logo

Blocking Google Search Results

I've wanted this feature for ages - the ability to tell Google not to include results from certain websites. And now it's here:

image

I first noticed it when doing the following:

  1. Searched for a solution to some obscure (often Notes-related) issue.
  2. Accidentally hit a result for a site that requires registration and/or payment.
  3. Immediately hit the back button.

If now that, if you press the back button quickly enough, Google will show a "block this site" link under the result you clicked on.

Or you can try and manually add sites at this page (?) if you're logged in to Google.

Comment Icon 3/10 Comments Read - Add | Thu 2 Feb 2012 | | Open »

Why Might Notes Consider a MIME Field To Be Rich Text?

I hate the idea of turning this site in to my own forum, but have an "interesting" problem for you, which might help to have the answer on the internet, so...

I'm in the process of writing code to loop all messages in a Notes inbox, so I can examine their content. Now, consider this document and its Body field:

image

The Body field is obviously MIME, right?

As confirmed by ScanEz.

image

If you were to run the following code against the above document, what would you expect to see?

Item item = document.getFirstItem("Body");

if (item.getType()==Item.RICHTEXT){
    System.out.println("Item is Rich Text");
    
} else if (item.getType()==Item.MIME_PART){
    System.out.println("Item is MIME");
    
} else {
    System.out.println("Item is another type");
    
}

Now, I'd expect it to say it was a MIME field. Wouldn't you? But it doesn't. It says it's Rich Text!

I put this down to a quirk and decided to ignore what it was telling me and just go ahead and examine the MIME parts directly. Here's the code I used at first:

session.setConvertMIME(false);

MIMEEntity me = document.getMIMEEntity("Body");

if (null!=me){
    System.out.println("FOUND MIME ITEM!");
} else {
    System.out.println("CAN'T FIND MIME ITEM!");
}

session.setConvertMIME(true);
I'd expect it say it found a MIME item by that name, but this code says it can't find a MIME item. WTH?

Why on earth might Notes not be able to find a MIME field when it's obviously there and why might it consider it Rich Text instead? It's driving me spare.

UPDATE: Found the Solution

Ok, here's why it happens. If you combine the two code snippets above, like so:

Item item = document.getFirstItem("Body");

if (item.getType()==Item.MIME_PART){
    session.setConvertMIME(false);
        
    MIMEEntity me = item.getMIMEEntity();        
    if (null!=me){
        System.out.println("FOUND MIME ITEM!");
    } else {
        System.out.println("CAN'T FIND MIME ITEM!");
    }        
    session.setConvertMIME(true);
    
} else {
    System.out.println("Item is another type");
}

This won't work. The code will never get as far as the MIMEEntity bit as Item.getType() will never return MIME_PART.

However, this code will work:

session.setConvertMIME(false);

Item item = document.getFirstItem("Body");

if (item.getType()==Item.MIME_PART){
    MIMEEntity me = item.getMIMEEntity();        
    if (null!=me){
        System.out.println("FOUND MIME ITEM!");
    } else {
        System.out.println("CAN'T FIND MIME ITEM!");
    }        
    
} else {
    System.out.println("Item is another type");
}

session.setConvertMIME(true);

It all comes down to where you turn off MIME conversion for the session. It needs to happen before you look at the types of any field. Makes "sense". I guess. In a kind of it doesn't really kind of way.

Comment Icon 3/8 Comments Read - Add | Tue 31 Jan 2012 | | Open »

Two Websites I've Been Asked To Make

Normally when family or friends say they need a website I roll my eyes and hope there's a way I can get out of doing it. But then my older brother, Tim, asked me to do one that actually got me quite interested.

Tim's the engineer for a local radio station and is responsible for making sure - amongst other things - the station stays on air. He wants a way to monitor the output level of the station's signal remotely. So he's bought an Arduino kit and written a "sketch" file to have it monitor audio signal levels via a 3.5mm input jack.

2012-01-27 09.24.23

