Tutorial by Examples: 2

DateTime date1 = new DateTime(2009, 8, 1, 0, 0, 0); DateTime date2 = new DateTime(2009, 8, 1, 12, 0, 0); int result = DateTime.Compare(date1, date2); string relationship; if (result < 0) relationship = "is earlier than"; else if (result == 0) relationship = "is the...
const int July = 7; const int Feb = 2; int daysInJuly = System.DateTime.DaysInMonth(2001, July); Console.WriteLine(daysInJuly); // daysInFeb gets 28 because the year 1998 was not a leap year. int daysInFeb = System.DateTime.DaysInMonth(1998, Feb); Console.WriteLine(daysInFeb); // daysIn...
Add years on the dateTime object: DateTime baseDate = new DateTime(2000, 2, 29); Console.WriteLine("Base Date: {0:d}\n", baseDate); // Show dates of previous fifteen years. for (int ctr = -1; ctr >= -15; ctr--) Console.WriteLine("{0,2} year(s) ago:{1:d}", ...
First, add relevant dependencies into the build.gradle file. dependencies { .... compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson:2.3.0' compile 'com.squareup.retrofit2:adapter-rxjava:2.3.0' .... } Then create the model you ...
using System.Runtime.InteropServices; class PInvokeExample { [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern uint MessageBox(IntPtr hWnd, String text, String caption, int options); public static void test() { MessageBox(IntPtr.Zero,...
function meridiem(d:Date):String { return (d.hours > 11) ? "pm" : "am"; }
Open your command console and execute the following commands: $ sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony $ sudo chmod a+x /usr/local/bin/symfony
To use the py2app framework you must install it first. Do this by opening terminal and entering the following command: sudo easy_install -U py2app You can also pip install the packages as : pip install py2app Then create the setup file for your python script: py2applet --make-setup MyAppli...
The predicate dif/2 is a pure predicate: It can be used in all directions and with all instantiation patterns, always meaning that its two arguments are different.
interface ITable { // an indexer can be declared in an interface object this[int x, int y] { get; set; } } class DataTable : ITable { private object[,] cells = new object[10, 10]; /// <summary> /// implementation of the indexer declared in the interface //...
When Intel produced the 80386, they upgraded from a 16-bit processor to a 32-bit one. 32-bit processing means two things: both the data being manipulated was 32-bit, and the memory addresses being accessed were 32-bit. To do this, but still remain compatible with their earlier processors, they intro...
if #available(iOS 9, *) { // iOS 9 } else { // iOS 8 or earlier }
Table Item The following class contains 2 properties a name (String) and the size (double). Both properties are wrapped in JavaFX properties to allow the TableView to observe changes. import javafx.beans.property.DoubleProperty; import javafx.beans.property.SimpleDoubleProperty; import javafx.be...
You can use the following extension method for comparing the contents of two IList< T > instances of the same type. By default the items are compared based on their order within the list and the items themselves, passing false to the isOrdered parameter will compare only the items themselves ...
This example will show you how to create a simple animation using the canvas and the 2D context. It is assumed you know how to create and add a canvas to the DOM and obtain the context // this example assumes ctx and canvas have been created const textToDisplay = "This is an example that uses...
Angular 2.0.0-rc.4 In this example we'll create a "Hello World!" app with only one root component (AppComponent) for the sake of simplicity. Prerequisites: Node.js v5 or later npm v3 or later Note: You can check versions by running node -v and npm -v in the console/terminal. ...
In MATLAB versions prior to R2014b, using the old HG1 graphics engine, it was not obvious how to create color coded 2D line plots. With the release of the new HG2 graphics engine arose a new undocumented feature introduced by Yair Altman: n = 100; x = linspace(-10,10,n); y = x.^2; p = plot(x,y,'r...
maplist/2 and maplist/3 are higher-order predicates, which allow the definition of a predicate to be lifted about a single element to lists of such elements. These predicates can be defined using call/2 and call/3 as building blocks and ship with many Prolog systems. For example: ?- maplist(dif(a)...
After creating an IAP in iTunesConnect: In the view controller that you want to buy in import StoreKit and add the relevant delegates class ViewController: UIViewController, SKProductsRequestDelegate, SKPaymentTransactionObserver { declare a variable with the product id from iTunesConnect ...
To get SSIS working for a SQL Server 2005 environment Acquire SQL Server 2005 (x86 or 64 bit) images. Mount the second disk and launch the installation wizard "Next" your way through the dialogs until you see see this screen. Under Client Components, ensure Business Intelligence De...

Page 2 of 21