HNHacker News
TopNewBestAskShowJobs

Nycto

709 karma · joined March 20, 2009

Dev on the brink

http://github.com/Nycto

submissionscomments
Nycto··on Breaking down Amazon's mega dropdown
Hey all,

I'm on the team that built this. We also built the redesign that launched last year. In fact, this was part of that. The article pretty much nails our implementation.

Point of fact: Our team is recruiting. If you dig UX projects like this, shoot our manager Chad an email: chaddes at amazon dot com

Nycto··on Stripe Checkout
At a previous company, we also found it to be a usability issue. Customers were confused when they were looking for a place to put their name, but couldn't find one. Incidentally, we encountered the same problem when we removed the "State" field from the address section (we could glean it from the zip).

Sample size of one company, so take this for what it's worth.

Nycto··on Git Tips And Workflows
> Search for a string in all revisions of entire git history

The example they show can be shortened by using xargs:

    git rev-list --all | xargs -n1 git --no-pager grep -F "search string"
And here it is as an alias that you can add to your .gitconfig:

    grepall = "!f() { git rev-list --all | xargs -n1 git --no-pager grep -F \"$1\"; }; f"
Nycto··on Yandex Browser
Two things:

1) 360 is based on Trident

2) I really hope this browser is nothing like 360: http://www.digital-dd.com/qihoo-browser-war

Nycto··on HBO to Netflix: We’re taking our ball & going home
It sounds like HBO is ditching Netflix to do their own streaming. Bummer. While I wish Netflix had a larger selection, the bigger appeal to me is how many platforms they support. I can watch it from Windows, my Boxee Box, my Wii, my iPhone or my Kindle Fire (Linux support is sourly missing, though). If HBO strikes out on their own, there is no way they are going to have that kind of breadth.

What I really want is a streaming service that lets me choose what sources I subscribe to in an a la cart manner. If Netflix wants to survive losing these content providers I think that's the direction they should go in: become a platform. And if they don't, it's a great idea for a startup.

Nycto··on Spin.js, a pure JS spinner
A spinner generated from http://www.ajaxload.info/ is 673 bytes. The minified javascript from this is ~3K. I suppose the trade off is features and flexibility, but I don't find myself needing much out of my ajax spinners.
Nycto··on CEOs vouch for Waiter Rule: Watch how people treat staff
I was a bit surprised to see an entire article devoted to this, as it's a very common in the theatrical world. Because of the short turn around time, directors are constantly having to work with new people. As well as calling people they know on the resumes, they will often ask the people collecting headshots and herding cattle outside the audition room if anything notable occurred. It can make or break an actors chances.

This is easy to apply to business. If you have a secretary greeting interview candidates, just get a quick opinion. Nobody wants to work with an asshole, and everyone remembers them.

Nycto··on Three string functions every PHP project needs
For anyone interested, you can actually make the startsWith and endsWith methods a lot faster by using strncasecmp or substr, like this:

https://github.com/Nycto/Round-Eights/blob/master/src/functi...

It could be a micro-optimization, but I find myself using these methods quite and it's a simple tweak to make.

Nycto··on Responding to Criticism
If an actor disagrees with the director's note, the rule is to try it once and see how it goes. Once you've done that, you can toss out additional ideas or expand on it, but you have to at least do it once.

