Tutorial by Examples: al

Behat/Mink Install using composer (for other methods check ) behat.org If you using linux, please go sure that you have installed php-curl (normal curl installation won't work) Linux sudo apt-get install php5-curl If you are using Windows, make sure you have PHP, Curl and Git installed. You...
Deconstructing the use of an unsafe pointer in the Swift library method; public init?(validatingUTF8 cString: UnsafePointer<CChar>) Purpose: Creates a new string by copying and validating the null-terminated UTF-8 data referenced by the given pointer. This initializer does not try to rep...
See Ellie for a working example. This example uses the NoRedInk/elm-decode-pipeline module. Given a list of JSON objects, which themselves contain lists of JSON objects: [ { "id": 0, "name": "Item 1", "transactions": [ { "id&quo...
An Albers projection, or more properly, an Albers equal area conic projection, is a common conical projection and an official projeciton of a number of jurisdictions and organizations such as the US census bureau and the province of British Columbia in Canada. It preserves area at the expense of oth...
The XAML file for the spirograph parameters is below. It includes three text boxes for the spirograph parameters and a group of three radio buttons for color. When we give radio buttons the same group name - as we have here - WPF handles the on/off switching when one is selected. <!-- This fi...
Transcript show: 'Hello World!'. This will print Hello World! to the Transcript window in Smalltalk. Transcript is the class that allows you to print to the Transcript window by sending the message show: to that object. The colon indicates that this message requires a parameter which is in this c...
In MVC, there are some scenerios where you want to specify an action for routing purposes, either for a link, form action, or a redirect to action. You can specify an action via the MVC namespace. When given a Controller, such as HomeController: public class HomeController : Controller { pub...
By unlisted package, I mean a package that is not available through Package Control (yet). So, you can't find it in packagecontrol.io. BUT, you can still install it using Package Control, so you'll get all the advantages. For example, they'll be automatically updated, just like a "regular&quot...
Main Component File: //our root app component import {Component, NgModule, ViewChild, ViewContainerRef, ComponentFactoryResolver, ComponentRef} from '@angular/core' import {BrowserModule} from '@angular/platform-browser' import {ChildComponent} from './childComp.ts' @Component({ selector: ...
Caveat: alloca is only mentioned here for the sake of completeness. It is entirely non-portable (not covered by any of the common standards) and has a number of potentially dangerous features that make it un-safe for the unaware. Modern C code should replace it with Variable Length Arrays (VLA). Ma...
Generally most of the exceptions are not that critical, but there are some really serious exceptions that you might not be capable to handle, such as the famous System.StackOverflowException. However, there are others that might get hidden by Catch ex As Exception, such as System.OutOfMemoryExceptio...
Objective-C NSMutableAttributedString *mutAttString = @"string goes here"; NSRange range = NSMakeRange(0, mutAttString.length); [mutAttString setAttributes:@{} range:originalRange]; As per Apple Documentation we use, setAttributes and not addAttribute. Swift mutAttString.setAttribu...
Given an 'albums' collection, you can loop through and output each item: {% for album in site.albums %} {{ album.content }} {% endfor %} Any custom front matter variables are also available within the loop. {% for album in site.albums %} {{ album.title }} {{ album.content }} {%...
For this example, an Ordered Collection will be used to show the different messages that can be sent to an OrderedCollection object to loop over the elements.The code below will instantiate an empty OrderedCollection using the message new and then populate it with 4 numbers using the message add: a...
Detailed instructions on getting rebol set up or installed. The most mature and stable version of Rebol is the official Rebol2, available from the downloads page for multiple platforms. There are 2 flavors: Rebol/View (version with gui, ~ 0.6 MB) Rebol/Core (no gui, for servers, ~ 0.3 MB) ...
Always use Named Arguments to optional parameters, to avoid potential bugs when the method is modified. class Employee { public string Name { get; private set; } public string Title { get; set; } public Employee(string name = "<No Name>", string title = "&lt...
Detailed instructions on getting c#-4.0 set up or installed.
You can load AngularJS services in vanilla JavaScript using AngularJS injector() method. Every jqLite element retrieved calling angular.element() has a method injector() that can be used to retrieve the injector. var service; var serviceName = 'myService'; var ngAppElement = angular.element(do...
After a while, you end up with many configuration items in your config.yml. It can make you configuration easier to read if you split your configuration across multiple files. You can easily include all files from a directory this way: config.yml: imports: - { resource: parameters.yml } ...
In many examples, you will find a service id like 'acme.demo.service.id' (a string with dots). You services.yml will look like this: services: acme.demo.service.id: class: Acme\DemoBundle\Services\DemoService arguments: ["@doctrine.orm.default_entity_manager", &quot...

Page 229 of 269