HNHacker News
TopNewBestAskShowJobs

asymptotic

409 karma · joined March 21, 2011

https://asim.ihsan.io/ https://github.com/asimihsan

[ my public key: https://keybase.io/asim; my proof: https://keybase.io/asim/sigs/ghOttQMhTUWDaeBj1z7Ebq-7KDe5wAATYO8RQ1QGUBs ]

submissionscomments
asymptotic··on My wife's and my holiday weekend project: A database of intro books
The basis of your website was the subject of a wildly popular Metafilter thread, which may interest you:

What single book is the best introduction to your field (or specialization within your field) for laypeople?

http://ask.metafilter.com/71101/What-single-book-is-the-best...

asymptotic··on Secure your code against the finalizer vulnerability
FWIW, from Bloch's "Effective Java" (2nd Edition):

    "Finalizers are unpredictable, often dangerous, and generally unnecessary. 
    Their use can cause erratic behavior, poor performance, and portability
    problems. Finalizers have a few valid uses, which we'll cover later in this
    item, but as a rule of thumb, you should avoid finalizers...

    One of the shortcomings of finalizers is that there is no guarantee they'll
    be executed promptly.  It can take an arbitrarily long time between
    the time that an object becomes unreachable and the time that its finalizer
    is executed. This means that you should never do anything time-critical in a
    finalizers.  For example, it is a grave error to depend on a finalizer to
    close files, because open file descriptors are a limited resource...

    Not only does the language specification provide no guarantee that finalizers
    will get executed promptly; it provides no guarantee that they'll get
    executed at all. It is entirely possible, even likely, that a program
    terminates without executing finalizers on some objects that are no longers
    reachable. As a consequence, you should never depend on a finalizer to update
    critical persistent state...

    Oh, and one more thing: there is a severe performance penalty for using
    finalizers."
Why would anyone ever consider using a finalizer?
asymptotic··on Return "this" in java instead of cloning objects.
The idea of chained calls all returning this forms the basis of the phenomenally useful Builder Pattern, from Bloch's "Effective Java".

There are three main reasons for using the Builder Pattern:

1) Allows for "constructor-like" calls to functions that don't necessarily share the name of the class.

2) Allows for complex, multi-parameter "constructor-like" calls without needing to make one massive function call.

3) Allows intermediate argument checking on particular constructor arguments, and allows sane optional constructor arguments.

(I find this pattern very useful).

See:

http://rwhansen.blogspot.com/2007/07/theres-builder-pattern-...

http://stackoverflow.com/questions/5007355/builder-pattern-i...

https://manuelselva.wordpress.com/2010/04/09/effective-java-...

asymptotic··on The Trouble with Erlang Concurrency
tl;dr: The Actor model of concurrency used in Erlang doesn't lend itself well to key/value caches.

The fact that Mnesia isn't mentioned once indicates the author is insufficiently knowledgeable about Erlang to write an informed article. This isn't an ad hominem attack because he didn't even mention Mnesia, hence this is an attack on the content of the article rather than his credentials.

(This rather anal mention of ad hominem is relevant because the author brings it up in the comments).

To those that follow, you'll learn more reading:

Erlang - mnesia (Erlang documentation) http://www.erlang.org/doc/man/mnesia.html

CAP theorem https://secure.wikimedia.org/wikipedia/en/wiki/CAP_theorem

And, of course, if you want to use something that someone has "just done", you would simply use Riak, which uses Erlang to implement an Amazon Dynamo type distributed key-value store:

http://wiki.basho.com/

Not that difficult. A few Google's and you're set.

EDIT: On reading my post I realise that Mnesia is an OTP application, rather than an Erlang built-in, and that Riak is an Erlang-based 3rd party library. However, using canonical libraries is part-and-parcel with learning about a language, IMO.

asymptotic··on Uniform and Normal Random Number Generator Shootout
I'm sorry, the quality tests are garbage. Anyone who's done even a cursory amount of research into PRNGs has already heard about the Diehard tests and would have used these in preference, or as a subset, of subsequent testing.

https://secure.wikimedia.org/wikipedia/en/wiki/Diehard_tests

As may be expected Diehard isn't the be-all-and-end-all of random generator testing; NIST have their own standards. Dieharder is an attempt to consolidate Diehard, NIST, and various other randomness tests.

http://www.phy.duke.edu/~rgb/General/dieharder.php

This is a severe, severe case of "Not Invented Here"; please do research before reinventing the wheel.

