Friday, December 30, 2011

JavaScript as a first language?

John Resig, noted JavaScript demigod, blogs about teaching JavaScript as a first language at the Kahn academy (http://www.khanacademy.org/).

I can see the advantages, I mean:
  1. it is everywhere
  2. no debug, compile cycle
  3. fast path to visual results
  4. job market is great
This still feels a little weird to me though. I mean JavaScript is such a franken-language. Or maybe it's me and too many years of Java as my bread and butter. I have been trained to think of OO and classical inheritance as the one true religion. But how in the world do you explain closures or the === versus the == operator or the bizarre behavior of with in JavaScript to a new person. Or do you just say "hey, this is a pretty cool language but some parts totally stink and all of this happened in the go go 90's when this whole internet thing was blowing up so just use this subset of the language and these libraries and you'll be fine"?

Thursday, December 22, 2011

Open Source Physics Rocks!

This is so cool, great site with tons of physics resources. The coolest part for me is the simulations. They use Java of course but this team has put together a nice tool set for building and bundling simulations. So you can describe a pendulum experiment and then bundle the simulation into a double clickable jar that will play on any platform.

http://www.compadre.org/osp/index.cfm

Simulations here
http://www.compadre.org/osp/search/categories.cfm?t=Simulation

For example, Doppler effect
http://www.compadre.org/OSP/document/ServeFile.cfm?ID=7902&DocID=678

Tuesday, December 20, 2011

JavaFX now shipping as part of SDK but it's not truly cross platform???

This is good but what the heck, the system requirements are still windows? I mean something shouldn't go into the JDK until it is truly cross platform. I can't make up my mind about whether to be excited about JavaFX or not. There have been so many disappointments with Java GUI technology. And HTML5 is certainly sweeping the land. But if Java shops could crank out rich interfaces using nothing but their Java skills then it would be a big win even if it mainly is used in intra-company apps.

I saw this on Adam Bien's blog
http://www.adam-bien.com/roller/abien/entry/java_fx_2_8230_comes

The JDK release notes
http://www.oracle.com/technetwork/java/javase/7u2-relnotes-1394228.html

JavaFX system requirements
http://docs.oracle.com/javafx/2.0/system_requirements/jfxpub-system_requirements.htm

Monday, December 12, 2011

Spring context viewer

Spring is a great tool but in a large code base with component scanning and autowiring it can be really easy to lose a handle on exactly what your application context looks like. I had just such a problem at work the other day where I needed a structured view of my Spring app context. This was a context at the war level that had another context as a parent at the ear level. There were some classloader issues involved. Anyway, I was able to query the context to figure out what I needed, but after work I thought about writing a quick ascii tree view of the context. It wasn't too hard and you get something like this.


 === Spring ApplicationContext Info ===
+<ApplicationContext 'shared.context'>
     -startupDate: 12/12/2011 09:19:14.667
     -id: shared.context
     -identityHashCode: 567e768e
     -classloader: EarLibClassLoader : urlSet = [URLEntry : file:/C:/code/sctx/dist/gfde....

Sunday, December 11, 2011

So Android was kind of an accident?

So in the latest hacker news there is a really interesting article about how Google acquired the base of Android from a Palo Alto startup. I had assumed that Google had carefully engineered Android as a natural evolution of their need to grow the mobile space into a platform for their advertising. But it seems, like always, the real world has a lot to do with chance and unforeseen consequences.

http://nikcub.appspot.com/posts/google-android-the-accidental-empire

Wednesday, December 7, 2011

Blazemeter is JMeter in the cloud

From the "why didn't I think of this" department. These guys took JMeter, the ubiquitous Java test tool, and put it in the cloud. When I have used JMeter before that was definitely a pain point, setting up all the distributed JMeter instances (which, I think used RMI to communicate which is always fun).

I just wonder how useful this is for QA testing though, since most folks have their QA instance internal instead of publicly accessible.

http://www.datamation.com/open-source/blazemeter-brings-apache-jmeter-to-cloud.html

I wonder what other open source tools are being "cloud-ified"?

Tired of paying WebEx, then try OpenMeetings

OpenMeetings is a nice project, available to download and run yourself (free and open source) or they have a hosted service. Not all of the WebEx features but an impressive feature set nonetheless. They are incubating at Apache too so that's nice.

http://code.google.com/p/openmeetings/

Monday, December 5, 2011

BitNami Tomcat stack

Ok, so it's been a while since I used a BitNami stack - I think I last used them to setup a Wordpress stack or some other PHP thingy. But since I'm mainly a Java guy I was happy to see that they have a nice Tomcat stack (either 6 or 7) + MySQL. You can pick from the usual native installers or VMWare images or EC2 AMIs.

http://bitnami.org/stack/tomcatstack

Sunday, December 4, 2011

The Twelve-Factor App is a must read if you are writing software as a service

This is a really powerful article. Boils down to 12 principle the best practices for building scalable, testable and reliable web apps. The goals are in the introduction but are worth repeating:
  • Use declarative formats for setup automation, to minimize time and cost for new developers joining the project;
  • Have a clean contract with the underlying operating system, offering maximum portability between execution environments;
  • Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration;
  • Minimize divergence between development and production, enabling continuous deployment for maximum agility;
  • And can scale up without significant changes to tooling, architecture, or development practices.


Read the full article here: http://www.12factor.net/

Saturday, December 3, 2011

Java and Kerberos (krb5.conf)

I had an interesting situation the other day where I needed to restrict the encryption types used in a Java webapp that authenticated via Kerberos. This is pretty common in that Kerberos is the default authentication protocol for Windows 2000 and onwards.

Now Kerberos and Active Directory are huge topics so I'm only going to focus on one thing that tripped me up, namely, where is the krb5.conf file for a Java application and what in the world can you use it for. Well it turns out the krb5.conf is a very useful file if you need to tweak things. Here is how you tell Java where your krb5.conf file is:

-Djava.security.krb5.conf=/path/to/your/krb5.conf

Now you need to make sure that you aren't setting either of these parameters or your krb5.conf file will be ignored:

-Djava.security.krb5.realm
-Djava.security.krb5.kdc

So inside your krb5.conf file, you can set your realm & kdc (key distribution center), your default realm and the default encryption types. Different versions of Windows Domain Controllers differ in the encryption types they support so you may need to tweak the following lines (they may have different types in your file, depending on Java version):

default_tkt_enctypes = aes128-cts des3-cbc-sha1 rc4-hmac des-cbc-md5 des-cbc-crc
default_tgs_enctypes = aes128-cts des3-cbc-sha1 rc4-hmac des-cbc-md5 des-cbc-crc
permitted_enctypes = aes128-cts des3-cbc-sha1 rc4-hmac des-cbc-md5 des-cbc-crc


The following links are quite helpful:

Java6 security tech note - new features
Java security tech note - troubleshooting
Wikipedia - Kerberos
Forum posting for encryption type difference between Windows Server 2003 and 2008

Great introduction to setting up a working python development environment

Best overall introduction to setting up your python work environment I have seen. Really good practical info on packaging and dependecy management (virtualenv, pip), the different python versions and important frameworks (django, fabric, flask, scipy).

For Java folks, this is the equivalent of telling a new Java programmer about Maven, Ant, Spring, etc.

http://mirnazim.org/writings/python-ecosystem-introduction/