Tutorial by Examples: by

In features/step_definitions/documentation.rb: When /^I go to the "([^"]+)" documentation$/ do |section| path_part = case section when "Documentation" "documentation" else raise "Unknown documentation section: #{section...
@Entity @Table(name="FOO") public class Foo { private UUID fooId; @OneToOne(cascade = CascadeType.ALL) @JoinColumn(name = "barId") private Bar bar; } @Entity @Table(name="BAR") public class Bar { private UUID barId; ...
<C-^> will switch to and from the previous edited file. On most keyboards <C-^> is CTRL-6. 3<C-^> will switch to buffer number 3. This is very quick, but only if you know the buffer number. You can see the buffer numbers from :ls or from a plugin such as MiniBufExplorer.
In Julia, as in many other languages, it is possible to interpolate by inserting values defined by variables into strings. For a simple example: n = 2 julia> MyString = "there are $n ducks" "there are 2 ducks" We can use other types than numeric, e.g. Result = false j...
ActiveRecord pattern was popularized by Rails. It's the default ORM there. Conventions Rails ActiveRecord is driven by conventions: class names are mapped to table names, field names are mapped to field names, foreign and primary keys should be named accordingly. These conventions can be overridde...
NSArray *aryFName = @[ @"Alice", @"Bob", @"Charlie", @"Quentin" ]; NSArray *aryLName = @[ @"Smith", @"Jones", @"Smith", @"Alberts" ]; NSArray *aryAge = @[ @24, @27, @33, @31 ]; //Create a Custom class with prope...
For example you want to use surfaceView in ng2-nativescript. As we don't have surfaceView in nativescript we should use placeholder. first we should import the requirements: import {Component} from "@angular/core"; import placeholder = require("ui/placeholder"); let applicat...
The orderBy() method specifies the ORDER BY fragment of a SQL query.For example consider our employee table having fields emp_id, emp_first_name, emp_last_name and emp_salary.Suppose we need to order the result by increasing order of employee salaries.We can do it in sql as given below. Select * fr...
def search_news_by_entity(location,timestamp): query = """ MATCH (n)-[]->(l) where l.name='%s' and n.timestamp='%s' RETURN n.news_id limit 10 """ query = query % (location,timestamp) news_ids = [] for res in graph.cypher.e...
Use the double negation syntax to check for truthiness of values. All values correspond to a boolean, irrespective of their type. irb(main):001:0> !!1234 => true irb(main):002:0> !!"Hello, world!" (irb):2: warning: string literal in condition => true irb(main):003:0> !...
JSON (JavaScript Object Notation) is a lightweight data interchange format. Many web applications use it to send and receive data. In Ruby you can simply work with JSON. At first you have to require 'json', then you can parse a JSON string via the JSON.parse() command. require 'json' j = '{&q...
Locating a Cocoa bundle using its path To obtain the bundle at a specific path using Cocoa, call the bundleWithPath: class method of the NSBundle NSBundle *myBundle; // obtain a reference to a loadable bundle myBundle = [NSBundle bundleWithPath:@"/Library/MyBundle.bundle...
The Ruby Version Manager is a command line tool to simply install and manage different versions of Ruby. rvm istall 2.3.1 for example installs Ruby version 2.3.1 on your machine. With rvm list you can see which versions are installed and which is actually set for use. user@dev:~$ rvm li...
JSON is a very strict format (see http://json.org). That makes it easy to parse and write for machines but surprises humans when an inconspicuous mistakes breaks the document. Common Problems Trailing Comma Unlike most programming languages your are not allowed to add a trailing comma: { a: 1...
=QUERY(QUERY(A1:D6,"select C,SUM(D) group by C",1),"select Col2>0",1)
Project is following the structure from the Angular2 Quickstart guide here. RootOfProject | +-- app | |-- app.component.ts | |-- main.ts | |-- pipeUser.component.ts | \-- sanitize.pipe.ts | |-- index.html |-- main.html |-- pipe.html main.ts import { bootstrap } from '@angu...
Set the NSFetchRequest property sortDescriptors to determine how data is returned. let fetchRequest = NSFetchRequest(entityName: "NAME_OF_ENTITY") let sortDescriptor = NSSortDescriptor(key: "NAME_OF_ATTRIBUTE", ascending: true) fetchRequest.sortDescriptors = [sortDescriptor] ...
Printing webview console messages to logcat To handle console messages from web page you can override onConsoleMessage in WebChromeClient: final class ChromeClient extends WebChromeClient { @Override public boolean onConsoleMessage(ConsoleMessage msg) { Log.d( &quot...
def make_unicode(data): if type(data) != unicode: data = data.decode('utf-8') return data else: return data
puts "Hello readers".reverse # => "sredaer olleH" class String def reverse "Hell riders" end end puts "Hello readers".reverse # => "Hell riders"

Page 14 of 23