Friday, 27 February 2009

Nice Face (book)

Ah, now there you go. Facebook get negative press one day and then they come back and seemingly offer "control" to their users.

Actually, it seems like a solid move in the fast evolving world of social networking.
Founder Mark Zuckerberg said the aim was to "open up Facebook so that users can participate meaningfully in our policies and our future".
From Facebook offers control to users on the BBC
Facebook has good market share and has become one of the key "names" in the social networking world. But, what you need to remember with all this, is that names, particularly in the world, can disappear quicker than a duck into a Ferrari if you're not careful.

Who remembers using Alta Vista as the go to search engine? Hmm, certainly do, but nowadays I never seem to go there. The ubiquitous Google occupies the dominant search engine position and is the name. How about Friends Reunited - once a major name, now who goes there? Or Internet Explorer? (OK, that's wishful thinking, although...)

Anyway, Facebook seems to be giving back some control, perhaps even a town hall type of approach with votes and everything to decide policy. In the increasingly wiki-world that seems like good sense:
"People should own their information. They should have the freedom to share it with anyone they want and take it with them anywhere they want, including removing it from the Facebook Service."
I'd say that's a step forward. And a good way for Facebook to retain their growing status and market share as well.

Thursday, 26 February 2009

Spring is here!

Ah, baseball on the radio.

Nothing makes me feel more like it's spring time. The world's about to become a warmer place: splendid.

My adopted Tiger, Ramon Santiago, slides into home to beat out the throw and put the Tigers up in the first spring training game of 2009 over the Atlanta Braves. Nice play - Ramon went 2 of 2 with a run and an rbi.

Wednesday, 25 February 2009

Free antivirus

Someone, let's call her "Hayley", asked about free antivirus software.

Well, as you might have read there are a whole bunch of "dodgy" free antivirus software around. So, as always, be careful what you're downloading!

What is certain, though, is that you need antivirus software and you need to keep it up to date. But you also need to take a lot of care where you go on the internet and what you do there.

A couple of half decent free resources, then would be:

AVG Free or Avast.

I've used both and they're both OK. If you really get a real problem then Sophos has a free 30 day trial. It's expensive to sign up for the full version, but if you need to get out of a problem then Sophos might be the cure if nothing else is working.

Of course, you'll also need to make sure to check for spyware, malware and all the other nasties.

Testing, Testing, 124

Test plans rock.

Really, they do. They're sooooo important. But they're always the stuff people leave out.

One of the key things with a Database Testplan (for the AQA Applied A Level course btw) is that the plan needs to relate clearly to the evaluation criteria. This is totally like crucial dude - check out the markscheme AO4 Line 3.

So, you can have all of your generic testing stuff like field sizes, queries and whathaveyou, but if you don't have specific testing points related to your evaluation critieria you're not getting very far down the mark line.

Here are a couple of someone's evaluation criteria. We'll call him "Alex" (it's OK, he's not a duck...):

Test Number 11
Test: User can edit data (eval crit 2)
How tested: I will try to edit data in tables
Expected Outcome: Able to edit data

Test Number 12
Test: The database prints weekly and daily reports related to that week/day (eval crit 3)
How tested: I will try and print reports which automatically print the records for today or this week
Expected Outcome: The right data will be printed without anything which is not needed

Ideally you want to refer all of your evaluation criteria to points in your test plan. I'll say it again: this is in addition to the generic testing points that you might have. That's really important. Like, really.

Or the ducks will know.

Tuesday, 24 February 2009

The Ills of Social Networking (sniff)

Feeling a bit under the weather? Can't shake off a sniffle?

Hmm, so maybe it's all that social networking you've been doing.

Lots of reports about this just now, with an 'expert' claiming that social networking sites could harm your health because they limit your face to face contact with other human beings. I guess that what you make up with in not catching their germs, you lose by, well, this:
...evidence suggests that a lack of face-to-face networking could alter the way genes work, upset immune responses, hormone levels, the function of arteries, and influence mental performance.

This, (the expert) claims, could increase the risk of health problems as serious as cancer, strokes, heart disease, and dementia.
Blimey! Good job I'm old and we didn't have all this internets stuff when I was growing up.

So, if you're tweeting on facebook all the time, maybe you should think of your health a bit more? Do you think??

Mind you, it seems even the trees are getting in on this social networking larch. There's an Activity Forest park in Devon that's got a Facebook profile.

Monday, 23 February 2009

Flash: multiple answers and upper/lower case

So, a Flash quiz with a text entry box?

Well, what if your user doesn't think the same as you? You show them a car and they write "motor car" rather than "car" in the text box. Shouldn't this be a valid answer?

You need a way of getting more than one answer accepted by the action script.

Here's a walk through...

I created a very basic question:

Really simple, eh?
  • all I have there is a question, an answer box and a button;

  • the answer box is set as an Input Text box with an Instance Name of answer;

  • then I have a 15 frame animation (it could be 3 frames long actually - I just like to spread my frames out!);

  • the Actions layer has stop(); at the 1st, 10th and 15th frames;

  • the background layer has my question at frame 1, the "Well done" bit at frame 10 and a "Try again" dialogue at frame 15.
OK with that? Simple stuff eh?

What we need to do then is attach some ActionScript to the button so that when it's pressed the answer in the box gets checked and we get moved on to the right place in the movie to give the feedback to the user.

The key is that I want to allow an answer of red or scarlet. And I want to allow an upper case answer and a lower case answer (or a mixture in case the user hits the Caps Lock key by accident half way through!).

Here's the ActionScript...

Need to see the script more clearly? Click the image then!

Now, I'm going to walk you through that line by line, so here goes...

1 on(release) {
All this does is say when the button is released do whatever's inside the curly brackets

2. answer.text = answer.text.toLowerCase();
Ah, this is a beauty, but you need to get the capitals in exactly the right places or else it screws the entire thing up. All it does it take anything that goes into the answer text box and convert it to lower case for the purposes of the ActionScript. Clever eh?

3. if(answer.text.indexOf("red") != -1 answer... )
Hmm, tricky. What this is doing is saying if whatever's in the answer box is red or scarlet then do what follows inside curly brackets.

But it does this in a cool way. It looks at the textbox and says if the boolean response (the true/false response) to the question "does it say red?" is not equal to (the != means not equal to...) false (the -1 means "false") then do what comes next. Read that again. And again. Get it yet? That's OK, it's a bit complex. Just know that it works!!

Then it says Or if it's scarlet. It does this with the symbol (you'll find the key at the bottom left of the keyboard just by the zed). This symbol means Or. Promise it does.

4. {
Opens what happens if the if statement is true (i.e. it's red or scarlet)

5. gotoAndPlay(10)
So go to the keyframe which says "Yay, you got it right dude". I could have used gotoAndStop and I could have named the keyframe. Both would have been cool.

6 }
So stop doing this if it's true

7 else
Why, do this if it's not true then...

8 to 11 should make sense - we check to see if we've closed all the brackets!

Adapting the Script:

Easy enough to do. You can keep adding or... by adding answer.text.indexOf("maroon") to the If statement. You can make this line as long as you want - but if there are lots of possibilities then perhaps you need to think about your question?

I'm not sure, but in a long quiz you might want to call the textboxes answer1, answer2 etc...

You can also add a check to make sure the user put something in the textbox. I might blog this one tomorrow if I feel like it.

And you can start to add up right and wrong answers nice and easily if you wanted to. This doesn't take too much doing!

Flash scene names

So, you have a movie with a bunch of scenes. But they're all called really useful names like Scene 1, Scene 37 and whathaveyou.

Even more annoyingly, they're not numbered in the right order. Ugh.

Wouldn't it be good if you could rename them? Hey, you might even have tried to do this. And failed...

First off you need to get the scene names up in a panel on the right. You'd think they'd make this easy woudn't you? Hmmm...
  1. Go Window > Other Panels > Scene (hey, keyboard shortcut madness: Shift+F2)

  2. A little windowy, panel thing pops up

  3. You can dock that windowy thing over on the right if you click on the little dotty things to the right of the word Scene at the top and drag it into the panels. Easy eh?

  4. Then you can double click the scene name and rename it
You know, you'd think that'd be a bit more usable really...

Sunday, 22 February 2009

The killer machines from outer space...


They're everywhere. Look around you - go on, do it now. How many machines do you see?

I happened across an interesting article by Don Norman, a kind of machine design guru, where he decides that machines are clearly from outer space. And on a mission.

It's a fun read, but with lots of very serious (and quite geeky to be honest) things to say. Check it out:

People Are From Earth, Machines Are From Outer Space

And remember next time a machine plays tricks on you...

Saturday, 21 February 2009

Facebook and what they know...

So, you've signed up to some sort of web social networking thingy? Apparently lots of people have.

Well, what about your content? What about your privacy settings? Can anyone find you, or do you restrict what people can find out about you?

The whole Facebook row which has been in the news is a good example of where this is contentious when changes start to be made.

If you didn't follow the story, basically Facebook decided that they wanted to change their "terms of service" (that's the bit that you didn't read before you ticked the box and hit the I Agree button, OK?) to allow them to claim "ownership" over all the content members put on the site. This BBC story kind of explains it. They then had to back down because lots of people decided they thought this was a Bad Thing - as summarised by the BBC again.

Hmm, please read them carefully? All 6,839 words?! (yes, I counted them...)

All very well - the change of heart is "temporary" and maybe the original plan wasn't actually to claim ownership either, although that's how it hit the headlines which would have put some users off at least.

What is interesting is that all this "new" social networking stuff is basically giving people a free reign over what they put online. The problem with putting content online is that you then lose some element of control over it before you start. Need an example? Ever taken a photo from a website? Or copied some text? Or accessed a friend's profile? (or, more interestingly, an enemy's?!!).

Losing control isn't necessarily a bad thing, so long as you control what you lose control of. Do I mind if the details I put on this blog are in the public domain? No, not really - I've limited what I've put in the profile that goes with it deliberately so that it doesn't matter.

But here's a thing - seems lots of people don't change security settings or have any idea what ticking the box and hitting the I Agree button allows someone else to do:

It is likely though that until the row over Facebook's Terms and Conditions went public, few people knew what rights sites claim over the content that their members upload and share.

"Less than 25% of users are making a specific point of going to the privacy settings and making changes," said Simon Davies, head of digital rights group Privacy International.

From: Whose data is it anyway? (BBC, 20/2/09)
Does this matter? Should people care what companies do with their details or who can access them? What information about you is there online that in 10 years time might come back to haunt you?

Or, for that matter, about me...

Friday, 20 February 2009

Cheatsheets help make life easier

Sometimes books are great in that they can teach you how to program something or the code to use for a job. But sometimes books are just too long to be all that effective. That's when you need a cheatsheet.

I happened to come across Added Bytes, a really interesting bloggy type of resource. It has a bunch of really quite nice little cheat sheets that might come in handy for all sorts of things.

The subjects are a bit geeky, with stuff like html and css being covered, along with JavaScript (which is quite a nice basis for Flash Action Script in my opinion) and rather more complex stuff like mySQL and PHP. There's also a World of Warcraft sheet though, with the promise of a French one to come too, although the owner has dismissed the possibility of doing a cheat sheet on girls (it's just too complex apparantly...)

