Wednesday, November 16, 2011

Is this a valid use of an interface?

I saw a piece of code that made me wonder if this was normal when using interfaces or if it is just abusing the functionality of an interface... The code looks like so:
 
public interface Constants {
    public static final String URL = "localhost:1099";
    ... // Other constants defined
}

Later on it is used like so:
 
public class Something implements Constants {
     ...
     Context ctx = new InitialContext( PropertiesFactory.getProperties( URL ) );
     ...
}

Is  it normal practice to create an interface with a bunch of constants in an interface (without any methods defined), then implement the interface in a class and use the constants? 

I would have just statically accessed those parameters directly rather than doing it this way. If you have an opinion, answer to my thought or are just bored, let me know.  Well, perhaps not if you're bored.

Wednesday, November 2, 2011

Now this is funky

I wrote something funky today. I was trying to create an instance of an inner-class that was part of my Blah DTO. In Blah, there is a List of Foo objects that needs to be populated based on some logic.

private void populateBlah(Blah var) {

   ...
   Foo foo = var.new Foo();
   ...
}

At first glance, I was baffled at the syntax. I had tried doing the obvious

Foo foo = new Foo();

but Eclipse would have none of it. It threw one of these at me when I tried that

No enclosing instance of type Blah is accessible. Must qualify the allocation with an enclosing instance of type Blah (e.g. x.new A() where x is an instance of Blah).

This still made no sense to me after reading. The Syntax just didn't seem right. I was expecting maybe to create an instance of this perhaps:

Foo foo = new Blah.Foo();

but again, that wasn't the case. Anyway, above is apparently how you instantiate a non-static inner class variable. Who knew. You learn something new every day.

Thursday, October 27, 2011

Eclipse, svn, javac and the filesystem have made my day horrible

I've got a strange issue out there that I have not been able to solve. At work, we use svn for source control. As is usual, when I get into the office in the morning, I update from svn and then start my day. At some point, I do a build to make sure everything works before I check code in.

We use ant to build all our projects and run unit tests, do static code analysis etc. When I was doing that today, I noticed that ant barfed on a couple of symbol not found errors. I checked our hudson continuous integration server to see if the build was fine and it was. So, I tracked down the classes in Eclipse. They had been updated recently (though one change was a few days old). However, everything was fine there. The symbols that were not found on the command line did exist in the code. Nearly all my projects in eclipse have warnings, but none had errors. A compile issue is an error in eclipse and would have been flagged as such. 

I was a bit confused. So I did a clean in eclipse, a clean in ant and then rebuilt from ant. Again, same issue. Then I searched for all class files that with the class name to see if something was hanging about. I found 2 class files for that class. But that turned out to be normal. Eclipse creates one and ant creates the other. Incidentally, using the file command against the class file will give you some information on what version of java it was compiled against etc. But none of it was useful in solving my mystery. I used javap to decompile the class files and both of them have the signature for the method in question (its a simple String getter).

I was at a loss as to what to do next. I tried to change the end-of-line characters to Unix to see if that made a difference, but it didn't. I deleted the files, updated it from svn and still have the same problem.

I am at a real loss on what to do next. I have got 4 other people to look at me, and they are stumped as well. None of this code is mine. This code runs fine on the CI server. It runs fine on other machines. 

So, it must be something on my environment. I had made some changes to it recently. I turned off a bunch of Eclipse validation because it was driving me nuts (it took far too long to do things). I turned off file system indexing on Windows (apparently, it will make eclipse faster if you do so). I put my file system in the exclusion list for Sophos anti-virus (apparently, that too will make it faster by disabling the on-access scan anti-virus software does).

None of these things should cause javac to not see a method in a class, especially when the file contains it (I checked the files on the file system as well and they methods are indeed there).

So, if anyone has suggestions on what else to try, let me know. I am going to blow away the entire project where the methods are 'missing' and check it out from svn again as my next step. I don't know if that will make any difference. All I know is, I have had a rather frustrating day where I spent time chasing after bogus errors that stopped me from checking in my code.

