Monday 31 March 2008

Identifying Colours (revisited)

Today Hobnob and I took a look at the whole colour identification thing and now my application seems to work a lot more sensibly. Discovered the following things:

* That copy-and-paste errors will seemingly always be prevelant in my applications. If I code my application to recognise reds as pink then that's what it'll do even if I did mean to change it to say red after I pasted it.

* That the difference between the RGB values within greys can vary up to around 6% and still look grey.

* That if I return an RGB value between 0 and 1 then checking to see if it's greater than 225 will not generally return true.

Those three combined with adding some extra weighting to the middle section of an image (assuming that most people taking a picture of something will aim to have it in the middle of the picture) seem to have mostly fixed my code!

Saturday 29 March 2008

Books I Read in March

Total: 8 books.

Past Mortem (Ben Elton)
The Chocolate Run (Dorothy Koomson)
Boy A (Jonathan Trigell)
Concertina: The Life and Loves of a Dominatrix (Susan Winemaker)
Changeling (Melissa Diem)
The Light Fantastic (Terry Pratchett)
Sushi For Beginners (Marian Keyes)
And God Created the Au Pair (Benedicte Newland & Pascale Smets)

Another library read, I borrowed, read and then returned Past Mortem within 24 hours (28/03). I much preferred this to some of Ben Elton's other recent books - it's witty and clever but I did work out whodunnit around halfway through.

Having enjoyed My Best Friend's Girl and Marshmallows for Breakfast, The Chocolate Run seemed like a good bet when it was one of Waterstones half price offers of the week. I started this at Waddow and finished it a few days after I got back on the 27th. A little more traditional chick-lit than the others, I didn't enjoy it as much as My Best Friend's Girl but it was a light, enjoyable read none-the-less. I put it on BookMooch and it very quickly went to PurpleRosebud (UK).

Boy A (22/03) was (alongside Concertina, The Chocolate Run and many, many others) a Waterstones buy. I was feeling a bit miserable and got quite happy with the 3 for 2's. I really enjoyed this book. It's short but easy to read and thought-provoking. I'm hanging onto it to read once more before I pass it on to someone. Boy A has also been made into a film which I'd be tempted to watch if I got the chance.

Concertina: The Life and Loves of a Dominatrix (21/03) was another of my reading at Waddow books. I picked this up in Waterstones, Lancaster because it caught my eye and the combination of food alongside domination seemed slightly odd. Odd it may be but there's not quite as much of a combination as the blurb and comments make out - there are some quite graphic descriptions of both but more of one than the other and rarely interleaved. That said, this is a book with some very beautiful bits of descriptive text (whatever it is they're describing) and is generally quite an enjoyable read. I've hung onto this one to reread again and then I'll decide what to do with it.

