HNHacker News
TopNewBestAskShowJobs

esmooov

345 karma · joined October 25, 2010

submissionscomments
esmooov··on Spot the Ball
What next? Crosswords in the paper?
esmooov··on Wikipedia Redesign Concept
I don't understand why designers refuse to pay attention to typographic guidelines. 95 characters per line is not very readable. To be fair, Wikipedia already suffers from this problem. Between 100-character lines and sans-serif body copy, Wikipedia's current typography is abysmal.

Otherwise this concept is fine. I'd love to see Wikipedia reset in Meta Serif or Tisa at 66-72 characters-per-line.

esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
Well, if you ever wanna chat about core.async or PourOver or jobs or life, I'm more than happy to do so: erik.hinton@nytimes.com Nolen's also a great guy and really serious about helping folks out with stuff like core.async. I'm sure he wouldn't mind jumping in an IRC chat to guide you along!
esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
Alright, this is a great point. It would be trivial for me to add addPossibilities. I think I'll do that! Thanks. This will really help for using PourOver to power tagging selection fields where you can ... add possibilities!
esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
I totally wouldn't be intimidated. We all just love what we do. The best way to get a job is often to get to know the folks on the team, hack with them on projects. I'd really hate to work at a place that I felt was exclusive.
esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
I think I'm a little confused. Why wouldn't you have just added the "roman" possibility from the get go? Could you provide an example of a situation when you don't know the universe of possibilities in advance?
esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
I would absolutely like to add a Crossfilter Filter type. I'd even accept a pull request ... ;)
esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
This looks really cool. I wouldn't say PourOver is focuses on speed as much as focused on being fast enough to get 60fps for 100k items. Cheers!
esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
There are some benchmarks against the base underscore filter methods in the tests. These are what Backbone uses by default. However, the real utility of PourOver is less in its raw speed -- I'm sure that it could be improved by smarter folks than I -- but in the patterns it abstracts. I hope you find it useful.
esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
Hi, all.

A lot of folks are asking for a demo and, you're right. I should have included one. My apologies. I'll get to working on one as soon as I can.

In the meantime, I encourage readers to check out the source for http://www.nytimes.com/interactive/2014/02/02/fashion/red-ca... That's probably the clearest "demo" of PourOver at the moment.

More to come!

esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
Crossfilter was absolutely the inspiration. I just wanted to make a Crossfilter that worked with the arbitrary boolean composition, could be dynamically added to and updated, and supported some of the less numerical patterns I was encountering.
esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
Oh this is great! I really should port something like this to the docs.
esmooov··on PourOver: A library for simple, fast filtering and sorting in the browser
This is exactly what PourOver offers. You can chain filter results to any boolean complexity, as well extend the default filter types to optimize indexing and caching. Indeed, PourOver was trivial to make, an outgrowth of the very pattern you define above. PourOver is just an attempt to scrap that boilerplate, allow for the queries to be indexed, combined with sorts, and automatically rebuild when the collection changes.
esmooov··on Privacy groups ask FTC to block Facebook-WhatsApp deal
"If you are not paying, then you are the product" is not logically equivalent to "if you are paying, then you are not the product". !A -> B != A -> !B Denying the antecedent.
esmooov··on Duck Wrapping
Just want to point out that you could implement similar behavior in Haskell:

{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-}

class Concatable a b where concat' :: a -> b -> a

instance Concatable [a] a where concat' l xs = l ++ [xs]

instance Concatable [a] [a] where concat' l xs = l ++ xs

a :: [Int] a = [1,2,3]

b :: Int b = 4

c :: [Int] c = [4]

-- Main> concat' a b

-- [1,2,3,4]

-- Main> concat' a c

-- [1,2,3,4]

