Posted by Phil on May 10, 2010 under Uncategorized |
A quick note, I’ve been playing with themes lately (I keep telling myself that I’m going to actually code one, but it never happens) so keep that in mind if the site keeps changing on you. I’m just trying to find a style that is pleasing to the eye, and works well for most visitors.
Posted by Ryan on April 21, 2010 under Uncategorized |
While in your Java development journey, if you find yourself getting an Error 500 NullPointerException and your console shows “IllegalStateException: Configuration is frozen”, you could be the victim of what I experienced this week.
I wanted my forwarding to actually redirect to a new action so that the decorator would be applied to the new action instead of the current one, so I tried this approach:
forward = mapping.findForward("blahblah");
forward.setRedirect(true); |
This doesn’t work. The reason is because the forward that you are using is defined in the struts config file, so you are attempting to modify an existing forward. This is not what you want to do because it will affect ALL future uses of that forward, hence the error. Here is the correct way to accomplish this:
forward = new ActionForward(mapping.findForward("blahblah"));
forward.setRedirect(true); |
UPDATE: An astute reader pointed out that this is probably only an issue if you haven’t set redirect=”true” in your struts config, and that you should always set redirect to true if you are forwarding to another action anyway. Good catch Casey!
Posted by Dustin on April 7, 2010 under Javascript, Uncategorized, Web Development |
So I had a lot of time on my hands today, and we were trying to figure out a good color palette for one of our customer service portals. Since I’m not in the least bit a designer we decided to wait for one of the Graphic Designers to take a stab at it, only problem with that is they were out to lunch. So someone gave me the idea to play around with the colors and make them change from time to time. I wasn’t feeling particularly ambitious so I scoured the internet for a good jquery solution to randomly select colors and change background colors based on those that were randomly generated.
below is what I came up with:
/* -- jQuery Colourific */
/* -- v 1.0 - January 2008 */
/* -- by ben watts (http://www.benwatts.ca/sandbox/jquery-colourific/) */
//$(document).ready
$(function(){
setupColourific();
});
// setupColourific
function setupColourific(){
var elements = new Array();
elements[0] = $("td.Upload"); // the element that's changing
elements[1] = $("td.Notes");
elements[2] = $("td.LoanTitle");
elements[3] = $("td.hdr");
elements[4] = $("body#body");
for(i = 0; i < elements.length; i++){
changeColour(elements[i]);
}
window.setInterval( function(){changeColour(elements[0]);}, 1000);
window.setInterval( function(){changeColour(elements[1]);}, 1500);
window.setInterval( function(){changeColour(elements[2]);}, 2000);
window.setInterval( function(){changeColour(elements[3]);}, 2500);
window.setInterval( function(){changeColour(elements[4]);}, 3000);
}
// changeColour
function changeColour(e){
// random values between 0 and 255, these are the 3 colour values
var r = Math.floor(Math.random()*256);
var g = Math.floor(Math.random()*256);
var b = Math.floor(Math.random()*256);
// puts the hex value inside this element (e is a jquery object)
//e.text(getHex(r,g,b));
// change the text colour of this element
e.css("background-color", getHex(r,g,b)).fadeIn();
}
// intToHex()
function intToHex(n){
n = n.toString(16);
// eg: #0099ff. without this check, it would output #099ff
if( n.length < 2)
n = "0"+n;
return n;
}
// getHex()
// shorter code for outputing the whole hex value
function getHex(r, g, b){
return '#'+intToHex(r)+intToHex(g)+intToHex(b);
} |
Obviously you’ll need to change the selectors to something relevant for your purposes. It’s probably not something you want to use on a regular basis but would make a great april fools day joke, or if you feel like a ceasure go ahead and mess with the time interval.
I can’t take full credit for this script, the original can be found at This site
Posted by Dustin on February 26, 2010 under PHP, Uncategorized, Web Development |
Nice to see the Dev blog is still here, and that I can remember my login. Here is a useful debugging trick I learned for PHP, hopefully it’s not in one of Phil’s link posts.
echo '<pre>'.print_r($app,true).'</pre>';
this bad boy will give you all of the values of an array, variable etc.
more to come soon.
Posted by Phil on January 2, 2010 under Uncategorized |
Hard to believe, but the E-com DevBlog is now over two years old. Time sure has flown and we are now reaching out to developers all over the globe. I started this blog with one of my co-workers so we could keep track of what we learned and hopefully pass it on to others. It has slowly evolved into a little bit of knowledge passing, and a monthly/bi-monthly/quarterly posting of useful weblinks (yes I know I haven’t posted Novembers LinkPost, or the December one.. it’s coming! I promise!).
In the spirit of keeping new useful things coming, and in the hope of a great year, I have completed an Adobe Air app called “VidCalc”. Basically it’s a tool to help you figure out video ratios (so you don’t skew them when you try to resize), the file size of a constant bitrate encoded movie, and how long it will take to send a file down the pipe. I could explain it in greater detail, but you should probably go check out the project page to find out for yourself.
Have a great new year!
Posted by Phil on December 9, 2009 under Uncategorized |
While working on launching a new site I suddenly realized that I didn’t have a vm or extra compy around without flash installed. Yes I could have just changed the swfobject params to a higher version of flash to see what my error message would look like, but I was wondering if there were any good plugins or ‘quick-fix’ tools to use for testing various versions of flash on a page. That’s how I stumbled onto Sephiroth’s FlashSwitcher plugin for firefox.

