Hacker Newsnew | past | comments | ask | show | jobs | submit | sold's commentslogin

Since Django 1.10 you can simply use get_random_secret_key in django.core.management.utils.

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.


No, that's 1.11 (a LTS release)


"Monad" in English and "Monade" in German are the same, they can both mean the functional programming concept or the philosophical concept. You can just ignore the philosophical concept, it's not relevant to mathematics.


It's Python - you can do a lot of meta-programming with it, though unlike Lisp and Mathematica there's a division between expressions and statements.


Earlier version was wrong https://cstheory.stackexchange.com/questions/1064/polynomial..., I doubt the current version has any substance.


The algorithm is only of theoretical interest, the situation is similar to primality testing. In practice programs such as nauty are good enough.


I set up an alarm clock for "detox" every day. I turn off my computer, silence the mobile phone and do nothing but read for hour or two. Resist any temptation to check email.

I've enjoyed this article that was recently on HN http://www.nytimes.com/2015/11/29/opinion/sunday/addicted-to...


I'd like to add this scenario actually happened during the Cold War. Soviets were reusing one time pads and the US army decrypted some of the messages, among other things this lead to discovery of Soviet spies targeting the US nuclear weapon program https://en.wikipedia.org/wiki/Venona_project


https://www.youtube.com/watch?v=yxx3Bkmv3ck

Computerphile recently showed how this was done.


Is it really still a "one time pad" if you used it multiple times?


Alias often used commands, I have g = git, sl = ls (common typo).

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.


I recommend

git config --global pull.ff only

instead, then you can use "git pull" without worries. Or,

git pull --ff-only


Anyone wondering what a "fast-forward" merge is? https://sandofsky.com/images/fast_forward.pdf


In the following scenario:

origin: A-B-C local: A-B-D

What is the recommended action? git pull --ff-only will fail, right? So should I be using git pull --rebase?


Yes, ff-only will fail. If C,D are independent and simple, I would go ahead and rebase, otherwise do a proper merge.

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: