Friday, April 27, 2012

Courage

Forget The Sorcer's Stone where Dumbledore gives Neville Longbottom points for standing up to his friends. Forget The Deathly Hallows where Neville chops off the snake's head. In the movie version of the Goblet of Fire, Neville steals something from Professor Snape. That takes courage. That's why he's in Gryffindor. Or was he smart enough to choose it?

Wednesday, March 21, 2012

Good news

A friend was recently in the hospital with a blocked artery and had angioplasty. This is not as absurd as open heart surgery. The later, though effective and highly successful, has been described as "overhauling an engine while it's running". However, even short hospital stays are not cheap.

The thing is, he recently changed jobs. And as of a few years ago, employers have started delaying health insurance for a month or three while you start the new contract. This is pretty evil. Getting health insurance on your own is ridiculously expensive. And if there's any kind of employment gap, it's ridiculously expensive when you have essentially zero income. So when this has happened to me, i've skipped health insurance for a month here and there. I take no medications, and rarely have anything serious happen, so it seems like a good bet. I've been lucky so far. When my gall bladder exploded, i was covered. It would have been something like $6k.

Anyway, the good news is that my friend's new insurance did indeed take effect before his hospitalization.

We seriously need to decouple health insurance from employment in the USA. Employers have way too much power over employees. And, employers have been shown time and again to make use of their power in unethical ways. For example, i know people who were threatened with termination who, once terminated, must then leave the country. That's because these people were invited to work here on a work visa. It's a major hassle to sell everything you have and fly home.

The thing is, companies, especially large companies that run a cyclical business, like to hire people on "at-will" contracts so that they can dump them when business slows. In the old days, they paid these people a bonus. Not so much anymore. There are some good reasons to be a contractor. First, you have a spouse with insurance, and you go with contracts so you can opt out of it. Second, you want absurd breadth of industry experience. Third, as an "at-will" contractor, you have the option of quitting without notice or explanation when you discover that your new boss is an asshole. The sword cuts both ways. But when jobs are scarce, you tend to take what's available. And that's when it becomes clear that this whole system sucks. We need an affordable national health plan.

Tuesday, March 20, 2012

OBFUSCATED COBOL

Today, i ran into a snippet of COBOL with a bug. It was of the form

IF LONGWINDEDNAMEA = 3 OR 4
AND LONGWINDEDNAMEB(1:1) = C
MOVE...

but it should have been

IF (LONGWINDEDNAMEA = 3 OR 4)
AND LONGWINDEDNAMEB(1:1) = C
MOVE...

because AND has higher precedence than OR. So what the first example does is, uhm, what the heck? Oh. COBOL has implied subjects and implied operators. If omitted, it uses the previous subject and/or operator. The first example expands to this:

IF LONGWINDEDNAMEA = 3 OR LONGWINDEDNAMEA = 4
AND LONGWINDEDNAMEB(1:1) = C
MOVE...

so the compiler directs the computer to compute

IF LONGWINDEDNAMEA = 3 OR (LONGWINDEDNAMEA = 4
AND LONGWINDEDNAMEB(1:1) = C)
MOVE...

Which is not at all what the author wanted.

When I was a good deal younger, the incredible verbosity that is COBOL was explained away like this. The language is designed so that business managers could read it. It's hard to imagine what business manager audience COBOL was aimed at. None that i've ever met could have told the difference between COBOL that does what it looks like and obfuscated COBOL.

IMO, a large fraction of computer bugs are actively encouraged by languages that think programmers don't know how to type. Computer languages also have absurdly complex precedence tables. Who could get that right every time? Only the guys who look it up every time, or use parenthesis every time. Why not just go with left to right everywhere? 1 + 2 * 3 = 9, instead of 7 (because you need to * before +).

Now, i suppose programmers don't, by and large, know how to type. I could type 22 words per minute by the end of high school. I could type 22 words per minute by the end of college (plenty of practice, but no additional instruction). Over the next 20 years, at a keyboard for 2000+ hours a year (40,000 hours), my typing speed doubled to about 40 words per minute. But about ten years ago, i got addicted to a typing game for a couple months, and my typing speed shot up to over 70 words per minute. What a wasted 20 years. With a little instruction, i could have save huge amounts of time typing.

