Wednesday, December 12, 2012

Development Is Implannable

It's possible, but not plannable. Let's make a new word: Implannable. Implannable.

That's at least half of what the 'agile' thinking is about.

Tuesday, December 4, 2012

Maven Is Back, Stronger Than Ever

Guess what this does, in proper maven resource plugin context:

<configuration>
<outputDirectory>target/classes</outputDirectory>
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/*.class</exclude>
<exclude>**/.svn</exclude>
</excludes>
<resources>
<resource>
<directory>src/test/java</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<filtering>false</filtering>
</resource>
</resources>
</configuration>

Copies resources out of src/test/java and src/main/java, excluding files matching the specified patterns? 

Wrong. Or, mostly wrong. 

The exclusions will apply to the src/test/java directory paths, but not the src/main/java. Yep, at least in the version we use. 

Caveat utilitor.


Monday, December 3, 2012

Maven Copy Plugin

This (new?) Maven 'copy' plugin: http://evgeny-goldin.com/wiki/Copy-maven-plugin, seems to be a useful tool to simplify some Maven projects. It seems to be a good way to using a minimal number of plugins for common tasks. This is not a deep review; I'm just blogging this as sort of a mental note.

But it could be used for the following problem: I recently learned a second way that the 'real' Maven and running under the Eclipse Maven plugin differs, in that resource files in /src/man/java are copied; but not so with Maven defaults. (The other difference I know of is that Eclipse has only one classpath, the same for both src/test and src/main. Fertile ground for bad imports.) It's easy to add with a standard plugin, but if you have many such small tasks, then possibly this 'copy' plugin will be better than a bunch of disparate plugins. Maven is verbose enough, I think.

Wednesday, November 28, 2012

Cleaning Keyboard

Hot tap water. Light scrubbing with some tissues and some detergent. Wiped it down using dry tissue. This is not an expensive keyboard.

Plugged the USB back in; felt no fear doing so, since I believe it is only indirectly connected to the laptop, driver circuits and whatever. Works, despite some amount of water remaining inside of the keyboard. No keys malfunctioning yet.

Has a slightly different feel though; perhaps due to the remaining liquid.

Maybe I'll have to keep tapping on it so that the keys don't become stuck after drying out.

EDIT: don't do as I did. After a while, the up and left arrow keys stopped working. So I unscrewed a gazillon (11 plus five) screws to open the case to wipe the internals. Now all arrow keys work, but the numerals five and six don't work, also two more keys (equals and plus, I think) don't work. Weird thing is that if I hit, say, five key and six key in rapid succession, I get: u6 u6 u6. But not in the reverse order, six key and then five key. Hard to tell which malfunctioning part of the keyboard makes this happen.

Thursday, November 22, 2012

Simple S3 Solution for Maven Repository

Quick post, just the outline for this part-manual solution to publish a repo in the AWS S3 cloud.

# Set up a bucket (or find one to reuse).
# Enable Java for the AWS console (to be able to upload filesystem trees to your cloud bucket).

Each deploy:

# Use Maven's deploy command, specify a file:///tmp/my-repo/ folder as target.
# Upload using the file tree upload.
# Run the 'Make Public' command on the folder uploaded.

That's the skinny of it. Will be good enough for weekly or even daily publishing; but perhaps not for hourly updates.

Details TBD-M.

Wednesday, November 21, 2012

Contrafactual Java Package Name

I know of at least two limitations to package names. One, I've stumbled upon a few times until I learned to avoid it 'by heart': Java keywords.

Just found out about another one: can't start with a (decimal :) numeral. Which is a bummer. For instance, stuff having to do with 3-dimensional maths and graphics would be most easily recognized under the name '3d'.

Workarounds.... for '3d', let's see: Ugly "_3d"? Cryptic "ddd"? Associative "xyz"? Silly "three_d"?

With the keywords, you can at least have a name that starts with the word you'd rather have, helping with matching and alphabetical ordering and such things.

---

I wonder why he/they didn't go for a separate package syntax. I mean, the '.' can never be used as the other form of qualification operator anyway. Maybe there was plans for namespaces-as-objects or something.

(Interesting digression...it could actually be implemented (except being able to use regular dot syntax, of course); take (ClassLoader, InitialPackage) --> PackageNamespaceObject or something.)

Slash syntax would've worked. Contrafactual Java:
package com/mylib/somepackage;

import com/mylib/somepackage/misc/*;
import com/mylib/someotherpackage/thispackage/ThisClass;
import com/mylib/someotherpackage/3d-math/SomeModule;

public class Contrafactual3dDemo { //...
}
(And why not lose those package and import semicolons...)