sold | 9 years ago | on: Show HN: Django Secret Key Generator
sold's comments
sold | 9 years ago | on: Django 1.10 released
sold | 9 years ago | on: Ask HN: Is there a mismatch between Math in German and English?
sold | 9 years ago | on: The Origins of SageMath; I am leaving academia to build a company [pdf]
sold | 10 years ago | on: Graph Isomorphism Algorithm Breaks 30-Year Impasse
sold | 10 years ago | on: Graph Isomorphism Algorithm Breaks 30-Year Impasse
sold | 10 years ago | on: Ask HN: Do you find reading increasingly challenging?
I've enjoyed this article that was recently on HN http://www.nytimes.com/2015/11/29/opinion/sunday/addicted-to...
sold | 10 years ago | on: Times Pulls Article Blaming Encryption in Paris Terror Attack
sold | 10 years ago | on: Ask HN: What are your best productivity tips (shortcuts/keybings/workflowithetc)?
Git: set up aliases. I can type "g co = git checkout", "g st = git status". Git configuration: pull.ff only (then "git pull" does not cause an accidental merge), fetch.prune (then "git pull" = "git pull -p").
Chrome: Ctrl+L for URL bar, Ctrl+T new tab, Ctrl+Shift+T to reopen closed window, Ctrl+W to close tab
Bash: use Alt+. for last argument (e.g. type "vim x.py"; then "python " and press Alt+. to get "x.py"), Ctrl+R to search last commands. "cd -" = undo last "cd"
Gmail: use keyboard shortcuts (enable in settings). ? to see help, most important: "c" compose, "r" reply, "a" reply all, "f" forward
Use a password manager such as keepass, remember only a few passwords.
sold | 10 years ago | on: Ask HN: How often does Git merge make mistakes?
Remember you can play a lot with git; if you are not sure how it will turn out, checkout a commit (e.g. git checkout origin/master), create a new throwaway branch (git checkout -b tmp), then you can do rebases, cherry-picks, merges etc., then do "git log tmp" or "git log -p tmp" to see how does the branch look. If you are unhappy, you can always throw it out (git branch -D tmp), it won't affect anything else.
I generally avoid the situation when a branch and origin diverges. The flow I have in my work is: If I need to make a small change (few lines), I pull, do changes, commit and push directly to master; if there are any intervening independent changes, pull --rebase. For anything larger, I create a new branch, and commit there. Once it is ready, I give it to a teammate for code review and do automated build, if everything is OK he merges it to master. Other people generally don't push to my branch, and there is no A-B-C vs A-B-D situation.
If several people work together on the same branch, we coordinate actions face-to-face or via team chat, to avoid conflicts. We pull/push many times a day and the changes are small enough so there are no problems with rebasing in a topic branch. If two people make big conflicting changes to the same branch, it means trouble and we merge or even discard some changes.
sold | 10 years ago | on: Ask HN: How often does Git merge make mistakes?
git config --global pull.ff only
instead, then you can use "git pull" without worries. Or,
git pull --ff-only
sold | 10 years ago | on: Fourier series
sold | 10 years ago | on: The limits of type theory: computation vs. interaction
Can you explain why? I don't know Kotlin, but from this page it seems to divide types into nullable and non-nullable (correct me if I'm wrong). Is it possible to have a type "T??" that has three possibilities - "null", "wrapped null" and "T"? If not, this approach will not help in the assoc problem mentioned by the parent poster.
sold | 11 years ago | on: Subtle Effect of Hidden Dependencies on the User Experience of Version Control [pdf]
git merge --abort. Perhaps not intuitive, but it's a single command.
sold | 11 years ago | on: Amazon.co.uk is down/suffering performance issues
sold | 11 years ago | on: C99 tricks
sold | 11 years ago | on: C99 tricks
sold | 11 years ago | on: A regular expression to check for prime numbers
If you take a number N given in unary, convert it to binary and do trial division up to the square root, it will take O(N log N) time for conversion to binary and O(sqrt(N) * log(N)^2) for trial division (depending on your computational model, it could be O(N) and O(sqrt(N)) - I am counting bit complexity). In total, it's O(N log N). The runtime is dominated by reading the input! The complexity of trial division and the brilliant AKS algorithm is the same from this viewpoint.
Even if you had an algorithm that did not have to convert to binary and could tell in time linear to unary represenation whether a number is prime, it would be interesting trivia but nothing worthy a Nobel prize. In practice numbers are given in binary (or some other base>1 number system). To use your algorithm, you would have to convert to unary, which already means trial division would be faster.
sold | 11 years ago | on: Ask HN: How do you take care of your vision?
Try setting it to the smallest temperature possible for 30 minutes and then turn it off to see the difference. I have it on all the time (though people working with colors might not be able to use it)
sold | 11 years ago | on: The reason people burn out on open source
This will not work:
if python3: print (SECRET_KEY) else: print SECRET_KEY
because it's a syntax error in Python 3. Instead, you can just write "print (SECRET_KEY)", this works in both versions and has the same effect.