Wednesday, March 14, 2012

Happy Pi Day

Go ahead, have a slice of pie. It's pi (π) day (3.14 or March 14th).

Wait a minute. I get '3' as the third month. But 0.14 of a month like March (31 days) is 4. So, shouldn't π Day be March 4th?

Or, if it's just the decimal representation, and you use the digits, what about other bases. Computer people use octal. The number pi, in octal, is 3.11. So two decimal digits of π is 14/100 (100 = 10 * 10). In octal, you're looking for a number that in decimal is x/64 (64 = 8 * 8). x = 64 * (14 / 100) = 8.96, or roughly 9. But 9 (decimal) in octal is 11, which is 8 * 1 + 1. All that to say, computer nerds can claim the 11th of March as pi day too.

Why stop there? Computer people also use hexadecimal. In hexadecimal, π is 3.24 or March 24th. This is particularly handy if you missed March 14th.

And, in Europe, dates are reversed from the USA. I have no idea if anyone really celebrates π day on the 22nd of July, which is 22/7.

If that's not enough, you can at least think about Tau day. Tau (τ) is π * 2 or 6.28 or June 28th. I don't know what you'd eat, maybe 2 pies? But you can show off as a real math geek.

There you go. You are eligible to eat your π on March 4, March 11, March 14, March 24, July 22 and June 28th. That should fill your pie hole.

If all else fails, March 14th is Einstein's birthday. And he doesn't look a day over 133. If you're not into π, you could have Einstein cake. You can have your cake and eat pi two (π * 2 = τ).

Tuesday, March 06, 2012

Opposition to Mars

Mars opposition this year was March 3rd. That's when Mars, the Earth and the Sun are lined up. It's when Mars is closest to the Earth for another year and a couple months. It's not a magic date where, if you miss Mars on that day, you missed it. It's just that Mars gets closer to the Earth up to that date, then farther. It happened to be cloudy on the 3rd for me. But on March 5th, i happened to have a 60 mm (2.4 inch) diameter refracting telescope out, and though there were some hazy clouds, and got to see the orange blob at 78x magnification.

It wasn't very impressive. However, i have ready access to a 254 mm (ten inch) diameter reflecting telescope. Since this is four and a quarter times the diameter, i should be able to see details four and a quarter times smaller. But also, it collects over thirteen times more light. That means the image should be brighter, and can stand more magnification before becoming grainy. Good enough to see some surface features at a glance, such as a polar ice cap. About once every five minutes, the atmosphere is still for a split second, and lots of surface details become clear. So the views are great for the patient.

The 2003 Mars opposition was the closest Mars would be to the Earth in something like 70,000 years. That's because it took place in late August. That's the time of year when the ellipse that is the Mars orbit is closest to the Sun. Six Earth months from late August is late February. So this very early March opposition can be described as nearly the farthest Mars opposition for quite some time.

It will be worth a look. Through my astronomy clubs, i have access to larger telescopes. And so do you. One club offers a public Open House every month, and another operates an observatory that seems to be open essentially every clear night. It's highly likely that you live near such a club.

Friday, February 17, 2012

Bacon

I haven't played in a movie, so i don't have a Bacon number. But in 1997, i was in the Mendelssohm Club, a chorus in Philadelphia. The Philadelphia Symphony Orchestra hired the chorus and also hired John de Lancie (you might know him as "Q" in Star Trek, among many other roles) as a narrator in a performance of Honegger’s King David. So, i performed on stage with John de Lancie. This is a fact which, i'm sure, he does not recall. There were over 80 of us in the chorus, and i never talked to him in any kind of one on one way. Well, i looked it up, and John has a Bacon number of 2. So, if my performance counts (no reason it should), then i have a Bacon number of 3.

I did have a curious concern. When i was a kid, i had all sorts of fantasies. Most of them were a bit stupid. And, almost all of them had come true. In fact, when some of the more outrageous fantasies actually happened, i started getting worried. One of the stupider fantasies had not yet happened. And it was sort of a recurring thing. I call it "Getting Stuck On An Elevator With A Celebrity". Since it recurred, i could sort of get an idea by what was meant by a celebrity. That's because it seemed to be a different celebrity each time. I avoided the elevator.

