Tutorial by Examples: c

Ember CLI allows you to use one of two options to generate a new app: Create a folder and run ember init (generates application structure and sets up git and makes your first commit) Run ember new <app name> (creates a folder with the specified name, steps into it and runs ember init) O...
Elixir doesn't have loops. Instead of them for lists there are great Enum and List modules, but there are also List Comprehensions. List Comprehensions can be useful to: create new lists iex(1)> for value <- [1, 2, 3], do: value + 1 [2, 3, 4] filtering lists, using guard expressi...
Maps are the Elixir key-value (also called dictionary or hash in other languages) type. You create a map using the %w{} syntax: %{} // creates an empty map %{:a => 1, :b => 2} // creates a non-empty map Keys and values can use be any type: %{"a" => 1, "b" => 2} ...
CHICKEN is a Scheme interpreter and compiler with its own extension module system called "eggs". It is capable of compiling Scheme to native code by first compiling Scheme to C. Installing Debian or Ubuntu or other derived distros: sudo apt-get install chicken-bin Fedora / RHEL / Ce...
This is useful when you didn't store the PID from a previous command iex(1)> self() #PID<0.138.0> iex(2)> pid("0.138.0") #PID<0.138.0> iex(3)> pid(0, 138, 0) #PID<0.138.0>
Once connected you can publish messages by calling the ISubscriber.Publish method: // grab an instance of an ISubscriber var subscriber = connection.GetSubscriber(); // publish a message to the 'chat' channel subscriber.Publish("chat", "This is a message") Consumers can ...
You can broadcast more complex messages by serializing the payload before you publish it: // definition of a message public class ChatMessage { public Guid Id { get; set; } public string User { get; set; } public string Text { get; set; } } // grab an instance of an ISubscriber...
StackExchange.Redis also supports sending bytes over the pub/sub channel, here we use protobuf-net to serialize our message to a byte array before sending it: // definition of a message (marked up with Protobuf attributes) [ProtoContract] public class ChatMessage { [ProtoMember(1)] pub...
Content has been moved back to good 'ol JSP wiki page
x<sub>2</sub> produces x2 x<sup>2</sup> produces x2
package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; public class Main extends Sprite { //Document Class Main Constructor public function Main() { ...
NSString *urlString = @"https://www.stackoverflow.com"; NSURL *myUrl = [NSURL URLWithString: urlString]; NSURL *myUrl2 = [NSURL URLWithString: urlString]; if ([myUrl isEqual:myUrl2]) return YES;
One (or two) of the coolest new features in recent Xcode releases are the IBInspectable properties and IBDesignable UIViews. These have nothing to do with the functionality of your application but instead impact the developer experience in Xcode. The goal is to be able to visually inspect custom v...
You can run logcat as an adb command or directly in a shell prompt of your emulator or connected device. To view log output using adb, navigate to your SDK platform-tools/ directory and execute: $ adb logcat Alternatively, you can create a shell connection to a device and then execute: $ adb sh...
SELECT e.Fname, e.LName FROM Employees e The Employees table is given the alias 'e' directly after the table name. This helps remove ambiguity in scenarios where multiple tables have the same field name and you need to be specific as to which table you want to return data from. SELECT e.Fname,...
Backbone requires Underscore and (optionally) jQuery - for DOM manipulation (using Backbone.View) and RESTful persistence. The quickest way to get up and running with Backbone is to create an index.html file with simple script tags in the HTML <head>: <html> <head> ...
Below you could find the table Employees with a reference to the table Cities. CREATE TABLE Cities( CityID INT IDENTITY(1,1) NOT NULL, Name VARCHAR(20) NOT NULL, Zip VARCHAR(10) NOT NULL ); CREATE TABLE Employees( EmployeeID INT IDENTITY (1,1) NOT NULL, FirstName VARCHA...
You can specify a column that contains dates so pandas would automatically parse them when reading from the csv pandas.read_csv('data_file.csv', parse_dates=['date_column'])
A recursive function is a function that calls itself in its definition. For example the mathematical function, factorial, defined by factorial(n) = n*(n-1)*(n-2)*...*3*2*1. can be programmed as def factorial(n): #n here should be an integer if n == 0: return 1 else: ...
The static modifier is used to declare a static member, which does not need to be instantiated in order to be accessed, but instead is accessed simply through its name, i.e. DateTime.Now. static can be used with classes, fields, methods, properties, operators, events, and constructors. While an in...

Page 122 of 826