Tutorial by Examples: l

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 ...
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...
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...
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...
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...
GridView definition on ASPX page As shown below, first column of grid is defined as a checkbox column, which is conditionally cleared as shown in further examples below (the header checkbox is only for selecting/un-selecting all rows on current page, but same can be extended for all on grid easily)...
Although not necessary in PHP however it is a very good practice to initialize variables. Uninitialized variables have a default value of their type depending on the context in which they are used: Unset AND unreferenced var_dump($unset_var); // outputs NULL Boolean echo($unset_bool ? "tr...
Fluent wait is a superclass of explicit wait (WebDriverWait) that is more configurable since it can accept an argument to the wait function. I'll pass on implicit wait, since it's a best practice to avoid it. Usage (Java): Wait wait = new FluentWait<>(this.driver) .withTimeout(drive...
Go to File > Settings > Keymap and select the Keymaps option from: Mac OS X Emacs Visual Studio Eclise Netbeans Jbuilder and others, to map the shortcuts to the wanted tool ones.
class UserUnsubscribeJob < ApplicationJob queue_as :default def perform(user) # this will happen later user.unsubscribe end end
This error message may be produced by the OpenSSH ssh client. It means that the TCP connection between the client and the server was closed by the server immediately after being accepted. This message generally indicates the SSH server has been configured not to accept connections from the client fo...

Page 662 of 861