Your Vehical is an Assest Not a Liability

A liability is something that costs you money. An investment is something that makes you money and an asset is something that helps you.

If you believe your car is a liability, a money pit, then you’re probably going to buy the cheapest car you can find that runs. You assume that the $3000 piece of junk you found is going to be cheaper than paying for a new car even after all the repairs you end up doing. That may end up being true if you happen to find a used car that isn’t a lemon. The biggest monthly savings on a cheap used car are paying it off and not having comprehensive coverage on your insurance. When you’re a teenager that may force your hand to go with a cheap car. When you’re an adult, you have other options.

If you believe a car is an investment then you’re going to look for a classic car that’s not in particularly good shape and fix it up. In the end you’re hoping that the cost to purchase the car plus the cost of repairs is less than the amount you will be able to sell it for. If you have a good eye for cars and the time for that sort of thing it may be worth the effort.

However, if you see a car as an asset; Something to make your life easier, then you should probably go with a new car. By new I mean less than 5 years old with 0 to 20,000 miles. You’re paying $200 a month to know that every morning you will be able to go to work so you can bring home $150 - $300 a work day. A car does not directly make you money. It indirectly makes you money by getting you to work and making it possible for you to work any hours the job requires. In that sense, your car is actually an investment. As long as your job pays more than the cost of owning and maintaining the car then you’re ahead.

So when it comes to cars it’s more about minimizing costs. Not about eliminating them. You could go with a used car and eliminate a monthly payment (at least temporarily) at the expense of piece of mind and possibly safety. How much are those things worth to you?

When deciding on what car to buy you need to consider many things:

1. This is what will get you to work
2. In the event of an accident, how important is it that you survive?
3. Are you willing to put the time, effort and money into fixing major problems?
4. What is the optimal miles per gallon the car gets?
5. How many miles can I reasonably expect it to last?
6. What’s the most car I can get for 10% of my income per year?

Your car is an investment no matter what it is. The key to minimizing the cost of paying for a car is recognizing needs vs wants. You may want to get to work in a Bentley but you could probably get away with a brand new $9,990 Nissan Versa and have just as much reliability and safety.

Mode 7 and You

Sin & Cos: The Programmer’s Pals! is probably the most straight forward example of Mode 7 implemented in a C like language available. You may be wondering what Mode 7 is.

F-Zero and Mario Kart for the SNES made use of Mode 7 and it has been used in quite a few games since. Mode 7 is a term to describe the ability to scale and rotate a texture. It simply translates the height of a texture into the depth.

Not so surprisingly you will find that the equations used to render Mode 7 are essentially identical to the equations used to render the ceilings and floors in Bunnies. Mode 7 is Bunnies without the walls.

The above link provides the basic rendering function but gets the key part of the equation wrong. Fortunately, Bunnies gets it right so I just used the equation from Bunnies.

WRONG:
distance = camera.z * scale_y / (screen_y + horizon);

CORRECT:
distance = camera.z * scale_y / (2.0 * screen_y - horizon);

I’ve started translating the old SoftGel C++ code to C# and this Mode 7 stuff is going to be the first to make use of the new library. I’m going to try to find time to start writing more tutorials. Bunnies is pretty advanced at this point and so I think I’ll begin developing a simple racing game and writing tutorials to explain how it all works. Eventually I may work the tutorials back to Bunnies.

You may be wondering what the point is with OpenGL and DirectX available. There are a number of reasons. The main one is that I’ve been there and done that with OpenGL and DirectX. I want to learn the math behind the rendering. The second reason is that most of the work that goes into making a game has nothing to do with rendering graphics. And also, you’ll find many of the same concepts that are used to render graphics are also used to implement game mechanics.

And finally, software rendering works on any platform that can plot a pixel. Not all gaming systems have 3D capabilities. If you can figure out the 3D stuff in software you’ll have no trouble doing it in DirectX or OpenGL.

Shop with Your Phone with Sears2go

Sears2go is a new way to shop provided by Sears.

With the holiday season fast approaching Sears2go makes it even easier to get all your shopping done. Often times while out holiday shopping stores are on opposite ends of town. Sears2go makes it easy to shop at Sears and get that holiday shopping done no matter where you are by making it possible to purchase select products using your mobile phone. This is the first on-the-go technology offered by a US retailer.

After purchasing an item on Sears2go, you will receive a text message alert when your merchandise is ready for pick-up. With Sears’ best in class in-store pickup you’re going to experience great customer service from purchase to pick-up.

