Archive for the ‘Life’ Category

HTML to AnyCode review

Sunday, September 16th, 2007 | Life, Tech

Shareware was never one of my favourite groups of software because I always had to find a new replacement application when the 15 day trial expired. Occasionally though a piece of software comes along which seems indispensable and even the guy who hasn’t paid for the last dozen pieces of software he has got, despite the fact he should, we shell out for a good bit of shareware.

Why? Because some applications really are good. The piece of software that got my digging deep (although it’s a phase seen as shareware is almost always very well priced) was Exactcom’s HTML to AnyCode Converter. Allowing you to insert HTML click a button and have it translated into a different language without all the complications of you having to work out how to change and update it as well as risking missing something and causing your new script to go horribly wrong.

It’s a very simple application, once launched it has a title image and 3 tabs below this in which control all its function. Clicking the first tab allows you to enter your code and the language you want it to be converted to. You can also load in a source file in which will then automatically populate the code box for you – just in case you are too lazy to cut and paste; a problem which often haunts me.

One click on the convert button and suddenly your code has been transformed into the language of your choice, the default being JavaScript. The code is even wrapped in <script> tags so you can copy and paste straight into your page. These are automatically removed if you save the file so you can immediately include it into your page.

A nice help tabs also backs up the application with some information on how to use the application, how to register it, about Exactcom and contact details if you are having any problems with it – their support is good too. There is a final tab for registering the application though this disappears once done.

Although the default pages which the open file looks for are .htm and .html, all formats can be selected and imported. The code is rich text too so all your code is fully colour coded – it might be the next step up from Notepad as a web editor. It seems that they have thought of everything!

The only one complaint I would have against it is the image at the top still has a big “Buy it now!” slogan on despite the fact that I purchased and registered it many moons ago. That’s not really a problem though and if they happen to change it in later versions; I have free upgrades for life so I am not worried. Free upgrades are another good reason for shareware – most applications come with it.

Twice I have asked them for support and both times I got a prompt response. The first was when I lost my registration code (wasn’t my fault, well, maybe a little bit) and the second time was one of their new versions had an error in the JavaScript output, which the solved and made a new version available in around a day. Should you be worried that there was an error? I don’t think so, after all its shareware not a huge corporate developing the software, and free upgrades mean all bug fixes are yours.

Though its functions are not huge I find them very useful – I have used it for around a year now and I have hardy ever used it for anything other than converting my HTML text into JavaScript – long story which I will tell shortly. I have hardy scratched the surface of the conversions to ASP, PHP, Perl and JSP.

My main use for the application is for stories on one of my websites. Back in the olden days when I was getting started with Microsoft Access I did not know how to fit all my HTML in a text field with a maximum character amount of 255 – luckily for Exactcom I had not discovered the memo field type and so my solution was to convert the stories into JavaScript, give them a file named based on their ID in the database and include them dynamically that way.

That made HTML to AnyCode Converter vital to my operation though – but that doesn’t make it vital to yours. Exactcom make some great software and HTML to AnyCode is the best converter around. But the use of converting code is not a wide market. Overall, if you need converting done then this software is the only buy. But if you don’t need this function then it’s a product you will sadly not want to register.

Creating water textures in Photoshop

Sunday, September 16th, 2007 | Life, Tech

Requirements: Adobe Photoshop 7

You can proably do this with older version of photoshop but if you don’t have them or want the new version, you can download a 30 day trail.

Introduction

In this article I’m going to show you how to create a water texture in Photoshop. Although Macromedia Fireworks has some built in textures to do this, the textures you can create in Photoshop look far more realistic and is more customizable. For more infromation on image editing see my last column.

I will also make it seemless so you can tile it on your web page, background, etc as wallpaper and it won’t show the lines where the image repeats.

Step by step

1. The first thing to do is to create a new image 400 x 300 pixels. This is just my recommended size though, the size of the document is irrelevant.

2. You’ll need a layer to work with. If you don’t already have one (you probably will) then create a new one.

3. Hit D to set your colors to default: black as foreground and white as background. Go to Filter>Render>Clouds to make what will be the base of our water texture.

4. Go to Filter>Blur>Radial Blur and use these settings – Amount: 38, Blur Method: Spin, Quality: Good (unless you don’t mind waiting a little bit, in that case choose Best). Then go to Filter>Blur>Gaussian Blur with a radius of 2 because we want this to be blurry to the max.

5. Go to Filter>Sketch>Bas Relief and choose the settings – Detail: 13, Smoothness 10. Next go to Filter>Sketch>Chrome and select the following options – Detail: 5, Smoothness 2.

