Archive for the ‘Random’ Category.

Wikipedia Parser

Cubia is a lightweight Wikipedia mirror that can run on older computers (less than 1Ghz) without any trouble. One of the issues that it has had for a long time is parsing the Wiki markup to look like Mediawiki (the software that runs Wikipedia). I was making use of a project that stalled years ago but seems to be the only project that can at least somewhat parse it. I looked for updated versions and it seems as though no one has created a full featured stand alone MediaWiki Parser. Most people apparently just run MediaWiki which is fine when you don’t have millions of articles or you have a very powerful server.

So, I finally decided to see if I could just use MediaWiki. Now obviously I can’t point it at Cubia’s database and just expect it to work. Cubia’s database is nothing like MediaWiki’s database. So the first thing I did was install MediaWiki with its own database. I quickly found that skinning wasn’t going to do it. I needed to pull Cubia’s data into MediaWiki to render while MediaWiki uses a bunch of convoluted code to render a page. Using MediaWiki directly would be a huge code rewrite hassle.

So I took a look at MediaWiki’s index.php file and found that I could cut out most of it. The only code needed is the initialization of MediaWiki. After that code is initialized I just pulled the data from Cubia and ran it though $wgOut->parse().

You do need to add


require_once( 'includes/GlobalFunctions.php' );
require_once( 'includes/Parser.php' );

You also have to get rid of the lines in Index.php that get the page title. That’s done either by setting a variable in the page that includes the mediawiki renderer or by setting the REQUEST value.

Before the Setup.php include in order for this to work. I renamed MediaWiki’s index.php to cubia.php and copied the mediawiki installation into Cubia. Now, when rendering an article I just include cubia.php and it creates a variable with the HTML version of the document.

More work needs to be done to clean up the cubia codebase but it functions rather well. Eventually I’d like to figure out the minimum code needed to use MediaWiki’s parser.

Cheap Computers

The Boston Herald is reporting that some MIT students are working on a $12 computer.

If you read the article you find that the $12 computer already exists in India but it’s using very old tech and is missing some important things that would make it easier for people who have them to learn skills such as programming.

A $12 computer of sorts - a cheap keyboard and Nintendo-like console - already exists in India, where people hook the devices to home TVs to run simple games and programs.

But Lomas, an American graduate student who stumbled across the computers in Bangalore while on an internship last summer, hit on the idea of upgrading the devices’ 1980s-era technology.

He and others at the Massachusetts Institute of Technology symposium hope to soup up the systems - which are based on old Apple II computers - with rudimentary Web access and more.

The goal is to upgrade the parts but keep the $12 price point. The biggest expense to any cheap computer system is the monitor. LCD screens are not cheap. By having an RCA or coax out they cut out the need to supply the monitor with the system. Any cheap TV will do.

One of the things lost on modern computers is the out of the box ability to program it. DOS and early versions of Windows came with QBASIC. Now you have to either purchase additional software or get an internet connection so you can download a free compiler.

The entry costs have gone up. There is also an artificial expectation of quality that has risen since the 80’s and 90’s. Text and 2D graphics don’t cut it anymore. Everyone wants to make 3D games which requires the ability to create 3D objects and animations. Or steal them. It’s very easy to be discouraged. People don’t realize that rendering graphics is the least of game programming or any programming for that matter. There is a lot to learn that is universal from graphically simple games.

The types of games that $12 computers are perfectly capable of running.

The Beauty of Manual

I drive a 2006 Mitsubishi Outlander which is the first automatic I’ve ever owned that had a manual override. I recently took it on a road trip up to Idaho.

Automatic is nice because you don’t have to do anything except push down the gas to go but when you’re going through mountains it becomes a problem. If you’re trying to go 60 miles an hour through the moutains the automatic will often drop down to 3rd gear causing the engine to spin up much too fast. With the manual override I can just move the shifter over and force the engine to stay in 3rd or 4th gear.

I found that cruise control works a little different in manual mode as well. When in automatic mode the engine shifts around to maintain the speed no matter what the conditions are. In manual mode if you’re in 4th gear going up hill the speed will drop and if it drops too much cruise control turns off. You then have to drop down to 3rd gear to maintain about 3000 rpm and keep your speed modest.

One of the issues with trying to save gas using cruise control is that when you go up hill the engine works harder using more gas when the correct thing to do is to maintain the same amount of gas and let the car slow down on the way up.

Cruise control in manual seems to work that way.

Of course we were hauling so much stuff that we still ended up with worse milage than I typically get driving to and from work on the freeway.

Because That’s Not How it Works

I was coming home from a long road trip to Idaho and in Vegas getting gas when some guy starts washing my windows. I told him “that’s not necessary, we’re leaving.” I refused to give him anything. My wife thought I should have given him a couple bucks. The reason I didn’t is simple; I didn’t ask him to wash anything. He volunteered. If he wants people to pay him for his efforts then he needs to get a sign that says “Get Your Windows Cleaned $2″ or something. Maybe it was the long road or the late hours but I was particularly cranky that night. I do not care to be extorted for money.

