Author Archive

Topological Sort in Report SharpShooter

Andrew Kazyrevich
 
Normally sorting is simple: you just need to tell which one of the two elements is larger. However, it’s not always the case – sometimes the items don’t have linear structure, and pairwise comparison is not possible. So let me piggyback on the hot topic of graph search and show you a useful and beautiful trick for sorting items in a SharpShooter report.
 
Which tasks you may need this for?
 
Well, think about plugins ecosystem in your app where a plugin could depend on other plugins, so you need to come up with the correct loading order:
 

 
Or you might be creating an online learning app and need to list course prerequisites for any given course:
 

 
Or consider project management: after finishing a task you can work on either one of its children, so listing all the tasks “properly sorted” in a report wouldn’t be that easy! Say, below is a simplified version of a startup project – if you where to present all tasks in a sorted list, will you place “setup legal entity” before “bugfixing” or after it?
 

 
The answer to this and other similar questions is topological sort and in this post we’d see how to implement it in a SharpShooter report. (more…)

May 11th, 2012

On strings similarity, graphs, and SharpShooter.

Andrew Kazyrevich
 
You know what, search engines frown upon the duplicate and similar content.
 
Or, rather, scratch that. What I wanted to say is that certain problems become utterly easy when you know which algorithms to apply. And, since I was lucky to touch some graph search stuff recently, I would like to share a few insights with you, – using a simple yet practical example. For reasons of brevity, some details got omitted (they should be easy to grasp from source code though) but if anything is unclear – don’t hesitate posting a comment or two!
 
So, back to search engines and duplicated content now. The “threshold similarity” will obviously depend on a concrete search engine, but generally pages are penalized with lower ranks for being similar to other pages. And even if you don’t deliberately copy-paste, there’s a chance to screw up, so one need to stay informed and keep the similarity low.
 
Therefore let’s help our friendly neighborhood SEO optimizer and build him a SharpShooter report about duplicate content! Say, a list of page URLs grouped or highlighted when they’re dangerously similar. (more…)
May 5th, 2012

Using Dapper with SharpShooter

Andrew Kazyrevich
 
Dapper is a “micro ORM” created for stackoverflow.com and they heavily use it in places where performance matters. It’s not a full blown mapper and doesn’t support relationsips and wouldn’t manage your connection life cycle etc – but it can map SQL queries to business objects.
 
And you know what, it does mapping better than anyone else. Dapper is much faster and more flexible than Linq2Sql and Entity Framework – and in this post we’ll see how to use it as a data provider for SharpShooter reports. (more…)
March 11th, 2012

Histograms in SharpShooter

Andrew Kazyrevich
 
While gleaning analytical insights from a report, the problems you end up dealing with are pretty much dependent on how well you can spot the patterns. And new patterns are almost always discovered by visualizing the data.
 
We touched this in How to debug scripts in Report SharpShooter highlighting items that “stand out too much”, and in Building a bubble chart with Report Sharp-Shooter with bubble charts, and lately in Logarithmic scale in SharpShooter charts where we revealed patterns visible only on a “log scale” charts.
 
But the techniques of visualizing are so powerful and variable, and it’s worth writing about them a lot more on this blog down here.
 
One, perhaps the most common, way of data visualization is histogram, and in this post we’d look into building histograms with SharpShooter. (more…)
March 5th, 2012