How to use Pelican on GitHub Pages 
Author: Josef Jezek
sudo apt-get install python-setuptools
; http://www.algolist.com/Dijkstra's_algorithm | |
(defn dijkstra [g src] | |
(loop [dsts (assoc (zipmap (keys g) (repeat nil)) src 0) | |
curr src | |
unvi (apply hash-set (keys g))] | |
(if (empty? unvi) | |
dsts | |
(let [unvi (disj unvi curr) | |
nextn (first (sort-by #(% dsts) unvi)) |
def insertionsort(A): | |
#we start loop at second element (index 1) since the first item is already sorted | |
for j in range(1,len(A)): | |
key = A[j] #The next item we are going to insert into the sorted section of the array | |
i = j-1 #the last item we are going to compare to | |
#now we keep moving the key back as long as it is smaller than the last item in the array | |
while (i > -1) and key < A[i]: #if i == -1 means that this key belongs at the start | |
A[i+1]=A[i] #move the last object compared one step ahead to make room for key | |
i=i-1 #observe the next item for next time. |
(clojure.pprint/pprint | |
(map vector | |
(range 25) | |
(cycle [:fizz :_ :_]) | |
(cycle [:buzz :_ :_ :_ :_]))) | |
; Credit to http://clojure-and-me.blogspot.co.uk/2012/08/functional-fizzbuzz.html, code rewritten a little by me. |
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
<!-- | |
For other language: Instead of `ace/mode/ruby`, Use | |
Markdown -> `ace/mode/markdown` | |
Python -> `ace/mode/python` | |
C/C++ -> `ace/mode/c_cpp` | |
Javscript -> `ace/mode/javascript` | |
Java -> `ace/mode/java` | |
Scala- -> `ace/mode/scala` |
Author: Josef Jezek
sudo apt-get install python-setuptools
<!-- | |
Inbox Unread reports inbox statistics hourly in the form of a Twitter avatar. | |
To run Inbox Unread first copy this php script to your server. Put your background | |
avatar adjacent to this file as "input.jpeg". Mine is 548x548 and all the positions | |
are setup for that size. Next go to http://script.google.com/ and sign in. Click | |
"Create a script for GMail" and replace the template with this code: | |
function processInbox() { | |
var unreadCount = GmailApp.getInboxUnreadCount(); |
;; Try it in the REPL or eval in Light Table | |
(require '[clojure.string :as string]) | |
(def vowels [:a :e :i :o :u]) | |
(defn char-is-consonant? | |
[char] | |
(not-any? #{(keyword char)} vowels)) |
This Grub Init Tune will make your computer sound like a Super Mushroom every time you turn it on! This only works for the Grub bootloader - this generally means you need to have Linux (or other Grub-based OS) installed.
Here's the code, which goes in your /etc/default/grub
file:
GRUB_INIT_TUNE="1750 523 1 392 1 523 1 659 1 784 1 1047 1 784 1 415 1 523 1 622 1 831 1 622 1 831 1 1046 1 1244 1 1661 1 1244 1 466 1 587 1 698 1 932 1 1195 1 1397 1 1865 1 1397 1"
import math | |
import random | |
import csv | |
import cProfile | |
import numpy as np | |
import hashlib | |
memoization = {} | |
Picking the right architecture = Picking the right battles + Managing trade-offs