Continue reading
Drawing Flow Diagrams with GraphViz
Continue reading
Once I got going with them, they were actually pretty straightforward. You can actually add all kinds of markers to your google chart, complete with funky icons and customisable colours! The code I added to make these is simply:
&chem=y;s=bubble_text_small;d=bb,Max:+917,FFFFFF,660066;ds=0;dp=15|y;s=bubble_text_small;d=bbtr,Min:+185,FFFFFF,660066;ds=0;dp=20
All we have here is a simple specification of which kind of bubbles I want, the label for them and which data series (ds) and data point (dp) to attach it to. I generated the bubble tail directions sensitive to whether they were a min or max label, and which half of the graph they are in.
Continue reading
My interest was mostly because I’m working on a book chapter which includes some static analysis content, and there are a couple of these tools that I include in my own builds, but I don’t do much with the output of them. However I didn’t want to drop anything from the chapter if it was actually a valuable tool and I was just missing the point – pretty much all the tools got a good number of votes though, so I’ll be covering all of the above. It does look as if phploc has less of a following, however it’s one of my favourite tools so it gets a mention anyway!
Thanks to everyone who took the time to vote; I thought I’d share the results in case anyone was interested.
Here’s a simple example, using PHP’s curl extension, of using the bit.ly API to get a short URL, using PHP (you need an API key, but if you’re a registered bit.ly user, you can log in and then find yours at http://bitly.com/a/your_api_key).
$ch = curl_init('http://api.bitly.com/v3/shorten?login=username&apiKey=R_secret&longUrl=http%3A%2F%2Flornajane.net');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
print_r(json_decode($result));
I love oggcamp for the sheer randomness of what I learn there. I’ve variously seen talks on home automation, mapping, operating systems, politics … the list is pretty long. This year, it’s in Surrey, on the same weekend as the final deadlines for my book so I figured I’d have to give it a miss. But when I got an invite to speak on the scheduled track, I realised this was the omen I needed, and accepted at once!
I’ll be giving a talk entitled “Open Source Your Career” – a talk which brings up an aspect of open source that we often don’t discuss; the personal rewards that an individual can gain from being involved in open source. If you thought it was all about altruism, think again. I’ll be bringing anecdotes, from my own career and others’, about how the best way to fast-track your professional growth. See you in Surrey :)
Well, I still don’t know what I want to do next, but that seems like less of a problem these days. I’m busy but in a planned-in-advance, only wearing myself down because there was something so exciting I couldn’t say no, kind of a way. I am not a great fan of travel, and have always tried to avoid it, but in fact so many interesting things came up this year that I ended up on the road more than ever. It turns out that there is a world of difference between being sent somewhere on short notice, and planning a series of interesting professional engagements that just happen to involve being away from home a lot all at once. And if I don’t want to go: I don’t go. It’s amazing how many people will wait til next month if you ask them!
I’m completely new to book-writing and it felt like a mountain to climb. I have five chapters of around 8 thousand words each to write for the book (I have co-authors, who are also lovely), and the general advice I got was to just take it all one step at a time. This sounds a lot like the way I teach project management and time management to developers, so I used those same skills and created a burndown chart (I blogged about creating these before):
As you can see, there have been some great days, and some quieter days. The flat lines are mostly weekends or days where I was out of the office with other clients. Although I feel slightly overwhelmed (and this doesn’t show the edits that come back after I submit each chapter), the graph is at least going in the right direction!
I found graphviz frustrating at times but on the whole it draws clean, symmetrical graphs far beyond anything else I can manage, even if I do use a mouse or tablet. Since I’m not able to use a pointing device on a regular basis, and I’m marking up my presentations in text also, it turned out to be a really good fit. I thought I’d share how I got on with it and some of my own graphs – as much to remind me next time conference season comes around as anything.
It’s just a standard problem of PHP REST services. When I try to access it with java I have to convert it over and over again to ints.
I did have a quick look at the PHP manual page for json_encode but I didn’t see anything mentioning this. A few weeks later (my inbox is a black hole and it takes a while to process these things) I fell over a throwaway comment to an undocumented constant JSON_NUMERIC_CHECK, and I added the constant name to my todo list. In the time it took for me to actually get around to googling for this, some wonderful person updated the PHP manual page (this is why I love PHP) to include it as a documented option, and someone else had added a user contributed note about using it.
It turns out, this constant does exactly what I need. Here’s a simple use case:
echo json_encode(array('event_id' => '603'));
echo json_encode(array('event_id' => '603'), JSON_NUMERIC_CHECK);
and the output:
{"event_id":"603"}
{"event_id":603}
There are probably some situations in which you don’t want all your looks-like-a-number data to be returned as a number, but for now it seems to be a good fit for api.joind.in.