HNHacker News
TopNewBestAskShowJobs

dgallagher

1,583 karma · joined December 29, 2008

submissionscomments
dgallagher··on What exactly is RESTful programming?
My $0.02. In general, I've found many people describe something as "RESTful" but not actually know what RESTful truly means. Instead, they use it as an acronym to say "A web-based API", which is not necessarily the same thing as RESTful.

The best follow-up question to ask someone is: "What level on the Richardson Maturity Model is your RESTful API?" If they can't answer that, they're probably using the term RESTful to describe something else.

Richardson Maturity Model:

    Level Zero Service  - URI API. Usually just POST. SOAP, XML-RPC, POX.
    Level One Service   - URI Tunneling via URI Templates. GET/POST.
    Level Two Service   - CRUD (POST, GET, PUT, DELETE). Amazon S3.
    Level Three Service - "Hypermedia as the Engine of Application State" (HATEOAS).
The higher up the level, the more "RESTful" your API (you can argue about the order of level's 0 and 1), but the more complex it will be. Not everything fits perfectly in those levels either; you're free to borrow concepts and mash-up your own custom API.

HATEOAS is the most complicated. Imagine you're browsing the internet. You go to a webpage, and it loads with lots of text, links, images, and videos. You can interact with it, click on links, watch videos, submit a form, and go elsewhere. You have no idea what appeared on the webpage until after you visited it, and the next time you visit it might change entirely. The link might become broken and you get 404'ed, or you need a username/password otherwise you get 401'ed. HATEOAS is similar to that, but instead of a "person" browsing a "website", it's "client software" browsing "XML/URIs/Resources" received from a server API.

REST is not easy to understand or explain, as it entails learning about many different concepts, ideas, and custom-building something based on them. This is probably why there's no single-sentence which easily describes REST. Saying that something is RESTful is like saying something is Drivable. You can drive a car, truck, motorcycle, bicycle, or boat, but they're all very different from one another. There are similar concepts between them, like accelerating, steering, breaking, but how they do each of those things is very different.

A good book I recommend is "REST in Practice" by Jim Webber, Savas Parastatidis, and Ian Robinson (http://www.amazon.com/REST-Practice-Hypermedia-Systems-Archi... or http://shop.oreilly.com/product/9780596805838.do). That helped me grasp what REST means.

dgallagher··on Nintendo’s President Satoru Iwata Announces Online Gaming Network
I think Nintendo has three advantages in the mobile-space (Nintendo 3DS vs. iOS/Android). #1, Nintendo-branded games. They're the "Disney" of video games, and have a large loyal following.

#2, dedicated gaming controls. Certain games need D-pads, analog sticks, and tactile buttons. Hard-wired controllers allow for more accurate control, and are essential in some "twitch-based" video games. Touchscreen's are phenomenally good for some types of games like board games and Angry Birds, but terrible for others like platformers and FPS's.

#3 is price. $40/$30 for a new game is extremely expensive for iOS games, but not 3DS ones. This may attract bigger budget games to the 3DS since developers/publishers could potentially make more on the 3DS than on iOS/Android. This can be considered a disadvantage too, since consumers may be deciding between one $40 3DS game, or 40 $0.99 iOS games. 3DS games will have to offer more perceived-value to justify premium pricing.

Currently I see #2, controls, as the biggest problem in the mobile-phone gaming space, which is why you're seeing 3rd-party solutions (iCade, 60beat GamePad, etc). Since 3rd-party solutions are not widely adopted and will result in high fragmentation, it'll probably require Apple or Google to design and release an "official" controller of some sort (ideally built into each device). If this never happens, there will still be a clear distinction between "portable gaming system" and "portable mobile phone/tablet".

dgallagher··on Rarest language? Objective-C has highest job posting to developer activity ratio
I find Obj-C elegant in the sense that it reads like an explicit english sentence:

    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:60.0];
If you've never used an NSMutableURLRequest object before, but know how HttpRequests are made, you can figure out what's going on without having to dig into any documentation.

Many languages I've seen (C in particular) hide that explicitness. You call someFunction(arg1, arg2, arg3), but what do arg1, arg2, and arg3 do? Can you pass a 4th or 5th argument too? Unless you've memorized what someFunction() does, you have to dig into the docs, which makes the language harder to read. Obj-C method calls always list "every" available parameter, regardless if its used or not (e.g. nil).

------------------------------

Obj-C takes up a lot of horizontal screen space. It works best on high-resolution widescreen monitors, with a modern editor, and modern mouse, both supporting vertical AND horizontal scrolling. Limiting lines to 80 characters, or anything really, destroys its readability.

The most unreadable Obj-C code I've seen is usually formatted this way. Google's Obj-C code is a nightmare to read; they limit it to 80-characters (http://google-styleguide.googlecode.com/svn/trunk/objcguide....). Great for a 1980's terminal, not for modern 2560x1440 displays.

Frankly line-length should not be the job of the programmer writing the code, but of the IDE/Editor displaying it properly on-screen. When you say "all code must be 80 lines long", you've forced that upon every programmer regardless if it's a good decision or not.

It's like decoupling the Model and View. The Model is the actual code written, where the View is how it's displayed. Programmers should be able to customize how their View looks using their IDE/Editor. When you hard-code the View into the Model, you break decoupling, and force everyone to use the same View.

Most Editors/IDEs let you customize the view somewhat, like color-schemes and "wrap text". But I haven't seen a "complete" decoupling of the model (code) and view (how it's presented) yet, in any IDE/Editor. Someone please correct me if one exists. This is a feature I'd "LOVE" to see in all IDE/Editors and programming languages, as it will make verbose languages like Obj-C much easier to read based on the programmers preference.

dgallagher··on A simple guide for getting started with git
I found this guide very useful, so thanks for making it. :) I've used SVN, Mercurial, and git before, so knowing those made this easy to digest. Plus it covers stuff about git I never knew existed, like gitk. So cool!
dgallagher··on Asynchronous message passing in Objective-C
That's really cool. For the heck of it I increased the actor count to 16 and CPU-usage stayed ~50% when running (Core i7, dual core w/hyper-threading). If you comment out the NSLog call, it spikes to ~280% CPU usage, as the overhead introduced by NSLog is likely slowing things down.
dgallagher··on TVs are all awful
I used an HDTV once that had three different HDMI ports on it (0, 1, 2). Each port reported a slightly-different EDID for the same TV!

