HNHacker News
TopNewBestAskShowJobs

hughlomas

117 karma · joined October 13, 2012

submissionscomments
hughlomas··on A Wretched Google Interview Experience
It seemed obvious to me that you would trim it if it became larger because the most it asks for is the count of a single day.

However, now that I think about it increment() could called multiple times during a single nanosecond, in which case I guess it would be multiplied by whatever the maximum number of executions per nanosecond would be. My once per nanosecond comment earlier was an erroneous assumption.

hughlomas··on A Wretched Google Interview Experience
Well to be pedantic it will grow, at worst, to (24 * 60 * 60 * 1000000000), if you are calling increment() every individual nanosecond. Though you are right that it is ignoring realistic memory issues. I was approaching it more as a thought exercise to address the moving window.
hughlomas··on A Wretched Google Interview Experience
A few hours ago when reading the article I was also intrigued by the question and journeyed down a similar path regarding the moving window and the trade-offs. After toying with a couple of improper solutions I came to a very similar conclusion. The basic idea being that each time increment() is called, you store the difference since the last increment, and to count you simply add up the offsets until you reach your desired time limit. Anyway I emailed myself the basic idea to post here later. There are probably some obvious optimizations but it satisfied me as a solution. Pseudocodish javascript example below:

  var second = 100000000
    , minute = second * 60
    , hour = minute * 60
    , day = hour * 24
    , current = 0
    , lastIncrement = 0
    , increments = [];

  function increment(){
      current = timer.time();
      increments.push( current - lastIncrement );
      lastIncrement = current;
  }

  function getCountInLastSecond(){
      var copy = increments.slice()
        , total = 0
        , count = 0;

      while( ( total <= second ) && ( amount = copy.pop() ) ){
          total += amount;
          count++;
      }
      return count;
  }
hughlomas··on Building a Chording Keyboard: Progress So Far
I have wanted to make an infrared-based chording keyboard. Using an infrared camera, monitor the velocity of the five brightest points and consider a fingertip contracting to be keypress. Throw a small infrared LED into the front of a smartphone and a forward facing infrared camera and voila, smartphone chording keyboard, without taking up any screenspace.
hughlomas··on Government likely to open criminal probe into NSA leaks
The United States, despite what it may now be, has a historical foundation as the "beacon of democracy". The seeds of philosophies from antiquity and the enlightenment took root in the founding of the country, and the United States pioneered modern western democracy.
hughlomas··on Relationships between Depression and High Intellectual Potential (2012)
No, this paper is a mimicry of an actual paper, it is analogous to fool's gold.
hughlomas··on HTML5 Features you need to know
While it is nice to have, datalists are currently lacking in common functionality and are no real substitute for fully featured autocompletes. For example, datalist only matches the beginning of the values. Typing "soft" into a datalist will not match "Microsoft".

There are some other limitations discussed here: http://msdn.microsoft.com/en-us/magazine/dn133614.aspx

hughlomas··on Belief in black magic persists in Papua New Guinea
It's not about "evangelizing atheism", it's about evangelizing knowledge. If someone in their community died, perform an autopsy to determine the actual cause of death and banish the specters of ignorance surrounding it. Create schools, encourage education. Praying is an empty gesture.
hughlomas··on “The Tesla Model S is our top-scoring car”
What a childish analogy, knives are not moving at high speed on every street.
hughlomas··on List of Online Services EA Has Shut Down
While I have many complaints about Diablo III, I was never afraid of Blizzard shutting down the servers, and that definitely factored into my purchasing decision. As you note, they have been running the Diablo II and Starcraft servers for well over a decade.
hughlomas··on It’s the Sugar, Folks
Note that the article is considering fruits and vegetables, while I would argue that they should be considering staples such as potatoes, beans, and rice. Staples which are cheap, feed a significant portion of the world, and are easy to prepare by cooking in water.
hughlomas··on It’s the Sugar, Folks
Buying a large bag of rice and large bag of beans once every two weeks isn't a big problem. Those dry foods have a huge shelf life and are cheap. I didn't say they need to eat fresh baby spinach and kale every day.
hughlomas··on It’s the Sugar, Folks
It is a myth that fast food is cheap. Fast food is more expensive than other foods on a by-weight basis.