Worth a look.

Saturday, 14 February 2009

Pitchers and Catchers

Time for pitchers and catchers to report - must mean spring training games are nearly here, which means summer is getting, well, a little closer.

Photo from Huey's Flickr stream

Good to see - it's been far too cold and miserable and I'm up for any sign that summer's nearly here!

Wednesday, 11 February 2009

Date Validation for Databases

So, you need to validate a date for your database.

OK, so there are some easy things to do:
  • you can set the field type to Date/Time

  • you then need to set the Format in the Field Properties to Short Date probably - depending on the format you need

What else can you do? What can get you more marks and make you look like a champion database dude?

An input mask is possible - use 00/00/0000;;_ for example.

You can then set a validation rule of something like Date().

But you might want to get funkier than that. Look at the screenshot here.

This shows that we're validating the date to be between today-43800 days and today-3000 days. That's days OK - so I got the calculator out and figured out that 120 years old was 365 * 120 - easy as that.

This allows you to set a range of valid dates for, say, a date of birth if you need someone to be at least a certain age. The -43800 days bit means someone can't enter 1645 by mistake!

I've also set the Required property to Yes. This means that they user has to enter a valid date of birth. They aren't allowed to leave it blank. Take a bit of care with required properties though: if there's any chance that the client might not need to enter that field for any item then don't set required to yes!