One of the HDMI ports reported this (extracted using SwitchResX):

    Established Timings:
    -------------------- 
    		720 x 400 @ 70Hz
    		640 x 480 @ 60Hz
    		800 x 600 @ 60Hz
    		1024 x 768 @ 60Hz
    
    Standard Timing Identification:
    ------------------------------- 
    	#0:	1280 x 1024 @ 60Hz 	(8180)
The two other HDMI ports reported this instead:

    Established Timings:
    -------------------- 
    		640 x 480 @ 60Hz
    
    Standard Timing Identification:
    ------------------------------- 
    
Almost all other EDID data matched, including additional timing data inside the EDID extension block, so I'm not certain these differences were that big of a deal. None the less, weird when all coming from the same TV.
dgallagher··on [Django] Python 3 port - all tests now pass on 2.7.2 and 3.2.2
After Django gets ported, the only thing keeping me from jumping to Python 3 is PIL. PIL has indicated that a 3.x-compatible version is in the works: http://www.pythonware.com/products/pil/
dgallagher··on Low vitamin D linked to heart disease, death
A friend on mine who has Multiple Sclerosis mentioned to me that it gets much worse for him in the winter, and then gets better heading into the spring and summer. IIRC low vitamin D is believed to make MS worse. He was going to try tanning beds this winter to see if it helps (usually tanning beds are bad news due to cancer risk, but in his medical case his doctor recommended it). Disclaimer: All anecdotical.

--------------------

Vitamin D is synthesized by your skin from sunlight using UVB rays. This is interesting to note, indicating that being far from the equator does not mean you cannot get enough UVB rays from sunlight during the winter:

The assumption that vitamin D levels in the population follow a latitude gradient is especially questionable in view of surveys which have shown that UVB penetrating to the earth's surface over 24 hours during the summer months in northern Canada equals or exceeds UVB penetration at the equator. Accordingly, there is sufficient opportunity during the spring, summer, and fall months at high latitude for humans to form and store vitamin D3.

- http://en.wikipedia.org/wiki/Vitamin_D#Production_in_the_ski... - http://www.nap.edu/openbook.php?record_id=13050&page=104

