September 30, 2008
Recently I said
@markusegger They will appreciate the banks when they are gone and there is no liquidity whatsoever (View)
@WinHEC We’ll be at the PDC, dunno about WinHEC though (View)
@craigber That being the case, they’ll pay the price at the polls (View)
@Ben_Hall I would imagine so, but as yet there’s no details (View)
DevExpress is gearing up for PDC, check out our trailer at http://tv.devexpress.com/pdcpromo.movie (View)
Heard a rumour that the US bail out has failed. Is that right? You guys have got to be kidding me; WFT are you doing over there?!!! (View)
@CAMURPHY you should have used dependency injection to inject BathingMonitor.Wife into the running code (View)
markusegger ah right, got you. Well hope it works out and that we can catch up at the PDC (View)
markusegger no worries, what did you want it for? (View)
@ColinMackay next Monday is the holiday here (View)
Why not come and join the conversation at http://www.twitter.com/garyshort
Leave a Comment » |
Microblogging |
Permalink
Posted by garyshort
September 29, 2008
The trouble with one search engine (whomever that may be) dominating the search scene, is that you only get to find, and therefore see, the information that they say you can. For example, I was reading an article on a patent application, made by Google, and I came across this quote (emphasis mine):
Google has sketched a plan for such a system in a patent application. Initially filed in March 2007, the application, which is not available on Google’s Patent Search site, was posted on the U.S. Patent and Trademark Office site on Thursday.
Now, I’m not suggesting that Google is doing anything wrong or underhand by not putting their own patent application on their patent search site, I’m just using it as an example to illustrate the fact that they dominate the search market and that means if they don’t want you to know about something, it’s pretty easy for them not to include it in their search results; not so easy for you and me to ensure our patent applications are not included for example. Market domination, by anyone, is seldom a good thing.
Leave a Comment » |
Technology |
Permalink
Posted by garyshort
September 18, 2008
Just downloaded the new beta of my favourite blogging tool (Window Live Writer) and noticed this nice little dialog that came with it
It was the “…and prevent programs from interfering with this choice” I particularly liked
1 Comment |
Technology |
Permalink
Posted by garyshort
September 18, 2008
Recently I said
Getting ready to leave to present on excel hacks for Scottish developers dundee (View)
@ARGibson good question, I’ll find out and let you know (View)
@betsyweber Cool, let me know once you are confirmed, I’d love to introduce you to some of the other DevExpress guys (View)
@akselsoft we have docs and videos to help you with general questions, but if you have specific issues mail me at garysATdevexpressDOTcom (View)
@ColinMackay Brave words from someone who’s coming to my talk tonight LOL (View)
@akselsoft Hey Andrew, sorry to hear you are having such problems with our ASP.Net controls, anything I can do to help you out? (View)
It turns out that @olivers and I are just too "butt ugly" to be doing DevExpress videos these days, so meet Erica http://tinyurl.com/56lrpt (View)
Why not come and join the conversation at http://www.twitter.com/garyshort
Leave a Comment » |
Microblogging |
Permalink
Posted by garyshort
September 16, 2008
Recently I said
@Karenyo should know better, if she "England" when she means "UK" one more time, I swear I’ll… tut and roll my eyes (More)
dear ALT.Net community, go to your rooms ’til you can speak to one another in a civil manner. KThnxBye (More)
@Stooshie yes Leuchars was fab, would have been better if the Vulcan had flown but can’t have everything – or so they tell me
(More)
@Stooshie very cool, good for you (More)
@Stooshie Cool, congrats. What will you be doing, anything exciting? (More)
blog: CERN Hack Attack – http://tinyurl.com/5nbls9 (More)
Why not come and join the conversation at http://www.twitter.com/garyshort
Leave a Comment » |
Microblogging |
Permalink
Posted by garyshort
September 16, 2008
This evening I thought to myself, wouldn’t it be cool to include my microblogging post (posts on Twitter) in my full blog? So I set about writing a script to fetch all of the previous day’s tweets (well all that are within the 20 pervious that the Twitter API supports of course) and copy them to the clipboard so that I can paste the HTML into my favourite blogging tool. I could have posted them straight onto my blog I suppose, but I’m not that confident in the Twitter API ; so for now, I’m happy to paste the HTML. Anyway, just in case the script is any use to you, I’ve posted it below. As always the code is optimised for a blog post not for production, so feel free to refactor to your hearts content
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Globalization;
using System.Windows.Forms;
namespace Microblogging {
/// <summary>
/// I am a class that represents a Twitter Status
/// </summary>
public class Status {
private string _Text;
public string Text {
get { return _Text; }
set {
_Text = value;
}
}
private string _Id;
public string Id {
get { return _Id; }
set {
_Id = value;
}
}
private DateTime _CreatedDate;
public DateTime CreatedDate {
get { return _CreatedDate; }
set {
_CreatedDate = value;
}
}
private string _Href;
public string Href {
get { return _Href; }
set {
_Href = value;
}
}
}
/// <summary>
/// I am a class that represents the Twitter API
/// </summary>
public class Twitter {
private NetworkCredential credential;
public Twitter(string uid, string pwd) {
credential = new NetworkCredential(uid, pwd);
}
/// <summary>
/// I answer an IEnumerable of the latest 20 tweets
/// </summary>
/// <returns>IEnumerable<Status></returns>
public IEnumerable<Status> GetRecentTwits() {
using (
//GS - Fetch the statuses
WebClient client = new WebClient()) {
client.Credentials = credential;
try {
using (Stream stream =
client.OpenRead(
"http://twitter.com/statuses/"
+ "user_timeline.xml")) {
//GS - Instantiate a XDocument from the return
XmlReader reader = XmlReader.Create(stream);
XDocument document = XDocument.Load(reader);
//GS - Query the XDocument and return the statuses
return from status in document.Descendants("status")
select new Status() {
Text = status.Element("text").Value,
Id = status.Element("id").Value,
CreatedDate = DateTime.ParseExact(
status.Element("created_at").Value,
"ddd MMM dd HH:mm:ss zzzzz yyyy",
CultureInfo.InvariantCulture,
DateTimeStyles.AdjustToUniversal),
Href = String.Format(
"http://twitter.com/garyshort/statuses/{0}",
status.Element("id").Value)
};
}
}
catch (WebException ex) {
//GS - Display the error as returned by Twitter
using (Stream errorStream =
ex.Response.GetResponseStream()) {
using (StreamReader reader =
new StreamReader(errorStream)) {
string errorMessage = reader.ReadToEnd();
Console.WriteLine(errorMessage);
}
}
return new Status[0];
}
}
}
}
class Program {
/// <summary>
/// Program entry point
/// </summary>
/// <param name="args">Commandline arguments</param>
[STAThread]
static void Main(string[] args) {
//GS - Instantiate our Twitter API class
Twitter twitter = new Twitter("uid", "pwd");
//GS - Retrieve the latest 20 tweets as per the API
var statuses = twitter.GetRecentTwits();
//GS - Create a string to paste into our blogging tool
StringBuilder builder = new StringBuilder();
builder.AppendLine("<p>Recently I said</p>");
foreach (Status status in statuses) {
//GS - For blogging on a daily basis we only
//want yesterday's tweets
DateTime startDate =
DateTime.Now.Date.Subtract(
new TimeSpan(1, 0, 0, 0));
DateTime stopDate = DateTime.Now.Date;
if (status.CreatedDate >= startDate &&
status.CreatedDate <= stopDate) {
builder.AppendLine(
String.Format("{0} "
+ "(<a href='{1}'>More</a>)<p />",
status.Text,
status.Href));
}
}
builder.AppendLine("<p>Why not come and join the "
+ "conversation at <a href='http://www.twitter."
+ "com/garyshort'>http://www.twitter.com/"
+ "garyshort</a>");
//GS - Copy the text to the clipboard to be pasted
//into our blogging tool
Clipboard.SetDataObject(builder.ToString(), true);
}
}
}
2 Comments |
C#, Developement |
Permalink
Posted by garyshort
September 16, 2008
Sometimes this country drives me mad.
Almost 50,000 Gurkhas have died fighting for Britain since 1815 and 150,000 have been seriously injured while serving.
Gurkhas are received at Downing Street before handing in their petition
Yet thousands of veterans who retired after July 1, 1997 have been refused visas and have been forced to live in poverty in their homeland of Nepal.
Hundreds of badly injured soldiers have also been barred from travelling here for treatment.
More
After serving for four years or more (like servicemen and women from other Commonwealth countries) Gurkhas should be allowed to stay in this country. It’s a no brainer. It’s not something these guys should have to take to the High Court. Shame on you Gordon Brown!
Technorati tags:
Gurkhas,
High Court
1 Comment |
Personal |
Permalink
Posted by garyshort
September 16, 2008
Well not quite, that would be what we call hype; but, truthfully, AutoCollage 2008 is a great product. Here’s a collage I made after my trip to the Leuchars Airshow last weekend.
Technorati tags:
AutoCollage 2008
Leave a Comment » |
Technology |
Permalink
Posted by garyshort
September 15, 2008
After a hack attack CERN said:
"Scientists working at Cern, the organisation that runs the vast smasher, were worried about what the hackers could do because they were "one step away" from the computer control system of one of the huge detectors of the machine, a vast magnet that weighs 12,500 tons, measuring around 21 metres in length and 15 metres wide/high.
If they had hacked into a second computer network, they could have turned off parts of the vast detector and, said the insider, "it is hard enough to make these things work if no one is messing with it."
More here.
Uh huh, so let me get this straight, you guys have a machine that creates black holes and destroys universes (okay, slight exaggeration) and the chain of command for this “Evil Empire Style mega weapon” goes: Command and Control computer –> Web Server –> The General Public. WTF?!
Your membership of the “Really Smart Club” is hereby revoked with immediate effect. An application form for membership of the “Galactically Stupid Collective” is in the post. Jeez!
Technorati tags:
CERN,
Hacked,
Morons
1 Comment |
Personal |
Permalink
Posted by garyshort