Tutorial by Examples

Back references are used to match the same text previously matched by a capturing group. This both helps in reusing previous parts of your pattern and in ensuring two pieces of a string match. For example, if you are trying to verify that a string has a digit from zero to nine, a separator, such as...
JSHint is an open source tool which detects errors and potential problems in JavaScript code. To lint your JavaScript you have two options. Go to JSHint.com and paste your code in there on line text editor. Install JSHint in your IDE. Atom: linter-jshint (must have Linter plugin installed) ...
ESLint is a code style linter and formatter for your style guide much like JSHint. ESLint merged with JSCS in April of 2016. ESLint does take more effort to set up than JSHint, but there are clear instructions on their website for getting started. A sample configuration for ESLint is as follows: {...
JSLint is the trunk from which JSHint branched. JSLint takes a much more opinionated stance on how to write JavaScript code, pushing you towards only using the parts Douglas Crockford deems to be its "good parts", and away from any code that Crockford believes to have a better solution. Th...
To define the struct called Person with an integer type variable age, integer type variable height and float type variable ageXHeight: struct Person { int age; int height; float ageXHeight; } Generally: struct structName { /+ values go here +/ }
In D we can use constructors to initialize structs just like a class. To define a construct for the struct declared in the previous example we can type: struct Person { this(int age, int height) { this.age = age; this.height = height; this.ageXHeight = cast(float)age...
Verilog is a hardware description language (HDL) used to model electronic systems. It most commonly describes an electronic system at the register-transfer level (RTL) of abstraction. It is also used in the verification of analog circuits and mixed-signal circuits. Its structure and main principles ...
As a good developer you have created following struct with both exported and unexported fields: type MyStruct struct { uuid string Name string } Example in Playground: https://play.golang.org/p/Zk94Il2ANZ Now you want to Marshal() this struct into valid JSON for storage in somet...
As of GHC 7.10, Applicative is a superclass of Monad (i.e., every type which is a Monad must also be an Applicative). All the methods of Applicative (pure, <*>) can be implemented in terms of methods of Monad (return, >>=). It is obvious that pure and return serve equivalent purposes, ...
BAD CODE Dim f As System.Windows.Forms.Form f.ShowModal() GOOD CODE Dim f As System.Windows.Forms.Form = New System.Windows.Forms.Form ' Dim f As New System.Windows.Forms.Form ' alternative syntax f.ShowModal() EVEN BETTER CODE (Ensure proper disposal of IDisposable object more info) Us...
Function TestFunction() As TestClass Return Nothing End Function BAD CODE TestFunction().TestMethod() GOOD CODE Dim x = TestFunction() If x IsNot Nothing Then x.TestMethod() 14.0 Null Conditional Operator TestFunction()?.TestMethod()
When we are using "width" with media queries it is important to set the meta tag correctly. Basic meta tag looks like this and it needs to be put inside the <head> tag. <meta name="viewport" content="width=device-width,initial-scale=1"> Why this is impo...
NLTK requires Python versions 2.7 or 3.4+. These instructions consider python version - 3.5 Mac/Unix : Install NLTK: run sudo pip install -U nltk Install Numpy (optional): run sudo pip install -U numpy Test installation: run python then type import nltk NOTE : For older versions of P...
Ripple touch effect was introduced with material design in Android 5.0 (API level 21) and the animation is implemented by the new RippleDrawable class. Drawable that shows a ripple effect in response to state changes. The anchoring position of the ripple for a given state may be specified by call...
My.Computer.Network.DownloadFile("ftp://server.my/myfile.txt", "donwloaded_file.txt") This command download myfile.txt file from server named server.my and saves it as donwloaded_file.txt into working directory. You can specify absolute path for downloaded file.
My.Computer.Network.DownloadFile("ftp://srv.my/myfile.txt", "donwload.txt", "Peter", "1234") This command download myfile.txt file from server named srv.my and saves it as donwload.txt into working directory. You can specify absolute path for downloaded fil...
My.Computer.Network.UploadFile("example.txt", "ftp://server.my/server_example.txt") This command upload example.txt file from working directory (you could specify absolute path if you want) to server named server.my. File stored on the server will be named server_example.txt. ...
My.Computer.Network.UploadFile("doc.txt", "ftp://server.my/on_server.txt", "Peter", "1234") This command upload doc.txt file from working directory (you could specify absolute path if you want) to server named server.my. File stored on the server will be na...
index.html <button id="increment">Increment</button> <button id="decrement">Decrement</button> <p id="app"></p> index.js import { createStore } from 'redux'; function counter(state = 0, action) { switch (action.type) { ...
This example is inspired by this question. We'll assume you know how to load a file using the File API. // preliminary code to handle getting local file and finally printing to console // the results of our function ArrayBufferToBinary(). var file = // get handle to local file. var reader = new...

Page 547 of 1336