I want to shoot a ray. And not just parallel to one of the axis of the cartesion coordinate system. I want to look in a direction and shoot a ray in that direction. I want to be able to shoot aray in any direction and walk on it. Like certain ice based superheros. And now I can do that.
Continue reading
Category Archives: Java
Circles in Minecraft?
Minecraft is a land of Cubes. And yet, in this blockland, it turns out the circle is a very powerful tool. Using the basics of trigonometry, we can build all sorts of things.
Continue reading
Identity work for the OpenStack Newton release
The Newton Summit is behind us, and we have six months to prepare for the next release in both upstream OpenStack and RDO. Here is my attempt to build a prioritized list of the large tasks I want to tackle in this release.
Parameter Names in Java 8
There is a killer feature in Java 8, and it is not Lambdas.
Array of Parameter Names in Java
My last post suggested an extension to the Java language that I think will be quite helpful. Until such a feature exists, we can fake it by using annotations.
Continue reading
Parameter Names in Java
There is a very small feature that could be added to Java in order to improve it significantly: Add names to the Parameter object in the Reflection API.
Continue reading
Tomcat Simple Bind to FreeIPA
An Identity Management Solution is no good if you can’t use it from your server applications. Here are the steps you can go through to get your server working along side FreeIPA.
Java Web Applications in Fedora
Fedora and Debian play the role where many chaotic projects get a degree of charm school: they learn to play nice with a lot of other projects. In Fedora, as near as I can tell, there is only one Java based web application packages as part of the distribution: Dogtag, the Public Key Infrastructure server. As we look at how PKI should look in the future, the dearth of comparable applications packaged for Fedora leaves us with the opportunity for defining a logical and simple standard packing scheme. While I am not there yet, this post is the start of my attempts to organize my thoughts on the subject. I’m looking for input.
JSS Sockets and HttpClient
The Java bindings for the Network Security Services (NSS) Library is called JSS. NSS provides a key management scheme that is different enough from both standard Java and OpenSSL that trying to do standard Java Socket operations using the Apache HttpClient requires a little bit of extra work.
Finding Java Classes
I’m back on a Java project. Been a while, and I want to capture some of the tricks I’m using.
Right now, I’m just trying to import the project into eclipse. Seems that the current team members don’t use it. I’m an IDE kind of guy, at least when it comes to Java.
Building the .classpath file can be tricky. However, since I know that I have a good build, and that this project it a good participant in the Fedora build process, I have the advantage of knowing that my packages reside in /usr/share/java. Still, all eclipse gives me is a set of classes that it can’t find. how to find them?
This project uses CMake. I could look for all of the Jar files in the CMakeLists.txt files, and I might do that in the future. However, a trick I’ve developed in the past has come in handy.
class2path(){ echo $1 | sed 's!\.!\/!g' } JDIR=/usr/share/java make_alljars(){ for JAR in `find /usr/share/java -name \*.jar -type f ` do for CLASS in `jar -tf $JAR | grep \.class` do echo $JAR $CLASS done done > /tmp/alljars.txt }
First, the make_alljars function creates a map in (value key) order. The value is the Jar file name, and the key is the class name. To fine a Jar file that contains a given class (in this example netscape.ldap.LDAPConnection) , run:
grep `class2path netscape.ldap.LDAPConnection` /tmp/alljars.txt
And the output is
/usr/share/java/ldapjdk.jar netscape/ldap/LDAPConnection$ResponseControls.class /usr/share/java/ldapjdk.jar netscape/ldap/LDAPConnection.class
This works really well with eclipse, in that the error messages have the name of the class. You can then just highlight the class name, paste it into the command line in place of the class I have above, and when you get the Jar file name, you can highlight to save to the clipboard. From The right click context menu pick Java Build Path and then Add External Archive and then paste the whole path in.