So you may of seen previous posts on Boost Graph construction, here I present an easier way of constructing the graph but at a performance cost. This shouldn’t be used if can be avoided, but it may be useful if you want to adapt your edges on the fly.
So we start with the normal code:
So we start with a basic set of nodes, A->E with some connections between them. This is an example of a directed graph so “flow” can only go one direction.
The benefit of this is you define the construct of the graph and create the graph_t, object g.
An alternative way of constructing is to generate the nodes, then add in the weights as in:
This may seem easier but comes at a performance cost. In contrast even on this simple example there is a 0.001s time increase, scale this to a real solution you may suffer badly. As stated make sure your scenario makes sense.
Preface:
When chatting with a colleague yesterday, I referenced a blog post I never actually wrote. So to remedy that here we go, how to use boost in the case of inheritance.
How To:
Inheritance in C++ is very important, a long with classes and templates I would say the most important triplet (of course inheritance cant exist without classes). As I mentioned in a previous blog post I found a new love of boost serialization allowing me to easily be able to save out my objects in binary,text or xml, but there is a spanner in the works when it comes to inheritance, this is due to the serializer not being able to know it has a parent or even what that parent is.This is actually solved with a small amount additional of code but is critical to put in or your objects wont behave in the expected way.
So we serialize out the child class and what do we get? Well actually it is very clean elegant empty file. Not what was intended, but with a small change to tell the compiler of the classes parent we are able to serialize out child classes and parents without a problem
As you hopefully can see this tells the compiler what the object parent is and provides a reference to it so therefore you can serialize that out. Of course you can put this line at the beginning or end depending on how you want to structure your outputs, but to my brain coming first makes sense.
The final solution being:
A year and a half ago, I order an Asus N73SV. At the time I was incredible impressed with it’s state of the art spec great expandability. I knew at the time it was a bit of a gamble with Asus not being a major player in the laptop market and the price being quite a bit cheaper than its rivals for similar spec. After using for a year I have done upgrades to RAM 6gb –> 10gb and replaced HDD for a hybrid and a larger second drive. It has been a great laptop till recently things have gone a little wrong.
Now I am not blaming asus for its product the two components that have gone wrong are completely under my control but my issue comes with the service and availability of replacements(in the UK). The two parts that have gone wrong is the battery is now completely shot, lasting about 10 mins going to 70% and turning off, and the power cable getting damaged as seen above.
These are normal issues you hit with portable electrical products, replacing the parts though is proving not to be so easy. The battery is out of warranty so I just need a replacement, the transformer is in warranty but I don't really want to loose my laptop for a couple of weeks since it has become a very important part of my life replacing my home computer completely and having heavy usage in the office although accompanied by other computers. So sending it away wasn’t really tempting when I would be ordering another part anyway, also I am not about to pay £150 in labour fees to replace a battery.
So customer support was out, but I want the official replacements so called them, first time they just hung up on me a little concerning they don't have a queue system. Second time I got through promptly, and found out they don't sell the items over the phone you can go to the asus shop website (http://shop.asus.co.uk/) and order there. I am slightly embarrassed that I never actually found this in my googling around for official products. So went on the site after the call and they are sold out of most things and don't actually list anything to do with my laptop.
So what do you do? well look at contact page and call this UK website help line, and what charming welcoming voice do you hear? A nice recorded German lady speaking German that I don't understand, I assume it leads to options but I don't understand. So I have resorted to emailing them.
In summary, the point of this rant was to express that Asus sell great products but there are no official replacements easily available. For a company of which I have enjoyed many great products from, I am shocked they fell down so badly on such an easy thing they can make a great deal of money from.
Hopefully will be able to get the replacement parts soon and have something better to say about Asus!
I have put together a quick demo for the upcoming conference. Sadly I wont be there to present the work but the main author Manuel J. Fonseca from IST is going to be there.
Give it a play and let us know what you think. This is a heuristic approach to parsing of sketched postures into a skeleton.
Paper Details and Demo from: http://stuartjames.info/skeletons-from-sketches-of-dancing-poses.aspx
Flag raising after medals awarded
The Crowd
Women's medley
So close for second and third!
Designed wheelchair’s seem to help
Power shot!
American guy on left was absolutely incredible, his competitor on the right.