Tutorial by Examples: 4

// assigning a signed short to its minimum value short s = -32768; // assigning a signed short to its maximum value short s = 32767; // assigning a signed int to its minimum value int i = -2147483648; // assigning a signed int to its maximum value int i = 2147483647; // assigning a s...
// assigning an unsigned short to its minimum value ushort s = 0; // assigning an unsigned short to its maximum value ushort s = 65535; // assigning an unsigned int to its minimum value uint i = 0; // assigning an unsigned int to its maximum value uint i = 4294967295; // assigning an...
When it comes to adding/removing channels to/from your channel groups, you need to have must have the manage permission for those channel groups. But you should never grant clients the permission to manage the channel groups that they will subscribe to. If they did, then they could add any channel t...
var data = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACN' + 'byblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHx' + 'gljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='; var characters = atob(data); var array = new Uint8Array(characters.length); for (var i = 0; i < characters.length; i++) { array[i] ...
Occasionally you will find the need to encode binary data as a base64-encoded string. For this we can use the DatatypeConverter class from the javax.xml.bind package: import javax.xml.bind.DatatypeConverter; import java.util.Arrays; // arbitrary binary data specified as a byte array byte[] bi...
// Java: Arrays.stream(new int[] {1, 2, 3}) .map(n -> 2 * n + 1) .average() .ifPresent(System.out::println); // 5.0 // Kotlin: arrayOf(1,2,3).map { 2 * it + 1}.average().apply(::println)
select LastName, FirstName, from Person Returns message: Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from Person' at line 2. Getting a "1064 error" message from MySQL mean...
The HTML 4.01 specification provides several different types of doctypes that allow different types of elements to be specified within the document. HTML 4.01 Strict <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> Includes all...
Enums have been backported from Python 3.4 to Python 2.4 through Python 3.3. You can get this the enum34 backport from PyPI. pip install enum34 Creation of an enum is identical to how it works in Python 3.4+ from enum import Enum class Color(Enum): red = 1 green = 2 blue = 3 ...
404 responses are returned when a resource is not found on the server, in Symfony this status can be created by throwing a NotFoundHttpException exception. To avoid an extra use statement inside a controller use the createNotFoundException() provided by the Controller class <?php namespace Bu...
Suggested Install Method Windows: Download and run the binary setup file. Linux(Debian): Run this command in your command line: $ apt-get install python-qt4 pyqt4-dev-tools qt4-designer OS X : Run this command in your command line: $ brew install pyqt Install Manually You can also downloa...
The web.config system.web.httpRuntime must target 4.5 to ensure the thread will renter the request context before resuming your async method. <httpRuntime targetFramework="4.5" /> Async and await have undefined behavior on ASP.NET prior to 4.5. Async / await will resume on an arb...
Once the Symfony Installer is available, create your first Symfony application with the new command: # Linux, Mac OS X $ symfony new my_project_name # Windows c:\> cd projects/ c:\projects\> php symfony new my_project_name This command can be run from anywhere, not necessarily from t...
using System.Net; ... string serverResponse; try { // Call a method that performs an HTTP request (per the above examples). serverResponse = PerformHttpRequest(); } catch (WebException ex) { if (ex.Status == WebExceptionStatus.ProtocolError) { HttpWebResponse...
Represents a thread-safe collection of key/value pairs that can be accessed by multiple threads concurrently. Creating an instance Creating an instance works pretty much the same way as with Dictionary<TKey, TValue>, e.g.: var dict = new ConcurrentDictionary<int, string>(); Ad...
Rescue from record not found error instead of showing an exception or white page: class ApplicationController < ActionController::Base # ... your other stuff here rescue_from ActiveRecord::RecordNotFound do |exception| redirect_to root_path, 404, alert: 'Record not found' en...
AMD is a processor manufacturer that had licensed the design of the 80386 from Intel to produce compatible - but competing - versions. They made internal changes to the design to improve throughput or other enhancements to the design, while still being able to execute the same programs. To one-up I...
Encoding //Create a Base64 Encoded NSString Object NSData *nsdata = [@"iOS Developer Tips encoded in Base64" dataUsingEncoding:NSUTF8StringEncoding]; // Get NSString from NSData object in Base64 NSString *base64Encoded = [nsdata base64EncodedStringWithOptions:0]; // Print the B...
A fold (from the left) is a higher-order relation between: a predicate with 3 arguments a list of elements an initial state a final state, which is the result of applying the predicate to successive elements while carrying through intermediate states. For example: Use foldl/4 to express the...
Prerequisites In order to run Elasticsearch, a Java Runtime Environment (JRE) is required on the machine. Elasticsearch requires Java 7 or higher and recommends Oracle JDK version 1.8.0_73. Install Oracle Java 8 sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update echo "or...

Page 1 of 8