RSS Feed
Jan 7

Redirecting STDERR to STDOUT

Posted on Wednesday, January 7, 2009 in code

I like to post things that I just learned so here’s a good one. Some batch commands output their errors to the STDOUT and/or STDERR by default. If you’ve got a long batch script this can cause an issue because the output is lost due to the command line truncating the output.

Now most people know about redirecting the output to a file like so:

   1: command -option arg > commandlog.txt

However, this is only handling STDOUT, most commands will put error information (which is what we’re most interested in) to the STDERR. So how do we get at that?

Well to log both do this:

   1: command -option arg > logfile.txt 2>&1

The final token there redirects STDERR to STDOUT, thus putting it all into logfile.txt.

You can also log to seperate files if you like.

   1: command -option arg 1> stdoutlog.txt 2> stderrlog.txt

That concludes today’s lesson. I hope you find this useful at some point!

Good times.

Jan 6

Cities I visited in 2008

Posted on Tuesday, January 6, 2009 in personal

Bit of a generic post but meh! It’s fun to make lists! So here goes…

  • London, UK
  • Sheffield, UK
  • Leicester, UK
  • Birmingham, UK
  • Muscat, Oman
  • Bangkok, Thailand
  • Phuket Town, Thailand
  • Manchester, UK – doesn’t really count because I live here.

Wow that was boring….I think I just found a new New Year’s Resolution! Here’s ninja cat:

Dec 19

Playing with dynamic styles in IE and the Dev toolbar

Posted on Friday, December 19, 2008 in code, web

Ever wanted to isolate just one element and mess with the style after it’s been generated with javascript? It’s always been a bit of a tall order with Internet Explorer due to the lack of Firebug and the unrealistic results when using IE developer toolbar to change styles. However, the latter tool does have a feature which allows you to save the element outside of the page with all styles copied, even if they were generated by javascript! Awesome.

You will need: IE, IE dev toolbar

Here’s how:

  1. Load up your page step1
  2. Open the dev toolbar and select the element using the aptly named element selector or in the DOM tree
  3. You will see all the styles in the developer toolbar.
  4. Right click the element in the DOM tree and selected Element source and style
  5. A new window will open with the HTML for the element, nicely formatted step2
  6. Click File>Save>Original HTML Source
  7. Save the file where you want

Now you have your element with all the CSS that was applied to it in the main page in an external file to play with at your leisure!

step3

[The pictures are from RSinteract, a product I am working on.]

Enjoy!

Nov 18

Book Meme

Posted on Tuesday, November 18, 2008 in personal, social, web

“She seems more angry and shaken than worried by the intrusion”
Accelerando - Charles Stross

via James Simm

Book Meme:

  • Grab the nearest book.
  • Open it at page 56.
  • Find the 5th sentence.
  • Post the text of the sentence on your blog along with these instructions.
  • Don’t dig for your favourite book, the cool book, or the intellectual one: pick the CLOSEST.

Happened to have Accellerando in my bag but haven’t actually started reading it yet! I wonder what the intrusion is?

Oct 19

Post FOWA 2008

Posted on Sunday, October 19, 2008 in personal, social, web

After experiencing FoWA for the second time, I felt it was a bitter sweet conference. The talks were not as compelling as last time around overall but there were plenty of them and a few gems in there. The real suprise for me was Ben Huh. His talk about keeping users interested in your site was fantastic and his interactive choose-your-own-presentation-ending idea was inspired.

Photo by James Simm

(more…)

Sep 25

Future Of Web Apps 2008

Posted on Thursday, September 25, 2008 in personal, social, tech, web

It’s that time of year again (I can’t beleive I’ve had this blog for a year and only written 6 things, including this!). The UK’s premier web conference - The Future of Web Apps, is coming back to London in 2008. I was there last year for all the Halo and Diggnation madness! It was brilliant. This year it’s even bigger and better with heavyweight speakers including Kevin Rose, Jason Calcanis, Mark Zuckerberg (!) and even Ben Huh from I Can Haz Cheezburger!. Should be very interesting.
(more…)

Sep 22

All Aboard the Test Driven Express

Posted on Monday, September 22, 2008 in code

Recently I’ve been following the great store front tutorial for ASP.NET MVC. To begin with it’s actually a tutorial about patterns and the new features of .NET 3.5 such as LINQ to SQL. In this respect it’s a great place to start learning to create .NET web applications. Rob Conery’s brisk but explicit style is excellent and really keeps you interested. I highly suggest any developer watch this series. (more…)

Sep 17

Pushing for Change

Posted on Wednesday, September 17, 2008 in code, rant

In a the constant rush of new techniques in the development world it’s hard for us (and by us I mean working developers) to keep up with everything. That is the point though, you don’t have to. Not everything we learn will be ultimately useful to us. I learned “awk” in university but I’ve never used it. However, this doesn’t mean we can be complacent either! I want to learn about the latest developments or I feel like I’m losing my grip on my skills, personally I think that’s a trait of all (hmm - ed) developers. Granted, I’m sometimes a little behind the crowd (I didn’t touch .NET until 2005) but that’s neither here nor there.

(more…)

Sep 12

Ideas, Motivation, Goals and Fish

Posted on Friday, September 12, 2008 in code, personal

Lately, I’m finding it hard to get excited about work. What’s that I hear you cry? No one gets excited about work! I’m not just talking about work to get paid I’m talking about work for fun, work in your spare time. This may be just post-travelling wind down, but it feels deeper and I think I know what the problem is: I have no goal. Without a goal you’re just treading water and that doesn’t get you anywhere.

(more…)

Sep 7

Stack Overflow Beta

Posted on Sunday, September 7, 2008 in code, social, web

Stack Overflow logo

Some of you may have heard of Stack Overflow, the web app Jeff Atwood over at coding horror has been working on for the past 6 months or so in collaboration with Joel Spolsky and various others. The aim of the project is provide a proper platform for programmers to exchange expert information for specific and general scenarios. If you caught the reference to expert sexchange you may understand that aforementioned godforsaken-hell-hole of a site has a similar premise.

(more…)