HNHacker News
TopNewBestAskShowJobs

dgallagher

1,583 karma · joined December 29, 2008

submissionscomments
dgallagher··on Apple posts free developer documentation for iBooks users
They are missing a few chapters compared to the online versions (easy to see which ones; just look at what chapter numbers were skipped in the contents). Still much easier to read than PDFs.
dgallagher··on [dead]
Can old links be re-posted after a certain period of time passes?

If so, maybe auto-add a prefix, "REPOST: Article Title", for any link that's re-submitted. That way people who've seen it before can ignore clicking on it, while those who haven't seen it will now have the opportunity to read it.

EDIT: BvS already posted a link to a Reddit post with the same idea.

dgallagher··on The Day I Bought $15,000 From the US Mint
Neat arbitrage play (with some minor risk as noted in the article).

If the Mint isn't losing any money on the credit card transactions (think PayPal fee's), then he's essentially getting free money from his credit card company. Otherwise I'm curious who wrote the law to let the Mint sell $15,000 for ~$14,500 (guess) after CC fee's and shipping... ;)

The poor bank definitely loses out. They have to spend all those man hours processing coins, money which they won't make back in interest as he'll clear out his savings/checking account rather quickly to pay the credit card fees.

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

EDIT: Per frisco's link:

The Mint says it costs, on average, about $3 to ship each 250-coin box. So $10,000 in coins would be 40 boxes, or $120 in shipping. As for credit-card costs to the government, a Treasury Department agency handles all government credit-card transactions and negotiates costs. No particular credit-card expense is charged to the Mint, a spokesman says.

So, $15,000 in coins would have been sold at a loss of $180 to the U.S. Mint. That doesn't take into a lot of other costs like manufacturing.

dgallagher··on Objective-C Memory Management For Lazy People
The author didn't do a clear job explaining Obj-C's memory management. Apple on the other hand does:

http://developer.apple.com/library/mac/#documentation/Cocoa/...

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

In simplistic form:

A) If a method "begins with" alloc or new, you must release or autorelease.

B) If a method "contains" copy, you must release or autorelease.

C) For every retain message you send to an object, you must balance it out with a release or autorelease (e.g. malloc/free).

D) If a method returns an object to you, and the method name did not match with the "A" or "B" rules, you have received an autoreleased object. This object is guaranteed to exist for the remainder of its identifier's scope.

E) To make an autoreleased object live longer than its identifier's scope, retain it (ensuring to release/autorelease it when finished).

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

There are a few edge scenario's too (described in the link), but that's the gist of it. Also, whenever you put an object inside an NSSet/NSArray/NSDictionary, it's sent a retain message. When said NSSet/NSArray/NSDictionary gets deallocated, it sends a "release" message to all of its members. A lot of other objects act similarly (always documented well by Apple).

At first it's a little challenging to grasp. But after programming for a little while in Obj-C using the Foundation or Cocoa API, you get the hang of it and it comes quite naturally.

In general I've found learning Obj-C with Foundation/Cocoa is difficult at first, mostly from trying to grasp the design patterns Apple has used with OOP. For example, delegate methods, bindings (using KVC/KVO), the responder chain, etc... But after you've learned them, you go "ah ha!!!" and get it. Then things become much easier to code.

On top of that, I have nothing but good things to say about other Apple coders. From bloggers, to StackOverflow users, to IRC; everybody is extremely helpful and pleasant to deal with. :)

dgallagher··on Appointment Reminder Launches
Love the idea. Great job. :) This is how I'd summarized things (I didn't watch the video):

Appointmentreminder.org:

- Automatic appointment reminders for your clients (phone, text message, email).

- No more meetings where nobody shows up!

- Get notified automatically if someone is going to be late!

- Client needs to cancel or reschedule? We'll let you know!

- Record phone reminders yourself, or save time and have our professional voice actors do it for you!

- Always on the go? Use it on your laptop or iPad. (iPhone coming soon!)

Never show up to an empty meeting ever again. How much time and money are you going to save?

:insert pricing chart here:

Questions or comments? email@email.com 888-555-1234

