Mar 06

How to: Survive on $20 a week

Today marks the start of a new series on here, how to survive on $20 a week for food. In this, I am going to attempt to survive solely on $20 a week for food. A few things before we get started though:
[*]I may go over the spending limit some weeks – this is because I, like everybody else, can be lazy and sometimes you just have to go out because of time or whatever. So, this is more of a general guide – I will try to not go out to eat whenever possible.
[*]Each week, I get $20 more to spend on food. Unused balance from the previous weeks roll over.
[*]The first week, I get $40.
[*]This $20 is solely for food – not for other supplies like soap, rent, etc.

Anyway, on to the food!

I went to the store earlier today, and got the following items:
[tr][td]Bread(small loaf)[/td][td]$0.59[/td][/tr]
[tr][td]Cheddar cheese(16 oz)[/td][td]$3.99[/td][/tr]
[tr][td]Mozzarella cheese(16 oz)[/td][td]$3.99[/td][/tr]
[tr][td]Milk(1 gal)[/td][td]$1.89[/td][/tr]
[tr][td]Peas(40 oz, frozen)[/td][td]$2.29[/td][/tr]
[tr][td]Instant mashed potatoes(13.75 oz)[/td][td]$1.69[/td][/tr]
[tr][td]Cheddar cheese(16 oz)[/td][td]$3.99[/td][/tr]
[tr][td]Chicken nuggets(26.5 oz, frozen)[/td][td]$3.99[/td][/tr]
[tr][td]Pears(in individual bowls, 16 total)[/td][td]$6.00[/td][/tr]
[tr][td]Peanut butter[/td][td]$1.29[/td][/tr]
[tr][td]Apple Juice(64 oz), 2[/td][td]$3.98[/td][/tr]
[tr][td]Animal Crackers(3lb)[/td][td]$4.69[/td][/tr]
[tr][td]Pizza dough[/td][td]$2.29[/td][/tr]

Alright, so I went a little over. The good news though is that some of these are one-off purchases that won’t have to be made for a while. For example, the mashed potatoes I expect to last 4-5 months, which given that I’m only back at school for 3 could prove to be somewhat problematic. As well, the pear bowls that I got should last for about three weeks, as should the peas. The grapes I got because I felt like having some grapes. The cheese is for the pizza dough, I am going to make some tonight. I won’t be using up all of the cheese, but I plan to make tacos next week so I can use the cheese for that.

That’s a start. I’ll post more once I eat some more, and we’ll see where we are at!

Jan 29


So I just watched The Incredibles because, you know, it’s a Pixar movie. And anything that Pixar makes is awesome. I mean, Pixar could make anything great. But anyways, one of the special features is about a deleted scene. What they were originally going to have was a pilot who flew the plane to the island, instead of Mrs. Incredible. The scene was basically the pilot flying, and then being shot down while the Incredibles escaped, and Dash asks “What about the pilot?”

Now, what would be totally awesome, was if this was a cameo for H. M. Murdock.

Yes. Murdock from The A-Team.

The rest of the movie could stay exactly the same, there’d be no need to change it. But at the end, there’d be a brief scene with all of the A-Team around Murdock in a hospital bed. And then Murdock asks: “So what’s the plan, Hannibal?”

Or something like that.

Jan 15

D-Bus tutorial finished

D-Bus tutorial finished. It should cover all major aspects of D-Bus, using both method calls and signals. I’ve tried to make it as clear as possible, but I’m afraid that it may not be quite clear. Hopefully it will be useful to people.

On a related note, this has caused me to greatly increase the features available on the website. BBCode now works(only for pages at the moment though). I do however need to make it more robust. At the moment it’s highly likely to break if bad input is introduced. In order to make something that looks good, I’m going to have to write some sort of tokenizer it seems. That way I can replace only certain instances. i.e. I want to make it so that each paragraph is enclosed by a <p> tag, but I don’t want that tag inside of code or quote blocks. Well, maybe inside of quote blocks, but definitely not code blocks. It makes it look weird.

Jan 13

D-Bus tutorial

So at work, we use D-Bus to allow our programs to talk to each other. However, when first learning how to use D-Bus, all of the information that we were able to find on the internet was either laughably out of date or otherwise useless. So I’ve taken it upon myself to create a good tutorial that shows you exactly how to use the D-Bus. Hopefully, you can find it helpful.

