Wednesday, April 30, 2014

Test for Obvious Features

I just downloaded and installed ICY Hexplorer, a free hex editor/viewer/manipulator/analysis thing that the Malwarebytes blog authors seem to like. When I opened a file with it, I got something like this:


Yep, the menus indicate that it has the awesome features the Malwarebytes analysts were using. But... it's super zoomed out. (That's how it was when I started it.) I can't change it. The help file doesn't mention zooming. People on the internet haven't figured out how to zoom. Apparently it displays at a legible scale for some people, but not for me or the other poor people on the internet asking about it.

How is it possible that something great like this could be released without a key feature like zooming? The answer is lack of beta testing, probably. The author, though obviously good at what he does, didn't check to see what other people would do with it or what might happen with other resolutions or display settings.

Moral of the story: have other people check your programs on other computers to make sure that obviously necessary features are present.

Monday, April 28, 2014

Success in the Land of Windows 95 VM Creation

In the last post, I lamented the difficulties of setting up VMWare Player to simulate Windows 95. Today, I have succeeded. I gave up on the DOSBox idea, but I found a link to a bootable floppy image from an amazing article/tutorial. I mounted that as a floppy drive in VMWare, kept my Windows 95 installation CD in, followed the DOS to 95 upgrade instructions from VMWare, put in my OEM key, and had Windows 95 setup going! Of course, I forgot to follow the instruction that said "critical!" and therefore butchered the Ethernet drivers and a bit of other stuff, but it seems to boot into 95 fine.

So, to recap, this is what you need to get Windows 95 running in VMWare:

  • VMWare Player
  • Windows 95 setup resources CD
  • DOS boot disk
  • Windows 95 product key
I'll redo the setup following the instructions properly tomorrow, but for now, I am very happy.

Sunday, April 27, 2014

Mysterious MS Access Printing Failure on Report Display

While working on an assignment for an advanced-use-of-Office-applications class, I ran into a very weird bug/mislabeling in Microsoft Access. If you use the OpenReport method on DoCmd without specifying the second paramater (which is technically optional), it will produce a message saying something like "Microsoft Access couldn't print your object." That's really weird, considering that displaying reports has nothing to do with printing anything.

The solution? Supply the second parameter, the view type. I used acViewReport and everything worked great.

Saturday, April 26, 2014

Trying to Set Up a Win95 VM

I learned today that it is more difficult than I thought to create a VM to run Windows 95 applications from a given hard drive. I need to get some old programs running, but keeping the 95 computer around is not a good option.

First, I tried ISOing the entire driving and putting it in VMWare Player. It did not work; no OS could be found. From further research, I learned that you need installation media to start a VM; boot info cannot be obtained from just the hard drive contents.

Next, I looked around for some Win95 install disc ISOs. IMG files don't work, only ISOs. Unfortunately, the only ISOs I could find on the Internet were identified as malware or had other problems that rendered them unusable. Looks like I'll need to find a real CD for 95.

Once I have that - which I don't yet - I'll be able to establish a VM from it and mount the drive image I made as a separate hard drive from which to read data.

Thursday, April 24, 2014

FMod - No Metafile

I know I've been saying for a while that I need a metafile format for Abiathar to make everything better, but I will not. I have changed my mind, sentient beings can do that.

Instead, I have figured out a very simple way to get around the issue of directory nonportability: use the residing directory of the binder instead of something recorded in that file. That line will remain in the format and will be saved, but ignored when opening (this is to maintain compatibility with old versions).

To deal with binary resources, I'll just add another file. I realize this may not be the most optimal solution, but I am not a big software company and, to be honest, wrangling a few files is not that hard. I'll still be able to have a "compile" command, which with this strategy might also have less redundancy that it would with a giant metafile.

Tuesday, April 22, 2014

Ingredients for a Chess Engine

I've been fantasizing about starting to write a chess engine based on human-like thought processes, not brute-forcing move trees like normal engines. I obviously don't have the time for that, but I did think about some essential modules and code fragments that might go into it. If anybody wants to write such a thing, here's a good place to start? I imagine starting out with it just picking a random legal move.

  • Board class
  • Move struct
  • IsLegalMove method
  • IsInCheck method
  • GetAllLegalMoves method
  • GetPieceMoves method
  • IsAttacking method
  • IsDefended method
