one techie, trying to make a difference

Javascript 2.0

March 22nd, 2008 Posted in coding | No Comments »

Jeremy Martin posted up a nice run down of the proposed Javascript 2.0 spec:

Well I suppose it’s an undeniable fact about us programmer-types - every now and then we just can’t help but get excited about something really nerdy. For me right now, that is definitely JavaScript 2.0. I was just taking a look at the proposed specifications and I am really, truly excited about what we have coming.

This is a pretty big deal all in all.  Web 2.0 and AJAX type sites are all driven with javascript.  Looking over some of the proposed additions it should be something to look forward to!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Learn photoshop the fun way

March 9th, 2008 Posted in graphic design | No Comments »

Certain people I know have challenges with photoshop.  This guy named Donnie(real name?) has a surprisingly educating and hilarious set of videos on youtube with tutorials on how to use photoshop.  I have watched most of them, they are all funny.  Here is the latest one. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

New Camera Canon A560

March 7th, 2008 Posted in misc | 1 Comment »

canon-a560.jpg

I got a new camera for a trip i’m taking this summer.  It is a Canon A560.  Overall I’m very pleased with it.  I’m a big fan of the A series, I have owned an A60 for a few years now and it has been a good camera.  The 560 has been pretty much everything I expected and more.  Very easy to use and maintains the same basic control setup as the old A series.  Turns on 2x as fast as my old one, holds 2 less batteries, 3x as large screen, 2.5x the megapixel.  I look forward to using it some more!  I was particularly impressed with the macro mode. I snapped a photo of a penny just playing around and was stunned how sharp it came out. 

penny.jpg

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

AspImage to ImageGlue conversion done

March 7th, 2008 Posted in coding | 1 Comment »

So after a good hard week of coding on my own time.  I am happy to say our primary website at work has been converted from ASPimage over to Imageglue.  Without going into specifics this is the core of the site, the image generation IS the site.  After my intial post on the issue I had written a complete wrapper class in ASP to hopefully make the switch over in one line of code.  Unfortunatly that was not possible since one particular function in imageglue was not terribly efficient.   I was able to make one further refinement and bring the image generation time up to an acceptable point.

It has now been 2 days since the switch over and knock on wood thousands of images have been generated successfully under imageglue and the w3wp.exe has not crashed!

Next up a personal site of mine is in the same situation.  However I was able to make my wrapper work with it on swapping only one line of code.  I will be posting the wrapper shortly.  It needs some commenting and general cleaned up a bit before I put it infront of the world.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Why budget webhosting sucks

March 6th, 2008 Posted in web | No Comments »

It has been my experience when it comes to web-hosting you simply get what you pay for.  This post comes on the heals of one of my ecommerce sites I started  being down yet again today.  The issues revolve around and around, seems like we rotate through them as the months go by.  Email trouble this week, server disk full next week, random timeouts(hah, that one is normal), and sprinkle in the other odd one time issues and you get a picture what we go through.  In my time with this particular host (about 8 months now) we have bit our toung and tried to give the guys the benefit of the doubt, but the last straw has finally come and we shall be switching.  Who is the host?  I’m not ready to say, because I get the impression they try to help, but it seems like the are just another budget host.  See whenever I get a new host my expectations are always high, then with varying amounts of time my impression of them goes further down until finally I get fed up and switch.  This has occurred enough times to me personally (and professionally) to simply lower my standards for these host.  Now I will say the host I’m typing this post on is hostmonster.com.  I can’t really complain about them, but I wouldn’t call hosting a blog mission critical either.  

So what is the point of all this?  Basically I’m complaining again about how crappy my current host is for my ecommerce site.  What to do?  When we started the site it was on a shoe string so we were looking to save where we could.  Hosting was one place, now the site is definitely on it’s feet we are moving to a dedicated solution.   So pony up a bit more for some decent hosting when you need the reliability. 

Edit

Go figure, at the time of hitting the post button hostmonster went down for nearly 2 hours 0_0

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

