Tutorial by Examples: c

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...
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__ =...
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 ...
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...
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...
Do not allocate new objects in onDraw @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Paint paint = new Paint(); //Do not allocate here } Instead of drawing drawables in canvas... drawable.setBounds(boundsRect); drawable.draw(canvas); Use a B...
One of the useful unit when creating a responsive application. Its size depends on its parent container. Equation: ( Parent Container`s width ) * ( Percentage(%) ) = Output For Example: Parent has 100px width while the Child has 50%. On the output, the Child's width will be half(50%) of t...
HTML: <div class="wrapper"> <div class="outer"> <div class="inner"> centered </div> </div> </div> CSS: .wrapper { height: 600px; text-align: center; } .outer { display: table; ...
HTML: <div class="wrapper"> <div class="centered"> centered </div> </div> CSS: .wrapper { position: relative; height: 600px; } .centered { position: absolute; z-index: 999; transform: translate(-50%, -50%); top:...
Typed holes can make it easier to define functions, through an interactive process. Say you want to define a class instance Foo Bar (for your custom Bar type, in order to use it with some polymorphic library function that requires a Foo instance). You would now traditionally look up the documentati...
Redis has publish/subscribe for sending messages. This is handled by subscribing to a channel & publishing to channel. Yes, subscribers will subscribe to one or more channels. Publisher need not know who are all subscribers. Instead, publisher will publish to specific channel. All the subscriber...
POSIX character classes are predefined sequences for a certain set of characters. Character classDescription[:alpha:]Alphabetic characters[:alnum:]Alphabetic characters and digits[:digit:]Digits[:xdigit:]Hexadecimal digits[:blank:]Space and Tab[:cntrl:]Control characters[:graph:]Visible characters ...
The New-Object cmdlet is used to create an object. # Create a DateTime object and stores the object in variable "$var" $var = New-Object System.DateTime # calling constructor with parameters $sr = New-Object System.IO.StreamReader -ArgumentList "file path" In many instan...
To check for location services we need real device but for testing purpose we can also use simulator and add our own location by following below steps: add new GPX file into your project. in GPX file add waypoints like <?xml version="1.0"?> <gpx version="1.1" cre...
git config --global help.autocorrect 17 This enables autocorrect in git and will forgive you for your minor mistakes (e.g. git stats instead of git status). The parameter you supply to help.autocorrect determines how long the system should wait, in tenths of a second, before automatically applyin...
private List<FooBar> _fooBars; public List<FooBar> FooBars { get { return _fooBars ?? (_fooBars = new List<FooBar>()); } } The first time the property .FooBars is accessed the _fooBars variable will evaluate as null, thus falling through to the assignment statement ass...
Asynchronous ajax call With this type of ajax call, code does not wait for the call to complete. $('form.ajaxSubmit').on('submit',function(){ // initilization... var form = $(this); var formUrl = form.attr('action'); var formType = form.attr('method'); var formData ...
git clean -f Will remove all untracked files.
If you need to download files with git under a proxy, setting proxy server system-wide couldn't be enough. You could also try the following: git config --global http.proxy http://<proxy-server>:<port>/

Page 431 of 826