Political Parties and YouTube

April 29th, 2009 by Richard No comments »

Gordon Brown just got asked at Prime Minister’s Question Time when we can expect another comedy performance from him on You Tube.

Gordon replied that YouTube was a very important communication medium and that he will continue to use it even if the other parties do not?

Maybe he wasn’t aware of:

  • http://www.youtube.com/user/webcameronuk
  • http://www.youtube.com/user/LibDem
  • http://www.youtube.com/user/greenpartyew
  • http://www.youtube.com/user/ukipwebmaster

to list just a few

Active Directory Management over PHP

April 22nd, 2009 by Richard No comments »

Update: I’m now part of the original adLDAP project, so libAD has been withdrawn, look forward to seeing my contributions and Exchange supposed on adLDAP in the near future.

A while ago I started using a library called adLDAP, unfortunately there have been a number of bugs and lack of some features with it.  Couple this with the lack of updates for the past two years, I decided to re-work this library and release it myself.  This library is called libAD.

libAD is a PHP library providing Active Directory authentication and management over LDAP.

It provides intelligent Active Directory integration with PHP. This extends on the original project that has not been updated for some time. It’s aim is to help other developers with getting over the same hurdles that we’ve experienced in getting the whole LDAP SSL Active Directory puzzle working natively on Linux.

This library is not designed to be a complete Active Directory management systems, but give you a set of functions through an API that will allow you to interface successfully with your Active Directory.

Given the varied nature of organisations and sites, adLDAP may not be your complete solution, but it should be a very sound starting point. LDAP isn’t overly friendly on first glance, and it’s a steep learning curve made alot worse when coupled with Microsoft’s seemingly unending army of catches.

The information you can retrieve from Active Directory is as useful as you make it. If you don’t fill out all their account information there’s not really going to be much to query.

libAD is open source software and is released under the GNU General Public License v2. This is a change from the license used under adLDAP which was LGPL.

Update: I’m now part of the original adLDAP project, so libAD has been withdrawn, look forward to seeing my contributions and Exchange supposed on adLDAP in the near future.

So have we solved Global Warming?

April 19th, 2009 by Richard No comments »

… or did it maybe not exist at all.  If the article I’ve just read is true then the Antarctic is bigger and denser than for 30 years.  Hmm but I thought all our taxes were going up to stop us from melting all the ice caps?

Windows Update frustrations

April 19th, 2009 by Richard No comments »

These days I’m a Mac person, but I do still use Windows for work and also occasionally for other bits and pieces, such as games, Windows software or Windows development.

Now today I booted my Mac into Windows Vista under Bootcamp, started a video encoding process that would take between 2 and 3 hours.  Obviously I’m not going to sit in front of my computer watching it encode a movie file, that would just be a monumental waste of time, so I leave it running.

I come back 2 hours later to discover the computer in sleep mode, that’s fine if the encode has finished then it’ll usually go to sleep automatically.  I wake the computer to discover the OS X login screen.

I check the Windows logs to discover that Windows Update has decided not only to download and install new updates but decided that regardless of what the computer is doing at that current time it should reboot itself and loose any work I happened to be working on.

Now I understand for the default settings and need for Windows Update to auto download and install, it helps protect computers from users who don’t, and have no need, to know about what security patches are required.

What I object to is Windows deciding to reboot itself automatically.  I’ve seen the little prompt before saying click me to snooze the reboot, but I wasn’t at my PC to be able to see that prompt.

The Windows Update system should look at the system processes and open applications to determine whether it might be acceptable to display the prompt, if the processor is very busy, there might just be a chance, that something important is going on!  Alternatively, maybe Microsoft can provide a way to applications to send a flag saying ‘Busy here, move along please’ and then remove the flag when they exit.  If they are worried about Viruses setting that flag then maybe restrict it to digitally signed applications only?

I feel Microsoft are intentionally putting features in Windows to piss off IT professionals!  So two hours of wasted processor time thanks to Windows Update.

Copyright infringement and The Pirate Bay

April 17th, 2009 by Richard No comments »

PiratesLet’s get a few things straight, downloading copyrighted music, software, games and music is NOT theft and it is not a criminal act.  It is a civil act of copyright infringement.  Now that’s out of the way I will also start by saying I do not agree or believe in piracy or copyright infringment in any way, shape or form.

Firstly, today the founders of The Pirate Bay (and I won’t link) have been found guilty of breaking copyright law and sentenced to jail. Now whilst there are lot of torrents on The Pirate Bay that contain copyrighted files that are being shared illegally, none of these files are actually stored by the pirate bay whatsoever.  They are effectually a search engine for .torrent files.

So what does the rulings in the Swedish courts today mean?  Does it mean the fact you can find illegally shared files by Google mean that Google should be shut down?  Of course it would be ludicrous to suggest such a thing, but actually is it?  Google can be used for exactly the same thing as The Pirate Bay can.  Just Google ‘casino royale avi filetype:torrent’ and I can guarantee you’ll be able to find a page with a link to a .torrent download for that movie.

Does this mean that copyright holders shouldn’t protect their property and their rights, no of course they should, I just feel they are going about it the wrong way.

DRM (Digital Rights Management)

I have no problem with DRM until it gets in my way of doing something I want to do with it.  Now this does not mean sharing the files amongst my friends.  It means if I buy something from iTunes (pre music going DRM-free) and I change from an iPod to a Zune then I shouldn’t have to re-buy all my music.  Secondly if I want to archive all my DVD’s for playback on Apple TV and then put my DVD’s in the loft I shouldn’t have to find ways around the insane corruption that Sony puts on it’s DVD’s courtesy of the Arccos software.