Tuesday, April 26, 2011

Hibernate, enumerations and smiley faces

I have a database table that has a column with single character values that are pre-defined. In the application tier, they are mapped as enumerations. So, it can be of value 'A', 'B', 'C' let's say.

Hibernate works well with that when I have to do something like
SELECT * FROM table WHERE columnX = 'A'; 

I use the CriteriaQuery to generate an instance of the object, add the column name, eq, value and viola, I am good to go. I would get an instance of whatever object the table maps to. Great. Keep in mind that my query is a bit more complex (column1 = blah and column2 = blah1 and columnX = 'A').

Now let's say I want to make this somewhat more flexible. In some cases, I need to do this
SELECT * FROM table WHERE columnX = '_'; 

How do I do that with hibernate (given that I am trying to use the enum for the value portion of the Criteria)?

The best I was able to come up with was to pass in null and check in my query creation method whether the passed in value was null; if so, then don't add it to the query (match any single character for a single character column should be the same as not passing in that where clause). Is there a better way of doing that?

Wednesday, April 13, 2011

Which is faster, contains() or indexOf() in a List?

One of the small things I was trying to solve today had to do with figuring out if something is not a member of a list. The list can be arbitrarily long and I need an efficient way of getting the data.

My first attempt to write that was something like:

public static boolean isNotMemberOf( Object type, List invalidTypes) {
return (invalidTypes.indexOf(type) == -1);
}

This makes for ugly reading though. My next attempt was to use the contains method

public static boolean isNotMemberOf( Object type, List invalidTypes) {
return (!invalidTypes.contains(type));
} 

Internally, contains apparently uses the indexOf call. So the question then becomes, which one is faster and what should I do? Should I just use contains for easier readability (and fewer WTFs a month later on, when someone else sees it)?

Tuesday, April 5, 2011

Getting better data for testing

I learned something neat the other day that I thought was worth writing about. I write a lot of unit test code to test the code I am writing. Since I use an ORM, I am able to create the persisted 'objects' in memory using mock factories. These are great because you can do something like
MyObject object = MyObjectMockFactory.create(EntityManager)
object.setProperty(blah);

and then use it in my testing and do something like
assertEquals( expectedValue, object.getProperty);
This is great. I especially enjoy using all that MockFactory based magic to create proper data structures in memory. All the relationships between tables in the database are created properly. There is a slight drawback to this approach though. Say you have an object that you are interested in testing. It is related to 20 other objects that you need to exist for your test. Now, you have to create all those objects, associate them properly so that you can use it in your test. Except you don't care about those objects. You just want them to exist. This starts to get annoying after a while. Imagine the object you are interested in is also relevant to many other classes and tests. All of a sudden, everyone has to create that object and its associated objects over and over for their unit tests. This gets painful (and inconsistent) quickly.

So how can we make this better? One solution I came across was DbUnit. To make this really effective though, I ended up using Jailer to extract the data and use it using DbUnit to do the tests. Jailer is really neat. It allows you to model the data structures you care about, filter it and export it in a DbUnit compatible flat file. Once that is done, you use DbUnit to load up the DbUnit xml files, create the structures in HSQLDB and you're off to the races.

The benefit to using Jailer is that you can have consistent data sets for multiple tests that multiple people can now use without having to build up all those 20 objects one at a time and associating them. All that stuff is now taken care of by a couple of calls to the DbUnit API. 

There are down sides to it for sure. In my case, I have to test for some data that doesn't exist or doesn't match up. That is hard when all the data is exported from a consistent database. But you can doctor that after the model is loaded up. You also need to have representative datasets. As in, if you expect 10 types of orders to be in the database for your tests, the exported data better have that. People also need to know what the data stored in the XML files so that they can use them in the appropriate manner.

