Better HN
topnewbestaskshowjobs
Log inSign up

eipi

44 karma · joined Jan 12, 2012 (14y ago) · 10 submissions

Submissions

comment 13y ago · link · parent

Until the day a man feels equally comfortable telling a sex-related joke to a woman as to another man, all such jokes are, by definition, sexist. We as a society are not open towards sex and the real sexist men feel that it is to their advantage that women should feel more embarrassed about sex jokes, even a woman have no reason whatsoever to feel that way.

comment 13y ago · link · parent

Wow!

3.

Ask HN: How do you manage your one-man project?

41 points · by eipi · 13y ago · 57 comments

comment 13y ago · link · parent

There are two kind of "technical" people. The "Science" kind, and the "engineering" kind. If you appreciate the "beauty" of an mathematical equation, or the "elegance" of a proof, you are the "Science" kind. If you appreciate the preciseness of a tool, or speed to achieve a task, you are the "Engineering" kind. Science provide the backbone behind engineering, but engineering re-invigorates science. Unfortunately, programming can fall into either categories. Argument like this is mostly pointless without a specific context. As a programmer, it is a life long effort to find the "zen" of the two.

comment 14y ago · link · parent

Because city and local officials make huge profits with these development. Remember, land is owned by the government. And no one is accountable for failed investment. Cheapest materials are used, getting done fast is important because the developer wants to get out of it as quickly as possible. It fits the prevalent theme in China right now: get rich quick and leave the country fast.

comment 14y ago · link · parent

For one, it will be useful to catch cheating program homework that simply renames variable names and re-arranges function definitions.

7.

Diffing code by program structure (not by text)(yinwang0.wordpress.com ↗)

3 points · by eipi · 14y ago · 1 comment

comment 14y ago · link · parent

Memoized version:

  class Factorial(object):
    def __init__(self):
        self.n = 0
        self.fact_n = 1

    def next_fact(self):
        self.fact_n *= (self.n + 1)
        self.n += 1

    def prev_fact(self):
        self.fact_n /= self.n
        self.n -= 1

    def fact(self, n):
        if n == self.n:
            return self.fact_n
        elif n > self.n:
            # start from self.n working forward
            self.next_fact()
            return self.fact(n)
        else:
            # start from fact_n working backwards
            self.prev_fact()
            return self.fact(n)


  fobj = Factorial()
  print fobj.fact(6)
  print fobj.fact(8)
  print fobj.fact(3)

comment 14y ago · link · parent

This is essentially what I have been doing for the last 6 months and it works great for me. But it only works great because 1) I go to bed at 9 pm - I am literally falling asleep with 5 minutes. 2) Coffee is only allowed before 9am.