View test_spark_python.py
import pandas as pd
import io
import requests
url="https://raw.githubusercontent.com/cs109/2014_data/master/countries.csv"
s=requests.get(url).content
p_df =pd.read_csv(io.StringIO(s.decode('utf-8')))
spark = SQLContext(sc)
s_df = spark.createDataFrame(p_df)
View save_last_200_rows.sql
mysql --database=achoo_backend --execute="show tables" --silent --batch | while read tablename ; do
echo "mysqldump --where="1=1 ORDER BY id DESC LIMIT 200" achoo_backend $tablename > $tablename.sql" ;
done
View cassandra.service
[Unit]
Description=Cassandra
[Service]
Type=simple
User=cassandra
WorkingDirectory=/usr/share/cassandra
ExecStart=/usr/sbin/cassandra -f
Restart=on-failure
RestartSec=10s
View equilibrium_index.java
// A zero-indexed array A consisting of N integers is given. An equilibrium index of this array is any integer P such that 0 ≤ P < N and the sum of elements of lower indices is equal to the sum of elements of higher indices, i.e.
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
class Solution {
public int solution(int[] A) {
View pip2.lua
init = function(args)
local r = {}
r[1] = wrk.format(nil, "/hello?1")
r[2] = wrk.format(nil, "/hello?2")
r[3] = wrk.format(nil, "/hello?3")
r[4] = wrk.format(nil, "/hello?4")
r[5] = wrk.format(nil, "/hello?5")
r[6] = wrk.format(nil, "/hello?6")
r[7] = wrk.format(nil, "/hello?7")
View curl_http2.md
  • install cURL with nghttp2 support
brew install curl --with-nghttp2
  • link the formula to replace the system cURL
brew link curl --force
View dataframe.jl
using Query, DataFrames, Feather
#Reading a CSV and ignoring the top line
df = readtable("data/netflix_prize/download/training_set//mv_0016765.txt", header = false, skipstart=1)
#=
julia> head(df)
6×3 DataFrames.DataFrame
│ Row │ x1 │ x2 │ x3 │
View installing_lxc_centos_7.2.md

Installing LXC on CentOS 7.2

Version

[root@be0 ~]# cat -v /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

Installing

View withings-smart-kid-scale-ws-40.md

Withings Smart Kid Scale WS 40

The smart in the name is a joke, they are kidding, the scale is pretty dumb.

What an uter crap

2.4 out of 5 stars on Amazon (I have promised myself not to buy anything below 3 starts)

Problem

View story.of.elm.txt
23:38:59 <l1x> or I need a function that return an integer with the current UTC eppoch
23:38:59 <l1x> epoch*
23:39:05 <l1x> hoelzro: :DDD
23:39:13 <l1x> yes!
23:39:18 <hoelzro> you can't do that
23:39:22 <hoelzro> sorry =(