Tutorial by Examples

Holy Grail layout is a layout with a fixed height header and footer, and a center with 3 columns. The 3 columns include a fixed width sidenav, a fluid center, and a column for other content like ads (the fluid center appears first in the markup). CSS Flexbox can be used to achieve this with a very s...
This is a minimalist Hello World example that uses only the most basic Android tools. Requirements and assumptions Oracle JDK 1.7 or later Android SDK Tools (just the command line tools) This example assumes Linux. You may have to adjust the syntax for your own platform. Setting up the And...
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...
Add the AppWidgetProviderInfo metadata in res/xml: <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="40dp" android:minHeight="40dp" android:updatePeriodMillis="86400000" android:previewImag...
The most important AppWidgetProvider callback is onUpdate(). It is called everytime an appwidget is added. public class ExampleAppWidgetProvider extends AppWidgetProvider { public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { final int N = a...
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.
Nine-patch images allow optional definition of the padding lines in the image. The padding lines are the lines on the right and at the bottom. If a View sets the 9-patch image as its background, the padding lines are used to define the space for the View's content (e.g. the text input in an EditTex...
This is MATLAB's long-winded way of saying that it cannot find the function that you're trying to call. There are a number of reasons you could get this error: That function was introduced after your current version of MATLAB The MATLAB online documentation provides a very nice feature which allow...
This example uses a search controller to filter the data inside a table view controller. The search bar is placed inside the navigation bar that the table view is embedded into. Embed a UITableViewController into a UINavigationController to get the UINavigationItem (which contains the navigation ...
This example uses a search controller to filter the cells in a table view controller. The search bar is placed inside the header view of the table view. The table view content is offset with the same height as the search bar so that the search bar is hidden at first. Upon scrolling up past the top e...
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...
A helper function to create a bitmap copy of an object. This can be used to convert vector objects, text or complex nested Sprite's to a flattened bitmap. function makeBitmapCopy(displayObj:IBitmapDrawable, transparent:Boolean = false, bgColor:uint = 0x00000000, smooth:Boolean = true):Bitmap { ...
Undo changes to a file or directory in the working copy. git checkout -- file.txt Used over all file paths, recursively from the current directory, it will undo all changes in the working copy. git checkout -- . To only undo parts of the changes use --patch. You will be asked, for each chang...
It is considered good practice to use a prefix when creating git archives, so that extraction will place all files inside a directory. To create an archive of HEAD with a directory prefix: git archive --output=archive-HEAD.zip --prefix=src-directory-name HEAD When extracted all the files will be...
It is also possible to create archives of other items than HEAD, such as branches, commits, tags, and directories. To create an archive of a local branch dev: git archive --output=archive-dev.zip --prefix=src-directory-name dev To create an archive of a remote branch origin/dev: git archive --...
With git archive it is possible to create compressed archives of a repository, for example for distributing releases. Create a tar archive of current HEAD revision: git archive --format tar HEAD | cat > archive-HEAD.tar Create a tar archive of current HEAD revision with gzip compression: gi...
MATLAB supports the use of logical masking in order to perform selection on a matrix without the use of for loops or if statements. A logical mask is defined as a matrix composed of only 1 and 0. For example: mask = [1 0 0; 0 1 0; 0 0 1]; is a logical matrix representing the identity matrix. ...
Creating a list from 1 to 10 is simple using range notation: [1..10] -- [1,2,3,4,5,6,7,8,9,10] To specify a step, add a comma and the next element after the start element: [1,3..10] -- [1,3,5,7,9] Note that Haskell always takes the step as the arithmetic difference between terms, and tha...
This hook is similar to the prepare-commit-msg hook, but it's called after the user enters a commit message rather than before. This is usually used to warn developers if their commit message is in an incorrect format. The only argument passed to this hook is the name of the file that contains the ...

Page 362 of 1336