Tutorial by Examples: f

Python 3.x3.2 accumulate yields a cumulative sum (or product) of numbers. >>> import itertools as it >>> import operator >>> list(it.accumulate([1,2,3,4,5])) [1, 3, 6, 10, 15] >>> list(it.accumulate([1,2,3,4,5], func=operator.mul)) [1, 2, 6, 24, 120] ...
Ionic 1.2 officially supports deployment as a website If you're not using any Cordova plugins then there is no problem (if you really wish to) to upload the contents of the www folder to your server, and woila - you'll have the same app. However, it is important to note that Ionic 1 never intended...
The thing is; you can't connect Ionic to any database (MySQL, Postgres, MSSQL, ...) directly. The keyword here is directly. No, there's no workaround, no magic involved, it's just not the way this is supposed to work. Ionic works on top of Angular and Angular is a frontend framework. However, the ...
The Replace function in SQL is used to update the content of a string. The function call is REPLACE( ) for MySQL, Oracle, and SQL Server. The syntax of the Replace function is: REPLACE (str, find, repl) The following example replaces occurrences of South with Southern in Employees table: FirstN...
Enable and configure the experimental Gradle plugin to improve AndroidStudio's NDK support. Check that you fulfill the following requirements: Gradle 2.10 (for this example) Android NDK r10 or later Android SDK with build tools v19.0.0 or later Configure MyApp/build.gradle file Edit the dep...
HTML: <div id="title"> <h1 data-content="HOVER">HOVER</h1> </div> CSS: *{margin:0;padding:0;} html,body{height:100%;width:100%;overflow:hidden;background:#0099CC;} #title{ position:absolute; top:50%; left:50%; transform:translate(-50%,-...
name = MyCompany Theme description = A Bootstrap Sub-theme. core = 7.x base theme = bootstrap ;;;;;;;;;;;;;;;;;;;;; ;; Regions ;;;;;;;;;;;;;;;;;;;;; regions[navigation] = 'Navigation' regions[header] = 'Top Bar' regions[highlighted] = 'Highlighted' regions[help] ...
When to use abstract classes: To implement the same or different behaviour among multiple related objects When to use interfaces: to implement a contract by multiple unrelated objects Abstract classes create "is a" relations while interfaces provide "has a" capability. This c...
sudo apt-add-repository ppa:brightbox/ruby-ng Hit Enter to confirm sudo apt-get update Then you can install your ruby version of choice (the ppa supports ruby2.0 ruby2.1 ruby2.2 ruby2.3 and legacy versions ruby1.8 ruby1.9.1) Don't forget to include the respective -dev package for your version. Ot...
To see all the facts involving the le relation from the prelude: Coq < Search le. le_n: forall n : nat, n <= n le_S: forall n m : nat, n <= m -> n <= S m ... max_l: forall n m : nat, m <= n -> Nat.max n m = n max_r: forall n m : nat, n <= m -> Nat.max n m = m ... ...
Search for all facts involving a pattern in an hypothesis or conclusion: Coq < Search (_ + O). plus_n_O: forall n : nat, n = n + 0 The _ character serves as a wildcard, it can be used multiple times: Coq < Search (S _ <= _). le_S_n: forall n m : nat, S n <= S m -> n <= m le...
Let's say your launch activity is called MainActivity, in your app com.example.myapp. In the manifest: <activity android:name=".MainActivity" > <intent-filter> <action android:name="android.intent.action.MAIN"/> ...
public static int GetProcessAffinityMask(string processName = null) { Process myProcess = GetProcessByName(ref processName); int processorAffinity = (int)myProcess.ProcessorAffinity; Console.WriteLine("Process {0} Affinity Mask is : {1}", processName, ...
public static void SetProcessAffinityMask(int affinity, string processName = null) { Process myProcess = GetProcessByName(ref processName); Console.WriteLine("Process {0} Old Affinity Mask is : {1}", processName, FormatAffinity((int)myProcess.ProcessorAffinity)...
The dimension attribute on an object specifies that that object is an array. There are, in Fortran 2008, five array natures:1 explicit shape assumed shape assumed size deferred shape implied shape Take the three rank-1 arrays2 integer a, b, c dimension(5) a ! Explicit shape (default ...
example: df = pd.DataFrame({'group1' : ['A', 'A', 'A', 'A', 'B', 'B', 'B', 'B'], 'group2' : ['C', 'C', 'C', 'D', 'E', 'E', 'F', 'F'], 'B' : ['one', np.NaN, np.NaN, np.NaN, ...
Gnuplot is able to generate a graphic from a script file which allows for a sequence of commands necessary to draw a graphic to be executed in sequence instead of type in manually. For the purpose of this example we'll create a simple script to draw a sin(x). Create a script file Create a file si...
# example data DT = data.table(iris) DT[, Bin := cut(Sepal.Length, c(4,6,8))] summary is handy for browsing summary statistics. Besides direct usage like summary(DT), it can also be applied per-group conveniently with split: lapply(split(DT, by=c("Species", "Bin"), drop=TRU...
# example data DT = data.table(iris) DT[, Bin := cut(Sepal.Length, c(4,6,8))] To apply the same summarizing function to every column by group, we can use lapply and .SD DT[, lapply(.SD, median), by=.(Species, Bin)] # Species Bin Sepal.Length Sepal.Width Petal.Length Petal.Width # 1...
In molecular biology and genetics, GC-content (or guanine-cytosine content, GC% in short) is the percentage of nitrogenous bases on a DNA molecule that are either guanine or cytosine (from a possibility of four different ones, also including adenine and thymine). Using BioPython: >>> from...

Page 176 of 457