Parsing JSON via ScriptEngine in the JDK

I’m writing some REST WebServices that return JSON and wanted to ensure that my JSON was correctly formatted and parsable. Since the JDK ships with a JavaScript engine built into it now, I figured it would be simplest to just use that and avoid any external dependencies. Here’s my code: ScriptEngine se = new ScriptEngineManager().getEngineByExtension(“js”); […]

IntelliJ refresh

I’ve been using IntelliJ IDEA for the past 7 years and anyone who knows me will tell you that I’m an IDE snob. However, over the past 7 years I have been using the exact same configuration for IntelliJ IDEA and all of my project files have rarely changed. Over those 7 years I would […]

Inversoft's new website and products

   Last week Inversoft launched the Clean Speak family of products and our new website. Clean Speak is a complete rewrite of our old profanity products and our website is a complete rebrand of our company. Clean Speak includes all of the same features of the older profanity products and many new ones. Here are […]

Hibernate/JPA with missing tables

For some of the Inversoft products I’ve been adding new tables for new features into our standard schema. The tricky part with updating the database is also giving customers all the update scripts that they need to run and instructions on how to run them correctly. I figured I’d see what happened if I added […]

Fixing Java tools on Snow Leopard

I was attempting to work with VisualVM and Tomcat over the past few days on Snow Leopard and it was constantly failing. I was getting errors like this: “attach: task_for_pid(59980) failed (5)” I was also getting errors inside VisualVM and from the command like using jmap that went like this: Attaching to process ID 61218, […]

C++ references

Assigning reference return value to a variable When assigning a reference return value to a variable, a copy is made. Here is an example: class References { private: std::string name; public: References(const std::string& name) : name(name) { }; virtual ~References() { }; const std::string& getName() const { return name; }; }; References r(“foo”); std::string n […]

Fixing macbook wake up problems

One of the family Apple notebooks (a Macbook) was having some issues waking up from sleep periodically. It was also having issues when the lid was closed the fan would constantly spin as though the machine was overheating. I took the machine into the only Apple store I trust (the main tech there is pretty […]

Generic variable to the current type

I just noticed that I’ve been using the Builder pattern with method chaining a lot. Looks like this: FooBuilder builder = new FooBuilder(); Foo foo = builder.add(…).divide(…).multiple(…).builder(); The issue that arises is that I want to store a bunch of methods in a base class that various builders can use. In order to do this […]

Inferred typing

I know that .Net 4 is going to have some pretty cool features around dynamic typing and C++0x is also adding some auto typing features. I was thinking about all of this today and realized that what I really use most of the time is an inferred type. Essentially it would infer a new type […]