I really do like not having to generate tonnes of data artificially; rather, it makes sense to get the data that already exists, plunk it into the model and get on with testing.  And this can be extended to large regression testing models. Generate the model, understand it and add more. OF course, you don't want to bloat your DbUnit tests with large data sets... but you can if you want to I suppose.

Sunday, March 6, 2011

COBOL!

That's right. COBOL. I am learning COBOL. Its a long story as to why. All I can say is, there are some amazing programmers out there who are retiring now who have written some awesome COBOL programs. It is something of a wonder that so much in life that I took for granted runs on COBOL. And until this week,  I had no idea how much of what's out there is dependent on COBOL and other old languages.

From DMVs to supply chains, lots of things run quietly in the background, making life function. A lot of it is not running today's technology; rather, it is running on mainframes with code written years ago. Food for thought eh?

Sunday, February 27, 2011

Why can't I start JBoss on my Linux machine

So, I've been fiddling about JBoss recently with the intention of doing things with EJBs. To do so, I installed the JBoss 6 application server on Windows 7 and Linux (Ubuntu). JBoss starts fine on both environments via the standalone
$JBOSS_HOME/bin/run.sh
script. I think I had to set the JBOSS_HOME variable on Windows, on Ubuntu, either JBoss knows to look in /usr/local/jboss (where I installed it) or it doesn't care about the JBOSS_HOME variable.


What I am having a problem with is the inability to start JBoss from Eclipse on my Linux environment. For whatever reason, JBoss 6 is not one of the server options in Eclipse, so I used JBoss 5 instead. Doing this sorted out the startup and shutdown of JBoss from Eclipse on my Windows environment. No such luck on the Linux one.

It kept trying to start up and I get this error:


In the Console, the only error I see is this:

02:49:50,294 ERROR [AbstractKernelController] Error installing to Instantiated: name=PostEjbJarMetadataDeployer state=Described: java.lang.NoSuchMethodError: javax.annotation.Resource.lookup()Ljava/lang/String;
    at org.jboss.metadata.annotation.creator.AbstractResourceProcessor.createResourceEnvRef(AbstractResourceProcessor.java:394) [:2.0.0.Alpha24]
    at org.jboss.metadata.annotation.creator.AbstractResourceProcessor.process(AbstractResourceProcessor.java:237) [:2.0.0.Alpha24]
    at org.jboss.metadata.annotation.creator.AbstractResourceProcessor.process(AbstractResourceProcessor.java:163) [:2.0.0.Alpha24]



I tried changing the timeout for startup (double click on the JBoss Server in the Servers tab > Timeout > Start (in seconds) to 120) and that seemed to have done the trick. If you run into this, give that a try. It boggles my mind that JBoss takes longer than 50 seconds to start!

Sunday, November 7, 2010

Darn it JSPs!

I learned something really neat... well not so neat about JSPs and how they get compiled.  Say you have something like this:

<% if (request.isUserInRole("user")) { %>

<p>Hey, let's do something with this user role business</p>


<% } %>
<% else if( request.isUserInRole( "guest" ) ) { %>

<p>Let's do something with the guest role </p>

<% } %>

You would think it would work. There's an if statement, then an else if statement... Except, when the JSP compiles, it looks like so:


if (request.isUserInRole("user")) {
      out.write("\n");
      out.write("\n");
      out.write("
<p>Hey, let's do something with this user role business</p>\n");
      out.write("\n");
      out.write("\n");
 }
      out.write("\n");
      out.write("\n"); 
else if( request.isUserInRole( "guest" ) ) {
      out.write("\n");
      out.write("\n");
      out.write("<p>Let's do something with the guest role</p>\n");
}
 Because of those newlines, the if/else if doesn't look right and it throws errors when you run. The only way I was able to get it to work was to put the close brace and the else if in the same statement:

<% } else if( request.isUserInRole( "guest" ) ) { %>

Once that was done, the thing compiled properly and worked fine. A neat little thing to keep in mind when throwing scriptlets in the JSP.

Monday, October 25, 2010

Why can't I view JSPs on my Linux box?

This is a bit insane I must say. I have the following setup: Eclipse Helios, 64-bit JDK (1.6.0_21), Tomcat 6 (6.0.29), and a pretty straightforward JSP that does nothing other than evaluate the date.

I get this crap all the time:

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:268)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
test.test01.MainServlet.goToPage(MainServlet.java:50)
test.test01.MainServlet.doGet(MainServlet.java:36)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause


java.lang.NoClassDefFoundError: javax/el/ELResolver
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
java.lang.ClassLoader.defineClass(ClassLoader.java:616)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
java.net.URLClassLoader.access$000(URLClassLoader.java:58)
java.net.URLClassLoader$1.run(URLClassLoader.java:197)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
java.lang.ClassLoader.loadClass(ClassLoader.java:296)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
java.lang.ClassLoader.loadClass(ClassLoader.java:296)
java.lang.ClassLoader.loadClass(ClassLoader.java:248)
org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:209)
org.apache.jsp.WEB_002dINF.jsp.search_jsp._jspInit(search_jsp.java:22)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
test.test01.MainServlet.goToPage(MainServlet.java:50)
test.test01.MainServlet.doGet(MainServlet.java:36)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 I have checked everything I can think of (JAVA_HOME, CATALINA_HOME variables) and all check out okay. The project in eclipse is a dynamic web project and has all the $CATALINA_HOME/lib jar files in it including the el-api.jar file.

So what gives? The real annoying thing about this whole process is that I can export the war file, pop it onto my windows machine and it works just fine! I tried doing the same with Tomcat on Ubuntu and running it from there directly but am no better off. So, anyone know what the heck I am doing wrong?

Thursday, June 3, 2010

Dynamic graphing in the web world

Instead of studying for my midterm, I am sitting here wondering if there is a way to create and interact with dynamic graphs in the web-based world. I don't know of too many things that are even out there that behave in the manner I envision, apart from perhaps the charts in google finance.

What I want to accomplish can be done using Swing and Java. I suppose I could create an applet that allows you to interact with the data and do things with it. My main motivation for having the ability to interact with data is the following use-case. 

Where I work, we use an HP tool called LoadRunner. It has a fairly useful (if sometimes annoying) tool called LoadRunner Analysis. This tool allows you to dynamically select regions of the various graphs it displays to the end user and then does stuff (in this case, updates the data you see to align with the regions of the graph you selected). Data it presents includes things like averages of whatever you happen to be looking for on the graph, max, mins, that sort of thing. 

We also have similar data externally. One example is the verbose GC logs of the JVM we use. It would be useful if I could find a way to graph the data in a reasonable manner and then interact with it by highlighting regions of interest and then finding out for example when the last full GC was or what the average time is between two young GCs or how much space on average is gained after a full GC in that selected time-frame. 

I suspect something like the dynamic 2D graphs that google finance uses would be sufficient to do most of this work, but I have never seen it used anywhere else before. So, does anyone know what I am talking about and how to go about implementing it?

Friday, February 12, 2010

Trying to use the Java plugin in Firefox

I've been trying forever to get the Java plugin to work on Firefox on Linux. There is an Ubuntu specific way to do it but I don't want to use apt to install it. My JDK is installed in /usr/local/jdk1.6.0_18.

So how do I do it? Used to be, you could go into the mozilla/plugins folder and you link the libjavaplugin_oji.so from the jre/plugins folder. Except no such file exists on my installation of the JDK. After searching on google and looking at official documentation from Oracle/Sun, I saw others have it... but not me. Turns out that my JDK is 64-bit and the setup is different. From one of the Oracle/Sun forums, I noticed that the name and path to the plugin are now different on the 64-bit version of the 1.6 JDK.

