Skip to content

Instantly share code, notes, and snippets.

@sakekasi
sakekasi / hyper.js
Created February 10, 2021 18:57
hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@sakekasi
sakekasi / main.py
Last active December 4, 2017 19:03
mit problem 2
# Implement a function that meets the specifications below.
def deep_reverse(L):
"""
assumes L is a list of lists whose elements are ints.
returns a new list that reverses L's elements and also
reverses the order of the int elements in every element of L.
"""
# Your code here
pass
@sakekasi
sakekasi / main.py
Last active December 3, 2017 02:03
mystery 2
def mystery2(lst, n):
if n == 0:
return lst
elif lst == []:
return lst
else:
a = mystery2(lst[1:], n-1)
b = a[0:n-1]
c = a[n-1:]
return b + [lst[0]] + c
@sakekasi
sakekasi / main.py
Last active November 20, 2017 06:45
Sum Numbers Problem Description
start = 1
end = 10
sum = 0 # sum should be 55
# set sum to the sum of all numbers from 1 to 10
# Your code goes here
@sakekasi
sakekasi / main.py
Created November 20, 2017 06:22
Closest Power Problem Description
def closest_power(base, num):
'''
base: base of the exponential, integer > 1
num: number you want to be closest to, integer > 0
Find the integer exponent such that base**exponent is closest to num.
Note that the base**exponent may be either greater or smaller than num.
In case of a tie, return the smaller value.
Returns the exponent.
'''
# your code goes here
@sakekasi
sakekasi / main.py
Created November 20, 2017 06:19
mystery
def mystery(lst, n):
if n == 0:
return lst
elif lst == []:
return lst
else:
return mystery(lst[1:], n-1) + [lst[0]]
ans = mystery([1,3,4,7,9], 2)
@sakekasi
sakekasi / CNF.js
Last active May 7, 2017 17:59
An implementation of directed resolution for CNF knowledge bases
class Literal {
constructor(variable, same) {
this.variable = variable;
this.same = same;
}
equal(other) {
return other instanceof Literal &&
other.variable === this.variable &&
other.same === this.same;
@sakekasi
sakekasi / README.md
Created May 5, 2015 17:07
midterm study guide

Thesis:

One of the many difficulties of studying Indian art is the lens of perception which the western upbringing we all share imposes upon us. We experience Indian culture as something fundamentally other, and the varied methods for this culture to reach us are fundamentally flawed in eigther the accuracy of the message they impart, or the size of the audience which can be reached by said message. Here, I seek to examine some of these methods, and to discuss their perceived quality in informing the layperson.

Structure:

  • popular media/oriental lens
  • indiana jones
@sakekasi
sakekasi / README.md
Last active August 29, 2015 14:20
Establishing a Feedback Loop for design iteration

When working to create a product or application, often, the team building said product learns on the job. The team gains an understanding of the specific domain of the application in order to add degrees of freedom to the code in order to allow for any of a number of goals (e.g. a minimum of dependencies across modules for easy team based development).

In order to aid this process of design, I'd like to propose an application that serves as a guide for programmers (or teams of programmers), helping them towards better design. While this tool does include some technical capabilities (e.g. design test cases via code analysis), its main function is sociological. Iterating on a design and prototyping will provide software designers an opportunity to really understand the domain in which they are working with a specific piece of software.

  • phases of the process
    • initial high level strategy phase
    • iterate
      • strategy/design
        • detail what you seek to learn/try out this time around
  • write '
#!/usr/bin/env python
from twisted.internet import protocol, reactor
from twisted.internet.endpoints import TCP4ClientEndpoint, TCP4ServerEndpoint
from twisted.protocols.basic import LineReceiver
from functools import partial
from time import strftime, localtime, gmtime
import datetime
import parse