futuremark trademarks pwnage

March 6th, 2008 Posted in misc | No Comments »

So futuremark thinks they can trademark the term “pwnage”.  This has been floating around the net for a few days, but what I found funny was the followup (damage control) that they posted here.

Fellow gamers,

Our purpose in filing for trademark on the name “Pwnage” is not to charge money or stop people from using the expression. That’s not what a trademark is for. Instead, we want to protect ourselves from squatters (or what I call campers) - people looking to trademark the name on false pretenses, just to make a claim against Futuremark Games Studio for its use.

Jukka Mäkinen, Executive Producer, Futuremark Games Studio

In essence, Jukka has described that what they are attempting to do is exactly what they are trying to prevent. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Cross Site Scripting attack from botnet

March 3rd, 2008 Posted in web | No Comments »

The last few weeks I have noticed some odd activity across all of our websites.  A single IP will crawl all our the pages in the site and attempt to inject a URL into the forms.  After some google searches for the offending IPs I came across this post which contained all the addresses scanning my sites.  

The IPs that were crawling my pages where:

195.70.10.128
202.154.57.36
81.169.140.109
195.238.1.60

UserAgent for all:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
Some sample entries out of my web-server logs

http%3A%2F%2Fhonamfishing.co.kr%2Fphpmysqladmin%2Flibraries%2Foduzov%2Fneloze%2F80
http%3A%2F%2Fwww.channelnewsperu.com%2Fimagenes%2Fpublicaciones%2Ffotos%2Fnepicu%2Fegul%2F
http%3A%2F%2Fwww.felixtorresycia.com%2Fadmin%2Fcorreo%2Fenaq%2Fecib%2F
http%3A%2F%2Fwww.northfans.ch%2Fforum%2Fadmin%2Fsettings%2Fgucor%2Fujusu%2F
http%3A%2F%2Fwww.pattibus.it%2Fphplib-7.2b%2Fpages%2Filosi%2Fdohigal%2F
http%3A%2F%2Fwww.altaiseer-eg.com%2Far%2Farticles%2Fjed%2Fumut%2F

This information above is being injected directly into pages with forms as inputs and passed to the server via GET.  From the post I linked to alot of people have reported this activity.  Hopefully somebody can ultimately get busted (probably not though). 

Seems people are doing a variety of things to stop this from blocking the entire list of addresses to checking time between page request.  In my situation as far as I can tell this is nothing more than a nuisance.  I will continue to post Ip addresses in hopes that others can find this information useful like I did!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Insane bullet ricochet

March 1st, 2008 Posted in misc | No Comments »

I’ll have to say this is one of the craziest things I’ve seen in a while. It has been around the net for a while, but I felt like sharing. 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Optimizing an image cropping algorithm

March 1st, 2008 Posted in coding | 1 Comment »

