Better HN
topnewbestaskshowjobs
Log inSign up

cmurphycode

517 karma · joined Jul 9, 2010 (16y ago) · 177 submissions

Software Engineer.

Opinions expressed are my own, and do not reflect my employer.

Submissions

121.

Automated Launch of 100 node Riak Cluster on EC2(reiddraper.com ↗)

2 points · by cmurphycode · 15y ago · discuss

comment 15y ago · link · parent

It's probably not as simple as just the fiber in fruits protecting against fructose/glucose, but it does help. (EDIT: what I mean is, don't replace fruits with a glass of metamucil and sugar :))

Soluble fiber is just that: soluble in water. In your stomach, it absorbs water and turns into a sort of carb-trapping gel. While the carbs are still eventually digested, the gel slows down the absorption. This is good, because it helps to regulate your blood sugar (not as much of a big spike and drop).

Since blood sugar spikes == insulin response == hungry signals, this is quite useful.

Insoluble fiber is also useful, but mostly just for waste processing.

comment 15y ago · link · parent

"checkout and reset do completely different things when given files or when not given files. reset on files should really have been called unadd. reset on refspecs should really have been jumpto, moveto or something else indicative that the current branch ptr is moved to a new refspec. --soft and friends could have been --no-update-index or --no-update-files."

I can understand your confusion, given the seemingly separate use cases for reset, but in fact, it makes perfect sense. Reset always does what it says it does. Let's break it down:

git reset --mixed <commit> will make your current HEAD point to <commit>, reset the index to <commit>, and leave your working tree alone. This is useful for "uncommitting" the last commit, e.g. so you can split it up into smaller commits. Example:

  git commit -am "lots of changes"
  # realize you should really do better
  git reset --mixed HEAD~1
  git add myfile.py
  git commit -m "implemented feature x"
  git add yourfile.py
  git commit -m "bugfix #3182"
Handy. Now let's look at the "unadd' scenario:

  git add dontstage.py
  git reset HEAD dontstage.py == git reset --mixed HEAD dontstage.py, since --mixed is the implicit default
git doesn't touch your commits, since you are already on HEAD. Git does reset the index to HEAD, which is before you added dontstage.py. If you had other changes that you added, it won't reset those, since you provided the limiter of dontstage.py. Git does not touch your working tree, so dontstage.py stays modified. The end result? Your working tree, index, and commits look exactly like before you ran git add dontstage.py.

Now, if someone (e.g. easy git: http://people.gnome.org/~newren/eg/) wants to make git reset HEAD to unadd, that's fine by me. I'm speculating here, but I imagine that the Linus/git dev point of view is, why call it anything other than exactly what it is? It's just nice and elegant that it happens to suffice multiple use cases.

The more you get into git, the more you start to realize why some of the commands that seemed arcane in the beginning are simple and elegantly named.

comment 15y ago · link · parent

That doesn't work for me. git commit -a --amend prompts for commit message in $editor git commit -a --amend -C complains about lack of input

Maybe this is a git version specific thing.

comment 15y ago · link · parent

Exactly. And if you know that you just want the SVN/HG commit-everything, just add a -a. Pretty intuitive.

Once you get used to having the ability to create arbitrary commits from a huge changeset, you'll find it aggravating when everyone else commits "3 bug fixes to core, swapping out a style sheet, and cleanup in database code" :)

comment 15y ago · link · parent

Absolutely. Hudson is great (I would even say invaluable), and Kohsuke, the founder, is an inspirational programmer.

comment 15y ago · link · parent

The page states it is only your first 30 created repos; did you have 30 before Leiningen?

comment 15y ago · link · parent

Google did try this. I don't think it ever left the lab, but I used it for a while. I think they may have canned it; I just realized I haven't seen it in a while. It was called searchwiki. I think it was originally just supposed to apply to your own results, but I'm sure they analyzed the tendencies to see if it would've helful to use overall.

Honestly, such a system would be ridiculously easy to game with a botnet, so there needs to be significant work in the area beforehand.

comment 15y ago · link · parent

I'm sure the price reflects a compromise in savings between the hotel and the consumer. While this is a simple example, removing inefficiencies like this is a good thing for the company, and a good thing for the consumers.

By the way, much like the new reduced plastic bottles by Poland Spring, this is a great example of company innovations spurred by the environment. So many cost saving ventures would have been out of the question for companies due to image (What? You expect me to get excited about the fact your bottles are more flimsy??), and are now up for grabs. Companies that recognize this opportunity will do well.

comment 15y ago · link · parent

Fascinating. I find it particularly interesting that Jobs, since moving back to Apple, has done nothing interesting with the Web, but so much with the desktop and hardware. Sure, iTunes delivers music over the Internet, but it is not a web application. On the other hand, he did create the iPad: "And then there's the typical hardware. It's possible that some people could come out with some very interesting Web terminals and sell some hardware."

comment 15y ago · link · parent

This article made me realize that Google's engineering/metrics based approach is more suited to some tasks than others. There are far too many possible views of the map to "design" by hand, but the algorithmic tricks that Google is so good at can handle it no problem. Even if a traditional usability expert could design a map of a given location at a given zoom level better (e.g., http://www.kickmap.com/), they couldn't pull it off at Google Maps scale.

Very good article, and the visual aides helped a lot.

comment 15y ago · link · parent

Hey, those are great! I don't know how I haven't come across those- feels like I've explored every git resource on Google. Maybe I should've used DDG :)

