Jim’s Blog
Comics
Forums

Shastrix Blogs

 
    Shastrix.com    |    Shastrix Blogs     Sign In   

January 2006

M T W T F S S
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
December February

Recent Posts

Rail travel in July 2016

Cover of Survivors

Book of the Year 2014

Saying goodbye to Clive Cussler

Cover of The Children of Hamlin

Cover of The Peacekeepers

Book of the Year Award

Recent Comments

Jim Books on the shor...

ASH Will SOMEBODY ple...

ASH Quite right; more...

Cait That last point r...

Jim MathsAlso, if the...

Guy I think I saw the...

Daffyd :o That's wierd. ...


Warning: Use of undefined constant galimg - assumed 'galimg' (this will throw an Error in a future version of PHP) in /var/www/html/blogs/craptohtml.php on line 8

Warning: Use of undefined constant galimg - assumed 'galimg' (this will throw an Error in a future version of PHP) in /var/www/html/blogs/craptohtml.php on line 9

Warning: Use of undefined constant youtube - assumed 'youtube' (this will throw an Error in a future version of PHP) in /var/www/html/blogs/craptohtml.php on line 10
Behind The Scenes | 12th January 2006, 17:16  
I've been told that my blog should also be to note updates to Shastrix.com so here I shall describe what I have been up to recently.

I have just uploaded a new addition to Shastrix Blogs, whereby users are able to upload images to a Gallery attached to their blog. I have had one or two problems in the development of this system, the main one being an issue with showing the correct number of images.

The code was meant to take the number of images in a user's gallery and divide by three to calculate the number of rows in the gallery (thumbnails are shown in rows of three), and to calculate the number of images which would be on the bottom line (as this could be one, two or three).

When the final line had to contain two or three images, the code functioned perfectly, however it encountered problems when it was only meant to show one. It tried to show two, leading to an empty image box showing up on the page.

The cause, I eventually found, was a problem with the way it handled numbers. In php it seems that 4/3 = 1.33333333333 to however many decimal places, but 3*1.33333333333 = 3.99999999999 not 4.

So that's the extent of my excitement for today. Let me know if there are any problems.
Previous
Next

Add Comment

Name:
Comment:
Are you a spambot?

By clicking the submit button you are agreeing to the AUP