tag:blogger.com,1999:blog-85436196696542967092024-03-08T19:11:03.268+00:00Mark Barrett - Blogging offRhubarb, rhubarb... blah, blah... tosh, toshMarkyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.comBlogger25125tag:blogger.com,1999:blog-8543619669654296709.post-56002417197127984722010-11-04T16:00:00.004+00:002010-11-05T09:48:41.675+00:00Are we Agile yet?So I was lucky enough to attend an Agile Fundamentals talk hosted by <a target="_blank" href="http://www.stevenlist.com/">Steven List</a> of Thoughtworks. Like a lot of companies we've been doing our own version of Agile for a while and thought it would be an idea to send a few guys to the talk and revisit the basics to refresh ourselves with the core fundamentals.<br /><br />Cracking talk - Steven was a great speaker I jotted down a few notes and thought it would be an good to get them on here.<br /><br /><span style="font-weight: bold;">Agile manifesto:</span><br /><br /><a target="_blank" href="http://agilemanifesto.org/">http://agilemanifesto.org/</a><br /><br />So you think you're Agile? So did we. Then we looked into the Agile Manifesto:<br /><br />Individuals and interactions OVER processes and tools<br />Working software OVER comprehensive documentation<br />Customer collaboration OVER contract negotiation<br />Responding to change OVER following a plan<br /><br />I don't want to go into all the Agile background, founding members, etc, etc and I certainly don't want to turn into the Agile Police but it's worth highlighting that the items on the right are important there's no doubt we need them and will use them if and when required BUT the items on the left are much more important. That is if you want to get the full benefit of using Agile. Any time we lean towards the items on the right it's worth someone whispering "but that isn't the Agile way". Someone should do an app for that.<br /><br /><span style="font-weight: bold;">Which 2 goals do you want?</span><br /><a target="_blank" href="http://en.wikipedia.org/wiki/Project_triangle"><br />http://en.wikipedia.org/wiki/Project_triangle </a><br /><br /><img src="http://www.chowamigo.co.uk/images/project_triangle.png" alt="The project triangle" /><br /><br />The project triangle. I loved this. What I like about Agile is the bluntness of it all. It's very open and transparent so we're not fooling anyone. If you want the project to be cheap and quick then it won't be good quality. If you want a product quickly and of a high standard then it won't be cheap. Of course you can always go for a high quality product that is cheap - but it won't be quick.<br /><br />One of these factors WILL ALWAYS SUFFER. Think about the 2 goals your team wants to aim for and stick to them. "Two out of three ain't bad" [Meatloaf, 1977]<br /><br /><span style="font-weight: bold;">Bugs are things you find in the garden</span><br /><br /><a target="_blank" href="http://www.agile-testing.info/defect-inventories/">http://www.agile-testing.info/defect-inventories/</a><br /><br />Ok maybe I've exaggerated the point but whatever it's called or however we phrase it a bug, a defect, an issue it's all the same thing - a change to the working code. And that's exactly how we should treat them. Write a new user story put it on your board and into your backlog. If it's urgent then prioritise it at the top. Next iteration it's fixed. Job done.<br /><br />Also Steven discouraged the use of bug tracking software. Or more accurately he suggested if QA or the team want to use a bug tracking system that's fine as long as there is also a user story that address the problem on a wallboard. This mirrored my experience with bug tracking software. Everyones bugs become vital (showstoppers) and any trivial bugs have a tendency to get left untouched.<br /><br /><span style="font-weight: bold;">More us less them</span><br /><br /><a target="_blank" href="http://jamesshore.com/Blog/The-Crucible-of-Great-Teams.html">http://jamesshore.com/Blog/The-Crucible-of-Great-Teams.html</a><br /><br />Some points in the talk reminded me how good it is to work in an Agile team. I'm not talking the dev team I'm talking about the whole team - product owners, PM's, BA's, testers the whole schabang. Not all of us will have (or want) the full set of roles to make up an ideal Agile team but however your team is setup the main principle is that the team succeeds or fails TOGETHER. It's not John's code, Neal's test or Adam's web service. It's our code. Our product.<br /><br />It's very obvious to say but working as a team errrm works! Want more productivity, looking to improve quality? Have the team sit together, encourage collective ownership, use activities to help them bond and ask them to find solutions within the team. You might be surprised. As Steve put it during his talk "STOP BEING A HERO".Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-90021970663663498972010-10-01T11:02:00.007+01:002010-10-01T13:04:36.850+01:00Home improvements vs code improvementsSo I've been a bit of a DIY guru at the moment and managed to get a few rooms from our flat refurbished. Surprisingly it's not that interesting when you're painting a wall (slightly better than watching it dry) and my mind started to wander about similarities with how we approach home improvements and how we can approach code improvements.<div><br /></div><div>Yeah ok bear with me this might all be rubbish you can blame it on an access of paint thinning fumes. These are in no particular order but hopeful someone can appreciate what I'm try to say here:<br /><br /></div><div><div><b>1. Plan it and do it<br /><br /></b></div><div>So I figured I'd hit the bathroom first... probably the hardest of the 3 rooms I was doing and also the one with the most work. But the number one reason to do the bathroom - I had to get it done. The spare rooms could wait but was no way we could last any longer with a crappy shower and toilet (no pun intended).</div><div><br /></div><div>Comparison? Whenever our dev team is handed a problem we always break things down into features and prioritise them in order of value - what can't we live without? If we nail this feature will it set us up nicely for the next one? </div><div><br /></div><div>Team discussions around features are generally pretty short, same with DIY - discuss, plan and give it a go. No messing. You'll soon realise the plan is flawed or the tools you are using don't work. </div><div><br /></div><div>If that is the case - stop. Don't waste any more time. Catch up with your team and think of a better way to produce the feature.<br /><br /></div><div><b>2. It's all in the preparation<br /><br /></b></div><div>I can't believe how often this was said to me by other people who were lending me a hand - "Make sure you sand that down before you paint it", "If you want a good finish make sure the prep is done well first". And they were right. </div><div><br /></div><div>I see acceptance and unit tests as preparation for a feature. If you want a good 'finish' get the tests down first. In development there are times when we don't know how to test or even how we're going to solve a problem. That's ok, spike some code and get things straight but as soon as you can make sure you revisit and plug in the tests.<br /><br /></div><div><b>3. Look to improve<br /><br /></b></div><div>The reason I was so busy trying to fix our flat up was because I let things slip - the equivalent of technical debt I guess. Had I kept on top of things while I lived there I wouldn't have had to refurb 3 rooms in one hit. </div><div><br /></div><div>Same with code - don't let that technical debt build up, tidy as you go. It's very rare a dev team is allowed free reign to clear technical debt so let's be up front and if we see something we can fix, fix it. This does come with a big but... BUT make sure any refactoring or improvements are fully tested ideally with acceptance as well as unit tests. Ensure you are improving code and not causing more issues for someone else.<br /><br /></div><div><b>4. Use external sources<br /><br /></b></div><div>The really bad thing about home improvement is the cost. Wow it's expensive. So I tried to do as much as I could myself but there were things that I just couldn't do. Plastering and plumbing for example. Nightmare - so I gave the job to someone who knew how to do it properly.</div><div><br /></div><div>Going back to code, is there something that can do this feature better than you can? I'm reminded of companies who build their own CMS or blogging system. Why? Use Drupal, Wordpress, Blogger or any other application that has a good reputation within that area. </div><div><br /></div><div>Don't be afraid to use an expert if it's quicker, cheaper or just a real a bitch to do yourself.<br /><b><span class="Apple-style-span" style="font-weight: normal;"><br /></span>5. ALWAYS add value<br /><br /></b>Whenever a feature is discussed ask the question:</div><div><br /></div><div>'What's the best result we can achieve for the least amount of time and money'</div><div><br /></div><div>That's the reason we look after our property so why should code be any different. I'm no property expert but I'm pretty sure the amount of time and money I put into our home improvements means the value of our property has increased. </div><div><br /></div><div>Can we always say the same about the features we produce?</div></div>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-64475226316317152722010-08-10T12:05:00.013+01:002010-08-10T13:13:10.690+01:00Beware Structure Map - use lazy loading!!!<span style="font-family:verdana;">Our team recently discovered a problem when a site we were responsible for crashed whenever a particular third party web service died. We were wrapping the web service call and catching any errors as is good practice but after 2 crashes in 6 weeks it was necessary to investigate further and we eventually traced the problem back to the Structure Map </span><span style="font-family:verdana;">registry</span><span style="font-family:verdana;">.<br /><br />We figured the registry was set up to initialise an instance of our </span><span style="font-family:verdana;">service </span><span style="font-family:verdana;">wrapper on startup so if the third party site was down and our site restarted (via IIS presumably) it couldn’t create an instance of the service wrapper and the whole site would fall over</span>.<br /><span style="font-size:78%;"><code><br /><span style="font-weight: bold;font-size:130%;">var serviceWrapperConfiguration = new ServiceWrapperConfiguration(</span><span style="font-size:130%;"><br /></span><span style="font-weight: bold;font-size:130%;"> new Uri(AppSettings.ServiceUri)</span><span style="font-weight: bold;font-size:130%;">);<br /><br /></span><span style="font-weight: bold;font-size:130%;">ForRequestedType<IServiceWrapperConfiguration>()</span></code></span><div><span style="font-size:78%;"><code><span style="font-weight: bold;font-size:130%;">.TheDefault.IsThis(serviceWrapperConfiguration);<br /><br /></span><span style="font-size:130%;">ForRequestedType<IServiceWrapper>().TheDefault.Is.ConstructedBy(context =><br />{<br />var configuration = context.GetInstance<IServiceWrapperConfiguration>();<br />return ServiceWrapperFactory.Create(configuration);<br />});</span></code></span><br /><span style="font-family:verdana;"><br />Although this was highlighted due to an external dependency </span><span class="Apple-style-span" style="font-family:verdana;">it’s good practice for all Structure Map registries to use lazy loading so once we uncovered the mistake we rewrote the registry to only create an instance when required</span><span class="Apple-style-span" style="font-family:verdana;">:</span><code><span style="font-size:78%;"><span style="font-family:Georgia,serif;"><br /><br /></span><span style="font-style: italic; font-weight: bold;font-size:130%;">ForRequestedType<IServiceWrapperConfiguration>()</span><span style="font-size:130%;"><br /></span><span style="font-style: italic; font-weight: bold;font-size:130%;"> .TheDefault.Is.ConstructedBy(() =></span><span style="font-size:130%;"><br /></span><span style="font-style: italic; font-weight: bold;font-size:130%;"> new ServiceWrapperConfiguration(</span><span style="font-size:130%;"><br /></span><span style="font-style: italic; font-weight: bold;font-size:130%;"> new Uri(AppSettings.ServiceUri)</span><span style="font-style: italic; font-weight: bold;font-size:130%;">));</span><span style="font-size:130%;"><br /><br />ForRequestedType<IServiceWrapper>().TheDefault.Is.ConstructedBy(context =><br />{<br />var configuration = context.GetInstance<IServiceWrapperConfiguration>();<br />return ServiceWrapperFactory.Create(configuration);<br />}); </span></span></code><br /><br /><span class="Apple-style-span" style="font-family:verdana;">This was tested throughly by pulling out the network cable on a PC so we lost connection to the third party service and loading the site locally. We were able to step into the website straight away so we're quietly confident this is no longer a problem - worth remembering when setting up Structure Map registries though.</span><br /><span class="Apple-style-span" style="font-family:verdana;"></span></div>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-84342574362263461082010-05-21T10:41:00.006+01:002010-05-21T11:08:09.367+01:00Bored of Arial and Verdana? Use Cufon...<span class="Apple-style-span" style="font-family:verdana;">Cufon is a cool way to render fonts that are not native to your users system. It's really handy if you want your headers to pop a bit more or for brands that use a particular font in their logo and want it used across other areas of the site.<br /><br />When I first saw Cufon the frontender in me said why not just use images. Then I realised it really comes into it's own when rendering dynamic content. It would be much easier to render text and get Cufon to transform it rather than assign images that would need to be updated each time the content changed.<br /><br />So what do you need to do to get up and running with Cufon? First of all download the Cufon script file from Git (the source also comes with documentation and HTML demos) - <a target="_blank" href="http://github.com/sorccu/cufon">http://github.com/sorccu/cufon</a>.<br /><br />Then you need to grab your TTF font file (other fonts types are supported so check the site for more info) and generate your font script - <a target="_blank" href="http://cufon.shoqolate.com/generate/">http://cufon.shoqolate.com/generate/</a>.<br /><br />All that's left is to use the Cufon.replace method to specify the HTML element that you like to transform, for example:<br /><br /><span style="font-style: italic;">Cufon.replace('#content-wrapper p.cufon-me'); </span><br /><br />I created a <a target="_blank" href="http://www.chowamigo.co.uk/demos/cufon-all-browsers.html">quick example with a free font called Cube</a> but I did notice some cross browser issues with IE6 in particular. Make sure you include a jQuery file on your page and call <span style="font-style: italic;">$(document).ready</span>. Without it <a target="_blank" href="http://www.chowamigo.co.uk/demos/cufon-problem-with-ie.html">in this example Cufon doesn't work in IE6</a> (you'll probably need <a target="_blank" href="http://www.my-debugbar.com/wiki/IETester/HomePage">IETester </a>to verify that!).<br /><br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-56126408758044973632010-04-15T12:33:00.010+01:002010-04-17T15:17:26.236+01:00My first TeamCity build monitor<span class="Apple-style-span" style="font-family:verdana;"> I'm quite surprised at the lack of decent TeamCity build monitors on the web. M</span><span class="Apple-style-span" style="font-family:verdana;">aybe it's because </span><span class="Apple-style-span" style="font-family:verdana;">TeamCity </span><span class="Apple-style-span" style="font-family:verdana;">incorporate an email and tray notifier with the system but I always find them easy to ignore, easier to ignore than a mahossive build monitor </span><span class="Apple-style-span" style="font-family:verdana;">screen at least.</span><span class="Apple-style-span" style="font-family:verdana;"><br /><br />After googling a few keywords around TeamCity build monitors </span><span class="Apple-style-span" style="font-family:verdana;">I did find some that were <a target="_blank" href="http://blog.coryfoy.com/2008/10/build-status-lamp-with-ruby-and-teamcity/">plain overkill</a>, while TeamCity itself comes with a status widget which gives you a <a target="_blank" href="http://confluence.jetbrains.net/display/TCD3/Enabling+the+Status+Widget+for+Build+Configurations">pretty standard javascript output for each build</a>.<br /><br />The TeamCity status widget was interesting, unfortunately it was also really detailed and unappealing BUT it could be modified to display the information I was looking for - something visual that I could put on a screen telling the team when a build failed and if anyone was looking into it.<br /><br />First of all I enabled the TeamCity status widget for a couple of builds:<br /><br /><img src="http://www.chowamigo.co.uk/images/tc_status_widget.png" alt="Enabling the TeamCity status widget" /><br /><br />Then I played about with some clever jQuery (more clever than I am) to make the page auto refresh whilst rejigging the layout to show only those things we were interested in. Now I've got some cool features to show off!<br /></span><ul><li><span class="Apple-style-span" style="font-family:verdana;">Every 10 secs the build monitor refreshes itself getting the latest TeamCity build information.</span></li><li><span class="Apple-style-span" style="font-family:verdana;">If all the builds are good the build information is hidden and a green background image is displayed.</span></li><li><span class="Apple-style-span" style="font-family:verdana;">If a build fails the screen turns red and the failed build gets highlighted. Some of the build data was unnecessary so most of it is hidden away except for the project name and link back to TeamCity.</span></li><li><span class="Apple-style-span" style="font-family:verdana;">Finally if (or when) someone is assigned to a broken build we go and get an avatar for that person from the images folder (the image filename takes the format <span style="font-style: italic; font-weight: bold;">teamcity username.jpg</span>).</span></li></ul><br /><br /><img src="http://www.chowamigo.co.uk/images/failed_build.png" alt="A failed build on the build monitor" /><br /><br /><span class="Apple-style-span" style="font-family:verdana;">To use this build monitor with TeamCity enable the status widget for each project (under 'Edit configuration settings' > 'General settings') and correct the build_monitor.html file by replacing <span style="font-weight: bold; font-style: italic;">buildsrv2 </span>with your build server and changing <span style="font-weight: bold; font-style: italic;">buildTypeId </span>to your own project id. I'm checking 3 different TeamCity projects but you can add or delete as many as you want.<br /><br />I've tried to make all this customisable so add your own images, styles or enhancements as you see fit.</span><span class="Apple-style-span" style="font-family:verdana;"> I nearly dived into JsUnit to see if it helps write better JS but that's another blog post. Any refactoring or comments welcome - </span><span class="Apple-style-span" style="font-family:verdana;"><a href="http://www.chowamigo.co.uk/downloads/buildmonitor.zip">Download my first TeamCity build monitor here (1.18MB)</a>.</span><span class="Apple-style-span" style="font-family:verdana;"><br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-49110452229242703262010-03-12T09:33:00.011+00:002010-03-15T15:20:17.900+00:00Scrumban<span class="Apple-style-span" style="font-family:verdana;">On Thurs 11th March I went to a Skillsmatter talk by Chris Pitts called 'Scrum to Scrumban'. The presentation was based around his experience in moving a dev team away from Scrum and towards a more Kanban style approach. It's actually</span><span class="Apple-style-span" style="font-family:verdana;"> an evolution I'd been involved with before but it was really interesting to see his take on the process</span>.<br /><span class="Apple-style-span" style="font-family:verdana;"><br />(Skillsmatter are excellent at uploading videos you can find </span><a target="_blank" href="http://skillsmatter.com/podcast/agile-scrum/chris-pitts-migrating-from-scrum-to-scrumban/zx-548"><span class="Apple-style-span" style="font-family:verdana;">Scrum to Scrumban here</a>.)<br /><br />There were a few points that really jumped out at me especially as I'm part of a new team that are keen to try more of a lean approach. We've rejigged our wall board which helped make each story go through a pull system but there are still some things that need to be straightened out. Chris suggested a few good ideas and I'm keen to try some to see if it helps our new team settle into 'Scrumban':<br /></span><ol><li>Pomodoro planning - Once your work is coming through as part of a pull system there is no need to hold huge planning meetings for upcoming work. When you feel the team needs more stories for the 'Backlog' or 'To do' column hold a 25min planning session with the business to get the next stories onto the board.<br /><br /></li><li>What about future Epics? A question I asked! By giving them an initial t-shirt size the business will know if they should be broken down. Any large epics need be broken down but everything else can then be brought up in the Pomodoro planning sessions when the team have run out of stories.<br /><br /></li><li>Dealing with too much WIP - Some teams use post-its to stick stories on their wall board but if you're finding too much WIP is going on try switching to cards which can be added to the board with magnets. Want to limit the WIP to say... 5 stories. Make sure you only have 5 magnets! A story can't make it to WIP if there isn't a free magnet. Brilliant.<br /><br /></li><li>Dealing with stories blocked by a third party - This is something that seems to happen a lot and it's always difficult to deal with. In such cases Chris suggested that it helps to introduce a new section on the board called a 'Sin bin'. The concept being the issues remain visible to the team and the devs constantly review the stories in the 'Sin bin' to make sure they haven't been unblocked by the third party. This is strictly for stories that are blocked by third parties though, other blocks should remain on the board until the team have resolved them.<br /><br /></li><li>Using date stamping (effectively) - My previous attempts at date stamping proved unsuccessful. As a team we tried to stamp each story as soon as it made it to a new column on the board. Unfortunately this wasn't a great approach as devs would often forget and stories would get through unstamped. On the other side of that we had loads of stamped stories and no idea how to use the information it gave us.<br /><br />Chris had a fresh take on this concept - ask your product owner to date stamp a story when it's first picked up by a dev and then once again when the story is has been demoed and verified by the product owner. In effect you only have 2 dates, one for the time the story was started and one for the date it was business verified. So what does this give you? Well first of all you can start to work out approximate cycle times for similar sized stories. Perhaps medium stories are going through at a maximum of 3 days. Now the product owner knows that any medium stories can be expected to arrive back at his desk in approx 3 days. Ok not bad but there is also an added benefit here. It pushes the devs to communicate early with the product owner and also forces them to demo the story at the earliest opportunity. All in all everyone wins!<br /><br /></li><li>Weekly retrospectives - The process to move towards a more lean approach can be very intense. Even small changes in the wall board or planning sessions can introduce concerns within the team. To assist the evolution towards lean it's a good idea to hold weekly retrospectives. Chris suggests that he found them very helpful as concerns or problems were caught early and resolved without spiralling out of control. Even months into the new process Chris made sure the team held weekly retrospectives just to make sure the team was happy.<br /><br /></li><li>Next evolution? Try Kaizen - Although I've got a long way to go before I can call myself a true Kanban disciple I've often wondered what the step after Kanban will look like. This is the first time I've heard of the word Kaizen and the concept appears to be - <a target="_blank" href="http://www.valuebasedmanagement.net/methods_kaizen.html">continuous incremental improvement</a>. From what I can gather it introduces the ability for teams to retrospect and fix on demand without the need to sit down and plan at all. It sounds interesting although one guy at the talk suggested he is using Kaizen and implied that he has added several new columns to the board. Hmmm unconvinced, part of my liking for Kanban is the way it simplifies the wall board and increases clarity of throughput. Then again maybe this guy found this was the best way to implement Kaizen and my experience (once I get there) may be different. Anyway something to think about I'm definitely not writing it off yet!<br /></li></ol><span class="Apple-style-span" style="font-family:verdana;">One final point - towards the end of the talk Chris bought up the subject of headphones. He indicated that developers on the team he helped were asked not to use them and the team found it improved communication dramatically. One pair might be talking about something and then another dev might overhear and say 'Oh you're doing that, I'm glad I heard you mention it, etc'.<br /><br />At first I wasn't convinced but our team has paired up a lot more recently which kind of forces you to abandon your headphones. I have to agree things are a lot more enjoyable and the team has gelled really well. Although I don't think you can enforce a headphone ban I'd hate to go back to those bad old days when each of us stuck on our headphones and banged out stories with our heads down.<br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com1tag:blogger.com,1999:blog-8543619669654296709.post-53965510116832207882010-03-09T14:14:00.005+00:002010-03-09T18:04:08.570+00:00Setting up Cucumber to use the Watir test runner<span class="Apple-style-span" style="font-family:verdana;">Recently I was asked to demo Cucumber and how our developers could use it to automate acceptance criteria. I've worked a lot with Cucumber as a way of running Watir commands but I couldn't remember the initial steps you go through to get it installed. After googling a few things I found a couple of links that were really useful - the <a target="_blank" href="http://cukes.info/">Cucumber website</a> is good and also a <a target="_blank" href="http://mikewagg.blogspot.com/2009/06/installing-cucumber-on-windows.html">blog post by my friend Mike Wagg</a> helps map out the Watir aspect.<br /><br />So let's fast forward a bit, I had installed Ruby, Cucumber, Watir and everything was fine no errors at all. I even wrote a quick Cuke test to search Google for the phrase "Cucumber". Yep all worked well so everything looked good for me to start coding the demo.<br /><br />Now this is where I lost about 2 days OF MY LIFE!!! (Ok maybe not that much but more time than I would've liked). I created a nice new Visual Studio solution with a bare bones HTML form and a couple of textboxes. I typed out a rough scenario with some acceptance criteria and filled out the step definitions. It was going to be around cars (very manly) so my first couple of step definitions looked like this:<br /><br /><span style="font-size:78%;">Given /^I am on the Cucumber brown bag page$/ do<br /> @browser.goto 'http://localhost/cucumberbrownbag/'<br />end<br /><br />And /^I have entered my car details correctly$/ do <br /> @browser.text_field(:name, 'makeTextBox').set("Fiesta")<br /> @browser.text_field(:name, 'modelTextBox').set("1.6 Ghia")<br />end</span><br /><br />Ok looks good so let's run the Cuke test... FAIL! I got this:<br /><span style="font-size:78%;"><br /></span><span style="font-style: italic;font-size:78%;" >Unable to locate element, using :name, "makeTextBox"</span><br /><br />Hmmm that's not good so I double checked my naming and step syntax, they all looked correct. Then I tried to rejig the steps, same error. Then I tried to see if Watir knew the textbox existed on that page:<br /><br /></span><span class="Apple-style-span" style="font-family:verdana;font-size:78%;">Given /^I am on the Cucumber brown bag page$/ do<br /> @browser.goto 'http://localhost/cucumberbrownbag/'<br /> </span><span class="Apple-style-span" style="font-family:verdana;font-size:78%;">@browser.text_field(:name, 'makeTextBox').exists?</span><span style="font-size:78%;"><br /></span><span class="Apple-style-span" style="font-family:verdana;font-size:78%;">end</span><br /><span class="Apple-style-span" style="font-family:verdana;"><br />Which gave me this error:<br /><br /><span style="font-style: italic;font-size:78%;" >unknown property or method `document'</span><span style="font-size:78%;"><br /></span><span style="font-style: italic;font-size:78%;" > HRESULT error code:0x800706b5</span><span style="font-size:78%;"><br /></span><span style="font-style: italic;font-size:78%;" > The interface is unknown. (WIN32OLERuntimeError)</span><br /><br />Hmmm now this is strange! I stepped back for a moment to try to work this out. It felt like it was something to do with the browser not being found or Watir being unable to attach to it. What happens if I change the step definition from my localhost domain to my IP address?<br /><br /></span><span class="Apple-style-span" style="font-family:verdana;font-size:78%;">Given /^I am on the Cucumber brown bag page$/ do<br /> @browser.goto 'http://10.1.0.185/cucumberbrownbag/'<br /> </span><span class="Apple-style-span" style="font-family:verdana;font-size:78%;">@browser.text_field(:name, 'makeTextBox').exists?</span><span style="font-size:78%;"><br /></span><span class="Apple-style-span" style="font-family:verdana;font-size:78%;">end</span><br /><span class="Apple-style-span" style="font-family:verdana;"><br />Bingo it worked... so it's permissions! Don't ask me why but I can only use localhost in my Cucumber scripts if I'm running the command line as administrator OR if I use my domain or IP address instead.<br /><br />On a separate note, I found a link to <a target="_blank" href="http://www.hanselman.com/blog/CategoryView.aspx?category=Watir">Scott Hanselman's blog on interactive Watir</a> which allowed me to bring up the Interactive Ruby tool - IRB (get it from the command line by typing "irb"). It's VERY useful as a way of stepping through the Watir process and seeing why things aren't working.<br /></span><span class="Apple-style-span" style="font-family:verdana;"></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com1tag:blogger.com,1999:blog-8543619669654296709.post-7512671598600632122010-02-16T10:14:00.006+00:002010-02-16T10:56:29.556+00:00Auto generating from a Web Services Description Language (WSDL) to ASP.NET (C#)<span class="Apple-style-span" style="font-family:verdana;">I ALWAYS forget how to do this so I'm going to blog the steps:<br /><br />1.) Open a Visual Studio command prompt (not a DOS prompt!)<br />2.) Drill down to the folder location where you want the auto generated class to be saved.<br />3 a.) If you are using a WSDL file rather than a URL, drop the file into the same location and type the following command (where <span style="font-style: italic;">filename.wsdl </span>is the name of the file) and press Enter:<br /><br /><span style="font-style: italic;">svcutil </span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">filename</span></span><span style="font-style: italic;font-family:verdana;" class="Apple-style-span" >.wsdl </span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">/language:C#</span><br /><br /></span><span class="Apple-style-span" style="font-family:verdana;">3 b.) If the WSDL comes via a URL, make sure the service is running and type the following command (where <span style="font-style: italic;">http://webservice?wsdl </span>is the URL of the WSDL) and press Enter:<br /><br /><span style="font-style: italic;">svcutil </span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">http://webservice?wsdl </span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">/language:C#</span></span><br /><span class="Apple-style-span" style="font-family:verdana;"><br />4.) You should find it has <enter>generated a class and config file which contains all the services, ports, bindings and messaging you need to communicate with this particular web service.</enter></span><span class="Apple-style-span" style="font-family:verdana;"><br /><br />FYI - More <a target="_blank" href="http://en.csharp-online.net/WCF_Essentials%E2%80%94Generating_the_Proxy">WCF proxy generating info here</a>.<br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com1tag:blogger.com,1999:blog-8543619669654296709.post-61518105675136052612010-01-23T18:24:00.010+00:002010-02-05T12:05:02.610+00:00Google multivariate test - Link button text and CSS demo<span class="Apple-style-span" style="font-family:verdana;">Recently been looking at google multivariate testing and I've been really impressed with how simple it is to set up and how in depth the web dashboard is. Quick start users might want </span><span class="Apple-style-span" style="font-family:verdana;">to go <a target="_blank" href="http://www.chowamigo.co.uk/multivariate-test.html">straight to the demo</a></span><span class="Apple-style-span" style="font-family:verdana;"> for those interested here's a bit more about it...<br /><br /><span style="font-style: italic;"><span class="blsp-spelling-error" id="SPELLING_ERROR_0">Woah</span> hang on a bit what do you mean by google multivariate test?</span> It's a cool new approach that anyone can use to really optimise a website in terms of layout or content. Maybe you think your sales pitch isn't quite right but you're not sure what's wrong with it. Setting up a google multivariate test allows you to write 4 or 5 different pieces of text and then tells you how each piece of text performs.<br /><br /><span style="font-style: italic;">Sounds clever but how does a multivariate test work out how well a piece of content is performing?</span> Well it's pretty straight forward, if we take the example above it will randomly display each piece of text and then record how many users saw that text and visited your <span class="blsp-spelling-error" id="SPELLING_ERROR_1">pre</span>-defined conversion page. In this case the conversion page would be the next page or even better the payment checkout page. Straight away you'll have clear percentages of uplift - maybe 5% more users who were shown 'Text 3' bought a product, maybe it was 5% less but at least it'll give you accurate feedback to make a decision on your sales pitch.<br /><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_2">Ok</span> so enough with the intro what I really wanted to blog about is how you can get into the HTML elements of a <span class="blsp-spelling-error" id="SPELLING_ERROR_3">webpage</span> and combine that with some funky <span class="blsp-spelling-error" id="SPELLING_ERROR_4">CSS</span> changes to create a really varied multivariate test.<br /><br />If you <a target="_blank" href="http://www.chowamigo.co.uk/multivariate-test.html">go to this page</a> you'll see a basic HTML page with a few links that are styled as buttons. If you click a link button it will go through to a thank you page which is also my conversion page. If you delete your cookies and refresh/revisit the page you'll notice the link buttons will change, by deleting your cookies and refreshing you'll get loads of different variations. Each time you click through it will record a visit to the conversion page from that test and will update the results on my google dashboard.<br /><br />If you check the HTML source of the test page you'll see some google javascript at the beginning and end of the page. This tells google that it's being used as a test page... the conversion page has similar javascript to identify it as a conversion page.<br /><br />Now here's the clever bit just before the source of each button is a script tag:</span><span class="Apple-style-span" style="font-family:verdana;"><br /><br /></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"><script</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">>utmx_section("Indiv button css")</span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"></script</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"></noscript</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">></span></span><br /><span class="Apple-style-span" style="font-family:verdana;"><br />This is what's known as a section name, once a <span class="blsp-spelling-error" id="SPELLING_ERROR_12">webpage</span> has been uploaded and verified the google dashboard identifies these section names and allows you to add HTML which will replace the existing HTML at this point on the <span class="blsp-spelling-error" id="SPELLING_ERROR_13">webpage</span>. In this case the section will be inserting some <span class="blsp-spelling-error" id="SPELLING_ERROR_14">CSS</span> that changes the button image for a different version:<br /><br /></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"><style</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">>.ca-google-ind-button { background:transparent <span class="blsp-spelling-error" id="SPELLING_ERROR_16">url</span>(images/google/x-large-button-flat-blue.<span class="blsp-spelling-error" id="SPELLING_ERROR_17">jpg</span>); color:#<span class="blsp-spelling-error" id="SPELLING_ERROR_18">ffffff</span>; }</span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"></style</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"></span><br /><br />Pretty cool huh! Including the original (which doesn't insert any <span class="blsp-spelling-error" id="SPELLING_ERROR_20">CSS</span>) I've got 4 different button link colours. All we need to do is attach another google section around the link text, include some text variations on the google dashboard and the link button is completely changed:<br /><br /><span style="font-style: italic;"></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"><</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">a class="ca-google-ind-button" <span class="blsp-spelling-error" id="SPELLING_ERROR_22">href</span>="multivariate-conversion.html"</span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">></span></span><span class="Apple-style-span" style="font-family:verdana;"><br /><span style="font-style: italic;"> </span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"><</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">script</span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span class="blsp-spelling-error" id="SPELLING_ERROR_24">utmx</span>_section("Text for <span class="blsp-spelling-error" id="SPELLING_ERROR_25">indiv</span> button")</span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"><</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">/script</span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">></span></span><span class="Apple-style-span" style="font-family:verdana;"><br /><span style="font-style: italic;"> Click me! </span><br /><span style="font-style: italic;"> </span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"><</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">/<span class="blsp-spelling-error" id="SPELLING_ERROR_28">noscript</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">></span></span><span class="Apple-style-span" style="font-family:verdana;"><br /></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;"><span style="font-style: italic;"><</span></span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">/a</span></span><span class="Apple-style-span" style="font-family:verdana;"><span style="font-style: italic;">></span></span><span class="Apple-style-span" style="font-family:verdana;"><br /><br />Although the demo isn't doing anything too exciting I hope you can see the <span class="blsp-spelling-error" id="SPELLING_ERROR_30">possibilites</span> that this technique can give you. Not only does it give you responsive feedback but it also adds value as soon as a test goes live.<br /><br />One final thing to say, I think it's a good idea to launch a small multivariate test <span class="blsp-spelling-corrected" id="SPELLING_ERROR_31">initially</span> just so you get a feel of things and how it works. After that my opinion is that you should be using this to really test radical differences not just paragraphs of text, there's no reason why the column layout can't be changed or even have the page <span class="blsp-spelling-corrected" id="SPELLING_ERROR_32">re skinned</span>.<br /><br /></span><span class="Apple-style-span" style="font-family:verdana;">I should add that you can switch off under performing combinations via the dashboard but make sure your traffic is at a high level and the failure was conclusive. We've seen some huge test swings where a combination has performed badly one week and <span class="blsp-spelling-corrected" id="SPELLING_ERROR_33">completely</span> turned around the next. </span><span class="Apple-style-span" style="font-family:verdana;">Again I really do think you get the most of of this by being daring and trying things that aren't obvious.<br /><br /></span><span class="Apple-style-span" style="font-family:verdana;"><a target="_blank" href="http://www.chowamigo.co.uk/multivariate-test.html">Google multivariate test - Link button text and <span class="blsp-spelling-error" id="SPELLING_ERROR_34">CSS</span> demo</a></span><br /><span class="Apple-style-span" style="font-family:verdana;"><br /><br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-42571976897241902742010-01-20T15:21:00.004+00:002010-01-20T15:29:25.002+00:00Cool freebie site for web UI lovers<span style="font-family:verdana;">Who doesn't like instant, relevant UI feedback and... for free?!?<br /><br /><a target="_blank" href="http://www.fivesecondtest.com/">FiveSecondTest.com</a> is a really cool site that lets real users carry out UI tests on your website, great for feedback on potential designs or UI tweaks (and a bloody good spot from our creative team).<br /><br /><a target="_blank" href="http://www.fivesecondtest.com/">http://www.fivesecondtest.com</a></span><span style="font-family:verdana;"><br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-7398356989267837782009-11-20T11:01:00.011+00:002009-11-20T15:06:17.474+00:00if (TeamProblems || !TeamProblems ) { Retrospective.Start(); }<span style="font-family:verdana;">Luckily that title is as technical as this post is going to get. Recently our team have let retrospectives slip a little. We've all heard the excuses <span style="font-weight: bold;">'Too busy', 'not needed', 'no one's around' </span>but those are <span style="font-weight: bold;">exactly the right reasons for DOING a retrospective</span>. Right I've already got ahead of myself here let's rewind a bit...<br /><br /><span style="font-style: italic; font-weight: bold;">So what is a retrospective?</span><span style="font-weight: bold;"> </span>A retrospective is generally thought of as a brief and informal get together (I hate the word meeting) to discuss what the team is doing right, what the team is doing wrong and how to fix some of the problems while maintaining the good stuff. The concept is part of Agile software development where teams develop through iterations or sprints, it's a chance to look retrospectively at the last iteration and try to do better - although we often don't get it right we should at least try.<br /><br /></span><span style="font-family:verdana;"><span style="font-style: italic; font-weight: bold;">But we're not doing Agile?</span></span><span style="font-family:verdana;"> Woah I didn't say it was exclusive to Agile. In fact I think you'll find it helpful without labelling it Agile or XP. </span><br /><span style="font-family:verdana;"><br /><span style="font-style: italic; font-weight: bold;">Sounds rubbish why should I bother doing a retrospective? </span>Ok... good question! Retrospectives are great for providing team feedback. Maybe there's a lack of quality and you find yourself fixing bugs all day, perhaps important deadlines weren't hit or the team in general is not working to a <a target="_blank" href="http://frazzleddad.blogspot.com/2007/11/why-sustainable-pace-matters.html">sustainable pace</a>. Flip this around and maybe the team is flying, code is shipped on time and doesn't come back - doughnuts all round. In either case don't you think it's important to work out what happened so it does (or does not) happen again?<br /><br /></span><span style="font-family:verdana;"><span style="font-style: italic; font-weight: bold;">Maybe I'll try it, so what happens in a retrospective? </span>Hmmm tough crowd. Ok there are loads of blogs and books you can read that will give you 100 different tips on doing retrospectives. Our team decided to borrow a lot from the <a target="_blank" href="http://www.infoq.com/minibooks/scrum-xp-from-the-trenches">Scrum and XP from the trenches PDF</a>, while <a target="_blank" href="http://agilesoftwaredevelopment.com/tags/retrospective">AgileSoftwareDevelopment.com</a> has some great articles and the pragmatic bookshelf published <a target="_blank" href="http://pragprog.com/titles/dlret/agile-retrospectives">a good read on Agile Retrospectives</a>.<br /><br />Regardless of any material you read, the one rule I really think is important is that retrospectives are <span style="font-weight: bold;">collaborative</span>. Everyone should get a say good and bad about how the team is doing. But what if you've got some shy devs or a manager that is particularly bossy? How can you make sure everyone has an equal voice?<br /><br />Something we've had success with is giving everyone a bunch of post-it's in 2 colours; one colour is for anything that was good about the iteration and the other colour is for anything bad. Each person spends 5 mins writing a few positive comments and a few that they think are negative.<br /><br />For example - 'The deployment took too long', 'IIS settings were updated without any errors', 'Javascript bugs were found too late'. It's easy to be critical doing this so I'd suggest trying to write one good post-it for every bad post-it, it might not always be possible though!<br /><br />After 5 mins writing on post-its (if something isn't thought about in 5 mins then is it important?) everyone stands up and sticks their post-its to a wall. As a team work out which post-its fit into a category, generally there is a common theme like 'quality', 'deployment' or 'IIS problems'. Bunch the related post-its together separating the good coloured notes from the bad. This gives the team very visual topics to discuss - 'Why are our deployments taking so long?', 'What can we do about the javascript errors?'.<br /><br />Take some time to go through the good and bad notes for each category. If a post-it doesn't make sense ask the writer to clarify. </span><span style="font-family:verdana;">If people want to elaborate on points let them but don't push it. </span><span style="font-family:verdana;">I believe every post-it on the wall is relevant because someone has gone to the trouble of writing it down. Discuss each one and talk it through.<br /><br /></span><span style="font-family:verdana;">Sometimes it's hard to remember key points or things that happened. In such cases you might find it useful to <a target="_blank" href="http://www.thekua.com/rant/2006/03/a-retrospective-timeline/">use a timeline to remember the last few weeks</a>.</span><br /><span style="font-family:verdana;"><br />Once everything has been discussed the team can decide on 3 goals for the next iteration. Perhaps it would be to talk to the deployment guy more, maybe you've felt the javascript pain and know what to look for next time? Remember though - we're not LiveAid. No one is trying to feed the world here. Try to remain positive by keeping your goals relevant AND reachable. Print an A4 list of the team goals and stick them above your wall board so everyone can see them.<br /><br /></span><span style="font-family:verdana;">Ok I've gone on way too long now. <span style="font-style: italic; font-weight: bold;">Yes you have, what was the result of YOUR last retrospective big mouth? </span>Easy rude boy... ok here are the goals from our last retrospective and to prove our team is not the elite Agile death squad we think it is, they are exactly the same goals as the retrospective before! Hey I did say we let retrospectives slip a little:<br /><br /></span><ul style="font-weight: bold;"><li><span style="font-family:verdana;">Increase clarity of through-put using the wall board</span></li></ul><ul style="font-weight: bold;"><li><span style="font-family:verdana;">Improve scrums - yesterday? today? anything blocked?</span></li></ul><ul style="font-weight: bold;"><li><span style="font-family:verdana;">Limit work in progress</span></li></ul><span style="font-family:verdana;">Acknowledgments - Thanks to the following guys (and more that don't have a blog) who helped me realise retrospectives are awesome: <a target="_blank" href="http://zubairk.wordpress.com/">Zubair Khan</a>, <a target="_blank" href="http://testerhemal.wordpress.com/">Hemal Kuntawala</a> and <a target="_blank" href="http://mikewagg.blogspot.com/">Mike Wagg</a>.<br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-36668135330929678592009-10-28T15:06:00.004+00:002009-10-28T15:32:31.146+00:00jQuery UI slider that uses a text box for input<span style="font-family:verdana;">'Quick start' users can <a target="_blank" href="http://www.chowamigo.co.uk/demos/slider-with-text-box.html">go straight to the demo</a>...<br /><br />.. but if anyone is interested this came about when our ever diverse creative team came up with a feature that needed a slider input that was also clever enough to work if the user typed a value into a text box (the feature was around currency which is why the example uses pounds).<br /><br />I looked around and couldn't really find anything other than the jQuery UI slider which was neat, simple but also allowed you into the events and properties of the slider so you can extend on it's basic functionality.<br /><br />Now you can add the jQuery slider markup to a page:<br /><br /><span style="font-style: italic;"><div id="sliderLow" class="slider"></div></span><br /><br />Drop in a text box:<br /><br /><span style="font-style: italic;"><input type="text" class="amountLow" onKeyUp="SetSliderValue('#sliderLow', this)" /></span><br /><br />And I guess the clever bit is the custom javascript that allows you to add as many sliders as you like to a page using parameters for <span style="font-weight: bold;">sliderId</span>, <span style="font-weight: bold;">minimumValue</span>, <span style="font-weight: bold;">maximumValue</span>, <span style="font-weight: bold;">inStepsOf </span>and <span style="font-weight: bold;">inputControlClass</span>:<br /><br /><span style="font-style: italic;"></span><span style="font-style: italic;"> SetupSlider('#sliderLow', 0, 40000, 250, '.amountLow');</span><span style="font-style: italic;"></span><br /><br />Anyway it's all done using HTML and CSS and it also uses the numeric.pack plugin to stop anything other than numbers being entered. Feel free to rip this off or take it away and extend it further.<br /><br /></span><span style="font-family:verdana;"><a target="_blank" href="http://www.chowamigo.co.uk/demos/slider-with-text-box.html">Go to the demo</a>...</span><span style="font-family:verdana;"> ENJOY!</span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com11tag:blogger.com,1999:blog-8543619669654296709.post-38956565708904388552009-10-01T10:32:00.003+01:002009-10-01T10:40:08.098+01:00Awesome online music editing software<span style="font-family:verdana;">What's so cool about <a href="http://aviary.com/tools/myna" target="_blank">this app</a> is that all the memory heavy library files are stored on Aviary's server- just build a track and export it. Also this thing let's you record from your machine AND gives you some wicked sound effects to lay on top.<br /><br />Ignore the crap demo track... for the library files click the button bottom left, record button is bottom right.<br /><br /><a target="_blank" href="http://aviary.com/tools/myna">http://aviary.com/tools/myna</a> and click ‘Launch Myna’.<br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-37502201585603328982009-10-01T09:40:00.006+01:002009-10-01T10:17:06.891+01:00(FIX) Visual Studio hangs, crashes and restarts when opening .ASPX or .ASCX files<span style="font-family:verdana;">So I come in to work, do my morning SVN update, open my Visual Studio 2008 solution and the aspx file I was working on the previous night hangs, crashed and restarts... errr WTF?!?<br /><br />After doing this <span style="font-weight: bold;">with every .aspx and .ascx file I opened </span>I decided to abandon VS and use Notepad++... this was NOT a good solution! What made it even stranger is that <span style="font-weight: bold;">I could open the same aspx/ascx files in a different VS solution and they'd open fine</span> - no crashes, no restarts.<br /><br />Stuck in VS hell for a couple days I thought ok let's take some time to figure this out. I googled some fixes, first I found <a href="http://stackoverflow.com/questions/500696/why-does-visual-studio-crash-opening-aspx-with-mvc-rc1" target="_blank">a few suggestions on StackOverflow</a>, then <a href="http://blogs.msdn.com/jnak/archive/2009/02/26/fix-available-asp-net-mvc-rc-crash-in-a-windows-azure-cloud-service-project.aspx" target="_blank">a hotfix update for an ASP.NET with MVC bug</a> but I still couldn't resolve the issue. Then I reinstalled VS - made me lose my keyboard and environment </span><span style="font-family:verdana;">settings </span><span style="font-family:verdana;">but I still had the </span><span style="font-family:verdana;">crash/</span><span style="font-family:verdana;">restart problem.<br /><br /><span style="font-weight: bold;">FINALLY </span>I did something clever, instead of just watching the crash I debugged into it which gave me a null reference error in some shared code. Essentially another dev had been working on a shared project which was checking for an entry in the root web config:<br /><br /><span style="font-style: italic;font-size:85%;" >var configEntry = System.Configuration.ConfigurationManager.GetSection("DumbAss") as NameValueCollection;</span><br /><br />I had updated SVN at a project level so I got the shared change but missed the root web config update - I mean how often does the thing change anyway!<br /><br /><span style="font-weight: bold;">Essentially this hang, crash, restart issue is not always a Visual Studio problem</span> (although it could handle it better). If like me you're stuck and need VS up and running <span style="font-weight: bold;">check your web.configs are up-to-date with all the required config sections </span>and if you're still getting VS restarting <span style="font-weight: bold;">it's a good idea to step in with debug mode so you can see the real error that's being thrown.</span><br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com1tag:blogger.com,1999:blog-8543619669654296709.post-51485100704997052112009-04-01T16:45:00.011+01:002009-07-28T10:29:33.233+01:00Working with web services - XML serialisation<span style="font-family:verdana;">As before I've got a quote object that is populated and passed across to a third party. It was turning into a real <span class="blsp-spelling-error" id="SPELLING_ERROR_0">biatch</span> of a task mainly due to some bad error messaging from a third party web service.<br /><br /></span><span style="font-family:verdana;">At this point, </span><span style="font-family:verdana;"><span class="blsp-spelling-corrected" id="SPELLING_ERROR_1">something</span> I found really useful was to look at a copy of the XML that was being sent to the web service. Getting into the XML file allowed me to really interrogate the data and it highlighted some formatting errors that had been missed by the unit tests - mainly date and currency formatting but enough to cause the web service to reject the request.<br /><br />If you find yourself in a <span class="blsp-spelling-corrected" id="SPELLING_ERROR_2">similar</span> dilemma use the code below and switch out the object type, file location and variable names for your own:<br /><br />var request = new <span class="blsp-spelling-error" id="SPELLING_ERROR_3">QuoteRequest</span>();<br /><br />request = <span class="blsp-spelling-error" id="SPELLING_ERROR_4">BuildRequest</span>();<br /><br /><span class="blsp-spelling-error" id="SPELLING_ERROR_5">FileStream</span> <span class="blsp-spelling-error" id="SPELLING_ERROR_6">fileStream</span> = new <span class="blsp-spelling-error" id="SPELLING_ERROR_7">FileStream</span>(@"c:\temp\example_request.<span class="blsp-spelling-error" id="SPELLING_ERROR_8">xml</span>", <span class="blsp-spelling-error" id="SPELLING_ERROR_9">FileMode</span>.<span class="blsp-spelling-error" id="SPELLING_ERROR_10">OpenOrCreate</span>);<br /> <span class="blsp-spelling-error" id="SPELLING_ERROR_11">TextWriter</span> stream = new <span class="blsp-spelling-error" id="SPELLING_ERROR_12">StreamWriter</span>(<span class="blsp-spelling-error" id="SPELLING_ERROR_13">fileStream</span>);<br /> <span class="blsp-spelling-error" id="SPELLING_ERROR_14">XmlSerializer</span> <span class="blsp-spelling-error" id="SPELLING_ERROR_15">xmlSerializer</span> = new <span class="blsp-spelling-error" id="SPELLING_ERROR_16">XmlSerializer</span>(<span class="blsp-spelling-error" id="SPELLING_ERROR_17">typeof</span>(</span><span style="font-family:verdana;"><span class="blsp-spelling-error" id="SPELLING_ERROR_18">QuoteRequest</span></span><span style="font-family:verdana;">));<br /> <span class="blsp-spelling-error" id="SPELLING_ERROR_19">xmlSerializer</span>.Serialize(stream, request);<br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-5441606327246862602009-02-24T10:36:00.005+00:002009-02-24T11:25:01.706+00:00Working with web services - Checking the web service connection<span style="font-family:verdana;">I've recently been working on a web service integration. It's a big task with integration tests, unit tests, WSDLs, the full works. To give it a bit more background the web service expects a quote object that gets populated by us and then passed across to the web service. We then get a response which is either an error(!) or more hopefully a list of quote responses that we can bind to a datagrid.</span><br /><br /><span style="font-family:verdana;">To start with the web service integration went well. Downloaded the schema from the WSDL, got the required quote object unit tested to make sure it was being populated correctly. All looking good, so went onto an integration test that would use test data to populate the quote object and pass it over.<br /><br />Now it all fell apart</span><span style="font-family:verdana;">! Kept getting a </span><span style="font-family:verdana;">rubbish 'Quote refused' error. This made me think of authentication problems so checked the username and passwords but they proved to be setup correctly. I was really coming to a block on the task when a collegue suggested downloading SoapUI to see what was going on with the web service connection. Turn out to be a good shout...</span><br /><br /><span style="font-family:verdana;">You can find SoapUI here - <a href="http://www.soapui.org/" target="_blank">http://www.soapui.org/</a>. It allows you to add a WSDL from either a URL location or from a file on your machine. As long as the WSDL is genuine, SoapUI returns a list of objects and double clicking on them generates example XML requests which you can send to the web service (click the green arrow top left)</span>.<br /><br /><span style="font-family:verdana;"><a href="http://www.chowamigo.co.uk/images/soap_ui_screenshot.gif" target="_blank">Soap UI screen shot here</a></span><br /><br /><span style="font-family:verdana;">It proved to be a good idea because when we tried to setup SoapUI with our third parties WSDL the schemas came down fine but sending XML returned an 'UnknownHostException'. I sent the screen grab to the third party who confirmed the WSDL we had been given was incorrect (essentially it contained the wrong web service URLs). Change of WSDL and 5mins later we were connecting with SoapUI.<br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-57042889604718814502008-08-04T12:37:00.004+01:002008-08-04T22:18:51.792+01:00.NET Gridview default display is annoying!<span style="font-family:verdana;">We've recently got into using a Gridview to display some of our tabular data. It's really easy to use and has some cool features - with a few annoying exceptions...</span><br /><br /><span style="font-family:verdana;">I wanted to remove the border lines which I did using CSS at first. This was ok except in IE when the browser showed a border around aspects of the table. I checked the HTML coming from the Gridview and it surprised me there was no THEAD for the header elements.<br /><br />I didn't think these 2 issues were related but they still needed fixing. </span><span style="font-family:verdana;">A quick google search and it looks like the default setup for Gridviews will cause these problems. It might only matter to a few of us but what if you want full control over the style and HTML? Luckily there is a fix!</span><br /><br /><span style="font-family:verdana;">Use the following code to override the base class OnPreRender and the border/grid lines that can be seen in IE will disappear. The final line will also cause the table to render a THEAD (in between header rows):</span><br /><br /><span style="font-family:verdana;"> protected override void OnPreRender(System.EventArgs e)</span><br /><span style="font-family:verdana;"> {</span><br /><span style="font-family:verdana;"> base.OnPreRender(e);</span><br /><br /><span style="font-family:verdana;"> this.GridLines = System.Web.UI.WebControls.GridLines.None;</span><br /><span style="font-family:verdana;"> this.CellSpacing = -1;</span><br /><span style="font-family:verdana;"> this.Attributes.Add("cellspacing", "0");</span><br /><span style="font-family:verdana;"> this.UseAccessibleHeader = true;</span><br /><span style="font-family:verdana;"> }</span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-37224219241288101642008-07-08T15:28:00.002+01:002008-07-08T16:50:29.846+01:00Mapping errors with nHibernate in Visual Studio<span style="font-family:verdana;">I've started to get into nHibernate recently and while it's pretty cool to use I'm shocked at the lack of info if you get into problems.<br /><br />A good example - I was working on a project that already had nHibernate setup and running with exisiting integration tests. I added a new object to the domain, created a new mapping file, project built, all good but when I ran my new integration test I kept getting this error:<br /><br />Class type <YOURNAMESPACE.YOURCLASS> is not defined within your current mapping files<br /><br />Finally got fed up searching through Google and asked a collegue who pointed out the reason why. </span><span style="font-family:verdana;">The error generally means the mapping file isn't being found by nHibernate.</span><br /><span style="font-family:verdana;"><br />Essentially I was being a bit thick and had named the mapping file newclass.xml instead of newclass.hbm.xml ok ok my bads on that one BUT he also told me the xml file needed to be setup as an embedded resource in Visual Studio (Right click the file - properties and set 'Build Action' to 'Embedded Resource').<br /><br />Lesson learned and just in case anyone else is stumped out there; </span><span style="font-family:verdana;">check you have named the mapping file correctly (it should be named the same as the domain object), with the right extension (hbm.xml) and you have specified the file is an embedded resource</span><span style="font-family:verdana;">!!!</span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-54157578256526782712008-07-02T12:02:00.005+01:002008-07-02T12:32:09.961+01:00ASP.NET ScriptManager causing JavaScript errors<span style="font-family:verdana;">First post for a while and the reason I'm getting this out there is due to the lack of Google results on the subject.</span><br /><br /><span style="font-family:verdana;">Recently our QA dept raised a bug with 2 javascript errors appearing on certain pages. The errors itself is <span style="font-weight: bold;font-family:verdana;font-size:85%;" class="objectBox objectBox-errorMessage hasBreakSwitch" >'Sys is not defined' </span><span style="font-family:verdana;">which in itself is a really useless error. Just to give this some background, I was using a .NET ScriptManager on a masterpage. Some pages using this masterpage had the JS errors and some didn't.</span><br /><br /><img src="http://www.chowamigo.co.uk/images/js_error.gif" alt="sys not defined error" /><br /><br /><span style="font-family:verdana;">Further investigation lead me to believe the errors were caused by the webresource.axd and scriptresource.axd not being rendered in the HTML. I was expecting something like this:</span><span class="objectBox objectBox-errorMessage hasBreakSwitch"><br /></span><pre id="line18"><script src="/WEBSITE/WebResource.axd?d=-LVZ..."<br />type="text/javascript"></script><br /><br /><script src="/WEBSITE/ScriptResource.axd?d=IrhmF..."<br />type="text/javascript"></script><br /></pre>After spending a few hours googling the issue I found a few responses suggesting IIS (deselect 'check file exists', yes done that), or web.config entries (again all correct).<br /><br />Finally I stumbled upon a thread suggesting .NET pages using ScriptManagers can cause issues when not calling the base from any page events - I've since lost the link hence this post!<br /><br />This is how my code looked with the error:<br /><br />protected override void OnPreRenderComplete(EventArgs e)<br />{<br />base.OnPreRender(e);<br /><br />[REST OF CODE...]<br />}<br /><br />The fix is obvious now - use<span style="font-weight: bold;"> base.OnPreRenderComplete(e) </span>but for future reference if you experience this issue check all your events are calling base correctly.<br /></span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com1tag:blogger.com,1999:blog-8543619669654296709.post-40878006713409228822008-04-22T14:03:00.009+01:002008-04-22T14:29:52.401+01:00Using Resharper 3.0 with CSS files causes Visual Studio 2008 to crash<p style="font-family: verdana;">Finally had enough of trying to edit CSS in Visual Studio 2008. Looks like Resharper is trying to work out the intellisense for the file and causes the whole solution to fall over. It's something that JetBrains are aware of but I can't seem to find a fix:<br /><br /><a href="http://www.jetbrains.net/jira/browse/RSRP-56402">http://www.jetbrains.net/jira/browse/RSRP-56402</a><br /></p><p style="font-family: verdana;">Anyway I've switched to using <a href="http://notepad-plus.sourceforge.net/uk/download.php">Notepad++</a> which I actually quite like. A friend suggested <a href="http://topstyle.en.softonic.com/">Topstyle 3</a> but I find the intellisense frustrating to use.</p><p style="font-family: verdana;">If anyone has a good CSS editor or even better if you know of a fix for Vis Studio 2008/Resharper 3.0 pls let me know!</p>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-9024797373678340072008-04-16T14:56:00.003+01:002008-04-16T15:03:34.133+01:00Wicked streaming music site<p style="font-family: verdana;">Pandora.com have blocked users outside the States so I've been looking for a good online streaming music site to replace it. I'm not keen on LastFM and after loads of googling I've just found Musicovery: </p><p style="font-family: verdana;"><a href="http://www.musicovery.com/">http://www.musicovery.com/</a><br /></p><p style="font-family: verdana;">Cool graphics, a sweet user interface (select the genres you want to hear and click your mood 'hotspot') it's the first site in a long time to really impress...</p>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-42293270577751580872008-04-15T10:55:00.007+01:002008-04-15T11:15:14.215+01:00Safari bug which causes all CSS to be ignored<p style="font-family:verdana;" >Our QA dept. recently raised a bug on a project I was working on suggesting Safari was ignoring all my CSS. OK bit wierd... so I checked it out and they were right all the other browsers were fine but Safari was rendering a page without styles.</p><p style="font-family: verdana;">So off I go doing the ol' half and half trick (pulling out half the CSS refreshing then halfing that until you isolate the issue). Finally I track it down to the fact that I had deleted a hex value but the empty background-color element was still in the CSS along with a badly used !important - <span style="font-weight: bold;" >background-color: !important</span>.</p><p style="font-family: verdana;">Just to prove I wasn't going mad here is the HTML to prove it. Hopefully it will help some poor sod out there who is currently refreshing Safari with a rather bemused look on their face...</p><p style="font-family: verdana;"><br /><html><br /><head><br /><style><br /><br />div { font:20px arial; width:250px; height:250px; background-color:!important; }<br /><br />#red { width:250px; height:250px; background-color:red; }<br /><br />#blue { width:250px; height:250px; background-color:blue; }<br /><br /></style><br /></head><br /><br /><body><br /><br /><div id="red"><br />This is red<br /></div><br /><br /><div id="blue"><br />This is blue<br /></div><br /><br /></body><br /></html><br /></p><br /><p style="font-family:verdana;" >(Oh and before anyone says it... you should never use !important but that's another story...)</p>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-72214022943680079602008-04-14T09:46:00.006+01:002008-04-14T10:09:31.871+01:00Subversion (SVN) cache is a pain in the arse<p style="font-family: verdana;">We use the Tortoise SVN client for source control and while it's a load better than using SourceSafe there is one issue that keeps coming up. In case you didn't know Subversion (SVN) will show a green tick for the files and folders that remain unchanged and red crosses to show files and folders that have been edited.</p><p style="font-family: verdana;">The problem is I select the folder and files with red crosses, commit to SVN, files get added but the red crosses still remain. Admittedly it doesn’t happen often but when it does there’s an easy fix – go into Task Manager and kill the TSVNCache.exe process:<br /></p><img src="http://www.chowamigo.co.uk/images/TaskManager.gif" alt="TSVNCache.exe in Task Manager" title="TSVNCache.exe in Task Manager" /><br /><p style="font-family: verdana;">The SVN folders should refresh and your green tick will come back… if it doesn’t make sure you have committed everything in that folder!</p>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0tag:blogger.com,1999:blog-8543619669654296709.post-83363008893329721302008-04-11T11:41:00.010+01:002008-04-11T16:06:25.878+01:00CSS hacks or filters that I can't live without!<span style="font-family:verdana;">Ok ok so there are various opinions on whether we should use hacks or filters to help us with CSS styles. Is it right, is it ethical, will we go to hell, whatever...<br /><br />For what it's worth I don't believe in hacks - if your CSS is not cross browser compatible (at the very worst it should look the same in Firefox 2 and IE 7) then you need to look at the CSS, refactor the markup if necessary and tweak until it's correct.<br /><br />BUT that is great if your starting a new project or have the ability to say 'right we're dumping this CSS and doing it all from scratch'. That's not always a possibility and you may find yourself looking at browser bugs that just need slight margin and padding tweaks to be correct.<br /><br />So... waffle and social responsiblity lecture over. Please use these hacks as you wish, I've found them very handy although they are always my last resort!!!<br /><br />(Copy and paste this code into a blank HTML file - If you are having problems cross browser, make Firefox look correct then change the other browsers accordingly)<br /><br /><html><br /><head><br /><style><br /><br />/* ALL: Show in all browsers */<br />#hackthis { Width:200px; height:200px; background:green; border:1px solid #000; }<br /><br />/*IE7: Purple IE6 Pink: */<br />* html #hackthis { *background: purple; -background: pink; }<br /><br />/* SAFARI: Show in Safari only */<br />#hackthis:empty { background:yellow; }<br /><br />/* OPERA: Show in Opera only */<br />@media screen and (min-width: 0px) { #hackthis { background:blue; }}<br /><br /></style><br /></head><br /><body><br /><br /><div id="hackthis"><br />&nbsp;<br /></div><br /><br /><p>FF = Green</p><br /><p>IE7 = Purple</p><br /><p>IE6 = Pink</p><br /><p>Safari = Yellow</p><br /><p>Opera = Blue</p><br /><br /></body><br /></html> </span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com1tag:blogger.com,1999:blog-8543619669654296709.post-60756885471294589372008-04-11T11:00:00.003+01:002008-04-11T15:55:42.942+01:00First blog post...<span style="font-family:verdana;">So here it is... my (feeble) attempt to get some of my points of view as well as dev and CSS advice out and onto the web.<br /><br />Comments are really welcome, especially if I'm wrong! Let's just try to share the love though ;D<br /><br />Marky</span>Markyhttp://www.blogger.com/profile/03688282045583748277noreply@blogger.com0