dgallagher··on "Whale Fail" - Google Books' Error Page
SuperNews! did an awesome parody of Twitter and their Fail Whale (4:28 long): http://www.youtube.com/watch?v=PN2HAroA12w
dgallagher··on Startup Ideas Every Nerd Has (That Never Work)
- A drag and drop interface that lets you make any program you want...totally code-free!

Xcode and Interface Builder, using Core Data and Bindings. Don't expect to make a full-blown 3D video game doing that though. ;)

dgallagher··on Ask HN: Favorite pointer tricks in C?
The same as above, only using Pointer Arithmetic instead of Array Subscripting:

    *(array + index) == *(index + array)
Further broken down:

    *(&array[0] + index) == *(index + &array[0])
dgallagher··on Review My App:"PG to Alonzo Church?", an iPhone game for the knowledge hungry
I took WHP43NLYEWNT. Thanks a lot Ivan! :)
dgallagher··on Google senior execs getting 30 percent raises
In general there's less friction when shifting jobs in California due to non-compete clauses being (mostly) banned:

http://en.wikipedia.org/wiki/Non-compete_clause#California

The article mentions a case in 1998 where out of state non-compete clauses cannot be enforced in California.

They are enforceable in Washington state, Microsoft's main location:

http://en.wikipedia.org/wiki/Non-compete_clause#Washington

This might be one reason why you haven't seen something like this at Microsoft.

dgallagher··on Objective C, Cocoa, And Iphone Programming Books For Beginners
I learned Obj-C/Cocoa using some of the books mentioned, plus a few others. My opinions for them are below. In general to get into Mac/iOS development:

    1) Learn C
    2) Learn Objective-C
    3) Learn Cocoa (Mac) or Cocoa Touch (iOS) - both APIs are similar
-------------------- C Books: --------------------

Learn C on the Mac, by Dave Mark

    - Very newbie-orientated
    - Hand-holds you through lots of stuff
    - HIGHLY recommended for beginners
    - Written specifically for Mac users (using Xcode 3.x)
    - Won't make you an "expert" in C, but gives you the basics
    - Code examples all available online
    
    Bottom Line: Recommended
Programming in C (3rd ed), by Stephen G. Kochan

    - Well written
    - on-par with "Learn C on the Mac" regarding beginner status
    - Not platform specific (you should know Xcode, TextMate)
    - Code examples don't generally jump chapter-to-chapter
    
    Bottom Line: Recommended
-------------------- Objective-C Books: --------------------

Programming in Objective-C 2.0 (3rd ed), by Stephen G. Kochan

    - I haven't fully read this book, but use it as reference
    - Seems to be a great continuation from Mr. Kochan's C book (above)
    - I wish I read this instead of Dalrymple/Knaster's
    
    Bottom Line: Can't give a recommendation because I haven't fully read it
Learn Objective-C on the Mac, by Mark Dalrymple and Scott Knaster

    - Continuation from "Learn C on the Mac", but I didn't like it as much
    - Writing style was a bit confusing at times. I preferred Dave Mark's C book.
    - Mac-orientated (using Xcode 3.x)
    
    Bottom Line: Recommended, with reservations
-------------------- Cocoa Books: --------------------

Cocoa Programming for Mac OS X (3rd ed), by Aaron Hillegass

    - Chapters 1-8 were fine. Chapters 9-35 are a NIGHTMARE for newbies.
    - Book uses new terms many times without defining them
        - Better know what a File's Owner is, or else Chap 9 will confuse you, etc
    - For one of the code examples the author wrote "I don't really expect you to 
      understand every line of that code now, but browse through the method and try
      to get the gist."
    - Book must be read sequentially, and code examples must be done sequentially. 
      Code examples in later chapters can reference code 5 chapters back. There's 
      no skipping around in this book, even for unrelated topics. Very annoying as
      a reference book.
    - For non-newbies, gives a "taste" of some of Cocoa's popular API's. You'll 
      have to read Apple's docs to really learn how to use them.
    - Reading this book after getting some Cocoa experience was much easier.
    
    Bottom Line: Very good intro to Cocoa's API's, but NOT for newbies coming 
                 straight from an Objective-C book. Read another Cocoa book 
                 first, program in Cocoa for 3-6 months, and then get this book.