For the most part DRM only seeks to annoy legitimate customers, as anyone who truely wants to pirate something, will find a way to do so regardless of how ‘protected’ the studios believe DRM to be… just take a look at how quickly BD+ got cracked.

Pricing

If I want to legitimately purchase a movie from iTunes for example, and let’s take an example of  ‘Max Payne‘, this costs £10.99 from the store. I can buy that same movie from play.com for £12.99.  Heck, when Quantum of Solace came out you could buy it from Tesco for £7, yet it was still £10.99 on iTunes and they won’t even let you buy an HD version!

Can the studios please explain to me how a movie that only has to be digitised once, costs nothing in physical storage in a warehouse, has no manufacturing costs and no distribution/delivery costs can cost only slightly less or indeed even more than it does in a shop?

If they studios want to stop people downloading for free they need to radically reduce the price of legitimately buying a film online.

Software

I can also see the arguement from the angle of the copyright holder, I am a software developer.  I have written and sold software online, only a minority of which are GPL’d.

There is a small subset of people out there that think it is their god-given right to give my software away and use it without me even getting a small amount of money for my efforts in developing it (I’ve never charge mega-bucks for applications, unlike some companies out there).

I do believe that copyright holders have the right to protect their rights, and make a living from it.

If I GPL’d my code and even though I sold it, there is nothing preventing someone else taking my same code and competing with me.  I’m not a Red Hat or a Novell of this world, I can offer the value added benefits of support and protection that they offer.  I wouldn’t be able to make any money from this type of arrangement.

This is why I believe the shared source licenses.  Basically buy the software, get the source, change what you want to in the source, but have no rights to redistribute it without permission.

Some more iPhone SDK tips and tricks

April 8th, 2009 by Richard No comments »

In working on an update to one of my applications on the Apple iPhone I thought I’d share another quick tip.

I found on a blog and it works brilliantly,  to make rounded corners on any UIImage.

ImageManipulator.h

@interface ImageManipulator : NSObject {
}
+(UIImage *)makeRoundCornerImage:(UIImage*)img :( int) cornerWidth :( int) cornerHeight;
@end

ImageManipulator.m

#import "ImageManipulator.h"

@implementation ImageManipulator

static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth, float ovalHeight)
{
    float fw, fh;
    if (ovalWidth == 0 || ovalHeight == 0) {
        CGContextAddRect(context, rect);
        return;
    }
    CGContextSaveGState(context);
    CGContextTranslateCTM (context, CGRectGetMinX(rect), CGRectGetMinY(rect));
    CGContextScaleCTM (context, ovalWidth, ovalHeight);
    fw = CGRectGetWidth (rect) / ovalWidth;
    fh = CGRectGetHeight (rect) / ovalHeight;
    CGContextMoveToPoint(context, fw, fh/2);
    CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1);
    CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1);
    CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1);
    CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1);
    CGContextClosePath(context);
    CGContextRestoreGState(context);
}

+(UIImage *)makeRoundCornerImage : (UIImage*) img : (int) cornerWidth : (int) cornerHeight
{
	UIImage * newImage = nil;

	if( nil != img)
	{
		NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
		int w = img.size.width;
		int h = img.size.height;

		CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
		CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, 4 * w, colorSpace, kCGImageAlphaPremultipliedFirst);

		CGContextBeginPath(context);
		CGRect rect = CGRectMake(0, 0, img.size.width, img.size.height);
		addRoundedRectToPath(context, rect, cornerWidth, cornerHeight);
		CGContextClosePath(context);
		CGContextClip(context);

		CGContextDrawImage(context, CGRectMake(0, 0, w, h), img.CGImage);

		CGImageRef imageMasked = CGBitmapContextCreateImage(context);
		CGContextRelease(context);
		CGColorSpaceRelease(colorSpace);
		[img release];

		newImage = [[UIImage imageWithCGImage:imageMasked] retain];
		CGImageRelease(imageMasked);

		[pool release];
	}

    return newImage;
}

@end

Just call the static method makeRoundCornerImage and pass your image to have the image rounded off the way you want.

For example

UIImage *imageFromFile = [UIImage imageNamed:@"myimage.png"];
imageFromFile = [ImageManipulator makeRoundCornerImage:imageFromFile : 20 : 20];

Note that you do need the CoreGraphics framework for this to compile.

More information can be found at the blog post link above.

The second tip is to load a remote image over the web and display it in a UIImageView object.

Create the following method in your interface

-(UIImage*) newUIImageWithURLString:(NSString*)urlString
{
	return [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]]];
}

Then call the following

UIImage *myImage = [self newUIImageWithURLString:@"http://url.to/image.jpg"];

Best G20 Tweet

April 1st, 2009 by Richard No comments »

The best #G20 tweet I’ve read so far

ursulaerrington: #G20. Feeling on trading floor is that they understand why people are angry. Dont mind protests as long as it doesn’t get violent.

Umm do they live in a different world to the rest of us?  How about blowing all your money have having to be bailed out to the tune of trillions of pounds by the taxpayer?

Things you can find about yourself online

March 27th, 2009 by Richard No comments »

Every now and again you find the curiosity to Google yourself and you find some interesting things. Well it depends on what you do for a living, and working in IT helps!

Well a quick Google later and I discovered that I was mentioned in a blog post in the Telegraph in 2007. OK the information isn’t quite accurate but cool nonetheless.

A blogger in France decided that my tips and tricks on iPhone development merited being mentioned along side the stunning work the core Facebook iPhone app developer did.

Finally I was also quoted in The Register in 2000.

.tel goes live

March 25th, 2009 by Richard No comments »

media_right_3Well I’ve just got my .tel domain http://richardhyland.tel

Time will tell if it’s any good or going to work, however I’ve actually got a .tel iPhone management tool awaiting approval from Apple.