Mathieu Tozer's Dev Blog

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




Dictionary Import and Export via NSKeyedArchiver

0 comments

Sweet! Now I can export dictionary objects. It was fairly
straightforward.

Funny how when doing something for the first time in Cocoa you kind
of hold your breath, and loose confidence when things go wrong, but
then when it all comes through you feel more confident about doing
the same thing again elsewhere, and you also realise how simple it
all really is!

With this newfound knowledge I should be able to import and export
dictionaries at will from Words to Words, so that users can download
dictionaries of type 'wordsdict' willy nilly from my website, or be
emailed them from friends, or whatever, and then import them into
their dictionary managers.

I just thought of a nicer interface for managing dictionaries. What
about a column for selecting the languge onb the left, with the
number of available dictionaries in brackets on the right.
English (4)
Japanese (3)

Selecting them shows the current view. Shouldn't be hard to do.

Anyway before doing that it's time for an SVN commit.



The next step I think to make it usable is to support some local
dictionaries, not just remote ones.
I should at this point Finalise the model attributes for dict
protocol dictionaries, because if I am going to start passing
dictionaries around, then I'm going to need them to work with later
versions of Words.
I will also need a way to perhaps modify a dictiionary's attributes.

It's funny the way I cross my fingers every time I commit something
to SVN, because I expect I've broken something in the process.

I'll try to set up some networked dictionaries for my future beta
testers to download, import and use. That should get things started.

One day in the future it would be nice if you could download them
from right within words!



Has words gotten to the point where I can almost say I have basic
word management working? Because then I have to move to a slightly
higher level and add in the stuff that makes that basic functionality
more usable.

Dictionary management is hard. I think that's why I'm sort of
ignoring it a bit.
But I have to have it work!

Which means thinking about how the system will add certain
dictionaries to itself when the program loads (for the first time).
Or is it better to ship words with a bundle of dictionary entities,
all neatly archived up, which are added to the user's own data
model.... this way the the sql database can still be kept in
Application support, but the available dictionaries can be added and
changed by me through the bundle.

I would have to fully specify and insert all the server and
dictionary database, set which languages it can translate to and
from, test them, paste all the needed info into the dictionary
(dictProtocolDictionary) and then put it in an archive that perhaps
the user can download.
The user could specify his own dictionary objects through the add
custom, or just download the ones I've specified and import them in.
That way, the user can abstract as a 'word's dictionary.

The dictionary files themselves objects would have to be kept in some
seperate store.

It would be nice to be able to:
Define a custom dictionary in words. EXPORT IT as a bundle.
Upload it to the net, have everyone else download it.
IMPORT the dictioanry file into their own words model

Having said that, I should be working towards building an import and
export function in words for dictionaries.

Essentially, it should be something along the lines of, for the user
(myself included!)
EXPORT
Select a dictionary in the dictionary preferences view.
Click export
choose a location for the file (filename wordsdict)
click export

IMPORT
Select import Dicitonary from the file menu
Select the wordsdict to import
click import
Give confirmation of the import
See the dictionary in the dictioanry preferences window.


More ideas re: defining words

0 comments

how about some highlighter tool that lets you select the text to be
used in quizzing? So I dump the text, and you just choose what needs
to be used by highlighting.

So the next step in usability for me is to have that freeform space
for defining words.
(which includes images)

So today's goal is to have that free form space available.

Could even use google define and wikipedia search for terms.

And I want the flow of the program to be more intuitive to 'flow'
from the search bar, as you would in a regular online dictionary.
This will help people ease into using it. So you enter a word in the
search bar, the most natural thing to do, and it tells you

"WORD not found in MANUAL GROUP or in LANGUAGE, looking up word in
ENGLISH dictionary

Add WORD to ENGLISH?

And all the user has to do is hit enter to add it to their list.

Find out how it works (dict.h) and import it into words.



Images will be displayed in the main window, and because I want to
show many images, I want to be able to cycle through them.
I would like to enable the user to show the images in a grid view, or
to cycle through them.
When images are being searched for, a progress indicator should be
shown.
Images that are not relevant should be able to be removed from the
view and thus deleted.

I propose an array, or a set, which holds images, that can be
unarchived and shown in the view.

Phew

It took a bit of fiddling around, but I seem to have the blob thing
sorted out. Turns out I was trying to put a mere mutable string in a
text view, when it needs to be an attributed string. The archiver was
dutifully saving it for me in the textblob attribute in the core data
entity for definitions.

I think I have a more usable program already!

However

Mincing steps, Mincing steps....


App Casted: Words 0.0 (VERY Beta!)

0 comments

I've made an app cast, put the sparkle frameworks in, and am now
serving Words 0.0 to a select few to try out.

