the mango trick
Those in the know eat mangos in the best way- slice the cheeks off, so you have two half rounds and the pit. Now, use the knife to score a grid on the two half rounds, so you have squares of about a centimetre. Push the rounds inside out to get easily spearable mango chunks. Mangos are pretty juicy and difficult to eat (but oh so tasty!) and this trick makes them a bit easier to eat.
But did you know the mango trick also works for avocados? I worked this out today as I made guacamole for the evening meal. The cubes make it easy to mash up the avocado with a fork. The difference with the avocados is you have to squeeze the sides together rather than bend them backwards.
Also- the pit in an avocado is easy to remove- press the knife into the seed, and then rotate the knife like a hand on a clock, this will dislodge the pit.
I really like the taste of mangos and avocados- can you tell?
COMMENTS
a song to tap your foot and smile to
Thanks to Timmy D’s blogging, I listened to Relient K’s new single, Must have done something right on their myspace page.
I really like this song- it’s really up beat and happy, a love song; in lyrics and in pacing. There is a groovy piano intro, which carries the piano through the whole piece and a rolling bass line, not unlike another favourite song of mine, Lady Madonna by the Beatles. Happy synthesiser sounds, as well as a bridge of vocal “Bop Bop Bop…” complete the package. Like Matt Thiessen (lead singer) says, it’s a song to tap your foot and smile to.
The other surprising thing is that I have seen that myspace done well is actually quiet pleasant. The Relient K guys have put together a clean page that doesn’t crash firefox (applause! applause!) Unlike some of the more amateur designs out there- I suppose that any web page has the capacity to look horrible, but myspace makes it much much easier.
I have listened to this song over and over again using myspace’s in built player, which is really quiet nice quality wise, and doesn’t sap my bandwidth. I need to get an internet capable money-card (not a credit card- one that lets me spend my own money) so I can use iTunes to buy this track (which comes with a bonus track!)
I'm really looking forward to the album- due out March 6th 2007.
COMMENTS
ninja word
Ninjaword is my new favourite toy tool. It is a quick dictionary (“fast like a ninja!”) that lets you quickly compare words- and keep typing to add words- so you have a nice record of what you have looked up.
And it’s got ninja in the name. Via [LifeHacker]
COMMENTS
mega church riots
Matt’s attempting to rile the megachurches with this cartoon:
Go here to see the original.
It’s good to ruffle feathers sometimes- especially when it means that people start to do the right thing because of it.
COMMENTS
catering for vegetarians
A brilliant comment on a [lifehacker] post about vegetarian recipes for the USA/Canada holiday, thanksgiving. While I don’t celebrate thanksgiving (yeah yeah, I’m just ungrateful) that comment is fantastic- it helps people work out what to feed vegetarians and vegans, at what ever time of the year.
There is actually quite a lot of things a vegan/vego can eat- trust me, I volunteer at a vegetarian cafe.
Another topic raised earlier in the thread is that of vegetarians and fish. The general consensus is that if you eat fish/chicken/anything-not-red-meat then you aren’t a vegetarian. I agree. If you don’t like red meat, then just put up with the label of “fussy eater”. Vegetarians/Vegans are usually so for ethical reasons, not “eww” reasons.
Vegetarians are really easy to cater for (properly, not just by removing the meat), and Vegans don’t take that much more of an effort to cook for.
COMMENTS
writing readable code
Dominic wrote about commenting code before you write it, and wondered about other good programming practices. This is a good chance for me to review the stuff I learnt last semester, hence this post, about How to Write Clear and Legible Code.
Writing clear, legible code is a good thing for a couple of reasons:
- You know what you are doing
- You can write code that follows the design
- You can see and fix bugs simply by reading the code
- Others can come and work with your code easily
- Future maintenance is simple
- Simple to re-use
So, with all these advantages, how do we actually go about writing this clear, legible code?
Write comments
- As Dominic already pointed out, comments help you recognize what a bit of code does, any potential issues, etc. In fact, writing the comments before hand works kind of like an outline for the program.
Use the white space
- The enter/return key was put there for a reason: use it! Space your code out nicely with tabs, using indentation to indicate different code blocks.
for (int i=0; i<24; i++) {
if (i == 13) {
System.out.println("ooh! unlucky!");
}
}
Use meaningful names
- Don't label things with just letters, or otherwise meaningless names ("foo" etc) Use names that describe what the variable is: interestRate (rate and interest are better than r and i, but it's ok to have long variable names), amountMoney, etc. This applies to variable names, method names, class names etc. Also, don't abbreviate unless you know what you are saying and do it everywhere.
Pick a standard and stick to it.
-
Don't use interestRate, TIME, Total, initial_amount all together- pick one and use it. While all are valid in Java, traditionally the words are run together, with every word after the first one starting with a capital.
Similarly, pick the number of spaces your tab is going to have (four is common) and use that always, whether your { is going to come at the end of the line or start on a new one, etc.
Of course, if you are working for a company, many of these "style" issues will be dictated to you.
Use Methods (otherwise known as functions)
- Encapsulate code into callable methods, that can be used from multiple places. Hint: if you are copy/pasting code, then you should put it into a method.
"for" loops:
-
Where possible, use the for instead of a while- it is clear and easy to see the condition for ending the loop.
Comment liberally!
- It's been said once, but it's worth repeating. Make sure to add lots of comments!
A lot of these are common sense, just remember to go the little bit extra to make things so much easier for you and anyone else who will be using your code in the future.
COMMENTS
making life simple
The general’s got a blog. Good discussion on the deep issues.
freewheelered!
COMMENTS
minus 470 mL
I gave blood today, for the first time! It was a really cool experience- knowing that my blood could be used to save lives!
Cool Things
- Doing it with friends! that way you can’t freak out, and you are saving twice, thrice, four times or more the number of lives!
- The colour- blood is so pretty! The deep red colour is just beautiful.
- Didn’t hurt! Well, the actual giving of the blood.
- Seeing the monitor with:
- mL collected
- mL per minute
- time elapsed (9.47!)
- Cool Chairs – the ultimate recliner.
- The food: mmm… orange juice and fruitcake
- Orders to take it easy the next day
Not cool things:
- The finger prick to test haemoglobin hurt. (15.4!)
- The initial needle hurt (for like 3 seconds as it went in. )
- Not enough people donate blood!
Weird things:
- Blood is warm- yeah, no way! But it felt weird flowing through a tube over my arm.
- The antiseptic is yellow.
- The needle is huge- I’ve got a dirty big hole in me!
- 470mL is not one pint. One US pint is between 473 and 474mL, and one imperial pint is close to 600 mL.
- B+ type (mine) is the most given, even though that doesn’t correlate to the population.
- 48 hours is all it takes to bring your blood levels back to normal.
Over all, it was a really cool way to spend an afternoon with friends- with snacks provided! (Yep, that’s the only reason we went, yeah?) In three months time (to let my haemoglobin recover), I’d be happy to do it all over again.
So what about you? Have you given blood? Are you planning to give blood? Does blood gross you out? Have your say, drop a comment in the box!
COMMENTS
top ten bad things that happen to data
Top 10 data disaster recovery stories [OnTrack]
You know all the stupid things that happen, and seem to happen the most when you don’t have a good backup, and all the data is important? Well, data recovery company OnTrack has compiled the top ten head-shakers for our enjoyment. Amazingly, they claim to have recovered all of the data in all of these cases.
There are the standard dropped, ran over, burnt stories, but there were some classics:
- Professor hears squeak, fixes with WD40, kills hard drive.
- Man packages hard drive in dirty socks to send in- damages drive more. Stick to bubble wrap, mate.
- Old banana left on external drive oozes goo and stops the drive.
The banana, however, could not be recovered.
And with the price of bananas being what it is at the moment, that’s a crying shame.
Good for a laugh… and a warning. Back up your data, folks! The most important stuff is only a writeable CD away!
Via the BBC
COMMENTS
ok, so, who doesn’t own a cell phone
Wow, second post for the day, after a veritable drought of blog posts!
Anyway, this one’s just a short one to point out that Timmy D has been added to the freewheelers, with his blog named after a line in a Relient K song.