IDEA has an excellent diff facility, complete with syntax highlighting and merging capability. I often use this for comparing two versions of the same file from CVS, but until yesterday, I didn't realize you could use this same facility to compare ANY two files (not just from source control). Just multi-select two files in the project view, right click and select "Compare Two Files"...
I like to keep a scratch directory in all my IDEA projects which is not committed to source control. It'll have files in it like "scratch1.xml", "scratch2.xml", etc (very easy to get to with ctrl-shift-N). Using these and IDEA's "diff two files" facility - its pretty easy to compare expected vs. actual output (useful for comparing SOAP requests, other generated XML documents, etc).
I guess sometimes it pays to read the directions ;-)
Posted by lhankins ( Mar 10 2004, 12:00:00 AM CST ) PermalinkAn ant target that every project should define is one which allows you to backup your source code (without neccessarily committing it). This is useful for a variety of reasons (lots of work done but not ready to commit, about to do a that big merge you've been dreading for a while, paranoid about the unusual noises coming from your hard drive, etc). Here's the target I've been using on my last several projects.
It basically just creates an archive of all source/config/buildfiles from your project in the directory defined by ${dir.backup.src}. The archive will follow the format : <project-name>-src-yyyyMMdd-hhmm.zip
Posted by lhankins ( Feb 01 2004, 12:00:00 AM CST ) Permalink Comments [1]I stumbled across these bookmarklets over on the CSS Discuss Wiki. They are a collection JavaScript utility functions which are useful for debugging webpages during development. The idea is you bookomark them in your browser, then you can use them to access/manipulate/debug the currently viewed webpage.
Some of them are very useful - for example, the generated source bookmarklet will popup a new window with the actual HTML source for the DOM tree of the current webpage (very useful if portions of the page in question were generated by JavaScript - which means there was no "original" source).
There is also a Shell bookmarklet which will pop open a JavaScript shell which has full access to the currently viewed page.
Posted by lhankins ( Jan 31 2004, 12:00:00 AM CST ) PermalinkAnt 1.6 has a new <import> tag which allows you to "#include" one ant file into another. There was a kludgy way of doing this with older versions of Ant (using the entity includes trick) but I was never really that crazy about it (seemed like it always caused IDEA to freak out).
Here's a discussion of this feature from the Ant Wiki.
I started using this on my current project and have been pretty pleased so far. We have a top level build.xml, and a build.xml file for each subsystem. We pulled out the common properties and paths into separate files (CommonAntProperties.xml and CommonAntPaths.xml) and use the <import> task to import them where needed. I guess my only complaint thus far is that IDEA doesn't seem to support the import tag. It flags all usages of properties which are contained in my CommonAntProperties.xml file as errors in any of the main build.xml files. Oh well - it can't be perfect. On a positive note, I noticed IDEA does have tab completion support for ant build.xml files (for the variables it does recognize). Just hit CTRL-SPACE after you do ${ and it will pop-up a list of know variable names.
Posted by lhankins ( Jan 26 2004, 12:00:00 AM CST ) Permalink Comments [1]On my machine I have two partitions : C & D. The C partition has the OS, all Programs like Office, IDEA, Oracle, etc on it. The D drive just has data - mostly source code, project directories, personal files, etc.
I’ve noticed that when I’m doing development, the D drive gets fragmented very quickly (even in one days time). After a full day's coding, I usually manage to create 1000 or so fragmented files (even when the machine has been completely defragged the day before). This is after doing full rebuilds, re-installations of the appserver (we have an ant target to completely wipe out our Jboss directory and re-install it), pulls from CVS, etc..
Anyway – you can setup Windows built in defrag tool to run on a recurring basis. Here’s how :
Create a batch file (e.g. c:\bin\DefragLocalDrives.cmd) with the contents similar to the following (customize to your local drive structure):
Now create a scheduled task to run this batch file. Goto Start | Control Panel | Scheduled Tasks and click on “Add Scheduled Task” Point the new scheduled task at the batch file you created in step 1 and set up the recurrence to your preferred frequency.
I set mine up to run every morning at 4:30 AM. At first I thought this would be overkill, but I’ve noticed that when doing development I always have some fragmentation, even after only a day’s use.
That’s it…
Posted by lhankins ( Jun 25 2003, 12:00:00 AM CDT ) Permalink