Better HN
topnewbestaskshowjobs
Log inSign up

ericmoritz

734 karma · joined Jan 6, 2011 (15y ago) · 236 submissions

Submissions

comment 14y ago · link · parent

and if you have less time on your hands, spend an evening with The Little Schemer.

comment 14y ago · link · parent

With web services, documents are your public API. Once a service is public, there is a contract between you and the consumers of the API that it will not change until a new version comes out. This is why we see the /v1/ convention in REST services. /v1/ MUST not change on people. You wouldn't do that with a public C library, you shouldn't do that with web services. It is anti-social to change that API on developers.

These documents are very complex. Just take a look at a twitter timeline JSON response. Having a getter and setter for every field in that document would get ridiculous.

The problem with JSON is it is so easy to change that it takes self discipline to enforce your own social contract. We all know that when faced with deadlines some developers get a little fast and loose to meet that deadline.

comment 14y ago · link · parent

I use Pelican for my blog. It's pretty straight forward. http://readthedocs.org/docs/pelican/en/2.8/

comment 14y ago · link · parent

anyone know what the time complexity of the append function is?

comment 14y ago · link · parent

I got the urge to learn how to touch type in my mid-twenties. I didn't take typing classes in high school because I took programming classes for my tech credits, so I never learned.

I started off using Qwerty but found my hands cramping up. I fantasized about getting an ergonomic keyboard to make it easier but I thought it was strange to have to carry my keyboard between work and home (I didn't want to buy two, they're expensive) Looking at the Typematrix keyboards peeked my interest in Dvorak. I was already trying to learn Esperanto at the time, so what the hell, what's one more oddity to add to my list.

I did dvorak7min everyday for a week or two and completely switched. I've been touch typing using Dvorak for seven years now. I never had the hand cramping issues I had with Qwerty. I am sure if I tried hard, I could type fast but I enjoy how comfortable Dvorak is rather than the raw speed it would bring.

The only side effect of Dvorak was I ended up switching from Vim to EMACS because the hjkl movement keys are no longer on the home row.

Don't worry, I gave up that Esperanto thing. I figured that with the amount of effort I was exerting to learn Esperanto I could learn Spanish. I never did learn Spanish.

comment 14y ago · link · parent

I have an old Moto Razr that I put my SIM card in when I go on long bike rides in the boonies. The battery lasts longer and if I fall I don't have to worry about crushing my smartphone.

comment 14y ago · link · parent

I use this all the time for scheduling meetings across timezones.

comment 14y ago · link · parent

That's somewhat true. There's no need to model data structures like trees, maps, sets and lists in a data store that supports them natively.

This article is still useful when using Redis because the article describes techniques apart from modeling fundamental data structures; most of the indexing techniques are still applicable to Redis, for instance.

As an example, the Composite Key Index technique could be accomplished using a sorted set to store the ordered set of keys and Redis's k/v functionality to retrieve the values.

comment 14y ago · link · parent

Here's a quick benchmark on my machine (a EeePC 1001HE). I used reduce1 with clojure-py because there doesn't seem to be a reduce BIF. I don't know if that effected this benchmark any:

Python:

    (time (reduce1 + (range 100000)))
    Elapsed time: 3882.57193565 msecs
    4999950000
PyPy:

    user=> (time (reduce1 + (range 100000)))
    Elapsed time: 259.984970093 msecs
    4999950000
Clojure via Java Hotspot:

    user=> (time (reduce + (range 100000)))
    "Elapsed time: 75.35225 msecs"
    4999950000

comment 14y ago · link · parent

I get the same feeling now that I've adopted TDD. I've lost that magic of spending most of my time debugging code.

Now I just define the outcome I want, assert that a unwritten function produces that outcome and code the outcome. Sigh /s

comment 14y ago · link · parent

Yeah, I don't see a reason why the entire stack has to be on one machine. It simplifies configuration a little but there's a trade off in the granularity of resources allocation that comes with the tiered approach.

1st, web servers are are distributable by design. If the web app in question can not be distributed, then a reread of Fielding's dissertation is in order:

http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

So if the web tier is designed correctly and is simply a state-less, data transformation engine then what's left is making your data tier be distributable and elastic.

Even better we could put an elastic web service layer between the frontend web tier and the data storage tier to provide an even better separation of presentation and logic.

In this set-up I believe we have the best of both worlds, the elasticity of the confederated design because each tier is designed to be fault tolerant and elastic with the resource allocation granularity we get with the tiered clusters.

comment 14y ago · link · parent

In my opinion they're both KV stores. Where they differ is what data structure they store. Cassandra stores BigTable rows indexed by a key and Riak is a binary blob + metadata indexed by a key.

I suppose it all depends on how be define a key/value store. Is it simply a data structure that can be accessed by a primary key. If that's the fact, nearly all databases fall under that description. If, on the other hand, a key/value store is simply a database that stores a blob indexed by a key, then nirvana is correct in saying "Cassandra" is not a KV store, but where does that get us?