comment 16y ago · link · parent

Nice! I also had a tough time understanding the manual on this topic, so I made the following diagrams: http://cmurphycode.github.com/Git-Diagrams/ (Source is on GH, so you can send changes!)

I printed out the get/reset diagram and referred to it a lot when I learned git. I still check it every once in a while, for reassurance :)

comment 16y ago · link · parent

You can use the visual mode for selecting text, then operate on it with the usual vim business.

There are commands built in for a lot of actions, and if there is a right click option that the extension doesn't provide, you can always write a script to extend it. Vimperator is nicely extensible.

I'm not sure if Vim scrolling with hjkl resolves the issue you saw with the arrow keys- I'm sure that's site dependent, and you'll have to try it yourself.

Good luck!

comment 16y ago · link · parent

You can search for text easily with chrome or firefox. With firefox, you can hit the quote key and search the links, pressing enter to navigate to the page. F3 goes to the next result. The same feature is not available in Chrome natively, for some obstinate reason. It kept me from switching to Chrome, but then I tried the type-ahead-find extension. It's a script so it won't be as fast as native, but it's so much better than nothing.

Firefox also has the Vimperator plugin that gives vim-like nav for Firefox. Highly recommended if you like Vim.

comment 16y ago · link · parent

What's the difference? We're substituting having superior intellect with having the willpower to work hard. It seems weird to say that at first. But the more I think about it, the more I think there must be a reason why some people do persevere enough to become "genius" level at something, and some people never do.

Personally, I think work ethic, along with intellect and charisma, is something you are partially born with. It's just silly to say that genetics play no factor: do those with severe mental disabilities just not work hard enough? Think about it as your genes defining a range: you can be between the 30th and 75th percentile of human prowess. Where you fall in that range is up to you.

comment 16y ago · link · parent

I agree completely! I suspect the solution to the CAPTCHA paradox will be something we haven't even considered. In fact, I don't think we can even solve it directly- we have to approach the problem from a different angle. For example, we can start requiring significant identity authorization on some high quality sites (sacrificing anonymity for responsibility), and rely on advanced filtering for the rest.

Think about it: the actual problem with spammers defeating CAPTCHAs is low quality content. I'd much prefer to expend energy trying to stop low quality content, which is often delivered by non-spammers :)

I wrote a blog post expanding on these ideas: http://cmurphycode.posterous.com/the-problem-with-captcha

comment 16y ago · link · parent

This is fascinating. It reminded me of another documentary on conjoined twins who are fused partway down the spine. Almost the complement of these twins!

The wiki page for the other girls has information and links: https://secure.wikimedia.org/wikipedia/en/wiki/Abigail_and_B...

comment 16y ago · link · parent

Using rebase this way is not harmful, but the author didn't explain the situation when it is!

As usual, the Pro Git book does a great job explaining: http://progit.org/book/ch3-6.html

In short, if your team develops with an old-school, SVN type model, where there is one reference repo (the remote) that all developers pull from and push to, rebase to your hearts content. But if your team pulls from each other, you really want to be careful with rebasing. I believe this is how the Linux kernel is developed, which explains all of the warnings about git rebasing. After all, it's logical to assume that you should do exactly as the Linux kernel developers, for whom git was created, do!

comment 16y ago · link · parent

