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 python3 | |
def calculate(castOn: int, bindOff: int, totalRows: int, curRow: int): | |
incPerRow = (bindOff - castOn)/totalRows; # stitches increased per row | |
totalStitches = sum([castOn + incPerRow*r for r in range(1, totalRows)]) | |
stitchesKnit = sum([castOn + incPerRow*r for r in range(1, curRow)]) | |
return int(100 * stitchesKnit / totalStitches) | |
if __name__ == "__main__": | |
c = int(input("Stitches cast on: ")) |
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
\ProvidesPackage{perun}[2016/09/23 v0.1 My own macros] | |
% http://tex.stackexchange.com/questions/11890/where-to-put-a-custom-macros-file | |
\usepackage[utf8]{inputenc} | |
\usepackage{amsmath} | |
\usepackage{amssymb} | |
\usepackage[gen]{eurosym} | |
\usepackage{enumitem} | |
\usepackage{siunitx} | |
\usepackage{mathtools} % provides dcases* environment in math mode |
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 | |
# | |
# This will abort "git commit" and remove the trailing whitespaces from the files to be committed. | |
# Simply repeating the last "git commit" command will do the commit then. | |
# | |
# Put this into .git/hooks/pre-commit, and chmod +x it. | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then | |
against=HEAD | |
else |
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
Welcome to Racket v5.3.6. | |
-> (define (factorial-no-tail n) | |
(if (= n 0) | |
1 | |
(* n (factorial-no-tail (- n 1))))) | |
-> (require racket/trace) | |
-> (trace factorial-no-tail) | |
-> (factorial-no-tail 6) | |
>(factorial-no-tail 6) | |
> (factorial-no-tail 5) |
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
#lang racket | |
(require racket/set) | |
; elements in the abstract integers | |
(define S (set '+ 'o '-)) | |
; Z -> S | |
(define (alpha z) | |
(cond |
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
From 0237a9fb589cd11c5409f55c84e1fb1e4037516f Mon Sep 17 00:00:00 2001 | |
From: Alex Shaindlin <me@ashaindlin.com> | |
Date: Tue, 26 May 2015 20:25:48 -0400 | |
Subject: [PATCH] Remove everything audio-related | |
--- | |
Makefile | 1 - | |
i3status.c | 22 ------- | |
src/print_volume.c | 181 ----------------------------------------------------- | |
3 files changed, 204 deletions(-) |
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
myGroupBy :: (a -> a -> Bool) -> [a] -> [[a]] | |
myGroupBy p xs = foldr f v xs | |
where | |
v = [] | |
f x ys = if (length ys > 0 && p x (head (head ys))) | |
then (x:(head ys)):(tail ys) | |
else [x]:ys |
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
module ConvexHull where | |
import Data.List (sortBy, delete) | |
import Data.Ord (comparing) | |
data Direction = Left | Right | Straight | |
deriving (Show, Eq) | |
data Point = Point { | |
x :: Double, |
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
module Main | |
where | |
import System.IO | |
main = do | |
num <- getNums | |
putStrLn ("The sum is " ++ show (sum num)) | |
putStrLn ("The product is " ++ show (product num)) | |
putFactorials num |
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 datetime, sys | |
today = datetime.date.today() | |
month = today.month | |
year = today.year | |
if len(sys.argv) == 2: | |
day = int(sys.argv[1]) |
NewerOlder