by Kofi Sarfo
1. January 2010 14:37
The Vanilla BlogEngine.NET allows comments to be posted via an HTTP post which is great in terms of enabling an AJAX implementation for blog post comments. However, it's great too for spam bots, almost exclusively, offering pay day loans throughout the comment sections of this site. One new year's resolution was to implement a solution using ReCaptcha. In this case the solution requires writing no code.
StackOverflow: How would one integrate ReCaptcha in to BlogEngine.net (ASP.net C#)?
I can't think why anybody would think a pay day loan a good idea when there's Zopa, for example.
by Kofi Sarfo
14. November 2009 08:05
Having tremendous fun playing find the missing ThoughtWorks.CruiseControl.MSBuild.dll.
At times it feels as if some twisted soul is curating the Internet simply to thwart my efforts.
by Kofi Sarfo
13. November 2009 16:59
During our three day Agile Training course with too many examples contrived to maintain audience engagement through cute caveman cartoons and engineering attempts familiar to all (house-building), one colleague questioned how suitable agile might be in model driven development.
The Agile view was presented in one instance as making use of Zeno's Paradox in reverse. The paradox says, essentially, that motion is illusory because to travel any distance there is a point half the way between start and finish (let's call this half-way) and there is also a point half the way between start and half-way (let's call this a quarter of the way) and so on. Because there are an infinite number of these half-way points it's impossible ever to get anywhere. This being the case the Agile take is that perhaps we're able to make better progress by considering how to only get half-way as opposed to considering in too much detail the end-game (or the whole journey).
If Agile's Raison (Scrum in this example) primarily is to produce some complete functionality periodically (frequently) in tight iterations then the question in the case of model development is "how much value does half an algorithm provide, if any?" If it's not possible to go to market with half a model then shooting for half-way appears only to help as a strategy for maintaining motion rather than for more frequent delivery.
Stated another way: Because the Quant team who are building complex mathematical models are unsure what the finished product will look like they almost have no choice but to work iteratively. The question is then whether their iterations include the development team and so far it looks as if they've not done so sufficiently that Agile's value here probably isn't more frequent delivery of complete vertical slices but helping to ensure that the direction traveled is more likely to be correct by facilitating conversation.
If more frequent contact between the Quant and Development team then mean fewer wasted cycles and fewer trips down blind alleys which might have resulted from more isolated efforts then it's another tick in the Adds Value column - this scenario leverages the Wisdom of Crowds. However, design by committee might just as easily be a problem instead. We'll see.
Returning to the initial question of how well suited the Agile Methodology might be for Model Development, Scott Ambler provides one possible answer: Agile Model Driven Development (AMDD): The Key to Scaling Agile Software Development.
Meanwhile I'll be discovering how well Continuous Integration works on a development team of one and whether the overhead can be justified.
55128f97-f8df-4912-9546-0e305a062403|0|.0
Tags: agile
Talks
by Kofi Sarfo
23. October 2009 06:17
I've been doing this
String Calculator Kata whenever I've had a spare half hour before 7am and wanted to see how others did it. See the
Andrew Woodward Calculator Kata and the
Bobby Johnson Calculator Kata.
by Kofi Sarfo
22. October 2009 06:20
Differences
It was more than a little odd to see tests pass using the ReSharper Test Runner but fail when using either NUnit or the as yet mystery default option (whichever is used when Test With > Debugger is selected from the context menu).
Reason being that ReSharper is kind enough to run the tests in the order they appear whilst the others do so in alphabetic order. Dependencies between tests become apparent. Slaps to the forehead are delivered. We resolve to steer clear of using statics for unit testing.
Mouse
With only one monitor at work - everyone has just the one monitor so we're not too keen on standing out for being flash by having two monitors! - it would be handy having test results appear in the status bar using an ALT-T shortcut and TestDriven.NET. However, licensing! So it's tabbed Unit Test Sessions and CTRL-TAB until we're in the promise land.
Keyboard Shortcuts
Also, it turns out the the advertisement for going mouseless is true. Keeping the hands on the keyboard does indeed speed up coding. The next problem then was trying to access the Debug Tooltips (available ordinarily by hovering the mouse over variables). The solution is AutoHotkey and the script is courtesy of Rob Henry.
by Kofi Sarfo
15. October 2009 19:51
Bloomberg connectivity is a riot. We submit (by FTP) a text file with an expected format using carriage return and line feed to separate data entity requests.
From C# this means shelling out to a batch file (remember DOS) which executes some Java code responsible for handling request/response. If the request is valid then one minute later a zip file is returned that contains a text file. We parse and we have a database ready data file. If the request is badly formed, however, then an error file is created on the remote FTP directory but that is never returned!
Five years ago someone asked on WILMOTT (serving the Quantitative Finance Community) how to connect a Java application with Bloomberg to send and receive data. Dominic Connor was kind enough to reply.
At another time, at another place we used the DLLs on the Bloomberg terminal to return the data we needed. It was fast, efficient, predictable and illegal. Good times.
You may be here looking for something on bbdlftp or BBDL FTP. Good luck.
18155409-e441-4717-a322-d2b39d8b07d1|0|.0
Tags: ftp
Nostalgia
by Kofi Sarfo
7. October 2009 00:52
It's been almost one week since we started doing this daily code Kata: Roy Osherove's TDD Kata 1 - String Calculator. Thirty minutes every day in October so far. Six days. Three hours. Writing the same functionality over and over. What happens is that, naturally, each time we get a little closer to the end (we've not yet completed it in thirty minutes) and we optimise by anticipating functional requirements and code to allow for simple changes ahead. We'll decide how much of this is cheating once we're actually done a few times within thirty minutes before moving onto the next Kata.
We're using just the one code snippet, TDDtestmethod, which generates a test method. We abandoned the calculator variable name, opting for c.Add instead.
Is there a prize for the longest [Test] case method name?
Calculator_
MultipleDelimeterVaryingLengthSpecifiedDelimitedMultipleStringDecimalValues_
ShouldReturnSummedValues()
Using underscores would only make matters worse. And when we looked at some of our tests recently we discovered that we were unit testing parts of the framework (guess we're still not sure about Entity Framework) and using unit tests for spikes too. The words "Gone Too Far" appeared suddenly.
b0170213-2640-4571-8d25-9aaa00d4727e|0|.0
Tags: agile, c#
Dojo
by Kofi Sarfo
1. October 2009 18:39
Today, a courier cyclist arrived bearing the gift of a new contract for new employment. If everything goes as expected we'll be working in the City within two weeks.
It's perhaps better not to mention the employer by name but they're a solutions provider working within an interesting area of finance and our role's likely to involve helping to ensure the reliability of systems processing terrabytes of data with issues of cleanliness and performance being most important. We're thinking optimised data querying, concurrency (scale) and transformation/calculation.
Without much recent UI experience all the cool Winforms & Web developer roles seemed out of reach so this is where our spare time needs to be invested over the next couple of years whilst the day job is all about the data, touching possibly on F# and elements of grid computing and much more of the modelling languages: UML & XML.
In terms of development approach the experience from the last consultancy role at Man Investments should prove invaluable in terms of transferring agile methodology and process where appropriate but because this is a smaller company, enterprise systems integration complexity ought not to present the same kind of challenges. I'm hoping for a more contained, bounded, intra-application kinda complexity. Those woods and trees managed to get quite blurred in that last assignment.
The new mission is to help provide Market Transparency. After five years in Hedge Funds it seems fitting.
I should add that Man Investments was a fantastic place to work.
627efa3d-9c28-4a3f-a46a-0342c49069c9|0|.0
Tags:
Interviewing
by Kofi Sarfo
23. September 2009 01:18
The following StackOverflow post is interesting not so much because of the text but how it's rendered.
We begin with a <div> tag which contains an expected id attribute format and using a jQuery regular expression we're able to match all div elements with an "id" attribute beginning "RSSContent".
<div id="Container">
<div id="RSSBlock">
<div id="RSSContent200909222115"
runat="server"
title="http://stackoverflow.com/feeds/question/477962" />
</div>
</div>
The "title" attribute for each element matched is used in an HTTP post of content-type application/json to a web service which acts as a proxy to overcome cross-scripting JavaScript constraints. This returns the post above which I found useful recently.
It's not an elegant solution. I've hacked the div element, using the "title" attribute to hold the URL and the directory structure isn't great either. The web service creates a user control which appears to work only in the root directory and the web application project requires a reference to an identical control in another project. The things we do for code compilation!
The end result is that rather than cut & paste, which would have been far easier we're using using an external resource to supply text so that if the RSS feed item was to change, for example, then we'd still display the most current version.
An XLink implementation, this is not. It's just an example of how I thought the web might work sometime soon after 2001... What we're missing here, conceptually at least, is meta to describe the relationship between this post and the one referenced. Well, in this case the meta is only human-readable and quite incomplete.
by Kofi Sarfo
20. September 2009 17:02
Yesterday, during yet another interview, we didn't deliver quite the finest explanation of what an XML Namespace is. Today, we're using them to parse a Stack Overflow feed so clearly we understand them, however, if part of the question's purpose is to assess our ability to express this simple idea simply then shitehawks! #fail
Take this feed, for example, which is the RSS for a useful post on Volatile vs. Interlocked vs. lock. In order to to be able to use XPath with XDocument to retrieve the question we rely on XmlNamespaceManager.
var xDoc = XDocument.Load("http://stackoverflow.com/feeds/question/154551");
var xmlNamespaceManager = new XmlNamespaceManager(new NameTable());
xmlNamespaceManager.AddNamespace("atom", "http://www.w3.org/2005/Atom");
var postedQuestion
= xDoc.XPathSelectElement("/atom:feed/atom:entry/atom:summary", xmlNamespaceManager);
This is another example of Stack Overflow brilliance. The feeds are in chronological order so that we can guarantee that the first item (or entry) is the original post. Following the Volatile trail leads to a Joe Duffy post on Volatile Reads and Writes, and Timeliness. For example, he writes the C# documentation for volatile is highly misleading with reference to the following MSDN documentation:
The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock statement to serialize access. Using the volatile modifier ensures that one thread retrieves the most up-to-date value written by another thread.
Unfortunately, I can't find this specific RSS item within the Technology feed and the same is true for the RSS feed for this blog. Although it's possible to score a reference to the item if it appears within the list of entries as they each have a unique ID, should the category contain too many entries then the older posts don't show up. Soon I'll show why this might matter but I digress.
The quoted paragraph above came as some surprise and a few hours reading suggests that:
- This stuff is hard!
- It would take *years* at the exclusion of a whole lotta stuff to have a legitimate claim to deep understanding of the intricacies of threading in .NET
- A solid handle on this C# Threading series of posts might just be enough (for now).
The real trick, however, might be recall during interview. There's definitely a theme here.
6014194c-e8f7-4a49-9a1d-b21d85feca72|0|.0
Tags: threading
C#