Thoughts From My Life

May 2008 Archives - Page 1

May
01
Written by Neil Galloway
 

I have been writing demo applications using OpenGL recently in C++. I documented how to set up the environment and create a project in my article OpenGL and Visual Studio Express 2008. I started out by writing the application as a Win32 application. This was a problem though.

When you are doing it in a Win32 project instead of a Win32 Console project it makes it very hard to do simple debugging using print statements. If you are like me, I like to scatter prinf or cout statements through different parts of my code so I can trace the progress and examine variables during development. It makes it very easy.

If you use these statements in a Win32 project however, this output does not get printed out to the console or anywhere for that matter. It is just eaten and no errors are incurred.

My Solution to Logging On Win32 Projects

The correct solution, which I didn't do, is to create a logging interface. Either create a separate dialog window that you can write your statements to or have it write to a file. This way, you might be able to cover off your logging system at the same time (if your application needs it).

What I actually did was another story. I switched my project to a Win32 console application. This gives you just the regular main method for your application and dumbs it down a bit. You also don't need to include the windows.h header file. The catch is that you must use the OpenGL Utility Toolkit ... glut to create your windows for drawing your OpenGL demos in. I wrote about it in my OpenGL and Visual Studio Express 2008 tutorial.

Post a Comment ... (4 Comments)

May
02
Written by Neil Galloway

One of the biggest annoyances when developing a homebrew application for the Nintendo DS is when your application is using the FAT library to read files and you want to be run your application in an emulator like nocash (no$gba) and have it work on the DS with minimal changes.

I have finally found a technique to do this that works very well. It lets you use FAT file access in an NDS emulator or another way to put it is libfat in an emulator. The only catch is that is only works for reading and not writing. The result is also in two separate NDS roms. One works in the emulator and one will work on your DS. However, this big plus is that your homebrew code does not need to change to work with both. It allows you to code, test, and repeat without any extra work.

I found the information to solve this issue from two separate articles:


Something to remember is that I have only been able to get .ds.gba files to work in the no$gba emulator. I don't know why, but the other filenames don't seem to work.

Requirements

  • Development Environment Set Up - Refer to various tutorials for creating NDS homebrew using the devKitPro method. The devKitPro install includes the libfat library.
  • fcsrimage - download link is on the left hand side of GPF Dev Site.
  • fcsr.dldi file - download link is on the left hand side of GPF Dev Site.
  • dlditool - this is included with you devKitARM installation
  • no$gba NDS emulator. Download the latest version.
  • Your own dldi file for your homebrew card if you want to patch for it too.



Procedure For Setting Up the NDS Filesystem

Assuming that the file structure in C:\files represents the files that will be on the flash card and that your NDS homebrew app is called nds_app. The basic process is as follows:

  1. Unzip the fcsrimage application from above and then change directory into this folder.
  2. build nds_app.img c:\files
  3. copy nds_app.img to the folder with nds_app.ds.gba. It is important that you have the .ds.gba file. no$gba doesn't appear to work if it isn't that extension.
  4. padbin 512 nds_app.ds.gba
  5. cat nds_app.ds.gba nds_app.img > nds_app_fs.ds.gba
  6. dlditool fcsr.dldi nds_app_fs.ds.gba. This file should now work in the no$gba emulator.
  7. You should already know how to patch your main rom for your homebrew card, but if not I run this command: dlditool sclt.dldi nds_app.nds

After this, you should now have to roms: nds_app_fs.ds.gba (the _fs is for filesystem) and nds_app.nds. The first file will work with a libfat homebrew app in no$gba and the second will work on the DS hardware itself.

Makefile Changes To Automate It

I use the same Makefile that is packaged in the PALib examples.

