Tuesday, December 23, 2003

Still having trouble with the javascript, but I posted the final query for my 'month' issue. SQL is such a powerful tool, yet not easy to understand alone. Thankfully there are friendly people out there who will help. One book I use frequently to help me with SQL is listed on my page in the books section. Take a look, it's worth having if you are going to be doing any ammount of SQL programming.

If you are getting data from SQL for your apps, get comfortable with Stored Procedures and queries. Let them do the work, so your code doesn't have to. I had to just take the plunge and do it. It was easy for me to just build my query strings on the fly and load down my apps with code just to get some data out of the database, but as I go on, I am trying to unload my app, and use the tools that are at your fingertips in SQL. Jump right in and have some fun. It's worth it, and another feather in your cap as well!

Thursday, December 18, 2003

My website is having lots of Javascript errors. I am not sure why since the problems seem to lie in the ads that Geocities tacks on to my page. But I am trying to keep it updated. I want to use that site to post chunks of code that I feel should stay available.

I posted my final code for watermarking. It's nice because it watermarks one image at a time as it is called for, leaving the original image alone. It's very quick.

I am now working on getting a drop down list with only the months that have orders visible. This is tricky. The SQL query that gets them is on my page (see link in Tuesday's post). It gives me numbers for the months. I also want text.

Tuesday, December 16, 2003

Okay, I've updated my website with bits and pieces of my current projects. I currently have an issue with my Wedding Site project, The Image Connection. Here's the link straight to that project's page.
http://www.geocities.com/qwert231/_webImageConLog.htm

I'm having trouble generating a JPEG stream. It works, but gets very grainy. Also, does anybody know how to do text effects? Like changing the opacity?

Monday, December 15, 2003

So, for all you following my adventures, I am currently working on my Windows Service. I am attempting to have a windows service that monitors a certain folder, checking it using a timer every x seconds. When the folder is populated with files, the service moves those files and enters data into our business system and our production system. I am hoping to make this service flexable enough so that it can be used at other photo labs and even with other business and production systems. (Or none at all.) To be able to do this I want to allow the user of the service to be able to select the database of each of the systems. But I want to make it easy. I may need to cut out the flexibility for now, but we'll see. This is my first Windows Service.

Wednesday, December 10, 2003

I am going to begin dedicating my site and this Blog to new developers. I myself view .Net (VB) as my first programming language and feel that I am still a beginner. So I will chronicle my educational path as I progress through the learning process. Please feel free to view my website for tips and books that have helped me along the way. I will be continuing to update this page as well.

Monday, December 08, 2003

Threre, got commenting going. Please, place comments. Even if it's just a 'I read your BLog.'
So, we've had our first snow storm (Alec) and it was a doozy. Snowed in for two days. Saturday I didn't do much of anything, tho I did get my wife to try Kielbasa and cabbage. Sunday I was able to visit my bible study and go over some scriptures with him, so that was good. But I didn't do much else. Trying to fix my wife's stereo but that's another story.

On the work front, I am going to try to get a book on software project management. I gotta get myself together, I have 3 major projects (2 web apps and 1 windows app). I have one person working with me on the web apps and I gotta clean things up and put them in order so that it's easier to bring somebody else up to speed as well as having all my files in a logical order.

Friday and Today I've been cleaning up our main site (www.centurycolor.com) codewise as it is about to get a major face lift. One nice thing about .Net is that I can do all the code behind the scenes and have our web designer do the front end. This is new as I use to do everything.

Haven't gotten to do much on the wedding site, but I have set up some documents as to what features are proposed, in progress, and completed for the 3 projects. These things are ongoing. Currently only the home site's new look and the overhaul of the wedding site are in progress. But version 3 of our software is going to be big.

Guess that's it for now. I wish I had a way to add commenting to this BLOG. I have to find a way to add a counter also.

Wednesday, December 03, 2003

Now to anybody who is a major programmer this may not be a big deal, but it was somewhat exciting for me. I was published! The Feedback was published in the November 2003 issue of .NET Developer's Journal http://www.sys-con.com/dotnet/article.cfm?id=452

I've been published before, in a poetry compilation. But this is exciting because it seems that some thing I have said has been taken seriously by part of the programming industry. Very exciting.

Now, back to my project. I created a variation of the Stored Procedure from Monday's post for the administration portion of the website. I could have used that SP by adding in more code, but it was already getting bloated. I actually took out the if statement, since I will not be needing to select only from certain groups and added some fields I would need. I may post some of this on the dotNetJunkies site or at least a comment that points them back here if they would like more.

I am going to be looking at allowing the various photographers that use our site customization so that their customers who browse the site can see the photographers logo and color scheme instead of the default. If anybody reading this has an info, ideas, pointers, or articles about this let me know. I'm sure I could do something with XML and schemas but as of yet I have not learned enough to feel I could rapidly release a project using those technologies and I already have an idea of what I want to do, but let me know.

It's nice to have some validation once in a while.

Monday, December 01, 2003

Back from a long weekend. Had some in-laws up, Clint and Beth Shrom. Had a wonderful, fun, weekend with them. But now it's back to work.

I'm working on our wedding site here at work. For any who would like to see the current version, it's www.theimageconnection.com.
I am working on some enhancements including the introduction of grouping for pictures as well as paged image viewing for previews. I am using a SQL stored procedure for this which gets passed the order number for the images to view, as well as the current page requested, number of images per page, and the group to show. It also has logic in it that if the group is All, it shows the next page of all the images. Kinda tricky, complex, yet delightfully functional. I got this from another page and enhanced it.
Here's where I got the stored procedure from (Dot Net Junkies, of course. The easiest to navigate and search.):
http://www.dotnetjunkies.com/Tutorial/70E24E50-C179-4563-B053-2742516BF05B.dcik

And here it is in all it's glory:
CREATE PROCEDURE [Get_Photos_By_Page]
@CurrentPage int,
@PageSize int,
@Job int,
@Group nvarchar(50),
@TotalRecords int output
AS
--Create a temp table to hold the current page of data
--Add and ID column to count the records
CREATE TABLE #TempTable
(
ID int IDENTITY PRIMARY KEY,
ImageName nvarchar(40)
)
--Fill the temp table with the Photo data
If @Group = 'All'
INSERT INTO #TempTable
(
ImageName
)
SELECT
ImageName
FROM
Photos
WHERE
Hide = 1 AND JobNumber = @Job
Else
INSERT INTO #TempTable
(
ImageName
)
SELECT
ImageName
FROM
Photos
WHERE
Hide = 1 AND JobNumber = @Job AND mGroup = @Group
--Create variable to identify the first and last record that should be selected
DECLARE @FirstRec int, @LastRec int
SELECT @FirstRec = (@CurrentPage - 1) * @PageSize
SELECT @LastRec = (@CurrentPage * @PageSize + 1)
--Select one page of data based on the record numbers above
SELECT
ImageName
FROM
#TempTable
WHERE
ID > @FirstRec
AND
ID < @LastRec
--Return the total number of records available as an output parameter
SELECT @TotalRecords = COUNT(*) FROM #TempTable