6. Now to add color. Duplicate the layer by going to the Layers palette and dragging the layer with the water texture onto. Click on the eyeball to the left of the new layer you just made to hide it. Select the original (lower) layer and go to Image>Adjust>Channel Mixer. You may want to make it a different color, but to copy the blue I used make these changes – in the Red Output Channel move the blue to the left; in the Green Output Channel move the green slightly to the right; in the Blue Output Channel move the blue to the right. Next click on the at the top of the layers palette and choose New Adjustment Layer. Then choose Hue/Saturation as the type. Play around with the Hue and the Saturation bars until the blue color looks the way you like it.

7. Now click the upper layer in the Layers palette. In the left drop-down box change Normal to Color Dodge and lower the Opacity real low to about 5-10%. (This layer brightens the lightest areas of the image and makes them glow a little). As a final touch you may want to adjust the Hue/Saturation layer again (just double click it) or try adjusting the Curves of the lowest layer (click it and hit Ctrl/M).

8. First make sure you save your file. Then flatten your layers by going Layer>Flatten Image. Next go Filter>Other>Offset. Fill in the coordinates – Horizontal: 200, Vertical: 200. After that, go Filter>Distort>Twirl select 120° as the angle. Now you may be done here if you like the way it looks, but I had a poor turn out on this example – the four sections were still clearly visible. So to correct this simply add one more filter. Go Filter>Distort>ZigZag and choose – Amount: 10, Ridges: 5, Pond Ripples.

9. Just for fun, you may want to see your image in seamless-tiling glory. Hit Ctrl/A to select all, then go to Edit>Define Pattern. Create a new image (about 800×800 pixels), click the paint bucket, set Contents to Pattern in the Options palette, and click in your blank image.

SQL UPDATE command

Sunday, September 16th, 2007 | Life, Tech

The SQL update command allows you to make specific changes to one or more rows. You could in theory do this by deleting the old one and inserting a new one but this means you have to deal with all the data and can only do one row of data. Using UPDATE solves both of these problems.

Basic syntax

As with everything there is a basic command structure to allow you to sort out what you want and run the various different parts of the commands. The syntax for using UPDATE is as follows:

UPDATE table SET field1 = 'value1', field2 = somenumber WHERE field3 = 'value3'

There are three parts to this. The first is the table to update. The second is the values which you are setting. The third is the validation of which rows in the table should have the update run.

Sample table

To make this easier to do I am going to create a sample table of data from which we can work from. The table is going to be called friends and will have several bits of data in it.

Name	email	age	favourite colour
Jim	jim@mail.com	24	blue
Alex	alex@operamail.com	23	black
Josh	happy@killer.com	30	grey
Mike	mikebob@avril.com	27	blue

Ok first lets say that Josh tells me that his email has changed from happy@killer.com to josh@wiggam.com. So we need to run an update command to change the email address from the old one to the new one.

UPDATE friends SET email = 'josh@wiggam.com' WHERE name = 'Josh'

In this code, all rows where the name is Josh, will have the current email changed to match josh@wiggam.com. This would be a problem if I had two Josh’s but I don’t so only one is updated. If I did have two Josh’s I could change the statement to say:

WHERE email = 'happy@killer.com'

Or I could also try

WHERE name = 'Josh' AND age = 30

Updating multiple values

Next let’s pretend that it’s Alex’s birthday – he turns 24 and decides that his favourite colour is now green. So we need to update two values in the table at once. Luckily this is pretty simple to do.

UPDATE friends SET age = 24, favourite colour = 'green' WHERE name = 'Alex'

First thing I must stress – you should never have a column name with a space it – don’t do it. But seen as this is just an example it’s not a problem. If you really needed a name like that then using FAVOURITE_COLOUR or a dash, etc to space them out.

In the above update statement both age and favourite colour are updated in every row where the name is Alex. Also there are no hyphens around age as it’s a number and so does not require them. You will get an error if you try to put them round a number when using a number column, as you will do for not using them in a text column.

Updating multiple rows

Finally I am going to look at how to update two records at a time. Though we have really already covered it so this is more of a confirmation to make sure you have it right. Take a look at this code:

UPDATE friends SET age = 60 WHERE favourite colour = 'blue'

I decide that everyone who likes blue is an old foogy so I am going to update everyone’s age to 60 who said their favourite colour was blue. As usual the script looks for everyone who is ok by the WHERE validation. This time it finds both Jim and Mike and changes both their ages to 60.

Conclusion