If the actor simply wants to give the director or other actors general notes that they aren't immediately involved in, the answer is "no way." The director was hired to shape the overall vision of the show. However, that's not to say that they are infallible. Good directors will generally ask people they trust to come in and watch the show and give feedback. The Artistic Director (the director's boss) will also usually give feedback.

And ultimately, directors get reputations. Actors can choose who they want to work with and theatre communities are small. Just a few months back I watched a director get fired and completely ostracized because she was downright mean when it came to giving feedback. She would use insults and fear to control actors. I doubt she will ever work in this area again.

Nycto··on Responding to Criticism
In theatre, we have a maxim: "Take the note."

The rehearsal process is short, maybe a month max for straight plays. Once you get past the grind of blocking and memorization, the director doesn't have much time to shape and mold things to make the show fit their vision. Which means that actors have to swallow their insecurities (of which actors notoriously have many) and incorporate everything they're given. Fast. It's an exercise in feedback loops at break-neck speeds. And believe me, directors don't like giving the same note twice.

What I'm getting to here is that feedback has become a social event in theatre. I don't mean that there is pizza and noise makers, just that it's done as a group. Every night after a run through, the entire cast will sit down for however long it takes and go through the director's notes -- of which there will be many pages. Given the timeline, there is no time for debate. If you start a discussion with the director, you are wasting their time, as well as the time of all your cast members (who are on the clock). It doesn't matter if your feelings are hurt, or if you have some lame excuse -- at that moment, you're always wrong and the direct is always right. And the only thing going through everyone else's head is, "Take the note." There isn't a single actor in the world who wants to work with someone that can't take criticism.

The real rub is that all of these opinions are completely subjective, yet deeply personal. Because that's art. Ultimately, you just have to know your shit and be willing to think on your feet. In you're spare time, study what you're given and think about actual ways you can incorporate it. The big realization is that it's collaborative art. Everyone is working together and NEEDS to be willing to work towards the same goal. If you don't, you're the bad apple. Directors will simply stop casting you.

I don't know that any of this can be incorporated into the tech world. Maybe this is how we should do code reviews or design meetings. Or run startups. Heck if I know. But it's not something I've personally encountered in any other social groups so far.

Nycto··on An update on Redis and Lua
I'm sure you simply meant to make this comparison based on the fact that both implementations execute scripted functions on the data store server. However, I think there is a very important distinction that warrants a clarification: Stored procedures are saved on the server and then referenced by name. Redis scripting requires that the code be transmitted in each request.

Antirez goes over this in his original post, here: http://antirez.com/post/redis-and-scripting.html

Nycto··on Genesis of requiring a "Dropbox folder," versus designated folders
I must admit that the first time I looked at Dropbox, the single folder design made me stop the train. It wasn't until months later that I realized I could set up symlinks. It was a bit of an "I feel like a dumbass" moment.

With this in mind, it's easy to see that the Dropbox made the right design decision. With symlinks, the problem was already solved for them in a way that power users are already familiar with.

Nycto··on The Programmer Salary Taboo
It's only a wash if your only gauge is money. If you hire him, you've potentially sacrificed moral. Sure, it isn't immediately meassurable in dollars, but it is still an important price to pay.
Nycto··on A conversation between two chatbots and how one found out the other is an AI.
Wow, this reminds me of the open scenes we used to do back in college (I'm a theatre major turned programmer). The idea was to take random stream-of-consciousness dialogue and build scenes around them. It was an interesting exercise to teach actors about creating conflict.

Also, I almost expected Godot to show up at the end.

Nycto··on Switching to Plan J (From Scala back to Java)
Just take a look at how specs [1] works:

  "Some element" should {
      "behave in some way" in {
          // ...
      }
  }
According to this, the String type has a "should" method and an "in" method, but it really doesn't. Instead, there is an implicit conversion from a string to another type that actually has those methods. They idea here is to make the DSLs more fluent by removing the need to worry about complex type interactions while designing the interface. It lets the users use the pre-existing types they're already familiar with.

[1] http://code.google.com/p/specs/

Nycto··on Query optimization in MySQL with Subqueries
MySQL supports spatial indexes exactly for circumstances like this:

http://dev.mysql.com/doc/refman/5.0/en/spatial-extensions.ht...

Nycto··on Mixing DOM and PHP objects for fun & profit
I had the same thought, so I whipped up how I would have implemented it with PHP:

http://pastebin.com/YD79HaxU

Caveat: That code is completely untested

Nycto··on Show HN: WerdMerge: A Portmanteau Generator With Phonemes
You might consider adding a popup or a footer note that describes what the stars with exclamation points do. My guess is that they either report a profane word or bookmark a word combination, but I couldn't tell you for sure. Clicking on one didn't give me much either.
Nycto··on Let's hijack a botnet and see what we get: 1million IPs, 100k bots, 70GB of data
I was thinking they were trying to fool duplicate content detection algorithms. Make it look unique and you might get higher search engine ranking.
Nycto··on Hotlinking to jquery.com will be disabled on January 31, 2011
Unless jquery.com itself uses Google's CDN (which it already is for some of its javascript)
Nycto··on Show HN: A/Bingo for PHP
> review is more, than welcome.

You opened the door, so here is my feedback:

- You never have to explicitly define any of the super globals as global... you can delete any line that says "global $_SESSION;", for example

- The database interactions look like they are heavily dependent on global state. It is also a tightly coupled dependency

- Use __construct for constructors instead of the class name: http://www.php.net/manual/en/language.oop5.decon.php

- Foreach is better than a for loop for iterating over arrays

- Single character variable names only make code more confusing. You write code once, you read it a dozen times.

I challenge you to rewrite this with only using classes (no global functions) and to write unit tests for your code. Remember, if you have to jump through hoops to test your code, you need to rethink what you're doing.

Nycto··on HN-Books
Well done. I have one request: The ability to filter by language
Nycto··on Functional Programming, from Java to Scala, D. Wall
The article complains about Scala lacking Open Classes:

    Open classes let you add features at runtime. [snip] It's 
    the kind of thing that would be driving programmers nuts by
    the end of a 20-year maintenance cycle. But it's a godsend 
    when the developers of the original library weren't prescient 
    enough (or didn't have the time) to develop everything you
    need.
This is what implicit conversions are for:

http://www.scala-lang.org/node/130

Nycto··on PHP Object Oriented Programming Reinvented
> I'm sure the speed is awful. But that's not the point.

Fair enough. I can appreciate that you have done an interesting bit of hackery here. Along that vein, you might consider adding support for uniform access. With this, methods without arguments can be called as properties, and properties could be exposed as read/write or read-only.

> Also, type hinting isn't all it's cracked up to be in PHP.

This is a matter of taste, but I completely disagree. In my opinion, type hinting is one of the redeeming qualities of the language. It means that PHP is taking care of the sanity checks for you. Of course, I'm partial to strongly typed languages.

> The main problem I have is that you can't pass a decorator object to type hinted methods.

Polymorphism allows you to do this. In the context of decorators, that usually means defining an interface.

Nycto··on PHP Object Oriented Programming Reinvented
I had the exact same thought. PHP is already dog slow... that's one of it's trade offs. An extra layer of indirection would kill it.

Also, you are losing a few important feature of PHP by doing this:

- Type hinted arguments (http://www.php.net/manual/en/language.oop5.typehinting.php)

- Static method calls

- Autoloading

And there are a bunch of things that would become nightmarish to manage. For example, object serialization or cloning.

Nycto··on Building a Scrabble MMO in 48 hours
(Caveat: IANAL) He says in the article they're expecting a C&D from Hasbro, but I think the chances of that are less than they think. Games like "Words with Friends" and "Lexulous" haven't had many problems, and they are blatant rip offs with minor variations.
Nycto··on Boxee's thoughts about the Apple TV
I don't use boxee (yet. I'm going to pick up a boxee box when they come out), but they appear to support Netflix:

http://boxee.zendesk.com/entries/86465-the-netflix-app

Nycto··on Adventures of an imperative programmer in the land of fp
Thank you for the reference to Project Euler. I'm learning Scala right now and it gave me just the right sized challenges for testing my knowledge. They're big enough to take time and thought, but small enough that you can solve them within the CLI interpreter.
Nycto··on The Pen Gets Mightier
Kind of lame that the article doesn't link back to the actual product: http://www.livescribe.com/

I also found this video of someone demoing the pen: http://www.youtube.com/watch?v=OU_RKv5zemM

Nycto··on A DSL in 5 Languages: Ruby, Python, PHP, C#, Java
For the PHP version: Why is the search method static? You are forcing whatever class you are using to be tightly coupled. Dependency injection can be done in PHP, too.

Better:

    $bt = Braintree_Transaction_Search::someFactory();
    $collection = $bt->search(array(
        $bt->orderId()->startsWith('a2d')
        $bt->customerWebsite()->endsWith('.com'),
        $bt->billingFirstName()->is('John'),
        $bt->status()->in(array(
            Braintree_Transaction::AUTHORIZED,
            Braintree_Transaction::SETTLED
        )),
        $bt->amount()->between('10.00', '20.00')
    ));
If you're really up to it, there is no reason you couldn't use an even more fluent interface in PHP...

    $collection = $bt->where()
        ->orderId()->startsWith('a2d')
        ->and()->customerWebsite()->endsWith('.com')
        ->and()->billingFirstName()->is('John')
        ->search();
Also, please make sure the search method returns an iterator, not an array. Just because PHP allows you to shoot yourself in the foot, doesn't mean you should.
← PreviousPage 2 of 3Next →