Tuesday, June 29, 2010

Water vs Energy: The Balancing Act

Water and Energy are very tightly integrated in modern human society.

You can not create energy without water, whether it is directly driving hydroelectric turbines or being boiled to drive a steam turbine or more likely being used to cool the systems.

You can not get water without using energy, if you're lucky enough to live next to a pristine stream you're going to need to pump it out, otherwise you have to process it, or pump it great distances.

A great example of this in Australia, that has received a lot of attention is desalination (particularly if you are a Sydney sider). Desalination requires A LOT of energy and when I say a lot I mean a lot! Currently it takes around a top of the line efficient reverse osmosis filtering plant around 5 MWh of electricity to generate 1 ML of water, or around 1.25 Wh to get your glass of water filtered. And if you consider an old school thermal desalination plant it takes around 80MWh/ML or around 20 Wh per glass of water.

Now when you consider that the majority of energy in Australia is generated using coal fired power stations, cooled with cooling towers then we need to factor in the water cost of generating the electricity it takes roughly 1900 L of cooling water to generate a MWh of electricity.

Further to the water cost of the electricity we need to consider the waste water from the desalination plant. The most efficient RO plants have water usage efficiencies of around 48% (which means 52% of the water that enters a desalination plant leaves as waste water) and generally the efficiency is more likely to be down in the mid to high 30s. So if we take the most efficient plant around then for every ML of clean water that is produced there is 1.083 ML of dirty water produced.

So basically for your glass of water you'll be using 1.25 Wh and 273 mL if you're getting it via desalination. If you don't happen to live at the desalination plant then there'll be additional energy that is required to pump the water to your location and further if the desalination plant isn't co-located with the power plant then transmission losses of around 20% need to be factored into the equation as well.

SOURCE: IEEE Spectrum 6.10

Friday, June 25, 2010

Documentation Made of Sand

This is a follow up to my earlier post discussing the documentation options that are around for C# and VB.Net. Today I focus on getting custom themes etc on the output webpage.

How do you customize the output from Sandcastle and Sandcastle Help File Builder?

This is how we did it where I work. First I picked the settings (e.g. The presentation etc) that most closely matched the output style that we desired. Then I generated the HTML output and handed it all over to one of my trusty designer minions coworkers. Actually we didn't use HTML as the ASPX page gave much more options for customizations and everything else we do here is in ASPX anyway.

Once the designer wand had been waved over it I had lots of fun figuring out what I needed to change on the input side of things, that is which customizations I could achieve by changing SHFB settings and which ones I needed to delve deeper for.

