Tutorial by Examples: df

$.ajax({ url: 'https://api.dropboxapi.com/2/sharing/add_folder_member', type: 'POST', processData: false, data: JSON.stringify({"shared_folder_id": "84528192421","members": [{"member": {".tag": "email","email":...
Use the filesystem module for all file operations: const fs = require('fs'); With Encoding In this example, read hello.txt from the directory /tmp. This operation will be completed in the background and the callback occurs on completion or failure: fs.readFile('/tmp/hello.txt', { encoding: '...
cat < file.txt Output is same as cat file.txt, but it reads the contents of the file from standard input instead of directly from the file. printf "first line\nSecond line\n" | cat -n The echo command before | outputs two lines. The cat command acts on the output to add line num...
Sometimes we will need to run commands against a lot of files. This can be done using xargs. find . -type d -print | xargs -r chmod 770 The above command will recursively find all directories (-type d) relative to . (which is your current working directory), and execute chmod 770 on them. The -...
C++11 for loops can be used to iterate over the elements of a iterator-based range, without using a numeric index or directly accessing the iterators: vector<float> v = {0.4f, 12.5f, 16.234f}; for(auto val: v) { std::cout << val << " "; } std::cout <<...
In Ruby, there are exactly two values which are considered "falsy", and will return false when tested as a condition for an if expression. They are: nil boolean false All other values are considered "truthy", including: 0 - numeric zero (Integer or otherwise) "&qu...
use feature qw( say ); # Numbers are true if they're not equal to 0. say 0 ? 'true' : 'false'; # false say 1 ? 'true' : 'false'; # true say 2 ? 'true' : 'false'; # true say -1 ? 'true' : 'false'; # true say 1-1 ? 'true' : 'false'; # fa...
This shows how you can iterate over multiple variables: for { x <- 1 to 2 y <- 'a' to 'd' } println("(" + x + "," + y + ")") (Note that to here is an infix operator method that returns an inclusive range. See the definition here.) This creates the outp...
Consider this simple project with a flat directory structure: example |-- example.asd |-- functions.lisp |-- main.lisp |-- packages.lisp `-- tools.lisp The example.asd file is really just another Lisp file with little more than an ASDF-specific function call. Assuming your project depends o...
// Java: Map<Boolean, List<Student>> passingFailing = students.stream() .collect(Collectors.partitioningBy(s -> s.getGrade() >= PASS_THRESHOLD)); // Kotlin: val passingFailing = students.partition { it.grade >= PASS_THRESHOLD }
This is a continuous collector that uses the hadoop fs -du -s /hbase/* command to get details about the HDFS disk usage. This metric is very useful for tracking space in an OpenTSDB system. #!/bin/bash while true; do while read -r bytes raw_bytes path; do echo "hdfs.du $(date +&...
The following demo features an <output> element's use of the [for] and [form] attributes. Keep in mind, <output> needs JavaScript in order to function. Inline JavaScript is commonly used in forms as this example demonstrates. Although the <input> elements are type="number&quot...
In case you have accidentally commited a delete on a file and later realized that you need it back. First find the commit id of the commit that deleted your file. git log --diff-filter=D --summary Will give you a sorted summary of commits which deleted files. Then proceed to restore the file b...
import Data.Traversable as Traversable data MyType a = -- ... instance Traversable MyType where traverse = -- ... Every Traversable structure can be made a Foldable Functor using the fmapDefault and foldMapDefault functions found in Data.Traversable. instance Functor MyType where ...
A module is a file containing Python definitions and statements. Function is a piece of code which execute some logic. >>> pow(2,3) #8 To check the built in function in python we can use dir(). If called without an argument, return the names in the current scope. Else, return an alph...
Suppose you have defined the following Person class: public class Person { String name; int age; public Person (int age, String name) { this.age = age; this.name = name; } } If you instantiate a new Person object: Person person = new Person(25, &qu...
package main import ( "fmt" "io/ioutil" ) func main() { files, err := ioutil.ReadDir(".") if err != nil { panic(err) } fmt.Println("Files and folders in the current directory:") for _, fileInfo := range fi...
MATLAB code can be saved in m-files to be reused. m-files have the .m extension which is automatically associated with MATLAB. An m-file can contain either a script or functions. Scripts Scripts are simply program files that execute a series of MATLAB commands in a predefined order. Scripts do no...
One of the things that can really boost your productivity while writing the code is effectively navigating the workspace. This also means making it comfortable for the moment. It's possible to achieve this by adjusting which areas of workspaces you see. The buttons on the top of the navigation and ...
git clean -fX Will remove all ignored files from the current directory and all subdirectories. git clean -Xn Will preview all files that will be cleaned.

Page 2 of 21