Tutorial by Examples: ci

function social_profiles( $contactmethods ) { $contactmethods['facebook_profile'] = 'Facebook Profile URL'; $contactmethods['twitter_profile'] = 'Twitter Profile URL'; $contactmethods['google_profile'] = 'Google Profile URL'; $contactmethods['linkedin_profile'] = 'Li...
It is sometimes useful to verify that your work on Developer edition hasn't introduced a dependency on any features restricted to Enterprise edition. You can do this using the sys.dm_db_persisted_sku_features system view, like so: SELECT * FROM sys.dm_db_persisted_sku_features Against the datab...
from datetime import datetime import pandas_datareader.data as wb stocklist = ['AAPL','GOOG','FB','AMZN','COP'] start = datetime(2016,6,8) end = datetime(2016,6,11) p = wb.DataReader(stocklist, 'yahoo',start,end) p - is a pandas panel, with which we can do funny things: let's see what...
Here is an example Picasso Circle Transform class based on the original, with the addition of a thin border, and also includes functionality for an optional separator for stacking: import android.graphics.Bitmap; import android.graphics.BitmapShader; import android.graphics.Canvas; import androi...
An immutable object is an object whose state cannot be changed. An immutable class is a class whose instances are immutable by design, and implementation. The Java class which is most commonly presented as an example of immutability is java.lang.String. The following is a stereotypical example: ...
To convert decimal number to binary format use base 2 Int32 Number = 15; Console.WriteLine(Convert.ToString(Number, 2)); //OUTPUT : 1111 To convert decimal number to octal format use base 8 int Number = 15; Console.WriteLine(Convert.ToString(Number, 8)); //OUTPUT : 17 To conv...
In Elm, reducing functions are called "folds", and there are two standard methods to "fold" values up: from the left, foldl, and from the right, foldr. > List.foldl (+) 0 [1,2,3] 6 : number The arguments to foldl and foldr are: reducing function: newValue -> accumul...
It is also possible to create archives of other items than HEAD, such as branches, commits, tags, and directories. To create an archive of a local branch dev: git archive --output=archive-dev.zip --prefix=src-directory-name dev To create an archive of a remote branch origin/dev: git archive --...
A has_many :through association is often used to set up a many-to-many connection with another model. This association indicates that the declaring model can be matched with zero or more instances of another model by proceeding through a third model. For example, consider a medical practice where p...
A has_one :through association sets up a one-to-one connection with another model. This association indicates that the declaring model can be matched with one instance of another model by proceeding through a third model. For example, if each supplier has one account, and each account is associated...
A has_and_belongs_to_many association creates a direct many-to-many connection with another model, with no intervening model. For example, if your application includes assemblies and parts, with each assembly having many parts and each part appearing in many assemblies, you could declare the models...
Circle To create a circle, define an element with an equal width and height (a square) and then set the border-radius property of this element to 50%. HTML <div class="circle"></div> CSS .circle { width: 50px; height: 50px; background: rgb(246, 156, 85); ...
An element's opacity can be set using the opacity property. Values can be anywhere from 0.0 (transparent) to 1.0 (opaque). Example Usage <div style="opacity:0.8;"> This is a partially transparent element </div> Property ValueTransparencyopacity: 1.0;Opaqueopacity: 0....
Changing some CSS attribute will trigger the browser to synchronously calculate the style and layout, which is a bad thing when you need to animate at 60fps. DON'T Animate with left and top trigger layout. #box { left: 0; top: 0; transition: left 0.5s, top 0.5s; position: absolute; ...
If you have a multi-parameter type-class with arguments a, b, c, and x, this extension lets you express that the type x can be uniquely identified from a, b, and c: class SomeClass a b c x | a b c -> x where ... When declaring an instance of such class, it will be checked against all other in...
When developing several applications on one machine, it becomes useful to separate out dependencies into virtual environments. With the use of virtualenv, these environments are sourced into your shell so that when you run a command, it comes from that virtual environment. This is most commonly in...
import random probability = 0.3 if random.random() < probability: print("Decision with probability 0.3") else: print("Decision with probability 0.7")
A subprogram (which defines a procedure), can be either a subroutine or a function; it is said to be an internal subprogram if it is called or invoked from the same program or subprogram that contains it, as follows program my_program ! declarations ! executable statements, ! among which...
A subprogram is said to be external when it is not contained in the main program, nor in a module or antoher subprogram. In particular it can be defined by means of a programming language other than Fortran. When an external subprogram is invoked, the compiler cannot access to its code, so all the ...
If efficiency is important, a fast way to iterate over pixels in a cv::Mat object is to use its ptr<T>(int r) method to obtain a pointer to the beginning of row r (0-based index). According to the matrix type, the pointer will have a different template. For CV_8UC1: uchar* ptr = image.ptr&...

Page 12 of 42