Tutorial by Examples

Below is a simple example which shows average item's price of each item per weekday. First, suppose we have a table which keeps daily records of all items' prices. CREATE TABLE tbl_stock(item NVARCHAR(10), weekday NVARCHAR(10), price INT); INSERT INTO tbl_stock VALUES ('Item1', 'Mon', 110), (...
Returns the names of constants in the specified Enum as a string array: Module Module1 Enum Size Small Medium Large End Enum Sub Main() Dim sizes = [Enum].GetNames(GetType(Size)) For Each size In sizes Console.WriteLine(size) Next End Sub ...
In normal mode, we can increment the nearest number on the line at or after the cursor with <C-a> and decrement it with <C-x>. In the following examples, the cursor position is indicated by ^. Incrementing and decrementing numbers for i in range(11): ^ <C-x> decrements ...
CREATE SYNONYM EmployeeData FOR MyDatabase.dbo.Employees
The core idea behind the Feature Branch Workflow is that all feature development should take place in a dedicated branch instead of the master branch. This encapsulation makes it easy for multiple developers to work on a particular feature without disturbing the main codebase. It also means the mast...
The Math.random() function should give random numbers that have a standard deviation approaching 0. When picking from a deck of card, or simulating a dice roll this is what we want. But in most situations this is unrealistic. In the real world the randomness tends to gather around an common normal...
Future<Results> costlyQuery() { var completer = new Completer(); database.query("SELECT * FROM giant_table", (results) { // when complete completer.complete(results); }, (error) { completer.completeException(error); }); // this returns essentially im...
Common Lisp REPL is an interactive environment. Every form written after the prompt is evaluated, and its value is afterwards printed as result of the evaluation. So the simplest possible “Hello, World!” program in Common Lisp is: CL-USER> "Hello, World!" "Hello, World!" CL...
Flash Player 10 introduced the Vector.<*> generic list type that was faster than the Array. However, this is not entirely true. Only the following Vector types are faster than the Array counterparts, due to the way they are implemented in Flash Player. Vector.<int> - Vector of 32-bit ...
Creating and configuring Sprite and TextField objects at runtime can be costly if you are creating hundreds of thousands of these on a single frame. Therefore a common trick is "pooling" these objects for later reuse. Remember we are not just trying to optimize the creation time (new Sprit...
Working Source - https://github.com/benhysell/V.TouchIdExample Long form description - http://benjaminhysell.com/archive/2014/11/authentication-in-xamarin-ios-with-touch-id-or-passcode/ //Simple View with a switch to enable / disable Touch ID and //a button to invoke authentication /// <s...
Flash dispatches Events for most of its objects. One of the most basic event is ENTER_FRAME, which is dispatched (at the framerate of the SWF) on every display list object. import flash.display.Sprite; import flash.events.Event; var s:Sprite = new Sprite(); s.addEventListener(Event.ENTER_FRAME...
You can create your own events and dispatch them, by extending the Event class. import flash.events.Event; class MyEvent extends Event { var data: String; static public var MY_EVENT_TYPE = "my_event_my_event_code"; public function MyEvent(type: String, data: Str...
class Person(models.Model): name = models.CharField(max_length=50) description = models.TextField() class Club(models.Model): name = models.CharField(max_length=50) members = models.ManyToManyField(Person) Here we define a relationship where a club has many Persons and memb...
Lodash works equally well on both servers (like node.js) and browsers. node.js with npm Download with npm from the CLI: npm install lodash Then in your node scripts: var _ = require("lodash"); // use lodash in your program... Download own copy for clientside in website (ie. in...
Codename One is a set of tools for mobile application development that derive a great deal of its architecture from Java. Codename One's mission statement is: Unify the complex and fragmented task of mobile device programming into a single set of tools, APIs & services. As a result create a...
UITextView has built in support to auto detect a variety of data. The data that is able to be auto-detected currently includes: enum { UIDataDetectorTypePhoneNumber = 1 << 0, UIDataDetectorTypeLink = 1 << 1, UIDataDetectorTypeAddress = 1 << 2, UID...
Single JAR Sometimes you have a local JAR file you need to add as a dependency to your Gradle build. Here's how you can do this: dependencies { compile files('path/local_dependency.jar') } Where path is a directory path on your filesystem and local_dependency.jar is the name of your local...
Dependencies in Gradle follow the same format as Maven. Dependencies are structured as follows: group:name:version Here's an example: 'org.springframework:spring-core:4.3.1.RELEASE' To add as a compile-time dependency, simply add this line in your dependency block in the Gradle build file: ...
In F#, all functions take exactly one parameter. This seems an odd statement, since it's trivially easy to declare more than one parameter in a function declaration: let add x y = x + y But if you type that function declaration into the F# interactive interpreter, you'll see that its type signat...

Page 315 of 1336