Tutorial by Examples: e

Create a new project with the Leiningen figwheel template: lein new figwheel hello-world Run Figwheel: cd hello-world lein figwheel After a moment it will start a development webserver and open the page in your browser. It also opens a Clojurescript REPL connected to the browser. Try enter...
When working with existing model that is quite big and is being regenerated quite often in cases where abstraction needed it might be costly to manually go around redecorating model with interfaces. In such cases one might want to add some dynamic behavior to model generation. Following example wil...
Logical operators in Lua don't "return" boolean, but one of their arguments. Using nil for false and numbers for true, here's how they behave. print(nil and nil) -- nil print(nil and 2) -- nil print(1 and nil) -- nil print(1 and 2) -- 2 print(nil or n...
:s/foo/bar/c Marks the first instance of foo on the line and asks for confirmation for substitution with bar :%s/foo/bar/gc Marks consecutively every match of foo in the file and asks for confirmation for substitution with bar
Some ADO.NET providers (most notably: OleDB) do not support named parameters; parameters are instead specified only by position, with the ? place-holder. Dapper would not know what member to use for these, so dapper allows an alternative syntax, ?foo?; this would be the same as @foo or :foo in other...
It's possible to pass Java objects to Nashorn engine to be processed in Java code. At the same time, there are some JavaScript (and Nashorn) specific constructions, and it's not always clear how they work with java objects. Below there is a table which describes behaviour of native Java objects ins...
User-defined method objects may be created when getting an attribute of a class (perhaps via an instance of that class), if that attribute is a user-defined function object, an unbound user-defined method object, or a class method object. class A(object): # func: A user-defined function object...
In C, a pointer can refer to another pointer. #include <stdio.h> #include <stdlib.h> int main(void) { int A = 42; int* pA = &A; int** ppA = &pA; int*** pppA = &ppA; printf("%d", ***pppA); /* prints 42 */ return EXIT_SUCCESS; } But, ref...
try (Realm realm = Realm.getDefaultInstance()) { realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { //whatever Transaction that has to be done } }); //No need to close realm in try-wit...
Debug Print shows the instance representation that is most suitable for debugging. print("Hello") debugPrint("Hello") let dict = ["foo": 1, "bar": 2] print(dict) debugPrint(dict) Yields >>> Hello >>> "Hello" >&gt...
ggplot(data = diamonds, aes(x = cut, fill =color)) + geom_bar(stat = "count", position = "dodge") it is possible to obtain an horizontal bar chart simply adding coord_flip() aesthetic to the ggplot object: ggplot(data = diamonds, aes(x = cut, fill =color)) + geom_ba...
angular .module('MyApp', []) .constant('VERSION', 1.0); Your constant is now declared and can be injected in a controller, a service, a factory, a provider, and even in a config method: angular .module('MyApp') .controller('FooterController', function(VERSION) { this.version = V...
There is no revolution here, but angular constant can be useful specially when your application and/or team starts to grow ... or if you simply love writing beautiful code! Refactor code. Example with event's names. If you use a lot of events in your application, you have event's names a lit...
The Hello world example is as simple as: awk 'BEGIN {print "Hello world"}' The most basic awk program consists of a true value (typically 1) and makes awk echo its input: $ date | awk '1' Mon Jul 25 11:12:05 CEST 2016 Since "hello world" is also a true value, you could a...
If you are unsure which rules to list in your .gitignore file, or you just want to add generally accepted exceptions to your project, you can choose or generate a .gitignore file: https://www.toptal.com/developers/gitignore https://github.com/github/gitignore Many hosting services such as Git...
Start a Script Block as background job: $job = Start-Job -ScriptBlock {Get-Process} Start a script as background job: $job = Start-Job -FilePath "C:\YourFolder\Script.ps1" Start a job using Invoke-Command on a remote machine: $job = Invoke-Command -ComputerName "ComputerName&...
async.parallel(tasks, afterTasksCallback) will execute a set of tasks in parallel and wait the end of all tasks (reported by the call of callback function). When tasks are finished, async call the main callback with all errors and all results of tasks. function shortTimeFunction(callback) { set...
async.series(tasks, afterTasksCallback) will execute a set of tasks. Each task are executed after another. If a task fails, async stops immediately the execution and jump into the main callback. When tasks are finished successfully, async call the "master" callback with all errors and all...
async.waterfall(tasks, afterTasksCallback) will execute a set of tasks. Each task are executed after another, and the result of a task is passed to the next task. As async.series(), if a task fails, async stop the execution and call immediately the main callback. When tasks are finished successfull...
Dropping the database is a simple one-liner statement. Drop database will delete the database, hence always ensure to have a backup of the database if required. Below is the command to drop Employees Database DROP DATABASE [dbo].[Employees]

Page 471 of 1191