Tutorial by Examples: df

It is perfectly fine to use a package name other than the folder name. If we do so, we still have to import the package based on the directory structure, but after the import we have to refer to it by the name we used in the package clause. For example, if you have a folder $GOPATH/src/mypck, and i...
To convert String to and from Data / NSData we need to encode this string with a specific encoding. The most famous one is UTF-8 which is an 8-bit representation of Unicode characters, suitable for transmission or storage by ASCII-based systems. Here is a list of all available String Encodings Stri...
.gitignore and .git/info/exclude work only for untracked files. To set ignore flag on a tracked file, use the command update-index: git update-index --skip-worktree myfile.c To revert this, use: git update-index --no-skip-worktree myfile.c You can add this snippet to your global git config ...
Swift let isPushEnabled = UIApplication.sharedApplication().isRegisteredForRemoteNotifications()
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...
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 ++++++++++++-- ...
General syntax: DATEADD (datepart , number , datetime_expr) To add a time measure, the number must be positive. To subtract a time measure, the number must be negative. Examples DECLARE @now DATETIME2 = GETDATE(); SELECT @now; --2016-07-21 14:39:46.4170000 SELECT DAT...
PMF FOR THE BINOMIAL DISTRIBUTION Suppose that a fair die is rolled 10 times. What is the probability of throwing exactly two sixes? You can answer the question using the dbinom function: > dbinom(2, 10, 1/6) [1] 0.29071 PMF FOR THE POISSON DISTRIBUTION The number of sandwhich ordered in ...
The SilverStripe Grid Field Extensions Module has some very nice features to enhance the basic GridField... GridFieldAddExistingSearchButton - a more advanced search form for adding items GridFieldAddNewInlineButton - builds on GridFieldEditableColumns to allow inline creation of records. GridF...
The module Better Buttons for GridField adds new form actions and buttons to the GridField detail form. Save and add another: Create a record, and go right to adding another one, without having to click the back button, and then add again Save and close: Save the record and go back to list view ...
In performing parsing, before starting, the grammar for the language needs to be specified. A source of tokens is also needed for the parser. The parser could be hand-written code, or a parser generator tool could be used. If a parser generator tool is used, then that tool will need to be downloade...
Perl does not attempt to decode filenames returned by builtin functions or modules. Such strings representing filenames should always be decoded explicitly, in order for Perl to recognize them as Unicode. use v5.14; use Encode qw(decode_utf8); # Ensure that possible error messages printed to sc...
Most of the questions around ownership come up when writing functions. When you specify the types of a function's arguments, you may choose how that value is passed in. If you only need read-only access, you can take an immutable reference: fn foo(x: &String) { // foo is only authorized to...
using System; using System.Linq; using System.Security.Cryptography; namespace YourCryptoNamespace { /// <summary> /// Salted password hashing with PBKDF2-SHA1. /// Compatibility: .NET 3.0 and later. /// </summary> /// <remarks>See http://crackstation.net/h...
Suppose we want to read and stack a bunch of similarly-formatted files. The quick solution is: rbindlist(lapply(list.files(patt="csv$"), fread), id=TRUE) We might not be satisfied with this for a couple reasons: It might run into errors when reading with fread or when stacking with ...
CoffeeScript allows to deconstruct objects and arrays when they are fed to functions as arguments. A function that leverages deconstruction will specify in its signature all the fields that are expected within its body. When invoking such function, an object or array containing all the expected fie...
Create this class : public class InputFilterMinMax implements InputFilter { private int min, max; public InputFilterMinMax(int min, int max) { this.min = min; this.max = max; } public InputFilterMinMax(String min, String max) { this.min = Integer...
Map 'Mapping' across a collection uses the map function to transform each element of that collection in a similar way. The general syntax is: val someFunction: (A) => (B) = ??? collection.map(someFunction) You can provide an anonymous function: collection.map((x: T) => /*Do something wi...
For enabling ProGuard configurations for your application you need to enable it in your module level gradle file. you need to set the value of minifyEnabled true. You can also enable shrinkResources true which will remove resources that ProGuard flaggs as unused. buildTypes { release { ...
XSD schema (schema.xsd) The following xml schema (xsd) defines a list of users with attributes name and reputation. <?xml version="1.0"?> <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://www...

Page 9 of 21