I’m really tired of people expecting money out of me. When we first moved into our house it was virtually non-stop. We had the same paper boy come by wanting us to subscribe at least a couple times. Every time I told him I wasn’t interested. I finally got rude and he hasn’t been back. Apparently for some people that’s what it takes. The reason we can afford a house is because we don’t just give money to everyone who asks.

My wife donates money to various charities and that I’m okay with. These are established organizations going about things the right way so I don’t mind giving them some money. What does bother me about them though is that once you give them money they start sending you expensive looking mailings. At that point we stop giving them money. Obviously they’re just wasting it. If they wanted more money they could have sent a cheap post card. I don’t need a bunch of mailing labels; I have a pen.

It’s the same schtick that the window guy pulled: give people something and then act like they owe you something.

Maybe I’m wierd but when people offer a gift of actual value in exchange for a donation I refuse to give them anything. I don’t mind getting some cheap sticker that I know only cost a few cents and advertises their charity. I do mind when I see what they’re giving out costs more than a buck and does nothing to advertise the charity. Most charities can do a lot with a dollar. I don’t need a cheap trinket bought with money that was donated for a good cause.

Maybe some people will only donate if you give them something of real value in return. And that’s sad really. The whole point of donating is to help out without demanding something for yourself.

BigDog Humanoid Robot

Why Homeschooling Works: Part 2

In Part 1 I brought up what a “licensed” teacher is actually taught and why it has little relevance to a parent who homeschool’s their child. Unless you’re the type of parent who likes to ignore their child you’re going to be learning how to teach them long before they’re school age. What a professional teacher learns is largely how to deal with other people’s children in large amounts. A parent just needs to know how to teach their own child which comes from experience and maybe a few books from the library should you feel so inclined.

This distinction also applies to the child. In a public school the child has to learn how to deal with other people’s children in large amounts while at home they only have to learn how to deal with carefully picked friends or their siblings.

Public school advocates always bring up the social retardation of the homeschooled child when trying to convince parents they should subject their child to other people’s little monsters.

It has been known for a long time that students perform better when they are not under a lot of non-school related stress. If a child doesn’t have to worry about being picked on or beat up they’ll perform much better. Only when the school life is better than home life will the school be a better learning environment. Most of the time it’s not. And when the homelife isn’t good the parents aren’t going to be available to homeschool so public school is the only option anyway.

So homeschool avoids one of the biggest disrupters to a child’s eduction: bullies.

The main social interaction in public school occurs during lunch when the students sit with their friends, during class when working in groups and when playing sports in PE.

The homeschooled child may miss out on an hour of social time during lunch but they can play with friends after school just like public school kids. Group work doesn’t tend to exist in the public school sense when being homeschooled. However group work in public schools serves the purpose of having students help each other since the teacher is unable to provide that service effectively to all students. When homeschooled, the student gets one on one “group work” all the time with the parent. It’s a learning tool, not a socializing tool. The classroom is typically not a time for socializing. Most class periods go by without two students talking to each other.

So in some ways the social experience is limited in the learning environment for the homeschooled student. However most of the social experience comes outside the classroom. It comes from team sports and other extra curricular activities. Things that the homeschooled student has every right to participate in. A homeschooled student also has time to join sports programs outside of public school such as karate or dance. Public school kids have to take additional time out of their day to do such things while a homeschooled student can make it part of their schooling time.

The homeschooled student can be socialized just as much as a public school child but without having to deal so much with the obnoxious kids.

One of the mistakes that people make is thinking that you need to learn how to deal with bullies. Having a backbone doesn’t come from dealing with bullies. It comes from self confidence. And that comes from being well educated and sure of your capabilities. Once you get out of grade school and into high school, bullies tend to go away. By college they’re virtually non-existant. In the real world bullies get fired. So why subject your kid to them when they aren’t part of the real world experience?

By the time your child gets to college there’s little difference socially between homeschooled kids and public school kids.

How to Save Gas: Carpool

I’ve heard stories about people selling their house that’s far from their work and purchasing a house closer to work to save money on gas. I know from living in Phoenix that the difference between a 40 mile commute and a 10 mile commute is 100,000 to 150,000 dollars. That’s a lot of gas, not including interest. Basically, you’re spending more money per month in an increased mortgage than you’ll be saving in gas. 100,000 dollars at 24 miles per gallon and $4 per gallon of gas will get you to work for about 6000 days if your commute is 100 miles there and back. Or about 20 years of driving to work. And that’s assuming you drive zero miles at your new “gas friendly” house.

But that 100,000 dollars is an investment you say. Not unless you plan to sell your house rather quickly. The interest on 100,000 dollars over 30 years is about 160,000 additional dollars at a 7.125 interest rate. So in 30 years you spent enough money on the house to drive to work for about 50 years at your old house.

If you owned a large house outside of town and downsized and actually saved money on your new house then it might make sense to move into town.

Because I’m a math major and did the math I bought a house outside of time and deal with the extended commute in order to save money in the long run. Electric cars will be here in a few years which means I’ll not only be saving hundreds of thousands on the house but I’ll also be saving a lot of money on gas because with a cheaper mortgage I have more money for a brand new electric car. In fact, I can spend up to 30K on an electric car simply with the savings in gas by driving all electric.

