Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Wednesday, 25 May 2011

Soda: a document editor

Hello! I’ve been working on a thing! It’s called Soda, and it’s a document editor. It’s sort of like Google Docs, only a bit simpler and, well, different. The most important difference is the way you create documents: rather than do it visually, you write them in a sort of code.

Now I realise this doesn’t sound terribly brilliant, but there’s a reason for it. When you type stuff using a WYSIWYG editor, it’s often difficult to maintain consistent formatting across a complex document. The ideal way to do it is to use some sort of style system – Word 2007 has those nice big style buttons if you have enough screen space, while LibreOffice has a handy Styles pallete/list thing.

However, neither of them really encourage the user to make use of these facilities, which I think is a shame, albeit understandable from a historical perspective. The ‘apply formatting to a selection of characters’ style of editing was laid down in The Beginning, and it’s probably far too late to do anything about it now. Still, I made Soda anyway, because it’s something I want to use (I wrote this blog post with it).

Anyway, the idea is you use various ‘control characters’ to apply semantic styling to blocks of text. For example, rather than say “make this text bold, size 22 and centred”, you instead say “make this text a level 1 heading”. In other words, you apply meaning to sections of text, and then you can control how all text with that meaning appears throughout the document (well, you can’t control it yet, as I’ve not actually implemented a style editing interface, but there is going to be one).

Caveat Emptor

Soda is not finished. It probably never will be, completely – there’ll always be something to add or something to fix. In its current state it’s quite usable, and I’ve tried to make sure the main part of it, the editor, has no glaring bugs.

That said, there’s still plenty to do before I’d be comfortable with declaring it fit for general use. Here are some things I have in mind at the moment:

  • Making registration/sign-in easier. I’ve been experimenting with OAuth login and it’s really just a question of putting the code in place, after which you’ll be able to sign in using Facebook, Twitter etc.

  • Smooth off the rough edges. At the moment, when you leave the editor with unsaved changes, there’s no warning/confirmation. Likewise for deleting documents.

  • Editor and preview preferences are not saved.

  • Needs a Markdown formatting guide.

This isn’t a comprehensive list, obviously, but these are the priority things. Like I said, none of them are really show-stopping problems, but they’re definitely obstacles which shouldn’t be there.

So yeah, if you want to poke around with it, feel free. It’d be good to get some feedback, too, as it’s hard to know what kinds of issues users may encounter when approaching it fresh.

Oh yeah and I know it’s silly, and I really do keep meaning to do something about it, but after logging in you need to click the ‘Your saved documents’ link at the top to create a new document. Once I’ve put the OAuth stuff in place, you’ll be redirected to that page after signing in or registering.

http://soda.heroku.com/

Saturday, 26 March 2011

Vim to HTML

I just discovered a feature of Vim that I'm not entirely sure is useful, but it's certainly interesting:

:TOhtml

It outputs the current file as HTML, including syntax highlighting! To see what I mean, this is the output when run on the main JavaScript file for my piXY application. Set your browser's monospace font to Consolas and what you'll see is pretty much exactly what I see in MacVim (as seen in the screenshot in the previous post).

Monday, 21 March 2011

Big Code

A big monitor can be a big productivity boost.


(click to embiggen, 647KB)

Also, Vim is so great. I've been using it for about 6 months and I'm still learning new things. Like, just the other day I found out you can do diB to delete in the current code block. My .vimrc is 129 lines long now!

Saturday, 4 December 2010

Bytes To Bytes, Bits To Bits

I haven't played World Of Warcraft since the end of August, and I'm not sure what I want to do with my account. It's paid up until the end of March 2011, so it's not like there's any urgency, but it's been on my mind somewhat lately. I've considered logging in to give away all the stuff I can, including the gold, and I've considered just cancelling the account without doing this. I've considered playing again, too, as I still read some WoW blogs and the talk of the Shattering is quite interesting. And yet, the longer I go having not played, the less find myself caring about the game; at the moment, the only things that interest me are seeing the new Azeroth from a levelling perspective, and continuing my Worldview series (oh how optimistic I was that I would cover any significant amount of the world before it got Shattered!). Honestly, the main thing preventing me making a decision on the matter is the thought of having to download the various patches released since I last played.

I have almost no interest in raiding, least of all in Icecrown Citadel. I don't care about loot – this close to Cataclysm it's all pointless anyway. The only slight interest I have is seeing how my level 80 characters (and my 77 warrior) perform with the new talent trees. I also wouldn't mind going to Ulduar again, not to defeat bosses, but to do a Worldview post (or series) there, as it really is a fantastic place.

