I just read this interesting article re: common science misconceptions. Improving the current state of science knowledge is just one of the things that is so motivating about working on software for education.
I just spent a few hours tracking down a bug in Rails 1.1, so I thought I'd post the issue and a workaround just in case anyone else hits it.
I designed a security enhancement so that controller methods can be protected by preceding them with a role. The standard Ruby method_added() callback is used to detect when controller methods are added, and then I manipulate the controller's before_filter chain appropriately. My code worked fine in Rails 1.0, and then stopped working in Rails 1.1.
I eventually tracked down the bug to the new implementation of before_filters and include_actions, which cache their results the first time they are called. This caching approach works fine as long as before_filters and include_actions are only called *after* all the filters have been registered, but I was using them *during* the registration process to figure out how to manipulate the filter chain. Since Rails 1.1 caches their value the first time they're called, their return value is out of date if more filters are added.
A workaround is to bypass the cache and use read_inheritable_attribute("before_filters") instead of before_filters. Similarly, use read_inheritable_attribute("included_actions") instead of included_actions. This is bad because now my code is tied to an implementation detail which would normally be hidden. Hopefully the bug will get fixed soon. I will submit it tonight to the Rails community for its consideration.
My favorite high school class was the first chemistry lesson I had in senior school. I was 14 years old and feeling very grown-up. I had worked hard to get into the top group of science students, and was looking forward to the challenge and excitement of working on some tough materials.
The teacher walked in and congratulated us on being selected as the top science students. He warned us that we had a lot of hard work ahead of us, but also promised that the classes would be fun and fulfilling as long as we concentrated on the materials and were diligent about our homework.
Once the pleasantries were out of the way, he started the first lecture, which was about the composition of the atmosphere. Everyone started taking copious notes. He told us that Nitrogen was 78% of the air we breath, with Oxygen accounting for 21% and the remainder taken up by Argon, Carbon Dioxide, and other gases.
He then proceeded to explain that Nitrogen had a pink color and a slightly sweet smell. Like good students, we continued to record this valuable information into our study notes. After several more minutes of lecture he stopped, and then exclaimed "are you students morons??!!". Needless to say, this caught our attention and we instantly brought our heads out of our books.
He continued: "If Nitrogen was pink and formed 78% of the air, the classroom would look pink! Are your brains even turned on right now?!" He proceeded to berate us for being so gullible, and then used the situation to segue into a discussion of the ingredients of science; observation, theory, and rigorous testing.
He concluded by pointing out that it's easy to hoodwink someone if they don't practice critical analysis. It was hard to argue with this point, since he had just got 20 of the so-called top science students to write in their books that Nitrogen was pink!
It was a classic lesson, a brilliant and insightful way to make a point, and it's a credit to the teacher than I can still clearly remember the moment many years later.
I'm the market for a developer-friendly chair. After some online research, I'm leaning towards buying a Humanscale Freedom. The reviews for the Aeron were also very good. Any feedback related to this topic is much appreciated, as I will make the purchase soon.
I follow politics and often get frustrated at rules and decisions that go against my personal values. Instead of ranting, I thought it might be more enjoyable and constructive to design a new constitution that would address many of my grievances.
Here is a list of the topics that I will cover in this series:
Objectives and Philosophy
The role of Government
Intellectual Property and Patents
Right to Die
If there are any important topics that I've left out, please let me know.
I thought I'd post a few more points related to the Tube concept I outlined recently.
A commenter and I had the same idea that it might be better to have balls running through the tube instead of canisters, primarily because it's harder to get a blockage. It's also closer to the analogy I made to the human arterial system, which has a much larger diameter than the various bits that float through it.
If you put the material to be transported into balls instead of canisters, the main issues seem to be:
How do you remove a particular ball from a stream of balls racing by?
Can magnetic fields be used to move balls through a pipe?
Any brights ideas on these (or other) questions are most welcome.
After three weeks of waiting, my car was finally delivered from DC to San Francisco. It's a beautiful sports convertible, and the perfect kind of vehicle for Californian weather.
I'm fortunate to have a garage under my apartment, but it's quite small and I have to be careful when parking.
A few days after the car was delivered, the weather was nice enough for an inaugural trip around town, ostensibly to find a good tennis club to join. I hopped into the car, switched the navigation CD from the east coast to the west coast, punched in my destination, flipped the switch to open the convertible top, and clicked the button to open the garage door.
After a few seconds of self-appreciation of my ability to multi-task, a nagging thought entered my mind. What was bothering me? My introspective mood was interrupted by the screeching sound of metal hitting metal. As the convertible top unfolded, it pressed against the garage door and created a nasty stalemate. Oops! I had not taken into account how small the garage was.
After stopping the garage door and the automatic hood I got out of the car to survey the damage. Not too bad. A broken rear reflector and some scratches on the trunk. Several hundred dollars worth of damage at least, but not as bad as it could have been.
The thing that interested me the most was that the accident hardly affected my mood at all. I figured that since I'd have to take it to the dealer to be repaired, I'd have Parktronic and a detachable bicycle rack added at the same time. No problem. Make the best of the situation and then enjoy the rest of the day.
Lesson learned: San Francisco is so beautiful, it's hard not to be in a great mood most of the time!
Here's an idea I had a while ago about a way to change the way that materials are delivered to and from a home. It applies to other areas as well, but for the purposes of this blog, I'll focus on uses related to homes.
There are several kinds of materials that regularly enter and leave a home. Here's a list of the main ones, together with how they are transported:
garbage; removed by the garbage trucks
sewage; removed by the underground drains
water; enters and leaves via water pipes
mail; enters and leaves via the postal service
food; picked up from the local store
gas; delivered via gas pipes
Notice that each kind of material has a different infrastructure associated with its transport. It made me wonder if it would be possible to use a single, unified approach for transporting all of these different kinds of things.
Here is the solution I came up with.
The main idea is to packetize transport of materials. It's analogous to the revolution that's occurring in network communications, whereby all kinds of data can be broken into packets and transported by a single transport protocol, namely IP (Internet Protocol). For example, voice, data, video are now all transported across a single network as a collection of packets.
I envisage a similar kind of network for the transport of material goods, which I call The Tube. The Tube is a network of pipes that connect and route through every house and every store. A pipe is 6-9 inches in diameter, transparent, and is evacuated so that things that pass through it do not encounter air resistance.
Traveling through the pipes are small cylindrical canisters around 12-24 inches long, which can contain any kind of material. Each canister knows where it came from, where it is going to, and what it contains. Canisters are propeled through a pipe using linear induction, which uses electromagnetism generated by coils around the pipes to move the canisters at speeds exceeding 100 miles per hour.
Since canisters can contain any kind of material, they can be used to transport waste, water, post, food, garbage, and other kinds of thing between any two points.
For example, here's how a Tube-based water system would work. Each house would have a small water tank. When the water level gets low, the house issues a request to the water supplier for some canisters of water. A few seconds later, the water supplier fills some canisters with water, enters them into a pipe and directs them to your home. Minutes later, the canisters arrive at your home and are automatically emptied into your water tank.
Similarly, when your home waste tank starts to fill, it places canisters containing the waste into a pipe and directs them to the sewage farm.
The most important concept of The Tube is that material transfer is packetized. Unlike, say, water pipes and sewage drains where a steady stream of a single material occurs, a typical pipe might contain thousands of canisters carrying a variety of different payloads. Transfering 20 gallons of water might take 5 canisters, and transfering a week of groceries might require 4 canisters. In addition, since canisters are routed individually, it's entirely possible that the 4 canisters carrying your groceries from the store to your home travel different routes and arrive a few minutes apart.
Each house contains an intelligent router which knows what to do with canisters when they enter the house. Water canisters are dumped into your water tank, mail canisters go into a mail basket, groceries are routed to your kitchen, etc. Similarly, your septic tank knows how to fill canisters with waste material and your trash cans know how to fill canisters with garbage.
There are several advantages to a Tube-based system:
1. It replaces the current postal service, sewage drainage system, water pipes, water towers, garbage pickup, and grocery shopping with a single, simple, easy-to-service system.
2. It is real-time. You can go online, order groceries, and have them delivered directly from the warehouse via a tube within minutes. No need to drive your car to a store, park your car, find the goods, wait in the checkout line, and drive home.
3. It is simpler to install. Right now, when you build a house, it has to be connected up to a ton of different delivery systems, such as sewage, gas, and water networks. With the Tube system, you connect your house to a pipe and you're done. Everything enters and leaves via a single point.
4. It cuts out the middle-man. You don't need to have stores anymore, since goods can be delivered directly from the producer to the consumer. Similarly, you don't need a postal service anymore, since mail can be delivered directly from the sender to the receiver.
The Internet protocol (IP) shows that a variety of different content can be transported using a single, packet-based scheme. By adopting the same philosophy, I think a single Tube network can be used for transporting most kinds of material goods.