Archive | Programming

RSS feed for this section

imgscalr 4.2 Released

Quick heads up to the Java developers out there using the imgscalr Image Processing Library, version 4.2 was just released! There is 1 new feature in this release and 1 bugfix: New Feature: New ULTRA_QUALITY scaling Method provides the nicest looking scaling result typically better than GIMP’s highest quality scaling method (Lanczos3)! Bug Fix: When […]

Read full story Comments { 0 }

imgscalr is Available from the Central Maven Repository

imgscalr is a tight and simple image manipulation library for Java. As imgscalr’s popularity has grown more and more people have asked for access to it via Maven’s central repository. While The Buzz Media has provided access to imgscalr via our own Maven repo as well as GitHub downloads, developers have pointed out that it […]

Read full story Comments { 1 }

imgscalr 4.0 released – Optimal Java Image Scaling

imgscalr is an optimized, fault-tolerant and simple Java library used to resize, rotate, filter, crop or pad images. imgscalr implements the most optimal code-paths for these tasks as recommended by the Java2D team and internally works around a number of hidden JDK and even JVM bugs pertaining to image operations via the Java2D pipeline. imgscalr […]

Read full story Comments { 3 }

AWS Elastic Load Balancer sends 2 Million Netflix API Requests to Wrong Customer

What is it? If you are unfamiliar with Amazon Web Services (AWS) or their Elastic Load Balancer (ELB) service, ELB is a load-balancing service that you can use to spread incoming traffic across many different EC2 server instances. ELB, like all things in the AWS cloud, is a dynamic service that scales up and down […]

Read full story Comments { 3 }

imgscalr 3.2 Released

Some good news for folks using imgscalr (a Java image-scaling library), version 3.2 was released today and brings with it support for rotation, a new AsyncScalr class used for support both asynchronous scaling support as well as scale-operation throttling in high-performance systems (e.g. web application) where 100s of scaling operations firing off in parallel would bog […]

Read full story Comments { 0 }

Tomcat Context Attribute ‘antiResourceLocking’ Disables Class Reloads

This is a quick TIP for anyone working with Tomcat during development and needing it to reload changes immediately… especially if you have Tomcat setup to run your webapp directly out of your IDE’s project folder. REMINDER: Remember you have to change your Project Properties to make your [projdir]/[webdir]/WEB-INF/classes directory your output dir for built […]

Read full story Comments { 0 }

Unavoidable Security Risk Caused by Elastic Load Balancer on AWS

Last night I was reading through the Amazon Web Services Forums and ran across this post that has vexed me since then. I imagine this post doesn’t come as a surprise to folks very familiar with AWS, but not previously knowing how elastic load balancers were implemented in AWS, it came as a surprise to […]

Read full story Comments { 6 }

(Servlet 3.0) Using @MultipartConfig, but getParts() returns null

Setup You are trying to use the new getParts() method defined in the Servlet 3.0 spec to process your multipart/form-data HTTP-POST uploads without using Commons FileUpload. Your servlet looks something like this: @WebServlet("/image/*") @MultipartConfig(location="D:\\Temp", fileSizeThreshold=10, maxFileSize=10485760) public class ImageServlet extends APIServlet { } And your HTML looks something like this: <form action="image/upload.json?version=1.0" enctype="multipart/form-data" method="POST"> <input […]

Read full story Comments { 0 }

Understanding the Unix Epoch (in Java), Time Zones and UTC

It is funny (or maddening, depending on your mood) how long something can be under your nose until you come to assume you understand it. Only after you are forced to look at that thing in detail do you realize you have no idea how it works. That happened to me just now with Java […]

Read full story Comments { 1 }

Designing a Secure REST (Web) API without OAuth

Situation You want to develop a RESTful web API for developers that is secure to use, but doesn’t require the complexity of OAuth and takes a simple “pass the credentials in the query” approach… or something equally-as-easy for people to use, but it needs to be secure. You are a smart guy, so you start […]

Read full story Comments { 243 }

Simple Java XML Parser (SJXP) 2.1 Released

Hot on the heals of the 2.0 release, SJXP 2.1 was released with the following changes: Fixed bug where isStartTag was always true for TAG type rules https://github.com/thebuzzmedia/simple-java-xml-parser/issues/closed#issue/6 Removed use of enhanced for-loop in code base because it caused a large number of AbstractList$Itr classes to be created for no great reason. https://github.com/thebuzzmedia/simple-java-xml-parser/issues/closed#issue/5 As always, head […]

Read full story Comments { 0 }

Simple Java XML Parser (SJXP) 2.0 Released

