Tutorial by Examples: c

ADO.NET Connections are one of the simplest ways to connect to a database from a C# application. They rely on the use of a provider and a connection string that points to your database to perform queries against. Common Data Provider Classes Many of the following are classes that are commonly used...
Entity Framework exposes abstraction classes that are used to interact with underlying databases in the form of classes like DbContext. These contexts generally consist of DbSet<T> properties that expose the available collections that can be queried : public class ExampleContext: DbContext ...
A Connection String is a string that specifies information about a particular data source and how to go about connecting to it by storing credentials, locations, and other information. Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword; Storing Your Connection Stri...
You can place named arguments in any order you want. Sample Method: public static string Sample(string left, string right) { return string.Join("-",left,right); } Call Sample: Console.WriteLine (Sample(left:"A",right:"B")); Console.WriteLine (Sample(right...
The zip function accepts 2 parameters of type SequenceType and returns a Zip2Sequence where each element contains a value from the first sequence and one from the second sequence. Example let nums = [1, 2, 3] let animals = ["Dog", "Cat", "Tiger"] let numsAndAnimals ...
stats::heatmap Example 1 (Basic usage) require(graphics); require(grDevices) x <- as.matrix(mtcars) rc <- rainbow(nrow(x), start = 0, end = .3) cc <- rainbow(ncol(x), start = 0, end = .3) hv <- heatmap(x, col = cm.colors(256), scale = "column", RowSideColo...
Compiler definitions run platform specific code. Using them you can make small differences between various platforms. Trigger Game Center achievements on apple devices and google play achievements on Android devices. Change the icons in menus (windows logo in windows, Linux penguin in Linux). P...
The mcparallelDo package allows for the evaluation of R code asynchronously on Unix-alike (e.g. Linux and MacOSX) operating systems. The underlying philosophy of the package is aligned with the needs of exploratory data analysis rather than coding. For coding asynchrony, consider the future packag...
What is an enter selection? In D3.js, when one binds data to DOM elements, three situations are possible: The number of elements and the number of data points are the same; There are more elements than data points; There are more data points than elements; In the situation #3, all the data ...
layer.masksToBounds = true; layer.cornerRadius = 8;
You can build the cross-platform "Hello World" C++ code, using Scons - A Python-language software construction tool. First, create a file called SConstruct (note that SCons will look for a file with this exact name by default). For now, the file should be in a directory right along your h...
foreach varlist1 list1 ?varlist2 list2 ...? body foreach is a powerful control structure that allows looping over a list or multiple lists. set alpha [list a b c d e f] foreach {key} $alpha { puts "key: $key" } Multiple variable names may be specified. set alphaindexes [list a ...
Subclassing also Subclasses Singleton Class class Example end Example.singleton_class #=> #<Class:Example> def Example.foo :example end class SubExample < Example end SubExample.foo #=> :example SubExample.singleton_class.superclass #=> #<Class:Example> ...
Instances never contain a method they only carry data. However we can define a singleton class for any object including an instance of a class. When a message is passed to an object (method is called) Ruby first checks if a singleton class is defined for that object and if it can reply to that mess...
There are three ways to reopen a Singleton Class Using class_eval on a singleton class. Using class << block. Using def to define a method on the object's singleton class directly class Example end Example.singleton_class.class_eval do def foo :foo end end Example.fo...
By default Entity Framework maps decimal properties to decimal(18,2) columns in database tables. public class Box { public int Id { set; get; } public decimal Length { set; get; } public decimal Width { set; get; } public decimal Height { set; get; } } We can change the p...
//all attributes $collection = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSelect('*'); //specific attributes $collection = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSelect('name'); //certain attributes are special...
$productFound = ($product->getId() !== null)
To view difference between two branch git diff <branch1>..<branch2> To view difference between two branch git diff <commitId1>..<commitId2> To view diff with current branch git diff <branch/commitId> To view summary of changes git diff --stat <branch/com...
The revert command allows discarding unwanted uncommitted changes. Reverting changes to a single file. hg revert example.c Reverting all changes. This will discard all changes not just the current directory. hg revert --all hg will output which files were reverted. reverting exa...

Page 407 of 826