Look for these targets in your Makefile and change the sections to look like this. Keep in mind I have mine also dldi patching for the supercard lite. You can swap that out for you own card. Some assumptions in my explanation are:

  • Assume your application is stored in C:\nds_app folder.
  • Your .dldi files (including fcsr.dldi plus your homebrew card's dldi...mine is sclt.dldi) are stored in the $(devkitARM)/bin/dldi folder.
  • You previously created your filesystem image as C:\nds_app\nds_app.img.
    i.e.
    cd C:\fcsrimage
    build C:\nds_app\nds_app.img C:\nds_app\data
    
# Makes a temporary copy before appending the filesystem
# image and that dldi patching it for use in an emulator.
%.ds.gba: %.nds
	@echo built ... $(notdir $@)
	@dsbuild $< 
	@cp $(CURDIR)/../$(notdir $@) ../$(notdir $(OUTPUT)).sc.nds 
	@cp $(CURDIR)/../$(notdir $@) ../$(notdir $(OUTPUT))_temp.ds.gba 
	@padbin 512 $(OUTPUT)_temp.ds.gba 
	@cat ../$(notdir $(OUTPUT))_temp.ds.gba  ../$(notdir $(OUTPUT)).img > ../$(notdir $(OUTPUT))_fs.ds.gba
	@dlditool fcsr.dldi ../$(notdir $(OUTPUT))_fs.ds.gba
	@rm ../$(notdir $(OUTPUT))_temp.ds.gba 

# This auto dldi patches for the supercard lite
# I don't have USE_EFS enabled so it is always
# using the else part.
#---------------------------------------------------------------------------------
%.nds: %.bin
ifeq ($(strip $(USE_EFS)), YES)
	@ndstool -c $@ -9 $(TARGET).bin $(ARM7BIN) $(LOGO) $(ICON) "$(TEXT1);$(TEXT2);$(TEXT3)" -d ../efsroot
	@$(CURDIR)/../efs $(OUTPUT).nds
	@cp $(CURDIR)/../$(notdir $@) ../$(notdir $(OUTPUT))_SC.nds
	@dlditool sclt.dldi ../$(notdir $(OUTPUT))_SC.nds
else
	@ndstool -c $@ -9 $(TARGET).bin $(ARM7BIN) $(LOGO) $(ICON) "$(TEXT1);$(TEXT2);$(TEXT3)"
	@cp $(CURDIR)/../$(notdir $@) ../$(notdir $(OUTPUT))_SC.nds
	@dlditool sclt.dldi ../$(notdir $(OUTPUT))_SC.nds
endif

I find this works the best for me, except that I am still manually running the build command in the fcsrimage folder to create the .img filesystem. If you can give me the Makefile commands to do that too, I would be eternally grateful.

Post a Comment ... (0 Comments)

May
05
Written by Neil Galloway

April finished last week, but I was a bit slow in tallying the results this time. I did have a new record this month and it maintained the status quo overall, but I still need to work on improving the traffic.

Thoughts From My Life Traffic Stats for April 2008

April's numbers and March's numbers are in brackets.

  • Page Loads: 21,802 (21,599)
  • Unique Visitors: 14,086 (14,029)
  • Average Uniques/Day: 469 (452)
  • Lowest Uniques/Day: 384 (299)
  • Highest Uniques/Day: 592 (630)

I had good traffic again across the whole month and set records just barely for a few of my metrics above. I am pleased with that as a few other bloggers have reported less earning for the month of April.

April 2008 Traffic
April 2008 Traffic

Thoughts From My Life Revenue

Overall, my earnings for April 2008 were $240.33. Here is the breakdown with last month's numbers in brackets.

  • PayU2Blog: $65.00 ($10.00)
  • Adsense: $135.14 ($129.26)
  • Kontera: $29.69 ($40.87)
  • LinkWorth: $10.50 ($10.50)
  • Azoogle: $0.00 ($0.00)
  • Commission Junction: $0.00 ($0.00)

My Adsense set a new record. Kontera cooled off to the usual numbers it used to get for me.

I have some other bad news too. My LinkWorth advertiser has canceled their campaign so that won't be coming in starting next month. It was a trivial amount anyways, but nonetheless.

I am about ready to drop Azoogle and Commission Junction. The affiliate links get a few clicks on my site, but I haven't been able to generate sign ups so I'm still sitting at zero with them.

Overall, I am quite happy with the month again. I would definitely like to find some content to boost the traffic even more, but it always seems hit or miss.

Post a Comment ... (0 Comments)

May
07
Written by Neil Galloway
 

I unfortunately broke a piece of the tailpiece off on my mandolin the other day. I was restringing it and was putting on some old strings (they hadn't been used) I purchased a few years ago. I don't know if that was the problem or not, but one the little pegs in the tailpiece that the eye of the string holds onto snapped off.

I didn't know what to do, so I phoned around to a number of places in Calgary and no one wanted to deal with it. Replacement tailpieces were selling upwards of $100 on eBay so that didn't look very good either.

I ended up phoning Long & McQuade here in Calgary (Calgary Long & McQuade) and they said to bring it by and they would take a look. Anyhow, I walked in and they have a replacement tailpiece of the exact same shape and size for $20. I couldn't believe my luck. It was the same size as my original so I could use my Kentucky tailpiece cover on it as well. It wasn't even stored in the back. It was a plastic wrapped item on a display shelf.

I own a Kentucky KM200S teardrop style mandolin. I purchased it back around 1995 or so. It is a pretty nice little instrument so I want to keep it in good repair.

Replacing A Mandolin Tailpiece

Replacing it is really simple:

  1. Remove the cover of the tailpiece.
  2. Remove any strings connected to the tailpiece. Either remove them from the Mandolin completely or loosen them enough that you can slip the string eyelets off of the tailpiece pins.
  3. Remove the screw for the knob you connect your strap to.
  4. Remove the 3 screws holding the tailpiece onto the bottom of the mandolin.
  5. Hold the new tailpiece in place where the old one was. The angle of the mandolin tailpiece might not quite be right, so bend it a little so that it is touching flat on the bottom side of the mandolin and the on the top.
  6. My old tailpiece had a piece of felt along the edge that the strings dug into, but the new one didn't have this. I removed the felt and superglued it onto the new tailpiece.
  7. Replace the 3 screws to hold the taipiece on.
  8. Replace the strap knob and screw.
  9. String up your guitar and put your tailpiece cover back on.

Overall, it was super simple, only cost me $20, took half and hour of work including the restringing, and I was able to keep on my original tailpiece cover.

Post a Comment ... (1 Comments)

May
12
Written by Neil Galloway

I have had a few people write me concerning my articles on Aeroplan and Airmiles, asking how I created my formulas for figuring out how much money you would need to put through your credit card to get back the annual fee for the credit card. This only works for cards that have a reward feature like airmiles, aeroplan points, or some other reward points.

I will try and get a baseline value for each type of reward point on each card and keep it in a table on this page (see below). If you want me to look at a card, let me know the name of it and I will look up the details.

This page will have 3 sections.

  1. Show how I create my formula for how much money you need to spend on a credit card to pay for the fees.
  2. List the formula for major cards.
  3. Use one of the reward items available for each card to figure out an exact value for how much money needs to go through the card to pay for itself for that reward item. I'll try to stick to gift cards since the value is fixed (i.e. $20 gift card) and is subject to change like airfare is.

The reason I give you the formula and my estimation is that every reward is different and can give you a different value to your points. Depending on what you use your card for, it can really change how much you are getting out of each point. Movie tickets give you more than a gift card for example. But who is going to want to use all their points on movie tickets.

Creating A Credit Card Formula

There are two pieces of information you need to know when figuring this out.

  • The annual fee for the credit card (i.e. $29/year).
  • The rate at which reward points are accumulated (i.e. 1 Aeroplan point per every $2 spent).

I will show formulas with the following variables:

  • PointsEarned: The number of reward points we can get from spending money.
  • MoneySpent: How much money we put through the credit card.
  • EarningRate: How quickly we can earn reward points. This should be expressed as points per dollar. If you earn 1 point for every $2 spent, then it is written as 1/2. You could also say 1 divided by 2.
  • PerPointValue: How much each point is worth if we used it to buy something. This is a dollar value. If a 2 for 1 movie pass is 25 points and it saves as $10 because that is the cost of a movie ticket, then each point is worth 40 cents. 25 points x 40 cents/cent = $10. So $0.40 would be our PerPointValue.
  • CardFee: The annual fee to own the card (i.e. $29/year).

How Many Points Do You Earn Formula

The first concept we need to know is that if we spend a certain amount of money, we receive a certain number of reward points.

PointsEarned = MoneySpent x EarningRate

How Much Do You Need To Spend To Recover the Fee Formula

The second concept is that we want to spend enough money on the card to at least cover the fee we paid to have the card. So we put the CardFee on one side of the formula and the other side of the formula is our calculation for dollar value of our accumulated points.

CardFee = PointsEarned x PerPointValue

Combining Formulas

The next step is to substitute our PointsEarned value in our second formula with the formula for PointsEarned we created in our first formula. Our equation now looks like this:

CardFee = MoneySpent X EarningRate X PerPointValue

What I am interested in is the MoneySpent value so if we divide both sides by EarningRate and PerPointValue, we end up with:

CardFee / (EarningRate X PerPointValue) = MoneySpent

Re-arranged again.

MoneySpent = CardFee / (EarningRate X PerPointValue)

In words: The money you would need to spend is the card's annual fee divided by the point earning rate and then divide that whole number by the value per point.

Example

I have a BMO Gold Mosaik Mastercard. The annual fee is $90 and I will receive 1 Air Mile for every $15 I put on the card. I can get a $20 gift certificate for Shell gas stations for 175 Air Miles. That means each Air Mile is worth 11.4 cents. So my variables are:

CardFee = $90
EarningRate = 1/15 or 0.06666666
PerPointValue = $20/175 or $0.114

The formula is:

MoneySpent = $90 / (0.066666666 x $0.114) = $11,842

Wow, I would have to spend $11,842 on my mastercard just to get back the fee I paid for it if I was going to use the miles for the gift card at Shell.

Keep in mind that this is for the Shell gift card reward. Other rewards give you move value for your points (movies, airfare, theatre tickets, etc).

Since the value of your point can change based on your use, I usually leave this part of the formula as a variable so you can plug in whatever you want:

MoneySpent = CardFee / (EarningRate X PerPointValue) = ($90 / 0.0666666666) / PerPointValue

MoneySpent = $1350 / PerPointValue

Just plug whatever you think it is worth in there and then you can get how much you need to spend to recover your annual fee value in points.

Formulas for Various Credit Cards

Using the same method I did in my above example, I have made formulas for the various cards. Just plug in how much you think a reward point for your card is worth and it should give you a number. As a hint...Airmiles PerPointValues I use are between 13 cents and 45 cents. Aeroplan PerPointValues can be between 1 cent and 3.5 cents. I know the range is big, but it really depends on what you use your points for.

I am also including cards that do cash back or have no fees just to keep the information filled out.

Note: If you want me to add a card, just post a comment and I will add it (and email you if you leave your address).

Credit CardAnnual FeeEarning Point RateFormula
American Express AeroplanPlus Card$601 per $160/PerPointValue
American Express AeroplanPlus Gold Card$1201 per $1 up to $10,000 and then 1.25 per $1 after that(150/PerPointValue) - 2500
American Express AeroplanPlus Platinum Card$4991.25 per $1 up to $10,000 and then 1.5 per $1 after that(748.5/PerPointValue) - 2000
American Express Air Miles$01 per $20N/A
BMO Gold Mosaik Mastercard$901 per $15$1,350/PerPointValue
BMO Silver Mosaik Mastercard$351 per $20$700/PerPointValue
BMO Mosaik Mastercard$01 per $40N/A
CIBC AeroClassic Visa$291 per $2$58/PerPointValue
CIBC AeroGold Visa$1201.5 per $1$80/PerPointValue
ScotiaBank No-Fee Money Back VISA Card$01% backN/A
TD Classic Visa$192 per $1$1,600
TD Platinum Visa$993 per $1$16,000
TD Gold Elite Vias$1203 per $1$20,200


Is The Credit Card Fee Worth It?

Listed below are some major credits cards and how much money you would need to put through the card if you were going to at least get back the value of the fee you paid for the given reward.

Credit CardAnnual FeeExample RewardPoints For RewardValue Per PointMoney To Recover Fee
American Express AeroplanPlus Card$60$50 Gap Gift Card6,000$0.0083$7,200
American Express AeroplanPlus Gold Card$120$50 Gap Gift Card6,000$0.0083$15,500
American Express AeroplanPlus Platinum Card$499$50 Gap Gift Card6,000$0.0083$87,820
American Express Air Miles$0$20 Shell Gift Card175$0.114$0
BMO Gold Mosaik Mastercard$90$20 Shell Gift Card175$0.114$11,842
BMO Silver Mosaik Mastercard$35$20 Shell Gift Card175$0.114$6,140
BMO Mosaik Mastercard$0$20 Shell Gift Card175$0.114$0
CIBC AeroClassic Visa$29$50 Gap Gift Card6,000$0.0083$6,960
CIBC AeroGold Visa$120$50 Gap Gift Card6,000$0.0083$9,600
ScotiaBank No-Fee Money Back VISA Card$0N/AN/AN/A$0
TD Classic Visa$19N/AN/AN/A$1,600
TD Platinum Visa$99N/AN/AN/A$16,000
TD Elite Gold Visa$120N/AN/AN/A$20,200

Post a Comment ... (4 Comments)

May
29
Written by Neil Galloway

Well, the suite is rented so that is exciting! We are going to scramble and try to get a few renos done while we have the opportunity as well. One of the rooms doesn't have a closet and definitely has enough room for it, so I will see if I can get one done. Would also like a more durable coat rack and shelf in the entrance.

Post a Comment ... (0 Comments)

Page 1