The historical question is very interesting, and I'm going to have to look into that more. But I suspect that artisans (a class that has changed a lot, if not died out completely) were very passionate about their work.

With the huge amount of hours that a knowledge worker spends at his day job, I personally feel that it's almost never worth it to have a job you don't enjoy. There just aren't enough hours in the day to do enough exciting things, once you subtract a healthy amount of sleep, maintenance tasks, and the day job. It certainly isn't worth it at the typically small compensation differences between jobs.

comment 16y ago · link · parent

There's an old quote I've heard attributed to the military, but I'm sure that's not the origin.

"Slow is smooth, smooth is fast"

Practicing fundamentals slowly is the traditional advice in everything from piano to karate.

comment 16y ago · link · parent

I like the !:-, even though it's super ugly. It's the perfect complement to alt+. !! is a classic, but the article mentions it.

comment 16y ago · link · parent

Here are some of my other favorites:

^foo^bar replaces the foo in the last command with bar

example: less setup.conf, ^less^vim

alt+. recalls the last argument of the last command (in emacs mode, anyway)

example: less setup.conf, vim alt+.

As mentioned, Ctrl+R is great for history searching. Repeatedly pressing Ctrl+R goes to the next result, and you can use the arrow keys to edit.

cd - goes to the last directory. It handles most of the use cases for pushd and popd.

comment 16y ago · link · parent

Would you accept an approximation for results as you type, with the true, exact search happening when you stop typing? I think this would be very useful, especially since I don't need to search the absolute real-time index of my emails 99% of the time. It would probably confuse users, though- having a new result pop in .5 seconds later.

comment 16y ago · link · parent

There's always a chicken-before-the-egg argument with companies like Apple. Do people love using their products because of their marketing, or is their marketing effective because people love using their products?

I think it's naive to say the former. Apple posted 3 billion dollars in profit last quarter. If all Nokia had to do to post those numbers was grossly overstate every feature in their phones (which should be easy, there are so many), they'd probably be doing it.

The thing that really bugs me about this is that personally, as a DIY techie, I actually like the power-user oriented nature of the Nokia phones a lot more than the iPhone (at least, at first, when the iPhone was hopelessly feature-barren). I probably would've really liked your real time search! But I'm not arguing about what I want from a product. I'm arguing about what the majority of people want.

comment 16y ago · link · parent

This is a classic engineer response. It's not about who does it first, it's about who does it right. We didn't have the technology to implement this properly 5 years ago. I've never seen the Ovi Maps tool you mention, but I'm willing to bet that it wasn't polished enough to make it natural for users.

Now, I'm not entirely convinced that Google Instant is polished enough either- anecdotally, I've already seen some confusion. But saying "it's all marketing" willfully ignores the lesson we've all been taught by Apple: a revolutionary feature that isn't intuitively usable is no revolutionary feature at all.

comment 16y ago · link · parent

I find careful measurement of activities is extremely helpful as a starting point for life change. After a certain point, you can leave the measurement behind, or at least back off the intensity. This is fortunate, since keeping such careful track of your life can be frustrating.

For example, when I wanted to get in better shape, I started calorie counting (in addition to exercising more, etc). I entered everything I ate into a website. This helped me become aware of what I was consuming- which can be quite deceiving.

Once I got a better handle on what foods were "dangerous" (not just bad for me, but which I ate in large quantities), I stopped calorie counting, but I'm maintaining my shape. I may go back to calorie counting every once in a while to see if anything's changed, but just that initial investment of time paid off quite well.

comment 16y ago · link · parent

I don't think it's as simple as keeping moving. I lost that flexibility fairly early on, certainly in the middle of playing multiple sports through high school, and I'm still very active today.

I know I don't do enough stretching, though. It's just frustrating because my hamstrings never seem to improve, and as soon as I stop stretching, I go back to base (about 12" from touching my toes while standing).

comment 16y ago · link · parent

This is the stereotypical Asian squat. Interestingly, young children do it by default. I think we lose flexibility as we age. I can't squat back on my heels without straining my shin muscles to keep from falling backwards, but the more I do it, the easier it becomes.

It is certainly a lot healthier for your knees than squatting on the balls of your feet, if only because your knees stay roughly on the same vertical as your toes. This is old powerlifter wisdom, and anyone with a knee injury can tell you first-hand. I can't squat on the balls of my feet without my right knee squealing in pain. Squatting on my heels is, at least, tolerable.

123456