Tutorial by Examples: c

The typical usage is with CSV-type files, where each line consists of fields separated by a delimiter, specified by the option -d. The default delimiter is the TAB character. Suppose you have a data file data.txt with lines like 0 0 755 1482941948.8024 102 33 4755 1240562224.3205 1003 1 644 12199...
You cannot have more than one delimiter: if you specify something like -d ",;:", some implementations will use only the first character as a delimiter (in this case, the comma.) Other implementations (e.g. GNU cut) will give you an error message. $ cut -d ",;:" -f2 <<<&...
You can only extract portions of lines, not reorder or repeat fields. $ cut -d, -f2,1 <<<'John,Smith,USA' ## Just like -f1,2 John,Smith $ cut -d, -f2,2 <<<'John,Smith,USA' ## Just like -f2 Smith
One of the main advantage of std::array as compared to C style array is that we can check the size of the array using size() member function int main() { std::array<int, 3> arr = { 1, 2, 3 }; cout << arr.size() << endl; }
The member function fill() can be used on std::array for changing the values at once post initialization int main() { std::array<int, 3> arr = { 1, 2, 3 }; // change all elements of the array to 100 arr.fill(100); }
To configure robolectric add @Config annotation to test class or method. Run with custom Application class @RunWith(RobolectricTestRunner.class) @Config(application = MyApplication.class) public final class MyTest { } Set target SDK @RunWith(RobolectricTestRunner.class) @Config(sdk = Build...
import React, { Component } from 'react'; import { WebView } from 'react-native'; class MyWeb extends Component { render() { return ( <WebView source={{uri: 'https://github.com/facebook/react-native'}} style={{marginTop: 20}} /> ); } } ...
SWIFT: Step 1: In your Info.plist add the following attribute: View controller-based status bar appearance and set its value to NO as described in the image below: Step 2: In your AppDelegate.swift file, in didFinishLaunchingWithOptions method, add this code: UIApplication.shared.st...
In order to create an use a custome tag,we need to follow couple of steps: Create a tag file,defining the attributes used by it and any variables which will be used by the tag a. The attributes need to have a name,their type and and required field with a boolean value b. The variables will be...
Sometimes it is useful to print a current binding directly from markup. A neat trick which allows that is to use an additional DOM element with a non-existing binding (KO < 3.0), custom binding or a binding that is not relevant such as uniqueName. Consider this example: <tbody data-bind=&quo...
Once the provisioning profiles are all set, next step in the process of submitting the app is to archive your code. From the dropdown of devices and simulators select option "Generic iOS device". Then, under "Product" menu select option "Archive". In case where the s...
Once the IPA file is generated, open Xcode, navigate to developer tools and open Application Loader. If you have multiple accounts in your Xcode, you will be asked to choose. Naturally pick the one you used for code signing in the first step. Pick "Deliver your app" and upload the code....
Structs may be used to implement code in an object oriented manner. A struct is similar to a class, but is missing the functions which normally also form part of a class, we can add these as function pointer member variables. To stay with our coordinates example: /* coordinates.h */ typedef stru...
//Hide column "A" worksheet.Column(1).Hidden = true; //Hide row 1 worksheet.Row(1).Hidden = true;
//Set the row "A" height to 15 double rowHeight = 15; worksheet.Row(1).Height = rowHeight; //Set the column 1 width to 50 double columnWidth = 50; worksheet.Column(1).Width = columnWidth; When Bestfit is set to true, the column will grow wider when a user inputs numbers in a ce...
//create a new ExcelPackage using (ExcelPackage excelPackage = new ExcelPackage()) { //create 2 WorkSheets. One for the source data and one for the Pivot table ExcelWorksheet worksheetPivot = excelPackage.Workbook.Worksheets.Add("Pivot"); ExcelWorksheet worksheetData = exc...
A modeless form is employed (usually) when you need to shows something permanentely alongside your application main screen (think about a legend or an view on a stream of data coming asynchronously from a device or an MDI Child Window). But a modeless form poses an unique challenge when you want t...
When a form is shown using the ShowDialog method, it is necessary to set the form's DialogResult property to close to form. This property can be set using the enum that's also called DialogResult. To close a form, you just need to set the form's DialogResult property (to any value by DialogResult.N...
Typically when loading plugins, make sure to always include the plugin after jQuery. <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> <script src="some-plugin.min.js"></script> If you must use more than one version of jQuery, then m...
if and else: it used to check whether the given expression returns true or false and acts as such: if (condition) statement the condition can be any valid C++ expression that returns something that be checked against truth/falsehood for example: if (true) { /* code here */ } // evaluate that ...

Page 684 of 826