Tutorial by Examples: ase

In this example, we can use GROUP BY not only determined the sort of the rows returned, but also what rows are returned, since we're using TOP to limit the result set. Let's say we want to return the top 5 highest reputation users from an unnamed popular Q&A site. Without ORDER BY This query ...
The strcase*-functions are not Standard C, but a POSIX extension. The strcmp function lexicographically compare two null-terminated character arrays. The functions return a negative value if the first argument appears before the second in lexicographical order, zero if they compare equal, or positi...
4.0 To uppercase $ v="hello" # Just the first character $ printf '%s\n' "${v^}" Hello # All characters $ printf '%s\n' "${v^^}" HELLO # Alternative $ v="hello world" $ declare -u string="$v" $ echo "$string" HELLO WORLD To l...
A database snapshot is a read-only, static view of a SQL Server database (the source database). It is similar to backup, but it is available as any other database so client can query snapshot database. CREATE DATABASE MyDatabase_morning -- name of the snapshot ON ( NAME=MyDatabase_data, -- l...
If data in a source database becomes damaged or some wrong data is written into database, in some cases, reverting the database to a database snapshot that predates the damage might be an appropriate alternative to restoring the database from a backup. RESTORE DATABASE MYDATABASE FROM DATABASE_SNAP...
This query will return the number of tables in the specified database. USE YourDatabaseName SELECT COUNT(*) from INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' Following is another way this can be done for all user tables with SQL Server 2008+. The reference is here. SELECT COUNT(...
// Java: List<String> myList = Arrays.asList("a1", "a2", "b1", "c2", "c1"); myList.stream() .filter(s -> s.startsWith("c")) .map(String::toUpperCase) .sorted() .forEach(System.out::println); // C1 ...
You can pass data to a template in a custom variable. In your views.py: from django.views.generic import TemplateView from MyProject.myapp.models import Item class ItemView(TemplateView): template_name = "item.html" def items(self): """ Get all Ite...
Git lets you use non-git commands and full sh shell syntax in your aliases if you prefix them with !. In your ~/.gitconfig file: [alias] temp = !git add -A && git commit -m "Temp" The fact that full shell syntax is available in these prefixed aliases also means you can us...
On Windows you can install Scollector as a service using the -winsvc="install" flag. On Mac and Linux you must manually create a service or init script. For example here is a basic systemd unit file: #Scollector unit file saved to /etc/systemd/system/scollector.service [Unit] Descriptio...
It’s a good practice to declare the primary language of the document in the html element: <html lang="en"> If no other lang attribute is specified in the document, it means that everything (i.e., element content and attribute text values) is in that language. If the document con...
You can use a template in a function based view as follows: from django.shortcuts import render def view(request): return render(request, "template.html") If you want to use template variables, you can do so as follows: from django.shortcuts import render def view(request):...
The built-in mtcars data frame contains information about 32 cars, including their weight, fuel efficiency (in miles-per-gallon), speed, etc. (To find out more about the dataset, use help(mtcars)). If we are interested in the relationship between fuel efficiency (mpg) and weight (wt) we may start p...
Method 1: Below query will be applicable for SQL Server 2000+ version (Contains 12 columns) SELECT * FROM dbo.sysdatabases Method 2: Below query extract information about databases with more informations (ex: State, Isolation, recovery model etc.) Note: This is a catalog view and will be availa...
If a selection on multiple arguments for a type generic expression is wanted, and all types in question are arithmetic types, an easy way to avoid nested _Generic expressions is to use addition of the parameters in the controlling expression: int max_int(int, int); unsigned max_unsigned(unsigned, ...
Few people have issue regarding error message not displaying if existing value is being entered in textbox. So, For Example I'm not allowing user to enter existing email. signup.php (Page where you wanted to sign up new user without existing email id) Remove use yii\bootstrap\ActiveForm; (if p...
Some people have issues regarding error messages not being displayed if an existing value is being entered. For example I'm not allowing a user signup with an existing email. View <?php ...................... <?= $form->field($modelUser, 'email')->textInput(['class'=&gt...
The static (compile-time) type is used rather than the dynamic (run-time type) to match parameters. public class Base { public virtual string GetName() { return "Base"; } } public class Derived : Base { public override string GetName() { ...
Rails uses sqlite3 as the default database, but you can generate a new rails application with a database of your choice. Just add the -d option followed by the name of the database. $ rails new MyApp -T -d postgresql This is a (non-exhaustive) list of available database options: mysql oracle...
"string".upcase # => "STRING" "STRING".downcase # => "string" "String".swapcase # => "sTRING" "string".capitalize # => "String" These four methods do not modify the original receiver. For exampl...

Page 3 of 40