Tutorial by Examples: f

A lot of Vim users find the Esc too hard to reach, and end up finding another mapping that's easy to reach from the home row. Note that Ctrl-[ may be equivalent to Esc on an English keyboard, and is much easier to reach. jk inoremap jk <ESC> This one is really easy to trigger; just smash...
The minification is used to reduce the size of CSS and Javascript files to speed up download times. This process is done by removing all of the unnecessary white-space, comments, and any other non-essential content from the files. This process is done automatically when using a ScriptBundle or a St...
A Stopwatch instance can measure elapsed time over several intervals with the total elapsed time being all individual intervals added together. This gives a reliable method of measuring elapsed time between two or more events. Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); double d =...
;Sends the keystroke for the letter "a" every 3 seconds. #Persistent SetTimer, SendLetterA, 3000 return SendLetterA() { Send, a }
This is an example of something that would have been straight up impossible with labels. If you execute the same label multiple times at the same time and they rely on variables that are being defined within them, they very likely interfere and cause unexpected behavior. Here is how to do it with f...
Consider the following example: type Company struct { Name string Location string } Hide/Skip Certain Fields To export Revenue and Sales, but hide them from encoding/decoding, use json:"-" or rename the variable to begin with a lowercase letter. Note that this prevents ...
Pipe operators are used to pass parameters to a function in a simple and elegant way. It allows to eliminate intermediate values and make function calls easier to read. In F#, there are two pipe operators: Forward (|>): Passing parameters from left to right let print message = print...
There are two ways to register a background page in the extension manifest. The scripts property In the common case, a background page doesn't require any HTML markup. We can register these kinds of background pages using the scripts property. In this case, a background page will be generated...
The ref keyword is used to pass an Argument as Reference. out will do the same as ref but it does not require an assigned value by the caller prior to calling the function. Ref Parameter :-If you want to pass a variable as ref parameter then you need to initialize it before you pass it as ref param...
In Swift, memory management is done for you automatically using Automatic Reference Counting. (See Memory Management) Allocation is the process of reserving a spot in memory for an object, and in Swift understanding the performance of such requires some understanding of the heap and the stack. The h...
This error occurs when tables are not adequately structured to handle the speedy lookup verification of Foreign Key (FK) requirements that the developer is mandating. CREATE TABLE `gtType` ( `type` char(2) NOT NULL, `description` varchar(1000) NOT NULL, PRIMARY KEY (`type`) ) ENGINE=InnoD...
While server side-code can run with elevated privileges, there is not an equivalent method to elevate privileges in client-side code (for obvious security reasons). As an alternative, you can specify credentials to emulate the access of a specific user or service account. To specify credentials, bu...
When testing for any of several equality comparisons: if a == 3 or b == 3 or c == 3: it is tempting to abbreviate this to if a or b or c == 3: # Wrong This is wrong; the or operator has lower precedence than ==, so the expression will be evaluated as if (a) or (b) or (c == 3):. The correct w...
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 +/ }
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, ...
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...

Page 179 of 457