These days, i define celebrity as someone who has admirers that they've never met. And, since i volunteered, i now help produce a monthly TV show, Astronomy for Everyone. I'm in almost all the episodes. A few months after the show started, i was at Astronomy At The Beach, a really big public event that the Great Lakes Association of Astronomy Clubs sponsors. This is an organization that is made up of about eight area astronomy clubs. They bring somewhere between 70 and 100 telescopes to a park, and between 3,000 and 13,000 people show up over two nights. Anyway, at the event, one of my friends said that a member of the public admitted to knowing my name. It shouldn't have been a big surprise. My estimate is that about 10,000 people watch the show. I meet my definition of celebrity.

The really stupid bit about this "Getting Stuck On An Elevator With A Celebrity" fantasy is that it involves getting stuck on an elevator. At best, this is a nuisance. And now, i've actually gotten stuck on an elevator. It's not an at best experience. So, does this count? Or do i have to get stuck again, only with someone else? I take the stairs alot. If you think you might be a celebrity, try not to get on an elevator with me.

Tuesday, January 31, 2012

Windows Media Player v 9.00.00.4508 on XP review

I mostly listen to music, audio books and podcasts on an mp3 player. But sometimes when i'm at work, the battery is low. My mp3 player can be recharged by plugging it into a computer USB port. Unfortunately, i can't then use it to listen to whatever. It can only either operate or be charged, not both. However, if i plug it into a computer, the computer can mount the device. However, the computer doesn't know where the device was last in a track. And, when i want to use the device again, the device doesn't know where the computer was. I handle this mostly by listening to whole tracks on the computer, and different tracks than i used last on the device.

The sound quality for my computer at work is comparable to the sound quality on the device. In both cases, i'm using the same headphones, which appears to be the primary limit for quality.

I thought Media Player on Windows XP could play any mp3 track. However, in one case, Windows Explorer identified a track as mp3 that Media Player wouldn't play. It turned out to be 192 Kbps variable rate encoded. My mp3 device played it without complaint.

Media Player can be excused from not being able to play Ogg Vorbis files. This Media Player was released in 2002, which is also the first year that Ogg reference software was released. It took forever for portable audio devices to support it. I used to convert all tracks to mp3 format. But now that i own a device that can play Ogg files, i prefer it. I can't update Media Player to some newer version. I can't install real software. I don't own the computer, and my employer does not allow me to install anything on it.

Another glitch in Media Player is that it doesn't smoothly go from track to track. There's always a short pause. Every now and then, music is split into tracks, but the audio was originally played continuously. It can be an annoyance. It's not a performance issue. It's just buffering. Windows Media Player didn't bother to get the software right.

Sometimes, if you select a bunch of tracks at once in an Explorer window, and tell it to play, Windows Media Player plays them in some apparently random order. They appear sorted in the Explorer listing, but appear shuffled in Media Player. It looked like Media Player was playing in directory order, but the mp3 player actually plays in directory order by default. I put the files on the device so that directory order is sorted order. The play order can be changed on Media Player one at a time. I thought there was no sort function, because there isn't such an option in the menus. However, there's a playlist button, and a sort option appears there. Mostly, i play one track at a time on Media Player. Both Media Player and my mp3 player device have shuffle modes.

Media player can do a few things that my mp3 player can't. It can play from CD, stream from the Internet, play certain DRM material (not an issue for me), and it offers various distracting visualizations. Fortunately, there is a "no visualization" option. In short, there are no unique features here that i value.

What does the device offer that Media Player does not? It plays a variety of sound file types. It offers more information on how a file is encoded. It smoothly plays from one track to the next. It offers playback equalization. It shows file encoding information. It can play back either 20% fast or 20% slow. It remembers where it was when last playing every track. It plays adjacent tracks without a gap. In short, most of these features are valuable.

Tuesday, January 17, 2012

Internet Blackout

Tomorrow, Wednesday, January 18th, there will be no blog post here on Predelusional. This is to protest big entertainment companies, the Chamber of Commerce, and their lobbyists attempt to get their way by ramming Internet censorship legislation through the US Senate.

