Tutorial by Examples: ti

When creating a nested class, you face a choice of having that nested class static: public class OuterClass1 { private static class StaticNestedClass { } } Or non-static: public class OuterClass2 { private class NestedClass { } } At its core, static nested c...
This topic is intended for intermediate to advanced F# developers "What are Monads?" is a common question. This is easy to answer but like in Hitchhikers guide to galaxy we realize we don't understand the answer because we didn't know what we were asking after. Many believe the way to un...
To create a prefab, drag a game object from the scene hierarchy into the Assets folder or subfolder: The game object name turns blue, indicating it is connected to a prefab. Now this object is a prefab instance, just like an object instance of a class. A prefab can be deleted after instanti...
:mak[e][!] [arguments] will start the program referred to by the makeprg option. By default, makeprg is set to "make," but can be configured to invoke any appropriate program. All [arguments] (can be several) are passed to makeprg just as if it had been invoked with :!{makeprg} [arguments...
Note that many datatypes don't need to be quoted, since they evaluate to themselves. QUOTE is especially useful for symbols and lists, to prevent evaluation as Lisp forms. Example for other datatypes not needed to be quoted to prevent evaluation: strings, numbers, characters, CLOS objects, ... Her...
DateTime now = new DateTime.now(); DateTime berlinWallFell = new DateTime(1989, 11, 9); DateTime moonLanding = DateTime.parse("1969-07-20 20:18:00"); // 8:18pm You can find more in depth information here.
Detailed instructions on getting asp.net-web-api 2 set up or installed.
For sending and receiving events we first need an Event object. Event objects are actually simple POJOs. public class ArbitaryEvent{ public static final int TYPE_1 = 1; public static final int TYPE_2 = 2; private int eventType; public ArbitaryEvent(int eventType){ this....
variables var = 50 -- a global variable print(var) --> 50 do local var = 100 -- a local variable print(var) --> 100 end print(var) --> 50 -- The global var (50) still exists -- The local var (100) has gone out of scope and can't be accessed any longer. types num = 20 -- a ...
A patch is a file that show the differences between two revisions or between your local repository and the last revision your repository is pointing. To share or save a patch of your local uncommitted changes either for peer review or to apply later, do: svn diff > new-feature.patch To get a...
The key in vectorizing R code, is to reduce or eliminate "by row operations" or method dispatching of R functions. That means that when approaching a problem that at first glance requires "by row operations", such as calculating the means of each row, one needs to ask themselves...
C99 These functions returns the floating-point remainder of the division of x/y. The returned value has the same sign as x. Single Precision: #include <math.h> /* for fmodf() */ #include <stdio.h> /* for printf() */ int main(void) { float x = 10.0; float y = 5.1; ...
function transform(fn, arr) { let result = []; for (let el of arr) { result.push(fn(el)); // We push the result of the transformed item to result } return result; } console.log(transform(x => x * 2, [1,2,3,4])); // [2, 4, 6, 8] As you can see, our transform fun...
1. Passing integer data: SenderActivity Intent myIntent = new Intent(SenderActivity.this, ReceiverActivity.class); myIntent.putExtra("intVariableName", intValue); startActivity(myIntent); ReceiverActivity Intent mIntent = getIntent(); int intValue = mIntent.getIntExtra("intVa...
// Add active class to active navigation link $(document).ready(function () { $('ul.nav.navbar-nav').find('a[href="' + location.pathname + '"]') .closest('li').addClass('active'); });
In addition to the concept of column units, Bootstrap has different breakpoints or grid sizes known as tiers. The Bootstrap 3 grid has four (4) tiers to accomodate different screen (or viewport) widths. The Bootstrap 3 tiers are xs, sm, md, and lg. Bootstrap’s grid columns are identified by differen...
If you're doing multiple long calculations, you can run them at the same time on different threads on your computer. To do this, we make a new Thread and have it point to a different method. using System.Threading; class MainClass { static void Main() { var thread = new Thread(Seco...
using System.Threading; class MainClass { static void Main() { var thread = new Thread(Secondary); thread.Start("SecondThread"); } static void Secondary(object threadName) { System.Console.WriteLine("Hello World from thread: " + thread...
Environment.ProcessorCount Gets the number of logical processors on the current machine. The CLR will then schedule each thread to a logical processor, this theoretically could mean each thread on a different logical processor, all threads on a single logical processor or some other combination...
Sometimes, you want your threads to simultaneously share data. When this happens it is important to be aware of the code and lock any parts that could go wrong. A simple example of two threads counting is shown below. Here is some dangerous (incorrect) code: using System.Threading; class MainCl...

Page 167 of 505