Tutorial by Examples: sin

Future<Results> costlyQuery() { var completer = new Completer(); database.query("SELECT * FROM giant_table", (results) { // when complete completer.complete(results); }, (error) { completer.completeException(error); }); // this returns essentially im...
Flash Player 10 introduced the Vector.<*> generic list type that was faster than the Array. However, this is not entirely true. Only the following Vector types are faster than the Array counterparts, due to the way they are implemented in Flash Player. Vector.<int> - Vector of 32-bit ...
Creating and configuring Sprite and TextField objects at runtime can be costly if you are creating hundreds of thousands of these on a single frame. Therefore a common trick is "pooling" these objects for later reuse. Remember we are not just trying to optimize the creation time (new Sprit...
Working Source - https://github.com/benhysell/V.TouchIdExample Long form description - http://benjaminhysell.com/archive/2014/11/authentication-in-xamarin-ios-with-touch-id-or-passcode/ //Simple View with a switch to enable / disable Touch ID and //a button to invoke authentication /// <s...
Let's download a Meteor Todos example project, using a Linux shell (command line) script, to test out Electrifying a project for the first time: Requirements for this section: Git apt-get install git-all There are many ways to install Git. Check them out here. git is a version control sys...
Defining our terms By array here we mean a Lua table used as a sequence. For example: -- Create a table to store the types of pets we like. local pets = {"dogs", "cats", "birds"} We're using this table as a sequence: a group of items keyed by integers. Many langua...
Given that the function has a proper prototype, integers are widened for calls to functions according to the rules of integer conversion, C11 6.3.1.3. 6.3.1.3 Signed and unsigned integers When a value with integer type is converted to another integer type other than _Bool, if the value can be r...
Pointer conversions to void* are implicit, but any other pointer conversion must be explicit. While the compiler allows an explicit conversion from any pointer-to-data type to any other pointer-to-data type, accessing an object through a wrongly typed pointer is erroneous and leads to undefined beh...
Streams of elements usually do not allow access to the index value of the current item. To iterate over an array or ArrayList while having access to indexes, use IntStream.range(start, endExclusive). String[] names = { "Jon", "Darin", "Bauke", "Hans", "M...
When you bind a service to your application credentials become available through the VCAP_SERVICES environment variable. This environment variable contains JSON containing the credentials for all bound services. Example VCAP_SERVICES environment variable { "push-reappt": [ { ...
After creating an IAP in iTunesConnect: In the view controller that you want to buy in import StoreKit and add the relevant delegates class ViewController: UIViewController, SKProductsRequestDelegate, SKPaymentTransactionObserver { declare a variable with the product id from iTunesConnect ...
Preface You'll need node >= 4 and express 4 for this project. You can get the latest node distribution from their download page. Before this tutorial, you should initialize your node project by running $ npm init from the command line and filling in the information you want. Note that you c...
Date always have a different format, they can be parsed using a specific parse_dates function. This input.csv: 2016 06 10 20:30:00 foo 2016 07 11 19:45:30 bar 2013 10 12 4:30:00 foo Can be parsed like this : mydateparser = lambda x: pd.datetime.strptime(x, "%Y %m %d %H:%M:%S...
Redux is the most common state management library used with React-Native. The following example demonstrates how to use the fetch API and dispatch changes to your applications state reducer using redux-thunk. export const fetchRecipes = (action) => { return (dispatch, getState) => { f...
DECLARE @VariableName INT SET @VariableName = 1 PRINT @VariableName 1 Using SET, you can only update one variable at a time.
Using SELECT, you can update multiple variables at once. DECLARE @Variable1 INT, @Variable2 VARCHAR(10) SELECT @Variable1 = 1, @Variable2 = 'Hello' PRINT @Variable1 PRINT @Variable2 1 Hello When using SELECT to update a variable from a table column, if there are multiple values, it wi...
CSS body { counter-reset: item-counter; /* create the counter */ } .item { counter-increment: item-counter; /* increment the counter every time an element with class "item" is encountered */ } .item-header:before { content: counter(item-counter) ". "; /* print the v...
Generic classes can be inherited: // Models class MyFirstModel { } class MySecondModel: MyFirstModel { } // Generic classes class MyFirstGenericClass<T: MyFirstModel> { func doSomethingWithModel(model: T) { // Do something here } } class MySecondGe...
Each requirements files should match the name of a settings files. Read Using multiple settings for more information. Structure djangoproject ├── config │ ├── __init__.py │ ├── requirements │ │ ├── base.txt │ │ ├── dev.txt │ │ ├── test.txt │ │ └── prod.txt │ └── setti...
using (new Sitecore.SecurityModel.SecurityDisabler()) { var item = Sitecore.Context.Database.GetItem("/sitecore/content/home"); }

Page 37 of 161