Skip to content

Instantly share code, notes, and snippets.

@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@masak
masak / restaurant.pl
Last active December 17, 2015 19:59
Constraint satisfaction problem http://xkcd.com/287/ solved in Perl 6
class Constraint {
has Real %.coefficients;
has Real $.sum = 0;
}
sub unknown($unknown) {
return Constraint.new( :coefficients{ $unknown => 1 } );
}
multi infix:<+>(Constraint $l, Constraint $r) {
@istepanov
istepanov / lcs.py
Created September 10, 2013 08:23
Search longest common substrings using generalized suffix trees built with Ukkonen's algorithm, written in Python 2.7
#!/usr/bin/env python
# -*- coding: utf-8
"""
Search longest common substrings using generalized suffix trees built with Ukkonen's algorithm
Author: Ilya Stepanov <code at ilyastepanov.com>
(c) 2013
"""
@xee5ch
xee5ch / convert-ff-pwd-to-keepass.rb
Created December 5, 2013 17:52
Convert Firefox passwords to KeePass XML for import into KeePassX.
#!/bin/env ruby
require 'rexml/document'
require 'digest/md5'
xml = File.read('ff-passwords-export.xml')
doc = REXML::Document.new(xml)
head = ""
foot = ""
@winterz
winterz / setup-travis.sh
Last active May 25, 2017 01:10
travis CI setup script
#/bin/sh -f
# things to do for travis-ci in the before_install section
if ( test "`uname -s`" = "Darwin" )
then
#cmake v2.8.12 is installed on the Mac workers now
#brew update
#brew install cmake
echo
@krzyzanowskim
krzyzanowskim / integerWithBytes
Last active May 30, 2018 03:36
integerWithBytes Swift way
// Playground - noun: a place where people can play
import Foundation
typealias Byte = UInt8
protocol GenericIntegerType: IntegerType {
init(_ v: Int)
init(_ v: UInt)
init(_ v: Int8)
#!/usr/bin/env perl6
use v6;
use Stats;
#Tim's original times:
#primes-inline-loop(1000) ran in 2.425 seconds (σ = 0.213 seconds).
#primes-inline-loop-upto-sqrt(1000) ran in 2.311 seconds (σ = 0.131 seconds).
#primes-inline-loop-upto-int-sqrt(1000) ran in 2.274 seconds (σ = 0.161).
sub bench($name, &code) {
@bishboria
bishboria / springer-free-maths-books.md
Last active June 8, 2024 06:39
Springer made a bunch of books available for free, these were the direct links
- Inexplicable perversity of human nature.
- The clever machinations of MongoDB's marketing people.
- The AGPL license killed it.
- We spent too long development before monetizing.
- Bad performance.
- Numeric types limited to a 64-bit `float`.
- Great product, but didn't/couldn't translate to revenue.
- Bad business model.
- Failure in timezones/timestamp nuances.
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active June 6, 2024 13:00
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).