The UPDATE command is fairly simple – you just specify the table to update, the values to set and the conditions a row must meet for the update to be run on that row. One final thought though – take another look at Mike’s email address and try and guess what music I was listening to when I wrote that one :).

Yep, it was of course Feeder ;).

SQL SELECT command

Sunday, September 16th, 2007 | Life, Tech

Whether you connect to MySQL, MS Access, SQL or more databases and whether you do it via PHP, ASP or even more you still use the same basic commands of SQL to extract information from the database.

Below is a sample database table called “members”

Username	Name	Email	Posts
Jim	Jim Harris	jim@ntlworld.com	24
Mod	Toby Hunter	t.hunter@btopenworld.com	4
Happy	Simon Gates	theman2003@aol.com	12

Seen as your database connections and how you phrase the code depends on what language you are using I won’t cover that. Chances are you will have some variable such as db = “your SQL commands here”

First of all, you may want to extract all the data. A basic command would be:

SELECT * FROM members

The SQL commands such as SELECT and FROM are always in capitals. SELECT is the first thing you put whenever you are reading or extracting data. It tells you what to take out. For instance you may only want certain columns.

SELECT name FROM members

Or

SELECT name,email FROM members

* tells the script to take all the columns from the database.

FROM tells you what table in the database to take the data from. So for instance if you had a table called “stats” you would use:

SELECT * FROM stats

Next you may want to add conditionals onto the data to only take certain rows:

SELECT * FROM members WHERE name = "Jim Harris"

This would give you the result:

Jim Jim Harris jim@ntlworld.com 24

You can also add several conditional values on:

SELECT * FROM members WHERE username = "jim" and name = "Jim Harris"

That would produce:

Jim Jim Harris jim@ntlworld.com 24

As with most mathematical type equations you don’t have to use the = sign all the time. For instance:

SELECT * FROM members WHERE posts > 10

This would produce

Jim Jim Harris jim@ntlworld.com 24
Happy Simon Gates theman2003@aol.com 12

The guy with the username “mod” would be missed out as his has not made more than 10 posts.

Finally you can also order the rows. For instance if you wanted to order then by the number of posts they made:

SELECT * FROM members ORDER BY posts DESC

This would produce:

Jim Jim Harris jim@ntlworld.com 24
Happy Simon Gates theman2003@aol.com 12
Mod Toby Hunter t.hunter@btopenworld.com 4

By contrast:

SELECT * FROM members ORDER BY posts ASC

Would produce:

Mod Toby Hunter t.hunter@btopenworld.com 4
Happy Simon Gates theman2003@aol.com 12
Jim Jim Harris jim@ntlworld.com 24

ASC sorted them lowest first or alphabetically and DESC sorts them highest first or reverse alphabetically.

The faces we let others see

Friday, September 14th, 2007 | Life

I headed to uni today for the international fresher’s fair. I met loads of people I haven’t seen for ages, people off my course, A-Soc people, union people. I got there and met more people. Every conversation was the same. “Hows it going?” “Not bad.”

I fully understand it’s like an automatic response to just say you’re fine. But you would think you eventually reach some distance from fine where you stop just telling people that you’re “not too bad.” Apparently not. Still, when you have a society to run and it’s literally days before the new term starts, braver faces are in order.

Let’s catch up

Monday, September 10th, 2007 | Life

Quite a few of us have blogs now. It’s great to see people blogging, uni involes far too much face to face contact for my liking. I don’t want to have to leave my room to find out what you did today. Blogs are the solution. I feel we’re slightly under utilising them though. We could be pinging each other like crazy.

For instance, I could make a quick comment on the fact that George has auctioned himself off as a human pet when only two months ago when I offered to purchase him in a deal for his liver, he declined my offer.

So in the spirit of cross-circle blog linkage, tell me what you are up to in the final week or so before the start of the new academic year. How do you feel about coming back to uni, what are you planning to do this year, etc, etc.

Personally, I don’t really know where I’m at. I didn’t really think about it for most of summer, then I didn’t really want the new term to arrive. Then I started to. Now I don’t really know how I feel. I can’t say I’m looking forward to the work and the general hecticness that uni brings. With work I can generally go home and stop worrying about it (to an extent at least) whereas at uni it’s never really off your mind as you always have something to think about.

I still haven’t really set a plan in stone as what I’m doing yet. I’m going to start moving my gear in any day now but I can’t really be bothered to be honest. It’s just more upheaval and stress and to be honest, I have other things on my mind. Indeed, other things on my mind than university as a whole.

Season 2

Saturday, September 1st, 2007 | Life