asymptotic··on The Most Important Code Isn't Code
Most discussions about commenting necessarily revolve around how to comment functions/methods/classes, when to comment, how to write code that is so intuitive that it doesn't necessarily require commenting, etc. In my opinion, these discussions miss out a key documentation requirement: describing how everything fits together.

Let's assume the supposed best-case: every single method and class is commented using a language-specific documentation system (I'm thinking of EDoc for Erlang, Javadoc for Java, etc). Who cares? Congratulations: I now know how all your functions work. But what is the system architecture? How do object instances of the different classes hang together to support the functional specifications? What is the sequence of events for various successful and failed transactions?

I suppose what I'm complaining about is the rationale that code commenting can necessarily substitute a solid set of functional specification and design documents. Then again, noone here made this suggestion, so maybe I'm just whining into a black hole. The only open-source project that comes to mind when I think of an astoundingly high quality of documentation is SQLite in the form of "Inside SQLite (2007)" (O'Reilly); unfortunately it's not free.

asymptotic··on Ask HN: Designers, please open up the library of stuff you've collected
Thank you. A hundred times thank you.
asymptotic··on Why positive fantasies make your dreams less likely to come true
FTA:

    But ultimately, Happes and Oettingen believe that positive fantasies are
    likely to scupper your [chances] of obtaining your goals. "Instead of promoting
    achievement, positive fantasies will sap job-seekers of the energy to pound
    the pavement, and drain the lovelorn of the energy to approach the one they
    like," they write. "Fantasies that are less positive - that question whether
    an ideal future can be achieved, and that depict obstacles, problems and
    setbacks - should be more beneficial for mustering the energy needed to obtain
    success."
asymptotic··on Ask HN: Who is riding his weekend project straight to profitability?
I'm part of a project that's an art piece management solution for galleries to use for exhibitions. Right now galleries use paper reports to track art pieces between exhibitions, and we want them to use tablets. We currently have a gallery interested in the project.

I'm the sole technical force behind the project. Front-end is on Android Honeycomb tablets, back-end uses Erlang for the web server and middle-ware and PostgreSQL for the database. I also work full-time so progress is a bit slow.

asymptotic··on Ask HN: Who is riding his weekend project straight to profitability?
dictionary.com

"their    [thair; unstressed ther] 2. (used after an indefinite singular antecedent in place of the definite masculine form his or the definite feminine form her ): Someone left their book on the table. Did everyone bring their lunch?"

Wikipedia:

https://secure.wikimedia.org/wikipedia/en/wiki/Singular_they

"Singular they is the use of the pronoun they (or its inflected forms) when plurality is not required by the context. Singular they indicates indeterminacy:

    either in regard to number — "Anyone who thinks they have been affected should contact their doctor";
    or, controversially, regarding gender — "One student failed their exam."
I accept the usage of their as singular is a bit odd. But I'm unwilling to accept that anyone considers the usage of "his" to be gender-neutral. Maybe "her", but most certainly not "his".
asymptotic··on Erlang is not a Concurrent Functional Programming Language
"con·cur·rent    [kuhn-kur-uhnt, -kuhr-] –adjective 1. occurring or existing simultaneously or side by side: concurrent attacks by land, sea, and air. "

In conjunction with:

Inside the Erlang VM with focus on SMP http://www.erlang.org/euc/08/euc_smp.pdf

"Measurements from a real telecom product showed a 1.7 speed improvement between a single and a dual core system.

It should be noted that it took only about a week to port the telecom system to a new OTP release with SMP support, to a new Linux distribution and to a new incompatible CPU architecture, the Erlang code was not even recompiled.

It took a little longer to get the telecom system in product status, a few minor changeswas needed in the Erlang code because Erlang processes now can run truly parallel which changes the timing and ordering of events which the old application code did not count for."

Besides the awful grammar, QED. I rest my case: Erlang, and not just Erlang OTP, is concurrent (think of it this way: spawn_link() isn't restricted to OTP). I think it's quite clear Erlang is also a functional language. Please refute with references.

asymptotic··on Ask HN: Who is riding his weekend project straight to profitability?
Ask HN: Who is riding _their_ weekend project straight to profitability?

FTFY.

asymptotic··on Scale Fail (part 1)
This is a phenomenal article. After wading through bullshit "X HTTP server beats Y HTTP server at serving 40 bytes of static content!!!" articles this is a breath of fresh air. This is clearly written by someone working in the real world.
asymptotic··on [dead]
Blocking Javascript by default? I am, and similarly didn't see any content. Temporarily allowed JS and it works.

Why do sites require Javascript to show any content at all? What's the web coming to?

asymptotic··on Android Tablets: Hardware and OS are Getting Better, but Apps are Still MIA
A few days ago I tried to run Android Honeycomb in an emulator on my quad-core 12GB RAM box, and it's completely, 100% unusable, even after increasing the device RAM to 1GB. Google admits their emulator is completely unusable:

http://www.androidpolice.com/2011/01/27/android-team-acknowl...

Android tablets are only going on sale on Amazon.co.uk start of June. Want to know why I'm unable to make tablet apps? This.

Ask yourself a question - how did a unusable emulator manage to make it past the Android team's QA process? If that's how incompetent they are...well, I'm shaking my head.

asymptotic··on Post.fm - Email Reinvented
If I didn't have an email address, and Post.fm claims to re-invent email, and yet Post.fm requires an email address, does my head explode when I try to connect the dots?

At some point obscurity stops being cool. I think I reached this point just before I left high school.

asymptotic··on An open platform to connect people and things (ThingSpeak)
I spent five minutes on the site and couldn't find a single link that lead to a section saying "ThingSpeak is...". So what is this? An API framework for user-facing devices? The "Documentation" page comes close...I now know it talks over HTTP, but...what? I don't even know.

It still surprises me that so many sites fail to clearly articulate a) what they do, and b) why I should be interesting in what they do. IMO it smacks of egocentrism and arrogance.