This clearly is not very thoroughly thought out. Hopefully, for the sake of my sanity, this won't turn into a project.

Sunday, April 20, 2014

Old Hard Drive

I just found my very first hard drive, the one that traveled across at least four computers, starting at Windows 95 and ending with XP, finally coming to rest in a dusty, unused computer at least three years ago now. It contains memories - in the form of half-baked programming/modding projects - from the first ten years of my life.

I am really excited to find this. As I type, I'm copying all the things (besides Windows system files) to my modern hard drive. Already, I've found a modding project I was really excited about but couldn't finish due to lack of a decent Keen: Galaxy level editor. Years later, there is one, and it's by me. That one might actually get finished.

There's "temporary" stuff that turned out to be not so temporary, extracted things from the Keen community, the classic K:M tools from the appropriate time period, a lot of strange files I'm not sure about, and generally lots of awesome stuff that I didn't really care about until I found this drive. It's possible that it also contains that one anthology of old DOS games I messed around with for hours on end.

This find is so awesome I might do a YouTube video about it. :)

Friday, April 18, 2014

Fixing the VideoPad Audio/Video Corruption Glitch

Today, while recording the newest LP video of KeenRush's Episode Smile, I stumbled upon a really nasty - yet minor - glitch in NCH VideoPad, the editor I use to put stuff together. The last time I tried to record such things, I misconfigured my microphone, resulting in blank audio. This time, I ran a better sound check before going ahead with the full recording.

