Tutorial by Examples

The Fluent NHibernate is a library to help you to map the entities using C# code instead of xml mappings. Fluent NHibernate uses the fluent pattern and it is based on conventions to create the mappings and it gives you the power of the visual studio tools (such as intellisense) to improve the way yo...
IQueryable<Cat> cats = session.Query<Cat>() .Where(c => c.Name == "Max");
Also known as bogosort. import Data.List (permutations) sorted :: Ord a => [a] -> Bool sorted (x:y:xs) = x <= y && sorted (y:xs) sorted _ = True psort :: Ord a => [a] -> [a] psort = head . filter sorted . permutations Extremely inefficient (on today's compu...
A basic QueryOver query is performed against an ISession using the QueryOver<T> method, where T is the type of a mapped entity. IList<Customer> customers = session.QueryOver<Customer>() .Where(c => c.LastName == "Simpson") .List();
Google currently has two ways to load the JS library for Google Visualization (a.k.a Google Charts), gstatic loader (https://www.gstatic.com/charts/loader.js) and jsapi (https://www.google.com/jsapi). The gstatic loader is recommended because Google is transitioning away from jsapi to the gstati...
Show a "Hello World!" in message box. MsgBox, Hello World! Show "Hello World!" stored in variable MyString in message box. MyString := "Hello World!" MsgBox, %MyString% Show a "Hello World!" in tooltip. #Persistent Tooltip, Hello World! Show a &q...
In the logging configuration file of your choice set the logging of the following packages to the levels shown.: # log the sql statement org.hibernate.SQL=DEBUG # log the parameters org.hibernate.type=TRACE There will probably be some logger specific prefixes that are required. Log4j config:...
This will show you the generated SQL, but will not show you the values contained within the queries. <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="hibernateProperties"> <p...
If you have any exposure to other text-based template languages, such as Smarty, Django, or Jinja, you should feel right at home with Twig. It's both designer and developer friendly by sticking to PHP's principles and adding functionality useful for templating environments. The key-features are... ...
Categories provide the ability to add some extra functionality to an object without subclassing or changing the actual object. For example we want to set some custom fonts. Let's create a category that add functionality to UIFont class. Open your XCode project, click on File -> New -> File a...
Def: Final Keyword prevents child classes from overriding a method by prefixing the definition with final. If the class itself is being defined final then it cannot be extended Final Method class BaseClass { public function test() { echo "BaseClass::test() called\n"; } ...

do

The do operator iterates over a block of code until a conditional query equals false. The do-while loop can also be interrupted by a goto, return, break or throw statement. The syntax for the do keyword is: do { code block; } while( condition ); Example: int i = 0; do { Console.W...
The @ sign binds a variable to a name during a pattern match. The bound variable can either be the entire matched object or part of the matched object: sealed trait Shape case class Rectangle(height: Int, width: Int) extends Shape case class Circle(radius: Int) extends Shape case object Point ex...
Pattern matching can also be used to check the type of an instance, rather than using isInstanceOf[B]: val anyRef: AnyRef = "" anyRef match { case _: Number => "It is a number" case _: String => "I...
The [ and [[ operators are primitive functions that are generic. This means that any object in R (specifically isTRUE(is.object(x)) --i.e. has an explicit "class" attribute) can have its own specified behaviour when subsetted; i.e. has its own methods for [ and/or [[. For example, this is...
This operator checks whether the object is of a particular class/interface type. instanceof operator is written as: ( Object reference variable ) instanceof (class/interface type) Example: public class Test { public static void main(String args[]){ String name = "Buyya";...
The left hand operand for these operators must be a either a non-final variable or an element of an array. The right hand operand must be assignment compatible with the left hand operand. This means that either the types must be the same, or the right operand type must be convertible to the left o...
Lazy evaluation means Haskell will evaluate only list items whose values are needed. The basic recursive definition is: f (0) <- 0 f (1) <- 1 f (n) <- f (n-1) + f (n-2) If evaluated directly, it will be very slow. But, imagine we have a list that records all the results, fibs ...
First, instantiate a Toast object with one of the MakeText() methods. This method takes three parameters: the application Context, the text message, and the duration for the toast. It returns a properly initialized Toast object. You can display the toast notification with Show(), as shown in the fol...
The R-Logo is a multilayer raster file (red, green, blue) library(raster) r <- stack("C:/Program Files/R/R-3.2.3/doc/html/logo.jpg") plot(r) The individual layers of the RasterStack object can be adressed by [[. plot(r[[1]])

Page 471 of 1336