HNHacker News
TopNewBestAskShowJobs

taylorfausak

453 karma · joined November 5, 2010

http://taylor.fausak.me

[ my public key: https://keybase.io/taylorfausak; my proof: https://keybase.io/taylorfausak/sigs/A2PCjgr2EDNNESDi2ULoiDl4L7q-8NB0hCGk2pnfCSY ]

submissionscomments
taylorfausak··on Fluffy Little Rovers Are an Effective, Adorable Way of Monitoring Penguins
From the paragraph above the photo:

> The researchers went about this by sneaking up on a nesting penguin from behind, covering its eyes, and sticking a cardio-frequency monitor on its back and putting the receiver (a watch-like device) around its flipper.

taylorfausak··on Mobile Web App Checklist
This is a great list! I have to nit pick the touch icon and splash screen sections, though. It's a lot more complicated than that. You need at least 8 <link> tags for touch icons and 7 for splash screens, just to support iOS <= 7. http://taylor.fausak.me/2013/11/01/ios-7-web-apps/
taylorfausak··on Swift – Why Annoying Is Good
You can use eitherDecode to get that behavior. http://hackage.haskell.org/package/aeson-0.8.0.0/docs/Data-A...
taylorfausak··on Haskell on Android
> To the inexperienced, this may look just like any green screen. But it meant much more.

Reminds me of "Black Triangles": http://rampantgames.com/blog/?p=7745

taylorfausak··on Implementing 2048 in 90 lines of Haskell
As ibotty said, I named the anonymous inner worker function `go`. From what I can tell, it seems to be pretty common in Haskell.

As for `>>=` (also known as `bind`), I'm using it as a more generic version of `concatMap`. The following expressions are basically the same:

    concat (map (\ x -> [x, -x]) [1, 2, 3])
    concatMap (\ x -> [x, -x]) [1, 2, 3]
    [1, 2, 3] >>= \ x -> [x, -x]
If you want to learn more, check out LYAH [1].

[1]: http://learnyouahaskell.com/a-fistful-of-monads

taylorfausak··on Implementing 2048 in 90 lines of Haskell
Wow, excellent catch! I apologize for the discrepancy. I must have made a mistake simplifying the game code for the blog post. I created a Gist [1] to showcase the differences.

The problem in the blog post is the `add` function. It should recurse (like `go` in the Hs2048 package). I fixed the post [2] with this line:

    add (x : y : rest) = x + y : add rest
[1]: https://gist.github.com/tfausak/4401ef0b43b5c1db0570 [2]: https://github.com/tfausak/tfausak.github.io/issues/31
taylorfausak··on Implementing 2048 in 90 lines of Haskell
Neat! I also cloned 2048 in Haskell [1]. I don't know how many lines of code it is, but the core game logic is remarkably simple.

[1]: http://taylor.fausak.me/2014/04/28/cloning-2048-in-haskell/

taylorfausak··on 10 Most Common Rails Mistakes
I would much rather have it return a null object instead of nil. You could make it better by adding a #guest? method to your User class.

    if current_user.guest?
Although I don't like how the example given returns an OpenStruct instead of a NullUser, for instance.
taylorfausak··on Haskell Packages for Development
I built a template for hi that sets up stylish-haskell, a test suite, an executable, and much more. Check it out: http://taylor.fausak.me/2014/03/04/haskeleton-a-haskell-proj...
taylorfausak··on Rails – The Missing Parts
Thanks for the shout out! I'm one of the developers of ActiveInteraction. Since most of the interactor gems are pretty similar, here's why you might prefer ActiveInteraction over Mutations, Interactor, et al.:

- Built-in ActiveModel validations. - Designed to be used with form objects. - Easier and more flexible composition. - Translatable with I18n. - Quacks like an ActiveModel.

That being said, Mutations is a great library for PORO interactors and ActiveInteraction wouldn't exist without it.

taylorfausak··on Frequency
It's a reference to this: http://xkcd.com/165/
taylorfausak··on Rewrites of the STM core model – again
It's in the URL.
taylorfausak··on Regex Golf
"You are deducted one point per character you use, and ten if you match something you shouldn't."
taylorfausak··on What's New in Ruby 2.1 [pdf]
I'm looking forward to `def` returning a symbol (page 11).

    private static void def main(args) ...; end
taylorfausak··on Python 3.4 Beta 1 Released
Wow, I haven't heard of pathlib [1] before now, but it looks awesome! In particular, using the slash operator to join paths is brilliant.

    >>> p = PurePath('/etc')
    >>> p / 'init.d' / 'apache2'
    PurePosixPath('/etc/init.d/apache2')
[1]: http://docs.python.org/3.4/library/pathlib.html
taylorfausak··on Usability vs. Security in the Context of Apple iOS Mobile Hotspots
At first, I figured this could be used as a case against Randall Munroe's password generation algorithm [1]. But it looks like the problem is with Apple's implementation, not with the method. The abstract claims that "the process of selecting words from that word list is not random at all". I wondered how not-random the selection was. The paper says: "words from this Top 10 list are ten times more likely to be selected as a default password". The word frequency distribution graph [2] is pretty damning.

[1]: http://xkcd.com/936/ [2]: http://imgur.com/nAKkPe3

taylorfausak··on Things I Wish I Had Known About Django Development Before Starting My Company
That's true about Django apps, but this post doesn't describe a Django app. It describes a Django project.
taylorfausak··on Use long flags when scripting
Agreed! It saves a trip to the man page.

Something else I figured out recently is that if you put the pipe at the end of a line, you don't need a backslash:

    echo thing |
    grep thing
taylorfausak··on Trello uses an icon font and so can you
I'm a huge fan of icon fonts, but I have a nit to pick with the HTML they chose.

    <span class="icon-sm icon-org"/>
That is not valid HTML. The <span> element is not a self-closing tag, so the slash is essentially ignored [1]. Fog Creek's blog is XHTML, so the tag makes sense there, but Trello is HTML5.

[1]: http://dev.w3.org/html5/spec-author-view/syntax.html#syntax-...

taylorfausak··on What No One Told You About Z-Index
The key takeaway:

  > New stacking contexts can be formed [… w]hen an element has an 
  > opacity value less than 1.
I had no idea that was the case. The CSS 2.1 spec [1] notes that "other properties may introduce stacking contexts, for example 'opacity'". The CSS 3 spec [2] elaborates:

  > Since an element with opacity less than 1 is composited from a
  > single offscreen image, content outside of it cannot be layered
  > in z-order between pieces of content inside of it.
[1]: http://www.w3.org/TR/CSS2/visuren.html#z-index [2]: http://www.w3.org/TR/2010/PR-css3-color-20101028/#transparen...
taylorfausak··on Slash: A markup language for styling text on iOS
Why make the markup HTML-esque and then provide an emph tag instead of em?
taylorfausak··on [] are like Facebook
I linked to the HTML spec because it explains that the slash only means something for void or foreign elements. The <div> element is neither, so the slash is either interpreted as an attribute or ignored. You are correct, both in this comment and the previous one; I was agreeing with you and providing sources.

My comment about the spaces was trivia on top of your trivia. I thought it was relevant because all of your examples of self-closing tags had a space.

taylorfausak··on [] are like Facebook
The HTML5 spec [1] covers this nicely: "[I]f the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing." Furthermore, the space before the slash is only necessary for XHTML [2].

[1]: http://dev.w3.org/html5/spec/single-page.html#start-tags [2]: http://www.w3.org/TR/xhtml1/#C_2

taylorfausak··on Favicons in the retina age
The section about iOS home screen icons has an error. Retina iPad icons are 144 pixels square, not 114. I wrote a blog post [1] that covers that.

Also, I'd recommend using ConvertICO [2] instead of the X-Icon Editor. It generates much smaller files (4 kb vs. 32 kb).

[1]: http://taylor.fausak.me/2012/03/27/ios-web-app-icons-and-sta... [2]: http://news.ycombinator.com/item?id=4164119

taylorfausak··on فلسطين. top-level domain representing the Occupied Palestinian Territory
This TLD messes up HN's title: "top-level domain representing the Occupied Palestinian Territory | Hacker News .فلسطين" I assume this is because Arabic is right-to-left, but it's interesting that only the title is affected.

Edit: This affects Mobile Safari on an iPad (iOS 5.1.1).

taylorfausak··on Lisp-like html as a replacement to bbcode/markup/textile
What's wrong with Markdown links [1]? I'd have a hard time coming up with a better syntax than this:

    [Google][]
      [google]: http://www.google.com/
    [Google][1]
      [1]: http://www.google.com/
    [Google](http://www.google.com)
I'm not sure what you mean about double-spacing either. Line breaks (<br />) are made by adding two spaces to the end of a line. If you don't like that, try GitHub-flavored Markdown [2].

[1]: http://daringfireball.net/projects/markdown/syntax#links [2]: http://github.github.com/github-flavored-markdown/

taylorfausak··on Startup jobs
Flagged. This is blog spam. The linked article [1] was posted to Hacker News [2] a month ago, when it was written.

[1]: http://michaelochurch.wordpress.com/2012/07/08/dont-waste-yo... [2]: http://news.ycombinator.com/item?id=4217471

taylorfausak··on Mountain Lion quietly includes app blacklist and security restrictions
It's free for Mac Developer Program members [1]. In other words, it's free once you spend $100 per year.

[1]: https://developer.apple.com/resources/developer-id/

taylorfausak··on Be happy Bike to work.
This matches my experiences. I ride most mornings before work since I telecommute, but it's the same idea. The positive effect on my mood surprised me — it only takes a little bit of exercise!

As an aside, please be careful wearing headphones when you ride. There are plenty of flame wars over that (and helmets, and brakes) over in /r/bicycling.

taylorfausak··on Designing for A Retina Web
This is a good, comprehensive overview of the options for high-density web pages. However, I'm curious about their CSS media queries.

            device-pixel-ratio,
         -o-device-pixel-ratio,
       -moz-device-pixel-ratio,
    -Webkit-device-pixel-ratio { … }
I was under the impression that you should put the vendor-prefixed versions first, followed by the unprefixed one. (Also, I don't think "-Webkit-" should be capitalized, but I don't know if it matters.) To wit:

         -o-device-pixel-ratio,
       -moz-device-pixel-ratio,
    -webkit-device-pixel-ratio,
            device-pixel-ratio { … }
← PreviousPage 2 of 4Next →