- You don't have to be perfect.
- Try to do a 80-90% solution. Make it better as you go or when a customer demands it.
- Stick to your strengths.
- Try your best to work for yourself, life is short.
- Maximize happiness by reducing the unhappy experiences.
- avoid contacts with people you don't like or will make you unhappy.
- start something on your own, as early as possible in your career.
- If there are constraints (like family, financial etc), try to do consulting.
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 rackunit) | |
(define (distinct? xs) | |
(= (set-count (list->set xs)) (length xs))) | |
(check-equal? (distinct? '()) #t) | |
(check-equal? (distinct? '(1)) #t) | |
(check-equal? (distinct? '(1 2)) #t) | |
(check-equal? (distinct? '(1 1)) #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
#lang racket | |
(require rackunit) | |
;; map :: (a -> b -> c) -> [a] -> [b] -> [c] | |
(define (map f . xs) | |
(match xs | |
[(list (list) ...) (list)] | |
[(list (list x xs ...) ...) (cons (apply f x) (apply map f xs))])) | |
(check-equal? (map sqr '(1 2 3)) '(1 4 9)) |
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 rackunit) | |
(define (interpret expr) | |
(match expr | |
[`(let ,(? (lambda (b) (or (empty? b) (pair? b))) bindings) ,body ...) | |
(let->combination expr)] | |
[`(let* ,bindings ,body ...) | |
(let*->nested-lets expr)] |
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
Some notes on the python scope: | |
Python has a weird scoping problem, which stems from its intention to create a nice | |
surface syntax and perhaps to satisfy the imperative programming paradigm. This | |
affects the semantics of the Python programs in unintuitive ways. | |
Consider the following code: | |
A. |
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
There's something really liberating about having some corner of your life | |
that's *yours*, that no one gets to see except you. It's a little like nudity | |
or taking a dump. Everyone gets naked every once in a while. Everyone has to | |
squat on the toilet. There's nothing shameful, deviant or weird about either | |
of them. But what if I decreed that from now on, every time you went to | |
evacuate some solid waste, you'd have to do it in a glass room perched in | |
the middle of Times Square, and you'd be buck naked? | |
Even if you've got nothing wrong or weird with your body -- and how many of | |
us can say that? -- you'd have to be pretty strange to like that idea. Most |
This tweet explains it all.
I have a huge pile of papers on my computer waiting to be read. Often I read parts of it immediately after I see the paper, but I forget about it until someone points on another article, how awesome that paper is. I then remember to read it more carefully.
One way to fix it is to work with like minded people and have serious (non-hand wavy) discussion around the paper.
The list below will grow. My hard disk has more papers than I can count. I have carefully chosen a list of very readable papers in the list below. Special thanks for the authors for publishing their great ideas.
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
http://sprunge.us is a paste service. It is used by the 9front (a fork of plan9) folks (who hangout in the #cat-v channel on irc.freenode.net). To use sprunge from plan9, one could use the commandline http PUT client, hput. | |
Let us say, you got an error while compiling stuff. This is what I do. I select the area (using mouse key 1, i.e. left key), use mouse key 2 (i.e. middle ket) to "snarf" (plan9 lingo for copy). I then open acme and click the "paste" tag and "put" (acme lingo for save) the file into the disk. | |
Now to post the file named say "errors.txt", I do this: | |
term% hpost -u http://sprunge.us -p http://sprunge.us sprunge@errors.txt # hit enter | |
http://sprunge.us/EUJF | |
The second line is the response from sprunge.us with the URL. |
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
#ifndef TEST_DEFINED | |
#define TEST_DEFINED | |
#define OFFSET(x, y) &((x *)0)->y | |
typedef unsigned int __u32; | |
typedef int __s32; | |
typedef long long __s64; | |
typedef unsigned char __u8; |