So, in my case, the plugin is located at
/usr/local/jdk1.6.0_18/jre/lib/amd64/libnpjp2.so
and by creating a symbolic link to it in ~/.mozilla/plugins, I have access to the Java plugin now. I needed that to use webex on my Ubuntu machine.

Tuesday, April 28, 2009

How do I set JAVA_HOME in Ubuntu so it works

I recently installed Ubuntu 9.04. And then I installed eclipse. I am trying to start it from an icon (yes, its via an icon... don't judge!) and am having an issue with setting the JAVA_HOME and PATH variables correctly.

When I kick off from a bash shell, the PATH is correct. But not from the panel in gnome. Of course, in the bash shell, I have both those variables set in ~/.bashrc. However, when I log in via the gdm, that file does not get read. I am trying to figure out what file gets read when I login so I can set the JAVA_HOME variable. I tried adding it to /etc/environment file, but I am at a loss as to how to add $JAVA_HOME/bin to the $PATH variable. For now, I start eclipse via the icon using

/usr/local/eclipse -vm /usr/local/jdk1.6.0_13/bin/java
and that works just fine for me...

Do I need the Java EE editor to work with Tomcat

I am pretty certain that all I have at work is a regular Java IDE and I am able to muck about with Tomcat... mind you, I don't deploy anything onto Tomcat via a 'Server' option. So, how come I can't do that easily with my regular IDE? I tried to install the Java EE development patches via Eclipse and it threw an error at me. I've seen the same requirement for some glassfish tutorials I was following before.

Is it because of that 'Server' feature that I need the EE version of Eclipse? I don't mind installing it, I was just curious. Anyone know?

Saturday, January 31, 2009

Hello World BlackBerry Storm Style

As with any new development project, one starts off with a simple 'Hello World' application. And so it is with the BlackBerry and Java code on it. I had a bunch of trouble getting the BlackBerry Eclipse plugin to work properly with Eclipse, but after installing, un-installing and generally cursing the damn thing a few times, I got it to work. I think the big trick was to understand that there are 2 things one needs to install:
  • The BlackBerry JDE plugin for Eclipse and
  • The BlackBerry Component pack (4.5.0, though I was able to build for the 4.7 device...)
A separate post on getting the JDE plugin to work and some questions related to that shortly. For now, here's how I got Hello World to work... I followed the instructions from the Thinking Blackberry blog. Below are the screenshots on the 5930 device running the 4.7 OS. There is also the helpful video put out by the BlackBerry folks themselves that I used as well.

Sunday, January 25, 2009

Mobile Application Development

Anyone ever done application development for the mobile platform? I think I've got something going on for the RIM platform. So far, I've got few details that I am not allowed to share... but I have eclipse setup and started working on getting familiar with the RIM Java development tools. I am excited. I've been down this path before and failed. And it was a rough loss.

We (a few other friends) used to sit and wonder at what all we did wrong. We moved on to do other things. One of us works for a search engine, another does QA for a network device manufacturer, another is a Requirements person (he uses terms like MRD). We've learned a tonne since we tried the last time. I think we've learned a lot about how to make businesses work. I just hope we learn a tonne more soon... and succeed. More details to follow. Wish us luck.

Sunday, August 31, 2008

How does one go about documenting complex tools?

I am now writing Java code (hooray for me) and playing around with Ant as part of my work. It isn't entirely tout le monde type stuff but it isn't anything spectacular. Yet. So, to my (much disappointed) audience, I ask, how does one go about learning about any system that is full of things one has little idea of? I learn by trying things and documenting them... but where do I start? From top down? From bottom up? What if I don't know where the bottom is?

Also what are the rules about changing someone else's work? Do you just go ahead and change things willy-nilly? Is there such a thing as respecting someone else's creations and working around them?

Oh, so many questions!

Sunday, March 30, 2008

I win!

Damn you eclipse, you drove me nuts for a while. DAMN. I spent good chunks of my nights and weekends fighting you. I was about to give up and go back to Windows Vista. Damn. I need to update all my newly found Goran Bregović music anyway. Quite a few people mused about what it could be. They were right, somewhat. So, what was it in the end? Lets see.

I install ubuntu. I have no idea what version... The installer decided to install x86_64. Why? Well, I have a 64-bit compatible chip. Well, when you go to eclipse.org and download eclipse, they figure out somehow that I am running a 64-bit version of the OS and let me download the 64-bit version of eclipse. I didn't notice. I installed eclipse. All is good. Or so I thought. I try and fire it up. Nothing happens except for the error. You would think that something so large would log something somewhere. No such luck. I looked in the obvious place: ~/.eclipse. I ran eclipse -clean. No luck.

I searched google. Ubuntu docs say to use apt-get install eclipse. I tried that. No luck. And it installed all sorts of gcj nonsense that I don't really want. I want Sun JDK. More searching ensued. Hours went by. I watched Borat along the way. Its just as much fun the second time around (I watched it the first time on my second trip to Washington DC). Yet more searching. I checked all sorts of things. I tried to launch it manually. You know with all the 50 arguments it needs to start. Still no luck. And quite frustratingly, no log file that says 'Oh by the way, you need blah' or 'you are missing something X that I need in order to run properly'. Grrrrrr.

I ended up searching for stuff specific to Ubuntu and Eclipse and Linux and somehow I ended up on an eclipse.org page. They mention a log file in there too. I didn't find one anywhere. But it was at that point that I ran a uname -a. I had previously also tried to try and start eclipse using Java 1.5 (release 15) but still no luck. Well, uname -a told me I was running x86_64. I kept going. I downloaded the x64 version of Sun's JDK. Hmmm. I installed it. It wanted to overwrite stuff in the 32-bit JDK folder. I decided to wipe out all the 32-bit JDKs. I installed the 64-bit JDK. I ran ./eclipse once more. Would you believe it, I was asked to pick a workspace!

So much for all that checking. Silly me, I should have checked all that before I went about searching google. One issue I still have though is: if eclipse won't start, how the <deleted expletive> am I supposed to know that it is a 64-bit version of eclipse and requires a 64-bit JVM (or a modified start process with a -d32 flag or something)?

Oh well, so much for all that. I have eclipse running. Let that be a lesson to all of you. 64-bit computing is a pain in the ass.

Thursday, March 27, 2008

Getting Eclipse to work in Linux

Getting Eclipse to start in Linux is a nighmare. You can't just double click on stuff like in Windows. Right now, the error I get when I try and start eclipse, I get the error:


JVM terminated. Exit code=13
/usr/local/jdk1.6.0_05/bin/java
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-jar /usr/local/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
-os linux
-ws gtk
-arch x86_64
-showsplash
-launcher /usr/local/eclipse/eclipse
-name Eclipse
--launcher.library /usr/local/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.3.R33x_v20080118/eclipse_1023.so
-startup /usr/local/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
-exitdata aa8030
-vm /usr/local/jdk1.6.0_05/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-jar /usr/local/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
I launched the thing using
/usr/local/eclipse/eclipse -vm /usr/local/jdk1.6.0_05/bin/

Lets see how it goes... I am not giving up yet.

Monday, March 24, 2008

Sorry, I promise to do better

To my dear mentor and to my team mate... I do apologise for my lack of working. Its past 1am and I am up. But I assure you I have an ace up my sleeve now, I promise. What is it? Ubuntu 8. Installed via Wubi.

All I need to do now is apt-get install eclipse... okay, well maybe that was a dumb thing to say. I'll do in manually of course. But I assure you, now that I have a happy development environment without any crazy ass security (aside from selinux, but that's another story). I will be back soon, I promise. In the meantime, join the revolution, join Mao and step on the Tibetans... Not.

Nemo me impune lacessit as the good lads from the Black Watch would say. BTW, little known trivia fact; I do indeed own an 18 oz Black Watch kilt with highland hose and flashes... no sporran though. Yet.