Tutorial by Examples: sin

Often times, responsive web design involves media queries, which are CSS blocks that are only executed if a condition is satisfied. This is useful for responsive web design because you can use media queries to specify different CSS styles for the mobile version of your website versus the desktop ver...
HTML comments (optionally preceded by whitespace) will cause code (on the same line) to be ignored by the browser also, though this is considered bad practice. One-line comments with the HTML comment opening sequence (<!--): Note: the JavaScript interpreter ignores the closing characters of H...
In ASP.NET Core there are several different ways we can localize/globalize our app. It's important to pick a way that suits your needs. In this example you'll see how we can make a multilingual ASP.NET Core app that reads language specific strings from .json files and store them in memory to provi...
Installing aws cli in Ubuntu / Debian Instance sudo apt-get install -y python-dev python-pip sudo pip install awscli aws --version aws configure Installing aws cli using python Using pip you can install aws cli in windows, OS X and Linux sudo pip install awscli Configuring the AWS Comman...
Most advanced user interfaces require the user to be able to pass information between the various functions which make up a user interface. MATLAB has a number of different methods to do so. guidata MATLAB's own GUI Development Environment (GUIDE) prefers to use a struct named handles to pass da...
To the average R user, the list structure may appear to be the one of the more complicated data structures to manipulate. There are no guarantees that all the elements within it are of the same type; There is no guaranteed structure of how complicated/non-complicated that the list would be (An eleme...
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...
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))) ;...
The ANSI CL standard uses an extended EBNF syntax notation. The documentation duplicated on Stackoverflow should use the same syntax notation to reduce confusion. Example: specialized-lambda-list::= ({var | (var parameter-specializer-name)}* [&optional {var | (var [initform [supp...
import java.io.*; import java.net.Socket; public class Main { public static void main(String[] args) throws IOException {//We don't handle Exceptions in this example //Open a socket to stackoverflow.com, port 80 Socket socket = new Socket("stackoverflow.com",8...
ob_start is especially handy when you have redirections on your page. For example, the following code won't work: Hello! <?php header("Location: somepage.php"); ?> The error that will be given is something like: headers already sent by <xxx> on line <xxx>. In or...
data.table extends reshape2's melt & dcast functions (Reference: Efficient reshaping using data.tables) library(data.table) ## generate some data dt <- data.table( name = rep(c("firstName", "secondName"), each=4), numbers = rep(1:4, 2), value = rnorm(8) ) ...
pyinstaller myscript.py -F The options to generate a single file are -F or --onefile. This bundles the program into a single myscript.exe file. Single file executable are slower than the one-folder bundle. They are also harder to debug.
The split-sequence library provides a function split-sequence, which allows to split on elements of a sequence (split-sequence:split-sequence #\Space "John Doe II") ;; => ("John" "Doe" "II")
The password in a credential object is an encrypted [SecureString]. The most straightforward way is to get a [NetworkCredential] which does not store the password encrypted: $credential = Get-Credential $plainPass = $credential.GetNetworkCredential().Password The helper method (.GetNetworkCrede...
base.twig.html <!DOCTYPE html> <html> <head> <title>{{ title | default('Hello World') }}</title> <link rel="stylesheet" type="text/css" href="theme.css"> {% block css %} {% endblock %} &...
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&...
bc is an arbitrary precision calculator language. It could be used interactively or be executed from command line. For example, it can print out the result of an expression: echo '2 + 3' | bc 5 echo '12 / 5' | bc 2 For floating-post arithmetic, you can import standard library bc -l: echo ...
Fish shell is friendlier yet you might face trouble while using with virtualenv or virtualenvwrapper. Alternatively virtualfish exists for the rescue. Just follow the below sequence to start using Fish shell with virtualenv. Install virtualfish to the global space sudo pip install virtualfish...

Page 43 of 161