They say you learn something new every day.

Archive for April, 2012

Exchanging Ideas (30/04/2012)

I wrote a while back about the Exchange System Manager, and while it was useful, it turns out that access rights to mailboxes are defined in the msExchMailboxSecurityDescriptor attribute in the AD. The problem is, rather than listing usernames, it lists ObjectIDs.

I’ve found a nifty way of pulling them out though:

DistinguishedName  = “DN of Object” 

set ObjUser = GetObject(“LDAP://” & DistinguishedName)
Set objsd = objUser.Get(“msExchMailboxSecurityDescriptor”)
Set dacl = objsd.DiscretionaryAcl

For Each ace In dacl

  wscript.echo ace.Trustee 


I’ve put this together in a script to report the access rights for lists of mail accounts. It’s one of those things I’ve been thinking about for a while, but finally got the chance to put it all together today.

How to Move Mountains (29/04/2012)

I’ve been reading How Would you Move Mount Fiji, not because I want to work at Microsoft or have any job interviews coming up, but just because I find it quite interesting, and like the puzzles there.

I find the concept behind puzzle questions quite interesting. On one level, of course, they’re stupid. A lot of them depend on whether you’ve heard them before. They’re so hard, and you’re asked so few of them that your responses aren’t representative of your intelligence.

Of course, intelligence and “IQ” are difficult concepts. I don’t think your IQ really tells you much – beyond saying, “this is a clever person” or “this is a stupid person”. And you can probably tell that from talking to them. It’s not really clear what intelligence is either.

However, there are some things to be learnt from puzzles, such as challenging assumptions, ways of thinking and putting in effort. And really, these are skills that you need in your every day life. 

Fixing stuff (28/04/2012)

I had to go home this weekend to fix my parents computer. (First line technical support you see). As it turned out the graphics card had blown.

I’m always a bit more nervous of hardware but I took it out and used the onboard graphics card until I can get a new one. I had a real faff finding the drivers and sorting it all and it reminded me again how difficult computers are. They really are. They’re basically too difficult for humans to use.

Simplicity and ease of use is really something to strive for above all else.

Thinking past (27/04/2012)

I’m reading a book about the puzzle questions they ask in Microsoft interviews.

Interestingly one of the ways of tackling them and of solving problems is by “thinking past” unknowns and working through the possibilities. It’s a good tip I think.

Updating live (26/04/2012)

I’ve struggled in the past with having hta files or documents that update in real time.

The way to do it is using the setTimeOut function.

id = setTimeout(“RunFunction()”,1000) 

This runs “RunFunction()” every second, so if you nest this you can make something keep updating.

Vertical Scroll Bars (25/04/2012)

I had to build a little app today for a ridiculous waste of time… I mean, a business fair that we’re hosting.  Let’s not go into the details.

For quick application development, it’s very easy to use javascript, HTML, CSS or VBscript and run it in Internet Explorer. I opted for vbscript because I needed to contact an external access database and I can’t find a way of doing that with javascript.

It works fine, but when displayed fullscreen (pressing F11 in Internet Explorer – which I had to use because of the VBscript), there’s a pesky vertical scroll bar.

It turns out you can get rid of that with one simple line of code:

  <body style=”overflow:auto”> 

One to remember.

Reliability Monitor (24/04/2012)

Courtesy of I discovered the Windows 7 Reliability Monitor today.

It’s a really great program and makes spotting problems so easy:


CSS3 (23/04/2012)

I’ve held off implementing any CSS3 because of slow take up, but I’ve been playing with CSS3 today to make some speech bubbles.

There’s a new pseudo element, “after” and “before”. I got a bit confused with them when chaining pseudo elements, but it seems that hover comes first.

I’m not sure what I think to CSS3 – but this created the effect I needed of speech balloons that change colour when you hover over them:

 .speech {position:relative;width:120px;height:50px;line-height: 50px; -webkit-border-radius: 30px;-moz-border-radius: 20px; border-radius: 20px; background:#235D79; margin-bottom:20px;}
.speech:before {content: ’ ‘;position:absolute;width: 0;height: 0;top: 35px;left: 20px;border: 25px solid; border-color: transparent}
.speech:after {content: ’ ‘;position:absolute;width: 0;height: 0;top: 35px;left: 20px;border: 15px solid; border-color: #235D79 transparent transparent #235D79;}

.speech:hover {background:#63ADD0}
.speech:hover:after {content: ’ ‘;position:absolute;width: 0;height: 0;top: 35px;left: 20px;border: 15px solid; border-color: #63ADD0 transparent transparent #63ADD0;} 

Twitter API 2: This time it’s personal (22/04/2012)

The missing part from yesterday’s post was about authorising arbitary user accounts through the Tumblr API. Luckily, there’s a file auth.php as part of the wrapper. I just need to get some time to read the example and I should be able to figure it out.

Twitter API (21/04/2012)

I’m building a little web application, and for part of it, I want to use the Twitter API, but by God the documentation is complex.

Luckily, I’ve found Matt Harris’s Twitter API Functions. I’ve been playing with them all day, and finally discovered, thanks to Stack Overflow (as ever) that there’s a slight tweak you need to make because of a change in December 2011.

In the code below I’ve got a little function to post tweets. The line in bold is the one that was missing and was causing me to pull my hair out:


$tweet_text = ‘Hello Twitter’;
print “Posting…\n”;
$result = post_tweet($tweet_text);
print “Response code: ” . $result . “\n”;

FUNCTION post_tweet($tweet_text) {


$connection = new tmhOAuth(array(
  ‘consumer_key’ => ‘xxx’,
  ‘consumer_secret’ => ‘xxx’,
  ‘user_token’ => ‘xxx’,
  ‘user_secret’ => ‘xxx’,
‘curl_ssl_verifypeer’ => false

$connection->request(‘POST’, $connection->url(‘1/statuses/update’), array(‘status’ => $tweet_text));
return $connection->response[‘code’];



Tag Cloud