Tutorial by Examples: e

Assume you want to create an extension property that is expensive to compute. Thus you would like to cache the computation, by using the lazy property delegate and refer to current instance (this), but you cannot do it, as explained in the Kotlin issues KT-9686 and KT-13053. However, there is an off...
cURL is the name of the project which depicts: 'Client for URLs' and also be called as Client URL Request Library it combines two separate packages: curl and libcurl. curl is a command line tool used to get documents/files from or send documents to a server, using any of the supported protocol...
Python 2.x2.3 python -m SimpleHTTPServer 9000 Python 3.x3.0 python -m http.server 9000 Running this command serves the files of the current directory at port 9000. If no argument is provided as port number then server will run on default port 8000. The -m flag will search sys.path for ...
A stream is closed by sending a closing </stream> tag. After the closing stream tag is sent, no more data should be sent on the stream (even in response to data received from the other party). Before closing the connection, the sending entity should wait for a response </stream> tag to g...
Once a TCP connection is established, the initial stream header is sent by the initiating entity. Similarly, whenever a stream restart is required (eg. after negotiating a security layer such as TLS) a stream header must also be sent: <?xml version='1.0'?> <stream:stream from='juliet...
The WHILE loop can be used as an alternative to CURSORS. The following example will print numbers from 0 to 99. DECLARE @i int = 0; WHILE(@i < 100) BEGIN PRINT @i; SET @i = @i+1 END
dplyr::filter() - Select a subset of rows in a data frame that meet a logical criteria: dplyr::filter(iris,Sepal.Length>7) # Sepal.Length Sepal.Width Petal.Length Petal.Width Species # 1 7.1 3.0 5.9 2.1 virginica # 2 7.6 3.0 ...
Displaying all the logs from the default buffer on the Command Line can be accomplished by: adb logcat This command will show you all the logs from the device's main buffer. Notice that if you use it for the first time, you'll get a lot of information, an enormous stream of data. So you may want...
Creates a new menu in the Spreadsheet UI. Each menu entry runs a user-defined function. var activeSheet = SpreadsheetApp.getActiveSpreadsheet(); var menuItems = []; // When the user clicks on "addMenuExample" then "Menu 1", the function Myfunction1 is executed. me...
To install dplyr simply type in the R console. install.packages("dplyr") And then to load dplyr, type library("dplyr") It's also possible to install the latest development version from Github with: if (packageVersion("devtools") < 1.6) { install.packages...
Python Windows The easiest way to install GTK3 for Python is by using PyGObject for Windows. It offers an installer that installs most things you need to develop GTK appilcations. The number of options the PyGObject installer offers can be daunting, but for most GTK projects the only option you h...
Use tuples in a switch let switchTuple = (firstCase: true, secondCase: false) switch switchTuple { case (true, false): // do something case (true, true): // do something case (false, true): // do something case (false, false): // do something } Or in combina...
Methods are inherited class A def boo; p 'boo' end end class B < A; end b = B.new b.boo # => 'boo' Class methods are inherited class A def self.boo; p 'boo' end end class B < A; end p B.boo # => 'boo' Constants are inherited class A WOO = 1 end class ...
git log --stat Example: commit 4ded994d7fc501451fa6e233361887a2365b91d1 Author: Manassés Souza <[email protected]> Date: Mon Jun 6 21:32:30 2016 -0300 MercadoLibre java-sdk dependency mltracking-poc/.gitignore | 1 + mltracking-poc/pom.xml | 14 ++++++++++++-- ...
This example is written with F# in mind but the ideas are applicable in all environments The first rule when optimizing for performance is to not to rely assumption; always Measure and Verify your assumptions. As we are not writing machine code directly it is hard to predict how the compiler an...
This error happens if a unknown object is used. Variables Not compiling: #include <iostream> int main(int argc, char *argv[]) { { int i = 2; } std::cout << i << std::endl; // i is not in the scope of the main function return 0; } Fix: #i...
This linker error happens, if the linker can't find a used symbol. Most of the time, this happens if a used library is not linked against. qmake: LIBS += nameOfLib cmake: TARGET_LINK_LIBRARIES(target nameOfLib) g++ call: g++ -o main main.cpp -Llibrary/dir -lnameOfLib One might also for...
The compiler can't find a file (a source file uses #include "someFile.hpp"). qmake: INCLUDEPATH += dir/Of/File cmake: include_directories(dir/Of/File) g++ call: g++ -o main main.cpp -Idir/Of/File
An interesting but rather unknown usage of Active Patterns in F# is that they can be used to validate and transform function arguments. Consider the classic way to do argument validation: // val f : string option -> string option -> string let f v u = let v = defaultArg v "Hello&quo...
F# uses the type keyword to create different kind of types. Type aliases Discriminated union types Record types Interface types Class types Struct types Examples with equivalent C# code where possible: // Equivalent C#: // using IntAliasType = System.Int32; type IntAliasType = int // ...

Page 508 of 1191