Perhaps if true, that means when it's cold out people stay indoors and wear lots of clothing when outside, effectively limiting sunlight exposure, meaning less vitamin D production in the winter...

dgallagher··on Why everyone hates the IT department
In my experience, thats what distinguishes between good and bad IT departments. Companies which looked at IT as a cost center tended to have bad IT service, where as those who viewed it as a value-added service had good IT service.

I use to do IT consulting and bounced in and out of dozens of companies. Some had no IT support, others had us augment their IT team. The best IT department was at a company where there was about one IT worker for every three employees. A ratio typically unheard of, this company spent greatly on IT as everything had to run smoothly. IT was at an employees desk within a minute if any trouble arouse. They were very profitable of course.

The worst companies spent as little as they could on IT. One literally asked me if I could setup their Windows NT 4 box because their Windows 2000 Server was having issues. This was only a few years ago, and they didn't want to buy a new Win 2008 box. Eventually they did, but it was months of pain and plenty of downtime before it happened. Everything else in the company smelled of cheapness too, all in a bad way; Penny wise, dollar foolish.

Also, if the IT-to-employee ratio is really low, like 1 per 200 employees, and systems aren't locked-down super tight, IT HelpDesk can constantly be in a position of stress with more requests than it can handle. This is typically the reason for long delays.

It's like any service center, really. If you want good service, you have to pay for it. Call up Apple's tech support, and then call up Lenovo's. Both do the same thing. But one is really really good, and the other terrible. Guess who views their tech support as a cost center and who doesn't? (Hint: You can tell if you don't see a tech support phone number on the front of their tech support webpage.)

dgallagher··on Indie Game Music Bundle (Pay what you want)
Nice, some new music to hack to for the rest of the day. :)

    - $1 - $9.99 gets you 10 albums.
    - $10+ gets you 17 albums.
    - Each album must downloaded separately as a zip file.
    - Four simultaneous downloads allowed, max.
    - I'm averaging ~100KB/s per download.
    - I've seen file sizes between 60MB - 400MB.
dgallagher··on Doom 3 source released
Question 1: Why did you run cloc as root?

Hmmm, because of a really bad habit I need to break. ;)

dgallagher··on Doom 3 source released

    $ sudo perl cloc-1.55.pl --unicode doom3.gpl/
        2014 text files.
        1907 unique files.                                          
         476 files ignored.
    
    http://cloc.sourceforge.net v 1.55  T=40.0 s (36.6 files/s, 22123.3 lines/s)
    -------------------------------------------------------------------------------
    Language                     files          blank        comment           code
    -------------------------------------------------------------------------------
    C++                            517          87051         113094         366423
    C/C++ Header                   615          29640          26891         110991
    C                              170          11407          15566          53520
    Bourne Shell                    36           4529           5476          33717
    m4                              10           1079            232           9025
    HTML                            55            391             76           4142
    Objective C++                    6            709            654           2605
    Perl                            10            523            411           2380
    yacc                             1             95             97            912
    Python                          10            108            182            895
    Objective C                      1            145             20            768
    make                            22            160            253            579
    DOS Batch                        5              0              0             61
    Teamcenter def                   4              3              0             51
    Lisp                             1              5             20             25
    awk                              1              2              1             17
    -------------------------------------------------------------------------------
    SUM:                          1464         135847         162973         586111
    -------------------------------------------------------------------------------
dgallagher··on Half of China's millionaires want to leave country
One quarter of China’s top 1000 richest people obtained their wealth from property, compared to less than 10% among the world’s 1000 richest, the report says.

Are they comparing the top-1000 richest people in China to the top-1000 richest people in the world? That's not a very good comparison. It's like comparing the top-1000 students from a single college, to the top-1000 students from every college in the entire world.

I'm not sure if the actual report makes this comparison too as I cannot read Chinese.

dgallagher··on Mac App Store apps must implement sandboxing as of March 2012
This SO question raises an interesting issue: http://stackoverflow.com/questions/7419912/how-will-lions-ne...

What if your app uses Python to perform IO? What if you wrote your code using PyObjC? Is there any way to sandbox that, or are you out of the Mac App Store for good?

