Tutorial by Examples: ase

Here the steps required to create a Firebase project and to connect it with an Android app. Add Firebase to your app Create a Firebase project in the Firebase console and click Create New Project. Click Add Firebase to your Android app and follow the setup steps. When prompted, enter...
Subdomain-based routing can be handled in Symfony using host parameter. For example, _locale parameter can be used as subdomain value. Assuming locale: en domain: somedomain.com parameters are defined in parameters.yml config file, route would be: /** * @Route( * "/", * ...
Query SELECT st.name, st.percentage, CASE WHEN st.percentage >= 35 THEN 'Pass' ELSE 'Fail' END AS `Remark` FROM student AS st ; Result +--------------------------------+ | name | percentage | Remark | +--------------------------------+ | Isha | 67 | Pas...
This example shows the behaviour of getopt when the user input is uncommon: getopt.php var_dump( getopt("ab:c::", ["delta", "epsilon:", "zeta::"]) ); Shell command line $ php getopt.php -a -a -bbeta -b beta -cgamma --delta --epsilon --zeta --zeta=f...
EXEC sp_MSForEachTable 'ALTER INDEX ALL ON ? REBUILD'
You can default to the normal Mongo format by defining your collections with the idGeneration field. MyCollection = new Meteor.Collection('mycollection', {idGeneration : 'MONGO'});
The common modifier to ignore case is i: /fog/i will match Fog, foG, etc. The inline version of the modifier looks like (?i). Notes: In Java, by default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching c...
Information about the database connections SELECT a.mon$attachment_id as Attachment_ID, a.mon$server_pid as Server_PID, case a.mon$state when 1 then 'active' when 0 then 'idle' end as State, a.mon$attachment_name as Database_Name, ...
Suppose that you had started an interactive rebase: git rebase --interactive HEAD~20 and by mistake, you squashed or dropped some commits that you didn't want to lose, but then completed the rebase. To recover, do git reflog, and you might see some output like this: aaaaaaa HEAD@{0} rebase -i (...
If we have a Model as following, from django.db import models from django.contrib.auth.models import User class UserModuleProfile(models.Model): user = models.OneToOneField(User) expired = models.DateTimeField() admin = models.BooleanField(default=False) employee_id = models...
psycopg2 is the most popular PostgreSQL database adapter that is both lightweight and efficient. It is the current implementation of the PostgreSQL adapter. Its main features are the complete implementation of the Python DB API 2.0 specification and the thread safety (several threads can share t...
To open an app with defined URL scheme todolist://: Objective-C NSURL *myURL = [NSURL URLWithString:@"todolist://there/is/something/to/do"]; [[UIApplication sharedApplication] openURL:myURL]; Swift let stringURL = "todolist://there/is/something/to/do" if let url = NSURL(s...
Your DocumentDB database can be created by using the CreateDatabaseAsync method of the DocumentClient class. A database is the logical container of JSON document storage partitioned across collections. using System.Net; using System.Threading.Tasks; using Microsoft.Azure.Documents; using Microso...
Deleting a database will remove the database and all children resources (collections, documents, etc.). await this.client.DeleteDatabaseAsync(UriFactory.CreateDatabaseUri(databaseName));
Introduces a case label of a switch statement. The operand must be a constant expression and match the switch condition in type. When the switch statement is executed, it will jump to the case label with operand equal to the condition, if any. char c = getchar(); bool confirmed; switch (c) { c...
Phantom types are useful for dealing with data, that has identical representations but isn't logically of the same type. A good example is dealing with currencies. If you work with currencies you absolutely never want to e.g. add two amounts of different currencies. What would the result currency o...
Convert in uppercase the string argument Syntax: UPPER(str) UPPER('fOoBar') -- 'FOOBAR' UCASE('fOoBar') -- 'FOOBAR'
In its simplest form supported by all versions of bash, case statement executes the case that matches the pattern. ;; operator breaks after the first match, if any. #!/bin/bash var=1 case $var in 1) echo "Antartica" ;; 2) echo "Brazil" ;; 3) echo "Cat&qu...
4.0 Since bash 4.0, a new operator ;& was introduced which provides fall through mechanism. #!/bin/bash var=1 case $var in 1) echo "Antartica" ;& 2) echo "Brazil" ;& 3) echo "Cat" ;& esac Outputs: Antartica Brazil Cat ...
Calculating the factorial of a number is a classic example of a recursive function. Missing the Base Condition: #include <stdio.h> int factorial(int n) { return n * factorial(n - 1); } int main() { printf("Factorial %d = %d\n", 3, factorial(3)); return 0;...

Page 19 of 40