I think that comparing HyperDex to Cassandra is a valid comparison. Both support pk lookups and secondary key lookups. The same is true about Riak. It would be nice to see a YCSB benchmark for properly configured Riak cluster.

I am pretty ignorant of the YCSB benchmark but it would be nice to have a benchmark that tests fault tolerance as well as raw performance.

comment 14y ago · link · parent

That's what I was getting at. It's appears to be a CP system. I wish all new distributed databases would have a nice little badge that says, "CP", "AP" or "CA".

Whenever they claim to be distributed but not subject to CAP, I automatically become skeptical.

There's nothing wrong with a CP database; HBase is a CP database and it's quite popular.

comment 14y ago · link · parent

From the FAQ <http://hyperdex.org/faq/>:

"So, the CAP Theorem says that you can only have one of C, A, and P. Which are you sacrificing?

HyperDex is designed to operate within a single datacenter. The CAP Theorem holds only for asynchronous environments, and well-administered datacenters enable us to sidestep this tradeoff entirely."

I'd like to see how they pull that off when a node goes down. I guess in "well-administered" data centers, nodes don't go down.

Sounds like they're sacrificing "A" to me because they're doing synchronous replication.

comment 14y ago · link · parent

I am going to try for a week or two. Having nearly 12 hours dedicated to work, I only have 4 exhausted hours in the evenings for eating dinner, spending time with my wife, kids and myself.

If my wife and I split our sleep cycle into two 4 hour periods we can better spend my four hours of free time.

The waking period between my commute and first sleep could be spend eating dinner, playing with the kids, and exercise. After my first sleep I can spend time with my wife, and study with a rested mind. Theoretically it seems like a good idea. We'll see how I cope after a week or two of trying.

comment 14y ago · link · parent

My guess is it's going to be an entire Xorg stack and Unity running along side Android.

107.

Learning Python Logging(eric.themoritzfamily.com ↗)

1 points · by ericmoritz · 14y ago · discuss

comment 14y ago · link · parent

I read it cover to cover. For most of the chapters I read the left side, answer the question in my head and then looked to the right to see if I was right.

Having just learned Clojure using "The Joy of Clojure", If there was anything I needed to verify, I translated the code into clj and pasted it into a Clojure REPL.

comment 14y ago · link · parent

I read it on my Kindle so I assumed the bad formatting was caused by reformatting to fit the Kindle.

comment 14y ago · link · parent

No, I don't think so. Those books were chosen not because they're good at teaching you C but rather because they're good at introducing you to concepts like memory layout, data structures and algorithms.

comment 14y ago · link · parent

Thanks for the recommendation. That was one of the text books that I looked at but the sticker shock steered me towards free MIT course notes.

comment 14y ago · link · parent

What I got out of The Little Schemer wasn't really how to write Scheme but more how to solve problems recursively.

At least for me it excelled in that aspect. As a method for teaching Scheme, I am certain it leaves much to be desired.

comment 14y ago · link · parent

Do you have a book recommendation to help someone read papers. I spent an couple evenings going over MIT course notes on discrete mathematics to attempt to read a paper on Conflict-free Replicated Data Types <http://hal.archives-ouvertes.fr/docs/00/55/55/88/PDF/techrep...;

What I would give for a book at that time that would help me translate the following:

    merge (X, Y ) : payload Z
       let ∀i ∈ [0, n − 1] : Z.P[i] = max(X.P[i], Y.P[i])
Into

    def merge(X, Y):
       Z = ... new object ...
       for i in range(len(X.P) - 1):
           Z.P[i] = max(X.P[i], Y.P[i])
       return Z
I eventually figured it out but it was a bit rough trying to figure out what all the symbols meant.

comment 14y ago · link · parent

I apologize for any offense that I may have given by using the phase "self-taught computer scientist".

This article is my personal recommendation of books that I often recommend to junior developers that are smart but didn't complete a degree and often find their knowledge of basic computer science lacking.

comment 14y ago · link · parent

I am sorry. What did you expect?

comment 14y ago · link · parent

The Design Patterns book is not on the list because I have not read it yet. Based on what I know of it, I am sure that it deserves to be on the list.

comment 14y ago · link · parent

When I say, "self-taught computer scientist" I had in mind someone, much like myself that did not go through college to earn a comp-sci degree but instead learned on the job and solves problems scientifically rather than by brute force.

I agree with you that it is a bit a self-applied label that could be offensive to those who finished college and earned a degree. Much like someone calling themselves a doctor without getting a PhD.

118.

Books every self-taught computer scientist should read(eric.themoritzfamily.com ↗)

229 points · by ericmoritz · 14y ago · 76 comments

comment 14y ago · link · parent

I have to say, after tinkering with Clojure, when I'm typing out a python dict or list I think, "So many damn commas..."
12345
8