esmooov··on Teaching Computer Programming to Underserved Kids
That's really excellent. It's funny, although not entirely surprising, but we have also been using parts of Khan and Bret Victor. The students seemed to really enjoy the sandbox of Khan as a starter to what is possible with code. Repl.it was a big help as well. The hard/fun part is transitioning between the experimenting and learning with these out-of-the-box tools to experimenting and learning by actually making your own stuff. I - and I'm sure the other ScriptEd folks - would love to hear more about your experience (scriptednyc@gmail.com).
esmooov··on Teaching Computer Programming to Underserved Kids
Haha. I'm happy someone saw that. I wish I could say that it had something to do with my theory of Social Catamorphism, folding our disparate talents into a better future, or something. Unfortunately, no such theory exists, and I just picked a piece of code that I enjoy and looks attractive.
esmooov··on On Atwood's Please Don't Learn to Code
Ah, yes. You are absolutely right that I pooched the Android memory example. Laymen might not care and it might not help them. I think a better example might be someone copying information off a website. I've seen this happen a lot. Someone will have to print off name tags for an event but there's only 10 people per page. Copy. Next page. Etc. If they understood, say, the idea of scraping, they'd see a simple batch scrape and save hours if not days.

As you your other point though, about general problem solving, I think I was unclear. When I said you miss the loops and divide-and-conquers of everyday life, I was just trying -- perhaps too lyrically for my own good -- that you are unable to categorize the world into categories you do not know and cannot recognize. You can't see that the operation you do for every page could be abstracted into a loop, exectuable by a computer. You don't see that you don't need to compare all of your friends to arrange them by height, say for a sweet picture, but you can quicksort them. (Ok this is about as contrived as you can get but programmers have a hard time thinking of places most people don't see programming but we do. Because we see it everywhere).

Finally, sure we should focus on illiteracy, debt, oppression etc. We are working, though, on a lot of these problems programmatically.

esmooov··on On Atwood's Please Don't Learn to Code
Right, and this is a barrier to learning digital domains. There is no physicalization of many digital ideas but, precisely by being digital, they do not map onto physical things. I can't run into a lambda on the street or have to fix a leaky loop in my roof. Sure, everyday things touch code but there's a reason why our instinct is to "blow on the cartridge" and not "fire up the debugger"
esmooov··on On Atwood's Please Don't Learn to Code
I like this point. It is an important distinction and a good comparison to a related area, physics. Two thoughts, though, that I'd like to hear your thoughts on:

1. Don't we all learn physics? At least basically in school we learn about inertia and atoms and velocity. Sure we don't learn the hard stuff and our understanding is woefully incomplete. But the analogy would be "the physics we learn in school" and "things like conditionals, sets, graphs, types". 2. The utility curve of physics is a little different than that of programming. Both contextualize the world and give you richer understandings of it in a similar fashion. However, physics stops solving everyday problems sooner than programming does. I have never whipped out alternative spacetime topologies to solve an everyday problem. I have written tons of bots and things to automate my life.

Dunno, just some thoughts.

esmooov··on On Atwood's Please Don't Learn to Code
Haha, that's awesome.
esmooov··on On Atwood's Please Don't Learn to Code
I wanted to add this to my original post because I think it sums up my point nicely:

"That which interests us in a given situation, that which we are likely to grasp in it first, is the side by which it can respond to a tendency or a need. But a need goes straight to the resemblance or quality; it cares little for individual differences. To this discernment of the useful we may surmise that the perception of animals is, in most cases, confined." - Bergson from Matter and Memory

Constraints on what we broadly know and understand are constraints on our contact and perception of the world. We can't live in a digital world and be blind to the recursions and graphs in the furniture.

esmooov··on CoffeeScript Means Giving Up on JavaScript
I'm not sure that this conclusion follows nor am I sure that discussions like this accomplish anything. CoffeeScript makes it easier to write "correct" JS and patches an institutional bug: Javascript's development crawls along. Even if it didn't the browser-as-environment handcuffs developers from taking advantage of new language features. (Have you used JS array comprehensions? No, because browser support is spotty, unreliable). And even in the best of development climates -- a thousand genius hackers ardently updating the code base -- these environmental restrictions would persist, drawn over the frame of IE-Mozilla-Google conflict and competition.

