Tutorial by Examples

~$ ping -c 1 google.com # unmodified output PING google.com (16.58.209.174) 56(84) bytes of data. 64 bytes from wk-in-f100.1e100.net (16.58.209.174): icmp_seq=1 ttl=53 time=47.4 ms ~$ ping google.com | grep -o '^[0-9]\+[^()]\+' # modified output 64 bytes from wk-in-f100.1e100.net 64 bytes from...
There is a mantra that some Java experts are wont to recite: "Exceptions should only be used for exceptional cases." (For example: http://programmers.stackexchange.com/questions/184654 ) The essence of this is that is it is a bad idea (in Java) to use exceptions and exception handli...
String types like UnicodeString, AnsiString, WideString and UTF8String are stored in a memory using their respective encoding (see String Types for more details). Assigning one type of string into another may result in a conversion. Type string is designed to be encoding independent - you should nev...
Use same UIImage with multiple theme base app by just applying UIColor to UIImage instance as following. // *** Create an UIImage instance with RenderingMode AlwaysTemplate *** UIImage *imgMenu = [[UIImage imageNamed:@"iconMenu"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]...
.intel_syntax noprefix .data .align 16 hello_msg: .asciz "Hello, World!" .text .global _main _main: push rbp mov rbp, rsp lea rdi, [rip+hello_msg] call _puts xor rax, rax leave ret Assemble: clang main.s -o hello ./hello Not...
$sku = 'some-sku'; $productId = Mage::getModel('catalog/product')->getIdBySku($sku); if($productId){ //sku exists }
A for loop iterates from the starting value down to the ending value inclusive, as a "count-down" example. program CountDown; {$APPTYPE CONSOLE} var i : Integer; begin for i := 10 downto 0 do WriteLn(i); end. Output: 10 9 8 7 6 5 4 3 2 1 0
Internal Table Declaration Based on Local Type Definition " Declaration of type TYPES: BEGIN OF ty_flightb, id TYPE fl_id, dat TYPE fl_date, seatno TYPE fl_seatno, firstname TYPE fl_fname, lastname TYPE fl_lname, fl...
Read, write and insert into internal tables with a header line: " Read from table with header (using a loop): LOOP AT i_compc_all. " Loop over table i_compc_all and assign header line CASE i_compc_all-ftype. " Read cell ftype from header line from table i_com...
In order to avoid a divide by zero with a numberSet (what you get after a reduction like avg()) you can short-circuit the logic: $five = min(q("sum:rate{counter,,1}:haproxy.frontend.hrsp{}{status_code=5xx}", "1h", "")) $two = avg(q("sum:rate{counter,,1}:haproxy.f...
With series operations, things are dropped from the left side if there is no corresponding timestamp/datapoint in the right side. You can mix this with the dropbool function to avoid divide by zero: $five = q("sum:rate{counter,,1}:haproxy.frontend.hrsp{}{status_code=5xx}", "1h",...
Creating a WebM video from canvas frames and playing in canvas, or upload, or downloading. Example capture and play canvas name = "CanvasCapture"; // Placed into the Mux and Write Application Name fields of the WebM header quality = 0.7; // good quality 1 Best < 0.7 ok to poor fps =...
The ServiceLoader is a simple and easy to use built-in mechanism for dynamic loading of interface implementations. With the service loader - providing means for instantation (but not the wiring) - a simple dependency injection mechanism can be built in Java SE. With the ServiceLoader interface and ...
As shown in the step by step guide (getting started with Amazon Redshift),it involves : Step 1: Set Up Prerequisites Step 2: Launch a Sample Amazon Redshift Cluster Step 3: Authorize Access to the Cluster Step 4: Connect to the Sample Cluster Setting Up Prerequisites Sett...
There are following setups to install opencart on your webserver Download the latest version of opencart for the official website or github and extract the files. In extracted files you can see the upload folder, license.txt file and readme.txt file The upload folder contains all the files to...
Alternate ways to install SymPy from conda. conda is the recommended way, but these are some alternate ways. Including: git, pip, etc.
NSIS installer can be downloaded from http://nsis.sourceforge.net/Download. An exe of 1.6 MB will be downloaded. You can install it using the wizard. While installing there are options to install 1. Full: Installs all the components 2. Lite: Basic and only essential components from the UI 3. Mi...
<!doctype html> <html> <head> <style> body{ background-color:white; } #canvas{border:1px solid red; } </style> <script> window.onload=(function(){ var canvas = document.getElementById("canvas"); var ctx = canvas.getContext(&...
This function will insert an element into an array at a given index: insert(){ h=' ################## insert ######################## # Usage: # insert arr_name index element # # Parameters: # arr_name : Name of the array variable # index : Index to insert at #...
foo() { while [[ "$#" -gt 0 ]] do case $1 in -f|--follow) local FOLLOW="following" ;; -t|--tail) local TAIL="tail=$2" ;; esac shift done echo "FOLLOW: $FOLLOW" echo "TAIL: $...

Page 766 of 1336