Tutorial by Examples: alt

The Firebase auth system is the source of a users uid, displayName, photoURL, and maybe email. Password based accounts set these persistent values in the auth system via the .updateProfile method. Storing these values in the Realtime Database, rDB, users node poses the issue of stale data. Displa...
Enable the module by typing: sudo a2enmod ssl Restart the web server (apache2) so the change is recognized: sudo service apache2 restart Optional (but a good idea): Create a directory that will contain our new certificate files: sudo mkdir /etc/apache2/ssl Create the key and self-signed ...
There are two equivalent ways to calculate the amount of time unit between two LocalTime: (1) through until(Temporal, TemporalUnit) method and through (2) TemporalUnit.between(Temporal, Temporal). import java.time.LocalTime; import java.time.temporal.ChronoUnit; public class AmountOfTime { ...
With the below commands, user's default search_path can be set. Check search path before set default schema. postgres=# \c postgres user1 You are now connected to database "postgres" as user "user1". postgres=> show search_path; search_path ---------------- &q...
Security policy is a group of predicates associated to tables that can be managed together. You can add, or remove predicates or turn on/off entire policy. You can add more predicates on tables in the existing security policy. ALTER SECURITY POLICY dbo.CompanyAccessPolicy ADD FILTER PREDICATE...
It's not the best way of iterating through the pixels; however, it's better than cv::Mat::at<T>. Let's assume you have a color image in your folder and you want to iterate each pixels of this image and erase green and red channels(Note that this is an example, you can do this in more optimize...
IF you are using simple categories, with each physics body belonging to only one category, then this alternative form of didBeginContact may be more readable: func didBeginContact(contact: SKPhysicsContact) { let contactMask = contact.bodyA.categoryBitMask | contact.bodyB.categoryBitMask ...
let bodies = (contact.bodyA.categoryBitMask <= contact.bodyB.categoryBitMask) ? (A:contact.bodyA,B:contact.bodyB) : (A:contact.bodyB,B:contact.bodyA) switch (bodies.A.categoryBitMask,bodies.B.categoryBitMask) { case let (a, _) where (a && superPower): //All we care about is i...
Objective-C First go the Target->Capabilities and enable HealthKit. This would setup the info.plist entry. Make a new CocoaClass of type NSObject The filename I gave is GSHealthKitManager and the header file is as shown below GSHealthKitManager.h #import <Foundation/Foundation.h> #imp...
SELECT CURRENT_DATE + '1 day'::INTERVAL SELECT '1999-12-11'::TIMESTAMP + '19 days'::INTERVAL SELECT '1 month'::INTERVAL + '1 month 3 days'::INTERVAL
update <SCHEMA_NAME>.<TABLE_NAME_1> AS A SET <COLUMN_1> = True FROM <SCHEMA_NAME>.<TABLE_NAME_2> AS B WHERE A.<COLUMN_2> = B.<COLUMN_2> AND A.<COLUMN_3> = B.<COLUMN_3>
Using canvas elements HTML provides the canvas element for building raster-based images. First build a canvas for holding image pixel information. var canvas = document.createElement('canvas'); canvas.width = 500; canvas.height = 250; Then select a context for the canvas, in this case two-di...
tkinter is a GUI toolkit that provides a wrapper around the Tk/Tcl GUI library and is included with Python. The following code creates a new window using tkinter and places some text in the window body. Note: In Python 2, the capitalization may be slightly different, see Remarks section below. ...
using System; using System.Security.Cryptography; using System.Text; public class PasswordDerivedBytesExample { public static void Main(String[] args) { // Get a password from the user. Console.WriteLine("Enter a password to produce a key:"); by...
Swift Import the Core Motion library: import CoreMotion Next, we need to create a CMAltimeter object, but a common pitfall is to create it in the viewDidLoad(). If done that way, the altimeter won’t be accessible when we need to call a method on it. Nevertheless, go ahead and create your CMAlti...
Each server has a default global time_zone setting, configured by the owner of the server machine. You can find out the current time zone setting this way: SELECT @@time_zone Unfortunately, that usually yields the value SYSTEM, meaning the MySQL time is governed by the server OS's time zone sett...
There are a few ways to setup a local copy of your Shopify theme: Node.js ( gulp/grunt ) Ruby Theme App ( Mac only ) There might be a few other ways, but I found the ruby way the most easy to work with. In order to work locally on the Shopify theme files you will need a few things: Ruby ...
Since every Applicative Functor is a Functor, fmap can always be used on it; thus the essence of Applicative is the pairing of carried contents, as well as the ability to create it: class Functor f => PairingFunctor f where funit :: f () -- create a context, carrying nothing ...
To provide translations in other languages (locales), we need to create a strings.xml in a separate folder by the following convention : res/values-<locale>/strings.xml An example for the same is given below: In this example, we have default English strings in the file res/values/string...
Creating language specific layouts is often unnecessary if you have specified the correct start/end notation, as described in the earlier example. However, there may be situations where the defaults layouts may not work correctly for certain languages. Sometimes, left-to-right layouts may not transl...

Page 5 of 6