Tutorial by Examples: st

Detailed instructions on getting monogame set up or installed.
localStorage.length property returns an integer number indicating the number of elements in the localStorage Example: Set Items localStorage.setItem('StackOverflow', 'Documentation'); localStorage.setItem('font', 'Helvetica'); localStorage.setItem('image', 'sprite.svg'); Get length localSto...
A simple example on how to read a UTF text file synchronously. import flash.filesystem.File; import flash.filesystem.FileMode; import flash.filesystem.FileStream; //First, get a reference to the file you want to load var myFile:File = File.documentsDirectory.resolvePath("lifestory.txt&...
Declare the AppWidgetProvider class in your application's AndroidManifest.xml file. For example: <receiver android:name="ExampleAppWidgetProvider" > <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> </intent-filter&gt...
String concatenation is done simply by writing expressions next to one another without any operator. For example: BEGIN { user = "root" print "Hello "user "!" } will print: Hello root! Note that expressions do not have to be separated by whitespace.
Early bound (requires a reference to Microsoft Scripting Runtime): Public Sub EnumerateDirectory() Dim fso As Scripting.FileSystemObject Set fso = New Scripting.FileSystemObject Dim targetFolder As Folder Set targetFolder = fso.GetFolder("C:\") Dim foundFi...
This hook works similarly to the post-commit hook, but it's called whenever you successfully check out a reference with git checkout. This could be a useful tool for clearing out your working directory of auto-generated files that would otherwise cause confusion. This hook accepts three parameters:...
This hook is called immediately after the commit-msg hook. It cannot alter the outcome of the git commit operation, therefore it's used primarily for notification purposes. The script takes no parameters, and its exit status does not affect the commit in any way.
This hook is called after a successful push operation. It is typically used for notification purposes. The script takes no parameters, but is sent the same information as pre-receive via standard input: <old-value> <new-value> <ref-name>
This program illustrates how one can copy a file using readable and writable streams using the createReadStream(), and createWriteStream() functions provided by the file system module. //Require the file System module var fs = require('fs'); /* Create readable stream to file in current direc...
In Terminal on your Mac operating system, enter the following 2 commands: lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
INSTALLATION PROCESS You can install Node Version Manager using git, curl or wget. You run these commands in Terminal on Mac OSX. curl example: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash wget example: wget -qO- https://raw.githubusercontent.com/creatio...
pass is a null statement for when a statement is required by Python syntax (such as within the body of a for or while loop), but no action is required or desired by the programmer. This can be useful as a placeholder for code that is yet to be written. for x in range(10): pass #we don't want t...
This function casts a ray from point origin in direction direction of length maxDistance against all colliders in the scene. The function takes in the origin direction maxDistance and calculate if there is a collider in front of the GameObject. Physics.Raycast(origin, direction, maxDistance); F...
Sometimes it can be useful to set your application locale based upon the request IP. You can easily achieve this using Geocoder. Among the many things Geocoder does, it can also tell the location of a request. First, add Geocoder to your Gemfile # Gemfile gem 'geocoder' Geocoder adds location...
We can check the status of migrations by running 3.05.0 rake db:migrate:status 5.0 rails db:migrate:status The output will look like this: Status Migration ID Migration Name -------------------------------------------------- up 20140711185212 Create documentation pages up ...
Rails have very easy way to get first and last record from database. To get the first record from users table we need to type following command: User.first It will generate following sql query: SELECT `users`.* FROM `users` ORDER BY `users`.`id` ASC LIMIT 1 And will return following recor...
In order to compile and run SystemVerilog code a tool called a simulator is needed. Most commonly, commercial tools from one of the Big Three EDA companies is used: Cadence Incisive Mentor Graphics QuestaSim Synopsys VCS Other EDA vendors also provide simulators: Aldec Riviera-PRO Xilinx...
An easy way to clone an object is by implementing a copy constructor. public class Sheep { private String name; private int weight; public Sheep(String name, int weight) { this.name = name; this.weight = weight; } // copy constructor // copies...
If you want to create multiple uploads, first thing you might want to do is create new model and set up relations Let's say you want an multiple images for the Product model. Create an new model and make it belongs_to your parent model rails g model ProductPhoto #product.rb has_many :product_p...

Page 98 of 369