Tuesday, June 24, 2014

Helpless


I hate it when this happens.

Saturday, November 16, 2013

Less is More: Markdown

Cool Perl tool for generating valid HTML documents from formatted plain text.

http://daringfireball.net/projects/markdown/

Saturday, March 9, 2013

How to Easily Compile C# Programs without Visual Studio

I've noticed that there are a lot of tutorials on the web about programming in C#, but there aren't very many tutorials out there that teach you how to actually compile and run the code that you write. In fact, it seems to me that every tutorial just tells you to install Visual C# Express (or VS Express for Web, or whatever) and then expects the rest to magically work itself out.

The problem with this is that anyone who opens Visual Studio for the first time and isn't already an expert developer will be immediately lost in the sea of options, buttons, and menu items that VS has to offer. At least that is what happened, and continues to happen, to me! Luckily, there is an easy, non-bloated way to compile C# programs that bypasses Visual Studio altogether. Just make sure you have the .NET Framework installed. You can download it here: http://www.microsoft.com/net

Command Line to the Rescue!

It turns out that the Microsoft.NET Framework (which is the backbone of Visual Studio) uses a simple executable called csc.exe to compile C# programs. So, if you've written a C# program and saved it with the filename "myprogram.cs", you can compile that program from the command line using csc.exe. The syntax would look something like this:

csc myprogram.cs

The output will be an executable file named myprogram.exe.

Now, if you typed the above command into your command line, you probably noticed that it didn't work and you got an error telling you something about 'csc' not being recognized as a command. This is because you'll need to specify the path to csc.exe on your computer before you can run it. On my machine, csc.exe lives in the C:\Windows\Microsoft.NET\Framework\v3.5\ directory. Thus, the command to compile myprogram.cs would be:

C:\Windows\Microsoft.NET\Framework\v3.5\csc myprogram.cs

NOTE: I'm using version 3.5 of the .NET Framework for these examples. Be sure to use the correct path for whichever version you have installed.

You can also specify an alternate location or filename for the output (.exe) file using the /out parameter. For example:

C:\Windows\Microsoft.NET\Framework\v3.5\csc /out:mycustomfilename.exe myprogram.cs

You can even use the * wildcard to compile multiple .cs files in one sweep:

C:\Windows\Microsoft.NET\Framework\v3.5\csc *.cs

Environment Variables make it Easier

If you're going to be developing C# applications, you're going to be compiling and running your programs very frequently and you're probably going to quickly tire of typing the full path to csc.exe each time. Not to fear! You can set up a system environment variable to make csc.exe accessible from any directory

NOTE: You will need Administrator privileges for the following steps.

To set up a system environment variable in Windows 7:
  1. Click on "Start" and right-click on "Computer"
  2. Click "Properties"
  3. Click the "Advanced system settings" link (on the left)
  4. Click the "Environment Variables..." button (at the bottom)
  5. Under the "System variables" section single-click (highlight) the "Path" item.
  6. Click "Edit..."
  7. Append the text

        ;C:\Windows\Microsoft.NET\Framework\v3.5\

    to the "Variable value" field. Note the semicolon (;) and be very careful not to erase any of the existing system variables. All you're doing is adding another variable to the end of the list.
  8. Click "OK" to save your edit.
Now you no longer have to specify the path to csc.exe when running it from the command line. Simply typing "csc" will do the trick.

Other Options

Sometimes when compiling, you will see various messages appear in the command line (error messages, warnings, etc.). If you need to save these messages for any reason, you can tell csc.exe to dump them into a .txt file by using the > operator. For example:

csc myprogram.cs > filename.txt

Also, if you're not a command line type of a person, you could always create a batch file to handle the command line stuff for you by typing the necessary compilation commands (see above) into a .txt file and saving it with a .bat extension. The resulting file (filename.bat) should be placed in the same folder as the .cs files that you with to compile. When double-clicked, the batch file will execute the commands it contains exactly as if they had been typed in the command line. More about batch files here: http://www.robvanderwoude.com/batchfiles.php

Conclusion

You should now know how to compile and run C# programs without relying on Visual Studio. I hope this post has been helpful. Now, start programming.

Monday, December 13, 2010

How to Get Free Stuff from Amazon.com with Amazon Student and mTurk

In his ceaseless roaming of the Internet, a friend of mine happened upon a way to purchase items from Amazon.com practically free of charge: that is, if you're willing to invest a bit of time. Here's how it works:

If you don't already have an Amazon account, head over to http://www.amazon.com/ and click on the "Sign In" link (at the top of the page). You'll be guided through the process of creating your account.

Next, go to http://www.mturk.com/ and sign in using the Amazon account that you just created. Note: make sure that your Amazon account has been activated by opening the confirmation email that was sent to your inbox. You'll have to do this for your new mTurk account as well.


Once you've set up your Amazon and mTurk accounts (you may also want to set up an Amazon Payments account at https://payments.amazon.com/), you're ready to start making money. mTurk is a subsidiary company of Amazon.com that pays users small amounts of money to do odd jobs (called HITs) that other users request. For example, you may be paid $0.10 to compare search results on Google or to find the UPC number of a certain product. Any money that you earn can either be spent on Amazon.com or deposited into a personal bank account. It must be noted that this is NOT a way to get rich quick; in fact, you probably won't get rich at all, but it is a way to make some pocket change. If you spend a bit of time each day doing odd jobs, eventually the cents add up to dollars and you can purchase something on Amazon, or withdraw the cash from your bank account.

