Coder's Revolution

Do you want a revolution?

Category Filtering: 'Java'

Confessions of a speed junky: How I made my code faster

ColdFusion, General, Java, Performance
The past couple of days I've been messing around with a couple functions, cleaning them up a bit to blog about them. One of them is for color-coding SQL and the other for highlighting differences in two strings. Both are pretty small, but very repetitive in what they do. Depending on the size of the text you are processing, performance varied. Sometimes the code inside was repeated hundreds of thousands of times given a large enough test.
Comments are currently closed

Put down the keyboard and step away from the computer

ColdFusion, General, Java
Research shows that driving while extremely tired renders the same results as driving drunk. Following that same line of though, is coding while sleep deprived the same as writing your code in a drunken stupor?
Comments are currently closed

No Cookie For You: Second Solution

ColdFusion, Java
I have a solution that I have gotten working locally to rid my ColdFusion logs of the annoying "Cannot create cookie" errors. For those of you just joining us, Teeps blogged it, Jochem explained it, I took a stab and it and failed, and now I'm back for round two. I apologize for blogging this so much lately, but once I get a good puzzle in my craw, I just can't let up until I've solved it.
Comments are currently closed

Cookie Reserved Names- Who's to blame?

ColdFusion, Java
Teeps started off the fun last month with this blog post about countless errors in his logs about not being able to set cookies. I get the errors too, and they usually look like this: 07/11 15:58:19 error Cannot create cookie: domain = .notingdetails.com 07/11 16:19:01 error Cannot create cookie: domain = .notingdetails.com 07/11 16:39:12 error Cannot create cookie: domain = .notingdetails.com 07/11 16:45:05 error Cannot create cookie: domain = .notingdetails.com
Comments are currently closed

Java Servlet Filters Part 2: Removing Cookies

ColdFusion, Java, Object Oriented Design (OOP)
As promised, I have written a Java Servlet Filter to remove cookies from a request. If you don't know what a Servlet Filter is, read this blog. Let me start by saying while my filter does function like I wanted it to, it did NOT solve this problem. I'll blog on that next. UPDATE: Here are my findings Given that, I can't really think of a real-world use for this code, but I am always in favor of coding for the sake of learning.
Comments are currently closed

I've created my first Java Servlet Filter!

ColdFusion, Java
In the Java world, web requests are handled by servlets loaded within a servlet container. There is a servlet mapping which specifies a servlet class conforming to Sun's Servlet specification which has been part of the J2EE spec since version 2.2. When a request is sent to the servlet container, it is matched to the proper url pattern and passed to the appropriate servlet object via that objects service() method.
Comments are currently closed

Hi, I'm ColdFusion, and so am I. (Is CF Schizophrenic?)

ColdFusion, Java, Object Oriented Design (OOP)
Sometimes I wonder about ColdFusion. Mostly when it gets depressed and locks itself in the bathroom with a box of chocolates. Seriously though, the identity of CF can sometimes be illusive when you listen to what everybody wants all at once. ColdFusion is different than most languages and I think that's a good thing, but what pushes us to request the changes we want? Do we wish CF was easier to pick up for the beginner? Perhaps we want it to behave a bit more like our favorite scripting language for our benefit or to impress our friends.
Comments are currently closed

I think we have an anemic Domain Model

ColdFusion, Java, Object Oriented Design (OOP)
I have been pouring over the latest Fusion Authority Quarterly Update, and particularly liked Sean Cornfield's article "Beans and DAOs and Gateways, Oh My!" I am pretty familiar with the four application layers he describes, but have had difficulty at times reconciling all the diverse ways I see those implemented. (design patterns) I feel I have a good grasp on OOP, but most of my current application is still on a version of Fusebox 4 which was modified to the point of not being easily upgradeable. We have tried to do new development in MachII, but my exposure has been modest.
Comments are currently closed

Fun with java.net.URL

ColdFusion, Java
I was working with URLs last week while working on my Is It Flex utility and I was looking for a handy way to take a base URL and a path/file relative to that URL and come up with a fully qualified combination. For instance, let's say you have the page http://www.mysite.com/pages/about.html and that page contains a relative reference to an image like this: The fully qualified path to the image would be "http://www.mysite.com/pages/my_photo.jpg". Ok, but given those first two pieces of information how do I consistently come up with the full path while taking into account any number of subdirectories, possible non-standard ports, and query strings with goodness knows what in them. My example at the time didn't have all those factors, but I figure any problem worth solving is worth solving well.
Comments are currently closed