asymptotic··on Ask HN: Apart from Hacker News, what else you read?
I physically subscribe to Harper's Magazine (http://harpers.org) and the New York Review of Books (http://nybooks.com).

I use Google Reader, through which I have 222 subscriptions and have read 11,321 items in 30 days; I mostly skim through most summaries and articles and read maybe 1 in 20-50. I bookmark particularly interesting articles in my Delicious account and then try to re-read them within a week to see if I a) still find them interesting, and b) whether new perspectives and thoughts crop up about the themes of the article.

If you're curious you can get the OPML export of my Google Reader subscriptions here: https://gist.github.com/970230

My daily reading routine is:

- Guardian's international articles (guardian.co.uk/world)

- International Herald Tribune (iht.com)

- Techmeme (techmeme.com)

- Skim the first page of HN

- Skim the newest articles on Metafilter and AskMefi.

- Flick through all my Google Reader items throughout the day.

You don't explcitly mention this but I also voraciously read books, at a rate of about two every month. Right now I'm going through a serious counterinsurgency phase.

asymptotic··on Show HN: Gitalytics.com - Quicker Way to check someone's github profile
Your site is currently unresponsive: http://www.downforeveryoneorjustme.com/www.gitalytics.com

I look forward to seeing it when it's up!

asymptotic··on London Hacker News Meetup - Thursday, 12th May
I'll come along, thanks for organising this dmitri1981!
asymptotic··on Cracking the credit card code
...there's nothing to crack here, so I find the title misleading. I would find articles such as "Cracking the ISBN code" or "Cracking the CRC32 code" equally misleading.

To me, cracking implies breaking through a barrier intended to be opaque. Hence, Ross Anderson's paper on an attack on the hardware security modules in ATM machines to brute force a PIN for a given account in less than the full PIN space is, truly, an example of cracking:

http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-560.pdf

asymptotic··on De-anonymizing Apple UDIDs with OpenFeint
FTA, keep in mind that issue is not whether there are unique identifiers of any sort on phones. Any of the IMEI, SIM, or UUID (or equivalent) on a phone can uniquely identify you. This is a fact of life.

However, the real issue is whether your phone can share such information _without your explicit permission_. This is _not possible on the Android_.

http://stackoverflow.com/questions/2322234/how-to-find-seria...

You need to have android.permission.READ_PHONE_STATE permissions in order to get the unique identifier, hence users, before installing an application, will be able to determine whether their particular application is capable of doing so.

asymptotic··on Tell HN: I'm writing an Erlang recipes book, are you interested?
Yes, I'm interested! I'm particularly interested in recipe books that are both task-oriented and language-oriented. For exaple, Doug Hellman's PyMOTW is a phenomenal guide to using libaries that are part of the Python standard distribution and would be a key part of the library.

However, some aspects of the recipe book should be task oriented:

