Tutorial by Examples: c

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...
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...
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...
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){ ...
A value of a struct type can be written using a struct literal that specifies values for its fields. type Point struct { X, Y int } p := Point{1, 2} The above example specifies every field in the right order. Which is not useful, because programmers have to remember the exact fields in order. M...
The Ionic Platform offers a range of powerful, hybrid-focused mobile backend services and tools to make it easy to scale beautiful, performant hybrid apps, at a rapid pace. In order to use Ionic Platform you need to have the Ionic Framework installed. 1.) Registration (sign-up) You need to enter...
The "listener" or "observer" pattern is the most common strategy for creating asynchronous callbacks in Android development. public class MyCustomObject { //1 - Define the interface public interface MyCustomObjectListener { public void onAction(String ac...
var regExp = new RegExp(r"(\w+)"); var str = "Parse my string"; Iterable<Match> matches = regExp.allMatches(str); It's a good idea to use "raw strings" (prefix with r) when writing regular expressions so you can use unescaped backslashes in your expression. ...
If you want to keep on-premises copy of the Gradle and let the Wrapper use it in the builds, you can set the distributionUrl pointing to your copy on the wrapper task: task wrapper(type: Wrapper) { gradleVersion = '2.0' distributionUrl = "http\://server/dadada/gradle-${gradleVersion}...
I like to wrap my OkHttp into a class called HttpClient for example, and in this class I have methods for each of the major HTTP verbs, post, get, put and delete, most commonly. (I usually include an interface, in order to keep for it to implement, in order to be able to easily change to a different...
There are three types of code swaps that Instant run enables to support faster debugging and running app from your code in Android Studio. Hot Swap Warm Swap Cold Swap When are each of these swaps triggered? HOT SWAP is triggered when an existing method's implementation is changed. WARM SW...

Page 297 of 826