dlazar | 5 years ago | on: California’s coronavirus strain looks increasingly dangerous
dlazar's comments
dlazar | 5 years ago | on: Malware on My Android Phone
dlazar | 6 years ago | on: Empress trees absorb about 103 tons of carbon a year per acre
dlazar | 6 years ago | on: Empress trees absorb about 103 tons of carbon a year per acre
The tree absorbs CO2 from the atmosphere and combines it with water (H2O) from the soil to produce more complex chemical compounds (such as carbohydrates). This process uses sunlight as the source of energy, and is better known as photosynthesis. The chemical compounds thus produced are used by the tree as structural material (the wood), or as stored energy (basically, reverting the photosynthesis reaction, aka "burning", releases the energy).
If the tree matter gets consumed by animals, those animals are going to use the stored energy, and ultimately re-release the stored carbon as CO2. If the tree just dies and is allowed to decompose, bacteria and other microorganisms will do the same: they'll eat the carbohydrates that the tree produced, and they'll breathe out the resulting CO2. If the tree is burned as fuel, the CO2 gets re-emitted directly.
So, to truly remove that CO2 from the atmosphere, the tree needs to be felled once it's stopped growing, and the resulting wood stored someplace where it can't be decomposed by microorganisms. Burying it is one solution to this (and this is what happened during the carboniferous era, when much of our coal and oil got created: dead trees fell in shallow swamps and were quickly buried under a layer of silt which prevented the decomposition).
Again, I'm no expert, so I'm happy to stand corrected if I've made any mistakes above.
dlazar | 7 years ago | on: Black Hole Propulsion as Technosignature
dlazar | 14 years ago | on: Strcpycat
//return = strlen(target)
unsigned strmcat(char *target, const char *source, unsigned length) {
const char *origin = target;
while(*target && length) target++, length--;
return (target - origin) + strmcpy(target, source, length);
}
//return = strlen(target)
unsigned strmcat(char *target, const char *source, unsigned length) {
const char *origin = target;
while(*target && length) target++; length--;
return (target - origin) + strmcpy(target, source, length);
}
How about this? //return = strlen(target)
unsigned strmcat(char *target, const char *source, unsigned length) {
const char *origin = target;
while(*target && length)
target++, length--;
return (target - origin) + strmcpy(target, source, length);
}
//return = strlen(target)
unsigned strmcat(char *target, const char *source, unsigned length) {
const char *origin = target;
while(*target && length)
target++;
length--;
return (target - origin) + strmcpy(target, source, length);
}
Granted, it's a tiny example, but you're going to be writing fewer bugs in the long run if you avoid being clever. So here are two rules to start with:1. Never put more than one statement on one line.
2. Never use the comma operator outside the "for" syntax.
dlazar | 14 years ago | on: Offer HN: Free Maths Lessons
dlazar | 14 years ago | on: Skeleton: A Beautiful Boilerplate for Responsive, Mobile-Friendly Development
In particular, this reacts quite badly to zooming, either in a desktop browser (chrome/linux): http://imgur.com/r1z9W or in a mobile browser (android): http://imgur.com/7aP39 .
In the desktop case, the font size doesn't change even if I zoom in the entire page. This isn't the default behavior, so the author must have gone to some lengths to break this functionality. I'm sure s/he had reasons for doing that, but I'm not sure what they were.
In the mobile case, zooming is constrained to a very limited range, and even when allowed, the text doesn't reflow, so it's hard to read lines because of all of the horizontal scrolling required. This behavior is quite common for fixed width, "grid" layouts.
In general, I'm all for frameworks that solve common layout problems, but this particular framework seems to have gotten the basics wrong. I would recommend against using it as it stands.
dlazar | 15 years ago | on: Optimize your website for iPhone in 10 minutes.
In conclusion: ALWAYS use "user-scalable=yes". Like this you'll give the user the option of correcting your assumptions if they turn out to be wrong.
Thanks for the article otherwise.
How would that even work? This is an RNA virus: is there a meiosis-like mechanism for two different RNA viruses infecting the same cell to exchange genes?