The Arduino board has a network connection and the plan is to put it on their network and it give a publically resolvable IP address. The Arduino board will respond to a HTTP request with a text/plain response that contains a number from 1 to 20 that is a measure of the output at that moment.

What Tim wants me to do is write a web front end to this. It needs to regularly "ping" the Arduino board to get the output signal and make some kind of visual indicator of historic output. If it drops to 0 for any length of time then he's got an issue. Either the Arduino has packed up or station is off air.

This is the kind of geekery I enjoy and I'm looking forward to getting stuck in to it. The Arduino in the shot above is in my possession and I'm free to mess about with it as I please.

Also on my to-do list is to make a website for Quinn's boyfriend's dad's driving school. He too has produced a "sketch" to show me how it should look:

image

Quinn's boyfriend is a talented artist and currently studying on a Computer Animation course at university. He must have gotten his talents from his mum's side me thinks.

Which website do you think I'll do first? Hmm....

Comment Icon 5/11 Comments Read - Add | Fri 27 Jan 2012 | | Open »

New Desk Speakers: Bose Companion 5s

Almost ten years ago I bought some Bose MediaMate. Thankfully Bose have got their online act together since then and buying the new pair you see below was quite a bit easier.

2012-01-26 09.21.12

I've replaced the MediaMates with a set of Companion 5s. They're a bit pricey, but I listen to music 8 hours a day, 5 days a week. The speakers I use are arguably as important a choice as the monitor. Well, that's the argument I made to my wife anyway.

The MediaMate's (which are on ebay if you want them) were always good speakers, but the Companions have blown me away (almost literally until I turned the "bass compensation" knob down). I can't believe the difference. Probably made by the subwoofer - sorry, "AcoustiMass Module" - under my desk.

I'm not an expert in acoustics but have an appreciation for what - to me - seems like a decent sound. If you read in the forums, which I don't, then you'll hear a lot of bad stuff about Bose. Over-priced and cleverly marketed, apparently, which may be true but they've got me. I get "brand blindness". Once I've bought something I like then I'll only ever buy another of them from the same company.

If you want to test out your speakers here's a good track. If they can't handle that you need a new pair.

Comment Icon 5/8 Comments Read - Add | Thu 26 Jan 2012 | | Open »

Adding Even More HTML5 Goodness to Codestore

I used to pride myself on keeping this site up there on the bleeding edge of best web design practice. That hasn't been the case as much lately though and this site's backend HTML has stagnated for years. It keeps up with things but generally lags behind.

In trying to catch up with the pace I posted on Friday about how I'd funked-up the search box. Not wanting to stop there I've now taken it a little further and converted as much of the site's markup to HTML5 as I dare.

The general structure of a page is now like this:

<!doctype html> <body> <div id="container"> <header> <nav> <ul></ul> </nav> </header> <section id="side"> </section> <section id="content"> <article></article> <article></article> <article></article> <article></article> </section> <footer> <nav> <ul></ul> </nav> </footer> </div>
</body>

If you're left wondering what all these new HTML elements are then worry not - they're simply new HTML5 elements. Most of them are simply used where you'd normally use a <div> but they give the markup more semantic meaning.

I now feel a bit better about the state of site.

Backwards Compatibility

Nothing's ever simple is it. To make sure these changes were backwards compatible I had to do two things.

First I had to add the HTML5Shiv trick, which uses conditional comments to load an extra JavaScript file for IE8 or less:

<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

Can't say I'm over the moon that my site now needs JavaScript to make the CSS work, and I've always liked that fact that one code-base rules all browsers, but I don't want to be held back by old browsers.

At some point in the future I'll remove the above Shim trick and remove "support" for <IE8.

The other thing I had to do was add the following CSS to make sure older browsers like Firefox 3.6 understood what these new elements were.

article, aside, canvas, details,
figcaption, figure, footer, header,
hgroup, nav, section, summary, video {
    display: block;
}

All done.

Comment Icon 4/14 Comments Read - Add | Mon 23 Jan 2012 | | Open »

 icon Page 1 of 324Last » | Next ›