HN user

globalrev

349 karma
Posts32
Comments126
View on HN
news.ycombinator.com 17y ago

Ask HN: So do these companies make actual money or they just have revenue?

globalrev
8pts3
news.ycombinator.com 17y ago

How do I combine Machine learning with nano-technology and fabbers?

globalrev
5pts2
news.ycombinator.com 17y ago

Python does support if-else in lambdas...

globalrev
7pts9
news.ycombinator.com 17y ago

How can you use an interpreted language and not Emacs?

globalrev
3pts4
news.ycombinator.com 17y ago

Ask HN: Would there be an energy crisis if...

globalrev
4pts5
news.ycombinator.com 17y ago

Ask HN: Systems programming laanguage of the future?

globalrev
1pts7
en.wikipedia.org 17y ago

Antimachines - any in use?

globalrev
1pts1
news.ycombinator.com 17y ago

Ask HN: What does Ruby have that Python doesn't?

globalrev
66pts221
news.ycombinator.com 17y ago

Why is Fibonacci misimplemented so often?

globalrev
3pts4
news.ycombinator.com 17y ago

Why no downmod for links?

globalrev
10pts16
news.ycombinator.com 17y ago

Ask HN: Which programming languages for mobile apps?

globalrev
5pts6
news.ycombinator.com 17y ago

What is the future of the OS?

globalrev
2pts0
news.ycombinator.com 17y ago

Does Google just sort results by relevance or can Knol be irrelevant but still nr1?

globalrev
1pts1
news.ycombinator.com 18y ago

Ask HN: Good books on computational complexity?

globalrev
16pts9
news.ycombinator.com 18y ago

Ask HN: What's up with this type of superannoying ads?

globalrev
3pts4
yudkowsky.net 18y ago

Awesome explanation of Bayesian probability

globalrev
40pts11
news.ycombinator.com 18y ago

Why were Lisp machines so expensive?

globalrev
12pts10
news.ycombinator.com 18y ago

How can people not use Firefox 3?

globalrev
4pts11
news.ycombinator.com 18y ago

Programming parallell systems vs parallell computers

globalrev
4pts4
news.ycombinator.com 18y ago

Discussion: Reddit worth 12.8 million dollars?

globalrev
5pts5
news.ycombinator.com 18y ago

Success of Y Combinator startups?

globalrev
10pts14
news.ycombinator.com 18y ago

I have finally seen the Emacs light

globalrev
38pts78
www.cfep.uci.edu 18y ago

Is this for 12-year-olds? I must be lagging behind...

globalrev
1pts3
news.ycombinator.com 18y ago

Ask HN: Platform that requires Java == only requires JVM?

globalrev
1pts2
news.ycombinator.com 18y ago

What math courses for programmers?

globalrev
5pts7
news.ycombinator.com 18y ago

Ask HN: solar energy, how can i buy? can i buy online?

globalrev
1pts1
news.ycombinator.com 18y ago

Is this really a PG-quote?

globalrev
1pts1
news.ycombinator.com 18y ago

Ask HN: Program to build webpages?

globalrev
1pts5
news.ycombinator.com 18y ago

Ask HN: definition of a highlevel language?

globalrev
5pts12
news.ycombinator.com 18y ago

I don't get Facebook, explain please!

globalrev
1pts4

What about wireless? I have a functioning wireless connection with my Vista desktop. However it seems really hard to get going with Ubuntu. I can't figure out exactly what to do with Ndiswrapper and if I need a new driver. Can't I just use what I have on Linux if I allow proprietary stuff?

Wireless still seems to be the most annoying thing about Linux.

OK one use of this is to check for your copyrighted photos obv.

But will people pay for such a service?

There are just so many companies starting with seemingly no way to make money.

This has been up so many times. It's not happening, live with it. Python "lambdas" can do most things you need anyway.Normally I don't really find the need for supercomplicated lambdas and you can do if-else in lambda s in Python with the ternary operator, see below:

####### def throwaway_function(emp): if emp.salary > developer.salary: return fireEmployee(emp) else: return extendContract(emp)

employees.select(throwaway_function) ######

Python lambda: filter(lambda emp: fireEmployee(emp) if emp.salary > developer.salary else extendContract(emp), employees)

Don't know what select does but it sounds like filter. So if that works as intended(is the ruby version both returning value and side-effecting?) or not I'm not sure but you probably could make it.

