Skip to content

Instantly share code, notes, and snippets.

View oleschoenburg's full-sized avatar

Ole Schönburg oleschoenburg

View GitHub Profile
(defn buffer-to-string
([^ByteBuffer buff]
(let [decoder (-> (Charset/forName "UTF-8")
(.newDecoder))])
(->> buff
(. decoder decode)
(.toString))))

I am going to write about the process of setting up Ubuntu as a dual boot option on your MacBook. Reading several guides, I decided that the actual process is much easier than you would thougt.

Ubuntu version

First of all you have to choose an Ubuntu version. [Ubuntu 12.10][Stable] is the latest stable release and the best option for beginners. If you feel as experimental as me you can go with [Ubuntu 13.04][Beta] as well. It's probably buggy and you will encounter issues when fighting with software version, but you will get a bleeding edge version with the newest changes and better drivers. Whatever you choose, start downloding the 64bit Mac version now. It will take some time.

EFI Bootloader

Your MacBook does not boot other OS out of the box. To do this you will need an Bootloader as [rEFIt][EFI]. Download and install it. Just use the installer, no need for customization here.

Partitioning

Next you will need to make an partition for Ubuntu. Use DiskUtility to create a new Partition on your Disk. Don't

package main
import "fmt"
var data [100]byte
func main() {
input := "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>."
i := 0
p := 0
(defn sq [x]
(* x x))
(- (sq (reduce + (range 1 101))) (reduce + (map sq (range 1 101))))
(defn divisible? [number divisor]
(zero? (rem number divisor)))
(defn fit? [number]
(every? #(divisible? number %) (range 1 21)))
(first (drop-while (complement fir?) (iterate inc 1)))
(defn middle [s]
(int (/ (count s) 2)))
(defn left [s]
(take (middle s) s))
(defn right [s]
(if (even? (count s))
(drop (middle s) s)
(drop (+ 1 (middle s)) s)))
(defn sc [p]
"Returns a function that matches data with pattern"
(fn [data]
(loop [d data
c p]
(if (seq c)
(if (seq d)
(if (= (first c)
(first d))
(recur (rest d) (rest c))