HNHacker News
TopNewBestAskShowJobs

dmethvin

2,736 karma · joined February 19, 2010

[ my public key: https://keybase.io/dmethvin; my proof: https://keybase.io/dmethvin/sigs/pw6fnhJ4hnh71_6xDqUydXLPbPVOD8MoH-V4VZqGJaY ]
submissionscomments
dmethvin··on Unicode support in MySQL is...
But a lot of databases have to deal with people's names. To paraphrase an old saying, "I don't care why I'm in the database, as long as they spell my name right."
dmethvin··on To close or not to close – Void HTML elements
Read the article, there's no way to specify "optional closing tag depending on whether a `src` property is present" so therefore it's manditory. You can, of course, write the parser to do it, but there isn't a way to express it in the HTML grammar.

I always have wished that the script inside the tag would be executed if the `src` couldn't be loaded, which is something John Resig suggested years ago [1].

[1] http://ejohn.org/blog/degrading-script-tags/

dmethvin··on [dead]
I don't have the ability to downvote today, but please take this to Reddit.
dmethvin··on University of Maryland Data Breach
Something like they found a SQL dump file that shouldn't exist, looked at its creation date, inspected the log files (e.g., web server logs) and found network activity indicating it had been sent somewhere bad. Or they saw some unusual activity when doing a monthly analysis of web log activity, dug into it, and realized the whole DB had been sucked out through a SQL injection exploit. Or...the possibilities are endless.

Since web servers are most reliably logged even on poorly maintained systems, I'm guessing at least part of the attack hinged on that. It's really common to have servers that end up with no disk space because web logs aren't being rotated and archived/pruned properly.

dmethvin··on Show HN: JS library to make your website instant
I think the Amazon example was being used as an example of the "directional cone", not preloading.
dmethvin··on Why you should (or shouldn’t) trust a startup
As a startup, you should also use this information to help decide your company's own risk/reward ratio of pursuing a customer. I worked in a B2B startup, and when we tried to engage larger businesses we ran up against this "trust" issue. Every time, we spent lots of time and money talking with them and came away with nothing.
dmethvin··on Programmers At Work: Bill Gates (1986)
> He doesn't mention anything at all about networking ...

It was a blind spot for Gates and Microsoft in the 1980s. He wasn't alone, of course. People like Marshall McCluhan had laid out a vision for it years before but Gates was really focused on software for devices and not the network. It wasn't until the late 1980s that Microsoft turned its attention to Novell which was making a killing in PC networking. (Gates recruited Jim Allchin from network company Banyan in 1990.) By the mid-1990s there wasn't much left of Novell, but Microsoft's interest and strategy there was purely driven by business and not vision. That was clear when they were clobbered again by the Internet.

dmethvin··on Execute SQL against structured text like CSV or TSV
Even better is LogParser, which lets you do SQL queries against just about any data format you'll find in a file on Windows. It's been around for a decade and continues to be improved.

http://technet.microsoft.com/en-us/scriptcenter/dd919274.asp...

dmethvin··on Hacking Airline Lounges for Free Meals
In any airport I frequent, this would not be worth the money. Some garages offer free parking for 30 minutes for pick-ups, but by the time you park, go through security, eat, and return you would owe at least $4. Then there's the time/gas cost of getting to/from the airport. Even if you used public transport it could be expensive, it's like $16 round-trip on BART from SFO to downtown San Francisco.
dmethvin··on You might not need jQuery
> The APIs seem to be designed with the assumption that all your code will be using jQuery.

Again, not true. For example, the `this` in an event handler is the actual DOM element, not a jQuery object. Whether you handle that directly with DOM methods or wrap it with `$(this)` is up to you. Many people prefer the latter but the former is often smaller and prettier.

> For example converting a wrapped node to a native DOM node requires an extra call that, in my opinion, is ugly: $('.something').get(0); and could be considered to be an anti-pattern.

How common is that, really? Your example assumes a single element with that class name. Why not chain a jQuery method behind it and handle the 0 or N cases as well?

dmethvin··on You might not need jQuery
> The problem with jQuery is that it's an all-or-nothing approach. The way it wraps native DOM nodes means it keeps trying to pull you back to using its inbuilt utility methods.

Not true at all. You can do a custom build and leave out things you don't need. You can even leave out stuff you DO need and replace with your own simpler shim. See the README file.

dmethvin··on You might not need jQuery
> Also, last time I checked jquery uses "querySelectorAll" for that fancy $("selector") syntax, which is slow as hell with every possible browser compared to "getElementBy*".

Not true, and has never been true; maybe you confused jQuery with Zepto? "#id" uses getElementById, ".class" uses getElementsByClassName, more complex selectors go through querySelectorAll, and custom selectors through Sizzle.

> And like others said, people mostly use like 1% of the API, which has as easy native browser support.

Hard to argue with that statistic since it's made up!

dmethvin··on You might not need jQuery
More to test than you thought. That just broke more than 20% of the Android installed base, since Android 2.3 doesn't work with classList.
dmethvin··on You might not need jQuery
Android 2.3 is the problem more than IE<9 for many developers at this point.
dmethvin··on JQuery 1.11 and 2.1 Released
If you've got some ideas a ticket at bugs.jquery.com would be a great place to start, with whatever analysis you have.

Remember, however, that many of your "comparable" test cases are making assumptions that jQuery can't make. For example, .show() sets the display property back to what it was before a previous .hide(), to do that it has to query the display property when hiding. If you try some ideas for fixes, the unit tests should indicate whether you've run afoul of such problems.

Is the performance of .show()/.hide() causing issues? Under what conditions?

dmethvin··on Healthy Open Source Projects Need People
Every Open Source project needs people. Find one that is doing things you are interested in and take a look around for things to do. Be sure you like the vibe of the project as well, do the people seem like folks you'd want to hang out with in your free time? It's not supposed to be a boring or tedious job, you may already have one of those so it should be fun.

I'll put in a plug for jQuery, see http://contribute.jquery.org for some guidance. There are plenty of things to do in every project besides hardcore coding as well, such as documentation or build systems.

dmethvin··on The famo.us controversy
> entirely caused by the javascript engine

I've profiled a lot of web pages/apps and this hasn't usually been true in my experience. Occasionally JavaScript is the culprit but that is more often to be due to really bad O(n-squared) algorithms and script that forces layout. In contrast, the rendering engine combined with complex CSS is often the cause of "janky" page behavior. Do you have some profiler runs that show a JavaScript bottleneck on a webview that doesn't exist when using Nitro or some other browser?

dmethvin··on The famo.us controversy
Generally, this happens through simplifying assumptions. For example, let's say you need to often check whether an element matches a specific CSS selector. That's easy with `elem.matchesSelector(selector)` but the browser has to assume the selector could be something complex like `#content li > ul input[type="number"]` just as easily as it could be `#phone`. Plus it has to parse the selector every time (or maintain a complex cache). If you as the developer know the selector always an ID you can just check for `elem.id === "phone"` in JavaScript and that will whip the pants off the C++ code that has to deal with an arbitrary selector.

I'd like to see what assumptions famo.us has made and whether they could have just been addressed at the CSS level. An example of that would be things like overlapping elements with rounded corners and drop shadows, which are very expensive for the rendering engine. So perhaps it was a lack of understanding of CSS jank factors that led them to decide a total circumvention was in order? We'd really need to see a side-by-side of the two and understand where the conventional solution was bogging down.

dmethvin··on The CDC 6600 Architecture
I had the fun of programming a this machine at the University of Virginia during the 1970s, and the Grishman book linked there was our textbook. It's a very pleasant and entertaining read.

The key to understanding the architecture is to realize that you are not writing assembly language as much as microcode. I think the architecture would have lasted longer if it had chosen to have registers be a multiple of 8 bits rather than 6. As important as number crunching was to that machine, the limit of 64 characters per 6-bit "byte" was really annoying and made interoperability a mess.

dmethvin··on Moonpig: a billing system that doesn't suck
As I understood it, the basis for their system was that each customer's account contains the actual current balance (remaining value) at any point (any given day). If you charge $10/year for a service that's 2.739726027 cents per day. You can't have a system like that and round to pennies without some serious error at the end of a year.

I'm not sure I understand the value of a system like that though. In the systems I've used and built, most customers see their service as an annual thing that renews on a particular date every year, for which they pay an annual fee. Doing it as a daily fee simplifies the special cases like converting between plans but makes it harder to deal with "your annual plan always renews on this date".

dmethvin··on Google Shopping: Upload Your Content Without Watermarks or Be Banned
> why would you invest a ton of money into quality photography and then cover it up with a watermark

I can't speak to Google Shopping, but Amazon requires a high-quality image before you can list a product. So if you spend money on the shot you don't want others stealing it. EXIF data and other non-watermark solutions are easily removed.

dmethvin··on Half an operating system: The triumph and tragedy of OS/2
Win95 had preemptive multitasking. Win 3.1 had cooperative multitasking. The "multiuser" aspect of Win95 wasn't secure at all, it was more for letting multiple users have separated settings (e.g., browser bookmarks). However, even that often failed because software would assume a single user and store all the settings in a common location. Since there was no real security in FAT32 filesystems that was pretty easy to do.
dmethvin··on How Apple’s ‘Blacklist’ Manipulates the Press
If you know anything about big companies and PR, you would know that much of what he says is true. They do indeed monitor what various media outlets say and create an "enemies list" that will be starved.

Even big and influential media may not escape. Apple doesn't need to cooperate with the normal reporters on the New York Times who ask hard questions about conditions in Chinese factories, they just need to court David Pogue.

dmethvin··on Windows and Line of Business Applications: No Good Options
Perhaps this could be retitled "Having cake and eating it too: No good options."

Big companies want technologies they can invest in that will remain stable and supported for a decade or more. Hell, many of them are upset that XP isn't being supported for longer than that.

If as a big company you had been a leader and built a web-based app in, say, 2005, it would most likely be a mess of hand-built DOM libraries that sniffed for specific browsers and most likely were wired to IE6 or IE7 (remember, jQuery didn't even exist yet). The "good options" that corps are choosing to use today mainly involve forcing newer versions of Internet Explorer into IE7 or IE5-Quirks mode so they don't have to lift a finger to change that festering pile of custom JavaScript.

I'm not convinced that any technology exists today that will be so set-it-and-forget-it wonderful that companies should plan to build it now and leave it the hell alone for a decade. But that's what they've demanded of the last generation of apps they built.

dmethvin··on Microsoft ‘Mortally Wounds’ SHA-1
http://technet.microsoft.com/en-us/security/advisory/2880823

http://blogs.technet.com/b/srd/archive/2013/11/12/security-a...

dmethvin··on A spreadsheet in fewer than 30 lines of JavaScript, no library used
There aren't a lot of good reasons to use `eval` and `with` in production JavaScript. Two wrongs don't make a right, even when you use them on the same line of code.
dmethvin··on S.F. programmers build alternative to HealthCare.gov [video]
You haven't provided enough information for anyone to give you advice about what might be the problem. Perhaps you live in a state that has its own exchange (e.g., Kentucky or Maryland). Or maybe there is no data for your area yet. Try Chicago (60609) for some sample data to use for an experiment. If that doesn't work, perhaps some error is occurring on the page; check the JavaScript console and report it to them.
dmethvin··on Google Apps drop support for IE9
One of the reasons that IE marketshare is so hard to measure is that it depends on whether business users visit the site. You can see this if you can get data that isn't filtered. The only public data I know like that is Clicky [1]. Note the sawtooth wave caused by users who use IE7/8 (and now IE9) during the week but some other browser during the weekend. So IE8 marketshare is almost 2x higher during the week than on weekends.

http://clicky.com/marketshare/global/web-browsers/internet-e...

dmethvin··on A quarter of online ad traffic is fraudulent
Right, it's basically "the cost of doing business" overhead that encompasses unsavory costs like bribes, extortion, dishonest employees, etc. As long as the parasites in the process don't get too greedy, it's still possible to run a business. It's just not as profitable as it would be and/or the customers pay more as a result. Unfortunately the sleaziest advertisers tend to thrive better in this environment.
dmethvin··on Google’s iron grip on Android: Controlling open source by any means necessary
> Google is stuck behind a rock and a hard place. If they don't try to create incentives for a unified experience, they get bashed for encouraging fragmentation, if they do assert a level of control, they get bashed for not being completely open.

This is exactly the position Microsoft was in during the mid-1990s, even before they went after Netscape. The article is saying that Google is even applying some of the same strong-arm tactics to keep OEMs in line. Fortunately, Google can point to Apple and say they're not a monopoly the way Microsoft was in its market. Plus, Android still looks really open compared to iOS.

← PreviousPage 5 of 16Next →