I’ve had a post entitled season 2 sitting in my drafts for a long time ago. Since last September I believe. The top paragraph of it it explains how this is a redraft because it’s been sat in there for so long. Well, I’m just rewriting it all from the start. With a whole new approach. I need I need a little more explanation.

After the success of my post, season finale which is one of three posts I am really proud of, I decided to continue the theme to look and see what themes we may see this year based on the second season of Dawson’s Creek.

The season is 60 seconds consists of Dawson and Joey getting together then soon breaking up again and ending with Joey’s dad returning from prison but Dawson finds out he is involved with drugs again and he ends up going back to jail with Joey blaiming Dawson. Abby dies, Andie enters the storyline and dates our renegade hero Pacey, Jack, the future gay guy and 5th main character comes in, Tamara briefly returns to remind us of the past.

I never got round to publishing the original post because I couldn’t really make the pieces fit. While Si really entered the storyline this year he turned out to be heterosexual, or at least, hasn’t come out in time. Our will they won’t they couple never officially got together. Nobody died. The symmetry just wasn’t falling into place.

Then a few weeks ago I had a thought. A spark of possibility appeared before me. Perhaps the season didn’t have to run from the start of term time to the end of term time. Perhaps it ran from the start of term to the start of next year’s term – in which case it isn’t over yet.

If you include the summer period then a hole host of possibilites open up. Our will they won’t they couple have been seperated albeit under different circumstances. Break ups, make ups, sex, lies, the drama has flown thick and fast over the summer. All we really need is a season finale. Some big event to leave us on edge for the start of the new academic year. And we have two weeks to get it.

So why am I writing all this now? Why after all this time of the post sitting in my drafts is it finally seeing daylight? Well, I think I may have found one. Maybe, just maybe.

Sleep patterns are for the weak

Saturday, September 1st, 2007 | Life

Hmm, to go to bed or not to go to bed. I went to bed at like this time yesterday. Having finally got to sleep at 2:30am and gotten up for work at 4:30am. Still I’m back on nights tomorrow and Monday before being on an open again on Wednesday. Then a close again on Thursday.

As term draws near I don’t know whether I should be quoting Natalie Imbruglia’s Counting Down the Days or Muse’s Our Time Is Running Out. It’s been a long summer. It feels like a moment ago but the conscience mind but my body is finally starting to feel the strain. It’s been an interesting summer and I think I’ve managed to set quite a few personal records – 2 open closes, 7 closes in a row, 16 consecutive days at work, 17 consecutive shifts at work.

Beat that, the real Leanne!

A night at the theatre

Thursday, August 30th, 2007 | Life, Reviews

While a night in front of the idiot box watching Lost or Prison Break may provide sufficient intellectual stimulation for people like Mr. O’Shea or Miss Le Breton, I personally have a slightly higher cultural taste. With that in mind I headed off to the Grand Theatre this evening to see a stage show of the hit BBC Radio 4 show “I’m Sorry I Haven’t A Clue” of which I am a big fan.

The show featured most of the long running members of the radio show with Humphrey Lyttelton taking on his role as the chairman, Colin Sell at the piano and Graeme Garden, Tim Brooke-Taylor and Barry Cryer making up the original contestants with Jeremy Hardy taking the place of the now late Willie Rushton.

The Grand was rennovated a year or two ago adding in air conditioning and better seats as well as restoring it’s fabulous beauty. Once you add to that a very funny show and you have a winning night out. Most of the best rounds from the show appeared including one song to the tune of another, sound charades and of course, Mornington Crescent.

All in all, an enjoyable night out.

Lack of information

Monday, August 27th, 2007 | Life

Is it really so hard to publish current information on a website?

Having just got off the phone from Argos who have lost my order (not the order contents but actually any record of the order ever being made) I headed off to Tesco’s website to find out when they are open as today is a bank holiday. But they have actually taken the information off! Last time I was on there I could find out all about the holiday opening hours but it’s not available anymore. They’ve done away with the “when is Tesco open this week” section and replaced it with standard static opening times text.

This was something I was thinking about earlier with regards to the union. Would it be so hard for them to have a page listing what is open when? They occasionally publish the term time and non-term time opening hours on each page for the shop or bar but it’s never in any kind of easily accessible fashion. Nor is it usually that accurate.

Things like when the union closes for the day. This never appears on the website. They have a sign on the front door saying “closed.” The website still claims The Old Bar is open. Still claims The Terrace is open till 12:30. Has no information on Extras out of term time opening hours. It has no information on when The ARC is open, when the cash office is open, hell, when the union building itself is open.

Is it really so much to ask for a bit of current information?