Tutorial by Examples

One of the great things about Ektorp, is that it provides ORM like functionality, straight out of the box. This example will walk you through creating a simple POJO and doing standard CRUD operation on it Creating a simple POJO First off, we define a POJO as follows import com.fasterxml.jackson...
FirebaseUI offers Android, iOS, and Web clients. You can get started with them like so: Android: // app/build.gradle dependencies { // Single target that includes all FirebaseUI libraries compile 'com.firebaseui:firebase-ui:0.5.2' // FirebaseUI Database only compile 'com.f...
Let's say we have multiple data sources which include database, file, prompt and argumentList. Depending on chosen source we change our approach: def loadData(dataSource: Symbol): Try[String] = dataSource match { case 'database => loadDatabase() // Loading data from database case 'file =&g...
The UWP applications can run in windowed mode and on several devices. They can be displayed on a wide range of screen sizes from low end phones to the huge surface hub screen. Using relative positioning will be enough for a lot of scenario but as the window size increases, it is always interesting t...
Sometimes you need to set the same data in many of your views. Using View::share // "View" is the View Facade View::share('shareddata', $data); After this, the contents of $data will be available in all views under the name $shareddata. View::share is typically called in a service p...
- (UIImage *)drawImageBySize:(CGSize)size quality:(CGInterpolationQuality)quality { UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetInterpolationQuality(context, quality); [self drawInRect: CGRectMake (0, 0...
Objective C CATransition *animation = [CATransition animation]; [animation setSubtype:kCATransitionFromRight];//kCATransitionFromLeft [animation setDuration:0.5]; [animation setType:kCATransitionPush]; [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEa...
We can add adaptivity to any subclass of UIView which we add on view controller in nib file. Lets take an example of adding adaptivity using size classes to a view. Add a view on view controller as: Now we need to pin this view to it's superview for fixing it's size and position using con...
Asynchronous validators allows you to validate form information against your backend (using $http). These kind of validators are needed when you need to access server stored information you can't have on your client for various reasons, such as the users table and other database information. To us...
If you want to detect missings with df=pd.DataFrame({'col':[1,np.nan]}) df==np.nan you will get the following result: col 0 False 1 False This is because comparing missing value to anything results in a False - instead of this you should use df=pd.DataFrame({'col':[1,np.nan]}) ...
Pandas don't support missing in attributes of type integer. For example if you have missings in the grade column: df= pd.read_csv("data.csv", dtype={'grade': int}) error: Integer column has NA values In this case you just should use float instead of integers or set the object dtype. ...
Below is and HTML page <html> <head> <title>Select Example by Index value</title> </head> <body> <select name="Travel"><option value="0" selected> Please select</option> <option value="1">Car</option&...
A minimal Flask application looks something like this: from flask import Flask app = Flask(__name__) @app.route("/") def index(): return "Hello World!" A large Flask application can separate one file into multiple files by blueprints. Purpose Make it easier for ...
Go to Main.cs file in iOS project and change existed code, like presented below: static void Main(string[] args) { try { UIApplication.Main(args, null, "AppDelegate"); } catch (Exception ex) { Debug.WriteLine(...
let doc = require('dynamodb-doc'); let dynamo = new doc.DynamoDB(); var tblName = "MyTable"; exports.handler = (event, context, callback) => { readOperation(context); } function readOperation(cnxt) { var params = { TableName: tblName, Key: { "id": ...
By default, the url property is not defined. Calling fetch() (while using the default Backbone.sync) will result in a GET request to the results of url. var Users = Backbone.Collection.extend({ url: '/api/users', // or url: function () { return '/api/users' } }); va...
By default, the urlRoot property is not defined. This urlRoot property is used by the url method to create a relative URL where the model's resource would be located on the server. var User = Backbone.Model.extend({ urlRoot: '/api/users', // or urlRoot: function () { return '/...
Model.url and Collection.url are only used internally by the default Backbone.sync method. The default method assumes you are tying into a RESTful API. If you are using a different endpoint design, you will want to override the sync method and may want utilize the url method. var Model = Backbone.M...
class MySubClass(np.ndarray): def __new__(cls, input_array, info=None): obj = np.asarray(input_array).view(cls) obj.info = info return obj def __array_finalize__(self, obj): # handles MySubClass(...) if obj is None: pass ...
For a more real time solution you can use watchPosition function in Geolocation that notifies whenever an error or a position change occurs. Unlike the getCurrentPosition the watchPosition returns an Observable import {Geolocation} from 'ionic-native'; import template from './custom-component.htm...

Page 881 of 1336