Unfortunately, the payoff of mTurk is rather low compared to the time investment. This being the case, every penny is valuable and you won't want to waste a single cent on shipping: this is where Amazon Student comes in. If you're a university student (if you have a .edu email address) you qualify for free Amazon Prime treatment for one year (I think that this is annually renewable). Amazon Prime gives you 1-day shipping for 0nly $3.99 and 2-day shipping free on qualified items. All you have to do is go to http://www.amazon.com/gp/student/signup/info and click on the "Get started" button. You'll need to sign in using your Amazon account and provide a valid university email address (ends with .edu). Once you check your university inbox and confirm your student account, you're done! Welcome to the world of free shipping!

Now, it must be said again that this is NOT a way to make large amounts of money. If you're looking to do that, you'd be better off finding a real job and working 9 to 5. However, if you're a student looking for a little extra spending money (or for cheap movies), mTurk and Amazon Student are perfect for you. If you're not a student, you don't qualify for the free Amazon Prime treatment, but you can still make money on mTurk; however, if you're not a student, you probably have a job and you might as well not even bother with the whole thing!

Since both mTurk and Amazon Student are subsidiaries of Amazon.com, there is no danger of getting scammed. What have you got to lose? Give it a try!

Thursday, September 16, 2010

avast!


Epic. Win.

Thursday, April 8, 2010

The Black Art of Emulation

We all have that one special video game that we used to play when we were growing up. For me, that game was Sonic the Hedgehog for the Sega Genesis. Now that the Genesis and I have seen a few more years, we spend less time together than we used. It's just too much of a hassle to dig the antiquated hardware out of its box and hook it up. However, about 8 months ago I discovered the solution: emulation. It turns out that old school gamers have been programming console emulators for years and years and I never even knew about it. Emulators are basically virtual consoles that run virtual game cartridges (Rom files ripped from physical cartridges) in order to recreate your favorite vintage gaming system right on your computer. I can play Sonic the Hedgehog whenever I want! Here are a few of my personally tested recommendations:

Fusion - Formerly Kega II or Kega Fusion. This is an emulator that will run Roms from several Sega systems including SegaSG1000, SC3000, Master System, GameGear, Genesis/Megadrive, SegaCD/MegaCD and 32X.

Jnes - Nintendo Entertainment System emulator.

ZSNES - Super Nintendo Entertainment System emulator.

Project64 - Nintendo 64 emulator.

Emuparadise.org - The source of all my Roms.

If you're worried about not having a controller, don't be. All of the emulators above allow customization of the control settings in order to provide users with a gaming experience that is as close as possible to what they're used to. Good Luck and Happy Gaming!

Sunday, September 20, 2009

King's Quest Reinvigorated

It seems nowadays that the golden age of computer games has come to an end. Is anyone with me? Today computer games such as World of Warcraft and Spore exploit Artificial Intelligence and cutting-edge graphics to appeal to the public. However, does anyone remember the good old days before all that, the days of King's Quest? Does anyone even care anymore? Well, some people do and those people are the brains at Anonymous Game Developers Interactive.

According to AGDI's About Us page, these folks are "a group of highly motivated individuals determined to revive the adventure game genre. [Their] aim is to remake classic Sierra On-Line adventure games, enhance them to modern standards, and then offer them as free downloads." And this is exactly what AGD Interactive has done.

King's Quest I: Quest For The Crown is based on the original Sierra Entertainment game of the same name that was created by Roberta Williams in 1984. The developers at AGDI have revamped it giving it new life at an extreme makeover. The current version of AGDI's remake (Version 4.0) was released on January 17, 2009 and is available for free download at AGDI's web site.

King's Quest II: Romancing the Stones is based on King's Quest II: Romancing the Throne, which was created by Roberta Williams and released in 1985. As with the first King's Quest, AGDI has renovated and re-released this game. The current version is Version 3.0 and it is available for free download from AGDI's web site.

King's Quest III: To Heir is Human. Well, since AGDI can't do everything, the people at Infamous Adventures have stepped in to remake King's Quest III. The latest version is 2.0. Cruise over to IA's KQ3 download page to grab this game.

UPDATE: 12-Mar-2013: AGDI has now released their own remake of King's Quest III, King's Quest III Redux: To Heir is Human, to compete with Infamous Adventures' previously released version. Now you can choose which version of KQ3 you want to play... or just try them both!
King's Quest IV: The Perils of Rosella. At the current date, this game has not yet been remade. However, Magic Mirror Games is hard at work on this project. Hopefully we can expect a top-notch product from MMG before too long. In the meantime, try downloading the original King's Quest IV.

King's Quest V, King's Quest VI, and Beyond. The chances of these games being remade in the future are comparatively slim. This is because they don't need it. Try searching the Internet for the original versions of these games. They can be found on numerous abandon-ware sites.

It's nice to see the old games coming back.