So we have languages that compile to JS that let the language evolve. I use CoffeeScript sometimes and JS sometimes. I'm not going to waste the time in the write-compile CoffeeScript loop for 100 lines of JS that I can write correctly. However, I no longer have to work on a 2k LOC, complex JS app without all the niceties of CoffeeScript. Furthermore, if I'm doing something that benefits from the special expressivity of a Lisp, I'll use clojurescript. If I'm very adventurous (and I need to write, say, an H.264 decoder), I'll use emscripten after any language that compiles to LLVM first.

But these are all for different uses, often things you would never have used POJS for anyway. It's not a discussion of plain ol' JS versions of H.264 encoders vs those made originally with Emscripten. It's a discussion of them not existing at all before, and now having the ability to express them and compile to JS. It's not a question of the old enormous apps we built in JS to the new, simpler ones we express in CoffeeScript. It's a question of not being able to build/maintain 5k LOC in POJS across many developers (whereas this task is less substantial in CoffeeScript). Live and let live and everyone benefits.

esmooov··on Loyal Opposition to Const, Private, Freeze, Non-Configurable, Non-Writable...
I think Jeremy's real point is that Javascript is an entirely different beast than Haskell or Java or Ruby. Why? Javascript depends on a free and open code environment to get around the fact that the actual language's development moves glacially, you have no control of the deploy environment (unless you are a browser developer or are working in node) and it is not easy to manage large projects (inclusion and namespacing features are lacking or limited in JS). In fact, the only feature that allows JS to keep up at all with these other languages is that it tells its developers "Look, I don't have a lot of fancy features and I haven't really changed in about a decade, but I'm entirely open. Hack and abuse me at your pleasure, codify me if you must, I'll take it. I always do."

None of the proposed object-lockdown would prevent anything. You could use decorators, you could use an adapter, hell you could rewrite or fork the useful library and take out the object-locks. But all of those introduce the very overhead that JS benefits from avoiding. I mean compare the size of "Javascript Pattern" to the GOF book. What's more, languages like Java are written with a sensitivity toward design patterning, Haskell has robust types/interfaces. Javascript just has a big empty box, prototypes and closures. (This is an exaggeration but if you declaim it loudly enough you will get a chuckle.)

esmooov··on TPM Under DDOS Attack
Bingo
esmooov··on NoSQL is a Premature Optimization
A lot of the confusion and furor over NoSQL vs relational vs NewSQL is caused by the idea that these technologies demand any sort of mutual exclusion. At my shop we use Redis and MySQL and SQLite extensively and - to the best of my knowledge - they have never gotten into scuffles with each other, holy wars of relationality. In fact, this seems to be a proclivity unique to their users.

That being said, I think it is - wait for it - premature to call NoSQL an unwarranted early "optimization." For our real-time analytics app, we use Redis because we are just storing key (page name) value (hits). With millions of writes a day for relatively simple data, it is nice - and in no way premature - to run Redis on a medium-sized instance. Data retrieval is fast and after a year and a half we haven't had any problems.

Other apps, use MySQL exclusively. For our many-many forests of tag, entry, source, author, etc etc relational data, we rely on the easy oversight of MySQL and the rich ORMs that have gracefully evolved to cut through the jungle.

What's more, there are many applications that use both Redis and MySQL. My Silver gem https://github.com/tpm/silver wraps MySQL requests in a Redis caching layer to speed up queries. This is not terribly novel or that different than, say, memcached but it does what we need it to.

The point is that just like apps are as multiform as the imagination is competent, so should be the tools and strategies we use to create them and solve their problems. Yes, people will use NoSQL incorrectly. People use MySQL incorrectly and inefficiently more than not. Hell, you can use YAML in a bad way. Those aren't the cases we should focus on. We should focus on all the systems that do work.

