Tutorial by Examples: ase

Some languages have a native structure for sets. To make a set in Go, it's best practice to use a map from the value type of the set to an empty struct (map[Type]struct{}). For example, with strings: // To initialize a set of strings: greetings := map[string]struct{}{ "hi": {}, ...
Create a DATABASE. Note that the shortened word SCHEMA can be used as a synonym. CREATE DATABASE Baseball; -- creates a database named Baseball If the database already exists, Error 1007 is returned. To get around this error, try: CREATE DATABASE IF NOT EXISTS Baseball; Similarly, DROP DATA...
Creating a ServiceHost programmatically (without config file) in its most basic form: namespace ConsoleHost { class ConsoleHost { ServiceHost mHost; public Console() { mHost = new ServiceHost(typeof(Example), new Uri("net.tcp://localhost:9000/Example")); ...
Prolog categorizes everything into: Atoms - Any sequence of characters that do not start with an uppercase alphabet. Eg - a, b, okay Numbers - There is no special syntax for numbers, no declaration is required. Eg 1, 22, 35.8 Variables - A string which starts with an uppercase character or unde...
Sometimes gotoAndStop() is called in the middle of the code that refers some frame-based properties. But, right after the frame is changed all links to properties that existed on the current frame are invalidated, so any processing that involves them should be immediately terminated. There are two ...
--- person_table: - &person001 fname: homer lname: simpson role: dad age: 33 - &person002 fname: marge lname: simpson role: mom age: 34 - &person003 fname: pe...
Reading line by line awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' < input.fa one can read this awk script as: if the current line ($0) starts like a fasta header (^>). Then we prin...
download and linearize the 10 first FASTA sequences from UniProt: $ curl -s "ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_sprot.fasta.gz" |\ gunzip -c |\ awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N...
Once you get past your 'Hello World' app, you'll need to start paying attention to your collection and document schemas, and will need some tools for managing your database. Robomongo - A longtime community favorite for managing Mongo. Highly recommended. JSON Generator - Invaluable utility for...
A release manifest is similar to an NPM package.json file, in that it's primary concern is specify a list of Atmosphere packages, and providing a bit of metadata about that list of packages. The basic format looks like this: { "track":"distroname:METEOR", "version&qu...
StarryNight contains a small utility that parses an application's .meteor/versions file, and converts it into a Release Manifest. npm install -g starrynight cd myapp starrynight generate-release-json If you don't wish to use StarryNight, simply copy the contents of your .meteor/versions file i...
meteor publish-release --from-checkout
When building a custom release track, it's common to keep packages in the /packages directory as git submodules. The following command allows you to fetch all of the latest commits for the submodules in your /packages directory at the same time. git submodule foreach git pull origin master
The first thing you need to do is create a connection to the database using the connect method. After that, you will need a cursor that will operate with that connection. Use the execute method of the cursor to interact with the database, and every once in a while, commit the changes using the comm...
Use tuples in a switch let switchTuple = (firstCase: true, secondCase: false) switch switchTuple { case (true, false): // do something case (true, true): // do something case (false, true): // do something case (false, false): // do something } Or in combina...
The MyBase keyword behaves like an object variable that refers to the base class of the current instance of a class. Public Class Person Public Sub DoSomething() Console.WriteLine("Person") End Sub End Class Public Class Customer Inherits Person Public S...
Build yourself three servers using whatever physical or virtual hardware you wish. (This tutorial assumes you're using Ubuntu as your operating system.) Then repeat the following instructions three times... once for each server. # add the names of each server to the host file of each server sudo n...
Then go into the mongo shell and initiate the replica set, like so: meteor mongo > rs.initiate() PRIMARY> rs.add("mongo-a") PRIMARY> rs.add("mongo-b") PRIMARY> rs.add("mongo-c") PRIMARY> rs.setReadPref('secondaryPreferred')
General Using the package RMySQL we can easily query MySQL as well as MariaDB databases and store the result in an R dataframe: library(RMySQL) mydb <- dbConnect(MySQL(), user='user', password='password', dbname='dbname',host='127.0.0.1') queryString <- "SELECT * FROM table1 t1 JO...

Page 15 of 40