Cocoa Programming for Mac OS X for Dummies (2nd ed), by Erick Tejkowski

    - THIS is the best "newbie" Cocoa book I've read. Very easy to understand 
      and follow.
    - Hand-holds you the entire way.
    - Many "minor" errors in the book and code examples, which is its only 
      downfall. However I managed to figure them all out and get every example 
      working.
    
    Bottom Line: Recommended for newbies. Only caveat is there are a lot of minor
                 errors in the book, but I managed to figure them all out without
                 much sweat.

Dave Mark has also written a new Cocoa book which I haven't read: Learn Cocoa on the Mac, by Jack Nutting, David Mark, Jeff LaMarche. If it's anything like Mr. Mark's C book, it's probably pretty good. Check reviews on Amazon, etc...

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

Also of note, Apple announced Xcode 4 in June 2010, which will replace Xcode 3.x "sometime in the future". Currently it's in beta. It has a very different user interface than Xcode 3.x, meaning just about every Mac programming book will become dated the moment Xcode 4 comes out. Both 3 & 4 appear "similar", but different enough to confuse new programmers.

dgallagher··on Breakfast is Overrated
I'll have to read that article when I have some free time. Thanks for the link. :)

While I do like some of the messages and ideas Michael Pollan (author of linked article, plus Food Inc.) is promoting, I always take him with a grain of skepticism. He's correct sometimes, and incorrect or questionable others. A common symptom of someone who's not a doctor or researcher in the field.

I personally classify him in the same arena as Michael Moore. Not to be ignored, but instead to be questioned for every made claim, requiring non-cherry picked studies and scientific research to back him up.

dgallagher··on Breakfast is Overrated
The problem is that doctor, dietitian, or nutritionist don't even agree with each other.

Look above for another question I answered, similar to this one, which I posted shortly after you posted yours. :)

Also, have you actually checked what the FDA nutritional recommendations are? They are really terrible advice that goes against actual science.

Any examples?

I think you meant USDA nutritional recommendations:

http://www.cnpp.usda.gov/DGAs2010-DGACReport.htm

In my root comment, I meant regulation of nutritional supplements (which is handled by the FDA). This is different than dietary recommendations (e.g. what quantity of vitamins/minerals to eat).

I'm not aware of any problems there are with the USDA's nutritional recommendations, though I'm sure there are some here and there (please share, I'd love to know!). It wouldn't be fair to discredit the entire document if there is an error, however.

It's a living document too, being updated every few years (the 2005 version should be replaced with the 2010 version soon). As more studies are done and more is learned about nutrition and humans, it gets revised.

dgallagher··on Breakfast is Overrated
The only problem is my doctor wants me to take X drug.

Try getting a second opinion from 1 or 2 other, unrelated doctors. Do they come to the same conclusion or not? Doctors aren't always 100% correct the first time (see my longish-response to another comment in this root thread).

My dietitian has type 2 diabetes yet still pushes to eat a grain filled breakfast and my nutritionist wants me to go on a cleansing diet of nothing but vegetables and fruits.

Lack of communication between the two? I'd get them in the same room together and watch them debate. Also this is another area where a second or third opinion would be good to have.

dgallagher··on Breakfast is Overrated
Good point. I'm not sure how many do, but it does happen. I'd love to see data regarding this (e.g. how widespread is it?).

Most doctors are essentially statisticians doing something like this:

1) Formulate a list of patient symptoms, ensuring credibility (e.g. are you lying/hiding/unaware-of something?).

2) Match those up with whatever diagnosis is statistically most likely.

3) Take "medicine X" and see what happens.

4) Cured? If not, go to step 2, repeat.

Step 2 can be subjective, especially if there are several likely causes. This can lead to different doctors giving different diagnosis. The more times a doctor has seen the same problem, the more likely he/she will be correct the first time. Specialists come in handy here, gathering lots of experience regarding only specific conditions.

For rare diseases, hard to diagnose, or those which aren't fully understood, repeating steps #2 - #4 is going to be more likely. This is where you'll find the greatest differences of "opinion".

Step #1 can be repeated too if conditions change, of course.

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

Regarding dietitians/nutritionists, I'm not sure how they work. I'd imagine most of their disagreements come from studies contradicting one another. Results of studies can be questioned as well.