Delivery Dates:

You might also need to set a delivery date (or a return date for a book or something similar).

Take a look at this for some ideas:

This time I'm setting a validation rule of between Date()+1 (i.e. tomorrow) and Date()+35, which is 35 days time. That's the set window I've got for delivering the product someone's ordered. The delivery date field has to be set within that window.

I've also set a default value here. My standard delivery date is tomorrow because the company does a next day delivery service. It will save time and effort having to type in the date each time if most of the deliveries will be made the next day.

For a library database I might set the default value for the return date to be Date()+14 for example - depending what the standard loan period is.

You can overwrite a default value, but it saves some time entering things that are going to be standard for many records if you use a default value.

Of course, you could get really clever and set up a calendar control on a form to make entering dates even easier - just like you see on the web for hotel booking or buying train tickets for example...

Thursday, 5 February 2009

Double Booking Solution to a Database

We were talking about this at work the other day - how do you solve a problem like double booking a hotel room or a car hire (or, for that matter, Maria)?

There are various solutions, but a dead easy one it laid out in the textbook we give our sixth form AS students. If you had that book in front of you then you'd go to page 193 and find that it was quite complex looking, but really dead easy. There needs to be some thinking done as to how exactly to get it work of course, but we'll get there with that. Perhaps.

I'll add some screenshots to this when I get the chance.

