Tutorial by Examples

std::array being a STL container, can use range-based for loop similar to other containers like vector int main() { std::array<int, 3> arr = { 1, 2, 3 }; for (auto i : arr) cout << i << '\n'; }
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...
In previous versions, setting up provisioning profiles was done manually. You generate distribution profile, download it and then distribute your app. This had to be done for every development machine which was extremely time consuming. However, in most situations nowadays, Xcode 8 will do most of t...
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 it's done, you can find your archive in the Xcode organizer. This is where all your previous versions and archive builds are saved and organized in case you do not delete them. You will immediately notice a large blue button saying "Upload to App Store..." however in 9/10 cases this w...
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...
After defining the structure of your form with the WinForms designer you can display your forms in code with two different methods. Method - A Modeless form Form1 aForm1Instance = new Form1(); aForm1Instance.Show(); Method - A Modal Dialog Form2 aForm2Instance = new Form2(); aF...
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...
-- Create a sample JSON with ARRAY create table car_sample(dim_id integer, info varchar(2000)); insert into car_sample values (200, '{"cars": [ { "Manufacturer": "Nissan", "Models": [{"Name":"Sentra", "doors":4}, {"Name&quo...
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...

Page 1101 of 1336