Tutorial by Examples

JSFiddle: https://jsfiddle.net/UnsungHero97/80qod7aL/ HTML <div class="box_shadow"></div> CSS .box_shadow { -webkit-box-shadow: 0px 0px 10px -1px #444444; -moz-box-shadow: 0px 0px 10px -1px #444444; box-shadow: 0px 0px 10px -1px #444444; }
HTML <div class="box_shadow"></div> CSS .box_shadow { background-color: #1C90F3; width: 200px; height: 100px; margin: 50px; -webkit-box-shadow: inset 0px 0px 10px 0px #444444; -moz-box-shadow: inset 0px 0px 10px 0px #444444; box-shadow: inse...
JSFiddle: https://jsfiddle.net/UnsungHero97/80qod7aL/2/ HTML <div class="box_shadow"></div> CSS .box_shadow { background-color: #1C90F3; width: 200px; height: 100px; margin: 50px; } .box_shadow:after { content: ""; width: 190px; height: ...
If you need to match characters that are a part of the regular expression syntax you can mark all or part of the pattern as a regex literal. \Q marks the beginning of the regex literal. \E marks the end of the regex literal. // the following throws a PatternSyntaxException because of the un-close...
The following code will print the arguments to the program, and the code will attempt to convert each argument into a number (to a long): #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <limits.h> int main(int argc, char* argv[]) { for (int ...
Python 2.x2.7 To import a module through a function call, use the importlib module (included in Python starting in version 2.7): import importlib random = importlib.import_module("random") The importlib.import_module() function will also import the submodule of a package directly: c...
-- Create an index for column 'name' in table 'my_table' CREATE INDEX idx_name ON my_table(name);
A unique index prevents the insertion of duplicated data in a table. NULL values can be inserted in the columns that form part of the unique index (since, by definition, a NULL value is different from any other value, including another NULL value) -- Creates a unique index for column 'name' in tabl...
There is a limit to the depth of possible recursion, which depends on the Python implementation. When the limit is reached, a RuntimeError exception is raised: def cursing(depth): try: cursing(depth + 1) # actually, re-cursing except RuntimeError as RE: print('I recursed {} times!'....
To share files or to host simple websites(http and javascript) in your local network, you can use Python's builtin SimpleHTTPServer module. Python should be in your Path variable. Go to the folder where your files are and type: For python 2: $ python -m SimpleHTTPServer <portnumber> For p...
Suppose we want to write a factory function that accepts an arbitrary list of arguments and passes those arguments unmodified to another function. An example of such a function is make_unique, which is used to safely construct a new instance of T and return a unique_ptr<T> that owns the instan...
Defining a member block inside a resource creates a route that can act on an individual member of that resource-based route: resources :posts do member do get 'preview' end end This generates the following member route: get '/posts/:id/preview', to: 'posts#preview' # preview_post_p...
If you are building a function that may be heavy on the processor (either clientside or serverside) you may want to consider a memoizer which is a cache of previous function executions and their returned values. This allows you to check if the parameters of a function were passed before. Remember, p...
# Create a sample DF df = pd.DataFrame(np.random.randn(5, 3), columns=list('ABC')) # Show DF df A B C 0 -0.467542 0.469146 -0.861848 1 -0.823205 -0.167087 -0.759942 2 -1.508202 1.361894 -0.166701 3 0.394143 -0.287349 -0.978102 4 -0.160431 1.054736 -0.785250 ...
The specifier override has a special meaning in C++11 onwards, if appended at the end of function signature. This signifies that a function is Overriding the function present in base class & The Base class function is virtual There is no run time significance of this specifier as is mainl...
With virtual member functions: #include <iostream> struct X { virtual void f() { std::cout << "X::f()\n"; } }; struct Y : X { // Specifying virtual again here is optional // because it can be inferred from X::f(). virtual void f() { std::cout <&lt...
SQLite is a C library that is typically compiled directly into the application by downloading the source code of the latest version, and adding the sqlite3.c file to the project. Many script languages (e.g., Perl, Python, Ruby, etc.) and frameworks (e.g., Android) have support for SQLite; this is d...
A syntactic extension that lets you write \case in place of \arg -> case arg of. Consider the following function definition: dayOfTheWeek :: Int -> String dayOfTheWeek 0 = "Sunday" dayOfTheWeek 1 = "Monday" dayOfTheWeek 2 = "Tuesday" dayOfTheWeek 3 = "W...
A typical use case for a filter is to remove values from an array. In this example we pass in an array and remove any nulls found in it, returning the array. function removeNulls() { return function(list) { for (var i = list.length - 1; i >= 0; i--) { if (typeof list[i...
Another use case for filters is to format a single value. In this example, we pass in a value and we are returned an appropriate true boolean value. function convertToBooleanValue() { return function(input) { if (typeof input !== 'undefined' && input !== null ...

Page 214 of 1336