KawigiEdit 2.0 - An Integrated Plugin for TopCoder

KawigiEdit is a full-blown TopCoder Editor plugin with all the features I decided I wanted to have in it.

Among the most useful features in this plugin are:

System Requirements

Installing KawigiEdit

How to install KawigiEdit in 10 easy steps:

  1. Download the latest KawigiEdit jar to your computer (and remember where you saved it).
  2. Start the TopCoder Arena applet.
  3. From the Options menu, choose "Editor". The Editor Preferences dialog should come up.
  4. Click on the "Add" button. A dialog titled "Enter Plugin Information" should pop up.
  5. For "Name", enter "KawigiEdit" (or whatever you want it to be called, it doesn't really matter)
  6. For "EntryPoint", enter "kawigi.KawigiEdit" (this one does matter).
  7. For "ClassPath", hit "Browse" and find the KawigiEdit jar. You should not have a previous version of KawigiEdit in the global classpath (in the text field on the top of the Editor Preferences Dialog).
  8. Once those are entered in correctly, click OK.
  9. If you want KawigiEdit to be used as your default editor, check the "Default" box next to the new entry in the table. I recommend setting it as your default editor, of course.
  10. Click "Save". If you get errors here, make sure that you are absolutely using Java 1.5, and that no previous version of KawigiEdit is in the classpath, and if that's all in order and you're still having problems, contact me personally or see if you can find anyone in the arena who knows a lot KawigiEdit.

Now KawigiEdit will be ready to use! Of course, to get the most out of KawigiEdit, you will probably want to tweak the configuration.

Configuring KawigiEdit

Assuming everything worked without any error messages, KawigiEdit is now installed and ready to use. However, it is advisable to do a few more things, to make sure it is all configured correctly for your system (and to your liking).

To configure KawigiEdit, simply select it on the "Editor Preferences" dialog and hit the "Configure" button. A dialog will come up with three tabs for "General/Testing", "Editor" and "Languages".

General Settings

One setting you are likely to want to customize is where on your computer KawigiEdit will save your code. By default, it makes a directory called "testprograms" wherever the applet's current working directory is (in Windows this appears to be your desktop, in Linux it uses your home directory). Use the Browse button or directly enter the name of the folder you want to use. You can also configure here how long KawigiEdit should wait to attempt to forcibly terminate a process it starts.

Testing Settings

Here, you can change the font and colors of the testing console panel. This is where the output from your programs and from the compiler will be displayed when you use the local compile and test features.

Problem Timer

You can use this section to customize how often the problem timer updates, what colors it uses, and even turn the darn thing off. Rest assured that if you turn it off (even if you turn it off with the editor running), it will be removed and the thread it was running on will be killed, so you don't have to worry about it consuming any CPU time. If you like it but are worried about CPU time, just lengthen the update delay.

Editor Settings

Here, you can change the font and colors used in the editor and local code display. This includes syntax-related coloring, like:

You can also turn on or off parentheses (, etc.) matching and specify what color the highlights should be (I recommend a color that is not too much different from your background color) and set your tab width.

Language Settings

On this tab, you configure how to save, compile and run your programs locally. Note that $PROBLEM$ will substitute the problem class name in, and $CWD$ will substitute the current working directory for the run command only. The CWD is not available for the filename and compile command (You may assume that you are in the current working directory). You can also use the Template Override field to pick a .ket file to use as a template for each language.

The default settings should work for most people whose system is configured exactly like mine. Fat chance, eh?

The default Java settings should work beautifully if you have Sun's Java SDK installed, and Java's bin directory is in your default system path.

The default C++ settings should be correct if you use g++, and it is in the path, for either Windows or *nix.

The default C# and VB settings should be correct if you use Windows and have csc and vbc in your system path, or *nix with mono installed and in the system path.

The rule of thumb on these settings is that you should try them out, and if they work, don't mess with them. KawigiEdit has been made to work with probably half a dozen C++ compilers before, so if you're wondering if it can work with yours, the answer is probably yes.

Template Editor

This is the place to edit your code templates, which are parsed and expanded when you open a problem or hit "Generate Code".

The easiest way to get started is to click on "Open Default", and pick which template (.ket file) you want to edit. Change anything you want, and click save (or save as) and you'll be prompted where to save it. After saving, KawigiEdit will ask you if you want to set it as the default template for some language, and if you click yes, you're done! The Template Override should be filled in for that language on the Languages tab.

Using KawigiEdit - A Walkthrough

Here is a quick example of how to use KawigiEdit in the Arena.

Editing KawigiEdit

I included the source to KawigiEdit for a reason - I think that it's a good place to learn things from (both in design and in using the plugin interface), and I don't think it's perfect for everyone. If you are familiar with Java and want to customize KawigiEdit further than can be done through the settings dialog, you can unpack it and start hacking at it. If you find ways to improve it that you think would be useful to others, too, please let me know what you did and how/why you did it.

The standard way to unpack the jar would be to use Sun's jar utility (part of the Java SDK) like this:

	jar -xf KawigiEdit.jar
		

You can also rename it to KawigiEdit.zip and extract it with any program that can extract zip files.

To make the applet use the extracted plugin instead of the jarred one, set the directory you extracted it into as the classpath (rather than the jar). This directory should have a directory called "kawigi" in it (but it shouldn't be the directory called "kawigi").

You'll also notice that this html file, a folder for the manifest, a resource folder, and a folder called "docs" popped out of the jar. In the docs folder, you'll find full documentation of the classes included in the jar (sorry if it's not quite accurate). This may help you to know where to start in changing stuff.

Contact Info

Anyone is welcome to contact me about features they hacked in, features they think I should add, problems, suggestions, etc. Try to keep the "uR pLu61n suX0rZ, j00z sh0uLD uZ3 P0p53di7!" emails to a minimum.