I hereby claim:
- I am jlengrand on github.
- I am jlengrand (https://keybase.io/jlengrand) on keybase.
- I have a public key ASBOPLSHLfuup2FQb9eaoKIljG0q1LIqAesn4cYTaeiJQwo
To claim this, I am signing this object:
println("Ratings query took : ${measureTimeMillis() { | |
transaction(db) { | |
var result = (Titles innerJoin Ratings).slice(Titles.primaryTitle, Titles.titleType, Ratings.averageRating, Ratings.numVotes).select { | |
((Titles.primaryTitle like "%batman%") and (Titles.titleType like "movie") | |
and Titles.tconst.eq(Ratings.tconst)) | |
}.orderBy(Ratings.averageRating) | |
.toList() | |
println(result.size) | |
println(result) |
val tconst: Column<String> = (varchar("tconst", 10) references Ratings.tconst).uniqueIndex() |
object Ratings : IntIdTable(){ | |
val tconst : Column<String> = varchar("tconst", 10).uniqueIndex() | |
val averageRating : Column<Float?> = float("averageRating").nullable() | |
val numVotes : Column<Int?> = integer("numVotes").nullable() | |
} | |
object Titles : IntIdTable() { | |
val tconst : Column<String> = varchar("tconst", 10).uniqueIndex() | |
val titleType: Column<String> = varchar("titleType", 50) // TODO: Own Table? | |
val primaryTitle: Column<String> = varchar("primaryTitle", 500) |
private fun loadData(db : Database, table: Table, fileName: String, partitions: Int, operation: BatchInsertStatement.(String) -> Unit){ | |
val reader = File(fileName).bufferedReader() | |
reader.readLine() // pass headers | |
val lines = reader.readLines() | |
val partitionSize = lines.size / partitions | |
val listOfLists = lines.chunked(partitionSize) | |
var increment = 0 |
"use strict"; | |
var precacheConfig = [ | |
["/index.html", "6633bcbb6d392a7d68be37924b341845"], | |
["/static/js/main.f95e1c59.chunk.js", "559581975d6026fccabb204f217e44db"], | |
["/static/js/runtime~main.1b922744.js", "13a6cba6703084ad6f60a3db941db615"], | |
["/static/js/vendors~main.3ca81432.chunk.js", "86fba34edc08a61c670b6c7527e6b813"] | |
], | |
cacheName = "sw-precache-v3-sw-precache-webpack-plugin-" + (self.registration ? self.registration.scope : ""), | |
ignoreUrlParametersMatching = [/^utm_/], | |
addDirectoryIndex = function(e, n) { |
#!/bin/sh | |
ON_OFF=$1 | |
SPOTIFY_PREFS="$HOME/Library/Application Support/Spotify/prefs" | |
PROXY_ON="network.proxy.mode=2" #HTTP Proxy | |
PROXY_OFF="network.proxy.mode=1" #No proxy | |
if [ ! -f "$SPOTIFY_PREFS" ]; then | |
echo "Spotify preference file not found. Exiting" | |
exit 1 |
#!/bin/bash | |
if [ -f $1 ] ; then | |
case $1 in | |
*.tar.bz2) tar xvjf $1 ;; | |
*.tar.gz) tar xvzf $1 ;; | |
*.tar.xz) tar xvJf $1 ;; | |
*.bz2) bunzip2 $1 ;; |
I hereby claim:
To claim this, I am signing this object:
from bs4 import BeautifulSoup | |
import urllib2 | |
url = "http://feeds.feedburner.com/Octocats" | |
content = urllib2.urlopen(url).read() | |
soup = BeautifulSoup(content) | |
print soup.find("img")["src"] |
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting | |
source ~/.rvm/scripts/rvm | |
export PS1="\[\033[0;31m\][\u@\h:\w]$\[\033[0m\] " | |
#adding my own scripts | |
export PATH="$PATH:$HOME/bin" |