Monday, 2 February 2009

Free Software #1 - Audacity

Audacity is a a really quite fuggly piece of software that you can use to make and edit sound files.

It's cool for lots of stuff - voice recording, editing a long recording into a bunch of sections and sampling a ring tone for example. You can also use it to record direct from your computer - so, say, you had a radio programme that you couldn't download...

You can download the latest version of this little beast from the Audacity site. It's not a big download and it's pretty stable and simple enough to use - stick a comment on this if you want to check something. You might need to get your hands on a mic if you want to dub your voice onto some sound, but they're pretty cheap to get hold of.

Look, the basic buttons look just like an old fashioned tape recorder. Even oldsters like me can work our way around that!

I'd start by getting an mp3 track (or whatever - it'll deal with lots of formats) into the software and start to play around with the various editing tools. Highlight some of the sound and see what you can do. The Effects menu is quite funky, but also try cutting the file around.

Then see if you can add two tracks at once. You might even be able to mix them into each other if you play around enough - the Audacity site has a pretty sound (ha ha...) set of help files and tutorials that should help you along with anything you get hideously stuck on.

The whole thing is easy enough to use. Just highlight want you want to edit and edit away.

The one issue you might have is being able to record your voice easily. Try Edit > Preferences and change the recording device to whatever's on the bottom. That might work.

I don't remember if you need to then change it back to something else to record sound from your soundcard. Try it and see!

Free, fuggly and funky. What more could you want?