Sears2go provides many of the same great features already available at Sears.com including the ability to easily browse and search for products, view product reviews and find where stores are located. You will also be able to view the latest special offers so you won’t miss out on any great deals while out and about.

To take advantage of Sears2go on your mobile phone you must have text-messaging enabled and be registered with a text-messaging plan. Sears is offering this service at no charge to you but your carrier may charge standard SMS/data rates.

Stop running around town to get all of your shopping done. Pull out your phone and use Sears2go.

Post?slot_id=25372&url=http%3a%2f%2fsocialspark

Smart People Don’t Go to College

People who want to be smart go to college. Or at least educate themselves. Some people think that they can just read books and they’ll know something. That’s not actually true. You can’t just read books or just observe others doing things. You need to apply your knowledge to really learn things. You have to read the book and apply what’s in the book to really learn. Otherwise all you have is a bunch of theories about how things are but you don’t really know. Many times the theories are nice but they aren’t entirely accurate when it comes to practical application. Also, if you don’t apply your knowledge to practical applications you won’t learn when it is appropriate to apply certain ideas to various situations. Knowledge that cannot be properly applied is useless.

You also will never be smarter than a book if you only do strictly what the book tells you to do. You have to color outside the lines or you will stifle your ability to learn and grow. By applying the book to the real world you will see that how the book tells you to do it may not be entirely accurate. Now you know more than the book is telling you.

When it comes to finances there is probably a book that will tell you anything you want to hear. If you want to believe that you can get rich flipping houses, a book exists that will be more than happy to take your money in exchange for telling you that. If you want to believe you can get rid trading on the foreign exchange (aka forex) there are books and programs that will take your money in exchange for telling you how you can get rich doing just that.

There are also books that will explain why you can’t get rich on the Forex markets or by flipping houses.

The fact of the matter is; they’re both right. The forex market contains a huge amount of risk. You can get rich and you can fail. Same with flipping houses. The key factor is you. The amount of effort you put into doing those things. You can’t just throw money at a problem and expect more money to come back.

So you need to educate yourself. If you’re not willing to learn and educate yourself then you really should stick to just reducing spending and putting your money in safe places like high yield savings accounts and bonds.

Your biggest financial investment is you. Educating yourself. Spending the money to learn. Get the information and get the tools to apply it. Don’t be the idiot that risks their life savings on their first time out playing poker. Be the smart player that finds ways to play for free and then goes in with some beer money to see how they can do once real money is involved.

There’s not a day that goes by that there isn’t a great opportunity. Smart people don’t bet on the “once in a lifetime opportunity” they learn how to find opportunities every day. And once you realize that, you don’t mind taking your time to learn because you know you’re not missing out on anything you can’t get when you’re really ready.

Understanding Bonds

http://www.savingsbonds.gov/indiv/products/prod_eebonds_glance.htm is the government web-site where you can learn all about Savings Bonds. Savings Bonds are a government backed investment with a reasonable guarenteed return on investment.

You can purchase a paper bond at half of the face value. So for a $1000 bond it will cost you $500. These bonds are guarenteed to be worth their face value in 20 years regardless of the interest rate. After the bond has reached its face value it will continue to earn interest at the fixed rate when it was purchased. Currently the rate is 1.3%. For those 20 years you will be earning 1.3% each year for $1000 compounded every 6 months.

So we earn $295.84 in interest over 20 years.

Let’s calculate the effective interest rate assuming that a $1000.00 bond matures (reaches face value) in 20 years. The interest on Treasury Bonds is compounded every 6 months so in 20 years there will be 40 periods.

We multiply the result by 2 since there are two periods per year making the effective interest rate about 4.8%. If we were to compound interest monthly it would be an effective interest rate of about 4.77%.

About a year ago ING was paying about 4.0% for their savings accounts. Now they are paying 2.75%. You can see that a Savings Bond provides a stable long term investment. However, because you can only purchase up to $5,000 per year (investment value) of these savings bonds you are limited in the amount you can invest.

An advantage of savings bonds is that the interest you earn is only taxed federally. They are also tax free if used to pay for an education. This makes them great gifts for babies. By the time they are ready to pay off student loans their bonds will have matured.

With a savings account the interest is counted as income and both the state and federal government take a piece of it.