But also, in the short term, there’s carpooling. I set up this web-site which makes use of Google Maps in order to help you find coworkers who are on the way to work so you can carpool with them. Your company can set up an account and then share the username and public password so you can see your location and all your coworkers locations. You can then click a link to plan your route and it will show you who is best to carpool with. You can then coordinate with your coworkers and refine the plan.

If you share a ride with one person every day who lives close to you, you can easily cut your gas bill in half.

Keep your cheap house and cut your gas bill: carpool. Don’t be silly and waste hundreds of thousands of dollars to move in town to “save” money. It’ll end up costing you a lot more.

Why Homeschool Works: Part 1

There are two key objections to homeschooling kids: qualification and social skills.

While at Arizona State University I was accepted into the professional program for secondary education. I turned it down to go back to computer science and eventually graduated with a degree in Math. I was married and had a child before I graduated. I was also working full time as a programmer before I graduated. So I chose to continue in my career so my wife could be a stay at home mom. A teacher’s salary is not enough. Maybe I’ll go into teaching later.

While studying to be a teacher I learned that the focus is not on the subject matter but on how to teach. And not just on how to teach but how to teach other people’s children. The big issue in public education is where to teach to. Do you teach down to the slow kids at the expense of the smart ones or do you teach up to the smart ones and the expense of the slow ones. The general consensus is to teach to the middle.

When you have 20-30 kids in a classroom some of them are bound to not want to be there and end up disrupting the learning environment for everyone else.

The job of a teacher is to then babysit the ones who don’t want to be there and try to teach the rest of the class at a level that caters to the “average” student.

A parent raises a child for 5 or 6 years before they are off to school. They know their child and how to teach them. They know the child’s abilities. The parent doesn’t need to know anything that doesn’t apply to their child which is the vast majority of what is learned when going for a teaching degree. The rest they could read a book on or take a couple classes if they really want to.

The other advantage of homeschooling is that the parent is learning with the child. When you’re in public school you have a new teacher every year. The new teacher has to assume where the old teacher left off and what level the student is at. With homeschooling the same teacher is there the whole time. They know exactly where the student is at. And even if the parent doesn’t know say, pre-calc now, they’ll learn as they review the lower levels as their child grows up. By the time their child is ready for pre-calc the parent should be, too.

Let’s say your child could really benefit from going on a certain fieldtrip. In public education you have to make sure the entire school is okay with it because your student will probably be out for the day. And the school has to make sure they have money for everyone. Which they usually don’t. And now you’ve got 30 plus kids that are all on this field trip that want to do different things but can’t. Typically they all stay together and be lectured as they go through. Some of them don’t want to be there.

The parent has to only pay for them and their student and there is no one to answer to. If they want to take their kid to the zoo they can. They can stay for as long as they want and go at their own pace.

A typical school day has around 6 periods with 50 minute sessions each. These happen from 8-3pm. Most children are not morning people. Studies have found that starting school at a later time improves performance. When a child is home schooled, school can start whenever the child is ready. You can’t shift the starting time in public schools easily because parents have to be to work. Not all students have a parent available to be home with them until 9am or later. With a homeschooled kid that’s not a problem.

Six 50 minute periods is 5 hours of teaching time. Since most classrooms waste 10-20 minutes per period getting the students settled in you can easily cut 1 to 2 hours off that time. It’s very easy to find the time to teach 3-4 hours a day. Which is what most homeschooled kids end up doing.

The numbers show that homeschooled kids outperform public school kids. And that’s for many reasons besides the ones discussed above.

World Daily Press: Where the World Comes to Talk

World Daily Press has been updated to replace the “Free Speech Zone”. You can now freely comment on any news article. There is no registration. All comments are anonymous. Most HTML is supported. Scripts and styles are removed. As problems arise things will be modified.

The RSS feeds are updated every 15 minutes. There are currently over 100 news feeds and more will be added.

MySQL 4.0 the Cripple

I started FreeRingtoneHeaven.com a couple years ago back when GoDaddy was still running MySQL 4.0. Until now it hasn’t been a problem because I never needed to deal with DATE fields. But, now that I’m going to be developing and managing a link system I need to be able to show stats based on the date that a click/impression/etc happened on.

Now that I think about it, my guess is that instead of using the DATE() function you’d have to cast the DATETIME field as a DATE field to group by the date.

So, today I finally moved the old FRH database from 4.0 to 5.0. GoDaddy recently upgraded. They don’t even offer 4.0 anymore. That’s how long FRH has been around. I’ve been running 5.0 on my dev boxes for at least a couple years now. This move will make it easier to add new features to FRH.

I don’t think I’ve made any serious changes to FRH for at least a year now. The last update was to add voting. Now with my handy dandy local copy I can pretty up the link program site and maybe touch up some pages that are a little homely looking like the Top Searches page.

ss_blog_claim=70b9168863fc97c91e6d88b40542a327 ss_blog_claim=70b9168863fc97c91e6d88b40542a327