Nav: (Display/Hide) - Home - About the Author / this page

Current Projects: Americana Engine (Game Engine Development)

Friday, June 25, 2010

Music Sorting Challenge

#130E: Create an algorithm that sorts a music library in a hard drive. (Goal Completed, but decided to manually sort)

EDIT 2: Found out that when exporting the directory list from the command prompt to a plaintext file, it won't export special characters correctly, which explains why some files were left in the root directory. Proof: Inputting the text output back into the command prompt produces an error. Sorry, didn't put quotes around it in this image, but the same error occurs when you put it in as well.

EDIT: With the knowledge of the command line based "move" command the rename operation can be skipped altogether. Both renaming and moving it to the correct folder can be done in one step. The music files to sort still needs to be moved to a separate folder for it to work. (Note that I added parentheses around the folder; when you sort by name the folder appears at the top of the window.)

Note: Pictures to be added later.

For those that noticed that the supposed name of the hard drive for this goal was leaked, yes, that is the descriptive name of the drive, but the proper name is KE MHD. Wonder how that would fare had I brought the drive to a friend's house... it has happened once with my flash drive.

As for the algorithm, I managed to complete this. But creating an algorithm doesn't do anything. In the real world, results are needed. I was given a set of 25,000 (yes, 25 thousand) music files all in one directory and I've been tasked to sort them into folders to make it easier to browse. Plus, give them shorter file names because even though a file can be long and have all sorts of descriptive information, it can run into problems when moving them into other folders, particularly experiencing an error if the path length goes above 255 characters.

So I got a copy of the files (no messing with the originals) for processing.

First thing's first. Since it'll take a long time to code that algorithm, I decided to do a generate filelist script and then import that into excel, adding and stripping tabs as needed. I used Notepad++ for this job since it updates the filelisting whenever it changes. My filelist script is as follows:

cd %1
dir /a:-d /b /s > "C:\filelist.txt"
This is placed under the folder context menu. It essentially generates a full pathlist of each of the files in the directory. Note: the 'cd' command first to get into the directory that was right-clicked on. And now, to rename the files. Due to the way the files are named, I generated an algorithm for this specific set of music files; your results may vary. The steps I took were:
  • Prior to doing the below procedure, ensure that you have the music files in their proper artist/album or compilation album folder. If it's a compilation album, the order is typically the track number first to get the correct order when sorting alphabetically. If it's only one artist, then the artist comes first, then the track number. It's helpful when you copy some songs into another folder (examples: flash drive or movie making), where you can identify the artist and song easily.
  • Generate the filelist (this is the full directory, which is necessary when renaming files from the commandline)
  • Take the filelist and copy it into a section into Excel
  • Replace the dash with a tab. By doing this in notepad and copy-pasting this separates the different values into separate cells making it easier to manipulate them.
  • (Optional) Replace the backslash with a tab. Then when you import it in excel, it's easier to remove.
  • Put the artist, track, and song in their respective fields
  • The track field, on custom cell properties, use 00 (it will force two digits to be displayed, 9 becomes an 09). Although Windows orders it correctly if the track number's first without the leading 0, the order will jumble if the artist name is first.
  • Copy the entire excel cell field range, paste into notepad, remove all tabs, save as a batch file
  • run the batch file
  • mark the folder as 'compressed' and repeat (optional, used for marking which folder is done)

Of course the list is quickly hand checked for misalignments because there can be a few exceptions to that rule where the fields are misaligned and the script won't work properly. (such as if the album had a dash in it, or the song did, etc.) The 'compressed' option is used for labeling purposes to mark which ones have already been processed (if I need to resume at a later date).

Later on, I found that they could be grouped into two folders: Compilation Albums and Single-Artist Albums. With that in mind, the only step to take was to put the songs in their proper folders and rename them all at once.

Approximately five days later, The goal was finished. However a few more days were spent correcting a few errors.

Wednesday, June 23, 2010

Fantasy Wedding


Source: Ray Vaughn Photography

What’s more of a fantasy than a wedding with Disney theme songs in a forest setting with a minister who talks similar to how it would be in a comedy movie? This one. It’s real.

