Tutorial by Examples: al

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <line x1="10" y1="10" x2="100" y2="100" stroke="red" stroke-width="10" /> <line x1="100" y1="10&...
The XMPP network can be thought of as a bidirected graph with servers (S) operating in a mesh, clients (C) clustered about their local server, and streams represented by extraverted edges: When a client wants to send data (eg. a message or presence information) across the network to another clien...
Similar to SQL for doing your first steps in MDX you need to start by installing a Server. There are several servers available that are compatible with MDX (check wikipedia page) with a couple of them free or with a community edition. Once you've your server you'll have to create your schema, you ...
The .every method tests if all array elements pass a provided predicate test. To test all objects for equality, you can use the following code snippets. [1, 2, 1].every(function(item, i, list) { return item === list[0]; }); // false [1, 1, 1].every(function(item, i, list) { return item === list[0...
Simple Example (centering a single element) HTML <div class="aligner"> <div class="aligner-item">…</div> </div> CSS .aligner { display: flex; align-items: center; justify-content: center; } .aligner-item { max-width: 50%; /*for d...
This bidirectional mapping requires the mappedBy attribute on the OneToMany association and the inversedBy attribute on the ManyToOne association. A bidirectional relationship has both an owning and inverse side. OneToMany relationships can use join tables, so you have to specify an owning side. Th...
The @if control directive evaluates a given expression and if it returns anything other than false, it processes its block of styles. Sass Example $test-variable: true !default =test-mixin @if $test-variable display: block @else display: none .test-selector +test-mixin ...
HTML <div class="wrap"> <img src="http://lorempixel.com/400/200/" /> </div> CSS .wrap { height: 50px;/* max image height */ width: 100px; border: 1px solid blue; text-align: center; } .wrap:before { content:""; di...
If you want to convert the content of a part into a domain object (e.g. a User or Account or Address), then the process is very simple: It is possible to upload multiple parts, each with a different name. For each part name, you will need one parameter annotated with @RequestPart, whose name matche...
String literal types allow you to specify the exact value a string can have. let myFavoritePet: "dog"; myFavoritePet = "dog"; Any other string will give a error. // Error: Type '"rock"' is not assignable to type '"dog"'. // myFavoritePet = "rock&qu...
To view a pdf you can download Adobe reader for free . You can create pdfs programmatically with the help of, e.g by using iTextSharp, jsPDF or PDFSharp (there are other libraries available)
This code writes the string to a file. It is important to close the writer, so this is done in a finally block. public void writeLineToFile(String str) throws IOException { File file = new File("file.txt"); BufferedWriter bw = null; try { bw = new BufferedWriter(ne...
Meteor.call(name, [arg1, arg2...], [asyncCallback]) (1) name String (2) Name of method to invoke (3) arg1, arg2... EJSON-able Object [Optional] (4) asyncCallback Function [Optional] On one hand, you can do : (via Session variable, or via ReactiveVar) var syncCall = Meteor.call("my...
Prefer dict.get method if you are not sure if the key is present. It allows you to return a default value if key is not found. The traditional method dict[key] would raise a KeyError exception. Rather than doing def add_student(): try: students['count'] += 1 except KeyError: ...
First, add Mongoid to your Gemfile: gem "mongoid", "~> 4.0.0" and then run bundle install. Or just run: $ gem install mongoid After installation, run the generator to create the config file: $ rails g mongoid:config which will create the file (myapp)/config/mongoid...
Mongoid tries to have similar syntax to ActiveRecord when it can. It supports these calls (and many more) User.first #Gets first user from the database User.count #Gets the count of all users from the database User.find(params[:id]) #Returns the user with the id found in params[:id] User.w...
Like an HTTP request, an HTTP response may include additional headers to modify or augment the response it provides. A full list of available headers is defined in §6.2 of the specification. The most commonly-used headers are: Server, which functions like a User-Agent request header for the serv...
You will often find yourself with a collection of data where you are only interested in parts of the data. In the example below we got a list of participants at an event and we want to provide a the tour guide with a simple list of names. // First we collect the participants $participants = colle...
Collections also provide you with an easy way to do simple statistical calculations. $books = [ ['title' => 'The Pragmatic Programmer', 'price' => 20], ['title' => 'Continuous Delivery', 'price' => 30], ['title' => 'The Clean Coder', 'price' => 10], ] $min = col...
use-fixtures allows to wrap each deftest in namespace with code that runs before and after test. It can be used for fixtures or stubbing. Fixtures are just functions that take test function and run it with other necessary steps (before/after, wrap). (ns myapp.test (require [clojure.test :refer ...

Page 80 of 269