dgallagher··on Linux From Scratch 7 Released
As others' mentioned, LFS is a great way to learn about Linux. After building LFS, I migrated to Gentoo. LFS shows you how everything is done manually, where Gentoo takes care of all that grunt-work via Portage. LFS is an excellent stepping-stone towards Gentoo (or any other package-managed distro), showing you how things are working under the hood.
dgallagher··on The 99 percent
Ah, I missed that. Nice catch! :)
dgallagher··on The 99 percent
The graph is a bit hard to read since it's labeled poorly. The X-axis is the year. The Y-axis is the percentage of income relative to 1979, after-tax. They do not mention if these numbers were adjusted for inflation, but the report linked to on the page says the numbers are adjusted for inflation:

Income is adjusted for inflation using the Bureau of Labor Statistics’ research series of the consumer price index for all urban consumers (CPI-U-RS). -http://cbo.gov/ftpdocs/124xx/doc12485/10-25-HouseholdIncome....

That report is much more detailed than the Economist's summary.

So, in 2007 the top 1% made ~375% of what they did in 1979 (~275% gain). In 2007 the bottom 20% made ~120% of what they did in 1979 (~20% gain).

dgallagher··on How I live on $7,000 per year
Plus he has the shittiest $82 health insurance plan he could find, and he doesn't calculate the costs of what will happen if he gets sick.

A bigger issue with the cheap health plans is they tend to have a very high deductible, usually in the $2000 - $3000 range (his is $3500! http://earlyretirementextreme.com/my-hdhp-hsa-and-some-comme...). If you end up in the E.R. once for anything, like a fever, you have to pay that entire deductible. For some, a single blood test will trigger it too.

Granted you typically only have to pay it once per year max (meaning you won't pay it for subsequent E.R. visits in the current coverage period), but it's a heavy penalty none-the-less.

dgallagher··on Rob Pike: Dennis Ritchie has died
His brother was superintendent while I was in high school. We asked him to invite dmr to come in and give a speech once, but understandingly dmr was too busy and had to decline. If dmr was anything like his brother, he was a great person and will be missed greatly. RIP, you changed the world for the better.
dgallagher··on Show HN: My network connection monitor for Mac
Apple does provide this in Activity Monitor. Click the "Network" tab and you'll see "Data received:" and "Data sent:". It tally's since the last reboot.

It would be nice to have a history feature though. Plus, there's no easy way to ask "How much bandwidth do I have left this payment period before Comcast starts billing me for going over my monthly limit?"

You'd have to tally total bandwidth, and then associate it with an internet connection. You could track internet connections via DNS/public-IP info, and possibly MAC address for WAPs. If you're a laptop user jumping from WAP-to-WAP, it would be nice to know when you're online at home, or in a Starbucks, and differentiate total bandwidth used for each.

dgallagher··on Hacker News Front Page Snapshot from Last Night
Another one: http://dave-gallagher.net/pics/hn_ipad.png
dgallagher··on Markdown Editor for web developers, on Mac OS X
That looks very nice, especially the TOC. I'd love to see it have a file-browser too similar to TextMate's, which is very nice if you like to organize MMD notes/docs in different files and folders.
dgallagher··on Ask HN: Who is Hiring? (October 2011)
I have a friend who works at Brightcove and never stops raving about how great your company is to work for. :)
dgallagher··on Ask HN: Has anybody here ever successfully started a videogame company?
That's an awesome story, you should definitely post it on YakYak. :)

Oh, and check out some of their new stuff I mentioned. Especially the iOS stuff as it's modeled after many games from the C64-era (you'll like them I bet): http://minotaurproject.co.uk/Minotaur/minotaurprj.php

dgallagher··on Ask HN: Has anybody here ever successfully started a videogame company?
I've been a fan of Llamasoft for years. They're an indie shop of two coders, releasing games since the early-1980's. More recently they created Neon, the music light-synth on the Xbox 360, Space Giraffe on XBLA, Gridrunner Revolution on Windows, and are currently making iOS games (GoatUp, Deflex, Minotron: 2112, and Minotaur Rescue).

They were not pleased with XBLA. Their game, Space Giraffe, got hammered by a particularly bad reviewer (employed at the official Xbox Mag, no less). The game is actually quite good, albeit extremely hard, and has been praised by the creator of Braid. Microsoft did't seem to care about them at all (at least that's what I think happened), so they went elsewhere.

