Tutorial by Examples

Logistic regression is a particular case of the generalized linear model, used to model dichotomous outcomes (probit and complementary log-log models are closely related). The name comes from the link function used, the logit or log-odds function. The inverse function of the logit is called the lo...
When an exception is thrown from within a Future, you can (should) use recover to handle it. For instance, def runFuture: Future = Future { throw new FairlyStupidException } val itWillBeAwesome: Future = runFuture ...will throw an Exception from within the Future. But seeing as we can predic...
Using @import allows you to split up your files into multiple smaller files. This makes sense, as you are able to keep better structure for your stylesheets and avoid very large files. Example Let's say you have a few files. - application.scss - header.scss - content |-- article.scss '-- ...
.message color: white .message-important @extend .message background-color: red This will take all of the styles from .message and add them to .message-important. It generates the following CSS: .message, .message-important { color: white; } .message-important { background-...
.message color: white .important background-color: red .message-important @extend .message, .important In the above code @extend is used in one line to add multiple classes' code to .message-important, however, it is possible to use one extend per line like this: .message-importan...
.message color: white background: black .message-important @extend .message font-weight: bold .message-error @extend .message-important font-style: italic This code causes .message-error to extend from .message-important, which means that it will contain code from both .me...
Sometimes, you may want an @extend to be optional, and not require the specified class to exist in your code. .message-important @extend .message !optional background: red This will result in the following CSS: .message-important { background: red; } Disclaimer: This is useful duri...
You can install ServiceStack in 3 ways: Complete Visual studio templates (Self hosted) Start from scratch run ServiceStack Self hosted (Console App) Run ServiceStack inside Asp.net MVC. Complete visual studio templates You can find info about these here: https://github.com/ServiceStack/Ser...
If the file does not contain a header row, File: 1;str_data;12;1.4 3;str_data;22;42.33 4;str_data;2;3.44 2;str_data;43;43.34 7; str_data; 25; 23.32 you can use the keyword names to provide column names: df = pandas.read_csv('data_file.csv', sep=';', index_col=0, ski...
generate sample data frames: In [57]: df3 = pd.DataFrame({'col1':[211,212,213], 'col2': [221,222,223]}) In [58]: df1 = pd.DataFrame({'col1':[11,12,13], 'col2': [21,22,23]}) In [59]: df2 = pd.DataFrame({'col1':[111,112,113], 'col2': [121,122,123]}) In [60]: df3 = pd.DataFrame({'col1':[211,2...
import string import numpy as np import pandas as pd generate sample DF with various dtypes df = pd.DataFrame({ 'int32': np.random.randint(0, 10**6, 10), 'int64': np.random.randint(10**7, 10**9, 10).astype(np.int64)*10, 'float': np.random.rand(10), 'string': ...
import os, time import pyodbc import pandas.io.sql as pdsql def todf(dsn='yourdsn', uid=None, pwd=None, query=None, params=None): ''' if `query` is not an actual query but rather a path to a text file containing a query, read it in instead ''' if query.endswith('.sql') and o...
Natively, Jenkins runs on port 8080. We can establish a proxy from port 80 -> 8080 so Jenkins can be accessed via: http://<url>.com instead of the default http://<url>.com:8080 Begin by installing Nginx. sudo aptitude -y install nginx Remove the default settings for Nginx c...
Functions remember the lexical scope they where defined in. Because of this, we can enclose a lambda in a let to define closures. (defvar *counter* (let ((count 0)) (lambda () (incf count)))) (funcall *counter*) ;; => 1 (funcall *counter*) ;; = 2 In the example above,...
The pattern matching library trivia provides a system trivia.ppcre that allows captured groups to be bound through pattern matching (trivia:match "John Doe" ((trivia.ppcre:ppcre "(.*)\\W+(.*)" first-name last-name) (list :first-name first-name :last-name last-name))) ;...
wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable make
redis-cli ping This should return PONG
The .indexOf method returns the index of a substring inside another string (if exists, or -1 if otherwise) 'Hellow World'.indexOf('Wor'); // 7 .indexOf also accepts an additional numeric argument that indicates on what index should the function start looking "harr dee harr dee harr&quot...
Common Lisp has a standard, which was initially published in 1994 as an ANSI standard. The Common Lisp HyperSpec, short CLHS, provided by LispWorks is an often used HTML documentation, which is derived from the standard document. The HyperSpec can also be downloaded and locally used. Common Lisp d...

Page 373 of 1336