I'd like to see, for every mind-thinky post about whether or not MySQL is a death trap or NoSQL is a nu-wave panacea, a post about how some company is making the technologies that they have chosen work for them. At the end of the day, there is no uniform march toward optimal global technology efficiency. Just the small victories of a startup that needs to record cat GPS movements, a newspaper that needs to analyze a million pages of leaks, a broker who needs to pour through SEC dumps. NoSQL, NewSQL, SQL, HithertoUnknownUnPostSQL: I say let em all in. Someone will find them useful.

esmooov··on The CMS Is Broken.
Well there are certainly tradeoffs. We do have more apps that can fail. Then again, when one does start to choke, as will happen, the others don't die. So if Baroque locks up, or starts to churn, or I do the ol rm -rf / all that is impacted it our ability to press frontpages until Chef can mint us another Baroque.

Also, there's not, so much, another layer between frontend and backend as there is a multiplication of frontends. It certainly may get us into trouble. Luckily, we already were in trouble and, worse case scenario, we all learn a lot from the experience.

The hell-road blacktop is something we are trying to tear us by substituting the abstract relation of CMS to site for a closer isomorphy of app to function. Who knows? Might work.

esmooov··on Haskell Platform 2011.2.0.1 is out -- major improvements for Mac users
So now that we have https://github.com/kripken/emscripten and a reliable LLVM backend for GHC, has anyone tried compiling Haskell to JavaScript? My instinct is that the world would explode but I can't be sure.
esmooov··on Four JavaScript Lines to Defeat New York Times Paywall
"...those of us in startup mode don't need the time sink of keeping up with the news..."

And that is why startups are rarely successful.

esmooov··on What kind of things are easy in Haskell and hard in Scala, and vice versa?
If you want some exact tasks that seem to be easier in Scala or Haskell, I think that if you take a truly skilled and experienced programmer in each language most tasks can be accomplished quickly, easily and efficiently. For what it's worth, here are some less deep tasks that seem easier in one language than the other:

Pattern matching/data extraction: Both Haskell and Scala have powerful pattern matching capabilities for extracting data from complex types in a simple and clear fashion. However, do to some of Scala's OO features such as case classes and extractors, elaborate pattern matching can be set up quite elegantly. A good example of this in action is the lift-json library that allows users to query a large JSON object in a variety of ways (LINQ,Xpath,etc) and decompose it swiftly. Haskell's pattern matching is accomplished through it's data constructors. This leads to simpler pattern matching on small structures but can quickly devolve into spaghetti with increasingly complex structures.

2. Laziness: Haskell wins this round as most of Haskell's types are lazy by default and you have to work hard to make them strict. In Scala, laziness is accomplished through either the Stream type of Collection views. Say for instance you have a 1000 item list, map 2 functions in succession that can't be composited and then return some arbitrary numbers of initial elements (perhaps a convoluted example) this is how you would do it in Haskell (this is not how you should ever write this but say, for the sake of argument you had to):

take 3 $ map (\a -> a * 10)­ $ map (\a -> a+1) [1..]

As you can see, this automatically had to happen lazily as it was performed against an infinite list. Compare the same thing in Scala:

List.range(1,1000000).view.map(_+1).map(_ * 10).take(3).force

For the sake of presentation, we just used a long list for the Scala example. If you want to check the laziness, try do this with the view and force and watch how long it takes. We could have also done this with Streams but we will look at this in the next point.

3. Infinite lists. Once you work with infinite lists in Haskell, you will want to use them all the time. In Haskell you just write, say,

take 3 [1..]

to make an list of all positive integers and take the first 3.

In Scala:

def posints(a:Int): Stream[Int] = a #:: posints(a+1)

posints(1).take(3).force

Now, why these three examples of things easier in one or the other? I think that they exemplify the real difference between Haskell and Scala: In Scala, complex things are easier and easy things are more complex. In Haskell, easy things are easy and complex things are complex. This is, of course, a gross oversimplification and there are many caveats: Haskell does functional stuff easier, Scala does mixed paradigm stuff well, etc. Whatever. Every explanation is an oversimplifcation of something more organic.

I would be happy to post more example of differences between Haskell and Scala. They are both so rad.

Page 1 of 2Next →