Archive for the ‘code’ Category

computer sci quote

Tuesday, June 2nd, 2009

Edsger Dijkstra - “Computer Science is no more about computers than astronomy is about telescopes.”

This is great.

Resizing JPG’s

Thursday, February 12th, 2009

Don’t forget a streams position

While working on a project that required jpg’s to be resized, I found plenty of examples on the web.
2 Things:

  1. Don’t use System.Drawing.Image.GetThumbnailImage()
  2. With steams, don’t forget to pay special attention to position.
This is a small function for resizing jpg’s

Private Function getResizedImageAsStream(
ByVal xAxis As Integer,
ByVal yAxis As Integer,
ByVal imgOriginal As Drawing.Image)
As System.IO.MemoryStream

Dim bmpTarget As New Bitmap(xAxis, yAxis)
Dim objGraphics As Graphics
= Graphics.FromImage(bmpTarget)
Dim strmImage As New System.IO.MemoryStream
objGraphics.CompositingQuality
= Drawing2D.CompositingQuality.HighSpeed
objGraphics.InterpolationMode
= Drawing2D.InterpolationMode.HighQualityBicubic
objGraphics.CompositingMode
= Drawing2D.CompositingMode.SourceCopy
objGraphics.DrawImage(imgOriginal, 0, 0, xAxis, yAxis)
bmpTarget.Save(strmImage, Drawing.Imaging.ImageFormat.Jpeg)
‘reset stream to beginning
strmImage.Position = 0
Return strmImage
End Function

Functionality Expectations

Wednesday, January 7th, 2009

On a regular basis I get requests like “Can it do this? I think we used to be able to…” I hate hearing that. Do people think developers work to remove functionality? The upside to this is that it shows the value of our work. People get comfortable with some functionality on a web site and assume all web apps must have it and honestly don’t remember what life was like before it.

With plenty of help from the people around me, I just rebuilt a website for our internal use. The most used applications are up to date but the core/framework was a disaster in classic asp. Over time, users subconsciously ignore links to broken or bad apps. Rebuilt it, throw on a fresh set of colors and all those forgotten apps/links are new again. Then, users start coming back asking why it doesn’t do all the great things it used to.

Our work is never judged against what came before it. We need to develop to compete with the biggest and best of now: Google, Amazon, Basecamp, and whatever else is coming out.