These are my personal notes on how to get Linux working on the Chromebook Pixel, common issues and how to solve them. This is not a step-by-step guide.
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 itertools | |
import re | |
import pygame | |
import sys | |
import colorsys | |
import numpy as np | |
WHITE = ( 255, 255, 255) | |
if __name__ == '__main__': |
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/sh | |
### BEGIN INIT INFO | |
# Provides: unicorn-daemon | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Put a short description of the service here | |
# Description: Put a long description of the service here |
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
def fibonacci(n): | |
if n == 0: | |
print "finobacci(0) = 0" | |
return 0 | |
elif n == 1: | |
print "finobacci(1) = 1" | |
return 1 | |
else: | |
print "fibonacci(%s) = fibonacci(%s) + fibonacci(%s)" % (n, n-1, n-2) | |
return fibonacci(n-1) + fibonacci(n-2) |
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
#!/usr/bin/env python | |
import re | |
def is_nice(s): | |
return (len(re.findall(r"[aeiou]", s)) >= 3 and | |
bool(re.search(r"(\w)\1+", s)) and not | |
bool(re.search(r"ab|cd|pq|xy", s))) | |
if __name__ == "__main__": | |
with open('input1.txt', 'r') as f: |
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
/** | |
* Created by jjst on 21/03/16. | |
*/ | |
object Floors { | |
def main(args: Array[String]): Unit = { | |
Console.println(floorNumber1("())")) | |
Console.println(floorNumber2("())")) | |
Console.println(floorNumber2("")) | |
} |
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
trait ASTElement | |
case class Expression(elements: ASTElement*) extends ASTElement | |
case class Literal[T](value: T) extends ASTElement | |
case class Function(name: String) extends ASTElement | |
object LispParser { | |
def main(args: Array[String]) { | |
val ast = parse("(first (list 1 (+ 2 3) 9))") | |
assert(ast == |
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
# Solution for https://www.hackerrank.com/challenges/game-of-throne-ii | |
from collections import Counter | |
from math import factorial as f | |
word = raw_input() | |
letter_count = [i/2 for i in Counter(word).values()] | |
print (f(sum(letter_count)) / (reduce(lambda acc, x: acc * f(x), letter_count, 1))) % (10**9 + 7) |
OlderNewer