2010-06-29 21:36Hacking your own Debian packageYet again I have found myself on the wrong side of Debian’s strict packaging policy. There is a piece of software that I want to install which isn’t packaged for Debian, but which fortunately is packaged for the sister distro, Ubuntu. This alternative package source is only useful, though, if Ubuntu uses sufficiently similar package names and version numbers, otherwise the Debian package management tools will treat the package as invalid due to dependency problems. The last time I had to deal with this sort of problem was with an earlier version of the same package, plasma-widget-adjustableclock, but this time the dependency problem is slightly different and I’ve tried fixing the problem in a different way too. Below I detail what the problem is, and my not-entirely-successful efforts at resolving it. 2010-06-28 23:13EU state flowersThe opportunity to speak with Americans about their federal system is one I rarely turn down, as it helps me understand Europe’s federal system. While talking to a particular American, I found that, despite the stereotypes, they did not believe that the EU was a federal country, and although this meant they agreed with the vast majority of Europeans on the matter, I decided to dismiss their view as uninformed and presented them with a video of the EU president celebrating the EU national day by reading a speech and watching the EU flag being lifted by members of the EU army, followed by a military band performance of the EU national anthem. I feel, though, that to really convince an American (and possibly a European too) that the EU is a country, I must provide a list of the state flowers of each of the EU states, which was, as I explained in an earlier blog post, one of the only things the EU was missing. Continue reading "EU state flowers"2010-05-31 20:10Getting a domain nameI’ve recently made a few changes to my blog and thought that, in the self-referential tradition of bloggers, I should mention some of the decisions I made and how they affect my blog. The most external change, and the one mentioned in the title of this post, is that I do now have a domain to host this blog on. By “external” I don’t just mean it is potentially visible in your address bar when you visit any page of the blog, I also mean that it involved interaction with various third parties. It is a change I had been meaning to make for a while now, and one I should have made long ago, but hopefully it should last a long time. Continue reading "Getting a domain name"2010-05-31 20:10
The only other problem with PHP Posted by Hagfish
in Programming at
20:10
Comments (0) Trackbacks (0) The only other problem with PHPBy a strange coincidence, I’ve recently bumped into another PHP gotcha, well, actually three of them depending on how you’re counting, but I’m sure that these must be the last three unexpected things about PHP and I won’t soon have to write another blog post detailing something else unintuitive that PHP does. The reason these could be seen as one gotcha is that they all involve PHP’s support for floating point numbers, so one workaround would just be to not use that datatype at all in your programs. As I will show though, it is harder than you might think to avoid them, so perhaps the best advice is to avoid using numbers at all. To be on the safe side though, maybe you should just use a different programming language. Continue reading "The only other problem with PHP"2010-04-30 19:40
Spelling conventions for software ... Posted by Hagfish
in Programming, Standards at
19:53
Comments (0) Trackbacks (0) Spelling conventions for software projectsA project at work recently reached an interesting crossroads where it had to be decided what the spelling convention should be for some code which the company’s partners would have to interact with. The use of English as a common language had been uncontroversial up to that point, but there had crept into the software words which had different spellings between American English (en_US) and British English (en_GB). As a passionate European, it made sense to me to choose the version of English spoken by the English, but the more I researched it, the more I realised that the correct international standard really was en_US. Perhaps the deciding factor for me was that the coding standard for the European Space Agency requires the use of en_US spelling, which I will mention below in my depressingly convincing argument for that same linguistic standard. Continue reading "Spelling conventions for software projects"2010-04-30 19:40
Is that all that's wrong with PHP? Posted by Hagfish
in Programming at
19:40
Comments (3) Trackbacks (0) Is that all that's wrong with PHP?While my previous blog post covered what may be an actual bug in PHP, there are still a couple of gotchas which might be worth mentioning. Firstly there is the inconsistent way it deals with single and double quotes around strings, and then there are the undesirable consequences of how it juggles variable types, for which I have an example. Of course, all languages have their problems, with the obvious exception of Groovy, the superiority of which I will demonstrate with a one-liner, possibly accompanied by an excuse to explain why that simple one-liner was so hard to write. Continue reading "Is that all that's wrong with PHP?"2010-03-31 18:38Hate PHPThe title of this post is even less helpful (and less fair) than the title of the blog post which inspired it, so it should probably be viewed as parody. However, I do sadly have a file on my computer called hate.php containing a series of lines of valid PHP source code which produce unexpected and even perplexing results. Admittedly there are only 6 lines, and the behaviour of half of them is as documented, but I hold PHP to a higher standard than I would a “messy” language like Perl, so I thought this deserved a blog post. Continue reading "Hate PHP"2010-03-31 18:38What is the Protestant way to mark Lent?One of the things I have noticed in the lead up to Pasch is what a benefit it is to have friends of several different Christian denominations and backgrounds, as they have provided me with interesting insights into different Christian traditions. Having done some research myself into the history of Lent, and comparing the different modern practices, I have noticed a gap in the apologetical literature, a gap which I have decided to treat as a challenge. I aim to construct (although not explicitly define) a Protestant position on Lent (for some value of “Protestant”), based on Church history and the Bible. The resulting position may not actually match the position of any particular Protestant group, or even intersect with any, but I think it is a thought-provoking task with an equally thought-provoking result. Continue reading "What is the Protestant way to mark Lent?"2010-02-28 22:47ICANN, you can'tI am always a little shocked to hear people defend the level of control that the American government has over the Internet through its influence of ICANN, and just as shocked to hear people’s paranoid speculation that having America’s role transferred to a UN body would somehow lead to massive censorship and spying taking place, as if that’s never been possible in America, and as if UN technical bodies have any history of doing that. It is understandable when people fall into the logical fallacy of argumentum ad ignorantiam, with an “if it ain’t broke don’t fix it” attitude, but even if we don’t know what a future UN solution might look like, we do know what America’s record of managing ICANN is, and it is not something about which you can say “it ain’t broke”. A friend of mine said that it was too stressful talking about these complicated technical and political matters early in the morning while I was driving us to catch a train, but hopefully none of my readers will be browsing my blog in that sort of situation. Anyway, below I will list some past actions of ICANN that are causes for concern, and explain why they were the result of American governmental influence. Continue reading "ICANN, you can't"2010-02-28 22:47
Splitting arbitrary length strings Posted by Hagfish
in Programming at
22:47
Comment (1) Trackbacks (0) Splitting arbitrary length stringsA friend of mine was apparently inspired by my solution to the problem of finding the first 10 digit prime number in the digits of e, and he told me about a seemingly similar problem he faced while trying to manipulate a text file he had created in a custom format. While some techniques from solving the e problem may be applicable, his data format allowed for arbitrary length strings, rather than having this 10 digit limitation, which made the problem suddenly much harder. I will detail the exact problem below, as well as listing some of the methods we used to tackle it. Continue reading "Splitting arbitrary length strings"2010-01-31 22:39How does cryptography work?A lot of my blog posts seem to be about cryptography, or at least mention issues related to it, and I am aware that this may make my posts harder to understand. I am also aware that there do not appear to be any helpful introductions to cryptography out there, or rather none which is accessible to the non-expert but still gives a sense of the underlying mathematics. In my mind I have often imagined that I could write such an introduction, and recently I have been motivated to do so after discussion with a school-age relative who said “Cryptography sounds really interesting”. She may not think that way after she’s read all this, but I hope to at least convince myself that a relatively concise explanation of cryptography, from the ground up, is possible. As cryptography is a rather large field, though, I will only cover RSA public key cryptography. Continue reading "How does cryptography work?"2010-01-31 22:39
known_hosts and key fingerprints Posted by Hagfish
in Programming at
22:39
Comments (0) Trackbacks (0) known_hosts and key fingerprintsIf you have used SSH at all, you are likely to have bumped into a warning message when accessing a new host for the first time. This is because unlike with HTTPS, there is no central list of which public keys belong to which hosts (or rather, which entities should be trusted to make those connections). For example, if you access www.google.com over HTTPS in a browser, then your browser does the equivalent of downloading a public key from that host, and a certificate saying that this really is Google’s public key. This certificate itself has to be checked cryptographically, but it will have been created by one of the few central trusted points for handing out certificates, and your browser will be pre-loaded with a list of these trusted points. As SSH clients don’t tend to have pre-loaded lists like this, you are left to make the judgement yourself about whether a given SSH public (host) key belongs to a given host. One way to do this is by comparing the key’s fingerprint (which is presented in the warning message) with another copy of that fingerprint retrieved over a different medium, preferably a trusted one, such as in person. To give someone the information needed to check these fingerprint warnings, you might think of sending them a known_hosts file, which contains a list of hosts and cryptographic data about their public keys, but unfortunately this cryptographic data isn’t stored in the same format as fingerprints. Where there’s a will, there’s a script, though, and so I detail below what can be done. Continue reading "known_hosts and key fingerprints"2009-12-17 16:26The Mininova verdictHaving previously discussed the verdict in the case brought against The Pirate Bay, perhaps I should not get distracted by other similar court cases, as this blog is not a running commentary on file sharing news. However, there is an important issue which I mentioned last time about where the courts will draw the line between Google and The Pirate Bay, and whether that line can stop a significant amount of copyright infringement without stopping a significant amount of legal online activity. The BREIN vs. Mininova case provides another interesting data point, testing the legal waters (despite the case being heard in a slightly different jurisdiction) which might inform other websites how they should operate to remain legal. I actually think that although the cases, and their verdicts, were similar, the Mininova case involved fewer dubious legal steps from the judge, but perhaps that’s because I have only read a Google translation of the verdict. In any case, I detail below my understanding of the trial and its consequences for operators of websites. Continue reading "The Mininova verdict"2009-12-17 16:26
A one-liner for finding spelling ... Posted by Hagfish
in Programming at
16:26
Comments (0) Trackbacks (0) A one-liner for finding spelling mistakes in codeI do a lot of programming, and I like writing one-liners to help me with things, so it’s perhaps not surprising that I’ve ended up writing a one-liner to help me with my programming. I should point out that the initial motivation to write this one-liner was not that I made any mistakes in the code I wrote, rather it was someone else’s code I was looking at which needed correction, but it would be hubris to assume I’m never going to make any mistakes myself, so I’m sure this script will be useful for my own code. Of course, nowadays editors will at least spell check the comments in your code for you, but it is also good to make sure your variable names don’t contain misspelled words, as that makes it harder for people (who know the correct spelling) to collaborate with you. This one-liner is rather crude and does produce a lot of noise in the output, but it is also interesting from a technical point of view, so I will discuss below how I came up with it and how it works. Continue reading "A one-liner for finding spelling mistakes in code"2009-11-30 22:4810 Years On - A British Straw Man Without the European UnionImagine you want to criticise a political institution but it’s too difficult to find any examples of bad things that institution is responsible for. One thing you might do, if you were intellectually dishonest, is imagine a make-believe future where that institution does all the things you are afraid it might do, and then imagine terrible outcomes caused by these actions. If you are not limited by reality, it can be very easy to construct nightmare scenarios that everyone can agree would be bad, and you can pin the blame on anyone or anything you like in your scenario. If you don’t like being disagreed with then this method of arguing has the added advantage that it is impossible to rebut, as your opponent would have to state what is really going to happen in the future. I am not the first person to realise that it is unfair to argue against a position using an imaginary future, in fact this has a name: the straw man fallacy. Unfortunately no one has told the TaxPayers’ Alliance this, or if someone did, they didn’t listen. Instead, the TPA have produced a series of “arguments” against the EU based on a future, fictional EU and how bad it is, and a future, fictional UK that leaves the EU and how good it is. I normally like to deal in facts, but it’s difficult to argue directly against a straw man with facts, so I thought I’d present an opposing straw man, with my own view of what the EU, and the UK outside of it, could look like in the future. Continue reading "10 Years On - A British Straw Man Without the European Union" |
QuicksearchCategoriesSyndicate This BlogBlog Administration |