- Web server hosting static files using the standard inets server, and 3rd party libraries like webmachine, nitrogen, and yaws. - How to log - How to enable tracing

etc.

asymptotic··on Ask HN: Can anyone recommend some philosophy reading?
You should ask this question on Metafilter as well. However, some people already have:

http://ask.metafilter.com/71101/What-single-book-is-the-best...

http://ask.metafilter.com/52701/Philosophy-readings

http://ask.metafilter.com/26408/crash-course-in-modern-philo...

Overwhelmingly, with my approval, many suggest reading "The Problems of Philosophy" by Bertrand Russell. It's one of the most accessible and thought provoking books on philosophy I've read. This has already been suggested by someone in this thread with a link to the book (http://www.ditext.com/russell/russell.html).

asymptotic··on CodeTyper - now you can type and sound like a hacker in the movies
Shame about the multiple posts, but this is truly hilarious. For bonus points the author should allow people to specific an arbitrary url from Google Code Search, Github, Bitbucket, Linux kernal source, etc. and then wrap it in a simple HTTP GET type API.

Everyone loves a cheeky API.

asymptotic··on What are all of Amazon's web services and what do they do?
I was about to agree with everyone about this being a lazy question, but now I feel like an idiot because I never knew Amazon offered "AWS Identity and Access Management (IAM)" (http://aws.amazon.com/iam/), which is a godsend.

What's a shame is that right now there isn't a web-based GUI for this service yet, and the boto Python module's IAM support is currently undocumented, but at least the code is there. A bit of code reading to get it up and running.

asymptotic··on Hackers and Fighters
FTA: "So to answer the post: yes, the street programmer is generally better than the CS graduate - at programming because CS courses are often so woeful. And the professor will beat the street programmer hands-down in the black arts of churning out papers. But in the CS departments which are not empty dojos, the graduates who have absorbed the wisdom of their intellectual fathers, and learnt to apply it under pressure will surpass the street programmer. "
asymptotic··on Why Retired Aircraft are Stored in the Desert
I'm surprised noone's pointed out the obvious - the US have obligations under stategic nuclear arms reduction treaties such as START I that compel the US to chop up B-52s, put the parts in the desert, and leave them there long enough to allow the Russians time to use satellite imagery to confirm they've been chopped up.

https://secure.wikimedia.org/wikipedia/en/wiki/START_I

"365 B-52Gs were flown to the Aerospace Maintenance and Regeneration Center at Davis-Monthan Air Force Base in Arizona. The bombers were stripped of all usable parts, then chopped into five pieces by a 13,000-pound steel blade dropped from a crane. The guillotine sliced four times on each plane, severing the wings and leaving the fuselage in three pieces. The ruined B-52s remained in place for three months so that Russian satellites could confirm that the bombers had been destroyed, after which they were sold for scrap."

asymptotic··on Libstdc++ has a "diagnostics" mode that suggests alternate containers
The actual introduction page is far more enlightening:

http://gcc.gnu.org/onlinedocs/libstdc++/manual/profile_mode....

The work is published under an application called "Perflint". Here's a link to the PDF for the paper:

http://0-portal.acm.org.millennium.lib.cyut.edu.tw/ft_gatewa...

"Abstract—We present perflint, a new industrial strength open source analysis tool that identifies suboptimal use patterns of the C++ standard library. Simply by recompiling and running on a representative input set, programmers receive context sensitive performance advice on their use of standard library data structures and algorithms. Our solution consists of collecting traces of relevant library operations and state during program execution, and then recognizing patterns for which there is a faster alternative, based on a model made of performance guarantees in the C++ language standard and machine knowledge. perflint has already found hundreds of suboptimal patterns in a set of large C++ benchmarks. In one case, following the advice and changing one line of code resulted in 17% program run time reduction."

asymptotic··on Amazon Web Services are down
This seems to be a prevalent misunderstanding. Amazon's EC2 SLA of 99.95% applies at the scope of a region. A region may contain more than one availability zone. Hence, deploying on multiple availability zones still only affords the 99.95% availability level.

Yes, multi-region availability on AWS is hideously expensive. However, some organisations value an availability of greater than 99.95% enough to warrant such a multi-region deployment. Clearly reddit, and many, many other AWS users, do not. This isn't a value call on my part; I definitely couldn't afford the inter-region data transfer costs, all I know is that AWS offers you the tools to deploy high availability web services.

← PreviousPage 2 of 4Next →