May 28th, 2013 by Lincoln Baxter III

Announcing PrettyTime :: NLP Natural Date Processing

If you have ever used Google Calendar, Siri, Android Voice Command or other natural language tools, you might be familiar with convenient calendar features and voice calendar control. android_voice_scheduling “Schedule a dinner party for six pm, next Thursday,” and The start time for your dinner party conveniently shows up, ready for your finishing touch. But how does this work? Can we use it for our own applications?

If you’ve given this a bit of thought, you’ve probably figured out that in order to understand grammar, the nearly infinite possible combinations of words, expressions, numbers, and dialects should require a not insignificant amount of computing power, and a good deal of creativity.

April 3rd, 2013 by Lincoln Baxter III

Set up an anti-spam filter for your website with mod_security and fail2ban

top apache2 cpu usage

Frequently spammers target products such as wordpress, web forum software, phpMyAdmin, and other common tools used by hobbyist and professional website administrators.

Whether you are hosting your own blog, or running a website for your company or more, it can be difficult to deal with the increasing amount of malicious web traffic seen on a daily basis, while still allowing friendly crawlers such as Google, Yahoo, and MSN search engines.

This harmful and wasteful traffic may damage your system or simply waste its resources, slowing down the site for your more welcome users. If this sounds familiar to you, but your page hits don’t seem to add up, then you may want to consider taking some of the measures outlined below in order to secure your site from harmful hacks and sluggish spam.

January 4th, 2013 by Lincoln Baxter III

JavaScript is the new Perl

perl_logo javascript_logo_unofficial

I don’t think we will see a “winner” of the browser-language wars any time soon, but there will be a winner. JavaScript hype is still through the roof, and with the discovery of a dynamic language in the browser actually works decently between late browsers, people are thoroughly excited; however, I’d akin this to people discovering Perl during the advent of C and C++. Does it work? Yes. Is it pretty? Not by a long shot.

Don’t get me wrong, I love Perl – I think it’s an incredibly powerful and fun language that now suffers from the bad reputation it acquired before gaining true object-oriented features – but, those who hate Perl hate it because it’s “too hard to maintain” and too “strange.” So if you want to talk about a strange language, look at JavaScript – it’s like Perl times ten. At least Perl has a consistent type inferencing and enforceable namespacing! (I think you’d have a hard time arguing that enforceable namespacing is a bad thing… global variable collisions can result in some pretty nasty bugs, particularly because it is easy to never see the downstream impact.)

Point being? As someone who has already gone through several language hypes and paradigm shifts in Computer Science (even in my relatively short 14 year experience,) JavaScript is a lot like Perl – extremely powerful, but a potential maintenance nightmare if one is not extremely diligent – and while I do like both languages, JavaScript just waiting for the next technology to come around and make it look like Perl does today: pervasive, but lacking enterprise adoption on large applications.

December 24th, 2012 by Lincoln Baxter III

2013 Holiday technology recap and predictions

christmas_wreath

Happy holidays, I hope everyone is relaxing and having a great time with their families and loved ones. To help see out the last year, and ring in the new one, I’ve prepared a (hopefully relaxing) article on some trends we’ve seen in 2012, and what that could mean for us in the next year and years to come. So if you want to take a break from the holiday din, then head over to JAXEnter and check out my article. The technologies I discuss are Rewrite, OCPsoft’s own, and Errai, by Red Hat.

Be safe, and I’ll see you all in the new year, ~Lincoln

December 5th, 2012 by Lincoln Baxter III

[announcement] Guide to translate PrettyTime to your native language

If you’ve ever looked for social-style date formatting for Java, to create timestamps like, “2 minutes from now” or “3 months ago,” [[PrettyTime]] is probably the tool you’ve ended up with, and as you might know, it supports over 25 languages and dialects – a great number to be sure. But what happens when you come across one of the over 4500 living languages that are not supported?

Well, then it’s time to do some translation, and in order to help you manage this task, we’ve created a guide to help you get through as quickly and easily as possible. When you’re done, you might even want to submit your translation back to us so that everyone else can benefit from your hard work. The guide covers this, too. It takes only a minute or so to read the guide and get started! Let us know how you do.

November 2nd, 2012 by Lincoln Baxter III

[video] GWT and Errai UI Quickstart

I wish I had a magic GWT + Errai quickstart tutorial for you. But in fact, I do! Check out this video, and the tutorial below, to start your adventure with client side HTML5 templating in GWT!

September 19th, 2012 by Lincoln Baxter III

How to @Inject Enum values into CDI beans

I was recently asked how to Inject a Java Enum into a bean constructor using CDI. This turns out to be a fairly interesting situation, because enums are not usually available for Injection.

September 18th, 2012 by Lincoln Baxter III

New tutorial: Regular expressions

Do you love regular expressions as much as I do?

Well even if you don’t, I am pleased to announce a new tutorial: “OCPsoft’s guide to [[Regular Expressions]].” As part of an ongoing initiative to promote awareness of regular expressions, and how they are used both as a general technology, but also specifically as applied to the Java programming language, we will be continuing to add new example-based guides to this course.

Please feel free to post questions and comments if there are topics or specific problems that you would like to see addressed. We will do our best to answer your questions and share the knowledge!

Check out [[Regular Expressions|the tutorial]].

Enjoy!
~Lincoln

August 22nd, 2012 by Lincoln Baxter III

[video] Enhance developer productivity, usability, and security

Java EE is already the perfect solution for complex business/enterprise systems and provides all the tools and foundations required to deliver scalable, performant applications for a wide variety of customers and clients.

But how does the end user experience stack up? How easy is it to navigate through your Website? Is your code full of nasty navigation logic? Are your links clear, transparent, and informative? Do you find yourself adding ‘?query=parameters’ in order to serve dynamic content from your application? Can you ensure that you are not leaking information in your URLs, and that your applications are secure from URL-based attacks? Are your old links making it difficult to migrate or integrate a legacy application to a new one?

These are all things that URL rewriting can help with, and if you are uncertain about any of these questions, this talk is for you. Watch this session from JAXConf 2012 and see what’s possible with the power of URL-rewriting.

For more information on the [[Rewrite]] project, visit the project homepage at [[Rewrite | OCPsoft]], and be sure to check out all of the other cool Java open-source projects while you’re here.
August 21st, 2012 by Lincoln Baxter III

Get started quickly with Hibernate Annotations and JPA2

Getting started with Hibernate and JPA (Java Persistence API) can be tricky, but this step-by-step tutorial explains exactly what needs to be done to set up your application to use this technology. This chapter covers very basic mapping and persistence.

When we are finished with this tutorial, we will have a standalone Java SE application with database connectivity. This article is part of a series: Guide to Hibernate Annotations.