Note that it’s not done quite yet. I’m going to add more information on signals, plus sample code once I’m done. I should have time to finish it this weekend.

On a related note, the tutorial is the first page that uses my new page-generator. It’s basically the same as a new post, but it’s more static to the extent that it will stay on the left hand side under ‘navigate’. With this in place, we are coming up on a fully-featured CMS system. Of course, this is nowhere near ready to release, but the basic framework is mostly in place at this point.

Jan 11

RM5248: Now with comments(really!)

So I’ve finished up the comments feature of the website, and it appears to be working properly. Currently, I have it set to allow guests to comment as well. It seems to be rather good.

On a related note, viewing a post is now in its own separate page, as opposed to a parameter to index.php. I think that it looks a lot better that way.

More features to come soon.

Oh, I almost forgot: This website should be fully XHTML compliant; I have not checked the new pages, but up until this point the entire site is good. Standards checks are a good thing.

Jan 08

Adventures in PIC programming

Recently, I got a PICKit2 programmer from Microchip, for a project. I haven’t started, I’ve just been learning my way around the chip, using the included lessons. They’re somwhat lacking though, so from time to time I’ll post some (possibly useful) information on here.

Just so we’re on the same page, I’m using the second type of PICKit2 that Microchip sells, the DV164120.

Now, on to the possibly useful part. The first lesson is to turn on a single light, and the 4th lesson is to make those lights rotate around and chase each other. It took me a while to figure out exactly what was going on, so let’s go dive into lesson 1.

bsf STATUS,RP0 ; select Register Page 1
bcf TRISC,0 ; make IO Pin C0 an output

bcf STATUS,RP0 ; back to Register Page 0
bsf PORTC,0 ; turn on LED C0 (DS1)

goto $ ; wait here

This is relatively simple, so let’s try and set two LEDs on at a time. First, let’s make all of PORTC to be output. That code is given in Lesson 3. Plus, let’s set the second bit on PORTC to set the second light on.

bsf STATUS,RP0 ; select Register Page 1
clrf TRISC ;from lesson 3, set all of TRISC to output

bcf STATUS,RP0 ; back to Register Page 0
bsf PORTC,0 ; turn on LED C0 (DS1)
bsf PORTC,1

goto $ ; wait here

However, this doesn’t work! You’ll notice that only LED C1 turns on. Huh. That’s interesting, because we definitely set two bits, bits 0 and 1 to turn on DS1 and DS0.

Well, so what would happen if we were to, say give the bsf command a hex value that had both bits 0 and 1 set, like 0x03? Well, as it turns out, that will actually turn on DS4. What?!

The key here is that bsf is setting the [i]bit[/i] value. Basically, you give it a variable and you set the actual bit in that region. However, you can also load in a value to that region, which is what the rotate lesson does. Now, let’s look at the datasheet for the PIC, and look at the PORTC:

Notice how this is only 7 bits. These bits control which outputs are on at a time. We’re only concerned with the first 4 bits, because we only have 4 lights plugged into the PIC. Now let’s look at the relevant code for the rotate that sets what light to put on:

 bcf STATUS,C ; ensure the carry bit is clear
rrf Display,f
btfsc STATUS,C ; Did the bit rotate into the carry?
bsf Display,3 ; yes, put it into bit 3.

Basically, what this does is it clears the carry bit, which is in the STATUS register. Now, we rotate the Display variable to the right, after moving it into f. Let’s step through this from the starting point, where Display has the value of 0x8(note that the Microchip code has this as 0x08, however only one byte is relevant and needed, since PORTC is only 8 bits(1 byte) wide). The next part shows only the last 4 bits of the byte, as those are the only relevant bits for this example.

1000 ;display at beginning
0100 ;rotate display to right, in C this would be Display &gt;&gt; 1
;is there anything in the carry bit? no, don't put anything in bit 3
0100 ;display next loop
0010 ;display after rotate
;is there anything in the carry bit? no, don't put anything in bit 3
0010 ;display next loop
0001 ;display after rotate
;is there anything in the carry bit? no, don't put anything in bit 3
0001 ;display next loop
0000 ;display after rotate
;is there anything in the carry bit? yes, set bit 3
1000 ;display at end. repeat

