What “The Land Before Time” taught me

17 05 2009

Inspired by the great folks at despair.com

Sometimes there is no Great Valley




Best oldschool RPG ever: Exile III

4 03 2009

Exile III was one of the most amazing, nostalgic games which I still play. It’s based on old D&D character creation, but with some unique differences in skills, etc. The point is that you level up your party while you are exploring the surface world. You’ve been banished to the underground “pit” civilization called “Exile”.

You are an adventurer party which explores the surface, reporting back to your Exile coordinator about the things you find up there.

Things get complicated as the story progresses, but it’s very heavily open-ended in the game play style. You literally go where your little heart leads you, finding out more and more about the surface in a very non-linear way. There are tons of “side” plots that you can discover.  As time progresses, cities and towns literally become overrun and sometimes destroyed by the forces at work in the world, keeping you interested in the world you’ve become a part of.

The game came as a trial, which impedes you from travelling further north than an predefined invisible line. I won’t promote pirating a serial key or an EXE patcher, but let it be known that I have seen one of the latter once upon a time, and the game was remade as Avernum (which I didn’t like nearly as much, for several reasons) and so Exile III has been cast aside.

The game comes with a save-game editor, which is pretty sweet. Most of the good stuff is enabled only after registering, but you still get several freebies like “heal hp/mp”, or “make towns forget you” (for those times where you decided to lead an assault on those innocent citizens of the town, thereby invoking the never-dying wrath of the town’s guards). Of course, no game is fun if you cheat your way through it, but at the same time, no game is fun if it is mercilessly hard with no hope for success if you’re ever in a weird jam.

Some notes about the playing the game:

  1. The installer you download from the Spidersoft page is actually more like a self-extracting exe. So, when you run it, it will expand the *real* installer into the same directory, so make a temp folder first and place the “exile3v10.exe” file into it before running it. After extracting run the “INSTALL.EXE” program to begin.
  2. The installer is a bit archaic, and defaults to the C drive, no matter what your main drive is.
  3. The installer can’t install to a directory with spaces or hyphens in its name. It’s no problem though, if you install it someplace easy first, and then just move the installed folder to the spot where you want it (including paths with spaces).
  4. All of the graphics are just bitmaps in the local game directory, so you can edit them to be whatever you want! :D This makes for some fun edits, like making one of the characters a giant Yoshi, or something. My personal idea for a character set will be posted soon for anybody to download ;)
  5. Vista and Windows 7 sort of molest the game, so I just set it to run in compatibility mode for Win95, and everything got better.

I guess that’s all for now :)





LINUX: Set root password

31 01 2009

So, this isn’t tough stuff, but any gui-loving user will find themselves in shambles when put in front of a l?[ui]n[iu]x (pardon the regex) terminal.  That is to say that it’s OKAY if you’re good “at computers”, yet you can’t fumble your way around a unix-style terminal.

I recently set up my own headless (no GUI) Ubuntu Linux, 8.10 server edition on an old computer I have lying around.  I decided that making it run Apache and my personal SVN repositories (while doubling as a 160gb backup drive :) ) was a good idea.  Problem is, after I got it all set up, I of course have no decent programs, and suddenly find myself wanting to browse the web on my new server box, to find the appropriate urls to feed to the ‘wget’ command.  And I’m tired of pushing my monitor’s “switch input source” button.

By default, Ubuntu tries to abstract the root account from you by letting you perform “root”-ish operations with your own account, using the sudo command.  But sometimes I just want to be root for an effing minute while I do stuff.  By default, Ubuntu comes with no password on the root account, meaning that it also won’t let you sign in with it directly.  Blank passwords are a no-no.

$ sudo passwd root

^^ that ‘$’ is the intrawebs’ way of saying “this is the start of a unix command-line thingy”.  And that’s the technical term, trust me.

This is actually the command to change ANY user’s password, but it just so happens that you’re changing the root password, so you of course need  the all-powerful pixie dust of the “sudo” command.  If you were root already, or some other empowered user, you would only have to type:

