Tutorial by Examples: er

This creates a simple archive of a folder : tar -cf ./my-archive.tar ./my-folder/ Verbose output shows which files and directories are added to the archive, use the -v option: tar -cvf ./my-archive.tar ./my-folder/ For archiving a folder compressed 'gzip', you have to use the -z option : ta...
There is an example for extract a folder from an archive in the current location : tar -xf archive-name.tar If you want to extract a folder from an archive to a specfic destination : tar -xf archive-name.tar -C ./directory/destination
Sometimes it can be interesting to have a cross-talk between the user and the program, one example being the swirl package that had been designed to teach R in R. One can ask for user input using the readline command: name <- readline(prompt = "What is your name?") The user can the...
Orders a collection by a specified value. When the value is an integer, double or float it starts with the minimum value, which means that you get first the negative values, than zero and afterwords the positive values (see Example 1). When you order by a char the method compares the ascii val...
Orders a collection by a specified value. When the value is an integer, double or float it starts with the maximal value, which means that you get first the positive values, than zero and afterwords the negative values (see Example 1). When you order by a char the method compares the ascii val...
Lists def lst = ['foo', 'bar', 'baz'] // using implicit argument lst.each { println it } // using explicit argument lst.each { val -> println val } // both print: // foo // bar // baz Iterate with index def lst = ['foo', 'bar', 'baz'] // explicit arguments are required lst.each...
def lst = [10, 20, 30, 40] lst.findAll { it > 25 } // [30, 40]
The Slow Query Log consists of log events for queries taking up to long_query_time seconds to finish. For instance, up to 10 seconds to complete. To see the time threshold currently set, issue the following: SELECT @@long_query_time; +-------------------+ | @@long_query_time | +-----------------...
# operator or stringizing operator is used to convert a Macro parameter to a string literal. It can only be used with the Macros having arguments. // preprocessor will convert the parameter x to the string literal x #define PRINT(x) printf(#x "\n") PRINT(This line will be converted to...
Prefix bitwise operators Bitwise operators are like logical operators but executed per bit rather than per boolean value. // bitwise NOT ~: sets all unset bits and unsets all set bits printf("%'06b", ~0b110110); // 001001 Bitmask-bitmask operators Bitwise AND &: a bit is set onl...
While catching the Throwable, Exception, Error and RuntimeException exceptions is bad, throwing them is even worse. The basic problem is that when your application needs to handle exceptions, the presence of the top level exceptions make it hard to discriminate between different error conditions. ...
SELECT * INTO NewTable FROM OldTable Creates a new table with structure of old table and inserts all rows into the new table. Some Restrictions You cannot specify a table variable or table-valued parameter as the new table. You cannot use SELECT…INTO to create a partitioned table, even whe...
The following example can be used to find the total row count for a specific table in a database if table_name is replaced by the the table you wish to query: SELECT COUNT(*) AS [TotalRowCount] FROM table_name; It is also possible to get the row count for all tables by joining back to the table'...
This is something that can be frustrating: you make a visualisation using D3.js but the rectangle you want on top is hidden behind another rectangle, or the line you planned to be behind some circle is actually over it. You try to solve this using the z-index in your CSS, but it doesn't work (in SVG...
First of all, ensure that you've enabled the 'Virtualization' in your BIOS setup. Start the Android SDK Manager, select Extras and then select Intel Hardware Accelerated Execution Manager and wait until your download completes. If it still doesn't work, open your SDK folder and run /extras/intel/Ha...
adb shell am start -n com.android.settings/.DevelopmentSettings Will navigate your device/emulator to the Developer Options section.
This is relevant for apps that implement a BootListener. Test your app by killing your app and then test with: adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -c android.intent.category.HOME -n your.app/your.app.BootListener (replace your.package/your.app.BootListener with proper ...
let data = [1; 2; 3; 4; 5;] let repeating = seq {while true do yield! data} Repeating sequences can be created using a seq {} computation expression
When factors are created with defaults, levels are formed by as.character applied to the inputs and are ordered alphabetically. charvar <- rep(c("W", "n", "c"), times=c(17,20,14)) f <- factor(charvar) levels(f) # [1] "c" "n" "W" ...
The General Query Log contains a listing of general information from client connects, disconnects, and queries. It is invaluable for debugging, yet it poses as a hindrance to performance (citation?). An example view of a General Query Log is seen below: To determine if the General Log is current...

Page 222 of 417