Showing posts with label lightbulb. Show all posts
Showing posts with label lightbulb. Show all posts

Friday, 2 March 2012

a backlog of lightbulb moments

Okay I admit. The title of the blog posts are usually as random as a phrase from a song I'm listening to while I write or something. Any way, I've been toiling with the idea of starting an open source project to create a download-able 'text' yoruba bible (I admit that there's probably one but I've not found it yet).

Thanks to the qbiblefree app (yes, I still use my N900 - and I'm not changing it till something better - read more hackable - comes along), I found out about Zefania XML format. So now I kinda know what format the bible would be in if I were ever to consider starting the project. The next question - were to get actual yoruba bible data from was kinda solved with a quick google search. The good people at http://www.africanportal.net/ABO/BibeliAtoka/ have uploaded pdf files containing bible books. Yes, there's still the problem of breaking it down into chapters and perhaps verses. Sejda has been a little helpful there - the books can be broken down into pages. It's not a one-to-one mapping with the chapters but it's a start. I figure I can actually use the pages as they are now with a little of meta data stored in a noSQL database or just flat files.

Then there's the really crazy part of how to type of all the pdf text through a web interface. My javascript is presentable at best. Or put another way, I program better in scala than in javascript - and you won't want to gamble your life on the quality of my scala code. Any way today something cool happened. I found this site here: http://www.jawish.org/blog/archives/314-Javascript-Thaana-Keyboard-version-3.0.html. It's basically the same problem as I'm trying to solve but for a different language. So I've spent the last two hours adding little modifications and I think it's works... almost. In fact, here's an example., there's an example text field at the end of this post that uses the modified script to allow you to type yoruba alphabets. Hopefully you can toil with it and probably even leave a comment on what you think.

I realize now that there's very little excuse for me not to go ahead with this project now - that's the scary part. I even found an example of how the keyboard interface can be designed: http://www.branah.com/dhivehi. But maybe it's time I started it anyway. I know it's time to sleep - lightbulb!

I'll upload a downloadable script with tutorials and all that. For now - use the non-yoruba letters (q, z, c, x, and v) on the keyboard for the non-english letters (Ọ, Ṣ, Ẹ) in the yoruba alphabet. The x and v are for acute and grave marks (ami) - type them before typing yoruba alphabets that require ami - hope it works :)

Monday, 30 January 2012

What a game!!!

I've been playing around, pro-actively for a change, with Qt and coding for my phone: over the holidays I created a SDA hymnal app for my phone. I don't mean to brag but the Mrs and an aunt were both jealous enough to request that I port it to work on their Symbian phones. I plan to blog about my experience learning Qt maybe once every blue moon.

Actually I'll start right now and talk about event filters. There's code out there that serves as an example of how event filters work but I strongly doubt that the availability tutorials have reached a level of verbosity that can render my own take on the topic redundant. On the N900 (hildon/maemo 5), there are a few applications that have this nifty search functionality where once you slide open the keyboard and start typing the application starts to search for what you are typing. I wanted that functionality on the aforementioned hymnal. For this to work I first attempted to override the keyPressEvent method of the main window but found out that the QListView on the main window actually was stopping the key press event from getting to the main window. To handle scenarios like this on possible solution is to use event filters implemented by two functions - installEventFilter and eventFilter - that together allow a widget to pass responsibility for handling events to some other widget.

So with the QListView example above, let's assume the instance of the QListView is called listView and the instance of the QMainWindow on which the listView is displayed is called mainWindow. Then to redirect listView's events to mainWindow you have to call listView.installEventFilter(mainWindow). A way of understanding the installEventFilter function is that you've installed a siphon in the process by which listView usually handles it's events so that listView's events now slip out of its hands into mainWindow's. You then have to get mainWindow to handle the events that come its way from listView - this is where eventFilter method comes in. You have to override mainWindow's eventFilter method such that you do any event specific checks and target object checks.


I've included the code portion based on the example in the documentation here for for the fun of it. Now this is not my code o. I copied it almost verbatim from the Qt documentation but added some comments that may be useful if you read the epistle leading up to this paragraph

//within MainWindow's constructor set up the siphon filter
listView->installEventFilter(this); 

//then you override the eventFilter method
bool MainWindow::eventFilter(QObject *object, QEvent *event)
 {
     if (object == target && event->type() == QEvent::KeyPress) {
         QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
         if (keyEvent->key() == Qt::Key_Tab) {
             // Special tab handling
             return true;
         } else
             return false;
     }
     return false;
 }



Now that you've read this you can now go on and read the Qt documentation here (http://developer.qt.nokia.com/doc/qt-4.8/eventsandfilters.html#event-filters) for actual code.

Friday, 6 August 2010

so long heartbreak...

It's totally unfair that I don't have access to all that cool stuff on the Dr. Who site just because my ip address places me outside some particular geographical region. Is it not enough that the TV networks this part of the globe are usually a whole season behind? Do they have to rub it in by denying me my God given access to some 'free' content?

Life's unfair, blah blah blah. In any case, and turning to more important things, I've made up my mind to burn up some bridges - or cross some personal milestones. Here's a quick list:

That site I've been working on for the larger part of the last year has to be number one on the list. Ok, so I was learning scala and liftweb and jquery and ... (yeah that's about it), but that experiment has got to end. Time to move on - there's a new squeeze in town.

Another one is that game I've planned to write for so long. Well, it was good as dreams go but some dreams are meant to be just that - dreams! It was nice having you for a friend but ours really never was a symbiotic relationship.

Then there's the concept of debt. The very idea that I can get it now and pay for it later. Now this one's tricky. You see I own a mortgage. I don't get why people say this with pride - I own a house is understandable but I own a mortgage? In any case, I not only own a mortgage but I'm on the verge of taking up some student loans. Somethings got to give here. I don't subscribe to the some debt is good debt idea but my actions say the exact opposite. Doesn't it say in the good book that they shall not borrow but shall lend to nations. Doesn't it say the cattle on a thousand hills belong to him. It's not about becoming rich as much as its about been financially secure and independent in God. Borrowing belies that concept I think. Living paycheck to paycheck belies that concept too. Something's got to give way. I'm just not so sure what yet... Ok, I wont be getting that SD card I crave for my N900 anything soon. I'll have to remember to backup regularly. And that's not all but let's move along for now.

I'm tired of settling. Granted, I go through this phase once every 6 months or thereabout (my mum would probably say I go through it every other nite but thats not really important now). I would like to go ahead and draw up a list now of goals but I'm afraid I've become too good at that and forgotten the bit about implementation (its a naija thing I guess). There's salvation. "Change goin' come" one way or the other.

By the way, if you (don't think I don't know there are some of you out there) read last week's then let me calm your fears - all is well *wink* *wink*

I feel like I've not said anything really positive here today (note to self: make sure to not listen to Miles Davis all day at work on a friday again). I guess when you realize that you need to change something positive has already started. Like one of my favorite authors loved to say it's the Holy Spirit that prompts us, each, to recognize our sinfulness. And Christ gives life more abundantly. He says if you drink of the water He gives you'll never taste again - I'll never thirst again. Last sabbath, after sabbath school I just sat there and kept thinking why it's so hard to follow God when all I have to do is believe. That's when it hit that true believe requires surrender. I need more of your grace and spirit, God. I need to learn to surrender all.