Comparing mA is stupid without also comparing voltage. The USB can provide 500mA at 5V, which is 2.5W. There are also modes for higher power, but they require negotiation. The Qi charging spec allows delivering up to 5W to low-power devices, 120W to high-power ones.
They're different numbers. Wolphram Alpha says 44oz of Pepsi is 503 Cal, which is 25% RDA. It also says it's 46% of the RDA for carbohydrates. RDA for sugar is 90g for women, 120g for men, and it contains 139g of sugar, so that's 115%-154%, depending on your gender. Putting that number on the cup ('this contains 150% of your recommended daily amount of sugar') would be even better.
Racing is a bit different from riding. Racing any vehicle (or even running) has a fairly good chance of causing injury, because it's forcing you to quickly decide between a speed advantage and safety. One serious injury per 25 hours covers quite a lot of races, but seems very dependent on the kind of racing. Near my father, there's a 24 hour mountain bike race, which people do individually or in small teams (up to 4). With that statistic, I'd expect almost every team to suffer some form of injury during the race. Unless 'getting a bit muddy' counts as a serious injury, that isn't the case. Even the crazy people who do it on a unicycle mostly manage to avoid injury.
A better approach than a ban would be to require the cups for sugary beverages over a certain capacity to prominently display a calorie count. And none of the 'per serving' bullshit that has become increasingly common, with some small print hidden somewhere saying '* Contains 15 servings'.
Wolphram Alpha tells me that a 44oz container of lemonade contains 312 calories (16% RDA). I suspect that if you printed that information, large enough to read, on the cup then a lot fewer people would order them.
I don't think they could fit within their power budget with an off-the-shelf BTLE SoC. They may find a DSP that can do some processing on the incoming signals to determine whether it's worth powering the BTLE part within the power budget, but it's unlikely - they'd want something very specialised. ASICs of the complexity that they need can be quite cheap, but you'd still be pushing it to get it done in $500K. You could probably build a working prototype for that, but getting it into production would need a bit more.
The difference is that the LCD needs to be on all of the time. The Pebble does a little trick where it uses the accelerometer to detect when you've just turned the watch face up and turns the screen on then.
You could end up with the watch using less than something that sends a 3 ms bluetooth blip every second.
Even once a second may be more than you need. If the aim is to have something that communicates with a much more powerful device, then I'd imagine that every 10 seconds you'd turn on the passive receiver and do a tiny bit of signal processing to detect if you have anything that might be a bluetooth signal (the receiver is always online because it's part of your energy harvesting, but the DSP isn't). If you do, then you bring the transmitter up and send a ping. You're only using the 10mW of Bluetooth LE for a tiny period, once every 10s, if you've already detected that there's a high probability that someone is trying to talk to you.
Even then, the power requirements are not obviously below what you can get from energy harvesting. You need to have a timing source that lets you detect when the 10s quiet window ends, and the more accurate you make that the higher its power requirements are. I'd say it was probably possible, but definitely not easy...
Here in Cambridge, computer science has a worse gender balance than mathematics, which is worse than the national average. I think the only department with a worse gender balance than us is the veterinary school (which is something like 90% female - apparently it's easier to find women who want to to take a degree that involves a lot of time with your hand up a cow than to work with computers).
I find it hard to credit logic that says women have more of a natural aptitude for mathematics than for computer science, but something is putting them off applying. I've just become responsible for admissions at an all-women college, which currently has two students in computer science in total for the three-year undergraduate course (both just about to enter the second year, no new admissions entering the first, no second years moving to the third). The college wants to increase its intake in STEM fields, but it can't do much without more applicants - it's not going to do it by letting in women who aren't qualified, because that's self-defeating in the long run (and in the short term affects the college's ranking within the university, which affects applications, and so on).
And, honestly, given some of the male students we've had getting 2.iis, I find it hard to believe that there weren't potential applicants of both genders who would have made better use of a Cambridge education.
It's not a clear-cut distinction. Bill Gates didn't inherit most of his wealth, but he did inherit enough to have the seed capital to be able to set up his own company and the contacts via his parents to get meetings with people at IBM and other potential big customers who normally wouldn't have talked to anyone at a small startup as a potential supplier.
Add to that, it's also possible to consult during your PhD. A PhD student in the UK gets a stipend of £12K. That's non-taxable, which means that any other income that you make during your PhD starts at the bottom. The tax-free allowance is £10K, so the first £10K you earn consulting is also tax free. If you're working in a commercially interesting area, then you can take home £22K/year tax free during your PhD, which is equivalent to a taxable salary of £28K ($47.7K). You're still eligible for student discounts on a lot of things, so your cost of living is a bit lower too and you may be eligible for (university subsidised) student accommodation. And, of course, you don't need to stop consulting when you use up the tax-free allowance, but it's a fairly good benchmark of where you should stop if you want to have enough time to finish the PhD in a reasonable timeframe.
Last time I took a supervised IQ test was about 15 years ago, but I easily did well enough to qualify for Mensa membership, so I have no emotional investment in disparaging the IQ tests (I'd love it if my score really were an objective measure of my intelligence!), but they have a number of flaws. Consider this simple example:
What is the next number in the sequence? 1, 2, 4, 8, 16
Most people here would tell you that it's 32. They're powers of two. However, 31 is an equally valid number (the maximum number of pieces you can divide a circle into using just straight lines). It's not just about pattern recognition, it's about recognising specific patterns. There are lots of other subtle biases involved. The same is true of the visual and spacial puzzles.
They're a good way of exercising your brain, but they're not really very representative of general intelligence. There's also the issue that the tests accuracy drops of quickly as you move away from the median. My test scores ranged by about 20 points over half a dozen tests. If someone tells you that they have an IQ of 143 (for example), then it's bullshit. There's so much margin of error there that it's really hard to distinguish anyone above 130 (I think Mensa requires 131), and even over 120 has a pretty hefty error margin.
The difference with C++ is that the error often doesn't appear where you made the mistake. You'll get an error saying something like type T (and a long string of indirections telling you what T really is in this context) in some standard library header doesn't implement a specific operator. You then need to peal back multiple levels of template instantiations to get to the place where it's actually causing the error. The last line in the first error will tell you the bit of your code that is instantiating the template, but the bug may be that one of the implicit arguments to a template two invocations later picks a value that is incompatible with one of your explicit arguments. This is nontrivial to debug.
I call BS on the grandparent. In FreeBSD, we have a codebase that dates back to 1977 in parts. We compile the whole thing with -Werror. We compile most of it (i.e. anything that isn't architecture specific) with gcc and clang, both with -Werror. Every time that we import a new compiler, we end up finding a load of warnings and fixing them. About the only place in the entire tree that we turn them off is gcc 4.2.1, which has a crazy number of warnings but is slowly being removed from default builds so no one can be bothered to invest the effort required to fix it just before it's killed. Everywhere in the base system, we fix the warnings. We're also slowly working through the clang static analyser results and Coverity scan reports. If we can do it as a volunteer-run project with a huge codebase that's getting on for 40 years old, no one else has any excuse.
For example, "incompatible declaration of function printf" when I forget to include stdio.h is not a significant warning because I don't care what printf returns and nothing depends on it.
Actually, this means that your code is relying on undefined behaviour and, while it might not bite you in this particular compiler/OS, a number of ABIs have different calling conventions for variadic and non-variadic functions and so you can end up writing code that just doesn't work with the next compiler/OS/architecture. If you're lucky. If you're unlucky, you'll write code where the compiler can detect that it's undefined behaviour and optimise it all away.
Actually, it's not faster for any compiler made in the last 20 years. There are two cases:
You're explicitly assigning a value to the variable in every code path
You're not explicitly assigning a value to the variable in every code path
In the first case, redundant expression elimination will just delete the initial zero store. A local value that is written and never read is easy to track. Once it's in SSA form, it just becomes a value with no uses and gets deleted trivially.
In the second case, the result changes. It's now potentially a lot faster, because the compiler will propagate the undefined value through all arithmetic in the code paths where it is not assigned, eventually get to the end and you'll find that a big chunk of your code has now been optimised into an undefined value (the compiler will just pick any register, or if you're lucky will emit an illegal instruction so that you can catch the trap in the debugger).
Initialising to zero is nice for pointers, because it guarantees that you have a trap value, so if you try to use it then you'll get a hard error, rather than memory corruption. For integers / floats, it's less clear. It would be nice for floats to be initialised to a NaN value, but most processors have no trap representation for ints.
Last time I did this exercise, Clang generated enough warnings that it took me a few days to fix them all. Most of them were undefined behaviour, which were probably safe unless the compiler is clever enough to exploit them (i.e. turn on LTO and your code won't work). A few of them were security vulnerabilities. If you don't fix the relatively benign ones, then it's hard to find the rest...
In Clang, we also try to make sure that warning messages for things that have a reasonable chance of being false positives have a little hint telling you how to suppress the warning. For example, we'll warn on if (a = b), but tell you that if you really meant this you can write if ((a = b)) and the compiler won't warn again. I think gcc has also started doing this recently.
As you say, the point of warnings is to tell you when you've done something that is probably wrong. The point of errors is to tell you when you've done something that is definitely wrong. Sometimes the correct response to a warning is to read the code, realise that it's doing something that should be permitted, and tell the compiler to suppress the warning next time.
Computers are a really bad example of this, because there are lots of objective criteria. Things like toothpaste and shampoo are much better. Most people have no idea, given two toothpastes, if one works better than the other. There's nothing on the packets that allows making an objective judgement. So people end up buying the one with the brand that they recognise. Somewhat depressingly, studies have shown that it doesn't even matter if their association with the brand is entirely negative - if brand A has done annoying things in the past and you've never heard of brand B, most people are more likely to choose brand A.
Advertisers don't like that one though, because it's hard to track. If you run an ad campaign that raises brand awareness, then you might see a spike in sales six months later when people start to actually need a product in the category that you sell and buy yours because now they trust your brand. Or you might see a spike in sales for a completely unrelated reason (e.g. increased seasonal demand caused by unusual weather).
Yes, we've also released the generated Verilog for anyone who wants to use just that. If you're a university, you can easily get a free license for Bluespec. If you're not, then you either most likely don't have the resources to get a decent FPGA (the ones that can run a processor at a useable speed start at about $3K), or you can probably afford the license. We're also talking to Bluespec about open sourcing their compiler, as most of their real value is from other services on top of it, but that's likely to take some time.
We're evaluating CHISEL, which is promising, but currently there's nothing else in the open source world that comes even vaguely close to Bluespec in terms of productivity for hardware designers, and CHISEL was not available when we started.
The old folder system was hierarchical. That made sense
It made sense for the 20% of the population who thinks of structure primarily in terms of hierarchy. This 20% has a very large overlap with programmers (not surprisingly, as most structured programming languages are innately hierarchical), but is still a small subset of the total computer-using population. This is one of the main reasons why programmers tend to be a lot worse at designing UIs for non-programmers to use than they think they are.
Comparing mA is stupid without also comparing voltage. The USB can provide 500mA at 5V, which is 2.5W. There are also modes for higher power, but they require negotiation. The Qi charging spec allows delivering up to 5W to low-power devices, 120W to high-power ones.
They're different numbers. Wolphram Alpha says 44oz of Pepsi is 503 Cal, which is 25% RDA. It also says it's 46% of the RDA for carbohydrates. RDA for sugar is 90g for women, 120g for men, and it contains 139g of sugar, so that's 115%-154%, depending on your gender. Putting that number on the cup ('this contains 150% of your recommended daily amount of sugar') would be even better.
Racing is a bit different from riding. Racing any vehicle (or even running) has a fairly good chance of causing injury, because it's forcing you to quickly decide between a speed advantage and safety. One serious injury per 25 hours covers quite a lot of races, but seems very dependent on the kind of racing. Near my father, there's a 24 hour mountain bike race, which people do individually or in small teams (up to 4). With that statistic, I'd expect almost every team to suffer some form of injury during the race. Unless 'getting a bit muddy' counts as a serious injury, that isn't the case. Even the crazy people who do it on a unicycle mostly manage to avoid injury.
Wolphram Alpha tells me that a 44oz container of lemonade contains 312 calories (16% RDA). I suspect that if you printed that information, large enough to read, on the cup then a lot fewer people would order them.
I don't think they could fit within their power budget with an off-the-shelf BTLE SoC. They may find a DSP that can do some processing on the incoming signals to determine whether it's worth powering the BTLE part within the power budget, but it's unlikely - they'd want something very specialised. ASICs of the complexity that they need can be quite cheap, but you'd still be pushing it to get it done in $500K. You could probably build a working prototype for that, but getting it into production would need a bit more.
You could end up with the watch using less than something that sends a 3 ms bluetooth blip every second.
Even once a second may be more than you need. If the aim is to have something that communicates with a much more powerful device, then I'd imagine that every 10 seconds you'd turn on the passive receiver and do a tiny bit of signal processing to detect if you have anything that might be a bluetooth signal (the receiver is always online because it's part of your energy harvesting, but the DSP isn't). If you do, then you bring the transmitter up and send a ping. You're only using the 10mW of Bluetooth LE for a tiny period, once every 10s, if you've already detected that there's a high probability that someone is trying to talk to you.
Even then, the power requirements are not obviously below what you can get from energy harvesting. You need to have a timing source that lets you detect when the 10s quiet window ends, and the more accurate you make that the higher its power requirements are. I'd say it was probably possible, but definitely not easy...
Here in Cambridge, computer science has a worse gender balance than mathematics, which is worse than the national average. I think the only department with a worse gender balance than us is the veterinary school (which is something like 90% female - apparently it's easier to find women who want to to take a degree that involves a lot of time with your hand up a cow than to work with computers).
I find it hard to credit logic that says women have more of a natural aptitude for mathematics than for computer science, but something is putting them off applying. I've just become responsible for admissions at an all-women college, which currently has two students in computer science in total for the three-year undergraduate course (both just about to enter the second year, no new admissions entering the first, no second years moving to the third). The college wants to increase its intake in STEM fields, but it can't do much without more applicants - it's not going to do it by letting in women who aren't qualified, because that's self-defeating in the long run (and in the short term affects the college's ranking within the university, which affects applications, and so on).
And, honestly, given some of the male students we've had getting 2.iis, I find it hard to believe that there weren't potential applicants of both genders who would have made better use of a Cambridge education.
It's not a clear-cut distinction. Bill Gates didn't inherit most of his wealth, but he did inherit enough to have the seed capital to be able to set up his own company and the contacts via his parents to get meetings with people at IBM and other potential big customers who normally wouldn't have talked to anyone at a small startup as a potential supplier.
Add to that, it's also possible to consult during your PhD. A PhD student in the UK gets a stipend of £12K. That's non-taxable, which means that any other income that you make during your PhD starts at the bottom. The tax-free allowance is £10K, so the first £10K you earn consulting is also tax free. If you're working in a commercially interesting area, then you can take home £22K/year tax free during your PhD, which is equivalent to a taxable salary of £28K ($47.7K). You're still eligible for student discounts on a lot of things, so your cost of living is a bit lower too and you may be eligible for (university subsidised) student accommodation. And, of course, you don't need to stop consulting when you use up the tax-free allowance, but it's a fairly good benchmark of where you should stop if you want to have enough time to finish the PhD in a reasonable timeframe.
Ugh, that's what I get for posting before coffee. Yes, the sequence that I was thinking of is circle division by chords, not circle division by lines.
If we'd gone into a career in science to separate ourselves from 'regular people' then we wouldn't be investing so much time and energy in outreach...
What is the next number in the sequence? 1, 2, 4, 8, 16
Most people here would tell you that it's 32. They're powers of two. However, 31 is an equally valid number (the maximum number of pieces you can divide a circle into using just straight lines). It's not just about pattern recognition, it's about recognising specific patterns. There are lots of other subtle biases involved. The same is true of the visual and spacial puzzles.
They're a good way of exercising your brain, but they're not really very representative of general intelligence. There's also the issue that the tests accuracy drops of quickly as you move away from the median. My test scores ranged by about 20 points over half a dozen tests. If someone tells you that they have an IQ of 143 (for example), then it's bullshit. There's so much margin of error there that it's really hard to distinguish anyone above 130 (I think Mensa requires 131), and even over 120 has a pretty hefty error margin.
The difference with C++ is that the error often doesn't appear where you made the mistake. You'll get an error saying something like type T (and a long string of indirections telling you what T really is in this context) in some standard library header doesn't implement a specific operator. You then need to peal back multiple levels of template instantiations to get to the place where it's actually causing the error. The last line in the first error will tell you the bit of your code that is instantiating the template, but the bug may be that one of the implicit arguments to a template two invocations later picks a value that is incompatible with one of your explicit arguments. This is nontrivial to debug.
I call BS on the grandparent. In FreeBSD, we have a codebase that dates back to 1977 in parts. We compile the whole thing with -Werror. We compile most of it (i.e. anything that isn't architecture specific) with gcc and clang, both with -Werror. Every time that we import a new compiler, we end up finding a load of warnings and fixing them. About the only place in the entire tree that we turn them off is gcc 4.2.1, which has a crazy number of warnings but is slowly being removed from default builds so no one can be bothered to invest the effort required to fix it just before it's killed. Everywhere in the base system, we fix the warnings. We're also slowly working through the clang static analyser results and Coverity scan reports. If we can do it as a volunteer-run project with a huge codebase that's getting on for 40 years old, no one else has any excuse.
For example, "incompatible declaration of function printf" when I forget to include stdio.h is not a significant warning because I don't care what printf returns and nothing depends on it.
Actually, this means that your code is relying on undefined behaviour and, while it might not bite you in this particular compiler/OS, a number of ABIs have different calling conventions for variadic and non-variadic functions and so you can end up writing code that just doesn't work with the next compiler/OS/architecture. If you're lucky. If you're unlucky, you'll write code where the compiler can detect that it's undefined behaviour and optimise it all away.
You can then write:
If you've got code that's only used for debugging, then strip it out with the preprocessor, don't just strip half of it...
You're not explicitly assigning a value to the variable in every code path
In the first case, redundant expression elimination will just delete the initial zero store. A local value that is written and never read is easy to track. Once it's in SSA form, it just becomes a value with no uses and gets deleted trivially.
In the second case, the result changes. It's now potentially a lot faster, because the compiler will propagate the undefined value through all arithmetic in the code paths where it is not assigned, eventually get to the end and you'll find that a big chunk of your code has now been optimised into an undefined value (the compiler will just pick any register, or if you're lucky will emit an illegal instruction so that you can catch the trap in the debugger).
Initialising to zero is nice for pointers, because it guarantees that you have a trap value, so if you try to use it then you'll get a hard error, rather than memory corruption. For integers / floats, it's less clear. It would be nice for floats to be initialised to a NaN value, but most processors have no trap representation for ints.
Last time I did this exercise, Clang generated enough warnings that it took me a few days to fix them all. Most of them were undefined behaviour, which were probably safe unless the compiler is clever enough to exploit them (i.e. turn on LTO and your code won't work). A few of them were security vulnerabilities. If you don't fix the relatively benign ones, then it's hard to find the rest...
In Clang, we also try to make sure that warning messages for things that have a reasonable chance of being false positives have a little hint telling you how to suppress the warning. For example, we'll warn on if (a = b), but tell you that if you really meant this you can write if ((a = b)) and the compiler won't warn again. I think gcc has also started doing this recently.
As you say, the point of warnings is to tell you when you've done something that is probably wrong. The point of errors is to tell you when you've done something that is definitely wrong. Sometimes the correct response to a warning is to read the code, realise that it's doing something that should be permitted, and tell the compiler to suppress the warning next time.
I can't be bothered to look up a citation, but check any HCI textbook.
Computers are a really bad example of this, because there are lots of objective criteria. Things like toothpaste and shampoo are much better. Most people have no idea, given two toothpastes, if one works better than the other. There's nothing on the packets that allows making an objective judgement. So people end up buying the one with the brand that they recognise. Somewhat depressingly, studies have shown that it doesn't even matter if their association with the brand is entirely negative - if brand A has done annoying things in the past and you've never heard of brand B, most people are more likely to choose brand A.
Advertisers don't like that one though, because it's hard to track. If you run an ad campaign that raises brand awareness, then you might see a spike in sales six months later when people start to actually need a product in the category that you sell and buy yours because now they trust your brand. Or you might see a spike in sales for a completely unrelated reason (e.g. increased seasonal demand caused by unusual weather).
Yes, we've also released the generated Verilog for anyone who wants to use just that. If you're a university, you can easily get a free license for Bluespec. If you're not, then you either most likely don't have the resources to get a decent FPGA (the ones that can run a processor at a useable speed start at about $3K), or you can probably afford the license. We're also talking to Bluespec about open sourcing their compiler, as most of their real value is from other services on top of it, but that's likely to take some time.
We're evaluating CHISEL, which is promising, but currently there's nothing else in the open source world that comes even vaguely close to Bluespec in terms of productivity for hardware designers, and CHISEL was not available when we started.
The old folder system was hierarchical. That made sense
It made sense for the 20% of the population who thinks of structure primarily in terms of hierarchy. This 20% has a very large overlap with programmers (not surprisingly, as most structured programming languages are innately hierarchical), but is still a small subset of the total computer-using population. This is one of the main reasons why programmers tend to be a lot worse at designing UIs for non-programmers to use than they think they are.
Because everyone has (to a first approximation) the same ability to speak. The USA has several orders of magnitude disparity in control of money.