Taking place in a forest in California, this wedding was one of the most unusual that I’ve videotaped… a large forest instead of the urban setting of churches and buildings. I face all new challenges in this place.

It goes to show that you’ve got to adapt to various conditions, various delays, etc. But in this place, it took this to the extremes. Really rough terrain forces everyone to wear tennis shoes instead of more formal ones. The entire event takes place outdoors. Because it went way into the night, only torches and few lights from buildings were able to illuminate the dark forest. Even the road to get to this location was winding and took driving skills to the extreme.

Now that I’ve learned how to master this setting, it makes those traditional weddings seem… more easier…

Saturday, June 19, 2010

Overprepardness

77. Visit at least 30 major malls in California. (6/30 - Capitola Mall)

I realize that it can't hurt to be overprepared. Especially on an important job. I managed to get everything with just 10 minutes of power left to spare, but I need to ensure things like this don't happen again.

On the other side, however, I realize that the '25 things' on Facebook is starting to pop up again. Just for fun, I decided to make that 25 list, which will be revealed when (and if) someone decides to tag me.

Third thing: Anticipate what interviewers are going to say. When they pull a fast one on you, it could mean the difference between a job and no job. That'll be important.

What I don't like about overpreparing: More stuff to carry around. Especially travel games, puzzles, etc., which take up more space that could be used for other important things.

For the goal: Prepare how you're going to get to your destination. Nothing's short of missing an exit and having to drive through 20 or so miles of forests at night to find your way back.

Wednesday, June 16, 2010

Way Up North

#88. Don’t listen to music for one day. (Goal Completed)
#136E. Visit 10 Museums. (2/10 - Turtle Bay Exploration Park)
#200E. Hang out with someone on the like list. (Goal Completed, it was actually completed months ago but was overlooked. Multiple occurrences were also counted.)
Changed: image for Day 1001 Project
Goal Edit: Gave Goal #11a another try (but if I don't succeed a second time, the goal won't be the only thing I will lose...)

Liking someone hurts. Especially on someone whom you can't reach using any contact method. I needed to find some time to figure things out. Perhaps I'm working too hard. So I headed north. Way up north.

I reappear at Redding. That was my next trip. Three days and a few hundred pictures later, I managed to get through a few additional goals, and to change a few. I realized that I have concentrated too hard and overlooked a few things. Perhaps, I should give myself another chance.

Both the Sundial Bridge and the Shasta Dam are both recommended to see as they're both free. Turtle Bay, however, requires a bit of money, but it's well worth it.

Sunday, June 13, 2010

Jackpot Runner, Round 1

