Tutorial by Examples

To convert decimal number to binary format use base 2 Int32 Number = 15; Console.WriteLine(Convert.ToString(Number, 2)); //OUTPUT : 1111 To convert decimal number to octal format use base 8 int Number = 15; Console.WriteLine(Convert.ToString(Number, 8)); //OUTPUT : 17 To conv...
The most feasible way is to use, the DateTime class. An example: <?php // Create a date time object, which has the value of ~ two years ago $twoYearsAgo = new DateTime("2014-01-18 20:05:56"); // Create a date time object, which has the value of ~ now $now = new DateTime("2016...
Specially useful for has_and_belongs_to_many relation, you can manually create a join table using the create_table method. Suppose you have two models Tags and Proyects, and you'd like to associate them using a has_and_belongs_to_many relation. You need a join table to associate instances of both c...
A GridLayout is a layout manager which places components inside a grid with equal cell sizes. You can set the number of rows, columns, the horizontal gap and the vertical gap using the following methods: setRows(int rows) setColumns(int columns) setHgap(int hgap) setVgap(int vgap) or you ca...
{foo: 'bar', biz: 'baz'}.keys # => [:foo, :biz] {foo: 'bar', biz: 'baz'}.values # => ["bar", "baz"] {foo: 'bar', biz: 'baz'}.to_a # => [[:foo, "bar"], [:biz, "baz"]] {foo: 'bar', biz: 'baz'}.each #<Enumerator: {:foo=>"bar", :b...
#define UNICODE #define _UNICODE #include <windows.h> #include <tchar.h> const TCHAR CLSNAME[] = TEXT("helloworldWClass"); LRESULT CALLBACK winproc(HWND hwnd, UINT wm, WPARAM wp, LPARAM lp); int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, PTSTR cmdline, ...
Highchart by default puts a credits label in the lower right corner of the chart. This can be removed using credits option in your chart settings. credits: { enabled: false } Or credits: false will remove the highcharts.com logo.
CSS styles for the credits label. Defaults to: credits: { style: { cursor: 'pointer', color: '#909090', fontSize: '10px' } },
Position configuration for the credits label. Supported properties are align, verticalAlign, x and y. Defaults to: credits: { position: { align: 'right', x: -10, verticalAlign: 'bottom', y: -5 } },
The URL for the credits label. Defaults to: http://www.highcharts.com. credits: { text: 'StackOverflow.com', href: 'http://stackoverflow.com' },
GetLastError returns a numerical error code. To obtain a descriptive error message (e.g., to display to a user), you can call FormatMessage: // This functions fills a caller-defined character buffer (pBuffer) // of max length (cchBufferLength) with the human-readable error message // for a Win32 ...
C11 Queries the alignment requirement for the specified type. The alignment requirement is a positive integral power of 2 representing the number of bytes between which two objects of the type may be allocated. In C, the alignment requirement is measured in size_t. The type name may not be an inco...
Object oriented style Connect to Server $conn = new mysqli("localhost","my_user","my_password"); Set the default database: $conn->select_db("my_db"); Connect to Database $conn = new mysqli("localhost","my_user","my_password&q...
The query function takes a valid SQL string and executes it directly against the database connection $conn Object oriented style $result = $conn->query("SELECT * FROM `people`"); Procedural style $result = mysqli_query($conn, "SELECT * FROM `people`"); CAUTION A ...
PHP makes it easy to get data from your results and loop over it using a while statement. When it fails to get the next row, it returns false, and your loop ends. These examples work with mysqli_fetch_assoc - Associative array with column names as keys mysqli_fetch_object - stdClass object with ...
When we are finished querying the database, it is recommended to close the connection to free up resources. Object oriented style $conn->close(); Procedural style mysqli_close($conn); Note: The connection to the server will be closed as soon as the execution of the script ends, unless it...
In sequence workflows, yield adds a single item into the sequence being built. (In monadic terminology, it is return.) > seq { yield 1; yield 2; yield 3 } val it: seq<int> = seq [1; 2; 3] > let homogenousTup2ToSeq (a, b) = seq { yield a; yield b } > tup2Seq ("foo", &qu...

for

for sequence expression is designed to look just like its more famous cousin, the imperative for-loop. It "loops" through a sequence and evaluates the body of each iteration into the sequence it is generating. Just like everything sequence related, it is NOT mutable. > let oneToTen = s...
Occasionally you may want to use the same tuple type in multiple places throughout your code. This can quickly get messy, especially if your tuple is complex: // Define a circle tuple by its center point and radius let unitCircle: (center: (x: CGFloat, y: CGFloat), radius: CGFloat) = ((0.0, 0.0), ...
The return statement in Bash doesn't return a value like C-functions, instead it exits the function with a return status. You can think of it as the exit status of that function. If you want to return a value from the function then send the value to stdout like this: fun() { local var="S...

Page 357 of 1336