There is some overlap with the statistical nature of doctors, though. Pinpointing food allergies/intolerances requires eliminating foods, one-at-a-time, from your diet and seeing what happens. I'm sure there are blood tests which can be done too.

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

In general though, it's not wise to discredit professionals just because they may disagree on certain things in their field. Unless the field is fully understood (I'm not aware of one which is!), you'll see that.

Perhaps I should rephrase my advice:

What's the best advice to take? That from "multiple" doctors, dietitians, or nutritionists. Not some yahoos on the internet.

A second or third opinion reduces the likelihood of errors, while limiting received advice only from those educated and qualified to give it.

dgallagher··on Breakfast is Overrated
I'll throw this one out there: "Barstool Blogging"

It's like conversations you have with some random person in the barstool section of a bar. Subject matter varies, but generally it ends with you both talking like "experts" about some random subject neither of you really knows much about, besides maybe a few "factoids" here and there.

dgallagher··on Breakfast is Overrated
Edit: The number of people jumping on board with this "theory" in his blog comments makes me despair for the state of nutrition and health education.

Most people on the internet have no idea what they're taking about when it comes to food, nutrition, and diets. The same applies to medical advice.

Many people read one thing and repeat it elsewhere, which is an issue if the source was incorrect. Also people love talking about their personal experiences. That's a problem seeing as it's not scientific (no control experiment, only one individual involved, etc...).

A big part of this is that the nutritional industry is not regulated by any body, such as the FDA. You end up with lots of products and advice that adds up to little more than snake oil. Hence fad diets.

What's the best advice to take? That from a doctor, dietitian, or nutritionist. Not some yahoo on the internet.

dgallagher··on Breakfast is Overrated
From what I've read, it'll take more than a nightly fast to trigger Ketosis:

If the diet is changed from a highly glycemic diet to a diet that does not provide sufficient carbohydrate to replenish glycogen stores, the body goes through a set of stages to enter ketosis. During the initial stages of this process, the adult brain does not burn ketones; however, the brain makes immediate use of this important substrate for lipid synthesis in the brain. After about 48 hours of this process, the brain starts burning ketones in order to more directly utilize the energy from the fat stores that are being depended upon, and to reserve the glucose only for its absolute needs, thus avoiding the depletion of the body's protein store in the muscles.

- http://en.wikipedia.org/wiki/Ketosis#Diet

dgallagher··on Ask HN: What do you use?
Hardware:

  MBP 17"            - anti-glare FTW
  Mac Mini           - for code testing
  52" HDTV           - 2nd display
  iPad               - 3rd display w/Air Display      - avatron.com/apps/air-display/
Software:

  1Password          - multi-browser password manager - agilewebsolutions.com
  Base               - SQLite manager                 - menial.co.uk
  Cinch & SizeUp     - window management              - irradiatedsoftware.com
  ClickToFlash       - block Flash in Safari          - clicktoflash.com
  Colloquy           - IRC                            - colloquy.info
  iWork Numbers      - notes                          - apple.com
  Murky              - mercurial/hg GUI               - tinyurl.com/p4qf2g
  OmniGraffle Pro    - diagrams/flow-charts           - omnigroup.com
  Photoshop          - graphics                       - adobe.com
  QuickSilver        - app launching                  - blacktree.com
  SelfControl        - block distracting websites     - tinyurl.com/d4ca5a
  Snippet            - code snippets                  - fuelcollective.com/snippet
  TextMate           - coding                         - macromates.com/
  Xcode              - coding                         - apple.com
  you Control:Tunes  - "Menu Bar" GUI for iTunes      - yousoftware.com/tunes/
dgallagher··on Joe Stump: Your city sucks (And so does mine)
The driving in eastern Massachusetts is pretty horrible, especially during rush hour (7:30am - 9:30am | 4:30pm - 6:30pm). Inside Route 128/I-95 expect to see many one-lane roads with traffic lights everywhere. Very slow moving at times with over-saturated roads. The Worcester area is just as bad. So are some communities in between I-495 and 128/I-95.

Public transit in the state is great IF you work/live near a train or subway line. Driving/parking to stations can be time consuming and expensive. Plenty of bus routes inside 128/I-95, though they have to deal with road traffic.

