Tutorial by Examples

public static void Main() { var xml = new XmlDocument(); var root = xml.CreateElement("element"); // Creates an attribute, so the element will now be "<element attribute='value' />" root.SetAttribute("attribute", "value"); ...
In this example database for a library, we have Authors, Books and BooksAuthors tables. Live example: SQL fiddle Authors and Books are known as base tables, since they contain column definition and data for the actual entities in the relational model. BooksAuthors is known as the relationship tabl...
ALTER TABLE Employees ALTER COLUMN StartingDate DATETIME NOT NULL DEFAULT (GETDATE()) This query will alter the column datatype of StartingDate and change it from simple date to datetime and set default to current date.
The editor.apply() method is asynchronous, while editor.commit() is synchronous. Obviously, you should call either apply() or commit(). 2.3 SharedPreferences settings = getSharedPreferences(PREFS_FILE, MODE_PRIVATE); SharedPreferences.Editor editor = settings.edit(); editor.putBoolean(PREF_CONS...
UDP is a connectionless protocol. Messages to other processes or computers are sent without establishing any sort of connection. There is no automatic confirmation if your message has been received. UDP is usually used in latency sensitive applications or in applications sending network wide broadca...
UDP is a connectionless protocol. This means that peers sending messages do not require establishing a connection before sending messages. socket.recvfromthus returns a tuple (msg [the message the socket received], addr [the address of the sender]) A UDP server using solely the socket module: from...
Sending data over the internet is made possible using multiple modules. The sockets module provides low-level access to the underlying Operating System operations responsible for sending or receiving data from other computers or processes. The following code sends the byte string b'Hello' to a TCP ...
In Python 2, an octal literal could be defined as >>> 0755 # only Python 2 To ensure cross-compatibility, use 0o755 # both Python 2 and Python 3

in

The in keyword has three uses: a) As part of the syntax in a foreach statement or as part of the syntax in a LINQ query foreach (var member in sequence) { // ... } b) In the context of generic interfaces and generic delegate types signifies contravariance for the type parameter in quest...
Use the Bash shell's filename expansion and brace expansion capabilities to obtain the filenames: # display the files and directories that are in the current directory printf "%s\n" * # display only the directories in the current directory printf "%s\n" */ # display only...
The following will list up to ten of the most recently modified files in the current directory, using a long listing format (-l) and sorted by time (-t). ls -lt | head
From NSString: NSString *str = @"Hello world"; NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding]; From Int: int i = 1; NSData *data = [NSData dataWithBytes: &i length: sizeof(i)]; You can also use the following methods: + dataWithContentsOfURL: + dataWithContentsO...
NSString *filePath = [[NSFileManager defaultManager] pathForRessorce: @"data" ofType:@"txt"]; NSData *data = [NSData dataWithContentsOfFile:filePath]; int len = [data length];
In this example we have an existing table, SuperHeros. This table contains a primary key ID. We will add a new table in order to store the powers of each super hero: CREATE TABLE HeroPowers ( ID int NOT NULL PRIMARY KEY, Name nvarchar(MAX) NOT NULL, HeroId int REFERENCES SuperHero...
NSDictionary *myDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil]; NSArray *copiedArray = myDictionary.copy; Get keys: NSArray *keys = [myDictionary allKeys]; Get values: NSArray *values = [myDic...
NSDictionary *myDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil]; NSData *myData = [NSKeyedArchiver archivedDataWithRootObject:myDictionary]; Reserve path: NSDictionary *myDictionary = (NSDictionary*...
NSDictionary *myDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil]; NSMutableDictionary *mutableDictionary = [myDictionary mutableCopy]; NSData *data = [NSJSONSerialization dataWithJSONObject:myDiction...
Swift import SystemConfiguration /// Class helps to code reuse in handling internet network connections. class NetworkHelper { /** Verify if the device is connected to internet network. - returns: true if is connected to any internet network, false if is not co...
Although D3 is not specific for handling SVG elements, it is widely used for creating and manipulating complex SVG based data visualizations. D3 provides many powerful methods which helps to create various geometrical SVG structures with ease. It is recommended to understand basic concepts of SVG s...
\bfoo\b will match the complete word with no alphanumeric and _ preceding or following by it. Taking from regularexpression.info There are three different positions that qualify as word boundaries: Before the first character in the string, if the first character is a word character. After...

Page 188 of 1336