Better HN
topnewbestaskshowjobs
Log inSign up

brucer

30 karma · joined Dec 1, 2009 (16y ago) · 10 submissions

Submissions

comment 6y ago · link · parent

Music, movies, software, high speed pizza delivery

comment 6y ago · link · parent

I believe nurseries are open again: https://summerwindsnursery.com/ca/promotions/curbside-pickup...

comment 6y ago · link · parent

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!

comment 11y ago · link · parent

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.

comment 11y ago · link · parent

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;
  }

comment 11y ago · link · parent

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));

7.

Show HN: Twinwords - fast two word domain name generator(twinwords.com ↗)

1 points · by brucer · 13y ago · discuss

comment 15y ago · link · parent

7th largest publicly disclosed shareholder. There are thousands of private shareholders that own more.

comment 15y ago · link · parent

I'm extremely dubious of a metric that claims JavaScript and Delphi have the same market penetration.

comment 16y ago · link · parent

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.