Send mail easily from a Java application with Mandrill

Mandrill SMTP (Simian Mail Transfer Protocol)

Does sending emails from your java program have you red in the face? Mandrill’s red on the other end but they’ll take care of your emails and take the stress off of you.
The java wrapper for the Mandrill web service allows your java application to use a powerful REST-based email web service with a powerful and rapidly increasing feature set.

Continue reading

Posted in Uncategorized | Leave a comment

Technology introduction – Will grandma use it?

I was on a cruise this past week when I learned that Steve Jobs had died. I watched a short news story that tried to discuss why he was such an important figure in technology but I think they completely missed the mark.

New technologies need to pass the grandma test: if the average grandma couldn’t figure it out or just plain wouldn’t use it, it’s likely not going to be successful. Whether you think Apple products are aesthetically pleasing or not, the majority of their design focuses on simplicity; I think this is the essence of their success.

While on the ship almost everything works through a single plastic card with a magnetic stripe and a single bar code: room access, payments for purchases, and tracking ingress and egress. Everybody seems to handle this well, even grandma. There are more advanced things you can do with the card like balance tracking on your in-room TV and modifying information on an interactive touchscreen kiosk. The fact that the card does almost everything and is simple to use is why it’s a winner. The fact that more advanced users have the option for further use makes it even better.

This is exactly what someone at Apple likely figured out. If you cater to the widest possible audience by making something so powerful easy to use you’re almost guaranteed success. The pair of 80 somethings talking about sending picture messages and using cell phone video conferencing is certainly evidence of this. Make it simple, make it powerful, try to manufacture it fast enough to keep up with demand.

Posted in Uncategorized | Tagged , , , | 2 Comments

Loading CSS from a JAR file evaluating EL

Yesterday I briefly explained how I was loading CSS files from a JAR and forcing their content through Velocity to evaluate expressions.  A co-worker offered up a more simple solution, it’s after the break.

Continue reading

Posted in CSS, Java, Programming, Web Development | Tagged , , | 1 Comment

Loading CSS from a JAR file

Recently a co-worker created a jar with common utilities in it including some JSP tags. The tag was easy enough to deal with but how do you load CSS/JS from a jar file? His solution was pretty simple; create a servlet that lives in the JAR that loads resources off of the classpath. All you had to do then was map the servlet in the webapp where you want to use it and it would snag requests and “serve” content from the JAR. This was good enough for static files but what about the CSS with paths that changed based on environment?

Continue reading

Posted in CSS, Programming, Velocity, Web Development | Tagged , , , , | Leave a comment

Spring MVC AJAX web services Part 2, attack of the JSON post

Previously I covered how to create simple AJAX web services using Spring MVC and annotated controllers. This made it very easy to create robust services that automatically convert your java beans into JSON for easy consumption by your AJAX client. In this post, I’ll show how to use a simple javascript library to convert your HTML form into a JSON object that your Spring controller can consume and marshal to a java bean automagically. Continue reading

Posted in Java, Javascript, jQuery, JSON, Programming, Spring | Tagged , , , , , , | 1 Comment

Cygwin Gotchas

I’m going to use this post to detail issues I run into when using cygwin on windows so I’ll be able to easily find them when I have that “Oh, I’ve run into this before” moment.

Environment Variables:
Cygwin only converts the PATH variable automatically. Any other variables you may need will have to be added to your .bashrc file in your home directory.

Missing default functionality:
By default, cygwin doesn’t install the clear command. Annoying, right? Ctrl + L will clear the buffer and do the same thing essentially.

Posted in Programming | Tagged , , , | Leave a comment

Spring MVC AJAX web services

With SpringMVC, writing REST type web services is brain-dead simple. The Jackson mapper is a very powerful library that automatically converts your POJOs to and from JSON without any interaction from you. Think it’s too good to be true?  It’s not! Continue reading

Posted in Javascript, JSON, Programming, Spring, Web Development | 2 Comments

Java ORM using mongoDB part 2

Previously I briefly introduced the mjorm mongo-java-ORM solution I found. This post will go more in-depth and give more specific examples of querying, creating, and removing records from your mongoDB instance. If you don’t already have mongoDB, you’ll need it for this tutorial. After I’m through with my dog and pony show, I’ll provide a link to download a copy of the app that will be created throughout the tutorial. Continue reading

Posted in Data Store, Java, ORM, Programming | Tagged , , | 2 Comments

IE inconsistencies

I’ll keep a running list of new items I find that are inconsistent between Internet Explorer and other browsers. I’ll skip most of the stuff that’s already public knowledge.

Internet Explorer doesn’t treat z-index for absolutely positioned objects the same as other browsers: it creates a new “stack” of objects that it re-indexes based on the z-index of the nearest relatively positioned ancestor. If you’ve got an absolutely positioned div that’s supposed to have a z-index that’s higher than something else within another div, make sure its ancestor has the appropriate z-index. The following will give you what you want.

<div style="position: relative; z-index: 999">
<div id="inner" style="position: absolute: top: 0, left: 0;">
Yay, I'm indexed
</div>
</div>

This will not:

<div style="position: relative;">
<div id="inner" style="position: absolute: top: 0,
left: 0; z-index: 999">
Boo, I'm not indexed
</div>
</div>

IE’s javascript engine is pretty sorry. It’s got plenty of bugs but the one I found today has to deal with boolean equality. In every other browser if the element is disabled this evaluates to true but IE evaluates it to false.

$('#element').attr('disabled') == 'true';
Posted in Browser Issues, Javascript, Programming | Tagged , , , | Leave a comment

595 Shift Register Simulator

Sometimes when creating a controller using a microcontroller, you run out of output pins; usually when driving displays. A 595 serial-in parallel-out shift register allows you to control up to 8 lines of data using four microcontroller pins. You can also cascade multiple 595 ICs together to enable even more outputs without using additional pins. Click here to check out the simulator and hopefully learn how to use a shift register.

Posted in Hardware, ICs | Tagged , , | Leave a comment