$ passwd USERnameGOEShere

And it would prompt you for the new password.  But again, if you don’t have good enough authentication, it’ll make you do “sudo” in front of it, or be root altogether.

As pointed out by Dave in the first comment below, the “sudo -s” command is a way to obtain sudo permissions for a more extended period of time.  If that’s all you want, then go for it.  But if you’re looking to actually give the root account a password, then you’ve gotten your instructions already.





Java: Count instances of a substring

6 01 2009

Despite my distaste for Java, I work in it every day at e-kiwi (author of software Screen-Scraper).

As usual, I was surprised to find that Java has no easy way to count the number of occurances of a substring within a given String variable.  I Google’d it and was surprised at the first result’s poor coding.  It had a ‘while (true)‘ loop with a goofy break statement tied to a misleadingly-named variable.

Try this:

public int countIndexOf(String text, String search)
{
    int count = 0;
    for (int fromIndex = 0; fromIndex > -1; count++)
        fromIndex = text.indexOf(search, fromIndex + ((count > 0) ? 1 : 0));
    return count - 1;
}

Pardon the ternary operator in there, but Java doesn’t like making boolean-casting-to-int easy.

If there are any errors you encounter, just let me know and I’ll fix it.  My use for such a function doesn’t require the ‘border’ cases where substrings are at the beginning or end of the main string.  If you know that you don’t need to match a substring which will begin at the first character of the main string, you can change the ternary part from:
fromIndex + ((count > 0) ? : 0)
to just
fromIndex + 1

Sorry to the dude that I flamed on his blog, but poorly written code is easy to find these days.  Idioms are the way to go.  Java’s slow enough as an interpretted language that it doesn’t need extraneous if-else statements in ‘while (true)’ loops and incessant variable assignment to immutable values.

You might argue that it doesn’t really matter if you lose a few cycles on today’s machines, but programs should be as efficient as possible when it’s worth the time.  You may as well take a few minutes (or even an hour) and figure out the best way to do something.  Forethought with save you an amazing amount of time in the future when you develope real programs and not just school assignments.





Python, MySQL, and a dictionary

19 12 2008

Here is a line in python that should be recorded for posterity…

Some background.  I have a multilingual database where several tables exist.  Each table is named after a particular “vocabulary” for my website.  For instance, there’s a “forums” table for all the terms that are used for pages related to the forums.  The purpose of having this table is so that I have all the needed terms very isolated into a nice hierarchy.  The SELECT * sql would look like this.. (pardon the fake spanish translations)

mysql> SELECT * FROM forum;
+---------------------+----------------------------+------------------------------+
| ID                  | enUS                       | es                           |
+---------------------+----------------------------+------------------------------+
| Audio Review        | Audio Review               | 

              | | by                  | by                         | [by]                         | | complete            | completed                  | [completed]                  | | current             | current                    | [current projects]           | | dropped             | abandoned                  | [dropped]                    | | loading             | Loading...                 | [Loading...]                 | | no                  | no                         | no                           | +---------------------+----------------------------+------------------------------+

As you can see, there is a column “ID”, which is what I use site-wide to access a term, and I select only one other column, according to the language code the user has his/her preference set for.  Thus, a general select for such a thing is …

mysql> SELECT ID,enUS FROM forum;
+---------------------+----------------------------+
| ID                  | enUS                       |
+---------------------+----------------------------+
| Audio Review        | Audio Review               |
| by                  | by                         |

… etc, etc.  Then, I just used PHP to fetch these results into an associative array.  I would then have to loop through each record, saving whatever is in the $row['ID'] spot as a key to this array, and whatever is in the $row[currentLanguage] spot as the value to said key.

So anyway..  I was trying to achive this effect in python; a Dictionary-type object where I can simply index into it with the term that I want, in order to get the language-translated value represented by the term.  I knew there had to be a way to do a famous python one-liner, and since those one-liners typically clock much faster than manual loops..

resultSet = (map(None, row.values()) for row in rows)

Seems simple, but it’s a hassle to work it out when your data is a tuple of dictionaries :P





