- Install VirtualBox on your machine
- Disable login credential: $ VBoxManage setproperty websrvauthlibrary null
- Download and uncompress the following image https://s3.amazonaws.com/vmfest-images/ubuntu-10-10-64bit-server.vdi.gz
- Clone the image to the directory where you want it to be permanently stored:
$ VBoxManage clonehd /path/to/downloaded/ubuntu-10-10-64bit-server.vdi /path/to/permanent/location/ubuntu...-server.vdi
- This should produce a uuid for your new image. Keep it around
- Start VirtualBox (the GUI) and:
- Create an new image Linux - Ubuntu (64bit)
- Select "Use existing hard disk" and if your newly cloned image doesn't appear in the drop-down list, click on the folder icon and find the image in your hard disk (the one you just cloned)
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
1. Install VirtualBox on your machine | |
2. Disable login credential: $ VBoxManage setproperty websrvauthlibrary null | |
3. Download and uncompress the following image https://s3.amazonaws.com/vmfest-images/ubuntu-10-10-64bit-server.vdi.gz | |
4. Clone the image to the directory where you want it to be permanently stored and make it immutable: | |
* $ VBoxManage clonehd /path/to/downloaded/ubuntu-10-10-64bit-server.vdi /path/to/permanent/location/ubuntu...-server.vdi | |
* This should produce a uuid for your new image. Keep it around | |
* $ VBoxManage modifyhd /path/to/permanent/location/ubuntu-10-10-64bit-server.vdi --type immutable | |
5. Start VirtualBox (the GUI) and | |
1. Create an new image Linux - Ubuntu (64bit) | |
2. Select "Use existing hard disk" and if your newly cloned image doesn't appear in the drop-down list, click on the folder icon and find the image in your hard disk (the one you just cloned) |
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
(reduce | |
(fn [[amount-left coins] denom] | |
(let [{:keys [mod dividend]} (calc-coins amount-left denom)] | |
(if (pos? dividend) | |
[mod (assoc coins denom dividend)] | |
[amount-left coins]))) | |
[amount {}] | |
denoms) | |
(fn [[amount {}] 20] |
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
(defn do-join [root] | |
(let [common ["!pub" "!datestr" "!country" "!region" "!city" "!kw" "!ref" "!url"] | |
zeroed ["?pageviews" "?landings" "?new-visits" "?return-visits" "?bounces"] | |
pv (pageviews root) | |
lnd (landings root) | |
nv (new-visits root) | |
rv (return-visits root) | |
b (bounces root)] | |
(<- [?json] | |
(pv :>> (conj common !!pvs)) |
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
(ns ybot.shaper-tests | |
(:use cascalog.api | |
ybot.analytics.yb.shaper | |
[ybot datastores] | |
[midje sweet cascalog])) | |
(let [tag-data [["jmblog" | |
"07409273223006096" | |
"http://www.optimizeandprophesize.com/jonathan_mendezs_blog/2007/02/optimize_your_y.html" | |
"United States" |
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
(defn top-n-seq [sample-name n] | |
(let [aa-seq-fields ["?aa" "?v" "?j" "?sn" "?nc" "?c" "?nf" "?rf" "?cdr3"] | |
sample-name-seqs (<- aa-seq-fields | |
(aa-seqs :>> aa-seq-fields) | |
(= ?sn sample-name))] | |
(<- aa-seq-fields ((c/first-n sample-name-seqs n :sort ["?nc"] :reverse true) | |
:>> aa-seq-fields)))) | |
(let [aa-seq-fields ["?aa" "?v" "?j" "?sn" "?nc" "?c" "?nf" "?rf" "?cdr3"]] | |
(?<- (stdout) aa-seq-fields |
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
(defn top-n-seq [sample-name n] | |
(let [aa-seq-fields ["?aa" "?v" "?j" "?sn" "?nc" "?c" "?nf" "?rf" "?cdr3"] | |
sample-name-seqs (<- aa-seq-fields | |
(aa-seqs :>> aa-seq-fields) | |
(= ?sn sample-name))] | |
(<- aa-seq-fields ((c/first-n sample-name-seqs n :sort ["?nc"] :reverse true) | |
:>> aa-seq-fields)))) |
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
(defn drop-every-nth | |
[n coll] | |
(keep-indexed (fn [idx val] | |
(when (pos? (mod (inc idx) n)) | |
val)) | |
coll)) |
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
(defn feature-vec [n] | |
(map (partial cons 1) | |
(for [x (range n)] | |
(take 22 (repeatedly rand))))) | |
(defn dot-product [x y] | |
(reduce + (map * x y))) | |
(defn transpose | |
"returns the transposition of a `coll` of vectors" |
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 numpy as np | |
def test_my_mult(n): | |
A = np.random.rand(n*23).reshape(n,23) | |
At = A.T | |
t0 = time.time() | |
res = np.dot(A.T, A) | |
print time.time() - t0 | |
print np.shape(res) |
OlderNewer