Tutorial by Examples

Dependencies can be added for specific configuration like test/androidTest androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1' testCompile 'junit:junit:3.8.1' Alternatively create your own configuration configurations { myconfig } And then download dependency fo...
Suppose we have an array of integers and we want to figure out the maximum value without holding the whole array in memory all at once. This approach can be adapted to handle a variety of other situations in which data needs to be processed while being deserialized instead of after. extern crate se...
Selecting only the attribute value of a link:href will return the relative URL. String bodyFragment = "<div><a href=\"/documentation\">Stack Overflow Documentation</a></div>"; Document doc = Jsoup.parseBodyFragment(bodyFragment); ...
Placeholders can be used in strings to automatically substitute the values in the final string. container = "cup" liquid = "coffee" string = "Filling the #{container} with #{liquid}..." The above String - when printed - will say: Filling the cup with coffee... Yo...
GHCi supports imperative-style breakpoints out of the box with interpreted code (code that's been :loaded). With the following program: -- mySum.hs doSum n = do putStrLn ("Counting to " ++ (show n)) let v = sum [1..n] putStrLn ("sum to " ++ (show n) ++ " = "...
If you want to extract a subset of an array (i.e. numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9]) you can easily do this with one of the following examples: numbers[0..2] will return [1, 2, 3] numbers[3...-2] will return [3, 4, 5, 6] numbers[-2..] will return [8, 9] numbers[..] will return [1, 2, 3, 4,...
Sometimes we need to change words position from one place to another or reduce size of the words and change the color of words automatically to improve the attraction of our website or web apps. JQuery helps a lot with this concept using fadeIn(), hide(), slideDown() but its functionality are limite...
CoffeeScriptJavaScriptis, =====isnt, !=!==not!and&&or||true, yes, ontruefalse, no, offfalse@, thisthisofininNo equivalenta ** bMath.pow(a, b)a // bMath.floor(a / b)a %% b(a % b + b) % b
A singleton is a pattern that restricts the instantiation of a class to one instance/object. For more info on python singleton design patterns, see here. class Singleton: def __new__(cls): try: it = cls.__it__ except AttributeError: it = cls.__it__ =...
The TinkerPop "toy graphs" make it possible to quickly try out some basic features of Gremlin. These graphs are pre-built and packaged with the Gremlin Console. The most commonly used "toy graphs" are "Modern" and "The Crew". When asking questions on StackOver...
The disabled binding adds a disabled attribute to a html element causing it to no longer be editable or clickable. This is useful mainly for <input>, <select>, <textarea>, <a> and <button> elements <input data-bind="disabled: disableInput"/> <sc...
Event handler to be invoked when a DOM element is submitted. <form data-bind="submit: doSomething"> <!-- form content here --> <button type="submit"></button> </form> <script type="text/javascript"> var vm = { ...
Many bugs in knockout data binds are caused by undefined properties in a viewmodel. Knockout has two handy methods to retrieve the binding context of an HTML element: // Returns the binding context to which an HTMLElement is bound ko.contextFor(element); // Returns the viewmodel to which ...
The with binding binds the HTML inside the bound node to a separate context: <div data-bind="with: subViewModel"> <p data-bind="text: title"></p> </div> The with binding may also be used without a container element where a container element may n...
CREATE TABLE all_datetime_types( c_date date, c_timestamp timestamp ); Minimum and maximum data values: insert into all_datetime_types values ('0001-01-01','0001-01-01 00:00:00.000000001'); insert into all_datetime_types values ('9999-12-31','9999-12-31 23:59:59.999999999');
CREATE TABLE all_text_types( c_char char(255), c_varchar varchar(65535), c_string string ); Sample data: insert into all_text_type values ('some ****&&&%%% char value ','some $$$$#####@@@@ varchar value','some !!~~~++ string value' );
CREATE TABLE all_numeric_types( c_tinyint tinyint, c_smallint smallint, c_int int, c_bigint bigint, c_decimal decimal(38,3) ); Minimum and maximum data values: insert into all_numeric_types values (-128,-32768,-2147483648,-9223372036854775808,-99999999999999999999999999999999...
CREATE TABLE all_floating_numeric_types( c_float float, c_double double ); Minimum and maximum data values: insert into all_floating_numeric_types values (-3.4028235E38,-1.7976931348623157E308); insert into all_floating_numeric_types values (-1.4E-45,-4.9E-324); insert into all_floatin...
CREATE TABLE all_binary_types( c_boolean boolean, c_binary binary ); Sample data: insert into all_binary_types values (0,1234); insert into all_binary_types values (1,4321); Note: For boolean, internally it stored as true or false. For binary, it will store base64 encoded value....
ARRAY CREATE TABLE array_data_type( c_array array<string>) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' COLLECTION ITEMS TERMINATED BY '&'; Create data.csv with data: arr1&arr2 arr2&arr4 Put data.csv in /tmp folderand load this data in Hive LOAD DATA LOCAL I...

Page 695 of 1336