On Thursday, January 19th, there probably won't be any new content either, but you never know.

Friday, October 21, 2011

parent/teacher conferences

An algebra teacher has four hundred and twenty students. There are three hours for parent/teacher conferences. If each parent talks to the teacher for one minute, how many new gray hairs does the teacher have by the end of it?

a. 5
b. 100
c. 500
d. all of them.

Monday, October 17, 2011

teacher pay for performance

I'm an engineer and computer programmer. One of the things that bothers me is that my employers, and i'm talking about managers here, almost never have a clue about how good or otherwise my performance is. I'd have thought that one would get an idea based on productivity or problem solving, or problem anticipation, or something. It simply doesn't happen. Most managers have little or no technical competence of their own. They don't seem to have any way to judge the performance of any of their direct reports with respect to others. They mostly either like you personally, or they don't.

As a contractor, i've changed positions frequently, so i've gotten to participate in numerous interviews. These too, have been nearly without exception, awful. More than a few have subjected me to a "quiz". For no apparent reason, i generally have performed quite poorly on these quizzes. One exception revolved around a research question that would be worthy of a Master's Thesis. I'd never seen the problem before. Though i was not able to come to a solution in 20 minutes, my direction was at least tenable. So, my performance has historically been good on impossible questions, but poor otherwise.

In a few cases, i've gotten a new manager at an old job where the new manager subjected me to a quiz. These have also been awful gages of performance. Why have tests been so bad?

I've talked about the No Child Left Behind (NCLB) program that G. W. Bush pushed into law. The idea here seems to have been that 1) teacher's own test scores do not correspond with student competence, so 2) we'll test students, and reward teachers with improvements in student's scores. A logical problem with this approach is that student's scores on testing also does not correspond well with student competence.