A savings bond can allow you to make more and keep more of the return that you earn on your investment. The trade off is that it is very long term and you have very restricted access to the money until it matures.
href=”http://www.savingsbonds.gov/indiv/products/prod_eebonds_glance.htm”>http://www.savingsbonds.gov/indiv/products/prod_eebonds_glance.htm is the government web-site where you can learn all about Savings Bonds. Savings Bonds are a government backed investment with a reasonable guarenteed return on investment.

You can purchase a paper bond at half of the face value. So for a $1000 bond it will cost you $500. These bonds are guarenteed to be worth their face value in 20 years regardless of the interest rate. After the bond has reached its face value it will continue to earn interest at the fixed rate when it was purchased. Currently the rate is 1.3%. For those 20 years you will be earning 1.3% each year for $1000 compounded every 6 months.

So we earn $295.84 in interest over 20 years.

Let’s calculate the effective interest rate assuming that a $1000.00 bond matures (reaches face value) in 20 years. The interest on Treasury Bonds is compounded every 6 months so in 20 years there will be 40 periods.

We multiply the result by 2 since there are two periods per year making the effective interest rate about 4.8%. If we were to compound interest monthly it would be an effective interest rate of about 4.77%.

About a year ago ING was paying about 4.0% for their savings accounts. Now they are paying 2.75%. You can see that a Savings Bond provides a stable long term investment. However, because you can only purchase up to $5,000 per year (investment value) of these savings bonds you are limited in the amount you can invest.

An advantage of savings bonds is that the interest you earn is only taxed federally. They are also tax free if used to pay for an education. This makes them great gifts for babies. By the time they are ready to pay off student loans their bonds will have matured.

With a savings account the interest is counted as income and both the state and federal government take a piece of it.

A savings bond can allow you to make more and keep more of the return that you earn on your investment. The trade off is that it is very long term and you have very restricted access to the money until it matures.

Investing in the Sunday Paper

The Sunday Paper is one of the most valuable papers you will find. In it are contained dozens of coupons for products you already buy. The Arizona Republic costs $2 a week for Sunday only. The East Valley Tribune is $240.24 for 52 weeks or about $4.62 per week. The East Valley Tribune doesn’t have a Sunday only subscription like the Arizona Republic does. Research major papers in your area to find the cheapest way to get the Sunday paper. You may even save money by just walking down to the local convienence store and paying the newstand price.

In addition to the Sunday paper there are a number of sources to find coupons on-line including http://www.coupons.com. The selection of on-line coupons tends to be very small compared to what you can find in the Sunday paper.

Often grocery stores will multiply coupons up to a certain amount so for example a 50 cent coupon could end up saving you a dollar or two dollars. Lose any concept you may have of store loyalty. When prices are comparable, fine, go to the store you like most. But don’t pass up savings just because it’s not the store you usually go to. Stores don’t have customer loyalty. There’s no point in being loyal to stores.

With only a few coupons a week you can easily pay for the paper and then some. One of the tricks with coupons is that coupons tend to come out when the item is not on sale but do not expire until after the item goes on sale. Unless you need an item now, keep the coupon until the item goes on sale or use the coupon on the last possible day. And if the last possible day rolls around and you decide you don’t need the item, throw the coupon away.

Part of the purpose of coupons (from the marketing standpoint) is to get you to muddy your view of wants and needs. Buying items you wouldn’t normally buy just because you have a coupon is a good way to lose money. Buying an item that isn’t on sale just because eyou have a coupon is a good way to spend more money than you need to.

Buy only things you need and try to minimize the price you pay by waiting for sales and coupons.

You will find that the Sunday paper will save you hundreds of dollars per year for a very small investment.

The Cash Advantage of a Certificate of Deposit

A Certificate of Deposit or CD is a product a bank offers that allows you to earn a larger interest rate. A CD uses Simple Interest to calculate how much you will earn over a certain period of time. In exchange for the higher interest rate the bank typically requires that you leave the money in the account for the entire duration that you agreed upon when signing up for the CD. Taking your money out early could result in penalties.

Currently ING is offering a CD with a yield of 4.00% over 12 months. So if you deposit $1000.00 into this CD you will make $40.00 in interest at the end of 12 months.

Since a CD is simple interest, let’s determine what the equivalent compound interest rate would be assuming that the interest is compounded monthly.

PV is the present value which is the amount you start with. In this case we started with $1000.00. FV is the future value or the amount you will have at the end. In this case we will have $1040.00. N is the number of periods that we are compounding the interest. Since we’re compounding monthly for a year N would be 12.

However, “i” is the periodic rate. We multiply by 12 to get the annual rate which is about 3.9%.

