Tutorial by Examples: cs

To get general statistics about main components of Linux family of stat commands are extremely useful CPU To get processors related statistics you can use mpstat command but with some options it will provide better visibility: $ mpstat 2 10 Memory We all know command free to show amount of (r...
@sorted = sort { $a <=> $b } @list; Comparing $a and $b with the <=> operator ensures they are compared numerically and not textually as per default.
Given the CSV file peoples.csv: 1,Reed,United States,Female 2,Bradley,United States,Female 3,Adams,United States,Male 4,Lane,United States,Male 5,Marshall,United States,Female 6,Garza,United States,Male 7,Gutierrez,United States,Male 8,Fox,Germany,Female 9,Medina,United States,Male 10,Nich...
The CSS/JQuery extractor enables extracting values from a server response by using a CSS/JQuery selector syntax, which might have otherwise been difficult to write using Regular Expression. As a post-processor, this element should be executed to extract the requested nodes, text or attribute values...
This uses the Dropbox Objective-C SDK to upload a local file to Dropbox as "/test.txt". [[client.filesRoutes uploadUrl:@"/test.txt" inputUrl:[NSURL fileURLWithPath:@"/local/path/to/test.txt"]] response:^(DBFILESFileMetadata *metadata, DBFILESUploadError *uploadError, D...
This tool let you list, create, alter and describe topics. List topics: kafka-topics --zookeeper localhost:2181 --list Create a topic: kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test creates a topic with one partition and no replication....
Recall that every transaction contains multiple sublists of data. Now that we can show only sublist data using Main Line, we can further refine our search results to specific sublist data. Most of the sublists included in Transaction results have a corresponding search filter to toggle whether they...
Client metrics cover the traffic between the client and the Varnish cache. sess_conn - Cumulative number of connections. client_req - Cumulative number of client requests. sess_dropped - Dropped connections because of a full queue. Monitor sess_conn and client_req to keep track of traffic vo...
There are a number of metrics describing the communication between Varnish and it's backends. The most important metrics here might be these: backend_busy - Number of http 5xx statuses recieved by a backend. With VCL you can configure Varnish to try another backend if this happens. backend_fail...
Objective-C example of swizzling UIView's initWithFrame: method static IMP original_initWithFrame; + (void)swizzleMethods { static BOOL swizzled = NO; if (!swizzled) { swizzled = YES; Method initWithFrameMethod = class_getInstanceMethod([UIView class], ...
This example will cover creating a custom error page for 404 Page Not Found and 500 Server Error. You can extend this code to capture any error code you need to. Web.Config If you are using IIS7 and above, ignore the <CustomError.. node and use <httpErrors... instead. Add in the following i...
fs is the File System API in node. We can use the method readFile on our fs variable, pass it a data.csv file, format and function that reads and splits the csv for further processing. This assumes you have a file named data.csv in the same folder. 'use strict' const fs = require('fs'); fs.r...
Sometimes, you need to output to more than one index in ElasticSearch, or have a custom mapping you want to apply to new indices as they roll in. There are two ways to apply a custom mapping. One way, is to upload an ElasticSearch template. See the ElasticSearch documentation for that. The other ...
Code function add_new_style() { add_editor_style( 'file-name-here.css' ); } add_action( 'admin_init', 'add_new_style' ); Explanation In the above code, we used add_editor_style to load the css file. We also used add_action to make sure that WordPress runs our function.
$rootId = Mage::app()->getStore($storeId)->getRootCategoryId(); $categories = Mage::getModel('catalog/category')->getCollection() ->addAttributeToSelect('*') ->addFieldToFilter('path', array('like'=> "1/$rootId/%")) ->addAttributeToFilter('level', 2...
If you do not only wish to display static objects, but have your UI respond to changes to correlating objects, you need to understand the basics of the INotifyPropertyChanged interface. Assuming we have our MainWindowdefined as <Window x:Class="Application.MainWindow" xmlns=&quot...
This example will go over the basic structure of a Cucumber feature file in Gherkin. Feature files use several keywords in the basic syntax. Lets look at the basic keywords: Feature: this keyword signifies that what follows is a basic description or name of the feature being tested or documented...
Since Bootstrap 4 is a major rewrite, many of the Bootstrap 3.x class names have changed or been removed. The restructuring of components such as the Navbar, and the introduction of new CSS classes and Flexbox support means that upgrading to 4.x is not a simple conversion process from 3.x. However,...
A splash screen is just like any other activity, but it can handle all of your startup-needs in the background. Example: Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="...
Generic subprograms are usefull to create a subprograms that have the same structure for several types. For example, to swap two objects: generic type A_Type is private; procedure Swap (Left, Right : in out A_Type) is Temp : A_Type := Left; begin Left := Right; Right := Temp; ...

Page 21 of 24