Sunday, November 27, 2005

New items on my e-bay auctions

If you know of anybody that might want them, please pass the word around.

Wednesday, November 23, 2005

Interesting news of an Atheist

I looked through some of this interview. It's pretty interesting. It's an interview with Dr. Antony Flew, Professor of Philosophy, former atheist, author, and debater.

Here's an excerpt:
HABERMAS: ... Given your great respect for Christianity, do you think that there is any chance that you might in the end move from theism to Christianity?

FLEW: I think it's very unlikely, due to the problem of evil. But, if it did happen, I think it would be in some eccentric fit and doubtfully orthodox form: regular religious practice perhaps but without belief. If I wanted any sort of future life I should become a Jehovah's Witness.

Monday, November 21, 2005

For Monty Python fans!

Death with Big Pointy Teeth

Also, I've added a second page to my train section. And I shrunk some images, so it should load faster. I moved the quicktime to a different page. I will be adding some more pics tonight.

Wednesday, November 16, 2005

2 years of Blogging!!!

Wow, has it been that long? Have I really been blogging since November of 2003? Yup, I have. I should do some sort of special. Ok, for today only, FREE ACCESS TO MY BLOG!!! Don't you feel special.

Linux is better than ever

My linux box is running better than ever. Not only is it serving web pages again, but it's also an FTP server, and I have it streaming Audio. (I am not opening FTP or streaming audio up to everybody as I don't want any issues to deal with.)

My dad can now FTP talks up to the server, so that a brother in his hall can log into the streaming audio and listen. In fact, I am streaming to another PC in my office, and accidentally restarted the linux box. The PC streaming had buffered about 1 minute, and picked up right where it left off.

I'm also still maintaining my site, and if anybody needs server space, let me know. You can see the latest progress of my train layout here.

Tuesday, November 15, 2005

Linux server is back up!!! Hooray!

Come to find out, I had a bad download of the Ubuntu 5.10 install iso. I downloaded it onto my linux box, and the md5 checked out, but then I put it on my windows box to burn it, and it must have gotten corrupted. So I downloaded it again, from the windows box, and the burn was fine.

So, I reinstalled last night, and today I'm restoring files and settings that were on the old system.

I have a 30Gb drive as my / partition, a 20Gb drive as a /fileshare partition (so my network can store stuff there), and a 6.5Gb drive as my /var partition, which holds my web files, so in the future, I won't be so messed up.

Check it out, if you notice anything wrong, please post your comments here. Thanks.

Monday, November 14, 2005

More Linux Progress

I've been playing with my linux system off an on all day. I tried 2 Ubuntu 5.10 disks, only to have them both fail. Ubuntu's installer has a disk checker. (I think it needs a network connection.) It said they were both bad. Since they both came from the same iso download, I downloaded again, and this one checked out. I'm going through the install now.

I have much to post there.

Current activity

I'm working on the Image Connection. I'd say this is revision 4. We're trying to simplify the grouping of images for photographers. The way it works now, is JavaScript 'moves' the image from one side to the other, setting a hidden input value to true. When the .Net is called to save the changes, it looks for all the flags and adjusts accordingly.

Currently the save process, where the data is saved to the database is VERY slow. I'm trying to see why now.

My Linux box is down. I had all my data on my / and /boot drive. I only had one drive. This drive crashed while trying to upgrade my distro. This may be my fault, but I'm not sure. In any event, I have my Linux drive slaved on my wife's system and I'm using explore2fs on the windows drive (my wife's system is Windows 98) to read and extract the files I want to save from my Linux drive. I will then wipe it, and do a fresh install.

However, I have some extra drives lying around, a 20Gb and a 6Gb. I'm going to have the 6Gb be my /var drive, which hosts the web page, and my 20Gb be a file share for my network. This way if my boot drive gets junked up again, I only need wipe it and reinstall. I think it'll be a good exercise.

Friday, November 11, 2005

Linux Upgrade Woes & My Web Site is down

Upgrading your linux Distro:
Step 1, uninstall all the old parts
Step 2, install all the new parts.

What happens when your CD kicks the bucket exactly in the middle of those processes?

Not good, is what happens. If you try to check out my site, it's not there. Sorry... working on it.

This brings up a good point. What kind of things do you look for in a site? What can I do to increase your viewing of it? (Besides bring it back up.)

Wednesday, November 09, 2005

How's about that

Take a look at my other Cuz on Justine's Blog!

Also, I have a LiveJournal site now, here:

What can I say about this one

Store Wars - Another Star Wars spoof.

Sunday, November 06, 2005

What I did this weekend. Trains!

I worked on my N-Scale train layout. Take a look here.

Updated: I added a video of my train in action. It's quicktime. Sorry for the bad videography and lighting.

Friday, November 04, 2005

Another snippet of code I like

I was rather in need of this code when I developed it. I was getting an error on an SQL command, and couldn't figure out which parameter was killing it. I give you the fix:

