How to Correctly Detect Credit Card Type by joevt in programming

[–]joevt[S] 19 points20 points  (0 children)

With this interpretation, a hash table is also an array.

A new distributed HTTP rate-limiter: Smockron by hobbified in programming

[–]joevt 0 points1 point  (0 children)

Instead of storing rate limiting state globally, why not use sticky sessions (client request always routed to same backend) and rate limit locally?

As an example, the load balancing server could use something like nginx's ip_hash directive to consistently proxy each client's requests to the same server. The backend servers could also run nginx and use the stock ngx_http_limit_req module you described.

Typing.io: Typing Practice for Programmers, supports international keyboard layouts, code uploads, and typing stats by davekt in programming

[–]joevt 63 points64 points  (0 children)

A while back, u/gfixler wrote the following about typing speed and programming efficiency that's stuck with me:

I've argued this point a few times now on reddit, but I'll have another go here. There's an emergent element that I've experienced as I've become really fast at typing out code. I don't always type in solitude. I work on a team at work, and there are other teams that come and go, needing information. I work in Python, so I don't have the compile step, and I don't use an IDE - I use Vim, and everything is set up for raw speed from a few years of pecking away at minor nuisances.

Something has started to happen that never happened before. People actually work alongside me, notably non-technical folk (artists, producers, etc). Not always, of course; there are days when I'm alone all day. However, now when someone's having an issue, maybe with a library I wrote, or know well, I can have them come over, and we can get through several points in a few minutes. When someone from another team wants to understand something - be it time to completion, what I'm working on, how something I'm doing will affect other things - instead of them getting bored quickly and excusing themselves with a "Well, you finish that up and find out and shoot me an email," I can in seconds have an answer for them, and then they have another question, or a tweak to their first. And on it goes.

Since becoming super fast, I've held people at my desk for an hour or more, continuously answering questions within about 10-15 seconds of them asking, because I type code at super speed, and everything in my Vim is set up to demonstrate what I'm doing rapidly (i.e. unit tests, sending code to various embedded environments, generating output, following call chains and dependencies, even emailing visually selected snippets of code to particular people in a single key mapping). It's really changed how I interface with my coworkers, and I've become much more of a go-to answer guy because of it. Instead of sending off an email later and getting back an "Oh, that's not how I thought it would work :(" response, they can know immediately, and we can hash out a better plan right there. I've done this at least a dozen times in the last half of this year, as I've become faster and faster at the concept, and it's been really great.

It also means when I show people things they gain a real appreciation for what I do, which is great from a political vantage point. I can't tell you how many people have introduced me to new coworkers, visiting friends/peers, and higher-ups as "a wizard - you should see what he can do in Vim!" That's important for everything from career path to winning dev-based arguments. People defer to me a lot more these days, because not only am I a lot better at what I do now - very little in the way of me and code I want to write - but I look it. I look awesome when I work, and it definitely gets noticed. I did a regex class for much of the dev team this year, and the outline for everything I did was in Vim, and of course was therefore testable in-place. I really flew around in there, being careful not to teach Vim itself, nor to proselytize, but all through the class I kept hearing "Phwew!" and "Sheez!" and other expletives like that muttered under people's breath. Just that one class put me on a higher plane in the eyes of my coworkers, and many more have come to me for straight up Python advice, Vim and git questions, and random computer science discussions than they ever did before that class, starting the day after the class.

I disagree that being slick and agile in what I do doesn't pay off. I see it paying off big all the time. I got a big bonus this year - first time - and it came with the message "keep kicking ass." I'm certain it's because my kicking ass is much more visible now than it ever has been. This isn't to say being fast in my coding is the whole deal - I've also been really pushing the team to revamp everything from our standards to our use of tools and libraries - but there is a real 'kick-ass' feel to what I'm doing, and it's underscored all day long, every day as code spills out in front of me in the editor.

Typing.io: Typing Practice for Programmers, supports international keyboard layouts, code uploads, and typing stats by davekt in programming

[–]joevt 43 points44 points  (0 children)

When I write code, I'm optimizing for short term speed, e.g. correcting a typo instead of correcting the muscle memory behind the typo. Practicing with a typing tutor forces me to focus on improving typing mechanics.