how is Mathematica compared to Matlab? As I understand Mathematica is for all kinds of math while Matlab is basically only matrix and linear algebra-stuff(with a lot of libraries for applications of that).

Is Mathematica as good as Matlab for linear algebra?

All I know is is that Git i supereasy to use for a beginner for 1-man-projects if you get the right help or tutorial. Preferrably start a repo at github and you will be waled through how to create a repo(not that there is much to it).

git init git add . git commit -m "blah" git push origin master

git branch name git checkout

easy-peasy

I just did this because I got inspired. What does it count as, genetic programming? It uses naive mutation and crossover(don't know if they qualfiy as real crossover and mutation) and a simple fitness function. It is fairly pointless since all it does is find a list with ones but it does so in just around 400 generations while random guessing takes forever.

  from __future__ import division
  import matplotlib.mlab as M
  import matplotlib.pyplot as plt
  import random as R
  
  def crossover(a, b):
      new = []
      for x,y in zip(a,b):
          if R.random() > 0.5:
              new.append(x)
          else:
              new.append(y)
      return new

  def mutate(xs):
      xs[int(R.uniform(0, len(xs)))] = int(R.uniform(1, 10))
      return xs

  def fitness(xs, goal):
      summa = 0
      for x,y in zip(xs, goal):
          summa += abs(x-y)
      return summa, xs, True if summa == 0 else False

  def nFittest(xs, goal, n=2):
      fittest = sorted(fitness(x, goal) for x in xs)[:n]
      if fittest[0][2] :
          return fittest[0]
      elif fittest[1][2]:
          return fittest[1]
      else:
          return fittest

  def init(fields, n):
      return [[int(R.uniform(1,10)) for x in     xrange(fields)] for y in xrange(n)]

  def newGen(a,b,n):
      next = [crossover(a,b) for x in xrange(n)]
      mutated = []
      for x in next:
          if R.random() > 0.9: mutated.append(mutate(x))
          else: mutated.append(x)
      return mutated

  def run(printing=True):
      n = 0
      first = init(15, 10)
      while n < 1000000:
          n += 1
          next = nFittest(first,   [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], 2)
          if type(next) == tuple: break
          first = newGen(next[0][1],next[1][1], 10)
      if printing:
          print "Nbr of generations: ", n
          print next
      return n, next

  def plot():
      trials = [run(False)[0] for x in range(100)]
      print "Done trials"
       averages = [sum(trials[:x]) / len(trials[:x])\
                  for x in xrange(1,len(trials)+1)]
      print "Done averages"
      plt.plot([x for x in xrange(len(averages))],   averages, 'ro')
      plt.axis([1, 100, 0, 1000])
      plt.show()

  def test():
      goal = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
      c=0
      while 1:
          c += 1
          x = [int(R.uniform(1,10)) for y in range(15)]
          if sum(x) == 15: break
          if c % 10000 == 0: print c
      print x
Any College Will Do 18 years ago

"I don't think so, not beyond your very first couple of jobs." And how long is that, 5-10years?

And for the really attractive jobs, do you even get a shot if straight out of college if you are not from a top one(often you don't either how because of no experience but when you do)?

Don't want to bash the point though. Effort > talent, I agree.

Any College Will Do 18 years ago

Sure but what I mean is for engineering the difference between a good and bad college might be bigger than say for economy?

Any College Will Do 18 years ago

Not an expert on the area at all but it seems perhaps the college you go to is more important for technical professions than business ones?

Does anyone else think so? I'm using Clojure a lot and really like it.

But Lisp has been around for 50 years and never hit the mainstream so it seems there perhaps is something about it that doesn't fit with most programmers?

Also it only offers one form of concurrnecy and while I like it there is still much speculation and research in the area. Scala for example kind of builds on the whole Java-language and offers a more recognizable language for Java-developers and more opportunities to roll your own concurrency-mechanisms, or at least that's the impression I've gotten.

And then we have Haskell and Erlang.

Could anyone point me on how to solve this(either a solution or preferrably a pointer on how to get to it): "Q: Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7."

First I thought it was simple but the I got stuck, maybe I'm just tired. No matter how I twsit and turn it I seem to get only an even distribution over 5 numbers.

The formatting got messed up but yes I agree. They were just examples, not the best ones perhaps.

I have felt a need for it sometimes though. Very complicated lambdas are perhaps generally better off as normal functions.

But I hate creating one-time-use functions if it isn't necessary.