Tutorial by Examples

package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; public class Main extends Sprite { //Document Class Main Constructor public function Main() { ...
NSString *urlString = @"https://www.stackoverflow.com"; NSURL *myUrl = [NSURL URLWithString: urlString]; NSURL *myUrl2 = [NSURL URLWithString: urlString]; if ([myUrl isEqual:myUrl2]) return YES;
Express JS is the goto framework for developing Web Applications, APIs and almost any kind of Backend using Node. To install express, all you have to do is run the npm command npm install express --save And you're done. To create and run a new express server create a file app.js and add this ...
One (or two) of the coolest new features in recent Xcode releases are the IBInspectable properties and IBDesignable UIViews. These have nothing to do with the functionality of your application but instead impact the developer experience in Xcode. The goal is to be able to visually inspect custom v...
You can run logcat as an adb command or directly in a shell prompt of your emulator or connected device. To view log output using adb, navigate to your SDK platform-tools/ directory and execute: $ adb logcat Alternatively, you can create a shell connection to a device and then execute: $ adb sh...
Detailed instructions on getting mapbox set up or installed.
A Hash includes the Enumerable module, which provides several iteration methods, such as: Enumerable#each, Enumerable#each_pair, Enumerable#each_key, and Enumerable#each_value. .each and .each_pair iterate over each key-value pair: h = { "first_name" => "John", "last_na...
SELECT e.Fname, e.LName FROM Employees e The Employees table is given the alias 'e' directly after the table name. This helps remove ambiguity in scenarios where multiple tables have the same field name and you need to be specific as to which table you want to return data from. SELECT e.Fname,...
If you want to get rid of the username field and use email as unique user identifier, you will have to create a custom User model extending AbstractBaseUser instead of AbstractUser. Indeed, username and email are defined in AbstractUser and you can't override them. This means you will also have to r...
Backbone requires Underscore and (optionally) jQuery - for DOM manipulation (using Backbone.View) and RESTful persistence. The quickest way to get up and running with Backbone is to create an index.html file with simple script tags in the HTML <head>: <html> <head> ...
Below you could find the table Employees with a reference to the table Cities. CREATE TABLE Cities( CityID INT IDENTITY(1,1) NOT NULL, Name VARCHAR(20) NOT NULL, Zip VARCHAR(10) NOT NULL ); CREATE TABLE Employees( EmployeeID INT IDENTITY (1,1) NOT NULL, FirstName VARCHA...
You can specify a column that contains dates so pandas would automatically parse them when reading from the csv pandas.read_csv('data_file.csv', parse_dates=['date_column'])
Read text file from path: val sc: org.apache.spark.SparkContext = ??? sc.textFile(path="/path/to/input/file") Read files using wildcards: sc.textFile(path="/path/to/*/*") Read files specifying minimum number of partitions: sc.textFile(path="/path/to/input/file&qu...
A recursive function is a function that calls itself in its definition. For example the mathematical function, factorial, defined by factorial(n) = n*(n-1)*(n-2)*...*3*2*1. can be programmed as def factorial(n): #n here should be an integer if n == 0: return 1 else: ...
When applied to a class, the sealed modifier prevents other classes from inheriting from it. class A { } sealed class B : A { } class C : B { } //error : Cannot derive from the sealed class When applied to a virtual method (or virtual property), the sealed modifier prevents this method (proper...
Used to obtain the size in bytes for an unmanaged type int byteSize = sizeof(byte) // 1 int sbyteSize = sizeof(sbyte) // 1 int shortSize = sizeof(short) // 2 int ushortSize = sizeof(ushort) // 2 int intSize = sizeof(int) // 4 int uintSize = sizeof(uint) // 4 int longSize = sizeof(long) // 8 ...
The static modifier is used to declare a static member, which does not need to be instantiated in order to be accessed, but instead is accessed simply through its name, i.e. DateTime.Now. static can be used with classes, fields, methods, properties, operators, events, and constructors. While an in...
C# has several operators that can be combined with an = sign to evaluate the result of the operator and then assign the result to the original variable. Example: x += y is the same as x = x + y Assignment operators: += -= *= /= %= &= |= ^= <<= >>=
For simple array comparison you can use JSON stringify and compare the output strings: JSON.stringify(array1) === JSON.stringify(array2) Note: that this will only work if both objects are JSON serializable and do not contain cyclic references. It may throw TypeError: Converting circular struct...
This example demonstrates that HTTP is a text-based Internet communications protocol, and shows a basic HTTP request and the corresponding HTTP response. You can use Telnet to manually send a minimal HTTP request from the command line, as follows. Start a Telnet session to the web server www.e...

Page 197 of 1336