diff --git a/.gitignore b/.gitignore deleted file mode 100644 index f9cb677..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.jar -/com -/lib diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fb1c23e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: java -jdk: - - oraclejdk8 - - oraclejdk7 - - openjdk7 - - openjdk6 -matrix: - fast_finish: true - allow_failures: - - jdk: openjdk6 -install: - - make fetch -script: - - make - - make test diff --git a/COPYING b/COPYING deleted file mode 100644 index 5daf74a..0000000 --- a/COPYING +++ /dev/null @@ -1,27 +0,0 @@ - -The Simplified BSD License - -Copyright (c) 2010-2013, Charles McGarvey et al. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - diff --git a/Makefile b/Makefile deleted file mode 100644 index aceb60e..0000000 --- a/Makefile +++ /dev/null @@ -1,61 +0,0 @@ - -# Use this file with GNU make to compile and package VimCoder. -# Supported targets: all clean distclean dist fetch jar - -project = VimCoder -version = 0.3.6 - -sources = $(wildcard src/com/dogcows/*.java) -classes = $(sources:src/%.java=%.class) -library = lib/ContestApplet.jar -jarfile = $(project)-$(version).jar -resource_path = com/dogcows/resources -resources = $(wildcard src/$(resource_path)/*) - -JAVAC = javac -JAVACFLAGS = -d . -sourcepath src -classpath $(library) - -PROVE = prove - - -all: $(classes) $(resources:src/%=%) - -clean: - rm -rf com - -distclean: clean - rm -rf lib - -dist: - git archive HEAD --prefix=vimcoder-$(version)/ | bzip2 >vimcoder-$(version).tar.bz2 - -fetch: $(library) - -jar: $(jarfile) - -test: all - $(PROVE) - - -$(classes): $(sources) | $(library) - $(JAVAC) $(JAVACFLAGS) $^ - -$(resource_path): - mkdir -p "$@" - -$(resource_path)/%: src/$(resource_path)/% | $(resource_path) - cp "$<" "$@" - - -$(library): - mkdir -p lib - curl -o $@ http://www.topcoder.com/contest/classes/ContestApplet.jar - -$(jarfile): all - rm -f $@ - jar cvf $@ COPYING README.md com - - -.PHONY: all clean distclean dist fetch jar test - -# vim:noet:ts=8 diff --git a/README.md b/README.md deleted file mode 100644 index 55f86df..0000000 --- a/README.md +++ /dev/null @@ -1,389 +0,0 @@ - -Vim + TopCoder = VimCoder -========================= - -![VimCoder Logo](http://chazmcgarvey.github.com/vimcoder/img/vimcoder.png) - -This plug-in makes it easy to use [Vim](http://www.vim.org/) as your -text editor in the [TopCoder Competition Arena](http://topcoder.com/tc). -It aims to be minimal in comparison to other editors such as -[KawigiEdit](http://topcoder.yajags.com/) or -[CodeProcessor](http://www.topcoder.com/tc?module=Static&d1=applet&d2=plugins) -plug-in chains while also providing enough functionality to also be useful. - -Features --------- - -* Works on any platform that the TopCoder Arena applet itself supports. -* Works with any language supported by TopCoder. -* Keeps track of your code files locally so you always have a copy. -* Downloads and stores a copy of the problem statement with your code for - off-line viewing. -* Has support for simple templates (default templates provided only for C++ - and Java). -* Test-case "drivers" can be generated locally with the example test-case data - (currently C++ only). - -Build Status ------------- - -[![Build Status](https://travis-ci.org/chazmcgarvey/vimcoder.svg?branch=master)](https://travis-ci.org/chazmcgarvey/vimcoder) - -License -------- - -This software is licensed according to the terms and conditions of the -[BSD 2-Clause License](http://www.opensource.org/licenses/bsd-license.php). -Please see the COPYING file for more information. -This project is neither supported nor endorsed by TopCoder, Inc. - -Download --------- - -The latest VimCoder jar file can be downloaded from the -[vim.org script page](http://www.vim.org/scripts/script.php?script_id=3321). - -Install -------- - -Unfortunately, installation is a bit cumbersome, but it is what it is: - -1. Download the latest version of the VimCoder jar file. -2. Run the TopCoder Arena applet and log in. -3. Click the "Options" menu and select "Editor" to show the editor - preferences. -4. Click the "Add" button to bring up a new window. -5. For "Name," type "Vim" or whatever you want to represent this plug-in. -6. For "EntryPoint," type "com.dogcows.VimCoder" without the quotes. -7. For "ClassPath," click on "Browse" and locate the VimCoder jar file. The - third field should now have the path to the jar file. -8. Click "OK" to close the window with the three fields. -9. Click "Save." - -You should now be able select "Vim" (or whatever you entered into the first -field) as your editor from the pull-down list on any problem statement window. - -Configure ---------- - -Depending on your preference or system attributes, you may want or need to -first configure the plug-in so that it will work how you want it to. You can -bring up the plug-in preferences window by following these steps: - -1. Run the TopCoder Arena applet and log in. -2. Click the "Options" menu and select "Editor." -3. In the new window, make sure the entry for VimCoder is selected from the - list, and click the "Configure" button. - -![VimCoder Preferences](http://chazmcgarvey.github.com/vimcoder/img/prefs.png) - -##### Storage Directory - -VimCoder saves the problem files and the code you're working on in -a particular directory you can set. By default, this directory is `.vimcoder` -in your home directory. This is an "invisible" directory on most systems. -Within this storage directory are several sub-directories, one for each -problem you open. Each sub-directory is named after the problem identifier -and contains your source code and other files related to the problem. - -If you want to change the storage directory, click the "Browse" button in the -VimCoder preferences window and navigate to the directory you would like to -use. If you have already saved some problems to the previous storage -directory, you may also want to actually move the directory to the new -location so that VimCoder can find the work you've already done. - -Beginning with VimCoder 0.3.5, there is a new option for an alternative -directory structure. It is not enabled by default, but it may be in the -future. Rather than having directories named after problem identifiers, the -new structure uses two levels of directories. On the first level, directories -are named after the contest associated with the problem (e.g. SRM-144-DIV-1), -and on the second level, directories are named after the problem's point value -(e.g. 300). This directory structure may be preferable if you ever want to -browse your repository since the contest name and point values are more easily -identifiable than the problem identifier. - -If this new directory structure is enabled, it will only apply to new -problems. VimCoder will not try to reorganize your current repository, though -you are welcome to do it manually yourself if you would like to switch to the -new directory structure. - -##### Vim Command - -By default, VimCoder tries to invoke Vim using the `gvim` command (or -`C:\WINDOWS\gvim.bat` on Windows). This will typically work just fine unless -you don't have gvim in your PATH (or your installation of Vim on Windows -didn't include the wrappers for the command line). If you get errors about -the vim process not being able to run and no Vim session comes up when you use -the VimCoder plug-in, you need to either make sure the Vim command exists in -your PATH, or else change the Vim command in the VimCoder preferences window -to something else. - -You may use an absolute path to your vim executable, such as -`/usr/local/bin/gvim` or `C:\Program Files\Vim\vim73\gvim.exe` -or wherever your actual Vim executable is. You may also invoke vim through -some other command (e.g. `xterm -e vim` or `gnome-terminal -e vim --`). - -The xterm example above demonstrates using Vim without the GUI, running in -a terminal emulator. You can enter any elaborate command you want as long as -Vim ultimately gets executed with the arguments that will be appended to the -command when it is invoked. After changing this value and saving your -preferences, the command you enter will be used the next time you open -a problem. - -Usage ------ - -To use VimCoder once it is installed and configured, go to a room in the -TopCoder Arena applet and open one of the problems. If you have set VimCoder -as your default editor, you will see the usual problem statement window come -up as well as a separate Vim editor window. Otherwise, you can change the -editor from the problem statement window, and the Vim editor window will come -up. You will see that the area usually devoted to editor will be used for log -messages; you will do your actual coding in the Vim window that comes up. - -Just enter your code into the Vim window and use the regular TopCoder Arena -applet buttons to compile, test, and submit your code. - -**Pro Tip:** If you accidentally close your Vim session, you can get it back -by switching to a different editor (such as the default editor) and then -switching back to VimCoder. Alternatively, the session will also reappear -(and load a buffer to a different source code file) if you switch languages. - -Storage Directory Structure ---------------------------- - -Knowing about the files created by VimCoder is useful if you ever need to do -anything advanced. When you open a problem, VimCoder will check to see if you -have already opened that problem by looking for the problem and solution -files. If these files are found, it will load your previous work. Otherwise, -it will fill out the templates based on the problem class name, parameter -types, and so on, and will create several files in a sub-directory of the main -storage directory: - -##### `$CLASSNAME$`.`$LANGUAGE$` - -This is the file where you write your solution code. If the class name for -the problem was BinaryCode and your language was Java, the name of this file -would be `BinaryCode.java`. When you open a problem, Vim will load this file -into a new buffer so that you can start coding. If there is a template for -the language you're using, that template will be used to fill in this file to -give you a reasonable place to start. When you save your code to TopCoder or -compile remotely, this is also the file that will be read to provide the code -for your solution. - -##### testcases.txt - -This file contains the example test cases that are associated with the -problem. The format is pretty simple. For each test case, there is one line -for the expected return value followed by the inputs (i.e. the method -arguments), in order, each on its own line. The format of this file is meant -to be easy for a human to write and easy for a program to read so that -a driver program (more on this later) can easily be written to run the test -cases against your code. - -While you are coding a solution, you may want to open this file in a new -buffer (type ":e testcases.txt") and add additional test cases to make sure -your code doesn't mess up on edge cases for which an example test case was not -provided. - -##### Problem.html - -This file contains the problem statement which is what you see in the top half -of the problem window. You can load this in a browser to read the particulars -of the problem when you aren't running the TopCoder Arena applet. You -typically shouldn't edit this file, but it's up to you. - -##### Makefile - -If there exists a Makefile template for the selected language, it will also be -filled out and saved in the problem directory. The purpose of the Makefile is -to compile your code locally. You can execute targets in the Makefile using -Vim's `:make` command. You also shouldn't need to edit this file directly, -but of course you can if the need does arise. Exactly what happens when you -use the `:make` command depends on the Makefile template. - -If you are using the default Makefile template for C++, typing ":make" without -any arguments will compile your code. Typing ":make run" will run all of the -test cases against your code. Typing ":make test" will also run the test -cases against your code, except it will abort at the first failed test. - -A Makefile template is not yet provided for any other language, but you can -write one yourself if you are so inclined. Read on to learn how templates -work. - -**Important:** Make sure you understand the difference between compiling -locally and compiling remotely (on the TopCoder servers). If you use the -Makefile to compile your solution (and maybe run the tests), you are not -interacting with the TopCoder servers at all. When you compile *remotely*, -you are sending a snapshot of your current solution to the servers for -processing. The distinction becomes important when it comes time for you to -submit your solution. When you push the "Submit" button, you are submitting -the **last version that was uploaded to the TopCoder servers** (by compiling -remotely), and that may be different from what is currently in your Vim -buffer, even if your Vim buffer was saved to disk. Therefore, it is very -important that you get into the habit of always pushing the "Compile" button -right before you submit your code. This point can't be overemphasized. - -##### driver.`$LANGUAGE$` - -If there exists a driver template for the selected language, it will also be -filled out and saved in the problem directory. If the language was currently -set to C++, the driver code would be in the driver.cc file. You normally -don't have to do anything with this file. It just provides supporting code -for running the test cases against your code. - -The driver should output TAP (Test Anything Protocol) so that tests can be run -in a test harness such as [prove](http://search.cpan.org/perldoc?prove). The -default Makefile template has a `prove` target (type ":make prove") that can -run the tests in a test harness; the test harness is `prove` unless otherwise -configured. TAP output is also very human-readable all by itself, so having -a test harness isn't really required. - -A default driver template is currently only provided for the C++ language. -You could write your own template if you wanted to. - -##### `$CLASSNAME$` - -Sometimes the TopCoder Arena applet will pass back what source code it has -saved. This will be saved in a file named after the class, without any file -extension. You can open this file if you need to access this code for any -reason (say, you messed up some code and need to revert back to the last time -you saved from the TopCoder Arena applet). - -Templates ---------- - -VimCoder comes with default templates for C++ and Java, but you can create -your own customized templates for any language supported by TopCoder. To use -your own template, you need to add a file to the storage directory with a file -name depending on the language. The file name should start with the name of -the language and end with "Template" with no file extension. For example, if -you wanted to create a C# template and your storage directory was -`/home/foo/.vimcoder`, you would need to create the file -`/home/foo/.vimcoder/C#Template`. - -A template is like a regular source code file with special keywords that will -be replaced as the template is "filled out" whenever you open a new problem. -Keywords are surrounded by two dollar signs so they're not confused with other -parts of the source code. The template expansion process is rather -simplistic, so if you can't get the right format for the terms you need, you -might have to change the plug-in source code to get the effect you're trying -to achieve. Here are the possible keywords and replacement terms: - -##### `$CLASSNAME$` - -This keyword is replaced by the name of the class you must use in your -solution to the problem. - -##### `$METHODNAME$` - -This keyword is replaced by the name of the public method your class needs to -have. - -##### `$RETURNTYPE$` - -This keyword is replaced by the type of the return variable of your public -method. - -##### `$METHODPARAMS$` - -This keyword is replaced by a comma-separated list of method parameter types -and names. - ----- - -Other keywords are also available, but the rest are intended to be used in -driver or Makefile templates, though any keyword can be used in any type of -template. You can create other types of templates by adding specially-named -files to the storage directory. Driver templates are named starting with the -name of the language and ending with "Driver" with no file extension. -Similarly, Makefile templates are named starting with the name of the language -and ending with "Makefile" with no file extension. - -Drivers provide additional code that allows the test cases to be run against -your solution. Currently, Makefile and driver templates are only provided for -the C++ language. Makefiles should have the commands needed to compile the -solution source code and/or make a driver program that will perform the tests. -If you want automatic building and testing for one of the other languages, you -will need to create a driver and Makefile template for that language. Here -are more keywords that may be useful for these types of templates: - -##### `$METHODPARAMDECLARES$` - -This keyword is replaced by C-style declarations of the method parameters. In -other words, each parameter is declared with its type on its own line -terminated by a semicolon. - -##### `$METHODPARAMNAMES$` - -This keyword is replaced by a comma-separated list of only the method -parameter names. - -##### `$METHODPARAMSTREAMOUT$` - -This keyword is replaced by a list of the method parameter names separated by -the C++ output stream operator (<<). The C++ driver template uses this to -display the input values of the test case data. - -##### `$METHODPARAMSTREAMIN$` - -This keyword is replaced by a list of the method parameter names separated by -the C++ input stream operator (>>). The C++ driver template uses this to read -in the test case data from testcases.txt. - ----- - -To give you an idea of how this all fits together, here is an example template -for Java, similar to the built-in default Java template: - -```java -import static java.lang.Math.*; -import static java.math.BigInteger.*; -import static java.util.Arrays.*; -import static java.util.Collections.*; -import java.math.*; -import java.util.*; - -public class $CLASSNAME$ { - public $RETURNTYPE$ $METHODNAME$($METHODPARAMS$) { - } -} -``` - -Notice that it looks just like regular code but has some keywords surrounded -by dollar signs that will be expanded to real values. Something like this -could be saved in a filed named `JavaTemplate` in your VimCoder storage -directory. - -Potential Pitfalls ------------------- - -##### Vim Client/Server - -VimCoder requires Vim's client/server feature in order to work. If the log is -showing errors with the invocation of Vim or if it's just not working and has -other strange symptoms, make sure your version of Vim supports the -client/server feature. If you are unsure, use Vim's `:version` command and -look for "+clientserver" in the output. If you see "-clientserver" instead, -then you'll need to get yourself another version of Vim. - -I think this feature was introduced in Vim 6.x, but I haven't done any testing -with any versions of Vim less than 7.2. If you're still on 6.x, you should -really upgrade anyway. - -##### Vim Settings Not Applied - -The problem is that sometimes your settings (in your vimrc file) are not being -applied as you would expect. This may be because you are using `setlocal` in -your vimrc file rather than `set`. The `setlocal` command applies settings -only to the current buffer or window (see `:help setlocal` for more -information), but VimCoder works by first launching Vim and then loading -a brand new buffer. - -The solution is to consider whether or not such settings should actually be -global; if they should be global, change `setlocal` to `set` in your vimrc -file. Alternatively, if you want certain settings to be set only for certain -kinds of buffers, you can use the `autocmd` command to selectively set -settings according to file path pattern and various events. -See `:help autocmd` for more information. - diff --git a/img/prefs.png b/img/prefs.png new file mode 100644 index 0000000..8e0d264 Binary files /dev/null and b/img/prefs.png differ diff --git a/img/vimcoder.png b/img/vimcoder.png new file mode 100644 index 0000000..7bfdf2f Binary files /dev/null and b/img/vimcoder.png differ diff --git a/src/com/dogcows/Editor.java b/src/com/dogcows/Editor.java deleted file mode 100644 index 19cee34..0000000 --- a/src/com/dogcows/Editor.java +++ /dev/null @@ -1,355 +0,0 @@ - -package com.dogcows; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.*; - -import com.topcoder.client.contestant.ProblemComponentModel; -import com.topcoder.shared.language.Language; -import com.topcoder.shared.problem.DataType; -import com.topcoder.shared.problem.Renderer; -import com.topcoder.shared.problem.TestCase; - -/** - * @author Charles McGarvey - * The TopCoder Arena editor plug-in providing support for Vim. - * - * Distributable under the terms and conditions of the 2-clause BSD license; - * see the file COPYING for a complete text of the license. - */ -public class Editor -{ - /** - * The problem ID number. - */ - private String id; - - /** - * The name of the class. - */ - private String name; - - /** - * The name of the contest. - */ - private String contestName; - - /** - * The point value. - */ - private String points; - - /** - * The path of the current source file. - */ - private File sourceFile; - - /** - * The path of the problem directory. - */ - private File directory; - - - /** - * Map languages names to file extensions. - */ - private static final Map languageExtension = new HashMap(); - static - { - languageExtension.put("Java", "java"); - languageExtension.put("C++", "cc"); - languageExtension.put("C#", "cs"); - languageExtension.put("VB", "vb"); - languageExtension.put("Python", "py"); - } - - - /** - * Construct an editor with the problem objects given us by the Arena. - * @param component A container for the particulars of the problem. - * @param language The currently selected language. - * @param renderer A helper object to help format the problem statement. - * @throws Exception If the editor could not set itself up. - */ - public Editor(ProblemComponentModel component, - Language language, Renderer renderer) throws Exception - { - this.id = String.valueOf(component.getProblem().getProblemID()); - this.name = component.getClassName(); - this.contestName = component.getProblem().getRound().getContestName().replaceAll(" ", "-"); - this.points = String.valueOf(component.getPoints().intValue()); - - // Make sure the top-level vimcoder directory exists. - File topDir = VimCoder.getStorageDirectory(); - if (!topDir.isDirectory()) - { - if (!topDir.mkdirs()) throw new IOException(topDir.getPath()); - } - - // Make sure the problem directory exists. - File newStyleDirectory = new File(new File(topDir, contestName), points); - File oldStyleDirectory = new File(topDir, id); - if (newStyleDirectory.isDirectory()) - { - this.directory = newStyleDirectory; - } - else if (oldStyleDirectory.isDirectory()) - { - this.directory = oldStyleDirectory; - } - else if (VimCoder.isContestDirNames()) - { - this.directory = newStyleDirectory; - if (!directory.mkdirs()) throw new IOException(directory.getPath()); - } - else - { - this.directory = oldStyleDirectory; - if (!directory.mkdirs()) throw new IOException(directory.getPath()); - } - - String lang = language.getName(); - String ext = languageExtension.get(lang); - - // Set up the terms used for the template expansion. - HashMap terms = new HashMap(); - terms.put("RETURNTYPE", component.getReturnType().getDescriptor(language)); - terms.put("CLASSNAME", name); - terms.put("METHODNAME", component.getMethodName()); - terms.put("METHODPARAMS", getMethodParams(component.getParamTypes(), component.getParamNames(), language)); - terms.put("METHODPARAMNAMES", Util.join(component.getParamNames(), ", ")); - terms.put("METHODPARAMSTREAMIN", Util.join(component.getParamNames(), " >> ")); - terms.put("METHODPARAMSTREAMOUT", Util.join(component.getParamNames(), " << \", \" << ")); - terms.put("METHODPARAMDECLARES", getMethodParamDeclarations(component.getParamTypes(), component.getParamNames(), language)); - terms.put("VIMCODER", VimCoder.version); - - // Write the problem statement as an HTML file in the problem directory. - File problemFile = new File(directory, "Problem.html"); - if (!problemFile.canRead()) - { - FileWriter writer = new FileWriter(problemFile); - try - { - writer.write(renderer.toHTML(language)); - } - finally - { - writer.close(); - } - } - - // Expand the template for the main class and write it to the current - // source file. - this.sourceFile = new File(directory, name + "." + ext); - if (!sourceFile.canRead()) - { - String text = Util.expandTemplate(readTemplate(lang + "Template"), terms); - FileWriter writer = new FileWriter(sourceFile); - writer.write(text); - writer.close(); - } - - // Expand the driver template and write it to a source file. - File driverFile = new File(directory, "driver." + ext); - if (!driverFile.canRead()) - { - String text = Util.expandTemplate(readTemplate(lang + "Driver"), terms); - FileWriter writer = new FileWriter(driverFile); - writer.write(text); - writer.close(); - } - - // Write the test cases to a text file. The driver code can read this - // file and perform the tests based on what it reads. - File testcaseFile = new File(directory, "testcases.txt"); - if (!testcaseFile.canRead()) - { - StringBuilder text = new StringBuilder(); - if (component.hasTestCases()) - { - for (TestCase testCase : component.getTestCases()) - { - text.append(testCase.getOutput() + System.getProperty("line.separator")); - for (String input : testCase.getInput()) - { - text.append(input + System.getProperty("line.separator")); - } - } - } - FileWriter writer = new FileWriter(testcaseFile); - writer.write(text.toString()); - writer.close(); - } - - // Finally, expand the Makefile template and write it. - File makeFile = new File(directory, "Makefile"); - if (!makeFile.canRead()) - { - String text = Util.expandTemplate(readTemplate(lang + "Makefile"), terms); - FileWriter writer = new FileWriter(makeFile); - writer.write(text); - writer.close(); - } - } - - /** - * Save the source code provided by the server, and tell the Vim server to - * edit the current source file. - * @param source The source code. - * @throws Exception If the source couldn't be written or the Vim server - * had a problem. - */ - public void setSource(String source) throws Exception - { - FileWriter writer = new FileWriter(new File(directory, name)); - writer.write(source); - writer.close(); - sendVimCommand("--remote-tab-silent", sourceFile.getPath()); - } - - /** - * Read the source code from the current source file. - * @return The source code. - * @throws IOException If the source file could not be read. - */ - public String getSource() throws IOException - { - return Util.readFile(sourceFile); - } - - - /** - * Send a command to the Vim server. - * If the server isn't running, it will be started with the name - * VIMCODER#### where #### is the problem ID. - * @param command The command to send to the server. - * @param argument A single argument for the remote command. - * @throws Exception If the command could not be sent. - */ - private void sendVimCommand(String command, String argument) throws Exception - { - String[] arguments = {argument}; - sendVimCommand(command, arguments); - } - - /** - * Send a command to the Vim server. - * If the server isn't running, it will be started with the name - * VIMCODER#### where #### is the problem ID. - * @param command The command to send to the server. - * @param argument Arguments for the remote command. - * @throws Exception If the command could not be sent. - */ - private void sendVimCommand(String command, String[] arguments) throws Exception - { - String[] vimCommand = VimCoder.getVimCommand().split("\\s"); - String[] flags = {"--servername", "VimCoder" + id, command}; - vimCommand = Util.concat(vimCommand, flags); - vimCommand = Util.concat(vimCommand, arguments); - Process child = Runtime.getRuntime().exec(vimCommand, null, directory); - - /* FIXME: This is a pretty bad hack. The problem is that the Vim - * process doesn't fork to the background on some systems, so we - * can't wait on the child. At the same time, calling this method - * before the previous child could finish initializing the server - * may result in multiple editor windows popping up. We'd also - * like to be able to get the return code from the child if we can. - * The workaround here is to stall the thread for a little while or - * until we see that the child exits. If the child never exits - * before the timeout, we will assume it is not backgrounding and - * that everything worked. This works as long as the Vim server is - * able to start within the stall period. */ - long expire = System.currentTimeMillis() + 2500; - while (System.currentTimeMillis() < expire) - { - Thread.yield(); - try - { - int exitCode = child.exitValue(); - if (exitCode != 0) throw new Exception("Vim process returned exit code " + exitCode + "."); - break; - } - catch (IllegalThreadStateException exception) - { - // The child has not exited; intentionally ignoring exception. - } - } - } - - - /** - * Read a template. - * We first look in the storage directory. If we can't find one, we - * look among the resources. - * @param tName The name of the template. - * @return The contents of the template file, or an empty string. - */ - private String readTemplate(String tName) - { - File templateFile = new File(VimCoder.getStorageDirectory(), tName); - try - { - if (templateFile.canRead()) return Util.readFile(templateFile); - return Util.readResource(tName); - } - catch (IOException exception) - { - return ""; - } - } - - - /** - * Convert an array of data types to an array of strings according to a - * given language. - * @param types The data types. - * @param language The language to use in the conversion. - * @return The array of string representations of the data types. - */ - private String[] getStringTypes(DataType[] types, Language language) - { - String[] strings = new String[types.length]; - for (int i = 0; i < types.length; ++i) - { - strings[i] = types[i].getDescriptor(language); - } - return strings; - } - - /** - * Combine the data types and parameter names into a comma-separated list of - * the method parameters. - * The result could be used inside the parentheses of a method - * declaration. - * @param types The data types of the parameters. - * @param names The names of the parameters. - * @param language The language used for representing the data types. - * @return The list of parameters. - */ - private String getMethodParams(DataType[] types, String[] names, Language language) - { - String[] typeStrings = getStringTypes(types, language); - return Util.join(Util.combine(typeStrings, names, " "), ", "); - } - - /** - * Combine the data types and parameter names into a group of variable - * declarations. - * Each declaration is separated by a new line and terminated with a - * semicolon. - * @param types The data types of the parameters. - * @param names The names of the parameters. - * @param language The language used for representing the data types. - * @return The parameters as a block of declarations. - */ - private String getMethodParamDeclarations(DataType[] types, String[] names, Language language) - { - final String end = ";" + System.getProperty("line.separator"); - String[] typeStrings = getStringTypes(types, language); - return Util.join(Util.combine(typeStrings, names, "\t"), end) + end; - } -} - -// vim:et:ts=8:sts=4:sw=4 diff --git a/src/com/dogcows/Util.java b/src/com/dogcows/Util.java deleted file mode 100644 index ceb26a9..0000000 --- a/src/com/dogcows/Util.java +++ /dev/null @@ -1,160 +0,0 @@ - -package com.dogcows; - -import java.io.*; -import java.util.Arrays; -import java.util.Map; - -/** - * @author Charles McGarvey - * The TopCoder Arena editor plug-in providing support for Vim. - * - * Distributable under the terms and conditions of the 2-clause BSD license; - * see the file COPYING for a complete text of the license. - */ -public abstract class Util -{ - /** - * Concatenate two arrays into a single array. - * @param a First array. - * @param b Second array. - * @return The combined array. - */ - public static T[] concat(T[] a, T[] b) - { - T[] result = Arrays.copyOf(a, a.length + b.length); - System.arraycopy(b, 0, result, a.length, b.length); - return result; - } - - /** - * Combined string elements from two arrays into a single array, gluing - * together elements of the same index with a delimiter string. - * @param a First string array. - * @param b Second string array. - * @param glue The delimiter string. - * @return The combined array. - */ - public static String[] combine(String[] a, String[] b, String glue) - { - String[] result = new String[Math.min(a.length, b.length)]; - for (int i = 0; i < result.length; ++i) - { - result[i] = a[i] + glue + b[i]; - } - return result; - } - - /** - * Join the elements of a string array with a delimiter. - * @param a The array. - * @param glue The delimiter string. - * @return The joined string. - */ - public static String join(String[] a, String glue) - { - if (a.length == 0) return ""; - StringBuilder result = new StringBuilder(); - result.append(a[0]); - for (int i = 1; i < a.length; ++i) result.append(glue).append(a[i]); - return result.toString(); - } - - /** - * Escape a string by replacing prepending backslashes and double - * quotation characters with an extra backslash. - * @param The string to be escaped. - * @return The escaped string. - */ - public static String escape(String a) - { - a = a.replaceAll("\\\\", "\\\\\\\\"); - a = a.replaceAll("\"", "\\\\\\\""); - return a; - } - - /** - * Simply read a file's contents into a string object. - * @param file The file to read. - * @return The contents of the file. - * @throws IOException If the file is not readable. - */ - public static String readFile(File file) throws IOException - { - StringBuilder text = new StringBuilder(); - - BufferedReader reader = new BufferedReader(new FileReader(file.getPath())); - try - { - String line = null; - - while ((line = reader.readLine()) != null) - { - text.append(line + System.getProperty("line.separator")); - } - } - finally - { - reader.close(); - } - - return text.toString(); - } - - /** - * Read a resource file into a string object. - * The resources should be placed in the directory `resources' - * underneath the parent directory of this class. Reading resources - * packaged in a jar is allowable. - * @param path Relative path to the resource. - * @return The contents of the resource. - * @throws IOException If the resource is not readable. - */ - public static String readResource(String path) throws IOException - { - StringBuilder text = new StringBuilder(); - - InputStream stream = Util.class.getResourceAsStream("resources/" + path); - if (stream != null) - { - try - { - byte[] buffer = new byte[4096]; - int numBytes = 0; - while (0 < (numBytes = stream.read(buffer))) - { - text.append(new String(buffer, 0, numBytes)); - } - } - finally - { - stream.close(); - } - } - - return text.toString().replaceAll("\n", System.getProperty("line.separator")); - } - - /** - * The poor man's template package. - * Provide a template and a map of terms to build the result with the - * terms expanded into the template. Terms in the template should - * appear surrounded with dollar signs. For example, if $MYTERM$ - * appears in the template, it will be replaced by the value into the - * terms map with the key MYTERM (if it exists in the map). - * @param template The template string. - * @param terms A map of key/value terms. - * @return The string expanded from the template and terms. - */ - public static String expandTemplate(String template, Map terms) - { - String text = template; - for (String key : terms.keySet()) - { - text = text.replaceAll("\\$" + key + "\\$", Util.escape(terms.get(key))); - } - return text; - } -} - -// vim:et:ts=8:sts=4:sw=4 diff --git a/src/com/dogcows/VimCoder.java b/src/com/dogcows/VimCoder.java deleted file mode 100644 index 7c4afe3..0000000 --- a/src/com/dogcows/VimCoder.java +++ /dev/null @@ -1,442 +0,0 @@ - -package com.dogcows; - -import java.awt.*; -import java.awt.event.*; -import java.io.*; -import java.text.SimpleDateFormat; -import java.util.*; -import javax.swing.*; -import javax.swing.border.*; - -import com.topcoder.client.contestApplet.common.Common; -import com.topcoder.client.contestApplet.common.LocalPreferences; -import com.topcoder.client.contestant.ProblemComponentModel; -import com.topcoder.shared.language.Language; -import com.topcoder.shared.problem.Renderer; - -/** - * @author Charles McGarvey - * The TopCoder Arena editor plug-in providing support for Vim. - * - * Distributable under the terms and conditions of the 2-clause BSD license; - * see the file COPYING for a complete text of the license. - */ -public class VimCoder -{ - /** - * The name and version of this plugin. - */ - public final static String version = "VimCoder 0.3.6"; - - - /** - * The first part of the command used to invoke the Vim server. - */ - private static String vimCommand = "gvim"; - - /** - * The path to the main VimCoder directory. - */ - private static File rootDir; - static - { - if (System.getProperty("os.name").toLowerCase().equals("win")) - { - vimCommand = "C:\\WINDOWS\\gvim.bat"; - } - rootDir = new File(System.getProperty("user.home") + System.getProperty("file.separator") + ".vimcoder"); - } - - /** - * Whether or not to use the contest name and point value as problem - * directory names. - */ - private static boolean contestDirNames = false; - - - /** - * The panel given to the Arena applet when it is requested. - */ - private JPanel panel; - - /** - * The text widget where log messages are appended. - */ - private JTextArea logArea; - - /** - * The current editor object (or null if there is none). - */ - private Editor editor; - - /** - * The configuration panel. - */ - private JDialog configDialog; - - - /** - * The key for the vim command preference. - */ - private final static String VIMCOMMAND = "com.dogcows.VimCoder.config.vimcommand"; - - /** - * The key for the root directory preference. - */ - private final static String ROOTDIR = "com.dogcows.VimCoder.config.rootdir"; - - /** - * The key for the problem directory name preference. - */ - private final static String CONTESTDIRNAMES = "com.dogcows.VimCoder.config.contestdirnames"; - - /** - * The preferences object for storing plugin settings. - */ - private static LocalPreferences prefs = LocalPreferences.getInstance(); - - - /** - * Get the command for invoking vim. - * @return The command. - */ - public static String getVimCommand() - { - return vimCommand; - } - - /** - * Get the storage directory. - * @return The directory. - */ - public static File getStorageDirectory() - { - return rootDir; - } - - /** - * Get whether or not to save problems in a human-readable directory - * structure. - * @return The directory name setting. - */ - public static boolean isContestDirNames() - { - return contestDirNames; - } - - - /** - * Instantiate the entry point of the editor plugin. - * Sets up the log widget and panel. - */ - public VimCoder() - { - logArea = new JTextArea(); - logArea.setForeground(Color.GREEN); - logArea.setBackground(Color.BLACK); - logArea.setEditable(false); - Font font = new Font("Courier", Font.PLAIN, 12); - if (font != null) logArea.setFont(font); - - panel = new JPanel(new BorderLayout()); - panel.add(new JScrollPane(logArea), BorderLayout.CENTER); - } - - - /** - * Called by the Arena when the plugin is about to be used. - */ - public void startUsing() - { - Runnable task = new Runnable() - { - public void run() - { - logArea.setText(""); - } - }; - if (SwingUtilities.isEventDispatchThread()) - { - task.run(); - } - else - { - SwingUtilities.invokeLater(task); - } - loadConfiguration(); - } - - /** - * Called by the Arena when the plugin is no longer needed. - */ - public void stopUsing() - { - editor = null; - } - - /** - * Called by the Arena to obtain the editor panel which we will use to - * show log messages. - * @return The editor panel. - */ - public JPanel getEditorPanel() - { - return panel; - } - - /** - * Called by the Arena to obtain the current source. - * This happens when the user is saving, compiling, and/or submitting. - * @return The current source code. - * @throws Exception If the source file edited by Vim couldn't be read. - */ - public String getSource() throws Exception - { - try - { - String source = editor.getSource(); - logInfo("Source code uploaded to server."); - return source; - } - catch (Exception exception) - { - logError("Failed to get source code: " + exception.getLocalizedMessage()); - throw exception; - } - } - - /** - * Called by the Arena to pass the source it has. - * @param source The source code. - */ - public void setSource(String source) - { - try - { - editor.setSource(source); - logInfo("Source code downloaded from server."); - } - catch (Exception exception) - { - logError("Failed to save the source given by the server: " + exception.getLocalizedMessage()); - return; - } - } - - /** - * Called by the Arena to pass along information about the current - * problem. - * @param component A container for the particulars of the problem. - * @param language The currently selected language. - * @param renderer A helper object to help format the problem - * statement. - */ - public void setProblemComponent(ProblemComponentModel component, - Language language, Renderer renderer) - { - try - { - editor = new Editor(component, language, renderer); - } - catch (Exception exception) - { - logError("An error occurred while loading the problem: " + exception.getLocalizedMessage()); - } - } - - /** - * Called by the Arena when it's time to show our configuration panel. - */ - public void configure() - { - final int border = 10; - final int inset = 2; - - loadConfiguration(); - - configDialog = new JDialog(); - Container container = configDialog.getContentPane(); - container.setForeground(Common.FG_COLOR); - container.setBackground(Common.WPB_COLOR); - - JPanel pane = new JPanel(); - container.add(pane); - - BoxLayout boxLayout = new BoxLayout(pane, BoxLayout.Y_AXIS); - pane.setLayout(boxLayout); - pane.setBorder(BorderFactory.createEmptyBorder(border, border, border, border)); - - JPanel fieldPanel = new JPanel(new GridBagLayout()); - pane.add(fieldPanel); - pane.add(Box.createRigidArea(new Dimension(0, border))); - - GridBagConstraints c = new GridBagConstraints(); - c.fill = GridBagConstraints.HORIZONTAL; - c.insets = new Insets(inset, inset, inset, inset); - - JLabel rootDirLabel = new JLabel("Storage Directory:"); - rootDirLabel.setForeground(Common.FG_COLOR); - c.gridx = 0; - c.gridy = 0; - c.gridwidth = 1; - fieldPanel.add(rootDirLabel, c); - - final JTextField rootDirField = new JTextField(rootDir.getPath()); - rootDirField.setPreferredSize(new Dimension(0, 24)); - c.gridx = 1; - c.gridy = 0; - c.weightx = 1.0; - fieldPanel.add(rootDirField, c); - - JButton browseButton = new JButton("Browse"); - c.gridx = 2; - c.gridy = 0; - c.weightx = 0.0; - c.anchor = GridBagConstraints.BASELINE_LEADING; - fieldPanel.add(browseButton, c); - - final JCheckBox contestDirNamesButton = new JCheckBox( - "Store problems according to contest name and point value.", - contestDirNames - ); - contestDirNamesButton.setForeground(Common.FG_COLOR); - contestDirNamesButton.setBackground(Common.WPB_COLOR); - contestDirNamesButton.setFont(rootDirLabel.getFont()); - c.gridx = 1; - c.gridy = 1; - c.gridwidth = 2; - fieldPanel.add(contestDirNamesButton, c); - - JLabel vimCommandLabel = new JLabel("Vim Command:"); - vimCommandLabel.setForeground(Common.FG_COLOR); - c.gridx = 0; - c.gridy = 2; - c.gridwidth = 1; - fieldPanel.add(vimCommandLabel, c); - - final JTextField vimCommandField = new JTextField(vimCommand); - vimCommandField.setPreferredSize(new Dimension(0, 24)); - c.gridx = 1; - c.gridy = 2; - c.weightx = 1.0; - c.gridwidth = 2; - fieldPanel.add(vimCommandField, c); - - JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING, inset, inset)); - buttonPanel.setPreferredSize(new Dimension(400, 24 + 2 * inset)); - pane.add(buttonPanel); - - JButton saveButton = new JButton("Save"); - buttonPanel.add(saveButton); - buttonPanel.add(Box.createRigidArea(new Dimension(1, 0))); - - JButton closeButton = new JButton("Close"); - buttonPanel.add(closeButton); - - browseButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent actionEvent) - { - JFileChooser chooser = new JFileChooser(); - chooser.setCurrentDirectory(new File(".")); - chooser.setDialogTitle("Choose Storage Directory"); - chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - chooser.setAcceptAllFileFilterUsed(false); - - if (chooser.showOpenDialog(configDialog) == JFileChooser.APPROVE_OPTION) - { - rootDirField.setText(chooser.getSelectedFile().getPath()); - } - } - }); - - closeButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent actionEvent) - { - configDialog.dispose(); - } - }); - - saveButton.addActionListener(new ActionListener() - { - public void actionPerformed(ActionEvent actionEvent) - { - prefs.setProperty(VIMCOMMAND, vimCommandField.getText()); - prefs.setProperty(ROOTDIR, rootDirField.getText()); - prefs.setProperty(CONTESTDIRNAMES, String.valueOf(contestDirNamesButton.isSelected())); - JOptionPane.showMessageDialog(null, "Preferences were saved successfully."); - } - }); - - configDialog.setTitle("VimCoder Preferences"); - configDialog.pack(); - configDialog.setLocationRelativeTo(null); // Center dialog in screen. - configDialog.setModalityType(Dialog.DEFAULT_MODALITY_TYPE); - configDialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - configDialog.setVisible(true); - } - - - /** - * Load the local preferences related to this plugin. - */ - private void loadConfiguration() - { - String vc = prefs.getProperty(VIMCOMMAND); - if (vc != null) vimCommand = vc; - - String dir = prefs.getProperty(ROOTDIR); - if (dir != null) rootDir = new File(dir); - - String cn = prefs.getProperty(CONTESTDIRNAMES); - if (cn != null) contestDirNames = Boolean.parseBoolean(cn); - } - - - /** - * A generic logging function, appends text to the text area. A timestamp - * is also prepended to the next text. - * @param what The text to append. - */ - private void log(final String what) - { - Runnable task = new Runnable() - { - public void run() - { - SimpleDateFormat format = new SimpleDateFormat("kk:mm:ss"); - logArea.append(format.format(new Date()) + ", " + what); - } - }; - if (SwingUtilities.isEventDispatchThread()) - { - task.run(); - } - else - { - SwingUtilities.invokeLater(task); - } - } - - /** - * Output non-critical messages to the log. - * @param what The text of the message. - */ - private void logInfo(String what) - { - log(" INFO: " + what + System.getProperty("line.separator")); - } - - /** - * Output critical messages and errors to the log. - * @param what The text of the message. - */ - private void logError(String what) - { - log("ERROR: " + what + System.getProperty("line.separator")); - } -} - -// vim:et:ts=8:sts=4:sw=4 diff --git a/src/com/dogcows/resources/C++Driver b/src/com/dogcows/resources/C++Driver deleted file mode 100644 index ca48428..0000000 --- a/src/com/dogcows/resources/C++Driver +++ /dev/null @@ -1,207 +0,0 @@ - -#include "$CLASSNAME$.cc" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -const static double __EPSILON = 1e-9; -static double __time = 0.0; - -static void __timer_start() -{ - struct timeval tv; - if (gettimeofday(&tv, NULL) == 0) - { - __time = double(tv.tv_sec) * 1000.0 + double(tv.tv_usec) * 0.001; - } -} - -static double __timer_stop() -{ - double start = __time; - __timer_start(); - return __time - start; -} - - -static void __eat_whitespace(std::istream& in) -{ - while (in.good() && std::isspace(in.peek())) in.get(); -} - - -std::ostream& operator << (std::ostream& out, const std::string& str) -{ - out << '"' << str.c_str() << '"'; - return out; -} - -template -std::ostream& operator << (std::ostream& out, const std::vector& vec) -{ - out << '{'; - if (0 < vec.size()) - { - out << vec[0]; - for (size_t i = 1; i < vec.size(); ++i) out << ", " << vec[i]; - } - out << '}'; - return out; -} - -std::istream& operator >> (std::istream& in, std::string& str) -{ - __eat_whitespace(in); - - int c; - if (in.good() && (c = in.get()) == '"') - { - std::ostringstream s; - while (in.good() && (c = in.get()) != '"') - { - s.put(char(c)); - } - str = s.str(); - } - - return in; -} - -template -std::istream& operator >> (std::istream& in, std::vector& vec) -{ - __eat_whitespace(in); - - int c; - if (in.good() && (c = in.get()) == '{') - { - __eat_whitespace(in); - vec.clear(); - while (in.good() && (c = in.get()) != '}') - { - if (c != ',') in.putback(c); - - T t; - in >> t; - __eat_whitespace(in); - - vec.push_back(t); - } - } - - return in; -} - - -template -bool __equals(const T& actual, const T& expected) -{ - return actual == expected; -} - -bool __equals(double actual, double expected) -{ - if (std::abs(actual - expected) < __EPSILON) - { - return true; - } - else - { - double minimum = std::min(expected * (1.0 - __EPSILON), expected * (1.0 + __EPSILON)); - double maximum = std::max(expected * (1.0 - __EPSILON), expected * (1.0 + __EPSILON)); - return actual > minimum && actual < maximum; - } -} - -bool __equals(const std::vector& actual, const std::vector& expected) -{ - if (actual.size() != expected.size()) - { - return false; - } - - for (size_t i = 0; i < actual.size(); ++i) - { - if (!__equals(actual[i], expected[i])) - { - return false; - } - } - - return true; -} - - -int main(int argc, char* argv[]) -{ - bool __abort_on_fail = false; - int __pass = 0; - int __fail = 0; - - if (1 < argc) __abort_on_fail = true; - - std::cout << "TAP version 13" << std::endl; - std::cout.flush(); - - std::ifstream __in("testcases.txt"); - for(;;) - { - int __testnum = __pass + __fail + 1; - - $RETURNTYPE$ __expected; - $METHODPARAMDECLARES$ - __in >> __expected >> $METHODPARAMSTREAMIN$; - if (!__in.good()) break; - - std::cout << "# input for test " << __testnum << ": " << $METHODPARAMSTREAMOUT$ << std::endl; - std::cout.flush(); - - __timer_start(); - - $CLASSNAME$ __object; - $RETURNTYPE$ __actual = __object.$METHODNAME$($METHODPARAMNAMES$); - - double __t = __timer_stop(); - - std::cout << "# test completed in " << __t << "ms" << std::endl; - std::cout.flush(); - - if (__equals(__actual, __expected)) - { - std::cout << "ok"; - ++__pass; - } - else - { - std::cout << "not ok"; - ++__fail; - } - - std::cout << " " << __testnum << " - " << __actual << " must equal " << __expected << std::endl; - std::cout.flush(); - - if (__abort_on_fail && 0 < __fail) std::abort(); - } - - std::cout << "1.." << (__pass + __fail) << std::endl - << "# passed: " << __pass << std::endl - << "# failed: " << __fail << std::endl; - - if (__fail == 0) - { - std::cout << std::endl - << "# Nice! Don't forget to compile remotely before submitting." << std::endl; - } - - return __fail; -} - -// vim:ft=cpp:noet:ts=8 diff --git a/src/com/dogcows/resources/C++Makefile b/src/com/dogcows/resources/C++Makefile deleted file mode 100644 index 5b58356..0000000 --- a/src/com/dogcows/resources/C++Makefile +++ /dev/null @@ -1,44 +0,0 @@ - -# Set the command for your C++ compiler, and specify any compiler flags you want to use (e.g. -g -# -Werror). -CXX = g++ -CXXFLAGS = -ggdb -Wall - -# The driver outputs TAP (Test Anything Protocol), so it can also be used with any TAP test harness -# (e.g. prove). Set the path to your test harness here, then use the `prove' target to run the -# tests with that harness. -PROVE = prove -PROVEFLAGS = -e "" - - -ifeq ($(OS),Windows_NT) -EXEEXT = .exe -endif - - -all: driver$(EXEEXT) - -clean: - rm -f driver$(EXEEXT) - -distclean: clean - rm -f $CLASSNAME$ - -run: all - ./driver$(EXEEXT) - -test: all - ./driver$(EXEEXT) --abort-on-fail - -prove: all - $(PROVE) $(PROVEFLAGS) ./driver$(EXEEXT) - - -%$(EXEEXT): %.cc - $(LINK.cc) $< $(LOADLIBES) $(LDLIBS) -o $@ - -driver$(EXEEXT): $CLASSNAME$.cc - -.PHONY: all clean distclean run test prove - -# vim:ft=make:noet:ts=8 diff --git a/src/com/dogcows/resources/C++Template b/src/com/dogcows/resources/C++Template deleted file mode 100644 index 6f225cd..0000000 --- a/src/com/dogcows/resources/C++Template +++ /dev/null @@ -1,37 +0,0 @@ - -// {{{ $VIMCODER$ <----------------------------------------------------- -// vim:filetype=cpp:foldmethod=marker:foldmarker={{{,}}} - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; - -// }}} - -class $CLASSNAME$ -{ -public: - $RETURNTYPE$ $METHODNAME$($METHODPARAMS$) - { - return $RETURNTYPE$(); - } -}; - diff --git a/src/com/dogcows/resources/JavaTemplate b/src/com/dogcows/resources/JavaTemplate deleted file mode 100644 index 68c790b..0000000 --- a/src/com/dogcows/resources/JavaTemplate +++ /dev/null @@ -1,20 +0,0 @@ - -// {{{ $VIMCODER$ <----------------------------------------------------- -// vim:filetype=java:foldmethod=marker:foldmarker={{{,}}} - -import static java.lang.Math.*; -import static java.math.BigInteger.*; -import static java.util.Arrays.*; -import static java.util.Collections.*; -import java.math.*; -import java.util.*; - -// }}} - -public class $CLASSNAME$ -{ - public $RETURNTYPE$ $METHODNAME$($METHODPARAMS$) - { - } -} - diff --git a/t/01-basic.t b/t/01-basic.t deleted file mode 100644 index 1984637..0000000 --- a/t/01-basic.t +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env perl - -use warnings; -use strict; - -use Test::More; - -# placeholder for tests to be added in the future... someday -pass; - -done_testing; -