Tutorial by Examples: ect

dependencies { compile 'com.google.code.gson:gson:2.8.1' } To use latest version of Gson The below line will compile latest version of gson library everytime you compile, you do not have to change version. Pros: You can use latest features, speed and less bugs. Cons: It might break com...
Add a init.gradle to your user gradle folder. The init.gradle is recognized on every project. Unix: ~/.gradle/init.gradle These are also alternative locations where init script can be placed and loaded automatically:- Any *.gradle file in USER_HOME/.gradle/init.d Any *.gradle file in t...
To get Array from any object, use Kernel#Array. The following is an example: Array('something') #=> ["something"] Array([2, 1, 5]) #=> [2, 1, 5] Array(1) #=> [1] Array(2..4) #=> [2, 3, 4] Array([]) #=> [] Array(nil) #=> [] 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
$> pwd /home/myUserHome $> cd .. $> pwd /home will print the current path to the console.
You can use a class to mimic the switch/case structure. The following is using introspection of a class (using the getattr() function that resolves a string into a bound method on an instance) to resolve the "case" part. Then that introspecting method is aliased to the __call__ method to ...
I created custom label with wrapper around FormattedText property: public class MultiComponentLabel : Label { public IList<TextComponent> Components { get; set; } public MultiComponentLabel() { var components = new ObservableCollection<TextComponent>(); ...
To know the path of the directory your file is in you can use: Esc to enter command mode :pwd This will print the path to the directory at the bottom of the editor, like this I'm a ninja ~ ~ ~ ~ ~ /home/ubuntu/myfolder 1,5 All Now...
To print the directory stack, use the command pushd without any parameters: @echo off cd C:\example\ pushd one pushd ..\two pushd ..\.. pushd echo Current Directory: %cd% echo: popd pushd three pushd echo Current Directory: %cd% Output: C:\example\two ...
This is a huge topic, but it is also the most important "performance" issue. The main lesson for a novice is to learn of "composite" indexes. Here's a quick example: INDEX(last_name, first_name) is excellent for these: WHERE last_name = '...' WHERE first_name = '...' AND ...
innodb_buffer_pool_size should be about 70% of available RAM.
For a Django project with requirements and deployment tools under source control. This example builds upon concepts from the Two Scoops of Django. They have published a template: repository/ docs/ .gitignore project/ apps/ blog/ migrations/ ...
Explicite selection A plotting style is usually selected using the with keyword, like plot x with points This allows to use different plotting styles for every plot: plot x with points, 2*x with lines Typing help with in the gnuplot command window gives a list of all available plotting styl...
A CSS rule consists of a selector (e.g. h1) and declaration block ({}). h1 {}
This example shows how a MongoDB collection can be displayed in a React component. The collection is continuously synchronized between server and client, and the page instantly updates as database contents change. To connect React components and Meteor collections, you'll need the react-meteor-data...
Chaining and Chainable is a design methodology used to design object behaviors so that calls to object functions return references to self, or another object, providing access to additional function calls allowing the calling statement to chain together many calls without the need to reference the v...
Selective imports can help to cleanup the namespace and speed-up the compile-time even more, because the compiler only needs to parse the specific, selected functions. import std.stdio: writeln; void main() { writeln("Hello world"); }
Selective imports may also be renamed. void main() { import std.stdio : fooln = writeln; fooln("Hello world"); }
You can re-use a moved object: void consumingFunction(std::vector<int> vec) { // Some operations } int main() { // initialize vec with 1, 2, 3, 4 std::vector<int> vec{1, 2, 3, 4}; // Send the vector by move consumingFunction(std::move(vec)); // Here...
var pattern = createPattern(imageObject,repeat) Creates a reusable pattern (object). The object can be assigned to any strokeStyle and/or fillStyle. Then stroke() or fill() will paint the Path with the pattern of the object. Arguments: imageObject is an image that will be used as a patter...

Page 43 of 99