I lived in Boston for a bit without a car near the subway. Super-easy (and cheap!) to get around. It's definitely a very walkable city so long as you have something warm to wear in the winter. Having a car in Boston is expensive mostly due to parking. There is street parking, but good luck getting a spot! :)

dgallagher··on Microsoft Slowly Euthanizes Xbox Indie Games
The late-2010 Xbox 360 dashboard update did seem to bury the indie game section under more menu's than the old one did (this is my gut feeling; I don't recall the steps for the late-2009 dashboard update):

1) Game Marketplace (1 of 9 options)

2) Explore Game Content icon (1st listed out of 11 icons)

3) Specialty Shops (1 of 6 options)

4) Indie Games icon (2nd listed out of 6 icons)

Though to be fair the entire Xbox 360 dashboard is overtly populated with lots of menu's everywhere. A lot of it is redundant (I count at least 10 options for Kinect stuff littered throughout; there are likely more).

dgallagher··on Tell HN: Uptick in mean-spirited comments
Interesting. What about a moving average? One that ranks you based on the last ~30 days of activity?

How about the ability to shut off karma for certain posts? One exception if it's down-voted by more than ~10pts. Then the user gets that subtracted from their score, preventing abuse when posting mean/hateful comments.

dgallagher··on Tell HN: Uptick in mean-spirited comments
Extending this idea a bit, add a second statistic which indicates what percentile in the overall HN bell curve you fall into.

For the sake of example, imagine an evenly-distributed bell curve. The high end averages 10 karma's per post, and the bottom end 0 karama's per post. If your average is a 6, you'll be in the 60th percentile. A little "60%" could be displayed next to your username.

This allows you to quickly compare your level of contributions to those of others.

dgallagher··on Stephen King tells everything you need to know about writing in 10 minutes
Google Cache as the link is currently down:

http://webcache.googleusercontent.com/search?q=cache:4qYMp-t...

dgallagher··on John Carmack on government
The Iraq war was not about anti-terrorism, although that's partially how it was sold by politicians. The Iraqi government has never launched a single terrorist attack against the United States (please correct me if I'm wrong as I've never heard of one instance).
dgallagher··on Ask HN: What to do when co-workers don't aspire beyond getting their paychecks?
This is one my favorite posts I've ever read on HN. Thanks for sharing it. :)
dgallagher··on How to Push Past the Pain, as the Champions Do
You're very correct. The differentiation likely takes years of training to fully develop. A general rule of thumb to keep injury risk low is to never push yourself more than 10% of what you normally do (lots exercise books say this). If you can hold that level for several weeks without problem, it's likely safe to "notch up" another 5% or 10%. Lots of other variables at play too, of course (rest, stretching, warmup, etc...).
dgallagher··on How to Push Past the Pain, as the Champions Do
Just want to point out that there's a difference between "pain" and "discomfort".

Pain is your body saying "I'm injured. If you don't stop now, expect things to become worse, potentially causing permanent damage." No athlete I'm aware of pushes through pain unless they expect to retire immediately after, or go into surgery. Runners who do this tend to get knocked out of the sport. Good runners recognize pain for what it is and stop immediately.

Discomfort is different. This is what the article is talking about. Running through cramps. Throwing up but still not stopping. Feeling tired but still pushing ahead. Leg muscles sore but still holding pace.

Of course you need to be careful about discomfort too. It could be a sign that you're severely dehydrated, or have too few electrolytes in your body. This is mostly an issue for distances greater than a marathon, however.

dgallagher··on IDE WTF
Per Apple, Xcode 4 will have a feature that auto-fixes certain coding mistakes, like missing semi-colons:

http://developer.apple.com/technologies/tools/whats-new.html...

dgallagher··on Ask HN: Good Programming Search Engines?
Possibly (you never know). Actually if you take the idea a bit further, you could create "custom" search engines for various other topics.

For example, a search engine for chef's looking for new food to cook. A search engine for auto-repair for do-it-yourselfers. And of course a programming one. Basically, any major topic or profession.

This could be done by taking a large engine (such as Google) and customizing its queries, filtering out non-relevant stuff. Because currently everything is bunched up together in one giant index. It's not as efficient as it could be.

← PreviousPage 8 of 13Next →