To my horror, the clip again had blank audio - and also blank video for the last 30 minutes (which was super weird because I only recorded for about 15). Fortunately, though, the other three clips of roughly equal length I recorded were fully intact. This got me thinking, and I noticed that (due to OBS's naming method) the butchered file had the same name as the last one to receive butcherage. It also was able to be loaded a lot faster than the others.

I then went into Windows Media Player to see whether it could play the file. It did, with audio and all, finding the correct length. Renaming the file fixed the problem in VideoPad. Apparently, it caches video files by file names for quick loading in other projects, storing the data in some shared database. It could be easily fixed by adding a check for file size or date modified.

Long story short: If VideoPad is loading messed-up versions of your video clips, try renaming them to bypass the cached entry.

Thursday, April 17, 2014

Windows 8 Power Button!

I received the biggest non-service-pack update ever yesterday for my Windows 8.1 Pro computer. Two restarts after the massive 900MB download, I noticed something really amazing when I logged in:


That's right, folks. Microsoft has brought back the power button in Windows 8. Personally, I don't know why they hid it away for so long - it was almost impossible to find before this update. Well, now I can get rid of the third-party application I installed just to give me a convenient power button!

Wednesday, April 16, 2014

FICS Server Source

I recently had a brilliant idea that will probably be kept secret for a while. For it, I needed access to the source code of the FICS server. I wasn't able to discover the source used to create the current version, but there is a version from 1994 available that has all the basics, which is really all I want.

You can get it at their FTP site. Only one of the files there is usable, one is 6MB and throws an FTP error when accessed. It's a tar/gz file, so WinRar or 7zip is necessary to access it. It contains a whole bunch of stuff written in C; the interesting parts are in FICS-distrib.

1994 FICS source

Please note that, as it is released under GPL, you must provide any modifications to the source upon request. (The current FICS admins are technically violating this stipulation; the current version has changed hands a few times.)

Tuesday, April 15, 2014

Uploading Images to Google Maps from iPad

Here's another thing I found that makes me very upset. There is no straightforward workflow for getting a picture from an iPad onto Google Maps as an attachment. Instead of allowing you to upload a picture like any sensible thing that allows you to have pictures at all, Maps requires that you post a link to a public image file somewhere. Fine, I'll just... wait, what? How can I get a picture public from an iPad?

My first thought was to use the public folder in Dropbox. I have a Dropbox app, and a public folder, and a way to get pictures into the Dropbox public folder. Therefore, I have public picture files that Google will accept. Simple logic, yes? Nope. The link produced by the Dropbox app when I ask it to give me a public link is some sort of weird private sharing key that isn't really an image and therefore not acceptable by Maps.

Alright, I'll get this Google+ app thing and put pictures in it and then presumably Google will let me add an image from one of my albums because it is in fact my album. I can get to the Photos section in the app, and I see every photo I've uploaded to my blogs, but there does not appear to be a way to actually add an image.

I give up. I connected my iPad to a computer, which can actually do things on the Web.

Thursday, April 10, 2014

Access Macro Designer Needs AutoComplete

Those who work with Microsoft Access frequently know that it has a somewhat special macro system compared to the other Office applications. The default is a visual designer, allowing the user to insert control flow structures and some other common programming-ish tasks. Something common when creating advanced databases is the display of message boxes, such as confirmation dialogs.

The visual macro designer makes this incredibly difficult. By not having VBA-like autocomplete, it makes the message box property constants essentially inaccessible. (In fact, I'm not even sure if it accepts the textual constants.) To create a confirmation dialog, the macro writer must enter the numeric constants - which, in addition to being almost impossible to remember, need to be mentally binary-OR'd together to combine attributes (like having Y/N buttons and an exclamation icon).

That renders the macro designer considerably less useful. Please, if you require numbers to be passed as arguments and don't want to use a bunch of Boolean arguments instead, give some autocomplete functionality or at least provide a way to use mnemonics.

Wednesday, April 9, 2014

HigherPower - Oh, Right

While in the car today, a realization struck me concerning HigherPower's increased world generation time. (In the middle of all the crazy busyness going on in my life right now, I don't have time to actually write about important things here.)

A configuration file option tells the HigherPower world generators how many ores of each type to place in each chunk. If I remember correctly, 200 Fleexium and 2 Eethur ores are generated per chunk. It doesn't take a lot of time to pick 200 random locations and try to put an ore block there - but what does take a lot of time is continuing the pick random locations until 200 blocks are filled with ore. This takes even longer for Eethur, which has extremely specific spawning conditions.

Now I feel somewhat silly. Instead of trying to generate a maximum of 200 ores per chunk, I'm forcing it to place all 200 somewhere. With the 1.7 world generator bringing a lot more variety in the underground block types, this resulted in a huge slowdown for HigherPower, which only places its ores in regular stone. I suppose I'll soon be changing the code to use a maximum of some higher number.

Mental program optimization! Gedankenexperiments!

Sunday, April 6, 2014

HigherPower - Network Time

Well, I decided it's finally time to look at some Forge tutorials and get HigherPower's custom packets and network functionality back together. Getting the infrastructure for it set up was a breeze; I love Netty! I still need to figure out how to actually move my data into The New Way, but I'm guessing NBT serialization hasn't changed terribly much.

Instead of doing what I planned to do, I tested some considerably less related stuff. The Furnace Sensor, one of the most difficult things to implement, surprisingly didn't have any huge problems. It did cause a crash, but that was because I had some something obviously silly with Block objects that caused a null pointer exception. After repairing that, the sensor worked just like before. (Even the incredibly inconvenient GUI continued to be inconvenient!)

The Lawn Mower, possibly the most hacked-up glob of code I've ever written, is another story. For some reason, it decided to pull stacks of pumpkin seeds, redstone torches, and various flowers out of nowhere. Inserting null checks at various places fixed that, but the machine remained the super buggy thing it always had been. While trying to tweak that, I did somehow cause it to create a huge, writhing, expanding wall of lawn mower blocks whenever one started moving. I fixed that and also the old bug that made it not drop its contents when destroyed while moving.

Saturday, April 5, 2014

HigherPower - Legit Names

Today, I continued to clean up the HigherPower code base after the move to Forge for v1.7. This involved much renaming of files and a little bit of JSON file writing.

Really, most of the time I spent was replacing @ForgeSubscribe and @EventHandler with @SubscribeEvent and liberally decorating methods with @Override. More functionality is intact than I expected; even the super-hacked /genhere command still works. The wireless redstone blocks worked almost immediately, except that their Creative inventory icons were rotated the wrong way. There were a few inconsistencies with implementations of _HPBlockContainer versus BlockContainer, but those have all been made better.

It did take me a while to figure out how to fix the PSY music discs. (Those are really important to the mod.) Apparently, SoundManager is no longer publicly accessible; sounds should be registered with ResourceLocation instances and JSON files placed in non-obvious locations.

Advanced data blocks continue to be broken, but other containers with GUIs surprisingly still work. For some reason, it now takes quite a bit longer to generate a new world, but I don't see any obvious performance problems in HigherPower's generators.

Ignoring such issues and instead being upset at blocks having wrong or default names, I embarked on a task of migrating the block constructors to the new string ID system. (It was actually at this point when I discovered the inconsistent class hierarchy.) Now, all of HigherPower's block classes register themselves in the constructor, saving me the hassle of doing that every fourth line.

The recommended way of gathering Nether Noir: a few stacks of glass and a diamond pick

HigherPower - A Huge Mess

With the switch to the Gradle build system and all the changes in vanilla Minecraft that came with version 1.7, HigherPower's code base became a huge mess of errors. I spent a couple hours today going through the at-least-sixty files and trying to get the project to build. Right now, I'm not concerned very much with things actually working; I just want it to run and not crash.

Most of the fixing was just mindless prepending of the letter I onto Icon and IconRegister. There were of course a bunch of things concerning the move towards string IDs, but I just had to change some variable types and some method calls.

What was really terrible, however, was the removal of public iterators in NBT tag objects. (They also, for some unimaginable reason, moved tag names into part of the parent tag's child map. This makes my life considerably more difficult when serializing.) It is no longer possible to just get a general list of all the subtags in an NBT list tag. I can get the number of items in the list, but I can't pull one out without knowing what type of things it contains - the methods are all specialized.

Also, the move to Netty for network handling has totally broken my advanced data machines, so I ended up commenting out pretty much everything about those. I'll deal with that later, once most everything else is actually functional again.

Registering items is mandatory now, so I had to put that registration instruction in the constructor for my items. I'm very happy that I have a class for such things. There are a lot of missing textures, but I can fix that by renaming the files to suit the new style.

Thursday, April 3, 2014

FMod - Consolidate Project

I have decided that the Abiathar project format is a go-ahead. Managing dependencies in a binder file is confusing for new users and mildly inconvenient for advanced users. It is literally the only system in Abiathar that I don't like. So, I'm going to fix it, because that's how I roll.

I took some time today to sketch the IO methods for the Abiathar project file class. The file will contain a bunch of headers denoting types of resources, user-friendly names for managing things in UI forms, and of course the disk representation of the various resources. The goal of the format is to be forwards-compatible, allowing old versions of Abiathar to load and save newer-version projects without wrecking everything. All resources needed to render the levels will be saved in the project file for easy mobility. Paths to reload the resources from can be specified to update them if on a computer with the appropriate files.

Once this format is done, I'll have to totally redesign the Dependency Gatherer. I'll likely end up making it a more user-friendly wizard with some resource management options sprinkled throughout the Edit menu. It might be necessary to get some kind of migration wizard going to move the dependency binders over to project files, but it should be pretty easy to just create a new project file with the edited levels.

This will also make it massively easier for me to add things like palette remaps or custom infoplane icons. Change is exciting!

Wednesday, April 2, 2014

HigherPower - Back to It

The Forge team decided to move to Gradle for code management. Therefore, every modder is forced to use that system, whether they like it or not. Until today, I could never get it to work - there was always some setup error or Eclipse couldn't find the files necessary to run the project. Somehow, everything lined up just right and Gradle built everything smoothly today.

Of course, like every Forge update, the update to Minecraft 1.7.2 broke everything. Literally all of my mod files have some sort of error in them. HigherPower is nowhere close to compiling, and a huge amount of its dependencies in Forge for 1.6.x are no longer extant or have changed names. (IconRegister, I'm looking at you.) Instead of the old way of doing packets, through the Forge networking infrastructure, it's integrated with Minecraft's Netty streams. That might actually make creating advanced GUIs less painful, but we shall see.

Message to Forge team: This is totally unacceptable. I understand you need to get compatibility with the new Minecraft versions, but you don't need to rename everything. Seriously, just a one-character change you made, probably with one keystroke, is going to require me to go through uncountable files to deal with. I had to go search the Internet and ask for help on IRC to figure out that the Configuration class moved namespaces. Your product, even though you don't get paid for it, is in use by hundreds if not thousands of developers around the world. Any minor inconvenience you cause is multiplied by that.

I know what I'll be doing the next few weeks. Isn't forced refactoring fun?