I am proud to scream from the top of my desk, directly at my closet, that Simple Java XML Parser (SJXP) 2.0 has just been released. The 2.0 release brings a huge performance boost over the 1.x series that decreases memory and CPU usage by an order of magnitude. Additionally, user object pass-through support was […]

Read full story Comments { 1 }

imgscalr Java Image-Scaling Library 3.1 Released

Announcement imgscalr 3.1, the high performance Java Image Scaling library was released. imgscalr’s focus has always been on simple, fast and correct image resizing in Java (an inherently convoluted subject with many different answers). The library itself consists of a single class (Scalr) and a series of thread-safe static methods used to scale an image. What is new […]

Read full story Comments { 0 }

AJAX Byte to Char (and Char to Byte) Converted Utility Released!

I just added a new AJAX utility to our suite of AJAX tools and this one can be used to convert a series of chars to bytes or a series of bytes to chars. You can try it here. The idea for this app was born out of the work I was doing on the […]

Read full story Comments { 0 }

imgscalr Java Image-Scaling Library 3.0 Released!

I would like to give a big personal thanks to Magnus Kvalheim from movellas.com for helping with one of the best features of this new release: BufferedImageOp support! Announcement imgscalr 3.0, the high performance Java Image Scaling library was released. imgscalr’s focus has always been on simple, fast and correct image resizing in Java (an […]

Read full story Comments { 0 }

Anti-Aliasing in Java 2D is an Expensive Operation

This post is more of an aside or random observation and it likely only effects folks trying to do animation or games with Java; normal folks using Swing, probably won’t care. I was just playing around running some of the old-ass JFC demos that come with the JDK on my machine; something I’ve done over […]

Read full story Comments { 2 }

imgscalr Java Image-Scaling Library 2.1 Released

Hot on the heels of the 2.0 release, imgscalr just made a 2.1 release which includes a very important enhancement that improves the visual quality of the resize operations across all the different Methods (SPEED, BALANCED or QUALITY). For some technical background on the issue, Java2D does not support all image types equally and working […]

Read full story Comments { 0 }

Java NIO: SocketChannel read() Hangs Forever or write() Sends No Data

It was late, I was tired and it took me an hour to figure this out so I wanted to post it here for anyone else trying to frantically Google for the same terms I was using. If you are doing some Java NIO client network programming using SocketChannel, and you are doing channel.read() operations […]

Read full story Comments { 4 }

QN: imgscalr Java Image-Scaling Library 2.0 Released

Version 2.0 of the imgscalr Java image-scaling library has been released. This release matures the library, tightens up every area that could get tightened up and adds some new features: * API-break: resize(BufferedImage, Method, int, int, boolean, boolean) was removed and replaced by resize(BufferedImage, Method, int, int). * DEBUG system variable added; set ‘imgscalr.debug’ to true […]

Read full story Comments { 1 }

JavaMail SMTP on localhost Fails with Amazon AWS SDK in Classpath (SOLVED)

Update #1: I solved the stupid problem! If you are using JavaMail in your application (most likely a web application) and no matter what you do, you cannot get it to connect to your SMTP server on localhost (in my case, Postfix) and just constantly get a cryptically stupid exception message like: unable to connect […]

Read full story Comments { 1 }

How to See “Closed” GitHub Issues by Label

GitHub’s issue-tracker is solid. It is easy to understand, easy to use and easy on the eyes. Unfortunately while trying to create a handy changelog link for the 1.2 release of imgscalr I noticed that GitHub doesn’t allow you to search Closed issues by label, only Open issues: I spent a while reading through the […]

Read full story Comments { 0 }

QN: imgscalr Java Image-Scaling Library 1.2 Released

Version 1.2 of the imgscalr Java image-scaling library has been released. This release makes the library easier to use, accessible from the new The Buzz Media Maven repository and improved the logic used to determine the proportionally-scaled width and height for images depending on their orientation (LANDSCAPE or PORTRAIT). For download links, Javadoc, source code […]

Read full story Comments { 0 }

Project Lombok – Never Write Boilerplate Java Code Again

(Click to enlarge) If you read our recent article about Java 7 getting automatic resource management and were excited to never write boilerplate again, you need to try out Project Lombok. Project Lombok (created by Reinier Zwitserloot and Roel Spilker) is a annotation processor compiler plugin for javac that provides a handful of very focused […]

Read full story Comments { 3 }

Java 7 Gets try-with-resources Support (Automatic Resource Management)

Java 7 is adding support for a new try-with-resources code-block construct that allows the runtime environment to automatically manage closeable resources for you; e.g. streams. What originally started with a proposal in February of 2009 from Joshua Bloch for try-catch blocks to add the ability to automatically manage resources, eventually turned into a modification to […]

Read full story Comments { 7 }