News for hackers. Stuff that matters.

brucer

Re:Apple, ARM, and Intel on Tuesday June 16, 2020 @11:45AM (#23540520)
Music, movies, software, high speed pizza delivery
Re:Chloroquine, past and present on Friday March 20, 2020 @01:29PM (#22639469)
I was intrigued by the results from the recent quick french study: https://www.mediterranee-infection.com/wp-content/uploads/20...

I read through the paper, and it's not immediately obvious, but if you look at the two graphs at the bottom, the hydroxychloroquine is 75% effective in the first chart, but only 50% in the second one. That's because the actual test was:

Control: 16

hydroxychloroquine: 14

hydroxychloroquine + azithromycin: 6

The first chart includes all 20 people who got hydroxychloroquine - including the 6 who also got azithromycin.

My question: do we know how effective azithromycin would be on it's own? Maybe it's the wonder drug we should be focused on, which would be great since it's available everywhere.

It should go without saying these are VERY preliminary results from a small trial but it's something!

Re:Migrating from Heroku to AWS using Docker on Saturday April 04, 2015 @12:43AM (#9319934)
I'm also curious if any large projects use it. We tried it out for a couple weeks - it worked fine but we felt overly constrained by the configuration rules and ended up rolling our own solution.
I just realized I overthought the caching scheme, and removing one check made it 3x faster :)

  function getLongestPathCached(nodes, nodeid, visited, depth) {
    var idx;
    visited |= 1 << nodeid;
    idx = (visited * 32) + nodeid;
    if (visitCache[idx]) {
      return visitCache[idx];
    }
    var neighbours = nodes[nodeid];
    var max = 0
    for(var i=0;i<neighbours.length;i++) {
      if (!(visited & (1 << neighbours[i].dst))) {
        var dist = neighbours[i].cost + getLongestPathCached(nodes, neighbours[i].dst, visited, depth+1);
        if (dist > max) {
          max = dist
        }
      }
    }
    visitCache[idx] = max;
    return max;
  }
I'm really impressed you implemented this in so many languages!

I was curious how fast Javascript would run this, so I ported the lua example over, it ran in 2200msec on my mac laptop. I'm not sure it's a great comparison benchmark however, because there are some obvious optimizations you can make. I added a simple cache to avoid recalculating travel costs for leaves and it now runs in 150msec.

var fs = require('fs');

  var nodes = [], visited = [];
  var visitCache = {};

  function readPlaces() {
    var lines = fs.readFileSync('agraph','utf8').split('\n');
    var numnodes = lines[0]|0;
    for(var i=0;i<numnodes;i++) {
      nodes[i] = [];
      visited[i] = false;
    }
    for(i=1;i<lines.length;i++) {
      var line = lines[i].split(' ');
      nodes[line[0]|0].push({dst: line[1]|0, cost: line[2]|0});
    }
  }

  function getLongestPath(nodes, nodeid, visited) {
    visited[nodeid] = true;
    var neighbours = nodes[nodeid];
    var max = 0
    for(var i=0;i<neighbours.length;i++) {
      if (!visited[neighbours[i].dst]) {
        var dist = neighbours[i].cost + getLongestPath(nodes, neighbours[i].dst, visited);
        if (dist > max) {
          max = dist
        }
      }
    }
    visited[nodeid] = false;
    return max;
  }

  function getLongestPathCached(nodes, nodeid, visited, depth) {
    var idx;
    visited |= 1 << nodeid;
    if (depth == nodes.length - 7) {
      idx = (visited * 32) + nodeid;
      if (visitCache[idx]) {
        return visitCache[idx];
      }
    }
    var neighbours = nodes[nodeid];
    var max = 0
    for(var i=0;i<neighbours.length;i++) {
      if (!(visited & (1 << neighbours[i].dst))) {
        var dist = neighbours[i].cost + getLongestPathCached(nodes, neighbours[i].dst, visited, depth+1);
        if (dist > max) {
          max = dist
        }
      }
    }
    if (idx) {
      visitCache[idx] = max;
    }
    if (typeof visited != 'number') {
      visited[nodeid] = false;
    }
    return max;
  }

  readPlaces();
  var start = Date.now();
  var length;
  if (nodes.length < 32) {
    length = getLongestPathCached(nodes, 0, 0, 0);
  } else {
    length = getLongestPath(nodes, 0, visited);
  }
  console.log(length+' LANGUAGE Javascript: '+(Date.now() - start));

Show HN: Twinwords - fast two word domain name generator

http://twinwords.com

For a hobby project, I made a web domain name generator. It's always bugged me they aren't smarter.It algorithmically figures out similar words by calculating pair similarities for all the two word domain names in the .com zone file (about 60 million.) Because of the way it works, the 'synonyms' it generates are more like how people use the words in domain names instead of a thesaurus, and it...

( Read More... | no comments | on HN )
7th largest publicly disclosed shareholder. There are thousands of private shareholders that own more.
Re:Dr Dobbs - The Rise And Fall of Languages in 2010 on Sunday February 06, 2011 @07:20PM (#2186919)
I'm extremely dubious of a metric that claims JavaScript and Delphi have the same market penetration.
Re:LED Bulbs Save Substantial Energy on Tuesday December 01, 2009 @05:35PM (#970967)
here's some that go up to 1500 lumens: http://www.ledliquidatorsinc.com/PAR_38_12_LED_Cree_light_bu...

one thing to note is with LED's the higher power ones are less efficient, so the 800 lumen lights on that page use 1/3 the power.