Tutorial by Examples: ect

The following function can be used to get some basic information about the current browser and return it in JSON format. function getBrowserInfo() { var json = "[{", /* The array containing the browser info */ info = [ navigator.userA...
There are two common ways to encode a POST request body: URL encoding (application/x-www-form-urlencoded) and form data (multipart/form-data). Much of the code is similar, but the way you construct the body data is different. Sending a request using URL encoding Be it you have a server for your s...
Lets say we have a class Classy that has property Propertua public class Classy { public string Propertua {get; set;} } to set Propertua using reflection: var typeOfClassy = typeof (Classy); var classy = new Classy(); var prop = typeOfClassy.GetProperty("Propertua"); prop.Se...
The using keyword ensures that the resource defined within the statement only exists within the scope of the statement itself. Any resources defined within the statement must implement the IDisposable interface. These are incredibly important when dealing with any connections that implement the IDi...
An object can only be deallocated by delete if it was allocated by new and is not an array. If the argument to delete was not returned by new or is an array, the behavior is undefined. An object can only be deallocated by delete[] if it was allocated by new and is an array. If the argument to delet...
WITHOUT_ARRAY_WRAPPER option in FOR JSON clause will remove array brackets from the JSON output. This is useful if you are returning single row in the query. Note: this option will produce invalid JSON output if more than one row is returned. Input table data (People table) IdNameAge1John232J...
If you like to organize your project by keeping source files in different subdirectories, you should know that during a build qmake will not preserve this directory structure and it will keep all the ".o" files in a single build directory. This can be a problem if you had conflicting file ...
8 The proposed Object.entries() method returns an array of key/value pairs for the given object. It does not return an iterator like Array.prototype.entries(), but the Array returned by Object.entries() can be iterated regardless. const obj = { one: 1, two: 2, three: 3 }; Object...
LeakCanary is an Open Source Java library to detect memory leaks in your debug builds. Just add the dependencies in the build.gradle: dependencies { debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1' releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1' ...
Vital to using character sets is to tell the MySQL-server what encoding the client's bytes are. Here is one way: SET NAMES utf8mb4; Each language (PHP, Python, Java, ...) has its own way the it usually preferable to SET NAMES. For example: SET NAMES utf8mb4, together with a column declared CH...
The following example illustrates how to use CullingGroups to get notifications according to the distance reference point. This script has been simplified for brevity and uses several performance heavy methods. using UnityEngine; using System.Linq; public class CullingGroupBehaviour : Mono...
Following script illustrates how to receive events according to visibility to a set camera. This script uses several performance heavy methods for brevity. using UnityEngine; using System.Linq; public class CullingGroupCameraBehaviour : MonoBehaviour { CullingGroup localCullingGroup;...
module.exports.routes = { '/foo': '/bar', 'GET /google': 'http://www.google.com' };
Now that you have an object, it might be good to figure out what it is. You can use the Get-Member cmdlet to see what an object is and what it contains: Get-Item c:\windows | Get-Member This yields: TypeName: System.IO.DirectoryInfo Followed by a list of properties and methods the object ha...
Meteor reads a mobile-config.js file in the root of your app directory during build, and uses the settings specified there to generate Cordova’s config.xml. Project_folder ├── /.meteor └── mobile-config.js Most configurations can be achieved with mobile-config.js (app metadata, preferences, ...
// First load a product object $product->getSku(); $product->getName(); // Alternative method $product->getData('sku'); $product->getData('name');
// First load a collection object foreach($collection as $product) { $product->getSku(); $product->getName(); // Alternative method $product->getData('sku'); $product->getData('name'); }
In an iOS app, your user interface can take on one of a few different general shapes and sizes. These are defined using size classes, which are available through a view or view controller's trait collection. Apple defines two size classes: regular and compact. Each of these size classes are availab...
Making an app adaptive – that is, responding to size class changes by changing your layout – often involves lots of help from the Auto Layout system. One of the primary ways apps become adaptive is by updating the active Auto Layout constraints when a view's size class changes. For example, conside...
System.IO.Compression.ZipFile.CreateFromDirectory("myfolder", "archive.zip") Create archive.zip file containing files which are in myfolder. In example paths are relative to program working directory. You can specify absolute paths.

Page 46 of 99