What they've done is focused on a niche. Most of Llamasoft's games are mash-ups of games from the 1980's, usually with lots of crazy graphical effects, and lots of goats, sheep, llama's, oxen, and various other beasties. Gameplay design is among the best I've ever experienced in twitch-based games. There's a loyal following of customers who love their games and support them, helping Llamasoft sustain themselves.

They're not super-rich, but have been chugging along for a while. I think they're excited about iOS because they're indie, and it's very easy for them to release games on it. Marketing and getting the word out is definitely their biggest challenge. Currently, it seems their goal is to release a new iOS game every 2-3 months, and build up a catalog of games. Once one of them is a hit, it'll bring in more customers, who will be interested in their back-catelog.

GoatUp, which just released to great reviews, might be that ticket (check it out: http://itunes.apple.com/us/app/goatup/id462286820?mt=8).

You can always ask them directly about their experiences. They've been on XBLA, Steam, iTunes, and a lot of other platforms in the past. Sign up at www.yakyak.org, and ask Yak or gilesgoat a question.

dgallagher··on Show HN: Core Data Editor 4 (for OS X)
That looks pretty cool. Basically it lets you browse and modify Core Data persistent stores. I've been doing this with Base, which is SQLite-only. Will there a be free demo made available?
dgallagher··on HP Names Meg Whitman President and Chief Executive Officer
HP appointed Meg Whitman as CEO earlier today, in an attempt to save the troubled computer maker. When asked what her first course of action would be, Mrs. Whitman firmly answered "eBay."

"I'm an excellent eBayer, and have been for years. You've never seen a feedback profile with so many A+++++'s before." Mrs. Whitman continued, "HP has warehouses full of inventory, ready to be gobbled up by the highest bidder. On my way in today, I must have passed about a dozen pallets of iPaq 3630's just collecting dust. Those go for a lot of money you know! There's so much stuff just lying around here that can be sold for big big bucks!"

The board of directors was quick to point out Mrs. Whitman's Titanium PowerSeller level status, among her many other credentials. "She accepts all major forms of payment, including PayPal." When asked about their CEO selection process, a board member went on to say "We won an auction for a used paper towel holder from her the other week. She even emailed a tracking number so we could determine the exact date it would be delivered. I must have refreshed UPS.com about a zillion times! Well, when we got it, turns out it was actually new, not used! That level of service amazed us, and we knew right then and there we found our next CEO."

Mrs. Whitman quickly detailed a plan to get the company back on track, including getting their feedback rating back up to 100%. "All these negative feedbacks about this Norton AntiVirus thing have got to go. And paying to upgrade your auction to bold, and including a picture, really does make a difference!" One shareholder noted that "It's executive-level thinking like this which will save this company." Other Shareholders have agreed, and bid the stock up to a yearly-high shortly after the announcement.

"Is Woz's cubicle still around here? I bet there's several Apple I's under his desk that'll go for lots."

When asked about long-term prospects beyond selling all of HP's assets, Mrs. Whitman indicated that they can continue to thrive by adopting IBM's business model of advertising their brand everywhere, without actually selling anything, financing it with Jeopardy-playing machines. "I love that show and watch it every night. Ooo, maybe we can make a Wheel of Fortune machine too! That'll really pump our margins up!"

dgallagher··on Why Entrepreneurs Can't Sleep
Working on a problem late can sometimes be beneficial. I've been up late with a problem in my head and went to bed with little downtime. It's hard to go to sleep, definitely. However, I've actually dreamt the solution a few times, and woke up the next morning knowing exactly what to code.

This happened two nights ago. I was coding something fairly complex and had a hard time connecting everything together. It was something I had been struggling with for two weeks. In a dream, I figured out how to make things much simpler. The next morning I deleted 1000 lines of code, re-structured things, and got it working succinctly.

But you definitely don't sleep very well when you do it. :)

dgallagher··on Why Entrepreneurs Can't Sleep
This might sound a little weird, but try putting an large ice-pack on your head while you're lying in bed, ready to go to sleep:

http://healthland.time.com/2011/06/17/tip-for-insomniacs-coo...

I've done it a few times and after about 10 minutes, any racing-thoughts in my brain dissipate, and it becomes much easier to go to sleep.

dgallagher··on Sony to ban gamers from PSN unless they waive right sue over security breaches.
Thanks for sharing that roc. :)
← PreviousPage 4 of 13Next →