Tutorial by Examples

This query returns all cones with either a mint scoop or a vanilla scoop. minty_vanilla_cones = IceCream.objects.filter(scoops__contained_by=[MINT, VANILLA])
In order to define a Set of your own type you need to conform your type to Hashable struct Starship: Hashable { let name: String var hashValue: Int { return name.hashValue } } func ==(left:Starship, right: Starship) -> Bool { return left.name == right.name } Now you can cr...
Create a Loader object: var loader:Loader = new Loader(); //import Add listeners on the loader. Standard ones are complete and io/security errors loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete); //when the loader is done loading, call this function loader.co...
Twilio's Node.JS API natively supports promises, allowing you to use promises when sending SMS messages (this example was taken and adapted directly from Twilio's API Docs). // Create an authenticated Twilio REST API client var twilio = require('twilio'); var client = new twilio.RestClient('ACCOU...
The browser function can be used like a breakpoint: code execution will pause at the point it is called. Then user can then inspect variable values, execute arbitrary R code and step through the code line by line. Once browser() is hit in the code the interactive interpreter will start. Any R code ...
Twilio help build apps that communicate with everyone in the world. Voice & Video, Messaging and Authentication APIs for every application. You can get an API key for free. To send a message through Twilio, your application needs to make an HTTP POST request to Twilio with the following things...
A yield statement is similar to a return statement, except that instead of stopping execution of the function and returning, yield instead returns a Generator object and pauses execution of the generator function. Here is an example of the range function, written as a generator: function gen_one_t...
pip install sqlalchemy For most common applications, particularly web applications, it is usually recommended that beginners consider using a supplementary library, such as flask-sqlalchemy. pip install flask-sqlalchemy
The FlagsAttribute should be used whenever the enumerable represents a collection of flags, rather than a single value. The numeric value assigned to each enum value helps when manipulating enums using bitwise operators. Example 1 : With [Flags] [Flags] enum Colors { Red=1, Blue=2, ...
In order to inspect an image, you can use the image ID or the image name, consisting of repository and tag. Say, you have the CentOS 6 base image: ➜ ~ docker images REPOSITORY TAG IMAGE ID CREATED SIZE centos centos6 cf2c3...
Parentheses are needed to avoid ambiguity: foo 1 |> bar 2 |> baz 3 Should be written as: foo(1) |> bar(2) |> baz(3)
String.prototype.toUpperCase(): console.log('qwerty'.toUpperCase()); // 'QWERTY'
String.prototype.toLowerCase() console.log('QWERTY'.toLowerCase()); // 'qwerty'
Token pasting allows one to glue together two macro arguments. For example, front##back yields frontback. A famous example is Win32's <TCHAR.H> header. In standard C, one can write L"string" to declare a wide character string. However, Windows API allows one to convert between wide c...
A predefined macro is a macro that is already understood by the C pre processor without the program needing to define it. Examples include Mandatory Pre-Defined Macros __FILE__, which gives the file name of the current source file (a string literal), __LINE__ for the current line number (an int...
Detailed instructions on getting ssl set up or installed.
/// <summary> /// Returns the data for the specified ID and timestamp. /// </summary> /// <param name="id">The ID for which to get data. </param> /// <param name="time">The DateTime for which to get data. </param> /// <returns>A Data...
To generate an XML documentation file from documentation comments in the code, use the /doc option with the csc.exe C# compiler. In Visual Studio 2013/2015, In Project -> Properties -> Build -> Output, check the XML documentation file checkbox: When you build the project, an XML file wi...
If you put your commonly used aliases into an .iex.exs file at the root of your app, IEx will load them for you on startup. alias App.{User, Repo}
Say you have a <textarea> and you want to retrieve info about the number of: Characters (total) Characters (no spaces) Words Lines function wordCount( val ){ var wom = val.match(/\S+/g); return { charactersNoSpaces : val.replace(/\s+/g, '').length, characte...

Page 207 of 1336