In some respects one of the things I miss most about WoW is gone forever: the exploration and discovery. Sure, the world is changed, and sure, there are and will be new zones and dungeons to see, but the game is no longer really new and strange and exciting to me. It's like Morrowind in that respect, a game I spent countless hours playing just because it was so big and there was so much to see – misty, rain-soaked swamps, ash-blighted mountains, a strange giant mushroom town, ethereal and dangerous Daedric ruins, and best of all the creepy steampunk Dwarf ruins, with their mysterious rumbles and clangs. However, because I have experienced all of that, it is of course no longer new, so the adventure of playing though the game again is but a shadow of what it was; very little is new but what I have since forgotten, and the dated, awkward mechanics of the game-play become foremost in my attention, particularly in the long beginning when your character is weak and lacking in the array of skills you acquire by the end of the game – once you've become used to leaping over mountains and covering the length of Vvardenfell in less than a minute, going back to being weak, earth-bound and slow is quite demoralising.

In contrast to games like Morrowind, World Of Warcraft does an excellent job of making you feel at least somewhat powerful right from the start – at no point are you in danger of being killed by a lone mudcrab, and when you try to hit something, you mostly do actually hit it, rather than flail uselessly around it (assuming it's roughly your level or lower). Of course, the memories of past glories are there, and many level 80 characters have seen things a newbie wouldn't believe: setting ghouls on fire off the shoulders of dragons, watching Moonfire glittering in the dark near the Wrathgate, many of these moments preserved in time by the umbrella of Achievements. But World Of Warcraft does a much better job of drawing you in so you see past the limitations of the gameplay mechanics, and moreover, there is just more: more terrain to explore, more variety of things to kill, more weapons to wield, more people to talk to, whether real or NPC. There mere fact that it offers twelve different ways to start the game, depending on the race you choose, and ten different ways to play through the game, depending on the class you choose, is another way Blizzard improves upon the much more initially linear approach Morrowind et al take.

I feel I'm very much an Explorer type – I love seeing what's over the next hill or through the next door. Seeing new things is largely what keeps me interested in a game, and when I've seen all there is to be seen, I start to lose interest. To some extent, I'm reluctant to cancel my WoW account now, with Cataclysm so close, because there really will be, for a time, lots of new things to explore. On the other hand, there are many, many other games that can offer a more completely new experience – Dragon Age, Guild Wars 2 and LoTRO are just three that come to mind right away, and that's just in the (MMO)RPG genre.

Beyond games, there's also my programming: right now I'm still pretty much a noob in the world of web-based software development, and it's still new and exciting. More importantly, it's more directly useful to my life, as it's something I feel I could really build a career out of, as opposed to the mostly stuck-in-a-rut jobs I've had up til now. And the best part is, software development will always offer new things to discover and learn about; innovation is integral to the enterprise. Programming is important to me, and I don't want to let a 'mere game' get in the way of making something of my life.

Perhaps once I'm more settled in a software development career I'll come back to WoW, if it's even still around by then. Or, perhaps I'll ride the wave of the Next Big Thing in MMOs, exploring along with everyone else.

Tuesday, 16 November 2010

FORJing ahead

The forum is coming along rather nicely now – I recently added the functionality to store each registered user's count of how many posts they've read in each thread, and soon I'll be able to implement thread list filtering based on this or other criteria (such as 'interest').

It's actually getting close to the point where I'd feel comfortable with saying the forum is ready for limited general use, so long as the users aren't expecting something as full-featured as vBulletin or Beehive. Still, the foundations are there, and the basic structure is more or less done, I just need to add furniture and stuff now. And maybe wallpaper.

Also, what it really needs more than anything is for a lot of people to test it out, poke it and see if it falls over. As much as I test it myself, there's bound to be some things I miss. If you sign up, you don't have to use a real (or even valid, I think) e-mail address – it's effectively just a username, and there's no mechanism in place to send anything to it. I'm not even sure yet how to do that if I wanted to.

Sidetrack

While the forum is taking up most of my coding time, I've also started working on another project, ostensibly for work but with the aim of making it generally available if it turns out to be useful beyond the circumstances in which it'll initially be used. In a nutshell, it's a non-realtime messaging application that's a sort of hybrid of e-mail and IM, for the purpose of basic information requests. The main selling point, and the reason you'd use it in preference to e-mail, is that it will make tracking and reporting on such requests much simpler, and easier to collaborate on.

So, not much to say about it yet, as I'm still working out the basics of how it's all going to work, and even what it's actually going to do, but once I have something worth showing, I'll talk about it here.

GitHub

If you're of a coding bent, these two projects are on my GitHub profile.

Sunday, 31 October 2010

Ostensibly Here

ALERT: this post is about programming and stuff, so if you're not interested, best skip it! That said, I'd love it if you had a look at the new forum I'm working on and had a play. If it breaks, please let me know :D

Hello!

Gosh it's been a while, hasn't it? There's a good reason for that, however, and it does sort of involve WoW. Or rather, it involves a distinct lack of WoW: I haven't played since I broke my Windows 7 install by messing up the installation process of Ubuntu, about two months ago (I told it to put the bootloader on my external drive. Don't ask). Anyway, in lieu of WoW-playing, I have been doing something to break out of the rut of career mediocrity I've been in for years: I have been learning how to make web-based programs. That is, how to write in Javascript, Python and Ruby, how to run servers, and all (well, some) about the stuff that holds it all together.

Said the client to the server

Javascript, as it happens, is a really nice language. Apparently it gets a lot of stick for being a toy, but I feel it's more like a surprisingly versatile yet lightweight tool. The best part is, pretty much every desktop and laptop computer comes with the tools necessary to begin with Javascript: a text editor and a web browser. Of course, the real power comes when you can communicate with and store data on a server, as then you can split an application into two parts: the server-side which does all the data-retrieval, and the client-side which does all the presentation and interaction.

A common framework for developing the server-side web applications is MVC – Model, View, Controller. This is all well and good for presenting mostly static pages that the user doesn't interact with much, but when you involve Javascript on the client side more than for a few nice effects, you can start offloading a lot more of the page rendering to the client. Rather than sending fully-formed HTML from the server, you can just send the relevant data (in JSON format, ideally) and have the client set up the HTML on the fly. Until fairly recently this wasn't a practical way to do things, as browser incompatibilities and slow Javascript performance meant the DOM manipulation required just wasn't practical. However, efforts by Google, Mozilla and Opera to vastly improve their Javascript engines, combined with the emergence of Javascript frameworks like jQuery and Prototype, has resulted in a new style of developing large, complex web applications.

Enter Andy, stage left

It was into this environment that I entered more or less in ignorance. Ten years ago I'd done some programming for a while in Delphi, writing some handy little utilities like a font browser (sadly no longer available since the host it was on closed down). However, writing Windows desktop software is really quite different to writing for the web. For one thing, the applications tend to be more monolithic and closed – all compiled up into one neat .exe file. Web apps on the other hand are invariably run directly from source code, albeit often minified, and can easily pull their various parts from different servers around the web; they feel looser and more open to write.

On Javascript

Speaking of 'loose and open', that's generally how I see Javascript. It's a very easygoing language, due in large part to its loose typing. It's that and the fact that functions are first-class object that really make Javascript so nice to use. You almost never have to declare the type of a variable, and a function definition (which itself can be a variable) has a list of parameters that doesn't specify their type:

var add = function(a, b) {
    return a + b;
}

The thing about that function is that its parameters don't even have to be numbers:

var foobar = add("foo", "bar"), // foobar = "foobar"
    forty_two = add(40, 2);     // forty_two = 42

Or how about:

var arbitrary = function(a, b, func) {
    a *= 2;
    b *= 1.5;
    return func(a, b);
};

var number1 = 64,
    number2 = 99,
    number3 = arbitrary(number1, number2, add);

alert(number3);

There's just so much I could write here, about objects, closures, AJAX, jQuery and so on, but it'd get kinda boring I reckon, so I'll move one.

The future's bright

But it's Ruby-coloured, at least for me. It took a lot of prompting and hinting and suggesting, but my brother finally persuaded me to dive into all this stuff, and after a nice chat with his boss I've begun to focus my attention on Rails, pretty much just because it apparently has better (i.e. more) job prospects than the language and framework I initially chose, Python and Pylons.

Job prospects is what I need, as I'm currently working fixing computers, which, while not boring, is hardly challenging. One of the things I love about programming is solving problems, and there is an endless supply of those. There's always something new to learn, to try and understand, and maybe even eventually to teach others about.

I feel with programming I can do something more directly useful to people than just being a cog in a black box machine that takes in broken computers and spits out working ones. That's a large part of the motivation for writing my forum – I want to do something that people will use and appreciate. The idea was born of dissatisfaction with the way most existing forum software works: too many page loads, cumbersome to navigate and slow to use. Another part of the motivation, of course, is so that I have something to show to prospective employers, as it's not like I have x years of commercial programming experience. From what I've heard and read, though, I stand a good chance of getting hired based on what I know and can do, rather than how long I've been doing it.

So, here's to hoping for an improvement in my general state of affairs! Who knows, maybe one day I'll even come back and have a pop at ol' Deathwing.

Friday, 27 August 2010

/usr/bin/python

I tried, but doing Python/database/Apache things in Windows just isn't nice. All the guides for doing it are like afterthoughts to the Linux guides. Consequently, I am downloading Ubuntu. uTorrent says it'll be done in 6 minutes, but that's assuming the speed holds, which it hasn't for the previous 72.3%.

I have a Grand Scheme to make some simple blogging software as a way to learn Python, Pylons, SQL et al, possibly even moving this very blog to it. We shall see. In any event, it means I'll probably be playing WoW less as I'm lazy and rebooting back into Windows just to play will seem like an insurmountable obstacle. This is a good thing, honestly, as I need to aim higher than my current "career".

Anyway, must go, takeaway Chinese food should be ready for collection now!

Tuesday, 24 August 2010

Post Is Late

Good day! Well it is for me, as good as work days can be, which on balance is actually around average. 50% good. So, WoW then, eh? I've not stopped playing in the long time since my last post, but I've also not really had a lot I've felt like writing about. Drama happened with the guild (again), resulting in me pretty much losing interest in raiding altogether. I think I've been on one raid in the past 2 months, and that only because Zoe begged me to come and tank Patchwerk for the weekly. Tanking Patchwerk in a mostly 251-geared Blood-spec DK tank is kinda dull. Zoe did did 360 DPS on her Disc priest. I think she was the only healer, too.

And speaking of tanking! I might have mentioned in these hallow'd posts my orc warrior. He's called Sibher and he's a tank. He's also now level 77, and has been Prot spec from day one. Well, from level 10 at least, as much as a level 10 character can be said to have any spec at all with just one talent point. So warrior tanking. There's a lot more to it than DK tanking, that's for sure. Many more buttons to press, or at least that's how it feels. Definitely more dynamic, and zooming about like a bit spiky pinball of doom is great fun. I just seriously with you got Heroic Throw sooner, and not damn level 80.

I actually levelled all the way to 75 as Prot spec, and to be honest I think this is the best way to do it - you are really really hard to kill, and with DPS gear on you still do a pretty high amount of damage. Soloing elites of your own level or maybe 1 higher is often possible. Rounding up a bunch of 9 mobs and killing them all at once is routine stuff - they don't hit very hard individually, so while Shield Block is up you're more or less invincible. Unless there's more than one spellcaster in the mix, then you're stuffed. Hate spellcasters.

At level 75 I got him a Fury spec, then bought him another Bloodied Arcanite Reaper, and... well, did crap DPS to be honest. I don't really know what I'm doing wrong but other classes (hunters, warlocks and boomkins in particular) seem to do vastly more damage than me in dungeons. At 77 with full heirloom gear I can manage about 1300 DPS on a training dummy, but in instances it barely gets above 1000. I discovered that having enough Hit rating is essential, as not only do missed melee swings lower your DPS, they also generate no rage, with has an even bigger impact on your damage output.

And maybe I'm doing it wrong or something but Fury DPS is kinda... simplistic. All I seem to do is hit Whirlwind and Bloodthirst on cooldown, and Slam when it procs. Maybe Execute on a boss but they're usually dead by the time I notice their health is below 20%. Four buttons, then, none of which are spammable. I dunno, it just seems weird not to be constantly using GCDs for something. Maybe I should put Sunder Armor on my bars.

And Another Thing

I didn't play WoW at all last night. Instead, I worked on my new Project: learning how to program for the web. Specifically, Python. I didn't actually get much done, having managed to install Apache and Python, then Pylons, and I still need to get some kind of SQL going (Bob recommends PostgreSQL instead of MySQL so I'll give that a pop).

The purpose for all this is two-fold. Firstly, I need to wean myself off WoW. I am too easily tempted by distraction for it to be good for me, and I would be better off spending my time doing something with real-world benefits. Which leads into the second point: I want eventually to make this a career. I enjoy programming, having done a lot of Delphi, HTML, CSS, and lately at work some VBA (yuck), and I've dabbled a bit in Javascript. I believe web programming is going to be very important in the coming decades, so I want to make sure I'm prepared. Programming jobs are usually well-paid, so hopefully with Zoe becoming a teacher we'll have a comfortable life together :-)