Tutorial by Examples: c

Jest is used by Facebook to test all JavaScript code including React applications. One of Jest's philosophies is to provide an integrated "zero-configuration" experience. We observed that when engineers are provided with ready-to-use tools, they end up writing more tests, which in turn res...
If you have a multidimensional array like this: [ ['foo', 'bar'], ['fizz', 'buzz'], ] And you want to change it to an associative array like this: [ 'foo' => 'bar', 'fizz' => 'buzz', ] You can use this code: $multidimensionalArray = [ ['foo', 'bar'], ...
The command syntax will be of the following type: <REST Verb> /<Index>/<Type>/<ID> Execute the following command to explore elasticsearch cluster through Kibana Console. For checking the cluster health GET /_cat/health?v For listing all the indices GET /_cat...
To get started go to root of project directory and run : $ sphinx-quickstart You will get options to create documentation for your project. For default setup follow below commands: Prompt Choice > Root path for the documentation [.]: <ENTER> > Separate source and build dire...
Elasticsearch provides data manipulation & data searching capabilities in almost real time. under this example, we have update, delete & batch processing operations. Updating the same document. Suppose we have already indexed a document on /car/external/1 . Then running the command for i...
In the beginning there were callbacks, and callbacks were ok: const getTemperature = (callback) => { http.get('www.temperature.com/current', (res) => { callback(res.data.temperature) }) } const getAirPollution = (callback) => { http.get('www.pollution.com/current', (res) ...
It is possible to specify a text hint when using EditTexts. Text hints are useful for conveying to the user what they should type in the EditText. In XML: <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="use...
In case of big data sets, the call of grepl("fox", test_sentences) does not perform well. Big data sets are e.g. crawled websites or million of Tweets, etc. The first acceleration is the usage of the perl = TRUE option. Even faster is the option fixed = TRUE. A complete example would be: ...
This example shows how to make an interactive presentation transition with "real-world" physics similar to iOS's notifications screen. To start with, we need a presenting view controller that the shade will appear over. This view controller will also act as our UIViewControllerTransitio...
The scatter function has two undocumented properties 'jitter' and 'jitterAmount' that allow to jitter the data on the x-axis only. This dates back to Matlab 7.1 (2005), and possibly earlier. To enable this feature set the 'jitter' property to 'on' and set the 'jitterAmount' property to the desired ...
Another convenient solution for cross compilation is the usage of gox: https://github.com/mitchellh/gox Installation The installation is done very easily by executing go get github.com/mitchellh/gox. The resulting executable gets placed at Go's binary directory, e.g. /golang/bin or ~/golang/bin. E...
Methods used: .DriveExists(strDrive) returns (True/False) .FileExists(strFile) returns (True/False) .FolderExists(strFolder) returns (True/False) The following code checks for the existence of a file using the "FileExists" method of a file system object. For checking the existence of...
Methods used: .DeleteFolder(FileSpec, Force (True/False)) .CreateFolder(Path) .DeleteFile(FileSpec, Force (True/False)) The following example illustrates the Deletion and creation of a folder using the methods "DeleteFolder" and "CreateFolder". Code: Dim strFolderPath, ob...
Methods Used: .CopyFile(Source, Dest [,Overwrite (True/False)] .CopyFolder(Source, Dest [,Overwrite (True/False)] The following code illustrates the use of CopyFile method to copy a file to a new location. The same thing can be achieved for the folders by using the CopyFolder method. Code: Di...
Methods used: .GetFolder(strPath) - Returns an object referring to the path We can set an object reference to a folder using the getFolder method and perform different operations on them. Code: Dim strFolderPath, objFso, objFolder strFolderPath = "C:\Users\GS\Desktop\LogsFolder" Se...
Methods Used: .GetFile(strPath) - Returns an object referring to a file. We can set an object reference to a file using the getFile method and perform different operations on them. Code: Dim strFilePath, objFso, objFile strFilePath = "C:\Users\GS\Desktop\LogsFolder\file.txt" Set ob...
As you would know, Hadoop can be run in the local environment in 3 different modes : Local Mode Pseudo Distributed Mode Fully Distributed Mode (Cluster) Typically you will be running your local hadoop setup in Pseudo Distributed Mode to leverage HDFS and Map Reduce(MR). However you cannot de...
As java provide two different commands to compile and run Java code. Same as Kotlin also provide you different commands. javac to compile java files. java to run java files. Same as kotlinc to compile kotlin files kotlin to run kotlin files.
This example shows how to customize the UIDynamicItem protocol to map position changes of a view being dynamically animated to bounds changes to create a UIButton that expands and contracts in a elastic fashion. To start we need to create a new protocol that implements UIDynamicItem but that also...
Redis-py provides the execute_command method to directly invoke Redis operations. This functionality can be used to access any modules that may not have a supported interface in the redis-py client. For example, you can use the execute_command to list all of the modules loaded into a Redis server:...

Page 780 of 826