Now back to our original question, which was how to set multiple lights to be on? Well, we need to do basically the same thing that we did for the rotate. We make a variable, and then we load the [i]variable[/i] with the hex value of what two lights we want on.

cblock 0x20

org 0
bsf STATUS,RP0 ; select Register Page 1
clrf TRISC ;set all IO pins C to output

bcf STATUS,RP0 ; back to Register Page 0
movlw 0xA ;1010 binary. Lights DS2 and DS4
movwf Display
movf Display,w
movwf PORTC
goto $ ; wait here

Simple once you understand it.

Jan 08

RM5248: Now with comments(almost)

I’m currently working on adding the ability to add comments to news posts. The framework is in-place, but I think that I need to re-work some of the website in order to make this more customizable. So, you can’t actually add any comments yet. I’m feeling rather lazy at the moment, and so I don’t feel like finishing it tonight.

So hopefully later this weekend. But because of what I want to do, it will take a little bit. Basically what I want to do is to make it possible to turn comments on and off, as well as have the ability to allow anonymous users to post comments. That’s something that I need to work on to allow maximum control over what is on the site, so that non-computer-savvy people can make a website for themselves and easily update it. This means that it would probably be a good idea to break out the viewing of individual posts into their own page, as right now that is all done thru index.php, and if I wanted to add more settings it would get very large and difficult to maintain. So, if I break it out into different pages I can make it cleaner.

I think that I am also going to look into re-working some of the SQL strings, making more use of PEAR to get values and insert values. Hopefully that will make it fully database-independent.

Dec 27


This past weekend was of course Christmas. I went up to my aunt’s house for the weekend, and I got to see all of my cousins. This stuff is relatively boring, so let’s talk about something else instead.

Where to start? I’ve got a bunch of random stuff, so let’s start out with some code!

For whatever reason, since I’ve started my co-op job again, I’ve been dreaming in code somewhat. I’ll be sleeping, and then out of nowhere a block of code will come out. That’s not particularly accurate, but bear with me! So the other night, I woke up early in the morning and really had to go to the bathroom. Now sometimes after I wake up, I can get a little confused, especially if I was just having a very vivid dream. So anyway, as I’m sitting in bed, halfway between awake and sleep, I was also dreaming a bit about code. So in my dream, because I really had to go to the bathroom, I actually had to really return a float very badly. A float, as in a data type in programming.

….Yeah, I’m not really sure where that came from.

For the holidays, I got a few books off of Amazon, some for myself and some for presents. I got two books for myself; Artemis Fowl: The Atlantis Complex and World War Z: An Oral History of the Zombie War.

Now, the Artemis Fowl series is a series more meant for kids. However, I absolutely love it. I saw the first book in middle school. Some kid who was sitting in front of me on the bleachers was reading it, and had it next to him. I thought it looked interesting, and so I then read it. Turns out, it was really awesome. The Atlantis Complex is now the 7th book in the series, and it’s still rocking hardcore. Probably my favorite part was a pun on Wikipedia-instead of looking stuff up on Wikipedia, the fairies look stuff up on Wicca-pedia(*rimshot*). (Yeah, I like puns). Anyway, the book was quite good. I don’t think it was the best, but perhaps that’s because I read it in the car driving up. I’ll have to read it again sometime.

Now, World War Z is quite an awesome book. I mean, seriously, this rocks. I picked it up because it looked interesting, plus it’s a bestseller anyway. It’s written in the style of a group of interviews from different people in different perspectives, in the style of Studs Terkel. I had to read a bit of Studs Terkel for a class a few years ago, so I really found it quite cool. In fact, the author, Max Brooks, credits Studs with the format of the book. The style of the book actually makes it flow really well. Instead of having a story following a person or a group of people after the zombie apocalypse, the story instead asks people about their experiences during the war. I think that it gives you a much broader view of the war, instead of a “well here’s a group of people and here’s what they did” sort of thing. You also have to figure out what exactly is going on, as the way it is written uses slang that real people would have said, such as “Zack” or “G” for zombie, and the original name of the disease being “African rabies.” I read it all in just about a day, I found it so fascinating. I suppose part of the reason is that because there isn’t a real story to the book, you really can use your imagination more or something. It’s not a blow-by-blow account of the entire war and the events leading up to it. While it was quite fascinating, it was also a little bone-chilling, because it all seemed so real, except for the unkillable zombies of course. Some of the narratives describe how people would flee to Canada so that the zombies would be frozen, but they weren’t prepared for the winter. That just really stuck in my mind as being so plausible. Final rating: 5/5. If you like zombies, you should read this book. Actually, you should just read this book anyway.

