Tutorial by Examples

A LocalDate is a date without a timezone. Consider using them when you are only concerned with the year, month, and day of month and are not interested in an exact time. For example, when we write our date of birth (such as 1960-01-01) we don't care about the timezone in which it happened.
A given year-month-day: LocalDate oneJanuaryNineteenSixty = new LocalDate(1960,1,1); Today's date: LocalDate today = LocalDate.now() Tomorrow: LocalDate tomorrow = LocalDate.now().plusDays(1); Yesterday: LocalDate yesterday = LocalDate.now().minusDays(1); Two weeks ago: LocalDate tw...
Converting a java.util.Calendar object: Calendar rightNow = Calendar.getInstance(); LocalDate today = LocalDate.fromCalendarFields(rightNow); Converting a java.util.Date object: Date rightNow = new Date(); LocalDate today = LocalDate.fromDateFields(rightNow); Converting a string: String d...
this is our index.html file <!DOCTYPE html> <html manifest="index.appcache"> <body> <p>Content</p> </body> </html> then we will create index.appcache file with below codes CACHE MANIFEST index.html write those files that you want ...
Bifunctor is the class of types with two type parameters (f :: * -> * -> *), both of which can be covariantly mapped over simultaneously. class Bifunctor f where bimap :: (a -> c) -> (b -> d) -> f a b -> f c d bimap can be thought of as applying a pair of fmap operation...
There's a useful set of type combinators for building big Functors out of smaller ones. These are instructive as example instances of Functor, and they're also useful as a technique for generic programming, because they can be used to represent a large class of common functors. The identity functor...
The Proxy :: k -> * type, found in Data.Proxy, is used when you need to give the compiler some type information - eg, to pick a type class instance - which is nonetheless irrelevant at runtime. {-# LANGUAGE PolyKinds #-} data Proxy a = Proxy Functions which use a Proxy typically use Scoped...
Since Proxy contains no runtime information, there is never a need to pattern-match on the Proxy constructor. So a common idiom is to abstract over the Proxy datatype using a type variable. showread :: forall proxy a. (Show a, Read a) => proxy a -> String -> String showread _ = (show :: a...
Since Proxy contains no runtime information, you can always write a natural transformation f a -> Proxy a for any f. proxy :: f a -> Proxy a proxy _ = Proxy This is just like how any given value can always be erased to (): unit :: a -> () unit _ = () Technically, Proxy is the term...
Below code is basic example of spark launcher.This can be used if spark job has to be launched through some application. val sparkLauncher = new SparkLauncher //Set Spark properties.only Basic ones are shown here.It will be overridden if properties are set in Main class. sparkLauncher.setSparkHom...
Overview: There are typically two types of SAS Deployments: SAS Foundation only installation (BASE SAS). This is typically is installed on a PC. It does not run any server software. SAS Planned Deployment for their server architecture which will install the SAS server environment along wit...
There are several different ways to specify props in JSX. JavaScript Expressions You can pass any JavaScript expression as a prop, by surrounding it with {}. For example, in this JSX: <MyComponent count={1 + 2 + 3 + 4} /> Inside the MyComponent, the value of props.count will be 10, becau...
In JSX expressions that contain both an opening tag and a closing tag, the content between those tags is passed as a special prop: props.children. There are several different ways to pass children: String Literals You can put a string between the opening and closing tags and props.children will ju...
Description: mov copies values of bits from source argument to destination argument. Common source/destination are registers, usually the fastest way to manipulate values with[in] CPU. Another important group of source_of/destination_for values is computer memory. Finally some immediate values m...
This is usually used for renaming or shortening long namespace references such referring to components of a library. namespace boost { namespace multiprecision { class Number ... } } namespace Name1 = boost::multiprecision; // Both Type declarations are equivale...
Alias Declaration are affected by preceding using statements namespace boost { namespace multiprecision { class Number ... } } using namespace boost; // Both Namespace are equivalent namespace Name1 = boost::multiprecision; namespace Name2 = multiprecision; ...
PyMongo is a native Python driver for MongoDB. Install PyMongo pip install pymongo Create a connection Use MongoClient to create a connection. MongoClient defaults to MongoDB instance running on localhost:27017 if not specified. from pymongo import MongoClient client = MongoClient() Acce...
For a circular View (in this case TextView) create a drawble round_view.xml in drawble folder: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid...
Php arrayiterator allows you to modify and unset the values while iterating over arrays and objects. Example: $array = ['1' => 'apple', '2' => 'banana', '3' => 'cherry']; $arrayObject = new ArrayObject($array); $iterator = $arrayObject->getIterator(); for($iterator; $iterator-...
To declare a single namespace with hierarchy use following example: namespace MyProject\Sub\Level; const CONNECT_OK = 1; class Connection { /* ... */ } function connect() { /* ... */ } The above example creates: constant MyProject\Sub\Level\CONNECT_OK class MyProject\Sub\Level\Connection...

Page 1041 of 1336