http://www.nydailynews.com/life-style/health/junk-food-expen...

http://graphics8.nytimes.com/images/2011/09/24/opinion/sunda...

People can eat more and healthier by purchasing and preparing their own food.

hughlomas··on Apple’s Deleting iCloud Emails That Contain The Phrase 'Barely Legal Teens'
It doesn't have that connotation, "barely legal" implies "fully legal".
hughlomas··on Google Glass - If I Had Glass
That cuts out a sizable demographic from "exploring" it.
hughlomas··on Bill Gates: My Plan to Fix The World's Biggest Problems
What about extending the prime years of scientists, engineers, etc? More years of experience and wisdom to capitalize on and to reinvest their skills and knowledge into human progress. I for one would prefer that many of the brightest candles in humanity's past were still lit.
hughlomas··on GitHub Says ‘No Thanks’ to Bots — Even if They’re Nice
As some have pointed out many of the requests they provide are quite helpful and it could be useful to have an interface to browse a selection of optimizations that have been offered up by bots.

What about splitting them off into a separate interaction lane to eliminate the noise they create elsewhere? A "Bot pull requests" tab. Make it passive, so it does not trigger notifications, emails or other active communication, but is available and streamlined.

hughlomas··on Did learning to fly give bats super-immunity?
Consider it from the disease's perspective.

Ebola doesn't 'target' humans. Ebola's obvious symptoms and mortality rate in humans limit its ability to spread efficiently. The flu virus or cold virus has been far more successful in penetrating the human ecosystem. Perhaps Ebola has been selected for being stable in the bat ecosystem. The mobility of bats also makes them an excellent transmission vector, which a virus would ideally want to be non-symptomatic.

hughlomas··on NY newspaper runs interactive map with names, addresses of gun permit holders
Yes, especially if you simply observe a house known to have guns and take them when the owners are not home.
hughlomas··on NY newspaper runs interactive map with names, addresses of gun permit holders
Two variables of risk that factor into a criminal's decision:

1) Is the house occupied? 2) Are the occupants armed?

Providing an answer to the second question only helps the criminal by letting them know that they can perform an armed robbery with no resistance.

hughlomas··on Drone Olympics in SF
What is the goal or challenge? I can find no reference to the criteria that contestants will be judged on.
hughlomas··on Low-cost Solution to Clearing Afghan Landmines
What happened to the company?
hughlomas··on Thoughtcrime in Britain
Why hasn't Britain adopted some sort of free speech law in the spirit of the US's first amendment? They've had over two hundred years to do so. Can anyone provide insight into why?
hughlomas··on Mapping Racist Tweets in Response to President Obama's Re-election
Yeah, I inform my world view with Cosmopolitan and the The National Enquirer as well.
hughlomas··on Parrot in captivity manufactures tools, something not seen in the wild
My favorite example of tool use in birds is this video http://www.youtube.com/watch?v=OYZnsO2ZgWo of a crow that actually bends a piece of wire to form a hook. There are some details about it here: http://news.nationalgeographic.com/news/2002/08/0808_020808_...
hughlomas··on Goldeneye 64's inspirational startup story
Someone throwing some quotes into a reddit-esque nostalgia post and topping it off with his name in size 40 font hardly qualifies as an article. When I first saw the title I was hoping for something along the lines of the recent Starcraft article (http://www.codeofhonor.com/blog/tough-times-on-the-road-to-s...).
hughlomas··on Conway's Game of Life, using floating point values instead of integers
Good job. Any idea why using the parameters specified in the video description of https://www.youtube.com/watch?v=KJe9H6qS82I do not seem to replicate the output of the video? http://jsfiddle.net/CSyUb/45/

I tried the same parameters in the version downloadable at http://sourceforge.net/projects/smoothlife/ and it did not seem to produce similar output to the video either.

← PreviousPage 2 of 2