My final thought tonight is on fake gift boxes. To that end, I got these Prank Pack Gift Boxes from ThinkGeek. I gave the PetPetter box to my mom. Her reaction was quite awesome; as she opened up the box, she went “but Ethan(our dog) loves to be petted!” with an expression not unlike this smiley: o.O

It was awesome. ^_^

Dec 16

Thoughts on Net Neutrality

So for the past few years, we’ve been hearing about this thing called “Net Neutrality”. Basically what that is, is that all content on the internet is delivered the same. There is no preference over what sites get better speed and/or service to the users of the internet.

Recently however, some companies have looked to tiered internet(where you pay more for faster speeds) and/or a download limit. We’ve already seen Time Warner institute a policy on this, albeit on a very limited scale.

My real thought on the matter though, is why? Why do the ISPs want to charge more for a higher download limit? While I do agree that most people may not download a lot in a month, there’s really no good reason to have a download cap like this.

Basically, what Time Warner is saying is that it costs more to send 10GB of information than it does to send 40GB of information. This isn’t true(or, at least as far as I know). While cable internet access is shared among all of the people on the network, that only matters if everybody is downloading a lot of information at one time. Anyway, my point is that there isn’t a noticeable cost difference between downloading 10GB and downloading 40GB.(if there is, link me to something that shows that!) Because of the nature of the network, the more you use it, it does not get correspondingly more corroded. For example, charging based on water usage makes sense. There is a finite amount of water for people, and for each gallon processed you need to clean the water, pump it, etc. As well, the more water you push through the system the more strain is put on the system over a period of many years.

“But wait!” you say. “Since cable is a shared medium among subscribers, isn’t that just the same as the water line, which is shared among customers?” Well, yes. Paying for faster speeds makes sense, as basically all that is doing is making the pipe which comes to your house larger. However, unlike the water system, where how much it costs is directly related to how much you use, this is not the same with the internet. Network hardware does not have a certain lifespan, to the extent that it can only take X number of packets before it needs to be replaced. How long before a part of the water system needs to be replaced is almost always directly related to how old it is. While it is true that network hardware does need to be replaced eventually(as it will eventually break), the amount of data does not determine this. If we try to force 10,000 gallons of water though a 1-inch pipe in one minute, that pipe will have to be replaced very soon, as the pressure is very high. If we try to force 10,000 packets through a piece of network hardware that can only take 8,000 packets a second, the 2,000 remaining packets simply disappear. There is no forcing of the packets through the hardware.

Note: Don’t quote this information as factual. Anything stated here is to the best of my knowledge. I’m not really a network guy.

So, to conclude: Internet based on how fast you can download makes sense. Internet based on how much you download doesn’t.

Dec 14

Welcome to RM5248.COM

Why hello there.

As you probably don’t know, I’ve been working on this website for the past few months, looking to teach myself a bit of PHP and MySQL. It is of course, not done, but it’s getting there. 🙂 It’s done to a point at which I feel that I can use it as more or less a blog now, which is what I was intending it for. Actually, I was going to make a site to work with a new game engine to play [url=]C&C: Red Alert[/url] on, but then I saw on Planet Command and Conquer that somebody made a new engine(not FreeCNC). So that plan sorta died.

  • This site however, is going to become a [url=]CMS[/url] system. However, this is nowhere near what I would like it to be. Things to add:
  • Ability to dynamically change pages. At the moment, really the only page is the ‘about’ page. I’d like to make it so that you can easily add new pages on the fly.
  • Add new links. There’s no way to change this at the moment.
  • Comment on news posts.
  • User administration. You can’t do anything yet.
  • User profiles. This would probably be something that you could turn on and off, as some people might not like this.
  • Searching. Apparently, the InnoDB engine of MySQL doesn’t do searching very well. We need to find a way around that…
  • BB-code tags(i.e. [b] for bold, etc)

Well, that’s about it for now. If you notice something horribly wrong, e-mail the webmaster. That is of course me. So, that’s just

See you later.