I've just read the editorial in the AASA Journal of Scholarship & Practice, Summer 2011 edition. It lists a number of further points. These include the fact that NCLB was rolled out to the nation, but never tested. There are numerous statistical issues with what students are tested for what teachers, and how the response to the program is to "play the program", without concern for the education of students. For example, let's say that you are a Special Education teacher. All of your students have been given to you because they are behind. But there's no policy that protects you as a teacher. Even if you improve your student's test scores dramatically (though they're still below average), you'll be penalized. This editorial talks about how some students have been encouraged to drop out of school and pursue a GED, instead of staying in school, and lowering the average test scores for the school. This doesn't help the students. And so on. The details are important. I highly encourage everyone to read the above referenced article.

As an engineer, i don't have pay for performance unless i go into business for myself. And, even then, i only have pay for performance if i get all the business stuff right, and perhaps, am lucky. But now it appears that even if i'm an above average engineer (whatever that means), this is a good thing - judging by the teaching profession.

If we want our kids to do better in school, we have to be smarter than this. We need to use systems that work, proven in pilot programs. Our current system, forged in the general incompetence of politics, doesn't work.

Tuesday, October 04, 2011

User Interface Rant

photo
In the early days of the web, all hyperlinks were blue & underlined. Even images were outlined in blue. So all clickable links were easy to recognize. This was quickly fixed. These days, most pages have clickable images. These days, there are images that are clickable from icons that look like buttons to images you might want to see at a larger size. Seldom is there the slightest indication that they can be clicked. I ignore the boiler plate of most pages, since that's where much of the advertising or non-changing content resides. But some sites hide valuable content there - like the dates and times for events.
By default, links look like links. So web developers have to go out of their way to make this happen. Pretty strange, eh? An entire planet seemingly dedicated to user interface obfuscation.

Thursday, August 25, 2011

Sudoko

I've now solved over 70 of the Project Euler site i mentioned a couple months ago. One of the problems i just solved was to generate solutions to 50 Sudoku puzzles. People solve these sorts of puzzles by hand all the time. I could have done it that way. I started by solving the first one by hand. It was pretty easy. I really only used one rule to make it happen. I thought about the rule for a bit, and decided it would be easy enough to code into a program, and that might be quicker than doing 50 by hand. And this first version solved some 29 of the 50. My program showed how far it had gotten. I used that to tackle the next unsolved puzzle by hand. And, indeed, i found an easy rule to code, and that version managed 39. From there, it might have been quicker to solve the last 11 by hand. Eventually, there were five ideas, and 46 problems were solved. One of the problems could be easily solved by hand from there if a guess was made of one of the two remaining possibilities for the cell. I decided to code in guesses. After making a guess, it would use it's previous system to see if it could get a solution. It continued to make a single guess until it either solved the puzzle, or it ran out of single guesses. All fifty puzzles were solved.

Total run time was difficult to get. What you'd like is the amount of time it takes to solve each puzzle. So, if you had a thousand puzzles to solve, you could multiply your time by a thousand and get a good estimate for how long that would take. But the total time was much less than a second. It's unlikely that the time would scale. It's quite possible that a thousand puzzles would also take less than a second.

Of notable interest is that nearly five thousand people have solved this problem. There are tons of programs that have been published that also solve this problem. So at least one person in a million, world wide, has written a Sudoku solver. That's a good deal more than i'd have expected.

Friday, August 19, 2011

Bike Log Day Four

I weighed myself just before day one. I guess that would be day zero. I'd lost five pounds compared to the previous time i'd weighed myself. That was a couple months ago. As i haven't been dieting, per se, i didn't expect to see a drop. I figured that since it was a fairly dramatic five pounds, i must have caught my weight at a low ebb. Historically, my weight has normally risen and fallen, pretty much at random, over a ten pound range, in the course of any random week. When i take a measurement, there's usually no way to take it at face value. I weigh myself approximately daily over a week, and my weight for the week is the lowest number. I figure it's easy to add weight - drinking a gallon of water is about eight pounds. But, i figure the bottom is the bottom.

A gallon of water is quite a bit. In 1986, i drank a gallon of water every day for six months, and half a gallon the other six months. It's great for your health. Now, you might think that my weight value from two months ago would also be subject to the ten pound range. But that was with several measurements. So it's likely that it really was the minimum back then.

On day two, i weighed myself again, and it was another three pounds down. So that's down eight pounds. Eight pounds is not something i lose in two months without serious effort. So this minor mystery is getting to be less minor.

Thursday, August 18, 2011

Bike Log Day Three

In 1992, i rode to work every day for an entire summer. My speed started out at about 6 MPH, and ended at 21 MPH. I had a shower at work, so i could go as fast as i wanted. It was 9 miles each way, and so that first trip was an hour and a half. By the end, it was 27 minutes. Fastest transport across Boston.

Back in Boston, i started biking to work in the Spring. I really hadn't done any biking that season. Six miles per hour is the speed you can go on a bike if you're totally out of shape. Little kids who have just gotten over using training wheels can go this fast.

My first measured day this time around was a bit over ten miles per hour. It took a couple weeks to get to that speed back in '92.

Day three's first timing was 31:43, for an average speed of 11.91 MPH. That's more than 10.35 MPH. That's a 15% increase in speed in just one day. In 1992, a big speedup like this took a week. Things aren't exactly the same. One of the things that changed on this day was that instead of wearing a hooded sweat shirt, i just wore a sweat band over my ears. That means it was easier for my body to get rid of waste heat. Some of the early speed increases are going to be due to improvements in how things are done rather than in changes in physical health.

Wednesday, August 17, 2011

Bike Log Day Two

There is no bike log from day one. I wasn't going to log anything. After all, i probably won't bike to work for more than a few days this time. Don't worry. I won't post anything if i don't have anything to say.

The trip to work is 6.3 miles. My bike computer (odometer) said 10.11 km. I've not calibrated it to four significant digits. I haven't had this unit very long. I could have told this unit to read out in miles, but for no reason that i can discover, i told it to read out in km. So if i'm listening to jazz music on my mp3 player, i suppose it's Kilometers Davis.

It took 36 minutes and 25 seconds, according to the bike computer. My wrist watch said it took about 50 minutes. The bike computer keeps the time of day accurately. But if i stop for a street light, the bike computer stops too. There's no way that i was stopped for fourteen minutes. But i was stopped for perhaps five. I stopped my wristwatch stopwatch a bit later than when the bike computer would have stopped, so there's another two or three minutes. This anomaly is about six minutes. The man who has two clocks has no idea what time it is.

The average speed was 10.35 MPH. Again, this isn't calibrated to four significant digits. I'd read this as ten and a third MPH. The numbers probably have four significant digits of precision, but not accuracy. Precision has to do with repeatability. So you can think of the distance as a unit similar to miles, and compare day to day numbers with four digits. Unfortunately, though the bike computer has an Average Speed readout, and although the bike computer manual says that there's a trip timer, the only way to get trip statistics is to reset all values in the computer. So i lose the odometer setting. However, this value matches the bike computer's average speed readout, despite the fact that it also averaged a few previous trips. While what really matters is distance, what tracks progress is speed. I'll likely focus on average speed in the future.

Thursday, August 11, 2011

interviews

I've been on both ends of the interview. I've seen that both ends pretty much suck. Interviewers ask pointless and stupid questions. Interviewees are in a half panic and act like they've lost 50 IQ points or more. It's not realistic on either side. It's mostly luck if it ends up with any kind of a match.

Despite getting resumes from recruiters, who were supposed to match requirements to experience, we seldom got the experience we were looking for. We soon discovered that only 1 in 3 candidates that we asked in for an interview actually showed up. So, we invited everyone. No big deal - i always had work to do to fill in. In one interview, the English was so bad that it wasn't clear if the candidate matched the resume or not. One guy showed up, we showed him the job in the morning. He went out for lunch and didn't return.

One of our best employees was transferred in from another department. She would never have made it through our interview. She had little actual relevant skills, but learned quickly. I spent about an hour with her about once a week in a code review. I tried not to critasize her working code too much. I'd simply make non-mandatory suggestions. Her code improved rapidly in quantity and quality. Everyone has a learning curve period. Hers was no worse than most. When she left, she tried to get me hired by her new employer. They turned me down.

These days, when i'm the interviewer, the question is "is this someone i'd like to hang out with?". It's not that i want someone to hang out with. It's just that these are the people who are the really sharp candidates. Very little else matters. I don't care if the candidate can't wake up in the morning, if they're obnoxious, if they're holding 3 other jobs. I only care if they'll get the job done.

I often get a contract with only one or a couple interviews. I often get offers for months after getting hired and i've stopped sending out resumes. How long do they think i'll wait?

I didn't send a resume or cover letter for my first interview. It was a summer job while i was in school. I'd made it through my freshmen year in Engineering, and that was enough. I didn't send a resume or cover letter for my first job after i graduated. I said i had an Engineering degree. They wanted to hire me for whatever. By the time i needed a resume, i had tons of experience on it. Many employers are looking for specific narrow skills these days, so i have to edit it down to what they want to see.

I don't say anywhere that "I have strong communications skills." My resume now has a reference to my TV show. It's a real attention grabber.

Monday, July 25, 2011

Mars attacks, every year

It's time for the Mars hoax email again. You may get email that says that Mars will appear as big as the full Moon, or even There will be two moons in the sky, and with a date, like August 27th. It comes from the 2003 Mars opposition announcement. In late August of 2003, Mars had a particularly close opposition, and in a telescope at 75x, Mars appeared as big as the Full Moon does with the unaided eye. Each summer, the email gets modified a bit more, and is pretty far from reality.

Mars doesn't get real close to the Earth every summer. Not even once a year. The next close approach is in March of 2012. Mars closest approaches that happen in Augst or September are the closest that they get. The March event won't be particularly good. But it will be worth a look.

At the moment (late July 2011), Mars is a morning object, and the visual diameter is 4.4 arc seconds. One must magnify Mars by about 400x to bring it to the visual size of the Full Moon. Fairly large back yard telescopes can achieve this. Perhaps an eight inch (200 mm) or ten inch (250 mm) diameter telescope would perform OK at this magnification. However, the atmosphere needs to be really steady to get a good view. One can expect a brief really still view about once every five minutes.

And then, you'd get a view with the kind of detail you can see on the Moon. That is, you'd see the largest areas of light and dark. No craters or mountains. For Mars, this may include a polar cap, and shades of orange. Waiting until March will give you views that are about 4 times larger in any given telescope.

The closest views of Mars at the moment can be downloaded over the Internet. They come from a rover that is on Mars - Opportunity. The twin cameras give a very human like stereo view, in color (multiple images are taken with red, green and blue filters, which combine to make color images). Further, there's a microscope, which can take images that can show detail to something like a 20th of a millimeter.

There is something about using your eyeball and a telescope and seeing it for yourself. It's different. There's still a month or so of Saturn's big show this summer. So get out to your local astronomy club's next event and take a look.

Tuesday, July 19, 2011

the possible future of cars

An article at Motortrend covers the proposed 56.2 MPG fuel standard by 2025. It's easy to be alarmed by the article, as evidenced by some of the comments left there. I'm not alarmed. I'm impatient. Here's why.

My 2000 Saturn (an American car) has a lifetime average of over 43 MPG, though it's still low mileage, at 290,000. A turbocharger should boost it's fuel economy by 20%. That would bring it to 52.4 MPG. A cruise control would boost highway economy by 5 MPG. That's been my experience with all my other cars. This car isn't a hybrid, or diesel, or indeed anything special. It's a cheap, reasonably peppy 4 door sedan, with air conditioning added for summer comfort and safety. Adding a cruise control would add less than $50. A turbocharger is a bit more, but not thousands. It'd be cheaper than A/C, and would pay for itself in gas. So, 56.2 MPG was achievable more than ten years ago at a reasonable price. Why wait?

I've said earlier that reducing highway speed from 70 MPH (in Michigan) to 62 MPH (100 km/hr) improves fuel economy by 17%. This hasn't changed. Not only do you save money, but your vehicle gets better range. Highway signs are cheap. They were changed to 55 MPH nationwide for a few years in the late 70's. We didn't get out of that fuel crisis because we obtained more fuel. We got out of it by improving fuel economy. One of the issues is that refinery capacity isn't growing. So gas availability is effectively capped. That's what the crisis was about.

The following was my response to the Motortrend article, including some of the comments at the time.

The BP oil spill in the Gulf has cost plenty to everyone. It's still costing us.

The American auto industry isn't at a disadvantage. My 11 year old American car has delivered over 43 MPG, lifetime average. Nearly 50 on the highway. It's just a cheap car, with A/C.

There's a saying that "There's no replacement for displacement" in the industry, meaning you have to have a big engine to have high power. But turbochargers have been in use since at least the 1940's, where they delivered higher power at lower weight, with less fuel, giving performance and range to aircraft. That's a 70 year lifetime for this particular nonsense.

This article claims that a breakthrough in battery technology is unexpected. But more than ten years ago, flywheel batteries were shown to have a 50:1 advantage in energy storage to weight ratio over lead-acid batteries. That's much better than Lithium. Everything in a flywheel is recyclable, and there are no toxic or rare chemicals.

Friday, July 01, 2011

Generic terms

One of the job titles that's pretty common is Systems Specialist. What does it mean? The word Systems is pretty generic. The solar system is a system. The one we live in has a star, some planets, asteroids, comets, and so on. So a Planetary Scientist is a Systems Specialist, right? But i work in Information Technology (IT), which is another overly generic title, but which is nearly always taken to have something to do with computers. So what is a Systems Specialist in terms of computers? Well, computers have parts too. There's the thing that actually processes data, the Central Processing Unit (CPU). There's at least one of them in every computer. But there's also specialized memory called cache, Random Access Memory (RAM), disk, networking, and various other devices. That's a computer system. Computer systems come in a number of varieties. Sometimes the same hardware can run very different software. For example, the exact same hardware might be able to run MS Windows, Linux or Apple Macintosh operating systems. So the same hardware might have very different personalities. And a Systems Specialist might not be a specialist in all of them. What kind of Systems is this person a Specialist in? Why not say Unix Systems Specialist, or whatever? Then examine the word Specialist.

When i'm asked what i do for a living, it is often the case that i'm talking to someone who doesn't do what i do. I assume they don't know the details of computers at first. So i don't launch into the details unless asked. I say, "I do something with computers". It's pretty generic. I've been asked what my job title is, and i tell them. But when they ask me what that means, and it's as generic as Systems Specialist, the only really good answer is "My job is so secret, not even i know what i'm doing".

Wednesday, June 29, 2011

euler

I bumped into a site that has mostly mathematical computer problems to solve. The site says that you can use any tools you want to come up with solutions. I use whatever i have at hand. That has included C, Perl, the shell, and my 25 year old HP-28C calculator. The problems are genearlly designed to require some computer programming. But some people have managed to solve some of the problems by hand(!). I have not, as yet, looked for hints elsewhere on the Internet, even though this is encouraged. The site suggests that computer programs can be written which take less than a minute to run.

At the time of this post, i've solved 36 of the over 300 puzzles. I don't attempt to limit computer time. If i get a solution, it's a solution. I expect that once i have a correct solution, it's code that will never run again, so there's not much point in optimizing the code. However, i like optimizing code...

Sometimes i make mistakes. But the system allows you to guess again if you get a wrong answer. One of the solutions i was writing had an estimated run time of a few hours. I ran it over night. But in the morning, it was still running. It turned out that there was an error, and it would never have finished. Opps. When i fixed it, i also noticed a way to speed it up, and the final version took about a minute. However, it took me a half hour to get the speed up working. I'm really just trying to get the total time spent down, except that i value my time over my computer's time.

One of the puzzles asks how many months start on Sunday in the 20th century. I could have done some calendar arithmetic (i've done it before). I could have narrowed it down with some math. But Unix (and Linux) have a calendar function, and it produces text, so how hard could it be in a shell script?

#!/bin/sh
for y in `cnt 1901 2000`; do
for m in `cnt 1 12`; do
cal $m $y | grep "^ 1"
done
done

I ran this script with the output into "wc -l". The "wc" program is the Unix word count program. The "-l" option makes it count lines. So here's how it works. The "for y" loop counts years from 1901 to 2000, inclusive. That's the 20th century. The 20th century is almost the 1900's. That's because the 1st century is the first hundred years, from year 1 through year 100, inclusive. The 2nd century is from 101 to 200. Anyway, the "for m" loop counts the 12 months. "cal" is the Unix calendar program. It can take two arguments, the month ($m) and year ($y). The "|" (vertical bar) symbol tells the shell to direct the output of "cal" into the next program. The "grep" bit is the Unix search program. It stands for "General Regular Expression and Print". The regular expression is the "^ 1" bit. This expressions tells grep to only pass lines that start with a space and the number 1. It turns out that the calendar format for a month has dates right justified. If a date is "10", then there's no space before it. The default calendars have Sunday at the far left. So this little script spits out a line like this:

1 2 3 4 5 6 7

for each month that starts with a Sunday. I run the output of the script into the word count program, having it count lines. The number of lines is the number of months that start on Sunday.

There's just one more little thing to describe. In the line "for y in `cnt 1901 2000`; do" there's a bit of syntax and a program. The syntax is the back quotes - the first just before the word cnt. The stuff in between the back quotes is a program with it's options, in this case cnt. This program is expected to print out a list, and the variable y gets set to each value on each loop. But the program cnt is something i wrote in the 1980's. It knows how to count up or down, with skips, with leading zeroes or spaces, with small functions taking the initial integer for a start, and can output in roman numerals and other formats. There must be solutions like it for other people, but this is what i've used. I've not released it to the public, for various reasons. So, if you want to use my solution, you'll have to solve this bit of the puzzle yourself.

Anyway, this solution produced an answer really quickly. It took more time to write this post than to write and run this program.

The site has a forum for each problem. Early solvers often post hints on how to solve or optimize solutions. And, often, these hints help you solve later problems. For example, there are a bunch of problems involving prime numbers. Having a good prime number test can be really handy. I peruse these and see if there's anything of interest.

This whole site is about education. A million years ago, i looked at the book 101 BASIC Games. These were games, written in the computer language BASIC. Not all of them worked. There were lots of different variants of BASIC when it was written. The programs were submitted by lots of different people using most of those variants. I studied a bunch of them to see how they worked. But it wasn't really a curriculum. The interesting thing about Project Euler is that it's more like a curriculum. Each of the problems requires a new skill or skills. The result is inductive chain learning. This can be an efficient way to learn. And, it's free.