Miko’s Blog, straight out of Hamamatsu, Shizuoka, Japan

15 12 2008

One of my interests is languages.  Included in that is Japanese.  Perhaps some of you may shun me for claiming I like Japanese, yet I don’t fit that anime-addicted mold that tends to be the basic framework that Japanese groupies persue.  Truth be told, a person can like, and even love, a language without fitting such a mold.  I prefer not to deign to any insulting level, though, so I shall move on before my tounge starts cutting people.

My wife speaks japanese.  I’ll leave it at that.

Each week I read a blog by a japanese woman named Miko, who has a talent for posting just the sort of stuff that I find interesting… it’s not the web-log (blog) of an uber l33t hackzor with an anime collection to rival those that I would insult in paragraph 1.  Instead, it’s a normal person with normal experience, yet who finds fun things that are (in reality) little jewels of interest.  I think the blog is great :)  

http://en.challenge-coin.co.jp/blog/

Enjoy, if you choose to so do.





Windows Hyper-V Server 2008: Part 1 Clarification

12 11 2008

So, the trouble with “Hyper-V Server 2008″ is that it, by nature, is pretty much a free version of one of the full/pay editions of the stripped down “Server Core” versions of “Windows Server 2008 with Hyper-V“.  In fact, it is so much like a server core version, that I’m just going to classify it right now as part of the server core family.

What are the implications of that accusation?  Well, for starters, don’t go expecting to be able to use Hyper-V from the local machine.  The concept of a server core is that it runs and runs and does its job like bread and butter, but it can only be managed remotely.

…And?  you ask.  Managing it “remotely” means that your Server Core can only recieve user interaction from another computer.  This includes installing OSes on top of Hyper-V, and also running those OSes.  In other words, even if you use a nearby computer to install the OS and do the basic setup, the computer that Hyper-V is installed on is now dead in the water if you expected to use the machine locally.  Even though Hyper-V is running your Virtual Machines, there is no way to connect to those VMs visually while sitting in front of your Server Core.

So, if you were a misled hopeful of Hyper-V’s application to you as a virtualization groupie for your sweet desktop at home to run Windows Vista and Ubuntu side by side, then I’m afraid you’ve made a blunder :)  There will be no Visbuntu for you, laddies.  Your only other options are to download and crack up one of the full versions of WS 2008 w/Hyper-V (so that you have a GUI and the management tool right there on the local machine, thus allowing you to run your VMs and interact with them locally) or, alternately, you could use the free edition of VMware Server (I’d recommend 1.x, since version 2 got a little goofy with the interface– it’s webbrowser-based only) or something free like VirtualBox, by Sun Microsystems.

For those of you who want to press forward, you’ll find only minimal documentation on the matter.  You’ll be adding Windows Firewall rules from the command line, etc (the Windows Firewall is on by default in a Server Core installation, and there’s no easy GUI to turn it off with).  And make sure you’ve got a copy of Vista with Service Pack 1 on it.  You’ll need it to do the remote management, once you’ve got the Hyper-V configuration done.





Windows Hyper-V Server 2008: Part 1

27 10 2008

As I’m sure some of you geeks out there know, Microsoft released Windows Server 2008 recently.

Here’s the Wiki on it: http://en.wikipedia.org/wiki/Hyper-V

To ‘wow’ us all, they released a free distribution of it as well, specifically called “Windows Hyper-V Server 2008“.  This is different from the other versions of WS 2008.  How?

Let me explain.

Windows Server 2008 with Hyper-V (not the free one) comes in 3 flavors: Standard, Enterprise, and Datacenter.  But let’s be honest; when does Microsoft ever just release fewer versions than we can count on our hands?  Here’s the real product list, for those of you interested.

If you’re reading this, I’m going to assume that since it’s only been a short while since Hyper-V has made its début, that you already know what the benefits to using it are, and thus you’re Google searching like crazy to figure out how to make use of the free version of WS 2008 and to utilize virtualization “on metal”, as it’s being called; virtual machines that run on hardware emulation instead of just software codebases.