In my impending migration from aspimage.dll to a more efficient (crash free) image component I have discovered a grave shortfall of imageglue for asp classic.  There is one particular operation my code must perform that must be used.  That simple operation is GetPixel(x,y).  This has a counterpart in imageglue known as GetColor(”x,y”), both return the color at the current location.  By my estimate aspimage performs this operation nearly 50-100x faster than imageglue does.  This is huge when you have nested loops that need to read each pixel of the image.  In my testing today I plugged my nearly complete wrapper class into my existing code (see this post for more information).  The code was processing, but eventually timed out.  After some examination I discovered what was happening.  Imageglue was performing so much slower the code actually caused the page to time out :(.  So much for a quick and easy transition.  Immediately I realized what I was facing, this could be difficult to make work. 

First I should explain what this actually does. As you would assume this is generating images, specifically text on images.  Neither aspimage nor Imageglue have precise enough text measurement features to allow you to measure down to the pixel the text height.  This presents a problem if you intend to crop the picture directly to the edge of the text.  Enter the problem: In aspimage the previous coder (let’s not even go there) used a very inefficient algorithm to locate the edges of the text.  I put the image below as an example.  What is the most simple was to find the edges of this text on the image?  Read each pixel, starting from each of the 4 corners (separate loops) and when you meet up with a pixel that is a different color you have found your edge.  Once you have traversed all 4 edges you now have your crop area.  So, in my testing an image like this has over 50,000 pixel reads.  Ouch…

sometext.jpg

Amazingly, that approached worked nearly instantaneous with ASPimage.  I was really surprised by this since it is a lot of memory access to accomplish this quickly.  Imageglue on the other hand as I discovered takes over 50x longer to complete the same operation.  Luckily I have semi solution to the problem.   Obviously the algorithm needs some work.  Instead of sampling every pixel why not break the samples up into steps?  That is what I tried and it worked, but still really slow.  My goal was to get an image generated very quickly < 500ms if possible.  I was at about 2 seconds with this approach.  Below is an illustration of the second algorithm.  What you see is the sampling of pixels.  When it finds an edge, it stops and goes to the next side to sample.

sometext2.jpg

Shown above is one of 4 loops to find the edge, this particular one demonstrates locating the top X coordinate.  Now what is noteworthy by looking at the image is the location which the stepping found the edge.  If we were to crop the image at the inner most part it would cut off the S a bit.  In fact the range of this occuring is simply the same as the stepping value.  So if you step 10 pixels at a time you can “overshoot” your text as much 10 pixels.  So we have a trade off, the 1st algorithm finds the edge perfectly down to the nearest pixel, but took 50,000 reads.  This one looks to do alot better (about 1,500-2,000 reads) but now we have the issue of overshooting our target.  I will confess on one of my sites (using aspimage) in production I simply accepted this was the best the algorithm would do.  I tweaked the stepping and simply cropped the dimensions that it returned plusthe stepping value.  This insured a nicely cropped image with no cut off points, but it could be miss-cropped as much as my stepping value was set at (10px).  Now fast forward to this algorithm on imageglue.  We are still fighting slow pixel reads, about 1.5-2 seconds to generate this image.

My current solution is to take algorithm 2 and tweak further, we simply need less pixel reads, but more accuracy.  My idea was to essentially do a quick stepping with a large stepping value such as 20-25 pixels to locate the edge of the text quickly, then backup one column and do a fine pass (about 5px steps).  Below is an illustration of what this looks like.


sometext3.jpg

It may not be very clear on this example, but image a larger image where more scanning needs to be done, this is much faster.  It is about 2x as fast in-fact just from my initial test.  So I cut we now cut our pixel samples in roughly half.  This is where I am at right now with this issue.  I am now in the usable zone for use with image glue, but I’m frustrated by not getting a snappy image generated.  

I can hear my algorithm analysis professor now from college giving me a lecture on this issue.  Amazing, you never think you will need to know that stuff, but here I am :).  My question goes out to anyone reading this, what if any is a more efficient approach to this problem?

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google

Bullet Proof Webdesign a CSS book review

February 29th, 2008 Posted in books | No Comments »

I read a lot of books pertaining to programming and web technology.  Unfortunately keeping up with the tech world is a never ending battle, but it is a necessary evil.  One of my down falls has always been web design, I can usually code a back-end just great, but coming up with a nice UI will give me the equivalent of writers block in a hurry.  One of the big issues I found was I simply didn’t have the tools to turn a design I came up with into a clean, usable UI for my sites.  I did your typical noob html layout for a long time, nested HTML tables with lots of spacer gifs.  There had to be a better way.  Enter CSS, cascading style sheets. 

bulletproofwebdesign.jpg

I picked up a book called Bullet Proof Webdesign by Dan Cederholm (0321509021).  All in all this is a really great book for someone that has done little to no CSS, but is pretty familiar with HTML concepts.  After reading this book a chapter a night I was able to do just about whatever I needed to with CSS.  The whole book is based around the “old” way of doing things (like I mentioned above) and the correct way.  I highly recommend this book!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google