leynos: (Default)
Learning two languages simultaneously sometimes gets one confused. The way Ruby and JavaScript treat function declarations is an interesting example:Read more... )
leynos: (Default)
I've made some UI tweaks to the demo message board at http://bbs.df12.net/ following feedback from Angus, Bruce and Scottie.

I'd still like to know what people think of the underlying idea tho. The plan is to have something as easy to set up as an instance of phpBB that will act as a server for a native clients variety of computer platforms and devices. What you see here is a client implemented in JavaScript, but that client could be ObjectiveC running on an iPhone, C++/Qt on a Linux box or .Net on Windows. I also intend to produce a simplified html interface for visually impaired users and for mobile phones.

With regards the threadmap, the rationale behind that is to try and replicate the sprawling discussions that you'd see on Usenet but never really happen on message boards. You tend to either get phpBB style linear threads where deviating from a single thread of discussion is actively discouraged, or Reddit/Slashdot style nested posts which get awkward after a small number of replies and tend to be best suited to short lived discussions.

Of course, there are still a lot of optimizations to be made. Right now there's no support for incremental thread updates, which would be crucial to my goal of 'Usenet as a web service'.

Other facets still need some hammering out. For example, post deletion—I'm thinking of having users able to mark a post as deleted (if the moderators of a particular board have that feature enabled), but only moderators will be able to delete a post or thread outright (or recursively 'prune' part of a thread). Again, I'm keen to hear what you think.
leynos: (Default)
I can't really blame Internet Explorer for being strict about JavaScript. I would too. Firefox on the other hand seems amazingly lax about malformed script. I'm actually going to side with Microsoft here. A run of JSLint (handy command line version: http://whereisandy.com/code/jslint/) on main.js reveals a slew of embarrassing errors—missing semicolons, reserved words used as hash keys, etc. IE is now happy with it.

The BBCode parser I borrowed required similar treatment. I may well return this to its author with the applied tweaks once I have also written some tests for it (an excuse to learn a JavaScript unit test framework).

On the other hand, I can't really forgive IE8's insulting mangling of CSS. It's fixed now. But srsly, what in Zod's name is this all about:

<meta http-equiv="X-UA-Compatible" content="IE=edge">?

(From HTML5 Boilerplate)

I'm told that it still doesn't work in IE9, and I despair.

On the gripping hand, the demo version of my site is now up at: http://bbs.df12.net/ hosted on my funky new cheap as chips VPS. (I can't even begin to pretend that I can afford Heroku's cheapest paid hosting).

And you can now create threads! (Tho if you created an account before, you'll need to re-register as this is a different database).
leynos: (Default)
I've done a little bit more work on my client/server web forum, and I'd like to hear your thoughts.

A copy is running online at: http://stark-sunrise-626.heroku.com/

You can see the source code at: https://github.com/leynos/converse

If you can trivially break it, please let me know.

What is it

The idea is to ultimately build a web forum with proper separation of concerns between the client and server. The initial implementation uses a client written in Javascript and a server in Ruby, but any conceivable combination should be possible (a native client for Android and iOS would seem the next logical step). The two talk using a pseudo-RESTful API (pseudo, because it uses JSON instead of XML).

Right now, all that works is a single thread view. The top pane is the thread map and the bottom pane is the messages. Ultimately, there will be multiple boards with multiple posts, but this is the prototype as it exists just now.

Some bits you may (or may not) care about

The server is written in Ruby using Sinatra, with a CouchDB database. All of these elements are new to me, so I'm learning this as I go along. Similarly, I'm a novice at JavaScript in many ways.

The thread map is drawn using the cross-browser Raphael library, so it should work in IE as well (it did last time I tested it).
leynos: (Default)
I've been in the process over the past few months (very sporadically, I might add) of writing a project planning tool. It still doesn't do much yet, but it's at the stage now where it will produce a simple functional Gantt chart (with an NSDate based model and view). (There are also some ugly drawing glitches).

I'm initially targeting Linux (using GNUstep), but ultimately, I aim to maintain versions for Windows and Mac as well.

You can download the source from http://bitbucket.org/leynos/gantt.app

Anyway, I'm kind of looking for some input as to where I should take this application. I have some ideas, but I'm not really sure which to give priority.

Firstly, I guess, would such a tool be of use to anyone?

I want to create something that makes time allocation easy and something people can do without thinking about too much.

If you don't use a project management tool for planning your projects at present, what is it about current PM tools that you find gets in the way or makes them unsuitable?

Stuff I hope to include would be resources (with address book integration), deadlines, dependencies, estimates and actuals, burndowns, kanban, sprints (however those might be represented),
weighting and chronological notes.

I'd also like to eventually include client/server based collaboration and plugin based integration with various issue tracking systems. This all sounds a bit ambitious just now, but you've got to start somewhere.

Anyway, looking forward to hearing your thoughts on this.
leynos: (Default)
Right, I've seen too many Makefile tutorials that were clearly written by people who have been smoking copious amounts of skunk, so I'm going to post this in the hope that it will make life easier for anyone else writing a small C or C++ project.

It works with GNU make, but I'm sure most BSD people will already have their shit together anyway. Strangely, most of this came from the pmake FAQ, specifically, this chapter.

Here goes:

CFLAGS          = -Wall -I/usr/local/include
CPPFLAGS        =
LIBS            = -lfoo -L/usr/local/lib

PROGRAM         = myapp
OBJS            = main.o bar.o baz.o qux.o etc.o

$(PROGRAM)      : $(OBJS) 
    $(CXX) $(OBJS) $(CXXFLAGS) $(LIBS) -o $(PROGRAM)

include Dependencies.mk

Dependencies.mk :
        $(CXX) -MM *.cpp > Dependencies.mk

.PHONY          : clean
clean           :
    rm -f $(PROGRAM) *.o

Anything in bold and italic means "your stuff goes here", so your executable name goes under "PROGRAM" and the names of your object files go under "OBJ", corresponding to the names of your object source files.

Stuff in "CFLAGS" applies to C source only, "CXXFLAGS" applies to C++ only and "CPPFLAGS" is for preprocessor flags.

For C source only, of course, you would use "$(CC)" instead of "$(CXX)"

I anticipate that, for the C/C++ stuff at any rate, I won't have to make any real changes to this Makefile. At least until I start having multiple source directories.

Cheers to [livejournal.com profile] brucec for corrections and [livejournal.com profile] spacelem for the suggestion of using gcc -MM.
leynos: (Default)
I've been making an attempt at learning Haskell over the past few days. It's been interesting, but I'm still more than a little sceptical. I can see the advantages to functional programming a little bit better now. The book I'm reading, Real World Haskell, is doing a better job of explaining them than any lecturer at University managed to accomplish. The problem is though, that any task that interfaces with the user requires imperative programming. Haskell has what are called "pure" and "impure" functions.

The pure functions have no side effects and are immutable. These are the bread and butter of functional programming. The stuff that does all the heavy lifting. The stuff that can be mathematically proven. Interacting with the user requires impure functions. Writing impure Haskell seems, from what I can see, to be little different from writing code in an imperative language with first class functions. (There are some distinctive features, but humour me for a minute). And in writing, for example, a task list application using GTK or Cocoa bindings for Haskell, I can see myself writing a lot of imperative code with bits of functional code here and there to do the "real" work.

Most of this is early doors yet, and there is plenty of time for further research and experience to change my mind, but here is my thought regarding this at present: Wouldn't it be better to take an imperative language, that people are comfortable working in, and adding a means of declaring functions to be "pure"? There is no reason then that these "pure" functions in this hypothetical language extension couldn't use lazy evaluation and behave largely as Haskell functions.

I'm going to keep at this for a while though. I'm aiming to write something non-trivial at some point just to see what functional programming actually brings to development of user applications. I'm still curious.

Addendum: It seems that "D" has this discussed "pure" declaration. I will have to take a closer look at D at some point.
leynos: (Default)
The problem:

I'd like a list of upcoming UK cinema releases on my palmtop. I previously accomplished this by ripping the IMDb's Recent Releases page using Plucker. While this worked, it was far from ideal. Too much unwanted flim flam y'see.

So I set about creating a replacement. In doing so, I did some coding. Yay. The first bit of programming I've done in over a year. Okay, so it was in PHP, and yeah, the code I wrote sucks the big one, but it does what I need it to do.

What it does is scrape the release info from the page, and filter out all the useless (for me) stuff, such as videos, videogames and festival releases, then present it in a form convenient to a palmtop. The page can then be ripped using Plucker or some similar tool.

Download here.

I just wrote it for myself, so the code is a mess, and it has no comments. But I'm kind of pleased I did something with this evening other than get drunk and read Slashdot. I'll maybe add individual pages for each film when I can find another free evening.


In other news, I'd forgotten the extent to which The West Wing kicks arse, having made a start on Season Four. The first two episodes raised smiles, inspired and enthralled in equal measures.

Now I need to pack for the games night at [livejournal.com profile] brucec's place tomorrow. I'll be bringing my PS2 with Virtua Tennis 2 and Street Fighter 2.


leynos: (Default)

January 2015

456 78910


RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 20th, 2017 02:05 am
Powered by Dreamwidth Studios