30 karma · joined Dec 1, 2009 (16y ago) · 10 submissions
comment 6y ago · link · parent
comment 6y ago · link · parent
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
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 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 16y ago · link · parent
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.