Putty 0.61

Yesterday Putty 0.61 was released. I have updated my Putty x64 build page with the latest installer (MSI) and binaries.

The installer *should* upgrade from the previous release version without issues, it might just install over the SVN version if you have that installed, so it might be worth removing the SVN version before upgrading.

Enjoy.

Posted in C / C++, Putty, Technology, x64 | Leave a comment

iOS and Twitter OAuth Login

I have recently been working on a iOS (iPhone) application for a client. This app needed to have the ability to post things to Twitter and Facebook.

Facebook provides a really nice SDK which (with a few hacks) provides an inline login dialog which handles all the oAuth details for you. It looks good and works well.

Twitter unfortunately does not do the same and while there are hundreds of Twitter-iOS libraries out there, they are all overly complicated and provide a UI which is not consistent with how the Facebook SDK does things, which if i want my app to appear good and consistent then they must look and behave the same.

The other main reason was because the libraries were overly complicated, they used the “Out of band” oAuth authentication which means a user has to copy a pin from a web page into the application, which is hardly a nice thing to do. Yet Facebook doesn’t have to do this. After a bit of investigation i found out twitter didn’t have to either.

To solve all of this i have created a simple demo application and library, utilizing the Facebook-iOS-SDK and PlainOAuth (by Jaanus Kase) projects as a basis and building what i wanted on top.

A lot of the code should be self explanatory. And below is a screen shot of what the end result is. You can find the project on git hub here: https://github.com/lloydsparkes/unoffical-twitter-sdk

Posted in Apple, C / C++, Twitter | 6 Comments

Some code snippets from my homepage: Part 2

In this part 2 of my series on the various parts i used to build my new homepage for my website i will cover how i put my RSS feeds on the page.

Again to start with you will need to use jQuery and the Google JavaScript API. So insert the following two lines into the header of your HTML if you do not already have them included. You can also substitute the jQuery import from the Google CDN with a local address or another CDN.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>

The next bit is we need a place holder so somewhere in the body of the document

<div id="blog">
<h3>Recent Blog Posts</h3>
</div>

Then we just need the following function to fetch the last entries, then to write them out into the placeholder:

<script type="text/javascript">
function load_blog()
{
var blog = new google.feeds.Feed("http://blog.lloydsparkes.co.uk/feed/")
blog.load(function(result){
    if(!result.error){
        var data = result.feed.entries
	for(i in data){
	    if(i < 5){
		$("#blog").append("<p><a href='" + data[i].link + "'>" + data[i].title + "</a><br><span>" + $.timeago(new Date(data[i].publishedDate.split(" -")[0])) + "</span></p>")
		}
	}
     }
})
}
</script>

Finally the ready function so when the document is ready the function will be executed and the feed entries into the page.

<script type="text/javascript">
$(document).ready(function(){
     load_blog()
})
</script>

And thats loading a RSS feed into a page using JavaScript.

Posted in Technology | Leave a comment

Some code snippets from my home page: Part 1

About 6 months ago i reorganized my website, this included a new homepage ( here ). A lot of the code was borrowed from a friends web page ( here ), recently a friend who likes it asked me how the code worked, and to go through it, so i thought it might be worth making a blog post on it.

All the code is under the license ”Creative Commons Attribution-Noncommercial 2.0 UK: England & Wales License” and is copyright to Tom Brearley.

I assume a basic knowledge of HTML / JavaScript.

There are 4 parts to the web page in question, the tag line, recent blog posts (items from an RSS feed), recent tweets(items from twitter), recent music (from last.fm).

All of the code requires jQuery, i used it from the Google CDN but you can use it locally. The code to use it from the Google CDN is:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

Simply place this in the header of your HTML.

The Tag Line

This is rather simple. We have an array of tag lines, and we pick on random when the page loads.

The first this we need is a placeholder for the final message. Insert it in to the body of the page. Also include a fall-back message, which will be displayed if for some reason the JavaScript fails.

<span id="tagline">is awesome</span>

Then the code which will actually pick a tag line and insert it correctly into the document. In the head of the document, create a script tag, and insert the following function (modifying the tags to your taste). This simple function just creates an array called “phrases”. Then using the jQuery notation, sets the HTML property of the tag with the name “tagline” with a random phrase.

function go(){
var phrases = Array(
"uses <a href="http://www.bing.com">Bing!</a>",
"loves <a href="http://www.microsoft.com/windows">Windows</a>",
"uses <a href="http://www.microsoft.com/ie">Internet Explorer 9</a>",
"loves <a href="http://www.microsoft.com/windowsphone">Windows Phone 7</a>",
"uses <a href="http://www.microsoft.com/windows">Visual Studio 2010</a>",
"is a <a href="http://www.conservatives.com/default.aspx">Conservative</a>",
"reads <a href="http://conservativehome.blogs.com/">Conservative Home</a>",
"dislikes <a href="http://www.apple.com/macosx/">OS X</a>",
"loves his <a href="http://www.apple.com/macbookpro/">MacBook Pro</a>",
"used to be a <a href="http://en.wikipedia.org/wiki/Scouting">Scout</a>",
"programs in <a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a>",
"prefers <a href="http://en.wikipedia.org/wiki/Dogs">dogs</a> over <a href="http://en.wikipedia.org/wiki/Cat">cats</a>"
)
$("#tagline").html( phrases[ Math.floor(Math.random() * phrases.length) ] )
}

Finally we need to call this function once the page is loaded. To do this insert the following code just before the “go()” function.

$(document).ready(function(){
go()
})

And that is Part 1, watch out soon for the final 3 parts.

Posted in Random Notes, Web Development | 4 Comments

So I bought an iPad

I have been looking at tablets for quite a while and was trying to decided between the Motorola Xoom and the iPad. It was quite a difficult choice between the two but I decided on the iPad for one simple reason, the quality of the device ( hardware and software ) is just so much better than the Xoom or any other android tablets. If I had gotten the android one I would have spent a lot of time hacking around with android to get it to work well, like I did with my phone when I had a HTC Hero. The iPad just works much like my Windows Phone 7 HTC HD7.

That said it’s not perfect, it doesn’t fit in with my microsoft dominated computer setup that I use, and it is just a stop gap solution to when Microsoft bring out there tablets next year.

It is a very good device, and very able to do a lot of. The things I wanted a tablet to do but there are a number of key features missing that I believe Microsoft will be including in there tablets from the way the development of Windows 8 is going. The first issue is the lack of user account or begin able to put the device into a “guest mode” so that i can lend my device to someone else without worrying that they can access all my email, social networking and work details. I believe Microsoft will have this feature in there tablet version of Windows 8. This feature would mean that a family or couple could share an iPad without having their different account settings clashing with each other. The second issue that I have noticed is that the keyboard always just has the capital letters on the keys, rather than switching between lowercase and uppercase letters when suitable during the writing process, or when the shift key is pressed, as a better indication of the change, because as i am writing this article on my iPad using both hands I cannot see the shift keys, and therefore can see if it is capitalised or not.

I will follow up this article once I have spent more time on the device, but so far it seems to be really good even if it isn’t perfect for my needs, it will be a far more pleasurable year to spend using it rather than the android equivalent.

Posted in Apple | Leave a comment