Tutorial by Examples: f

We can destructure lists of compound objects CL-USER> (loop for (a . b) in '((1 . 2) (3 . 4) (5 . 6)) collect a) (1 3 5) CL-USER> (loop for (a . b) in '((1 . 2) (3 . 4) (5 . 6)) collect b) (2 4 6) CL-USER> (loop for (a b c) in '((1 2 3) (4 5 6) (7 8 9) (10 11 12)) collect b) (2 5 8 11...
package main import ( "fmt" "io/ioutil" ) func main() { files, err := ioutil.ReadDir(".") if err != nil { panic(err) } fmt.Println("Folders in the current directory:") for _, fileInfo := range files { ...
The equivalent to git pull is the command git svn rebase This retrieves all the changes from the SVN repository and applies them on top of your local commits in your current branch. You can also use the command git svn fetch to retrieve the changes from the SVN repository and bring them to ...
git does not recognice the concept of folders, it just works with files and their filepaths. This means git does not track empty folders. SVN, however, does. Using git-svn means that, by default, any change you do involving empty folders with git will not be propagated to SVN. Using the --rmdir fl...
Go to File -> Settings -> Editor -> Colors & Fonts -> Android Logcat Change the colors as you need: Choose the appropriate color:
Some basic types and classes in Java are fundamentally mutable. For example, all array types are mutable, and so are classes like java.util.Data. This can be awkward in situations where an immutable type is mandated. One way to deal with this is to create an immutable wrapper for the mutable type...
enable_shared_from_this enables you to get a valid shared_ptr instance to this. By deriving your class from the class template enable_shared_from_this, you inherit a method shared_from_this that returns a shared_ptr instance to this. Note that the object must be created as a shared_ptr in first pl...
This example shows how to use a request interceptor with OkHttp. This has numerous use cases such as: Adding universal header to the request. E.g. authenticating a request Debugging networked applications Retrieving raw response Logging network transaction etc. Set custom user agent Retrof...
For any object (i.e, variable, array, union, struct, pointer or function) the unary address operator can be used to access the address of that object. Suppose that int i = 1; int *p = NULL; So then a statement p = &i;, copies the address of the variable i to the pointer p. I...
An immutable object is an object whose state cannot be changed. An immutable class is a class whose instances are immutable by design, and implementation. The Java class which is most commonly presented as an example of immutability is java.lang.String. The following is a stereotypical example: ...
Number formatting, grouping digits according to the localization. const usNumberFormat = new Intl.NumberFormat('en-US'); const esNumberFormat = new Intl.NumberFormat('es-ES'); const usNumber = usNumberFormat.format(99999999.99); // "99,999,999.99" const esNumber = esNumberFormat.form...
Currency formatting, grouping digits and placing the currency symbol according to the localization. const usCurrencyFormat = new Intl.NumberFormat('en-US', {style: 'currency', currency: 'USD'}) const esCurrencyFormat = new Intl.NumberFormat('es-ES', {style: 'currency', currency: 'EUR'}) const u...
Date time formatting, according to the localization. const usDateTimeFormatting = new Intl.DateTimeFormat('en-US'); const esDateTimeFormatting = new Intl.DateTimeFormat('es-ES'); const usDate = usDateTimeFormatting.format(new Date('2016-07-21')); // "7/21/2016" const esDate = esDateT...
To convert decimal number to binary format use base 2 Int32 Number = 15; Console.WriteLine(Convert.ToString(Number, 2)); //OUTPUT : 1111 To convert decimal number to octal format use base 8 int Number = 15; Console.WriteLine(Convert.ToString(Number, 8)); //OUTPUT : 17 To conv...
The most feasible way is to use, the DateTime class. An example: <?php // Create a date time object, which has the value of ~ two years ago $twoYearsAgo = new DateTime("2014-01-18 20:05:56"); // Create a date time object, which has the value of ~ now $now = new DateTime("2016...
{foo: 'bar', biz: 'baz'}.keys # => [:foo, :biz] {foo: 'bar', biz: 'baz'}.values # => ["bar", "baz"] {foo: 'bar', biz: 'baz'}.to_a # => [[:foo, "bar"], [:biz, "baz"]] {foo: 'bar', biz: 'baz'}.each #<Enumerator: {:foo=>"bar", :b...
The URL for the credits label. Defaults to: http://www.highcharts.com. credits: { text: 'StackOverflow.com', href: 'http://stackoverflow.com' },
C11 Queries the alignment requirement for the specified type. The alignment requirement is a positive integral power of 2 representing the number of bytes between which two objects of the type may be allocated. In C, the alignment requirement is measured in size_t. The type name may not be an inco...

for

for sequence expression is designed to look just like its more famous cousin, the imperative for-loop. It "loops" through a sequence and evaluates the body of each iteration into the sequence it is generating. Just like everything sequence related, it is NOT mutable. > let oneToTen = s...
The return statement in Bash doesn't return a value like C-functions, instead it exits the function with a return status. You can think of it as the exit status of that function. If you want to return a value from the function then send the value to stdout like this: fun() { local var="S...

Page 114 of 457