I decided to make my own php photo gallery that dynamically renders thumbnails and such, but also uses Slimbox 2 to display the full image.

Download

Installation is easy, just copy and paste the files into your image directory and it will go on it’s own. You can edit the index.php file to change some settings which mainly is just for controlling the images themselves. You can also edit the template.html file in the ‘data’ folder to change the overall look of the page.

I don’t have a demo yet, but I’m working on uploading some pictures now which I’ll use as a demo.

Previous ArticleNext Article
P.

PC Woes

So conveniently on the day after I lose my phone my computer’s Hard Drive dies, there goes 130GB of personal data. Although I did make a recent backup since I had to send in my motherboard for repair which only came back to me about a week prior. At the moment I’m running my desktop computer with an old old old… old 80GB Maxtor drive which I figured I’d use to try Windows 7 RC while I wait for my hard drive to come back.

So what are my first impressions of Windows 7?

Well… it’s very… blue. I changed as much of the colors that as I could the second the install finished. But so far it seems decent, although my old HDD isn’t attributing anything good to the overall performance. What are my performance ratings?

Processor: 7.3

Memory: 7.5

Aero GFX: 6.1

Gaming GFX: 6.1

HDD: 4.3  (awww……)

Anyway I’ll see how much of it all improves when I get my other HDD back.

R.

Regex and Anchor tags

I had been looking on the Internet for a solution to a program I had be working on and sadly didn’t come up with one. I was trying to find a way to use regular expressions to find all the html anchor tags in a string along with matching a wild card URL (ie: secnem.com.*test.html). And after many hours of thrusting my head into my keyboard I came up with:

/<a [^><]*href=[\”\’][^\”\’><]*<rule>[^\”\’><]*[\”\’][^>]*>\s*.*\s*<\/a>/iU

You’d replace <rule> with what ever url rule you want, except for any wild cards in the url I needed to use [^\”\’><]* instead of just .* . This would prevent it from matching outside of the anchor. Bascially [^\”\’><]*  means: match any character except a double quote, single quote, greater than sign, or less than sign. All of which should not be in the href field to begin with.

If you wanted to see what the content of the anchor tag was or the matched href, simply put some brackets around like so:

/<a [^><]*href=[\”\’]([^\”\’><]*<rule>[^\”\’><]*)[\”\’][^>]*>(\s*.*\s*)<\/a>/iU

Hope this helps someone. You can of course adapt this to other html tags by replacing ‘a’ for ‘table’ or w/e. Same with the href. larsolavtorvik.com has a great resource for testing regex in real time and addedbytes.com has a great cheat sheet as well.