This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
for i in {100000..1}; do | |
d=$(($(date +%s) - i)) | |
cmd="vi $i.txt" | |
mod=$((i % 10)) | |
if [[ $mod -eq 1 ]]; then | |
cmd="cat $i.txt | grep $d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Collapses tabular result sets into a (hierarchical) object graph based on | |
* column nomenclature. Given a query that selects parent and child columns as | |
* parent__id, parent__val, children__id, children__val, this will return an | |
* array of objects in the form | |
* | |
* {id: 1, val: 'parent val', children: [{id: 11, val: 'child val'}]} | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.io.Source | |
import scala.util.Random | |
object Markov extends App { | |
val outputLength: Int = args(0).toInt | |
val prefixLength: Int = if (args.length > 1) args(1).toInt else 2 | |
val in = Source.fromInputStream(System.in).mkString("").split("""\s+""").toList | |
val tokens = tokenize(in) |