HNHacker News
TopNewBestAskShowJobs

grey413

336 karma · joined February 16, 2012

submissionscomments
grey413··on Ask HN: Python web programming without a framework?
Simply put, python doesn't have any (non-terrible) built-in capacity for mapping HTTP requests to code like PHP does. At their core, python web frameworks are all about adding that capacity to the language. Full stack frameworks like Django go on to add a lot more, but the simpler frameworks are all about the request to code mapping, like bare PHP is.

If you're intent on understanding 100% of your codebase, you should consider one of the single-file frameworks, like Bottle or Flask, and spend some time reading and understanding their code.

grey413··on Sorry, PC companies: you've apparently managed to perfect the PC
Part of the reason that software isn't pushing up against hardware limitations as hard anymore are the relatively old and underpowered current generation consoles. Games were traditionally on the front of the hardware curve, but over the last few years only a small proportion of the game market has had fundamentally high hardware requirements.

It'll be interesting to see what upcoming console releases will do for the the hardware market.

grey413··on Telomerase – Mouse lifespan extended up to 24% with single treatment (May 2012)
Constant telomerase activation is one of the major steps in making cancer cells immortal and thus eventually metastatic. It's possible that controlled telomerase activation (via drugs or clever future gene therapies) might present a small enough increased cancer risk that it would be worth the increased health and longevity.

Last I heard, gene therapies currently have fairly high risks involved with them (cancer, mostly).

grey413··on How Apple and Amazon Security Flaws Led to My Epic Hacking
I just set up 2-factor auth

1) You still need to enter your password every time you log in.

2) You can add backup phones that can be called/texted with the verification codes

3) You can print out back-up codes that will always work (once)

4) If your phone is stolen and is using an application-specific password, you can revoke that password for that application.

grey413··on I only know PHP. How do I write a Web application in Python?
It's a tradeoff. Django is a full-stack framework, which integrates lots of components such as templates, form generation, and an ORM. This means that you can get off the ground quicker, and that the community is all more or less on the same page. The downside is that if you want to do something that Django isn't good at (complicated database stuff, logic in templates, etc), you are in for a world of pain (reportedly). Overall, Django is a great default for making CMS-type sites, but can become a technical debt if your requirements outgrow it.

Pyramid, on the other hand, deliberately not a full stack framework, sacrificing ease-of-use for flexibility. It doesn't include any database opinions at all, can swap templating languages on a whim and wouldn't know a form if you hit it over the head with one. The upside is that it has first class core components, really well defined extension points, an unmatched routing system, and a few truly excellent plugins (I love you pyramid_tm). The downside, of course, is that you will own your entire stack, which means that A) there is more up-front work researching, designing, and developing your application's component stack and B) there's no central community guaranteed to be using the same stack as you. Overall, pyramid is suited for essentially any use case, so long as you put the work into it.

tldr: Django is (somewhat) inflexible but easy, Pyramid is flexible but more demanding. Both are excellent.

There are probably more jobs working with Django, if that's a consideration.

grey413··on * { box-sizing: border-box } FTW
Not as badly as you might think! Playing around with the new box model on a test site and on the bootstrap site (via firebug), I only found four noticeable changes in appearance:

- The search form was noticeably shorter and more cramped. I fixed this by adding height: 100% to the interior text input element

- Text inputs are less wide than they should be when you use bootstrap's span classes

- The navbar's vertical and horizontal dividers disappeared. I fixed this by adding 1px of padding to either the side or bottom of the divider, as the case required.

- Side tabs are a less wide than they should be

← PreviousPage 4 of 4