Tutorial by Examples: ect

To turn a Javascript Date object into a moment (moment object) just call moment and pass the Date as a argument moment(new Date()); // Moment {_isAMomentObject: true, _i: Sun Jul 31 2016 11:08:02 GMT+0300 (Jerusalem Daylight Time), _isUTC: false, _pf: Object, _locale: Locale…} To turn the momen...
PSR-5 proposes a form of Generics-style notation for collections. Generics Syntax Type[] Type<Type> Type<Type[, Type]...> Type<Type[|Type]...> Values in a Collection MAY even be another array and even another Collection. Type<Type<Type>> Type<Type<Type[,...
Defining the list of Ints trait IntList { ... } class Cons(val head: Int, val tail: IntList) extends IntList { ... } class Nil extends IntList { ... } but what if we need to define the list of Boolean, Double etc? Defining generic list trait List[T] { def isEmpty: Boolean def head:...
build.gradle repositories { maven { url 'http://4thline.org/m2' } } dependencies { // Cling compile 'org.fourthline.cling:cling-support:2.1.0' //Other dependencies required by Cling compile 'org.eclipse.jetty:jetty-server:8.1.18.v20150929' compile 'org.eclipse.jetty:jetty-servlet:8....
Usually the case when one wants to change a field type to another, for instance the original collection may have "numerical" or "date" fields saved as strings: { "name": "Alice", "salary": "57871", "dob": "198...
Android Studio -> Preferences -> Gradle -> Tick Offline work and then restart your Android studio. Reference screenshot:
Initial Creation and Download (CakePHP 3.x) The easiest way to create a new CakePHP project is via Composer (if you don't know about composer look here for more info) Install Composer If you need to install it and are on a windows machine follow this guide If you are on Linux/Unix/OSX follow thi...
Basic architecture examples on how development for embedded systems works (i.e. IDEs, cross-compiling, downloading, in-line debugging, JTAG,...) and what would be the minimum requirements for starting. It would be worth mentioning different approaches and platforms from begginers-higher level to ad...
Setup The tests below uses these values for the examples. val helloWorld = "Hello World" val helloWorldCount = 1 val helloWorldList = List("Hello World", "Bonjour Le Monde") def sayHello = throw new IllegalStateException("Hello World Exception") Type c...
Like patching of classes, you can also patch single objects. The difference is that only that one instance can use the new method. Example: Override a string object to provide parsing to boolean s = 'true' t = 'false' def s.to_b self =~ /true/ ? true : false end >> s.to_b =&...
To select an element by an exact HTML attribute use the css locator pattern [attribute=value] //selects the first element with href value '/contact' element(by.css('[href="/contact"]')); //selects the first element with tag option and value 'foo' element(by.css('option[value="f...
To select an element by an HTML attribute that contains a specified value use the css locator pattern [attribute*=value] //selects the first element with href value that contains'cont' element(by.css('[href*="cont"]')); //selects the first element with tag h1 and class attribute that...
2.04 Bash treats some paths as special and can do some network communication by writing to /dev/{udp|tcp}/host/port. Bash cannot setup a listening server, but can initiate a connection, and for TCP can read the results at least. For example, to send a simple web request one could do: exec 3</...
<PropertyGroup> <DirectoryToCreate>NewDirectory</DirectoryToCreate> </PropertyGroup> <MakeDir Directories="$(DirectoryToCreate)" />
<PropertyGroup> <DirectoryToRemove>TempData</DirectoryToRemove> </PropertyGroup> <RemoveDir Directories="$(DirectoryToRemove)" />
<PropertyGroup> <LinkedSolution>LinkedSolution.sln</LinkedSolution> <BuildType>Build</BuildType> <!-- Build / Rebuild --> <BuildArchitecture>x86</BuildArchitecture> <!-- x86 / 64 --> <BuildConfiguration>Debug</BuildCo...
Via jCenter including the following in your project's build.gradle file: compile 'com.google.android.exoplayer:exoplayer:rX.X.X' where rX.X.X is the your preferred version. For the latest version, see the project's Releases. For more details, see the project on Bintray.
Add the required libraries into the dependencies section of your Android module's build.gradle: android { ... defaultConfig { ... testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } dependencies { ... androidTestCompile 'com.android.su...
add_action( 'init', function() { // do something here } ); Using a function block to hook a set of instructions. With the init hook, the set of instructions will be executed right after wordpress has finished loading the necessary components.
class MyClass { function my_init_method() { // do something here } } $obj = new MyClass(); add_action( 'init', array( $obj, 'my_init_method' ) ); Using a method of an object to hook a set of instructions. With the init hook, the set of instructions will be executed right...

Page 64 of 99