15. Reach 400 total friends on any site that counts friends. (Goal Aborted; couldn't add friends fast enough and was unable to catch up with the number of friends that she had. tsk tsk)
#77. Visit at least 30 major malls in California. (5/30 - Mt. Shasta Mall)
33. Win at least 2,000 tickets in one session. (Round 1 over, with a score of 500 tickets)

Yes, there are rules even to my goal list that I didn't even know about. Even I can't keep myself well informed. (I do know that I still have one more chance to pass the latter goal, however.)

Round 1. Apparently with a huge load of tokens, Chuck E Cheese's wasn't worth enough. Nearly all of the tokens for this place was used, scoring less than 500 tickets. Of course, I'm not the only one shooting for that goal. Another group of people are pursuing this exact same goal (and 'failing' at that task as well).

Short review: Jackpots are not worth as much as others (the most you can get is 100, and you can call that a 'bonus'. There is a 500tix one available, but you need at least 12 tokens to do this). In addition: the food service is less than satisfactory. No one occupies the entrance, preventing us from entering for some time, food takes much longer than usual due to an error, despite the fact that it's not busy, prizes are waaay overpriced that you'll be bound to rely more on the cash to ticket conversion system than winning it. And the prizes are rather sucky too.

In the end I came out with two bottles of playdoh and one lamb koosh ball, which came too late; no one's interested in that anymore, and it wasn't a plushie either. It not the same. Oh well.

Wednesday, June 9, 2010

Goal 33 Prep

#33. Win at least 2,000 tickets in one session. (Preparing)

After doing some cleaning, I manage to find some tokens for use in arcades, etc. such as Boomers. Used to go to them years ago for some fun and birthday parties, but now in these times, it's serious business, especially when prizes these days are starting to become hi-valued, such as an X-Box sitting in the list of prizes to grab for a mere 15,000 tickets, or a Wii on the list of 'Big Prizes' on the Stacker arcade game.

It’s not just a few tokens... it’s more like a lot. At least $50 worth of tokens to be exact. And more than half of them are useless because the arcade itself that accepted those tokens closed down, and there are no more of them in existence. Also, those tokens don't have any cash value, so tokens can't be traded for anything. (It doesn't apply to tickets, though, since they buy prizes, and they apparently have cash value at Chuck E Cheese, where you can buy in 100 tickets per dollar.)

Also, I gotta use those coins up, because in these times, entertainment places such as John’s are switching to cards, making those coins useless. The only exception to that rule are those games that still require coins to operate, but it still limits choices.

I’m ready to start this goal.

Monday, June 7, 2010

Encountered Before

#139E. Encounter "eejayy". (Goal Completed)

EDIT: Skipped verification because I do not find a second physical encounter occurring anytime soon.

Found a picture for proof, and another goal completed.

But that picture was taken 16 months ago, February, last year, during the parade (This is Key Club from the HS I previously went to). Wait, how is that possible?

How come I didn’t notice that before? ‘Cause I wasn’t paying attention, probably.

You take pictures, and you usually don't have time to notice some people in the event until it's over and you look at your pictures afterward. But fast forward. You make new friendships, head to college, and then when you look back at your old pictures, it’s the “Hey, I know this person!” look, as you recognize people you previously haven’t noticed before.

It has occurred many times to me; Some people on FB added me as friends because they knew me; they said we were both in the same class back in elementary school, but I failed to notice that. And I looked back. Indeed we were.

I've got some time to burn so I'll try to look a bit more... see what I've missed back in the days, and to find more answers.

(To not single anyone, I recognized four other people that I didn't initially catch the first time around a year ago.)

Wednesday, June 2, 2010

Serious Gaming Pt 2: Torchlight

Reach Level 99 on Torchlight. (Goal Completed, but level 100 was the highest level.)

I think there was a Serious Gaming pt 1 (Bejeweled Blitz) but I'm covering the other games as well with the second Goal List focusing more on game achievements.

Part 2: Torchlight. It's a lot similar to FATE and the Diablo series, and I noted a couple of things while playing the game to get here:

  • I tried out Alchemist later: Ember Lance: a lot of people say it's rigged given the fact that it kills a lot in one shot. I tried this class to test it out. Yes, it's powerful, but doesn't have as much power as any melee attack, etc. and it sucks a lot of mana. On the last boss on Hard Mode, you can't even hold your ground.
  • Vanquisher: Didn't try yet. Will test some time in the future.
  • Destroyer: Tried first. Learned that the last ability "Devastate" was probably one of the most powerful abilites that I've ever used.
    • During my playthrough I also leveled Dual Wield, Martial Weapons, Block and Parry, Frost Shield, Adventurer, Defensive Spell Mastery, and Armor Expertise to max level, with Haste, and Heal being used as side abilities. Towards level 99 my damage went into the five digit range. The Slash attack was developed first because it could hit multiple enemies with both weapons, then dual wield, then criticals, before focusing on the weapon/armor bonuses.
    • Devastate looks overpowered because it doesn't really use up a lot of energy if done correctly. And it does damage based on weapons equipped.
    • Enhancer is scaled based on level, can be used to level up even low level equipment to a reasonable level for the next playthrough (eg. 600+ dps for a no requirement weapon). Very helpful to get through the game even faster.
    • Fame was capped at level 55.
    • Grabbed the Identify spell early in order to avoid the continuous use of identify scrolls.
    • All sidequests in the main storyline were completed.
    • Many Map Portals were used to level up the character, with the realization that killing champion units can raise the XP bar by as much as 29 percent, and can be defeated in a short amount of time (power leveling). The rest of the leveling was done in the Shadow Vault (bonus dungeon).
    • Level 100 occured within 15 hours game time.
  • Unrelated, but the Torchlight Help Manual's metadata says "FATE User Guide" in the document title.