Tutorial by Examples: e

(defun print-entry (key value) (format t "~A => ~A~%" key value)) (maphash #'print-entry *my-table*) ;; => NIL Using maphash allows to iterate over the entries of a hash table. The order of iteration is unspecified. The first argument is a function accepting two parameters: ...
Extractor behavior can be used to derive arbitrary values from their input. This can be useful in scenarios where you want to be able to act on the results of a transformation in the event that the transformation is successful. Consider as an example the various user name formats usable in a Window...
Map 'Mapping' across a collection uses the map function to transform each element of that collection in a similar way. The general syntax is: val someFunction: (A) => (B) = ??? collection.map(someFunction) You can provide an anonymous function: collection.map((x: T) => /*Do something wi...
Single slots are used when a child component only defines one slot within its template. The page component above uses a single slot to distribute content. An example of the page component's template using a single slot is below: <html> <head> <title>Page Title</t...
Slots offer a convenient way of distributing content from a parent component to a child component. This content can be anything from text, HTML or even other components. It can be helpful sometimes to think of slots as a means of injecting content directly into a child component's template. Slots ...
Named slots work similarly to single slots but instead allow you to distribute content to different regions within your child component template. Take the page component from the previous example but modify it's template so it is as follows: <html> <head> <title>Pag...
The variable command ensures that a given namespace variable is created. Until a value is assigned to it, the variable's value is undefined: namespace eval mynamespace { variable alpha set alpha 0 } The variable can be accessed from outside the namespace (from anywhere, in fact) by at...
Make sure you are in the directory that contains your Rails app, then create an app on Heroku. $ heroku create example Creating ⬢ example... done https://example.herokuapp.com/ | https://git.heroku.com/example.git The first URL of the ouput, http://example.herokuapp.com, is the location the ap...
Given these two CSV files: $ cat file1 1,line1 2,line2 3,line3 4,line4 $ cat file2 1,line3 2,line4 3,line5 4,line6 To print those lines in file2 whose second column occurs also in the first file we can say: $ awk -F, 'FNR==NR {lines[$2]; next} $2 in lines' file1 file2 1,line3 2,line4...
The -n flag enables you to check the syntax of a script without having to execute it: ~> $ bash -n testscript.sh testscript.sh: line 128: unexpected EOF while looking for matching `"' testscript.sh: line 130: syntax error: unexpected end of file
Download and install the WiX Toolset from wixtoolset.org. The installer for the WiX Toolset provides also the integration with Visual Studio, after the installation you should be able to create WiX specific projects. Warnings Admin rights are needed. Some versions of WiX are compatible only with...
Detailed instructions on getting asp.net-identity set up or installed.
Gradle will only run one task at a time by default, regardless of the project structure. By using the --parallel switch, you can force Gradle to execute independent subprojects - those that have no implicit or explicit project dependencies between one another - in parallel, allowing it to run multip...
The Gradle team works regularly on improving the performance of different aspects of Gradle builds. If you’re using an old version of Gradle, you’re missing out on the benefits of that work. Try upgrading to the latest version of Gradle to see what kind of impact it has. Doing so is low risk because...
If your routes file is overwhelmingly big, you can put your routes in multiple files and include each of the files with Ruby’s require_relative method: config/routes.rb: YourAppName::Application.routes.draw do require_relative 'routes/admin_routes' require_relative 'routes/sidekiq_routes' ...
Almost every function in C standard library returns something on success, and something else on error. For example, malloc will return a pointer to the memory block allocated by the function on success, and, if the function failed to allocate the requested block of memory, a null pointer. So you sho...
On Windows Download the Visual Studio Code installer for Windows. Once it is downloaded, run the installer (VSCodeSetup-version.exe). This will only take a minute. By default, VS Code is installed under C:\Program Files (x86)\Microsoft VS Code for a 64-bit machine. Note: .NET Framework 4.5.2...
String#at Returns a substring of a string object. Same interface as String#[]. str = "hello" str.at(0) # => "h" str.at(1..3) # => "ell" str.at(-2) # => "l" str.at(-2..-1) # => "lo" str.at(5) # => nil str.at(5..-...
String#to_time Converts a string to a Time value. The form parameter can be either :utc or :local, defaults to :local. "13-12-2012".to_time # => 2012-12-13 00:00:00 +0100 "06:12".to_time # => 2012-12-13 06:12:00 +0100 "2012-12-13 06...
String#exclude? The inverse of String#include? "hello".exclude? "lo" # => false "hello".exclude? "ol" # => true "hello".exclude? ?h # => false

Page 536 of 1191