Tuesday, March 04, 2014
My brain imploded the moment I tried to do something which was just far too advanced for its limited ability. It involved strange ugly creatures that lurk in the deep places of the Java programming language; exotic elaborations of inconceivably weird data sets that my mind just couldn't comprehend in their entirety. I was trying to capture input from a touchscreen in an array but the array needed to be held in another array, and the whole thing wrapped in classes which defined the methods of storing the data and then freeing memory when no longer needed. Perhaps I was tired. Perhaps I was simply trying to go too fast. I don't know. I could no longer remember the difference between implementing a class and extending a class. The web wasn't helping. My questions on an Android programming forum had gone unanswered. I was left reading example source code that was thousands of lines long and impossible to unravel. It just made me feel like the little I had accomplished in a week and a half was precisely just that: a little. At midnight last night, I pushed myself away from my desk and went to draw a cartoon for the next couple of hours whilst Dumb & Dumber playing on the box. So, as it stands, the little app I've written is almost finished. It had taken the entire weekend for me to realise that I couldn't expand it to be something more useful. One of the worst things about life as a programmer was dealing with feature creep – the excitement of clients who want their simply database to run their entire world. Now I'm programming for myself, the feature creep is worse than ever. However, I'm now trying to wrap it up and get back to blogging. There are parts of the app that need to be finished but they're the dull parts such as a settings screen and it's hard to find the enthusiasm to code them. I still need a way to export and import user data but since I'll probably be the only user, I'm not sure it's worth the trouble. I also need to spend time using this app, learn its flaws and try to work out if this is a genuinely useful tool which will do all it was intended to do: write my blog, clip my toenails, and tell me that the meaning of life is the number 42.
Posted by The Spine at 1:09 pm
Monday, February 24, 2014
I don't want to ignore the blog at the expense of the app but, over the weekend, I definitely became more serious about the work I'm doing with Android. I actually found myself adding comments to my code. It's a small thing but it tells me that I'm passed the stage where I'm not entirely sure what I'm doing. As you can see from this snippet, I'm actually writing completely new code and I need the comments to remind me what all the parts are doing. It's strange to be programming again. This project started out as an intellectual distraction. Could I really get something running on my Android tablet and could it actually do something I might find useful? I could and I think that it is. Useful to me, at least, and I'm already using it as it was intended. I'm also now at the stage where I can see the faults of my original design and I've started to rectify them. One of the problems I've tackled today was the variety of screen sizes in the devices that run Android. Every device out there seems to have a different sized screen or different pixel densities. That's a problem because I'd like my little App to work on a wide variety of devices so I need to be sure that I've built software capable of adapting to different environments. That's not as easy as it sounds, if, indeed, it sounds easy at all. It's the sort of thing that could easily leave me chewing on the business end of mental ward by the end of the week…
Posted by The Spine at 3:19 pm
Saturday, February 22, 2014
Yesterday morning I was pretty delighted by my progress and intended to make my humble app a little more functional. This morning I'm just exhausted. Yesterday was crazy ambitious even by my standards of blindly leaping into things without quite knowing what I'm doing. The problem began when I tried to implement at file open dialog box. Whoa, I hear you cry and I agree! I'm moving into the exciting stuff really quickly but I have things to do and my file open dialog box was where I left off yesterday. You know the sort of thing I'm talking about: you click 'load' and a window appears asking you to select a file. I thought it would be easy. Usually one of the easiest things to program is the file open dialog box and that's because you don't actually write software using a programming language. Well, you do but using a 'programming language' is like saying that the entirety of your speech is made up of English and it contains words and grammar which you understand. It is true that programming involves knowing that language but much of the basic functionality of any piece of software is actually created by using something called the API, which is the application programming interface. To continue the English analogy, it's like saying that a writer has lots of newspaper articles that are already written for them and which they can quote. In software terms, these are libraries of functions that provide many of the basic building blocks of the app. For example, somebody has usually created a simple-to-use building block which displays a file open dialog box. You tell the computer to go and create the dialog box and you wait for it to come back with the name the user selected. You don't actually know anything that happens – the 'new folder' option or 'sort files by name'. You simply say 'I need a file name, get one for me' and the computer's demon returns with a 'as you requested, master' and lays both the directory and file name at your feet. So, adding my file open dialog box was my next step. Except one of the very few things that Android is currently missing is a built-in file open dialog. Yesterday, after writing my enthusiastic and critically acclaimed blog update (nearly three people read it) I clearly faced a dilemma. Write my own file open dialog, find one somebody had already created, or do something else. Writing file open dialog boxes is miserable and I wasn't going to spend my day worrying about one of the ideas I had for my App which wasn't actually necessary. I decided instead that what my app needed was more whiz bang. I decided to look at the graphic functions of Android. I was hesitant at first because that's heading into games programming, which I assumed would be really difficult. However, pretty quickly, I'd created a screen and had some things flying around. By 4am this morning, I'd designed a new layout for the app, produced yet more things flying across the screen and a functioning button which makes a satisfying click noise. Today I intend to add another button, make my buttons indent when I click them, and then I want to produce more graphical magic before I then link the whole thing into a facility to interact with the wider world. For the first time, I actually think this app might have a future beyond my little world where it does something solely for my amusement and utility. I beginning to hope that others might enjoy it. In fact, I can see there being at least another ten or eleven people in the entire world who might want this app and that would be at least £5 or 6£ in my pocket if I sold if for fifty pence.
Posted by The Spine at 1:54 pm
Friday, February 21, 2014
Following the cast, the contract's reflexivity, symmetry, and transitivity requirements are met by only allowing Points to be compared with other Points, via expression p.x == x && p.y == y.Sometimes clever folk need somebody a lot less clever to put a hand on their shoulder when they get excited and ask them to rephrase that for people without a doctorate in abstract logic. Of course, the fault might well be my own. I'm a terrible student since I never attempt the examples they write in the course of these books. I always want to get to the meat of the business. I get frustrated having to read five pages about how to change the colour of text, which is the sort of thing I tend to figure out quite easily. More difficult for me was learning how to open new screens from the main screen. It was obvious in the end but it was the kind of top down structural approach to software development I really needed at the beginning. Had they said that an Android app is made up of many 'Activities' which are essentially concurrent and each declared in their own file, I might have had a better idea of what I was doing. I don't think learning things my way is necessarily bad. It forces me to have an active knowledge of real programming rather than the kind of passive knowledge you get by simply reading other people's code. I believe writing is best learnt by writing and speaking a language best learnt by speaking a language. Programming is best learnt by getting the hardware to do what you want it to do. My app might not break any records and surprise people with its originality but it will do what I want it to do and that's a better achievement than simply producing the same code as you could have downloaded from your tutor's website. At this point, my 'App' is like some kind of Texas Chainsaw hillbilly with pieces chopped from different places and stitched together. Yet it actually does what I wanted and I'm delighted it works. I only have one functioning button, a menu system which deletes the database and then restores it by reading in data from text files, and my Settings page only reports things about the database just to assure me that the database actually exists. I wasted three hours yesterday trying to figure out why my database wasn't being created only to later discover that my database existed and was fully populated with fake data but my 'checkDbExists' routine was flawed. Christ… Does anybody find this kind of rambling blog post interesting? I'm not bright enough to actually write a meaning post about Android programming but I'm too dumb to realise I should just shut up and get back to it. Today I'd like to figure out how to open a file selection dialog to import and export data. Later, I'd like to allow them to modify records and then start extending the functionality to the actually things I'll hopefully find useful.
Posted by The Spine at 1:26 pm
Tuesday, February 18, 2014
Men of the world unite! Either Ant or Dec has chopped off the top of his thumb and, oh, what a fine time it is to be a man, when the best among us has done what we all aspire to do: sing a song of manhood replete with sharp kitchen gadgets and a willful disregard for reading the instructions. But you might have already grimaced over this story and know that it was actually Ant who suffered the injury whilst using a vegetable slicer to prepare dauphinoise potatoes for Dec. I only typed 'Ant or Dec' because I can't honestly tell one receding hairline from another standing a foot to the right. In my mind, it's the high-foreheaded hydra that's one thumb down on the day and has only three thumbs remaining. It's a strange world where this story features so highly in the news. It's probably why, as I gazed over the morning papers, I wondered why I continue with this sad pretence of blogging. The truth is that had I not written a piece about 'Flappy Bird' in the past week, traffic to this blog would be at an all-time low, with today setting a chilly record. Meanwhile, The Guardian promotes Jack Monroe like she's the incarnate truth of blithe poverty; the happy-clappy survivalist and expert prepper for a country that's just about getting by on one Ryvita a day and the occasional shapeless grape we find squashed beneath our empty freezer. That's not to say I don't like Jack Monroe, her backstory, or how she's passionate about eating cheaply. It's just that she's so different to me that she constantly demonstrates how I'm doing everything wrong… So, here goes. Aim for the mainstream, David. Aim for the mainstream… How to cheaply feed a family of four with one thumb joint taken from popular TV presenter, Anthony 'Ant' McPartlin and some bloody-stained veg sliced unreasonably thin… First, take one TV presenter (£20 million a year, available at your local broadcaster), wash his thumbs, and apply one sharp blade to the top knuckle… But I have to stop this sham right there. It would be fine if I could but I just can't carry on and I'm increasingly tired of newspapers that can. It's not just The Guardian that does it, of course. They all twist stories to fit their particular narratives. The Guardian just happens to have the best free web presence and politics I don't totally object to, so I'm still drawn to reading it and feeling dismayed and utterly disappointed by the predictability of their content; how they try to link every celebrity story into a restatement of their perpetual themes of the surveillance society, poverty, gender politics… Especially gender politics… Perhaps it's just these jaded eyes but journalism seems to have become home to every third-rate academic willing to add another floor to the elaborate Babel that stretches skywards towards a feminist utopia that really isn't up there. But perhaps a tower is far too phallic, no matter how much my metaphor might droop. Let's make it a deep cave disappearing down towards some core dark truth. Yet what surprises me the most is that I've never been entirely hostile to gender studies. I never thought it a paradigm shift to realise that gender is not absolute. Gender study is very prevalent in literary theory where it has become an often repeated observation that a writer such as D.H. Lawrence had a feminine sensibility. Once you accept that kind of distinction, the rest of it follows fairly easily. Even if I never thought much of Kristeva's work (a writer who clearly hates to be understood), I've always quite liked Hélène Cixous's way of making her point.
I write this as a woman, toward women. When I say "woman," I'm speaking of woman in her inevitable struggle against conventional man; and of a universal woman subject who must bring women to their senses and to their meaning in history.If Freud could argue that we are defined by our childhoods, it seems only reasonable to conclude that the things we do, the words we choose to write, might also be influenced by our bodies, hormones, the very way we respond to the base urges of our gender. The problem is that some places aren't ready for the reconstituted male, men who agree with the broad arguments of feminism and simply wish to move on. We have to continue to play the role of the proxy bastards, out to keep women down and establish the patriarchal order. It's not a part I wish to play but I'm doomed by my place in the patriarchy. Last week's Question Time was a perfect example. Tessa Jowell was on the panel with Dr David Starkey, George Galloway and others. They were debating whether the accused should be given anonymity in rape cases and Jowell was generally against it lest it discourage more women to come forward. It was a strange argument but typical of the 'two wrongs do make a right' logic that sometimes passes for progressive thinking. Rape has been under-reported for centuries and it's only relatively recently that the law has taken the proper steps to recognise its severity. Yet should centuries of abuse, mainly by men, now justify a new kind of injustice that overlooks the rights of the individual if they just happen to be male? Even when acquitted, the accused are never cleared of the suspicion of guilt. Rape is a sentence that is handed down as soon as an allegation goes public. Does a belief in 'innocent until proved guilty' make me a typical man or simply somebody who believes in equality? Sometimes, in wanting justice to be blind, it feels like I'm not demanding the fashionable bias. To me these things seem logical but perhaps logic isn't as important playing the gender game where everything hinges on what we have between our legs. I expect articles in the papers this week explaining why Ant shouldn't be mocked for losing his thumb, how it either reveals the emergency of a new masculine identity or reinforces the old stereotypes that says that men are useless around the kitchen. Brighter folk might even tell you that Ant didn't chop off his thumb but symbolically took off the top inch of his penis. Perhaps they're right. I really haven't thought about it enough to disagree except to say if Ant was slicing vegetables with his penis, then he was asking for trouble. By now, I'm just confused. Perhaps his thumb is or really isn't his dick and I don't know my arse from my elbow. I nearly didn't blog today and tomorrow I might not even bother.
Posted by The Spine at 5:28 pm
Monday, February 17, 2014
Monday. I'm not sure what the hell I'm doing. I didn't intend to draw another of these 'Great Figures of State' cartoons, though I liked the idea of doing a series of them and I thought it would give me chance to learn new skills. I'm trying to teach myself to be less kind in my drawing. I finished this Gove cartoon last night, thought it was done, and then immediately realised this morning that I'd been too kind to the man. I've tried to rectify that as much as I can but the result is still too kind.
Posted by The Spine at 1:52 pm