Flash Switcher in Firefox Tray - (with my other tools
)
The plugin is fairly huge (14mb) but it makes sense as he’s cramming 3 version of flash for 3 different operating systems in it. What it does is puts a little flash logo in the bottom right of your window. When left-clicked it shows you other versions of flash that you can test with (9.0 r124, 8.0 r24, or 7.0 r63). If you click on one, it will remove the currently installed version of flash and install the one you clicked on. IMPORTANT! before you click on one of the flash versions in the menu, use the sub-menu to “Save as…” your current version or it will be removed and you’ll have to go download it and install it again. Once you’ve “Saved as…” it will keep your current version and list it with the others.

Flash Switcher with sub-menu active
Hopefully this will be useful to those of you playing with various versions of flash, or if you want to do a test for users without flash (just click remove to uninstall flash from your browser).
Posted by Brett the Younger on October 6, 2009 under Uncategorized |
Being somewhat new to the Apache Axis webservice world, I’ve been looking for a solution on how to upload a file via the webservice. I found some MIME and DIME formats and there was even some cool looking technologies about MTOM (see here).
In the end the simple answer I found, on the same page linked to above, was to encode the file as a Base64 string and put it in the request like a normal string. Then on the service side it is simply decoded.
For example:
On the client side:
String base64Encoding = Base64.encode(byteArrayFromFile);
.
.
.
//In the XML request
.append("<ns1:encodedFile>")
.append(base64Encoding)
.append("</ns1:encodedFile>") |
And then in the service:
String base64String = request.getEncodedFile();
byte[] byteArray = Base64.decode(base64String); |
And then with the byteArray you can save it or do whatever you need.
Posted by Phil on March 6, 2009 under Uncategorized |
Very quick post, anyone toying with jQuery UI should be excited to know that 1.7 was released today. Lots of bugs were squished, and compatibility with jQuery 1.3 has been added. So by all means, get there and get developing (or not). http://jqueryui.com/
Posted by Brett the Younger on November 24, 2008 under Uncategorized |
As the QA guy I’m always looking for tools to automate my testing to make things easier and quicker (not too mention easier to spot problems). My first macro tool was iMAcros for firefox which has to be the coolest thing since sliced bread. Then Drew found Xenu which was like another heaven sent goodie for finding errors and stuff. And of course we have always been using a web checking service to monitor for downtime and the like.
Well, last month I found a pretty powerful tool in order to do all that stuff. I just needed to build it. The tool is called Autoit v3. To quote from their website:
AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!
After learning how to manipulate windows and create a few COM objects I’ve come up with a tool that I’ve already used to check the links and search for errors on the sites. So here it is for beta testing and criticism, the Link-O Matic website checker.
it’s configurable, supports a proxy, searches for a string on a site’s page, has customizable error reporting, and even email alerts. And it even plays the tada wav upon completion.
Missing is documentation so if you have questions you’ll have to ask and I have yet to create a GUI so the only feedback it gives is a tray popup box which can be kind of annoying.
Posted by Dustin on July 11, 2008 under Off-Topic, Uncategorized |
In anticipation of the anticipated growth in popularity of the E-com DevBlog I thought it might be a good idea to mention that we here at Team Awesome have been keeping a list of good things that have at times made us laugh, traditionally this list was kept tucked away in a folder somewhere on each of our desktops only to be revisited when someone makes an addition and emails the change to the rest of us. However I noticed that whenever there was a change that someone wanted made they felt it was necessary to tell me to do it rather than do it and send us all the results. So in order to curb this and at the very least make it easer to share I recently (within’ the last 10 minutes) uploaded said list to google docs and shared it amongst those who already knew about it. I have no problem sharing it with anyone who is interested as long as you do two things.
- get me your gmail account
- Remember, it’s an honer to be on the list, not a punishment.