Changeling was a "Drop of the Irish" read from the library (celebrating St. Patrick's day I assume). This is a short, moving book which I really enjoyed. I read most of it in one go but then had to hold off on it for a week or so (doing coursework) before reading the last few pages on the train up to my Queen's Guide residential at Waddow (20/03).

The Light Fantastic is the second of my very slow movements through the Discworld series. I had to restart this a couple of times because I kept putting it down for weeks at a time but that's no real reflection on this book. Hopefully I can put Equal Rites down as one of my reads for next month...

I picked Sushi For Beginners up from the library having read (on the backs of far too many trashy chick-lit novels) that Marian Keyes is the author of the genre. Unfortunately I wasn't all that impressed by this book. There's nothing wrong with it as such but it's not at all special and felt a little bit formulaic for my liking. Like most novels of its kind it's pretty easy to read but I'd be unlikely to bother with it again.

Borrowed from the library and read in bed on that day when I was too ill to get up, And God Created the Au Pair is a very easy-to-read book. One of an increasing number of novels written entirely as correspondence there's not a lot else to say about this book.

Friday 28 March 2008

Identifying Colours

I've almost finished my Tamagotchi app. I have something that's alive for a bit getting hungrier, dirtier and older and can be fed, played-with and cleaned by taking pictures. The pet demands that you take a picture of something that is a specified colour to successfully play/clean etc. Unfortunately its colour matching seems slightly flawed - I've just taken pictures as follows:

Took Blue - Identified Blue
Took White - Identified Yellow (but reflection from green wall/shadows?)
Took Red - Identified Blue
Took Green - Identified Green
Took Black/Blue - Identified Red

Clearly something is not so great in my colour matching. I'm currently going through all the pixels in the image and identifying them as one of: black, white, grey, red, yellow, green, cyan, blue and magenta. I keep a count of how many pixels are of each colour and say that the picture is whatever the modal colour is. If two or more values are equally common then I return whichever of the most common colours appear first in the list of colours.

I guess I shall have to try a few more methods and see what works best.

Thursday 27 March 2008

Pay It Forward

I've just found this post from Half-Baked Brownie Guider. The idea seems fairly straight-forward: each person who wins recieves a package from the person running the pay it foward. They then put together three packages of their own and allow people to enter a draw for them via. a blog or messageboard. On a specified date three names are drawn and those people are the new set of winners - each receives a package and is expected to run their own pay it forward for others.

Like a chain letter only not so nasty. I came across a chain letter that involved mailing people nice (new) knickers - I never got any :(

(I did wonder when I'd next use the underwear tag)

That Tamagotchi Application

Having taken a break with all the chaos that's come up recently I've now finally got back to my Tamagotchi-style phone application. It's gettting kinda neat now, I persuaded it to take photos which is good so that just menas I need to call my function to work out what colour they are!

Wednesday 26 March 2008

London Trip Badge

Back full of Guiding excitement I remembered my idea to design a badge for our upcoming London visit. Having fiddled about with some image searching and a lot of copy/pasting in Teal and Omnigraffle I've got as far as this black and white outline:The top bit that looks a bit funny will be a London eye if I can make some closer resemblance with a pencil. I think the background would be yellow with the rest in blue/black. The complex images (Big Ben and Tutankhamun) will need some simplification too. Not too bad though :)

Sunday 23 March 2008

If Only

If all we lost somehow came back
If all that died again would grow
If only it was so, these are the loneliest words I know
From If Only, Whistle Down the Wind.

I want my keyboard and music books.

Thursday 20 March 2008

Swimming

Swimming is good I should do it more often. It's made my ankles hurt today because I haven't done it for ages before today.

Also, never take children swimming. There just aren't enough eyes in my head for that.

Tuesday 18 March 2008

CustomItem Preferred Size

I've been coding a tamagotchi app for the Nokia N95 with MIDP 2.0. I'd been working on the Sun emulator until last night when I copied it to the phone. Running it on the phone was a bit deperessing because all the nice images in my custom status screen overlapped. It seemed slightly odd as I'd gone out of my way to ensure I calculated the height and width of all the bits and used them to get an overall minimum and preferred height e.g.

Class MyItem extends CustomItem {

byte height;
byte width;

public MyItem() {
this.width=part1.getPreferredWidth();
this.width+=part2.getPreferredWidth();
this.height=Math.max(part1.getPreferredHeight(), part2getPreferredHeight());
}

protected int getMinContentHeight() {
return this.height;
}

protected int getMinContentWidth() {
return this.width;
}

protected int getPrefContentHeight(int width) {
return this.height;
}

protected int getPrefContentWidth(int height) {
return this.width;
}

}

However, whilst this works in the emulator, it turns out I need another line to make it work on the phone. Adding the following:

this.setPreferredSize(this.width, this.height);

at the end of my constructor fixed my problem and now it all looks pretty great! :)

The Word is Music

I was trying to remember last week how I'd come to buy Sarah Kelly's albumTake Me Away, it took me a little while but I bought the CD after hearing one track on The Word Is Music (online radio). I thought I'd have another listen but I don't think I'm especially likely to buy anything from what's being played at the moment. The ads are somewhat irritating (though not as bad as Classic FM). Also, I don't like the way their feed works, why do I need a big blank black page (which I don't seem to be able to bookmark) among the tabs in my browser?

Wednesday 12 March 2008

RGB to Hue

Today I've been trying to convert RGB values to a hue value in Java. It would be easy using Java SE but there's not a 'does the job for you' function in ME (I hope).

It was all going a bit wrong for most of the day but then Hobnob came home and made it work! Hurrah!

Monday 10 March 2008

Custom Java ME Gauge (Revisited)

Woo, I've now managed to get three of my custom gauges together to make a status menu. The icons sit very nicely on top of each other (though I need to write the code to make the gauges update from the menu) but are still in completely the wrong place on the screen.

Lunch and library time!

Custom Java ME Gauge

Woo! I just made a cake that fades! I'm currently crafting a Tamagotchi-like Java ME application and was trying to find a nice way to display hunger levels etc. Gauages are a bit unpredictable in the amount of screen space they take up, so instead I've created a custom component that fades away depending on the level set. A quick Google for what I wanted lead me to this tutorial/example which was really useful (together with what I already knew from Jonathan Knudsen's book, Kicking Butt with MIDP and MSA). This page got me the last bit which was placing the image on the display (knowing what to throw at Graphics.drawImage). I've still not got my image in the correct place (when is TOP LEFT not top left?) but I do now know that it works!

Saturday 8 March 2008

Friday Feeling!

Went back into uni. today having had yesterday off for being ill. Was mostly very tired so I came straight back from lectures and went to bed for an hour or so but now it's officially the weekend!!

Lots of work to be done :(

Friday 7 March 2008

Thursday 6 March 2008

60ish Things You Probably Don't (Want To) Know About Me

Another one of those time-wasting notes passing through Facebook...

1. What is on your bed right now?
My bedding (sheet, pillows, duvet - not the denim one sadly, a Wilkos special), my really cool Rainbow throw from Toybox, my Snoopy bag from Lizi and a copy of Sushi for Beginners, the left overs from my lunch (fallen out of my bag), my Snoopy PJs, the rabbit soft toy from Clare and the coolest monkey ever.

2. When was the last time you threw up?
Hmmm... ages ago (thank goodness). I'm not sure I can actually remember. It might have been the summer after my first year of uni - 2004 - food poisoning from Butlins, Minehead.

3. What's your favorite word or phrase?
"It's funny" is the one I currently seem to use too often. I quite like charlatan, mountebank and masquerade - good old fashioned words.

6. What were you doing 30 minutes ago?
Reading on the bus.

7. What is your favorite holiday?
Right now, any holiday at all! I love Easter because it has Spring Harvest in it and that is good, I love Christmas because it's just generally awesome and summer would be better if there was more lounging about in not-too-much-but-just-enou
gh sun.

8. Have you ever been to a strip club?
Strangely, no.

9. What is the last thing you said aloud?
The code to get into the laundrette - a guy in our kitchen still doesn't know!

10. What is the best ice cream flavor?
B&J Phish Food (without the fish) or Half Baked. If it isn't B&J then it has to be vanilla (not that I'm fussy). Sorbet's better than ice cream anyway.

11. What was the last thing you had to drink?
Hot water straight from the flask - I burnt my tongue.

12. What are you wearing right now?
Jeans, boots, a stripy top and my red hoodie (and the required set of undergarments). Also, my coat - I should take that off.

13. What was the last thing you ate?
A plain chocolate digestive.

14. Have you bought any new clothing items this week?
Nope, thank goodness. I have too many clothes.

15. When was the last time you ran?
Um... probably for the bus sometime last week?

16. What's the last sporting event you watched?
Haha, I don't even seem to watch sport. Oh dear.

17. If you could go anywhere in the world, where would you go?
Somewhere with lots of exciting walking to do. Lots of green.

18. Who is the last person you sent a comment/message on facebook?
Chris asking me to project last weekend.

19. Ever go camping?
Yep! It's usually hard work but lots of fun.

20. Do you have a tan?
Never!

21. Have you ever lost anything down a toilet?
I dropped my phone once (never put anything in the back pocket of your jeans).

22. What is your guilty pleasure?
Reading when I think I should be working.

23. Do you use smiley faces on the computer a lot?
A bit but a lot less than I use to I think.

25. What did your last text message say?
"That's good. Hope you're having fun. I'm on a train with Graham going to Liverpool. Love, Saff" - to Charlotte

26. Are you someone's best friend?
I hope so!

27. What are you doing tomorrow?
Lectures on memory management and networking. A Linux practical.

28. Where is your mom right now?
Derbyshire?

29. Look to your left, what do you see?
My printer and my nice clean carpet!

30. What color is your watch?
Navy blue with Snoopy on (though the one I'm wearing is not mine!)

31. What do you think of when you think of Australia?
Naff soaps, James, an array of funny animals.

32. Ever ridden on a roller coaster?
Yep. I used to love them but now I'm a bit more nervy.

33. What is your birthstone?
Not a clue.

34. Do you go in at a fast food place or just hit the drive thru?
Eat in. I haven't used a drive thru for years.

35. Do you have any friends on facebook that you actually hate?
Nope. I'm not sure I hate anyone.

36. Do you have a dog?
No.

37. Last person you talked to on the phone?
My dad.

38. Have you met anyone famous?
Yes.

39. Any plans today?
Eat. Go to bed.

41. Are you happy?
Tired. Not unhappy though.

42. Where are you right now?
On my chair, at my desk, in my room, in my halls.

43. Biggest annoyance in your life right now?
Not enough sleep.

44. Last song listened to?
Stuff from the Buffy musical episode. That sounds a lot sadder than I am.

45. Last movie you saw?
Black sheep?

46. Are you allergic to anything?
Not very. Codine.

47. Favorite pair of shoes you wear all the time?
My boots.

48. Are you jealous of anyone?
Not that I can think of.

49. Are you married?
No.

50. Is anyone jealous of you?
Not that i know of.

51. What time is it?
21:02.

52. Do any of your friends have children?
Yes.

53. Do you eat healthy?
I wish.

54. What do you do during the day?
Study.

55. Do you hate anyone right now?
No.

56. Do you use the word 'hello' daily?
I should think so.

57. How many kids do you want when your older? What will you name them?
Some. Ask my husband.

58. How old will you be turning on your next birthday?
24.

59. Have you ever been to Six Flags?
Not that I know of (where??)

60. How did you get one of your scars?
The one on my knee came from falling over in the playground at school.

Saturday 1 March 2008

Books I Read in Febuary

Total: 9 books.

Can You Keep A Secret (Sophie Kinsella)
The Undomestic Godess (Sophie Kinsella)
Mums@Home (Sophie King)
My Mummy Wears a Wig - Does Yours? (Michelle Williams-Huw)
The Carpet People (Terry Pratchett)
Animal Crackers (Hannah Tinti)
The Secret Dreamworld of a Shopaholic (Sophie Kinsella)
A Left-Hand Turn Around The World (David Wolman)
Perfectly Correct (Philippa Gregory)

Following on from my discovery of Sophie Kinsella earlier in the month, Can You Keep A Secret (27/02) and The Undomestic Godess (25/02) were both library reads. I enjoyed The Undomestic Godess rather more than Can You Keep A Secret but perhaps that was partly due to the discovery as I progressed through the latter that I had read it at least once before. I'll carry on reading books by this author as I come across them but I'd be unlikely to bother rereading them (or at least being aware of it).

Mums@Home (23/02)

My Mummy Wears a Wig - Does Yours? (21/02)

The Carpet People

A 99p bargain from Waterstones, Animal Crackers is a fairly typical book of short stories (where typical means they're all slightly odd).

I received The Secret Dreamworld of a Shopaholic as the result of a swap for Stories We Could Tell (arwen1:UK). It had been a bit of a toss-up between something so obviously chick-lit and the more serious (I foget what) but I figured the chick-lit would be a quick easy read. Easy indeed, I picked this up on my way out after dinner on the 5th and finished it in bed that evening. I actually enjoyed this enough that I'll be making a small effort to find the other two in the series. I've put it back onto the swapping sites.

A Left-Hand Turn About The World (04/02) was another venture into the library's non-fiction books. I enjoyed Chris McManus's Right Hand, Left Hand and that prompted me to have a go at this. This book isn't nearly as good but is perhaps a little more friendly - maybe? It's a good introduction to handedness but I was a little frustrated without some of the more scientific content.

Mooched from Kim Cole (UK), Perfectly Correct (01/02) was my first book of Febuary. Having loved most Philippa Gregory's historical fiction (the exception being The Wise Woman) I thought it was worth trying something slightly different. The novel's had pretty mixed reviews and I can sort of see why. The writing's pretty fine and the story has some nice features but overall the book is lacking somewhat. Mostly I think because it has little hope of matching the beauty and intelligence of her historical novels. Anyway, I read this in a couple of days and have since made it available for mooching.

LinkWithin

Related Posts Plugin for WordPress, Blogger...