HN user

blar

24 karma
Posts1
Comments10
View on HN

It's excessive if your goal is _solely_ to execute a repeating AJAX request. But, if I'm understanding the attack correctly, this script is injected _in place of_ jQuery requested from Baidu's CDN. If you want the affected sites to appear normal, so the users whose browsers you are highjacking will contribute to the DDOS for the longest possible period, then you want to ensure that jQuery does indeed load.

The OP further clarifies why jQuery is injected _twice_: seems the injection is occurring only for 1% of requests. So it appears the code is looking to see if it has triggered the injection itself, and fires another request if needed.

For the last three years or so, I've been telling anyone who asked that ORM is an antipattern, to be avoided at all costs. I've settled into wrapping all queries in classes, with any parameters exposed as public properties. The SQL is written inside the class, essentially in a template. When necessary, the generated query can change based on the values assigned to the properties. All the mechanics of how the query is executed and passed to the database get rolled up in the base class, with a public method that returns the dataset returned by execution. Then I just run the dataset through transformation functions to get the data structures I actually need - combining multiple result sets if necessary to build really complicated objects when I have to.

I've been building this approach for a couple years now, and I haven't regretted it for a minute. I don't have to fit my databases to the vagaries of the ORM layer, and I have full control over my queries. I NEVER want to go back to ORM :)

Seconded. What I notice most when I'm on the verge of burnout is a lack of capacity for stress. Say when something breaks first thing in the morning - under normal circumstances, it's cause for some grumbling and maybe frustration at the time taken out of your day. When burnout is at hand, I'm just out of my mind. I don't have the tolerance for even the minor stressors, and nowhere close to my normal patience for the slow, thoughtful work necessary for top performance.

Burn out - for me - means a shorter temper and less productivity.

More functional C# 13 years ago

That really cracks me up! I work in C# probably 80% of the year (python and shudder vbscript make up the remainder) and I use lambda statements, implicit typing, and anonymous functions almost every day. The Linq IEnumerable<> extensions are also pretty well indispensable for me. My biggest complaint with C# is the limitations imposed by the static typing system: anonymous functions can't be generic, so you're forced to either declare delegates or explicitly declare each of your anon signatures; and KeyValuePair<> and Tuple<> both force you into sometimes excruciatingly, comically long object declarations, eg

Tuple<string, IEnumerable<string>, IEnumerable<KeyValuePair<string, bool>>

I've come to a point where I can comfortably write functional code in the language (though I should stress that I don't write "pure" functional code; I don't fall into the camp that abhors side effects in all scenarios). Day to day, it really is a fine language to work in, notwithstanding a few warts. In all honesty though, I'd rather be working in Python or a LISP most of the time

I'm pretty much in total agreement with you, but to nitpick on one thing you said:

as is publicly condoning breaking the law in reaction

_Peaceful_ civil disobedience campaigns played a large role in the Civil Rights movement and helped raise awareness leading to (in the US, at least) the Civil Rights Act - thereby reinforcing equal protections and voting rights.

The intent is important; and the NONVIOLENT aspect is especially important. But civil disobedience isn't always necessarily a bad thing. Nor is it always a childish suggestion.

I get the accusations of money laundering and narco-trafficking, but where are the computer hacking accusations coming from? I didn't see anything in the complaint that specifically alleged deliberate intrusions into any systems. Does this mean Justice is going to accuse him of computer hacking because he hired virtual servers and used them to run a criminal market place? That would sound like a stretch of hacking laws, right? What am I missing?

I very much want to come up with a coherent and inspirational repudiation of the OPs thesis. This is the second essay I've seen recently that seems to completely miss the magic of our trade, and I feel like we need some strong cheerleaders to counter this stuff.

How does a programmer NOT wake up every morning with a head full of inspired, flaming joy at the thought of what we do for a living? I've been at this for 5 years now (putting me in the same generation as OP, and the other blogger I came across) and I'm still ragingly in love with this craft. And I (_just_, you might say) write web apps. Yes, there are tedious days (we are, as many have stated WORKING, after all). And yes, sometimes the nature of constantly shifting specs leads us into some ugly code - but that's the nature of writing and designing to meet the needs of customers; sometimes customers really just NEED something that isn't very pretty.

