Tutorial by Examples: e

You can create instance of objects in one of two ways: (java.awt.Point. 0 1) ;;=> => #object[java.awt.Point 0x3776d535 "java.awt.Point[x=0,y=1]"] Or (new java.awt.Point 0 1) ;;=> => #object[java.awt.Point 0x3776d535 "java.awt.Point[x=0,y=1]"]
You can call static methods like this: (System/currentTimeMillis) ;;=> 1469493415265 Or pass in arguments, like this: (System/setProperty "foo" "42") ;;=> nil (System/getProperty "foo") ;;=> "42"
You can call a Clojure function from Java code by looking up the function and invoking it: IFn times = Clojure.var("clojure.core", "*"); times.invoke(2, 2); This looks up the * function from the clojure.core namespace and invokes it with the arguments 2 & 2.
The macro() function allows you to add new functionality to Illuminate\Support\Collection objects Usage: Collection::macro("macro_name", function ($parameters) { // Your macro }); For example: Collection::macro('uppercase', function () { return $this->map(function ($i...
Also known as triple equals. This operator does not test equality, but rather tests if the right operand has an IS A relationship with the left operand. As such, the popular name case equality operator is misleading. This SO answer describes it thus: the best way to describe a === b is "if I ...
Goto https://atom.io/ and install the atom editor. Then install some Atom packages for easier Titanium coding: NameTypeFeaturestitanium language javascriptLanguageJS Autocomplete (non alloy)Titanium Alloyadd-onAll-in-one packageJump to definitionOpen relatedTSS HighlightTi-Createadd-onCreate proje...
We are just creating an empty Alloy app using CLI and Atom. Open a new terminal and add the following: ti create --id com.test -d . -n APPNAME -p all -t app -u http://migaweb.de cd APPNAME/ alloy new This will create a basic app (name: APPNAME, bundle identifier: com.test, type: app, platform...
There are several ways to compile your app. You can use the simulator/emulator, deploy it to your device or create store apk's/ipa's. There is also a live test tool (TiShadow) which saves you a lot of time waiting for the compiler. cli way # android to device ti build -p android -T device # a...
Is the relative path to the file from the current execution directory Assume we have this directory structure: /home/stackoverflow/script.rb script.rb contains: puts __FILE__ If you are inside /home/stackoverflow and execute the script like ruby script.rb then __FILE__ will output script.rb ...
Contains the name of the script being executed. Is the same as __FILE__ if you are executing that script.
Contains the subpattern from the corresponding set of parentheses in the last successful pattern matched, not counting patterns matched in nested blocks that have been exited already, or nil if the last pattern match failed. These variables are all read-only.
The standard error output. The default value for $stderr
The current standard error output.

ENV

The hash-like object contains current environment variables. Setting a value in ENV changes the environment for child processes.
Modules can contain other modules and classes: module Namespace module Child class Foo; end end # module Child # Foo can now be accessed as: # Child::Foo end # module Namespace # Foo must now be accessed as: # Namespace::Child::Foo
To create a gemset we need to create a .rvmrc file. Syntax: $ rvm --rvmrc --create <ruby-version>@<gemsetname> Example: $ rvm --rvmrc --create ruby-2.2.2@myblog The above line will create a .rvmrc file in the root directory of the app. To get the list of available gemsets, us...
This code opens a file for writing. Returns an error if the file couldn't be opened. Also closes the file at the end. #!/usr/bin/perl use strict; use warnings; use open qw( :encoding(UTF-8) :std ); # Make UTF-8 default encoding # Open "output.txt" for writing (">") and ...
The permutation method, when called with a block yields a two dimensional array consisting of all ordered sequences of a collection of numbers. If this method is called without a block, it will return an enumerator. To convert to an array, call the to_a method. ExampleResult[1,2,3].permutation#&lt...
Example Podfile: target 'MyProject' do pod 'AWSS3' pod 'RealmSwift' end and if you wanted to remove RealmSwift, remove that line from your Podfile target 'MyProject' do pod 'AWSS3' end then from the command line run $ pod install and CocoaPods will remove RealmSwift.
DatabaseTransactions trait allows databases to rollback all the change during the tests. If you want to rollback multiple databases , you need to set $connectionsToTransact properties use Illuminate\Foundation\Testing\DatabaseMigrations; class ExampleTest extends TestCase { use Databas...

Page 480 of 1191