Tutorial by Examples

In many cases, for instance when using web views in table view cells, it's important to determine the content size of the rendered HTML page. After loading the page, this can be calculated in the UIWebViewDelegate delegate method: - (void) webViewDidFinishLoad:(UIWebView *) aWebView { CGRect f...
[ alias ] ignored = ! git ls-files --others --ignored --exclude-standard --directory \ && git ls-files --others -i --exclude-standard Shows one line per file, so you can grep (only directories): $ git ignored | grep '/$' .yardoc/ doc/ Or count: ~$ git ignored | ...
Sometimes you may want maintain versions of a git repository on machines that have no network connection. Bundles allow you to package git objects and references in a repository on one machine and import those into a repository on another. git tag 2016_07_24 git bundle create changes_between_tags...
The year, month or day components of a DATE data type can be found using the EXTRACT( [ YEAR | MONTH | DAY ] FROM datevalue ) SELECT EXTRACT (YEAR FROM DATE '2016-07-25') AS YEAR, EXTRACT (MONTH FROM DATE '2016-07-25') AS MONTH, EXTRACT (DAY FROM DATE '2016-07-25') AS DAY FROM D...
Create new Jekyll Post To create a new Jekyll Post, create a new file on _posts directory with the format YYYY-MM-DD-title.MARKUP Replace MARKUP with the file extension for the language you want to use. This is usually Markdown(.md or .markdown) or HTML(.html). _posts/2017-01-01-hello-jekyll.m...
The Jekyll gem makes a jekyll executable available to you in your Terminal window. You can use this command in a number of ways: $ jekyll build # => The current folder will be generated into ./_site $ jekyll build --destination <destination> # => The current folder will be generate...
In some cases you might want to add an additional description to an enum value, for instance when the enum value itself is less readable than what you might want to display to the user. In such cases you can use the System.ComponentModel.DescriptionAttribute class. For example: public enum Possibl...
Installing Appcelerator Titanium At first we need to set up Titanium: command-line tools (CLI) to compile the apps the MVC framework Alloy the SDK The main parts are installed using the node.js package manager 'npm'. Check https://nodejs.org/ if you need to install it. Linux (Fedora) If y...
GitHub offers unlimited hosting for users or organizations and project site. Both Jekyll and static files are available. Here are the steps in hosting your Jekyll blog on Github. Setup Users or organizations site Create a repository named username.github.io, where username is your username (or...
For testing purposes, you can host your blog on your local machine. After setting up and making any changes, Jekyll can server the blog to http://localhost:4000. On the command line in the root directory of the project, run: $ bundle exec jekyll serve The bundle exec part is optional, but if you...
Detecting the current state of the network connection and responding to any changes that might occur, can be done by using one of several plugins. This example is about the cordova-plugin-network-information plugin. Add the plugin to the project: cordova plugin add cordova-plugin-network-informati...
Gizmos are used for drawing shapes in the scene view. You can use these shapes to draw extra information about your GameObjects, for instance the frustum they have or the detection range. Below are two examples on how to do this Example One This example uses the OnDrawGizmos and OnDrawGizmosSel...
echo "Prints only the matching part of the lines" | grep -o "matching" # prints matching
$sce ("Strict Contextual Escaping") is a built-in angular service that automatically sanitize content and internal sources in templates. injecting external sources and raw HTML into the template requires manual wrapping of$sce. In this example we'll create a simple $sce sanitation f...
string s1 = "string1"; string s2 = "string2"; string s3 = s1 + s2; // "string1string2"
Concatenating strings using a StringBuilder can offer performance advantages over simple string concatenation using +. This is due to the way memory is allocated. Strings are reallocated with each concatenation, StringBuilders allocate memory in blocks only reallocating when the current block is e...
The String.Join method can be used to concatenate multiple elements from a string array. string[] value = {"apple", "orange", "grape", "pear"}; string separator = ", "; string result = String.Join(separator, value, 1, 2); Console.WriteLine(resu...
The $http service is a function which generates an HTTP request and returns a promise. General Usage // Simple GET request example: $http({ method: 'GET', url: '/someUrl' }).then(function successCallback(response) { // this callback will be called asynchronously // when the respo...
HTTP requests are widely used repeatedly across every web app, so it is wise to write a method for each common request, and then use it in multiple places throughout the app. Create a httpRequestsService.js httpRequestsService.js appName.service('httpRequestsService', function($q, $http){ ...
Counting rows based on a specific column value: SELECT category, COUNT(*) AS item_count FROM item GROUP BY category; Getting average income by department: SELECT department, AVG(income) FROM employees GROUP BY department; The important thing is to select only columns specified in the GRO...

Page 480 of 1336