So you would need to put your money into a savings account with a 3.9% rate in order to match the return of a 4.00% CD.

Currently ING is offering a savings account with a 2.75% APY. So you can see that in exchange for keeping your money in one place banks are willing to offer a higher interest rate. When deciding whether or not to put your money into a CD you need to consider the return compared to a regular savings account and the potential need to have access to the money.

So with compound interest over 12 months at 2.75% you would end up with $27.85 in interest; $12.15 less than the CD.

So in effect it costs you $1 per month to have unrestricted access to your money.

The potential money you make in a CD over what you would earn in a high yield savings account may not justify locking your money away. If you think you may need the money prior to the end of the period required by the CD then you should not put it into the CD.

Fun With MySQL

Error in my_thread_global_end(): 1 threads didn’t exit

If you get an error like that you need to upgrade your installation of MySQL to the latest version. If you’re using PHP then you need to update to the latest version of PHP. With .Net and languages like C# you are probably using the 3.51 ODBC driver to connect to MySQL. You’ll need to update to version 5.1 of the driver.

I’ve found that there’s not a lot of information on the net concerning this issue with C#. This is probably because .Net developers are writing web-apps which will silently ignore the error or they are running apps which exit and close the window so they never see the message. The only time you can see the error when coding in .Net is if you run a console app from the command line and the program otherwise cleanly exits. If you break out of the program you won’t see it.

Who uses C# to write console apps?

Fortunatly the error is not really an error. It’s a counting bug. MySQL sees your app’s thread and includes it in the thread count. MySQL exits first when your app closes and it sees that 1 thread is still open that it can’t account for so it throws an error.

The threads that alledgedly didn’t exit belong to your app and your app did in fact close so there are no threads that didn’t actually exit.

It looks scary but the error doesn’t mean there is an error in your app. It means that the MySQL lib can’t count.

The Poor Man’s Log Rotator


rotate_logs.bat:

bin\httpd -k stop

@For /F "tokens=2,3,4 delims=/ " %%A in ('Date /t') do @(
Set Month=%%A
Set Day=%%B
Set Year=%%C
)

ren logs logs-%Year%-%Month%-%Day%
mkdir logs

bin\httpd -k start

Instead of copying or moving large log files it’s much faster to shut down the Apache log server, rename the log folder based on the date, create a new log folder and then start up the server again. Once that process is done you’re free to copy or move the log files where ever you want without affecting the web server.

You can put this code into a bat file and use Windows Scheduler to automatically rotate your logs every week or day or whatever.

I’ve had a lot of problems with having Apache automatically name files based on the year and month to rotate logs and this seems to be a far more elegant solution. Apache does the minimum amount of work logging activity and the bat file does the minimum amount of work rotating the logs. The result is only a second or two of downtime depending on how quickly Apache stops and starts.

Putting Apache Logs into MySQL

On Lamp has an article titles “Writing Apache’s Logs to MySQL” which explains how to log directly to a MySQL database. This seems like a good idea on the surface. There’s nothing better than a database to store large amounts of information for processing. However, it’s not necessary or even advisable to try to store a bunch of log information from Apache directly into MySQL.

If you want your Apache server to run efficiently you need to have it do as little work as possible. For small sites the novelty of putting logs directly into MySQL may seem like a good thing. But as your site gets more and more popular the time it takes to insert rows is suddenly going to be noticable.

The better approach is to stick to file based logging and do post processing on log files. It’s rather trivial to write a PHP or Perl script to parse logs files and populate a database with the information. I currently use a free PHP script (the “Apache Log Parser” script) which happily chugs away reading the Apache “combined” log format. The class is instantiated into a simple script which takes the lines read by the parser script and stuffs them into a database table based on the year and month the request was made. This keeps MySQL happy by not storing millions of rows spanning 8 or 9 years of access logs into a single table.

Log reports are generally done on a monthly basis anyway. If your server is really popular then creating tables based on the year month and day is easy enough to do.

In order to improve efficiency even more, my server stores all the log files on a dedicated hard drive. I have yet to find a good log rotater for Apache. Every time I try to rotate logs I end up with runaway processes and server errors. So to rotate logs manually simply stop the server, rename the current log folder, create a new log folder, restart the server. A few seconds of downtime and you’re free to process the log files without interrupting the server any further.

You could probably write a bat file to do that process and set up a cron to do it automatically every week or so.

ss_blog_claim=70b9168863fc97c91e6d88b40542a327 ss_blog_claim=70b9168863fc97c91e6d88b40542a327