The easiest spot to start with customization is within the Sandcastle/Presentation folder, once you have picked the "Presentation" that you like, simply duplicate it and make the changes in the duplicate (there is one tricky thing here though, SHFB needs to be able to link to the theme that you have copied and it does this by checking whether any of the default theme names are in the presentation folder so you'll need to rename the folder to something like _). For us however the only thing that we actually changed was some styles stuff in "Presentation.css" and modified a couple of the icons.

Unfortunately that's not enough customization for us, instead our final customization relied on modifying the main Index.aspx page substantially. The source of this is in the SHFB/Web folder and I discovered thankfully that as long as I didn't replace the single key insertion which was the @WebDefaultTopic section of the iframe link we could pretty much have at it. Thankfully SHFB automatically copies everything that is in the Web folder across to the website that it creates for the documentation so no further hacking was needed to ensure that the added images and htc files where copied to the output.

Thursday, June 24, 2010

FastCash (for the skeesy bank!) and Incompetency

So the other night, I was in a a hurry to grab some cashola so I used the "FastCash" option on the NAB ATM. I wasn't sure I'd ever used it in the past, but I figured I needed cash and fast.

Boy was that a mistake, by default for me it took it out as a cash advance from my Credit Account. There is no way in hell I would've chosen that option normally. I got slugged a $1.75 cash advance fee and if I hadn't been able to transfer the balance due on my card I would've been charged interest on that as well!

There was no mention of a possible fee at all. Given that it was the first time I'd used the option I should have been given some sort of warning. Also, how about an option to select where the cash comes from the first time that you use the "FastCash" option? I guess it is too hard to shove that into the Cobol back-end or something.

Anyway, a few days later I was doing some internet banking and I thought, why not see if their feedback system is any good. To my surprise I got a good response from someone there and they gave me the option to change the card so that "FastCash" was against my Everyday account. Also, they apparently they:
I have also added your suggestions to our Customer Feedback Database. This is a critical database, which is updated and reviewed daily. We review each and every suggestion individually.
(I'll believe that when something changes......)

So, they where going to fix it and add it to the list of suggestions, that seemed pretty good to me. Until that is I tried to take some money out from an ATM a couple of days later. Being wary of the FastCash option I stuck with the tried and true method of "Withdrawal -> Savings" unfortunately I was presented with.
This account is not linked with this card.
Ummm, what?

So, today I had to go to the bank, this time I thought I'd better go to the branch (thankfully there is one close to work) and sort it out in person. It turns out that when they changed the "FastCash" option to my "savings" account, they also managed to change my "savings" account so it is now linked as a "cheque" account at the ATM. WTF?

I am yet to try the "Cheque" account option at the ATM, I'll let you know how it goes when I try to get out cash tonight.

Oh and there's no chance I'm going near the "FastCash" option again, turns out that saving two button presses on the ATM really isn't worth 3 emails to the bank, a trip to the branch and unlinking my savings account...

Monday, June 21, 2010

Cultivating Startups outside of the Silicon Valley

Like a lot of Software Developers I'd love to build the next big thing the TwitterBook of the future if you will. As part of my attempts to a) come up with a good idea and b) have the nous to get it up and running successfully I follow a lot of Venture Capital and Start up related blogs (such as Tech Crunch, A VC, Venture Hacks) and it occurs to me as I read all of these and try to scrounge other information and ideas from around the globe that if you're not located in the fertile VC fields of Silicon Valley that you're really pushing crap uphill when trying to get a project off the ground.

Several things have prompted this view, I see today a post on Tech Crunch discussing a Y Combinator event "Work at a Startup" which will be conducted in Mountain View. Then I see other discussions around the interwebz and I wonder how someone outside of Silicon Valley, let alone the US has any chance of getting good seed funding etc to take a business or idea to the next level.

I'd love to see events like the one above running down here in Australia. I'd definitely be interested in attending an event like that here in Melbourne. But then, are there really that many startups around here that people could work for.

What seems to be missing from here is the vibe that Silicon Valley has managed to create for itself. To people outside of Silicon Valley it has a mystical aura, it is where tech startups go to grow up. But what is it that it has that other places don't? I know a couple of people that have lived in the area and they all say it's just a giant industrial park, a mix of suburbia and campuses that sprawl all over the place without much character (and considering that they where accountants it must have been verrrrry lacking in character). So it certainly isn't its architectural charm or village atmosphere that does it.

I guess the real question we need to ask is how do we get the same "vibe" established in other areas of the world? I've got no idea.

Becoming Bridezilla

My wife to be just be just sent this through to me.

When is my wedding

I'd better not make any further comment on it. ;)

Friday, June 18, 2010

Why do dryers Vent outside?

As winter has now well and truly set in down here in Melbourne I've been having more trouble getting clothes dried at home. The days are too short and my backyard too shaded for clothes to dry in a day on the clothes line and leaving them for multiple days doesn't work much better either. The current cobbled together solution is to hang the clothes on a drying rack and have it sitting in the house for a few days. But, the only way that the clothes actually dry in less than a week is if that rack is in front of the living room heater.

And so it would seem that they experiment to save a bit of cash by not going out and buying a clothes dryer (and getting it mounted etc) may be coming to an end. But it occurs to me that there is one rather silly point about how our house (and pretty much everyone I've seen) is designed. There is an exhaust fan in our laundry and the only reason it is there is to vent to dryer exhaust out of the laundry and out of the house. If the laundry was on an external wall of the house there could even be a direct vent to the outside to get the hot air from the dryer to freedom.

The thing is though, that in summer we don't need a dryer. Even on rainy days using the clothes horse inside the house gets stuff dry pretty quick. So really the only time that we really need a dryer is in the middle of winter, which also happens to be the only time that we need heating in the house.

So why would we pump the heat from the dryer outside and then turn the heater on at home?

What we really need is a good way to divert the excess heat from the dryer into the house.

Of course there is one big issue with this Humidity! You might have to dehumidify the air a bit before pumping it into the house to prevent condensation and the like. But in general a little bit more humidity in the air could be a good thing because of the drying effects of winter.

I hate to see so much energy being wasted and think that we can save a hell of a lot by combining lots of simple ideas into our everyday lives, a little bit here and there adds up to a lot.

Thursday, June 17, 2010

I've hit the Winter Wall

And it sucks!

Call it whatever you want but the Winter Wall to me is my complete lack of motivation that tends to arrive around this time every year. It happens in a similar way every year. I am going to rugby training, going to the gym (and this year riding to work) on a dailyish basis.
Then I run smack on into the winter wall.
This usually occurs, with either a cold, or an injury (this year I rolled an ankle), prior to this catalyst I can happily push through the crappy weather etc to keep the training going. However once the winter wall is hit motivation is right down, without the "forced" rigours of Rugby training and games I could easily see myself doing very, very little.
Undoubtedly a large part of the difficulty arises from the temperature and the lack of light, I can't force myself to do the usual things that help get me back into the zone. Even things that I would do in the warmer, longer dayed months no longer occur, for instance, I'm much more likely to drive to the shops after work in the dark than I am to walk or jump on my bike.
Each year I tell myself that this year will be different, but that reality is I am probably kidding myself when I say that anyway. To be honest I am fairly sure that I suffer from a particular form of SAD (or Seasonal affective disorder) and I'd say considering that I know a lot of other people that suffer from a mid-year, winter induced hiatus from exercise, or at least a large reduction in the amount of exercise performed, that it is a rather common affliction.
I can not think of a cure, I am tempted to see if I can try some sort of light therapy and I think I'll investigate it. In the meantime however it looks like I'll have to wait a few weeks and see if transporting myself into the depths of a North American summer has enough impact on the Winter Wall for me to smash a few holes in it and break on through to the other side.

Thursday, June 10, 2010

IE8 Close Dialog Usability Fail

I am willing to admit that it could just be me but I am going to put this out there anyway. I don't like the close dialog in IE8.


I don't think it is designed very well. Where is the "Whoops I didn't actually want to close anything!" option? It's there it is just not immediately obvious even to someone that spends way too much time in web browsers everyday.
It is the "X" in the top right corner. I know it is consistent with how you close windows across the board. But how do you know if you click on it whether it'll close that dialog box or randomly choose one of the two options displayed with the dialog buttons.
Seriously how hard would it have been to put a "Cancel" button or a "Don't Close Anything" button.

I'll crawl back under my rock now.

C# Documentation Generation

Seriously I didn't think it would be that hard, all we needed was documentation on a couple of C# projects for an API that we where releasing unto the unsuspecting masses. Java has JavaDoc, C# has nothing, well basically nothing.

DoxyGen is a jack of all trades document generation tool, which does work with C# (and C++, C, Java, PHP, Fortran...) we tried this but for some reason it doesn't resonate with the developers that I work with and really when you think about it. Why doesn't Visual Studio (which we use for everything as we're a windows .Net development shop) have built in documentation tools?

C# is Microsoft's language and they added the ability to document your code with \\\ style comments. Unfortunately the ability to get comments out of the code into some form that is appropriate for documenting an API, has been ignored or rather, not yet standardized or implemented or whatever excuse MS wishes to use.

A bit of poking around reveals that MS has their own tool which they use to generate their MSDN API documentation, Sandcastle. Sandcastle is possibly the most poorly documented project in existence. (In fact I wondered if it was a deliberate attempt at irony but then just remembered how lazy developers are). Thankfully there are some other kind souls out there that have bludgeoned through figuring out how to use Sandcastle and they developed Sandcastle Help File Builder which is a GUI for running Sandcastle and also gives you the ability to generate .chm files if you so desire.

In my case we just want the HTML output as we're going to be hosting it on a webserver. Playing around a little but with SHFB (namely changing the HelpFileFormat) allows me to get output as a webpage instead of the default .chm output format. This is pretty good, but we needed to get it styled up so that it fitted in with the rest of our sites. No worries, I'll just read through the documentation on how to do it.
Creating New Presentation Styles
TODO - recommendations and examples on creating new presentation styles (generally inherit from an existing style)
Ahhhhh, hmmm, did I tell you how awesome the documentation for this is?
It turns out that the best way to change the design and style is to copy and existing style and modify it with the additional complication that SHFB requires that the new style contain the name of the style that you have copied (go figure that one out....).
So after figuring it all out I found this post which pretty much explains everything and could have saved me a little bit of time. Anyway, the basic steps are as follows
  1. Install Sandcastle and SHFB and its prerequisites. 
  2. Open up SHFB and start a new project. 
  3. Select the sources you want to use by "Adding Documentation Sources" 
  4. Tweak the settings as desired. 
  5. Click build. 
  6. The output will open in a new browser window. 
Thats the basic steps, next step is I have to figure out how to get rid of the web page errors, which are caused because of a reference to a link of type "ms-help" in the html files. These links are apparently needed for when the .chm files are being generated but all they seem to do in my case is cause errors. It turns out that each "Presentation" has a "Transforms" folder associated with it so by commenting out the offending ms-help insertions I can alleviate that problem.
Next step is to figure out how to customise the header fully, currently we seem to be only allowed to change the text and perhaps stick an image in using the Post-Transform Component perhaps that will be sufficient for us.

Tuesday, June 1, 2010

BP is super evil. Time to buy some shares

So basically the whole world thinks that BP is evil, or at the very least grossly incompetent. Obviously the BOP exploding and the resultant pouring of oil into the Gulf of Mexico is a tragedy and one that we obviously need to avoid in the future, but in terms of the vast number of operations that BP and the other oil producing companies are engaged in it seems that they do a better job far more times than they don't. That being said, the monumental cost of a failure on this scale means that this type of failure has already occurred once too often.

But I digress, the point I wanted to make here is that purely from a trading point of view, it is time to jump on BP. There is no doubt that the share price has been hammered losing roughly one third of its value since the disaster struck. While the DOW and S&P 500 have also dropped these drops have been in the order of 10%.

The way I see this playing out is that the share price will likely drop a little bit more as the various options fail a little more until some point probably a week or two before the expected arrival of the relief well that is currently being drilled.

At the current price the company is undervalued and this will only become more apparent as the price drops further. BP is a massively successfully global company that specializes in a commodity that the entire world can't get enough of. The share price will recover and the market will forget the disaster in time (even if the general public do not). And whoever managed to get in on them now will be holding a steady profit.