I'm not ready to get too excited about it yet because the software
isn't anywhere near being done, but it's neat to think of it being
"App Casted" about the place.

Remembering that it's really nowhere near show-able to anyone, I've
released it to a few people.

Here are the release notes.

Known Issues
Grouping System
Updating of groups upon deletion is slack. Lack of GUI to predicate
setter is a barrier to usability. Ordering of the group system is
random.
Dictionary Lookup
Not recommended at the moment, behavior unpredictable! Use the
definition button to manually add definitions. That's your safest bet.
Definitions
Meaning / Definition table view is not complete, proposed system is
to have a 'fat' table view so you can see the whole dump of
dictionary text within the one cell. Comments on this please!
No Icons!
Any icon designers out there??


Roll Back to Old Groups

0 comments

After trying to refactor the groups system, I have decided to roll
back to a previous and stable version. I am spending too much time
trying to get it working again, and the benefits of doing so are
slowly dissapearing, as my original solution worked just as well as
the refactored one would.

Through this exercise I have learnt again the value of version
control, and also the lesson of not refactoring too soon on in the
development process, especially if the current solution is working
and efficient. In fact, I was refactoring simply for the engineering
simplicity of the refactored model.

So now I have to
Take some screens to show what I was attempting
Take a copy of the nib, as the UI has been changed since re-factoring
as well.
Export a copy of a previous revision of words from the repository.
Import the new export in a branch of the Words directory
Delete the export
Checkout a new working copy of the roll back.
Incorporate the new network awareness components into the new
checkout model
Continue development...

I've also learnt that working on more than one thing at a time can be
an issue because if you need to roll back past those changes, you
have trouble!

Actually I was smart in not letting that happen, by not committing
broken versions of the grouping system.

So actually all I needed to do was
Delete the crappy one
Checkout a working copy from the correct revision.
Revert to my old backup sql database that I had prudently kept
against this event.
It all ran and loaded with no problem with all my old words and
languages in there!


Groups (AGAIN YOU ASK!?)

0 comments

Bah! Silly me hadn't even put the framework I was including into my linked frameworks folder. Is compiling and linking fine now.

The best way to describe the grouping system is IFFEY.

I should redesign it so that one array controller contains all the list objects in the system.

Anyway.
My goal today is to have the dictionary lookup system working satisfactorily. It must only look up dictionary definitions or attempt to if the system can connect to the server.

I kind of need to be able to toggle the internet connection somehow, which means developing within an active internet connection.

How do I do progress indicators? How do I have something processing in the background but still have the system responsive?
Is this where multi threading can help??

Well, accumulatively I think I've spent 15 minutes refactoring the groups system, almost purely using bindings and a proper core data model, and what I spent weeks trying to achieve myself (and succeeded, mind you), I've made work in 15 minutes.

The lesson learnt here is... well... don't be too afraid or too proud to completely write off all the code you've spent a long, hard time writing (on a Greyhound bus in California), because bad code is bad code, no matter how long it took to write it.

Been thinking of new titles for myself and my web blog, which is kind of due for an update I think. I want a wordpress blog with tabs to the different sections.

An interesting mix of Model/Computer Programmer (Yeah, I know)
Model/Computer Programmer (Yeah, I know)
Mac OS X Application Engineer / Model LOL

Just what am I!?


Refactoring Groups

0 comments

Bah! Silly me hadn't even put the framework I was including into my
linked frameworks folder. Is compiling and linking fine now.

The best way to describe the grouping system is IFFEY.

I should redesign it so that one array controller contains all the
list objects in the system.

Anyway.
My goal today is to have the dictionary lookup system working
satisfactorily. It must only look up dictionary definitions or
attempt to if the system can connect to the server.

I kind of need to be able to toggle the internet connection somehow,
which means developing within an active internet connection.

How do I do progress indicators? How do I have something processing
in the background but still have the system responsive?
Is this where multi threading can help??

Well, accumulatively I think I've spent 15 minutes refactoring the
groups system, almost purely using bindings and a proper core data
model, and what I spent weeks trying to achieve myself (and
succeeded, mind you), I've made work in 15 minutes.

The lesson learnt here is... well... don't be too afraid or too proud
to completely write off all the code you've spent a long, hard time
writing (on a Greyhound bus in California), because bad code is bad
code, no matter how long it took to write it.

Been thinking of new titles for myself and my web blog, which is kind
of due for an update I think. I want a wordpress blog with tabs to
the different sections.

An interesting mix of Model/Computer Programmer (Yeah, I know)
Model/Computer Programmer (Yeah, I know)
Mac OS X Application Engineer / Model LOL

Just what am I!?


+RSS | dev blog | Portfolio

About me

My status

Last posts

  • my del.icio.us
  • my flickr