Tutorial by Examples

Detailed instructions on getting swt set up or installed.
Detailed instructions on getting encoding set up or installed.
The reduce(), reduceLeft() and reduceRight methods are similar to folds. The function passed to reduce takes two values and yields a third. When operating on a list, the first two values are the first two values in the list. The result of the function and the next value in the list are then re-appli...
Outer joins return all the rows from one or both tables, plus matching rows. Table People PersonID FirstName 1 Alice 2 Bob 3 Eve Table Scores PersonID Subject Score 1 Math 100 2 Math 54 2 Science 98 Left joining the tables: Select * f...
This simple function will execute the specified Select SQL command and return the result as data set. Public Function ReadFromDatabase(ByVal DBConnectionString As String, ByVal SQL As String) As DataTable Dim dtReturn As New DataTable Try 'Open the connection using the connection...
This example uses the Thread Class, but multithreaded applications can also be made using BackgroundWorker. The AddNumber, SubstractNumber, and DivideNumber functions will be executed by separate threads: Edit: Now the UI thread waits for the child threads to finish and shows the result. Module Mo...
Unlike a SELECT statement, a Stored Procedure returns multiple result sets. The requires different code to be used for gathering the results of a CALL in Perl, PHP, etc. (Need specific code here or elsewhere!)
Data not yet known - such as end_date, rating Optional data - such as middle_initial (though that might be better as the empty string) 0/0 - The result of certain computations, such as zero divided by zero. NULL is not equal to "" (blank string) or 0 (in case of integer). others? ...
Using the /p switch with the SET command you can define variables from an Input. This input can be a user Input (keyboard) : echo Enter your name : set /p name= echo Your name is %name% Which can be simplified like this : set /p name=Enter your name : echo Your name is %name% Or you can...
IS NULL / IS NOT NULL -- = NULL does not work like you expect. x <=> y is a "null-safe" comparison. In a LEFT JOIN tests for rows of a for which there is not a corresponding row in b. SELECT ... FROM a LEFT JOIN b ON ... WHERE b.id IS NULL
int fakeMalloc(__local int * addrCounter,int size) { // lock addrCounter // adds size to addrCounter's pointed cell value // unlock // return old value of addrCounter's pointed cell // serial between all threads visiting -> slow ret...
GSON does not support inheritance our of the box. Let's say we have the following class hierarchy: public class BaseClass { int a; public int getInt() { return a; } } public class DerivedClass1 extends BaseClass { int b; @Override public int getIn...
The Android Account Authenticator system can be used to make the client authenticate with a remote server. Three pieces of information are required: A service, triggered by the android.accounts.AccountAuthenticator. Its onBind method should return a subclass of AbstractAccountAuthenticator. An a...
libraryDependency is the SettingKey that handles 'managed' library dependencies, which are dependencies that are automatically downloaded, matching the supplied versions. To add a single dependency: libraryDependencies += "com.typesafe.slick" %% "slick" % "3.2.0-M1" ...
A repository is a place that SBT looks for libraryDependencies. If the build complains about not finding a dependency, it can be lacking the correct repository. Within SBT, the repositories are listed in the resolvers SettingKey: resolvers += "Flyway" at "https://flywaydb.org/repo&qu...
The standard structure for a project built by SBT is: projectName/ build.sbt project/ <SBT sub-build information> src/ main/ scala/ <Scala source files> java/ <Java source files> resources/ ...
This sheet assumes that you are in the root directory of the project, containing the build.sbt. $ indicates a command prompt and > indicates commands run inside the SBT console. Compile a project $ sbt compile Test a project $ sbt test Enter SBT REPL: $ sbt Enter Scala Console with B...
If your project has this: scalaVersion := 2.11 // Replace '2.11' with the version of Scala your project is running on Then you can use %% to automatically get the version of the library compiled against the version of Scala the project is using: libraryDependencies += "com.typesafe.slick&...
A library can be 'pinned' to a specific version of Scala using the % operator between the groupId and the artifactId (the first two strings in a library dependency). In this example, we pin the library with the artifactId of slick to Scala version 2.10: libraryDependencies += "com.typesafe.sl...
Google Chrome supports extensions that augment the way the browser works. They can add functionality to web pages or to the browser UI. Any developer can create an extension and list it in the Chrome Web Store. See more on the extensions page.

Page 919 of 1336