Mathieu Tozer's Dev Blog

Cocoa, the development of Words, and other software projects (including those dang assessment tasks).




Flickr Image Search

0 comments

Thanks to a handy API, Words now does flickr tag search nicely. It was a bit confusing at first, but the API is well designed as it is and the author has further plans to make it really great, even "Sparkle like".

If I get anything up and running myself, I might even contribute some code to it myself!


Update to Jim

0 comments

Posting this here because it's probably the most coherant bit of writing I've done for several weeks! And it explains what I'm doing at the moment, even with all the typos.
--
Jim,

Since we haven't met up for a while, I'll give you a quick overview of
where I'm at with the project. I've been working really hard on it (to
the unfortunate detriment of my other studies) and I'm really excited
about where its heading.

First, sorry for not getting back to you on both accounts re the meeting
and the objects! I have my application working now for onine Dict
protocol dictionaries, which work quite well, and I have recently added
basic support for stardict dictionaries, in a bundled format specific to
my application. One of the goals for Words is to make it dead simple for
users to download and install new dictionaries, and I'm working on a new
interface to do this. I'm having issues with syncs while multithreading I
think, although I haven't attempted to debug that part yet. I'm still not
clear on how to use xjdic (minus the x for X11 part of course) to support
the Edict format within the context of my application, but I'm still keen
to

I've also had some changes to the design of the user interface, which
changes the proposed interaction for the app, and I've thought of a new
direction in which I would like to take the networked side of things.

Following seeing this
video:http://video.google.com/videoplay?docid=-8246463980976635143 I was
insired to aggregate user's word lists and definitions, uncluding images
and sounds, into a central database, in order to construct a user
generated multi language dictionary.

Using some nifty networked, server side wizardry, the details of which I
haven't even begun to fathom, you could make some very fun, data
validating two player quiz games incorporating all the aggregated media.

This also could potentially solve the hard problem of parsing the output
of dictionary searches. Because Words can / will connect to many
different dictionaries, it would be infeasable for me to write a parser
for each one to fine tune the formatting. And who can decide on what
definition is 'main' and should be used for quizzing. I cannot see how a
computer can determine this. At the moment, I call what dictionaries spit
out a 'definitionsBlob' or just a 'blob', and the user has the option of
setting at the moment 4 'main' definitions, which will be used in
quizzing etc. When networked, Words will first query the centralised
dictionary, and if there is a match, it will set these fields for you,
based on other users' submissions on the same word.

And if there is a user community, I could create a plugin architecture
for other interested people to write the 'blob' formatter for specific
dictionaries for pretty printing.

I've also decided against the smaller, minimised view in favour of a
speech bubble which will appear above a word once it is highlighted and
invoked by a right click menu or hotkey anywhere in the system, which
will give you your definitions.

Comments / Suggestions always welcome! It would be great if you had a Mac
so you could test it ;-)

-Mathieu


Blog Lookup

0 comments

gotTheStardictBlob-1.jpg


Old Notes

0 comments

I want words to define words in a separate thread, so that it doesn't
take control of the application
But I have to carefully design how this is going to happen?
At the word level?
At the word list level?

I think atomically at the word level it would be best.

I'd imaging that it would work something like this.

Define Word(s)
Start a new (worker?) thread
Pass the words to it
For each word
Start a progress indicator
When the word has been returned
Stop the progress indicator for that word.

Might the network connection monitor actually be better in another
thread too?
But that's not what takes all the time...
The application at any time needs to have connected dictionaries.
Should each dictionary have its own thread?
Or should the one thread manage all connected dictionaries.. or
should a connected dictionary itself be passed to the thread?
Or should a connected dictionary start a new thread for each stream
of words it needs to define?

So, when you ask a dictionary to define:words, it connects (if it
can) and starts a new thread to define the words. And quits when it's
done.

This model might make it easier because I don't have to change much
of the existing code base. But is it good form for a model object to
start a thread? Seems like a controller thing to do really.
But we do want each word to be able to be defining itself atomically
and independently of everything else.
And it would be nice to say "hey, you, try and define yourself!"
which could be done around a loop for each word, and it will go away
and create a thread for itself and look up everything in the right
dictionary etc.

For each word being defined
Start a new thread
Pass the define:word method to it
Kill the thread once the defining is done.

This could have too much overhead with starting and stopping all
those threads.

I kind of need to decide for certain though how I want the system to
define things.
Obviously I want it to try to define stuff for itself, but there also
has to be some way to force it to define words through the user
interface as well.

But this is the way it WILL work, if each dictionary has it's own
thread. So it's dictionary thread centric. A new dictionary thread is
started and is fed a word object which it takes. It does the work of
defining the word, and then defines the word (if it can), and let's
us know when it's done.

So by this, the define method in the dictionary should create the
thread.

I wonder if I start a thread at the point in the code that takes a
lot of time and makes the program freeze, that it will just work. The
new threads will follow along, and return back to the main thread
when the work is done, and just proceed like normal...


Making Improvements

0 comments

I think I need to start working to a timetable, with time constraints
and everything, because if I want things to be done in time, that's
how it's going to work.

Besides, it's what happens in the real world. Well I think. I guess
in the case of even Microsoft you ship when it's ready.

I'm still not sure which language/implementation will be needed to
make the server, but again, that would be jumping the gun because I
have to have a thorough idea of what to build before I start deciding
what to build it in.

So leave that aside for the moment.

Get back to the stuff that is making Words!!

Now that I can import and export words, I feel better about killing
the sql file and changing the data model, because I (and users) have
a way of saving their words (the valuable bits) and getting on with
things. So now I can actually start using words a bit more for
recording all those funny words I hear here and there.

yaaay~

The selection of groups is now preserved!! The group you had selected
will be saved for you when you come back to it, whenever that might be.

Now I'm off to take care of my body, by running to Bells Beach


More Musings re Networked Features

0 comments

Possible inclusions into what a words attributes should be:
A generalised notes section.
Flag definition as inappropriate / incorrect.
Phonetics
Pronunciation sound byte
Terms (example usages)
Idiomacity
Misspellings, common misspellings and variant spellings
tags?? For categories??
Is submitted.

The system will have to be tested and run for a while to iron out the
bugs and discrepancies that are coded into the system.

After all, it is still meant to be a loose way of defining things.

I guess what I need to do is design this part of the system more
thoroughly from a user interface level.
I need to know what kind of data a user might want about a word.

But how many should I allow?? 5? 10? As many as there are? As many as
there are on the server side, but on the client side, they should
only see their own, and the most popular.

Anyway, I need to set up the stand alone system first, and the
networked version CAN come later.


+RSS | dev blog | Portfolio

About me

My status

Last posts

  • my del.icio.us
  • my flickr