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:2610 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"2009-11-30 22:26
Which Linux applications are named ... Posted by Hagfish
in Programming at
22:26
Comments (0) Trackbacks (0) Which Linux applications are named after dictionary words?Every now and then I find my mind gets caught on some seemingly trivial observation, and I end up following a chain of thought tangential to the one I was originally on, until I arrive at somewhere quite unexpected. Whereas people in former times may have been unable to travel too far down these intellectual rabbit holes, we now live in a world where Google and Wikipedia have made us seemingly omniscient, and hypertext in particular allows us to jump from one idea to the next, wherever our curiosity takes us. The secondary limit, I suppose, would be the ability to process all of this information that we amass while browsing the Web. As a programmer, though, there are certain options for information processing which are open to me but would not be readily available to non-programmers, and even if what I do with the processed information isn’t particularly ground-breaking, it can at least be the subject of a new blog post. As the title of this post suggests, my most recent such endeavour involved looking at Linux application names, and dictionary words, and below I explain what I found and how I found it. Continue reading "Which Linux applications are named after dictionary words?"2009-10-31 22:46Employment contracts and copyright ownershipMost professional programmers have probably found themselves considering or accepting a job where the employment contract specifies the extent to which the employee can retain ownership of the things they create. It is natural that a company would want to claim the maximum amount of ownership over what the employee creates while on “company time”, but it is also quite common for companies to claim more than this. If you are working in a “salaried” position, your company may think that they own you from the moment you sign the contract until the moment they stop paying you (and to some extent even longer). From this point of view, a company would think that any software you write, even while at home, or on the weekend, or on holiday, should belong to them. Depending on the wording, a contract can potentially lead to all sorts of strange situations, and put unreasonable burdens on the employee, but I have thought about the different problems that contracts might present and come up with some alternative wordings which could act as a compromise between the desires of companies and the freedoms of their employees. If you are an employee faced with signing a contract that you think demands too much, maybe some of the ideas below could help you get your view across or get a fairer deal. Continue reading "Employment contracts and copyright ownership"2009-10-31 22:46The future of the webThere is a lot of talk about supporting interfaces across many devices, so I did a bit of research about where the industry sees itself going over the next few years. In terms of cross-platform programming languages, the main contenders are JavaScript (used with the W3C approved languages that it integrates well with), ActionScript (used with Flash) and Java. While Java is a wonderful language, it is not suited to the client side of the modern web, and it is the web paradigm that I am really considering here, so I will discount Java from this discussion. That just leaves Flash versus Open Web technologies, which I had increasingly thought was a battle that had been decided in the Open Web’s favour, but occasionally people get the impression that Flash will be a viable technology into the foreseeable future, and that it is preferable to using Open Web technology. It is the relative position and future of these two platforms that I have investigated, and I detail my findings below. Continue reading "The future of the web"2009-09-30 21:57Creating a dummy Debian package of kdebase-workspace-libs4+5Sometimes something unusual can happen in Debian’s archive which can stop you from installing the packages you’d like. The most likely reason is that you want to install a package you shouldn’t, but Debian is about Freedom, even the Freedom to do something stupid. I found myself in a situation where I wanted to install the Ubuntu package plasma-widget-adjustableclock which depended on a package which wasn’t in Debian (kdebase-workspace-libs4+5), or rather, existed in Debian but under a different name (libkworkspace4). To make the installation possible I ended up creating a dummy package for kdebase-workspace-libs4+5 and installing that, then trying the clock package again. Here I will explain the steps I took to solve the problem, and any issues I encountered along the way. Continue reading "Creating a dummy Debian package of kdebase-workspace-libs4+5" |
QuicksearchCategoriesSyndicate This BlogBlog Administration |