Tutorial by Examples: e

# this method can be anything and anywhere as long as it is accessible for connection @pyqtSlot() def run_on_complete(): pass # An object containing methods you want to run in a thread class Worker(QObject): complete = pyqtSignal() @pyqtSlot() def a_method_to_run...
A boolean represents the most basic datatype in TypeScript, with the purpose of assigning true/false values. // set with initial value (either true or false) let isTrue: boolean = true; // defaults to 'undefined', when not explicitely set let unsetBool: boolean; // can ...
Like JavaScript, numbers are floating point values. let pi: number = 3.14; // base 10 decimal by default let hexadecimal: number = 0xFF; // 255 in decimal ECMAScript 2015 allows binary and octal. let binary: number = 0b10; // 2 in decimal let octal: number = 0o755; // 493 in de...
A type to name a set of numeric values: Number values default to 0: enum Day { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday }; let bestDay: Day = Day.Saturday; Set a default starting number: enum TenPlus { Ten = 10, Eleven, Twelve } or assign values: enum MyOddSet { Thre...
Array type with known and possibly different types: let day: [number, string]; day = [0, 'Monday']; // valid day = ['zero', 'Monday']; // invalid: 'zero' is not numeric console.log(day[0]); // 0 console.log(day[1]); // Monday day[2] = 'Saturday'; // valid: [0, 'Saturday'] day[3] = fals...
Number formatting, grouping digits according to the localization. const usNumberFormat = new Intl.NumberFormat('en-US'); const esNumberFormat = new Intl.NumberFormat('es-ES'); const usNumber = usNumberFormat.format(99999999.99); // "99,999,999.99" const esNumber = esNumberFormat.form...
Currency formatting, grouping digits and placing the currency symbol according to the localization. const usCurrencyFormat = new Intl.NumberFormat('en-US', {style: 'currency', currency: 'USD'}) const esCurrencyFormat = new Intl.NumberFormat('es-ES', {style: 'currency', currency: 'EUR'}) const u...
Date time formatting, according to the localization. const usDateTimeFormatting = new Intl.DateTimeFormat('en-US'); const esDateTimeFormatting = new Intl.DateTimeFormat('es-ES'); const usDate = usDateTimeFormatting.format(new Date('2016-07-21')); // "7/21/2016" const esDate = esDateT...
Add one common horizontal line for all categorical variables # sample data df <- data.frame(x=('A', 'B'), y = c(3, 4)) p1 <- ggplot(df, aes(x=x, y=y)) + geom_bar(position = "dodge", stat = 'identity') + theme_bw() p1 + geom_hline(aes(yintercept=5), colour=...
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...
{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 ...
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...

Page 316 of 1191