- Latest Standard ISO version x86_64 is recommended (http://alpinelinux.org/downloads/)
- Create new VM ("Linux 2.6 / 3.x / 4.x (64-bit)")
- 1 CPU w/ 512BM RAM and 1 GB default (VDI) disk is more than sufficient
- Default networking (NAT)
- Boot and add Alpine ISO as attached virtual install media
- Default root password is blank (though note - ssh PermitRootLogin defaults to disallow blank passwords and: prohibit-password; switch to yes for Host ssh)
- Run setup-alpine
- Defaults are fine, but you do want "sys" disk setup to sda, y to confirm
#!/bin/bash | |
# Install Spark on CentOS 7 | |
yum install java -y | |
java -version | |
yum install wget -y | |
wget http://downloads.typesafe.com/scala/2.11.7/scala-2.11.7.tgz | |
tar xvf scala-2.11.7.tgz | |
sudo mv scala-2.11.7 /usr/lib | |
sudo ln -s /usr/lib/scala-2.11.7 /usr/lib/scala |
I know I'm late with this article for about 5 years or so, but people are still using Python 2.x, so this subject is relevant I think.
Some facts first:
- Unicode is an international encoding standard for use with different languages and scripts
- In python-2.x, there are two types that deal with text.
str
is an 8-bit string.
unicode
is for strings of unicode code points.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
--- Actions --- | |
$Copy <M-C> | |
$Cut <M-X> <S-Del> | |
$Delete <Del> <BS> <M-BS> | |
$LRU | |
$Paste <M-V> | |
$Redo <M-S-Z> <A-S-BS> | |
$SearchWeb <A-S-G> | |
$SelectAll <M-A> | |
$Undo <M-Z> |
Get the current Unix timestamp (seconds from 1970-01-01T00:00:00Z) in SQL.
- MySQL:
UNIX_TIMESTAMP()
- PostgreSQL:
CAST(EXTRACT(epoch FROM NOW()) AS INT)
- MS SQL:
DATEDIFF(s, '1970-01-01', GETUTCDATE())
- Oracle:
(CAST(SYS_EXTRACT_UTC(SYSTIMESTAMP) AS DATE) - DATE'1970-01-01') * 86400
dir="." #Set the default temp dir | |
tmpA1="$dir/spectrumhist_1_$$.png" | |
tmpB1="$dir/spectrumhist_1_$$.cache" | |
trap "rm -f $tmpA1 $tmpB1; exit 0" 0 #remove temp files | |
trap "rm -f $tmpA1 $tmpB1; exit 1" 1 2 3 15 #remove temp files | |
if [ $# -eq 2 ] | |
then | |
colors=$2 | |
else | |
colors=8 |
// ==UserScript== | |
// @name 百度网盘aria2导出工具 | |
// @author acgotaku311 | |
// @description 一个方便吧百度网盘的Aria2rpc导出的脚本。 | |
// @encoding utf-8 | |
// @include http://*n.baidu.com/s/* | |
// @include http://*n.baidu.com/disk/home* | |
// @include http://*n.baidu.com/share/link* | |
// @include https://*n.baidu.com/s/* | |
// @include https://*n.baidu.com/disk/home* |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.