So how do I set it up? you might ask.  After you install Windows Hyper-V Server 2008 (the free one, which I shall generally refer to as “Hyper-V” from now on.  Blast MS and their mile-long titles.) you’ll quickly notice that although it comes loaded with enough libraries to run a basic Vista-esque welcome/login screen, you’ve got nothing but good old cmd.exe to work with.

Here are the basics about what you’ll need:

  • A 64-bit processor is a must for Hyper-V.  Although remote management tools come in x86 (32-bit) and x64 versions, Hyper-V itself will only let you use a x64 processor.
  • Hardware virtualization is also a must.  That’s a hardward thing, of course.  You either have it or you don’t.  If you don’t, Hyper-V won’t be allowed to visit your box.
  • DEP (or, Data Execution Prevention) will also be a requirement.  I’m not going to bother explaining what it is.  You’re computer needs to have it.

To test your processor, I *HIGHLY* recommend using SecurAble (click for the download), a tiny little download that will tell you very directly if you have all of the above things on your processor.  For extra information about what each of these 3 attributes are, just visit http://www.grc.com/securable.htm for details.  Keep in mind that if SecurAble tells you that you don’t have Hardware Virtualization or DEP, you might just have it disabled in your bios.  Just restart you computer and at the first little graphic, start wacking F2, F10, Del, or some other hotkey to get you into the bios options.  Enabling either of these options won’t damage anything… it can only help!

For Linux users, SecurAble also runs under Wine or Crossover, so you can download the tool just like anybody else.

Chances are that if you’ve bought a decently new system in the last 6 months, you’re running 2/3 of these things already.  I tend to think of DEP and the Hardware Virtualization as a 2-for-1 deal.  An x64 processor would almost surely have these things, assuming you didn’t buy your box from a cheap vendor.

So, let’s move on.

This is how to get it running:

  • Download it.  It’s 900-something megabytes, so no CD is going to do the job.  If your computer doesn’t have a DVD drive on it, then your box likely is a little too behind the times.
  • Lauch the DVD.  If you’re only experimenting, the last thing I’d do is nuke your system to install Hyper-V.  Try it on a single partition first.  Dear goodness don’t nuke the whole system yet.  This is hardly a robust process.  I’m going to assume that you’re taking my advice:
    1. You could run the installer from your existing operating system, and just install it to an empty partition.  If you do this, then I guess you won’t need to burn it to a DVD.
    2. Alternately, you could boot from the DVD, which will eventually ask you for a partition to install on.
  • Install Hyper-V.  It doesn’t take very long.  After all, it’s what we call a “server core“, not the full-blown product.
  • Start up the computer in your new “Windows Server 2008″ installation.  For me, I deleted a Linux partion and consequently nuked my GRUB bootloader.  Windows OSes always overwrite the bootloader, which is normally bad for Linux; it orphans the partition and you have trouble booting up into it.  For me, the new bootloader installed by WS 2008 was a good thing, since it restored my options to boot the computer!
  • Log in with the “Other User” account.  This was confusing for me at first, as there was no default account to log into.  All you have to do is log into “Other User” with the username “Administrator” and a blank password.  It will welcome you and tell you that you need to set a new password.  Leave the original password field blank, of course, and then type a new password twice.
  • You’re in! Hyper-V will tell you for an unusually long time that it is “Preparing your desktop”, which is extra odd since there is no desktop in a “server core” version of WS 2008, which Hyper-V is.  Eventually you’ll get to see two things:
    1. A command prompt, which is in the background.
    2. Another glorified command prompt, running the built-in utility which can be accessed from any command prompt by typing:
      hvconfig

Now, as promised, Hyper-V is running.

So how do I install operating systems on top of Hyper-V?

Good question.  The process can only be performed remotely, via a “Hyper-V Remote Manager” update found on Microsoft’s download pages.  The program is downloaded as a standalone windows updater.  It is only available for Windows Vista with Service Pack 1, though they offer x86 and x64 versions of the utility.  Hyper-V itself will be running on x64 architecture, however the remote tool can be in either version.