Public Function giveParams(ByVal cmd As SqlClient.SqlCommand) As String
Dim ourString As New System.Text.StringBuilder
Dim i As Int32
Dim p As SqlClient.SqlParameter
ourString.Append(cmd.CommandText & "<br />")
' Walk each parameter in the command

For i = 0 To cmd.Parameters.Count - 1
p = cmd.Parameters(i)
ourString.Append("<td>" & p.ParameterName & "</td>")
ourString.Append("<td>" & p.DbType.ToString & "</td>")
ourString.Append("<td>" & p.Size.ToString & "</td>")
ourString.Append("<td>" & p.SourceColumn & "</td>")
ourString.Append("<td>" & p.SourceVersion.ToString & "</td>")
ourString.Append("<td>'" & p.Value & "'</td>")
Next 'p
Return ourString.ToString
End Function 'giveParams SQL


How to reduce Database traffic

Many, if not all, e-commerce sites use the common Shopping Cart template for customer order placement. This is where the user places items in the cart and at checkout the cart becomes an actual order.

I was taught this way. One issue we had, was storing the data in case the user leaves the site for some reason and would want to come back at a later time. This was resolved simply by storing all the shopping cart data in a database. Ours was SQL. (MS SQL to be exact.)

This worked fine, until you started to get a lot of users. This caused a lot of SQL traffic in the form of calls to the database for the current copy of the shopping cart. So, I needed to figure out how to lessen this traffic.

I noticed there were two types of shopping cart data needed. (Other traffic may be simplified, but the cart is the biggest baddie of 'em all.) We might need cart header information. This includes date, customer ID, type of order, etc. The other type of data was the full cart.

So, my first step to lessen traffic was to use only the header data when I could. This was simple to do, I only needed to create a smaller version of my stored procedure, and a method to call that procedure. Then, on all the pages that needed only header data, point to that new method instead.

How about the full cart? Sometimes we needed fresh data from the database, when a change might have been made or something like that. Other times I didn't. Well, if you've ever used .Net's Session object, you may know that you can store a whole dataset there across page refreshes. This is good because your app becomes more like a stateful app than a stateless app. But what is a good way to make sure you have the most recent data.

I came up with this code:

Public Function getCart(ByVal reset As Boolean, ByVal sessionId As Integer) As DataSet
Dim dsCart As New DataSet
Dim Session = HttpContext.Current.Session

'Get the cart dataset
If IsNothing(Session("tempCart")) OrElse reset Then
Call RefreshSession(dsCart, sessionId)
dsCart = Session("tempCart")
End If

If dsCart.Tables(0).Rows.Count <> dsCart.Tables(0).Rows(0)("ShoppingCartID") Then
Call RefreshSession(dsCart, sessionId)
End If

Return dsCart
Catch ex As Exception
Throw New ApplicationException(ex.ToString)

End Try
End Function

It allows you to use the cached copy, if available, and the fresh database copy if necessary. RefreshSession actually calls our stored procedure (through our database component) returns the dataset (ByRef) and saves it into the Session as well.

I found it beneficial to do some data checks to make sure we had a valid copy of the dataset from the Session object. I don't trust it, because I don't fully understand it. This probably is a performance hit, but overall, the steps I've taken have improved the web site performance tenfold.

You might also notice, that in this method I create the Session object, instead of using the Page.Session object. This is because I put this method into a module. This allows me to have write-once efficiency. I don't have to rewrite this code on every page that might use it.

I'd like to turn this entry into a help document at some point, so critiques and tips are more than welcome.

Check out this Atari on Ebay!!!

Click here to see my Atari on ebay. It's in good shape.

Wednesday, November 02, 2005

Ain't that nifty

I wanted to try out Haloscan trackbacks for my blog, so I did it's automated install. It also installed haloscan's commenting, wiping out the BLogspot comments. (They're probably there, just turned off.) So, sorry your comments are koosed. I could fix it, but it's not worth the trouble right now.
commenting and trackback have been added to this blog.

Short Circuiting comparisons

This is simply using Andelse or Orelse instead of And & Or. Check out Ben's info
here. I still find this a great help in many areas.


Buying your kid that costume he wanted: $100
Buying candy for the kids that come to your house: $60
Gas for driving your kid from house to house: $30

Me walking into the store the day after holloween and buying twice as much candy as your kid got for $10, priceless!

Some have said holloween is becoming the most expensive holiday. Others have said it is the biggest drinking holiday. Can you picture it, kids filling the streets after dark in dark costumes with more drunk drivers than any other night of the year.

I sit here with my 50% off candy, enjoying the fact that I never had to put up with all that.

On a programming note, I'm still looking to get Mono working on linux. If anybody out there has had success, please, drop me a line. I haven't really dug into it yet, but would like the chance to try it out.

My linux server seems to be running good. I never have to check it. Not only is it serving my website (ok, maybe it's only 20 people a day, peak, but it still doing it) but it's also running a client.