A function that calculates the mean in Python:
def mean(x): sum = 0 for i in x: sum += i mean = sum / len(x) return mean
or the same function in R:
mean <- function(x) { sum = 0 for (i in x) { sum = sum + i } mean = sum / length(x) print(mean) }
A function that calculates the mean in Python:
def mean(x): sum = 0 for i in x: sum += i mean = sum / len(x) return mean
or the same function in R:
mean <- function(x) { sum = 0 for (i in x) { sum = sum + i } mean = sum / length(x) print(mean) }
YouHaveDownloaded.com claims to track the IP addresses of people who use BitTorrent, but I’ve been torrenting Linux ISOs for months, pushing almost 200 GB of data, and the IP address of that box is not in their database. I don’t know what their methodology is, but they’re obviously not interested in people sharing legal files.
So I finally got a smart phone, and let me tell you, going from a phone that only does voice and text to the Galaxy Nexus is like being shotgunned into the next century. We call the Galaxy Nexus a mobile phone for historical reasons only. It’s really a mobile computer that happens to do voice and text messaging, among other things. I think there are enough reviews of the Galaxy Nexus that I don’t have to give another rundown of its features here, but I do have a few thoughts on the smart phone phenomenon.
First, my “phone” has 1 GB of RAM and 30 GB of storage. My laptop from five years ago had 512 MB of RAM and a 40 GB hard drive. My desktop computer from ten years ago had 128 MB of RAM and a PIII 133 MHz processor. I don’t know how that compares to the ARM Cortex 9 on standard benchmarks, but it’s not just hardware. Browsers today can render JavaScript 10 times faster than the same browsers just three years ago, and probably 50 times faster than Internet Explorer 6, on the same hardware.
So what will our “phones” be like in another five or ten years? In five years, they will probably have the computing power of today’s commodity desktops and laptops, and in ten years they will far surpass them. On top of that, protocol and software improvements like SPDY, Dart, NaCl, etc. (well, maybe), will push performance much farther than hardware improvements alone. I believe the future looks bright, at least from a purely technological perspective.
Of course, the changes we see are not just technological. My phone has GPS that can geolocate me to “within 30 meters” of my actual location. When I turned it on at home, the address that it gave me was my next door neighbor’s house, which is close enough. That’s really convenient when I want directions to the closest Chinese restaurant, but I’m also keenly aware that Google will never delete that data. Ever.
This always happens with technology — there’s always some catch, some unintended (or intended) side effect to our technological marvels. The combustion engine created the industrial revolution and allowed us to build cities (because it made rail and transport affordable), but it also pumped megatons of toxins and greenhouse gases into the atmosphere. For all the problems we solve, we create many new ones, but we keep going because usually the marginal benefits outweigh the costs, all things considered.
It’s just another thing to keep in mind. Email allows you to communicate easily with other people, but that doesn’t mean you should use it for every conversation. Some conversations should be reserved for face to face communication, but that fact doesn’t mean we should abandon email either. Likewise, we don’t have to abandon smart phones because we have (valid) privacy concerns. We just have to remember sometimes to turn off the GPS.
According to the rules on Beijing’s microblog management, which went into effect Friday, web users need to give their real names to website administrators before being allowed to put up microblog posts.
Bloggers, however, are free to choose their screen names, said a spokesman with the Beijing Internet Information Office (BIIO), the city’s web content management authority.
“The new rules are aimed at protecting web users’ interests and improving credibility on the web,” he said, speaking on condition of anonymity.
I always thought that personal privacy coupled with institutional transparency was the most effective form of government and society. At least in practice, government secrecy coupled with massive surveillance tends to be despotic. But maybe China will be the outlier…
I manage a Debian server that hosts the Evolving Scientist Podcast, among other things. I have no background in computer science or Linux administration. I’m just a Linux fan who loves learning, and administering a “production” server can be simultaneously entertaining, educational, perplexing, and infuriating.
A few weeks ago, I noticed htop reporting a load over 1.0, yet the CPU use was always close to 0%. I didn’t think much of it at the time, but as the load persisted, I got more worried. Was this harming my box in some way? Turns out, if it’s not CPU use, it’s probably I/O — continuous writing to the hard drive — and that’s not good for the integrity of your data.
If something was constantly read/writing to the hard drive, what was it? Where was it? I just happened to do this:
$ tail -n30 /var/log/syslog kernel: [ 76.392218] hub 1-0:1.0: unable to enumerate USB device on port 5 kernel: [ 76.580230] hub 1-0:1.0: unable to enumerate USB device on port 5 kernel: [ 76.768221] hub 1-0:1.0: unable to enumerate USB device on port 5 kernel: [ 76.952222] hub 1-0:1.0: unable to enumerate USB device on port 5 # repeated 30 times
What the hell? The kernel was writing error messages at a rate of about 6 times per second. That might be the problem. But what does “unable to enumerate USB device” mean? Why didn’t I see it before?
A Google search turned up this bug, along with numerous forum posts, speculating and pontificating on the matter. I tried upgrading the kernel. I tried rebooting the server (losing 131 days of uptime), to no avail. I was ready to move everything to a new server. Finally I stumbled across this:
cd /sys/bus/pci/drivers/ehci_hcd/ sudo sh -c 'find ./ -name "0000:00:*" -print | sed "s/.///" > unbind'
Immediately the load dropped, and 15 minutes later, it sits comfortably near zero. It was just that simple, but as always, you don’t know what you don’t know.
This is yet another reminder that there are no hard problems — only problems that are hard to a certain level of intelligence and knowledge.
I don’t know why it worked; I was just desperate and wanted it to stop, so I pasted some code from (yet another) tutorial on the net. Now that I have some peace of mind, I can dig deeper.
There’s a lot of drama over at the Evolving Scientist blog today, thanks to PZ Myers and reddit. Looks like some Christian apologists have stirred things up. For the record, that first comment is mine:
I have a deep concern about the increasing emphasis on the Standard Model in the new Blueprint. I have a very difficult time believing that we have come to a point in education that we are teaching atoms, *not the theory of atoms*. I do not believe in atoms, and I do believe in the creation of earth, air, fire and water by God. I now stand to certify, and seal, my stupidity.
Ridiculous beliefs deserve ridicule, and satire is often the best response.
I haven’t posted in a while, but I should, especially now that I’m done with quals.
Oh, I know nobody reads this, but I enjoy writing. It’s a great way to organize my thoughts, and if somebody else finds my ramblings useful, all the better.
Maybe I’ll start posting more often.