But the root of what we do is this: we conjure ideas from memory and imagination, commit them into words and incantations in the terminal, and send out our instructions to be carried out by the machine. Making our will manifest through a medium that is almost completely malleable to our intentions. If there's another trade out there that's more nakedly similar to "wizard" I'd love to hear about it. What we do is barely-adulterated magic. And there is so much room for improvisation, art, and beauty in the crafting of our instructions, that even a simple CRUD interface can become a work of glory.

I freely admit that, in my enthusiasm, I'm sounding a bit deranged. And I'm painting this in a bit more glowing light than most day-to-day coding deserves. But it pains me to see a programmer with such a negative outlook on programming. And when that view gets touted as a warning against being a coder, I feel those of us who really and truly enjoy our trade need to be standing up and making the counter-argument - with all the ardor and enthusiasm it deserves.

Addendum: and OK, so the OP may not be making the claim that "programming" itself isn't what's bad, it's the JOB that's bad. It's writing the code that our clients need, day-in, day-out, that's bad. My counter-claim to that: writing bad code is a choice. You can look at every problem that comes to you as "just more toilet cleaning", or you can look for the aspects of the problem that separate it from all the code you've written before, and start writing the correct, clean, elegant response to it. And if you're solving the same problem a second time, well it ought to be that much easier than before, right? If you solved the problem PROPERLY the first time, there should be very little work in solving it a SECOND time. So now you find yourself getting paid to do less work, while - hopefully - leaving yourself room to more fully commoditize whatever process you've found yourself on, making it easier to KEEP getting paid while doing less and less work each time. With your remaining time, you solve OTHER problems, and continue filling the pipeline with magic and money.

Seeing the job as tedious and boring starts as a choice you make yourself. Getting back the magic you felt in your youth is just a matter of remembering it; and choosing to see it in the next project that hits your inbox.

I'll avoid the personability side of the question, but focusing on the "change" aspect: Let's not confuse "physical" tools - like a hammer, press, CAD program, or text editor - with "thought" tools - like a paradigm of programming, say, Functional or Object-oriented.

I'm still a rather young programmer (only about 6 years into my career). But I've found myself actually working in a reverse flow of technology, in terms of what tools I use on a daily basis to do my job. I'm primarily a Microsoft-stack web applications developer. I spend most of my day writing out c# and t-sql; often, using Visual Studio and MS Management Studio to interact with my code and the database. Those are the tools I used at the start of my career, when really getting the hang of basic programming.

As I've moved forward (career-wise), I now find myself using rather "older" tools for my day to day tasks. I hate to touch a Windows machine without Cygwin installed, as BASH is my primary interaction with the computer now. And I find myself generating code at a faster pace in VIM than I can in VS. As I've started using more Postgres databases, I've grown more comfortable with psql, and the terminal-based interaction with the db.

So the actual tools I'm using to generate my work are, in a sense, "old". I've found myself almost shunning new tools. Or at the very least, not embracing new tools _just_ for the sake of them being new. A new tool has to have some value aside from "newness."

Use of these "old" tools is not to say that my skills as a developer are lagging behind, however. The same even goes for the languages I've been using for personal projects. I find myself working out ideas more quickly in Common Lisp (how's that for old?) than I can in c#.

The point I'm trying to make is: don't focus on whether or not the person is using the newest tools to do the job. What's going to matter more is how well they understand the fundamentals of their discipline. Granted, I'm still young, but I feel like the craftspeople that really understand the core principles of their craft, and keep an eye on the horizons of their craft, are going to remain in demand (so long as the craft is needed). And if that craft is software development, it won't so much matter whether the coder is embracing Rails or not; what will matter is that s/he understands the new ideas that Rails might embody, and can incorporate those ideas into their daily flow.

Apologies for going off-topic, but why ISN'T that an option now? Was that not the point of "type" in <script> in the first place? (That's a genuine question; I don't know the history of the <script> tag, or its "type" attribute.

How is V8 wired into Chrome, or Rhino(?) into Firefox, for example? Is there a great technical barrier to making it possible for the user to install an interpreter of their choice? As I understand the course of the browser's history, it already seems to be moving to an OS-style program (or, in Chrome's case, it has BECOME an OS), so it seems like user-loaded language runtimes OUGHT to be on SOMEONE'S mind. And I'd be surprised if it hasn't already occurred to someone before, I just don't know the history.

Has anyone attempted to write a browser that allowed for such a thing? Or has JS just been the accepted scripting language, and no one has yet tried to push past?