Here are some links to the Hyper-V Remote Manager tool, and a couple of documents about setting up Hyper-V.  I’ve downloaded these files and uploaded them here.  I found broken link after broken link finding these things, so I’ve posted them here.  These were up to date as of the time of this post.  Note the “.jpg” extentions.  Remove those.  WordPress only lets me upload visual media ;)

The links look broken.  They’re not.  WordPress thinks that they are images.  The x86 and the x64 versions of the Vista remote manager tool need an “msu” extention, while the other two are information documents that had a “docx” extention.

The annoyances you will face will be covered in my future posts about this process.  Trust me.. you’re far from happily running your favorite OS installations side by side.





Music

5 08 2008

I’m a muscian, normally, but I’ve been on holiday as of late, since I no longer have a guitar to work with, and my sound board is far far away.  I moved to Utah a few months ago, and I don’t yet have all of my stuff with me.  *sadface*

I had been doing some songs to put together a CD I was calling “What Have We Done With the Keys?”  The tracks I have recorded (at least in part) are as follows:

  1. Maudit
  2. And You’ve Gone and Told Love’s Secret (You Fool)
  3. Lock Down, Move On
  4. Acutally, ‘Sorry’ Wasn’t the First Thing that Came to Mind
  5. Aspirations
  6. The End of Tribulation
  7. Thievery Sends its Best Regards

Other tracks have been “in the works”, so to speak, but without my tools, I can’t build anything of any use.  That last track, “Thievery Sends its Best Regards” was done in FL Studio, since I don’t have my actual instruments.

Check out my music page a BandAMP.com for the whole song listing page.  It’s a nice little forum-based community.  My songs are set to only allow members to download them, but signing up is drop dead simple, and you won’t get a shred of spam from them.  I helped build up the site, I know 8)





Finite Dreams 0.1.23

5 08 2008

I’ve recently taken on some 3d programming with a set of libraries called “panda3d“.  They’re quite nice, and I’ve been impressed with it all so far.  The main interfacing language is Python, although many of the libraries themselves are written in C++, for speed’s sake.

Ever since (about) highschool, I had this vision of creating my own RPG.  Originally, my naive idea was to make a sequel to the beloved SNES game Chrono Trigger, but then it hit me one that day that…

A) I’d be an idiot for trying to make a “sequel” to a copyrighted video game produced by a largely successful company based out of Japan

B) I felt silly for trying to be “new” and “on the edge of discovery” while only (at best) attempting to extend the ideas of a genius other than I.

C) You don’t just “make a sequel” to your favorite video game.  That’s childish.

While all of the above sound pretty similar in nature, all three hit me differently, and I ultimately decided to completely redo the “story” that I had invented.  I had been drawing characters for use in the game for a long time, yet I still decided that even those needed a make over.

And over the next 3 years, the idea for Finite Dreams (FD) had been in the making.  (The name is kind of tentative, since I came up with it a while back, and I don’t think that I like it much anymore.)  Games from all over the spectrum (a few of the more relevant examples: Kingdom Hearts, Dark Cloud 2, and Final Fantasy XII) had developed ideas at the same time as myself, and I constantly found myself playing a brand new game that had come up with my ideas before I had.  *grr*

But now, I’m creating “my” game.  I’m not recreating someone else’s ideas, or implamenting them differently, or even doing them “better” than in some other game.  I’m making my own ideas, and it’s coming along nicely…  Unfortunately for me, I had to begin learning Python, but now I love it.  It makes me *hate* Java all the more.  *shudder*  ooooOoooOOOo, Java, how I loathe you.  But the guys at work hear me rant enough about Java, so I shan’t do it here.

I’ll be sure to post some actual content eventually.  For now, I’m getting the engine up and running.  While I’m a one-man team, I do hope to make some good progress, even if it takes me ages.  I’m an artist, muscian, programmer, modeler, and storywriter, all wrapped up into one.  I love every single one of those elements.  I can’t wait to hit every milestone along the way.