Skip to content

Instantly share code, notes, and snippets.

jamak

Block or report user

Report or block jamak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jamak on github.
  • I am jak (https://keybase.io/jak) on keybase.
  • I have a public key whose fingerprint is 4601 062F 15E3 7858 22B0 5CEF D895 DDFA 5762 5FB4

To claim this, I am signing this object:

View ipython_edit_QvhsOc.py
def res(n):
dp = [0] * (n+1)
for t in xrange(n):
dp[t+1] = max(dp[t+1], dp[t]+1) # press a
for k in xrange(t+3, min(t+7, n+1)):
dp[k] = max(dp[k], dp[t]*(k-t-1)) # press select all, copy, paste x (k-t-1)
return dp[n]
View app.go
package main
import (
// "os"
"fmt"
"github.com/stianeikeland/go-rpio"
"log"
"net/http"
// "sync"
"time"
View timelapse.zsh
#! /bin/zsh
TIME=$1
FNAME=$2
# if [[ $# != 3]] then;
# echo "USAGE: $0 time_interval filename"
# exit 2
# fi
if [[ -f $FNAME ]]; then
View core.cljs
om/IRenderState
(render-state
[this {:keys [move toggle
google-map directions-renderer
center directions poi-visible]}]
;; any diffs to the DOM are handled automatically by React,
;; but we have to manually diff the parts of the Google Maps state that we are managing:
(when (:dirty center)
(.panTo google-map (:data center)))
(when (:dirty directions)
View keybase.md

Keybase proof

I hereby claim:

  • I am jamak on github.
  • I am jak (https://keybase.io/jak) on keybase.
  • I have a public key whose fingerprint is 9C67 C854 011E 3E18 EC9C 2BF4 4E0C F238 CEFF 31F1

To claim this, I am signing this object:

View nqueens.go
package main
import (
"fmt"
/* "math/rand" */
)
const CAPACITY = 4
// a basic point struct
View examples.py
def rotate(matrix, n):
for layer in xrange(n/2):
first = layer
last = n - 1 - layer
for i in xrange(first, last):
offset = i - first
top = matrix[first][i]
# (0, 0) goes to (N-1, 0)
matrix[first][i] = matrix[last-offset][first]
# (0, N-1) goes to (0, 0)
View euler8.py
from string import whitespace
from operator import mul
data = open('number.dat') # Number pasted to file.
digits = [int(c) for line in data for c in line if c not in whitespace]
print max([reduce(mul, digits[i:i+5]) for i in range(len(digits)-5)])
View knapsack.hs
module Knapsack where
import Control.Monad
import Data.Array
import Data.List
data Item a = Item { item :: a,
itemValue :: Int,
itemSize :: Int }
deriving (Eq, Show, Ord)
You can’t perform that action at this time.