Tutorial by Examples

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 // ...
Time and date come in a number of different types in Java: The now historic Date and Calendar, and the more recent LocalDate and LocalDateTime. And Timestamp, Instant, ZonedLocalDateTime and the Joda-time types. On the database side, we have time, date and timestamp (both time and date), possibly wi...
A container will stop if no command is running on the foreground. Using the -t option will keep the container from stopping, even when detached with the -d option. docker run -t -d debian bash
docker stop mynginx Additionally, the container id can also be used to stop the container instead of its name. This will stop a running container by sending the SIGTERM signal and then the SIGKILL signal if necessary. Further, the kill command can be used to immediately send a SIGKILL or any ot...
eof returns true only after reading the end of file. It does NOT indicate that the next read will be the end of stream. while (!f.eof()) { // Everything is OK f >> buffer; // What if *only* now the eof / fail bit is set? /* Use `buffer` */ } You could correctly write: ...
Simply presenting a window is easy with GTK and Python. The example below is based off the Python GTK3 Tutorial, which you should read if you are a beginner in GUI programming or GTK. import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk # Set up the Gtk window win = Gt...
You can specify different dependencies for each platforms: "net45": { "frameworkAssemblies": { "System.Linq": "4.1.0" } }, "netstandard1.3": { "dependencies": { "NETStandard.Library": "1.6....
Outline is a line that goes around the element, outside of the border. In contrast to border, outlines do not take any space in the box model. So adding an outline to an element does not affect the position of the element or other elements. In addition, outlines can be non-rectangular in some brows...
Using Derived column we can prepare the input. We will provide yyyy-MM-dd to the final conversion: Year: (DT_STR,4,1252)(DataDate / 10000) Month: (DT_STR,2,1252)(DataDate / 100 % 100) Day: (DT_STR,2,1252)(DataDate % 100) All together: (DT_DBDATE)((DT_STR,4,1252)(DataDate / 10000) + "-&q...
Using c# or vb.net code the conversion is even more simple. An output column is needed because we type can not be changed on the fly, alternative is adding an input column on forehand make it ReadWrite. Next code will fill the new column. public override void Input0_ProcessInputRow(Input0Buffer ...
int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int i; for(i = 0; i < 10; i++) { printf("%d\n", arr[i]); }
int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int i = 0; while(i < 10) { printf("%d\n", arr[i]); i++; }
int arr[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int i = 0; do { printf("%d\n", arr[i]); i++; } while (i < 10);

Page 575 of 1336