Tuesday, July 19, 2011

N950 Arrival and My Development Plans

A couple of weeks ago I was notified by Quim Gil that I was selected for the MeeGo Community Developer Device Program for a Nokia N950 devkit.  Prior to this I had been quiet in Maemo-land for a little bit while I worked on an experimental rewrite of one of my applications that uses PyGame.  Seeing as PyGame isn't on the N950 I hurried up in getting it to a state I could put aside and moved on to learning QML.

The excitement increased as I saw the box personalized with my name regardless of that personalization just being a piece of tape
MeeGo Development

My development plans have changed (and frustration increased) over time as the MeeGo development story has gotten refined.  This is due to both changes in the UI toolkit availability and rules for distribution of applications.

Originally when things shifted to Qt I chose QWidget because it was ready now, includes widgets, and was recommended by Nokia (you know, the people who own Qt) for the types of apps I write (which recommendation was removed on June 22, 2011).  At MeeGo Conference I found out that some (most? all?) MeeGo instances are not including QWdget themes (which without a theme its basically dead).  QWidget in Qt5 will be optional and will probably not be included on those same MeeGo instances that currently don't ship a theme.  So there goes that work.

I am still a bit frustrated with QML in that there is not even a subset of common QML Components between platforms though some disagree on it being a problem.  I've just seen really terrible QML applications which mostly stem from everyone reinventing the same bugs when writing widgets from scratch.  I also find it a wonderful experience having the widgets available for the desktop such that I can write apps in a desktop environment that are targeted for small screens without the need for any pesky IDEs and emulation.  When it comes to testing, I am much more efficient testing and debugging natively on the desktop and just need to spot check how it translates to my devices.

I do not look forward to packaging for generic MeeGo.  I found out at MeeGo conference that dependency management isn't guaranteed to be included and one has to include in their package any dependencies outside of core MeeGo.  This is fine for compiled applications, you just pull in static libs.  This is not as simple for Python developers where part of the beauty is your program isn't compiled and any compiled extensions are distributed and maintained separately.  I have contemplated some tools to simplify this (based on cx-freeze and Hatchet) but that is a good amount of work and focused away from what makes all of this fun.

At MeeGo conference I raised my concern for packaging Python applications during the apps.meego.com lunch time BoF.  The impression I got then (no clue if things have changed) is that they will focus on MeeGo compliant apps at first and might later support others.  Even with that concession this is a stark contrast to the original vision that helped bring me on board from Maemo about (what was then called) Surrounds which would serve both as an app repo and as a place for third-party dependencies.  If I chose to not bundle all of my libraries then I also am not available for any of the other distribution channels (and any contests they might be running).  I don't program for the reward of the contests but it isn't fun feeling excluded.

The beauty of developing for Maemo was it had very low friction in the development story thanks to Python that I was able to spend more time focusing on what was fun: designing software for end-users to enjoy.  I feel that this is being lost in MeeGo.

MeeGo and Nokia

The picture can be better when focusing on a individual vendors.  Vendors may keep things a bit more lax with their distribution channels.  The problem is then you are customizing per vendor which requires device availability for testing and a lot more work.  That vendor has to be worth it.

Nokia is worth it (even without the DDP).  Nokia actually shipped a great device previously (N900 running Maemo5) and is committed to shipping the N9.  That is a lot more than other vendors can say.  On top of that Nokia offers a great experience with the software and hardware.  So as a user, Nokia is worth it.  What about as a developer?  Nokia has Qt Quick Components to provide reusable QML widgets.  They also will support dependencies and have Python/PySide available in their store.

The Way Forward

For my initial ports I will continue to focus on what keeps this fun, writing apps for end-users despite any downsides of being vendor specific.  After that I will bite the bullet of making my applications MeeGo compliant to make them available for a wider audience.
The default date.  It's good to see somebody at Nokia has a sense of humor

I have work to do on all of my applications but I will be focus on the ones that still use GTK first, especially since they are fairly simple.   I am using QuickNote as my playground for learning QML.  Expect further posts regarding progress updates and lessons learned regarding QML and MeeGo 1.2 Haramattan.

Google CR-48

Today I was asked my opinion on my CR-48 ChromeOS netbook to help with a purchasing decision for a Chromebook.  I thought I'd share my thoughts of having used it for the last 6 months.

I have a plethora of devices including most of the Maemo family (just missing the n800), some netbooks I got free through various (legal) means, and my desktop.

Whenever I am out and am needing something bigger than a handheld, I rarely choose something other than my CR-48.  This is because most of what I use are the various Google web apps and I can limp along on other use cases that don't fit in as well.  As an example, my CR-48 leaves the house once a week for my church meetings to assist me in my current responsibilities which is facilitating administrative matters so our congregational leaders get to focus more on assisting people.  An example of when I might chose another device is when I travel to various Maemo/MeeGo events where I'd want something that is a bit more prepared for python development.

The other main use of my CR-48 is what I'll refer to as opportunistic internet usage.  What I am referring to is the reduction in friction when having the thoughts "Oh, I'd like to look up ..." or "I should record ... so I don't forget" enough that you will act upon that thought more often.  This is when I am sitting about the apartment (or out and about) and my phone isn't quite enough to satisfy my need.  This is something harder to quantify when doing comparisons so it is usually not even thought of.  A tablet could also serve this purpose well except they are pricier and don't have a physical keyboard.

With any netbook you have to be honest with yourself about the reduced functionality due to their design, it is just more so the case for the CR-48 as you only have access to a web browser.  This can have some benefits though.  I remember an observation made to me back in the days of PalmOS.  My father preferred PalmOS because it wasn't imitating the desktop.  Why is that good?  When the imitation is too close you are more likely to get frustrated at the gaps when you come across them, sort of an uncanny valley of features.

So what devices should someone have?  It depends on your use case.  I've generally been a person who has preferred a cheap portable with the work horse being their desktop.  This has the benefit of being less paranoid about the portable device and making it easier to replace it when needed combined with the cost savings of a desktops (especially when you go 6 years without replacing them).  It is hard to say what I would get myself when left to my own devices (pun intended) since so many of my devices have been free.

ps If you are reading this and dream of robbing me, look further at the specs, release dates, and niche role of the various devices I listed.  It won't be worth it.

Friday, July 01, 2011

Google+

I still don't have too many people on Google+ but I thought I'd record my thoughts

Circles

I love them.  Some people are a bit confused about them and consider it a privacy risk that people can add you without your permission.  FB has the same problem but doesn't do a good job of telling you.  In FB if you send a friend request and it is never accepted/rejected then your feed will display any public updates from that person.  Google makes this explicit and emphasizes the benefit of it by having a "following" circle by default.  I think it is a much better and simpler model than "friending" products and people or "liking" their Page.

I'm still playing with what I want in circles.  Too granular of circles means you have a lot more to manage for each post.  Right now I am looking at "family", "friends", "acquaintances", "local", and "professional"


For cleaning up my circles over time, I'd appreciate a mass-edit mode where everyone is a row in a table and the columns are the circles they are in.  Bonus points for Google also showing who has not added me back and who I've not added back.

Posting

I like that when commenting on posts you can see what the visibility is of that thread.

Sometimes privacy on my posts isn't a big deal, like talking about programming for MeeGo.  It'd be nice if you could use your circles not just to restrict communication but say "these people will actually care but allow it to be discoverable for people I'm not connected to yet".

Another variant of that global-sharing-with-focused-audience use case is my use case for Twitter.  I originally joined twitter so I could track MeeGo Conference hashtag and know what else was going on around me while in attendance.  A Similar use case that a friend pointed out is tracking live news for things like the Texas legislative session.  I don't think I've seen a G+ equivalent system to hash tags but it will be hard for it to compete with Twitter without it.


Notifications

This is one of the killer features, being able to check on my notifications within GMail.

Feedback

It is nice that it is so easy to find how to provide feedback to Google on Google+.  It is also a really slick tool.  I've already sent them several items for improvement.  I hope they roll this out to their other services.

Integration with other Google products

Currently there is some integration with Buzz and Picasa Web though I am unsure of what Buzz's role is now and am thinking of disabling it.

I am looking forward to this being improved.  Good Google Calendar integration is a must for being a FB replacement.  Blogger shouldn't be too hard to also tie in.  I'd like them to solve the GMail / Google Reader integration issue but not too sure how they'll pull that off.

Contacts integration is actually where users will probably see the greatest troubles.  This is due to trying to bolt together different services that don't always have their data coordinated.  Users have unmerged GMail contacts, contacts creating G+ accounts with different email addresses than what are in my contact book, and the various tags I have from people.  It'll be a mess even with Google's help to try to match up all of these representations of people.

Back to Picasa Web.  I figured I should go back and update my tagging of people in my pictures.  Sadly I can't find the really helpful mass-tag tool that lets you look through all the faces it found and tag them.

Google Takeout

One of the reasons I am loyal to Google products (besides reducing the number of accounts I need) is the ability to leave and this is no different.

Final Thoughts

As I said, Google will need to improve their service integration and slowly ramp up their algorithms taking care of things for me.

Reaching critical mass will be a challenge.  Some might compare this with the migration from MySpace but this is even harder seeing as there are even more users with more history in the service to leave behind.  Maybe that is a good thing, to have a fresh start, but there are some connections that might not transition over that I would miss.

A question for me: where do I post things?  Facebook, Twitter, or G+?

Monday, June 06, 2011

Extrapolating

I give at the office, blood that is.  The organization that does it recently gave me access to my vitals through their website.  I finally took a look and a coworker made a startling realization.

I wonder if our cafeteria at work will start serving brains by 2012.  I bet Sodexo will charge an arm and a leg for it though.

Saturday, May 28, 2011

Meego Conference First Impressions

I am grateful for the opportunity to have gone to MeeGo Conference this week.

As has been discussed, the keynote was a let down. I very much appreciate Jaffa's analysis of the keynote.  The only thing I have to add is that there were rumors that the keynote was reworked at the last minute for various reasons and if this is the case we should be somewhat understanding, it is difficult pulling off a change like that.

So what were my favorite things about MeeGo Conference?

First, spending time with various members of the Maemo and MeeGo communities.  It was a lot of fun spending time together whether in sessions, meals, trips around town, or playing werewolf together.  It was great to see GeneralAntilles, Jaffa, Qole, sjgadsby, fiferboy, texrat, timsamoff, wazd, and many more.

My second favorite aspect of the conference was the collaboration.  I caught word of an apps.meego.com QA lunch BoF which was good as I don't remember if there were any other community app developers at the table to provide input from that perspective.  It was great to see the collaboration between geekygirldawn, xfade, lbt, bergie, and others.

The main problems I see with where we are at with maemo.org extras is (1) the monotonically increasing version numbers between repos, causing pain if you have a "1.3" in extras-testing but need to push through a "1.2.1" due to say Google changing an API making the app in extras completely worthless, (2) the friction in the workflow for providing both testing and user feedback, (3) noise in extras-testing due to lack of cleanup, and (4) use of extras-devel rather than a PPA.  (3) and (4) are resolved, so hopefully we also get (1) and (2).

Another aspect to the collaboration that I participated in was thp's Python presentation.  During the Q&A we had a bit of a discussion on viability for Python for various instances of Meego.  I'll cover this more in another post.

The final part to collaboration which I got to observe was thp et al taking the loaner Exo PC's and creating a multi-touch pong game.

The third and final of my favorite parts of the conference was the sessions.

Arjan Van De Ven's presentation was the best I saw due to his passion, his call to action, and audience (particularly Jaffa) raising issues with the internal communication within Intel being at friction with keeping MeeGo open.  A couple months ago he announced replacing several pieces of key software with other variants.  People took issue with no previous open discussion, few if any bug reports regarding Intel's complaints, possible NIH syndrome, and how much of this was spite towards Nokia for the switch.  Some interesting tidbits from what little I caught of that flame war were that some of the software being reverted to (evolution) has the same problems as what it is replacing (tracker) and the suggestion that software shouldn't be accepted until it is ready being at odds with the call to use innovative technologies.  Add on top of that last one the risk of "ready software" being more likely to be announced through unilateral big-reveals, shunning the in-the-open from-the-beginning software (here is looking at you MeeGo QML Components which I'll discuss more in a follow up post).  The main disappointment were a couple of potshots made at Nokia during the discussion.

I do understand that there is a conflict between always-innovative/always-beta software and getting quality releases out now using tried and true software.  I think the main thing people take issue with is how this was done and how much more this will be done with Nokia taking a backseat role.

The presentations on the future of Qt were also great even if they did raise my eyebrows on a few points (again, in a follow up post).  I got to see the Qt5 plans, Lighthouse, and QtQuick 2 presentations.  Unfortunately it wasn't until after-the-fact that I found out I should have also gone to MeeGo UX Components presentation (again, that promised follow up post).

As I've previously mentioned, thp's Python presentation was great.  I also expect wazd's presentation to be good but forgot to go (and he even used some of my programs, shame on me).  I also have to say I was impressed with hopbeat's use of Prezi and would wish to never see a traditional power point again.

Despite the let downs, MeeGo Conference was great.  It was also good to get some time dedicated to programming and to see more of San Francisco compared to my last visit (I was a lot less lost thanks to a real GPS).

Thursday, May 19, 2011

The Marriage Discussion

I was reading a friend's blogpost and my response got a bit long (and now  there isanother post so I guess I also take too long to write also), so here we go.

As was pointed out in the comments, Elder Oaks did also speak on the subject and did mention the sisters.  The proportions spent on each topic though is telling.

I think we tend to simplify this subject a bit too much.  Many guys could probably claim the following paragraph from the post would apply to them:
"I have so many girlfriends who wrack their brains about what they are doing that's keeping them from getting married. They wonder what's wrong with them and what they should be doing differently. They think that perhaps there's something else for them to learn before they get married. It's absolutely ridiculous! And though they mean well, some friends and family members don't help at all. They will often say things like, "You should act like this, or you should wear that." They go on and on about how men are stupid, and women need to practically bend over backward and be the aggressor to get men to see what they need to do. Essentially, they are making excuses for men and telling women to do all the work."
Well, except the last two sentences.

Some of the factors I can think of include (which some can apply to both genders)
  • No desire.  Maybe it is a sampling bias but despite this one getting a lot of complaints this doesn't apply to most guys I've met.
  • Desire but not priority  Sometimes we don't realize that we treat things with a lower priority those things we actually really want.  A lowered priority can be for obviously selfish reasons as "still wanting to have fun" or others like education and career.
  • Asking a person on a date being read into too much.  As President Hollingsworth pointed out, 10 years ago he was struggling to get people to go on second and third dates without them reading into things, now the problem is going on first dates without them being read into.
  • The 20s being the new teenage years.  This is especially the case with guys that are meandering through life rather than working to establish themselves in a career but face women around them that have or are working towards higher degrees.  Notice that I said "not working to establish" rather than "not established".  A guy actively working to establish his career whether through getting an education or growing in one's field is fine and should hold his head up.  This is also a problem spiritually.  If someone has been working to purify their desires, to fulfill the commandments, and serve those around them would they want to risk regressing through the negative influence  of someone who has not been developing themselves spiritually?
  • Trying really hard but not realizing they are doing it wrong.    One example: we've seen the times when a new cute girl or guy moves into a ward and everyone of the opposite gender surrounds that person and obsesses and fights over them for the next 4 months or so.  This is made more ridiculous by the fact that the attraction is skin deep and the person doesn't really seem to match them in their personality.  Sometimes it is helpful to take a step back and stop being so aggressive over being married to explore what you want and don't want through dating a variety of people and developing friendships that can blossom into a relationship.
  • And then there are the guys that girls ignore, turn down, or are even mean to.  This can because they aren't familiar with these guys, they are socially awkward, they are different but in a good way, different in a bad way, etc.  Hopefully if it is a bad way the guy recognizes this and is trying to improve but the way to improve is to be with people but others are so myopically focused on marriage they don't practice charity towards these people but see them as a waste of time on their path to marriage.
Those last two points mentioned the marriage/dating myopia and that is a topic of its own.  Sometimes it seems people's obsession over marriage is making them less ready for marriage.  I hear people talk about needing to have Christ in one's marriage and the need for selflessness.  People tend to be too focused on what they get out of a situation, who they'll get to flirt with, etc that they lose the opportunities to grow.

One example is to not be early or even being late to church.  A person then loses out on the opportunity to meditate on the atonement and the sacrament.  If they hold the priesthood they also lose out on helping prepare, bless, or pass the sacrament.  One reason people might do this is so that they can chose who they sit by and maximize time during meetings to be with them.

Another example is to just look at the amount of service offered to who, especially between two people that have needs.  Sometimes we neglect those who need it most because we get nothing out of it.  Granted there are other factors like how much the person needing service seeks help but we should be a lot more observant about these things.

Pressure to get married can be good and help push people past their hang ups with selfishness and help them take a risk but I also worry that continued pressure over the years and a social/spiritual environment that focuses mostly on socializing as a means for encouraging marriage to the detriment of service, sacrifice, etc exacerbates the marriage myopia.

I dislike not really having a purpose or conclusion to be building to so sorry for the jumble of not-fully-thought-out thoughts.

Friday, May 06, 2011

Forgiving Self and Others

Several months ago I was asked to speak during the main services of my Church.  In software development Bjarne Stroustrup stated "Starting a major project 'completely from scratch' can be exhilarating.  However, often more accurate description is 'intoxicating' and the result is a drunkard's walk through the design alternatives".  I tend to agree with that and is a something I would like to improve on.  Similar to the challenge of starting new software projects from scratch is to chose one of a myriad of topics related to the Gospel and Jesus Christ and narrowing down a focus in that topic.  So I kindly asked for a topic and was given "Forgiving Self and Others".

Someone had asked for some of material I used in my comments and I decided to go ahead and turn what I said into a post on the subject (and not just a transcript).

President Spencer W. Kimball described forgiveness as “purging of our feelings and thoughts and bitternesses” (Miracle of Forgiveness Ch 18).  I believe these feelings that we need to purge are an impediment to our living the two great commandments.  How can we "love the Lord our God" if we deny the efficacy of the atonement in the lives of ourself and others, rejecting that great sacrifice that the Christ made for us?  How can we "love thy neighbor as thyself" if we don't love ourself, if we can't forgive ourself?  How can we love our neighbor if bear a grudge against our neighbor?

Forgiving Self

I contemplated reasons we might not forgive ourself.  The ones I was able to come up with include
  • Incomplete Repentance
  • Needing increased faith and trust that we can be forgiven by Christ through the Atonement
  • Being too concerned with our perception of other's perception of ourself
To me it seems like we are in self-denial if we try to forgive ourselves without complete repentance.  I worry how much we are desensitizing ourselves to the influence of the Holy Ghost if we are trying to ignore the Holy Ghost's prodding for us to repent.

On the other hand it can seem overwhelming to look at our vast array of imperfections and to think of trying to repent of them all.    An analogy comes to mind for how to handle this.

If we were in a car accident and taken to the ER, what wounds would the doctors worry about first?  Scratches?  Your persisting foot infection you've never resolved?  A broken leg?  A pierced lung?  They would work on the life threatening injuries and as they are stabilized focus on the more debilitating damage.  They probably wouldn't even worry about the scratches until they are trying to clean everything off afterwards.  They also wouldn't focus solely on the what was initially the worst injury until it was completely healed, ignoring all others.

What sins keep us furthest from God?  Sometimes it can be quite surprising. For me an issue is "cease to sleep longer than is needful; retire to thy bed early, that ye may not be weary; arise early, that your bodies and your minds may be invigorated." (D&C 88:124).  If I repeatedly stay up I am too tired to wake up on time in the morning.  In my rush to leave for work I then neglect caring for my body through exercise, have less alert and sincere prayers, and I cut my scripture study short.

I'll leave it to President Lee for his words on forgiving self and the atonement:
Some years ago President Romney and I were sitting in my office. The door opened and a fine young man came in with a troubled look on his face, and he said, "Brethren, I am going to the temple for the first time tomorrow. I have made some mistakes in the past, and I have gone to my bishop and my stake president, and I have made a clean disclosure of it all; and after a period of repentance and assurance that I have not returned again to those mistakes, they have now adjudged me ready to go to the temple. But, brethren, that is not enough. I want to know, and how can I know, that the Lord has forgiven me also." 
What would you answer one who would come to you asking that question? As we pondered for a moment, we remembered King Benjamin's address contained in the book of Mosiah. Here was a group of people who now were asking for baptism, and they said they viewed themselves in their carnal state: 
"And they all cried aloud with one voice, saying: O have mercy, and apply the atoning blood of Christ that we may receive forgiveness of our sins, and our hearts may be purified. ... 
"After they had spoken these words the Spirit of the Lord came upon them, and they were filled with joy, having received a remission of their sins, and having peace of conscience" (Mosiah 4:2-3). 
There was the answer. 
If the time comes when you have done all that you can to repent of your sins, whoever you are, wherever you are, and have made amends and restitution to the best of your ability; if it be something that will affect your standing in the Church and you have gone to the proper authorities, then you will want that confirming answer as to whether or not the Lord has accepted of you. In your soul-searching, if you seek for and you find that peace of conscience, by that token you may know that the Lord has accepted of your repentance. Satan would have you think otherwise and sometimes persuade you that now having made one mistake, you might go on and on with no turning back. That is one of the great falsehoods. The miracle of forgiveness is available to all of those who turn from their evil doings and return no more, because the Lord has said in a revelation to us in our day: "Go your ways and sin no more; but unto that soul who sinneth [meaning again] shall the former sins return, saith the Lord your God" (D&C 82:7). Have that in mind, all of you who may be troubled with a burden of sin. 
Harold B Lee
Ensign, Oct 2008, 44-49, Stand Ye in Holy Places

If the barrier to forgiving ourself is worry over how people perceive us that sounds like some pride there.  Does the forgiveness of sins come from men or from God?  If we don't forgive ourselves due to how other's people perceive us, whose forgiveness are we considering more important?  Now don't get me wrong, repentance does involve repairing wrongs.  We should love and strengthen our fellow men.  What I am talking about is when these things are done and we are not letting go of the fact that we sinned because of this.

Forgiving Others

23 Therefore, if ye shall come unto me, or shall desire to come unto me, and rememberest that thy brother hath aught against thee—
24 Go thy way unto thy brother, and first be reconciled to thy brother, and then come unto me with full purpose of heart, and I will receive you.
3 Nephi 12:23-24

This last time I read these verses I thought about how it really would apply both to the person needing forgiveness and for person forgiving.  As I said in the beginning, how are we loving our neighbor if we haven't forgiven him?  Then if you wish to come unto the Lord and remember that you have not forgiven your brother but hold harsh feelings towards him rather than love, can you really come unto the Lord with full purpose of heart and be received by him?

Sometimes it feels like we talk of one person repenting and another forgiving as if these are strictly ordered and coupled affairs.  I'd say that these are not coupled events but are orthogonal to each other to the point where one might forgive another when that person has no sin to repent of.

First, I'll look at the ordering when both are needed.  President Kimball taught that we must be willing to make the first move. “we must forgive, and we must do so without regard to whether or not our antagonist repents, or how sincere is his transformation, or whether or not he asks our forgiveness” (Miracle of Forgiveness).  Our forgiving of another is an expression of love that can help elevate that person even to repentance.

This idea of love elevating another is expressed by Dr Victor Frankl in the following powerful but dry language
By the spiritual act of love he is enabled to see the essential traits and features in the beloved person; and even more, he sees that which is potential in him, that which is not yet actualized but yet ought to be actualized. Furthermore, by his love, the loving person enables the beloved person to actualize these potentialities. By making him aware of what he can be and of what he should become, he makes these potentialities come true.
Viktor Frankl, Man's Search for Meaning

This same concept was expressed by Goethe when he said "Treat a man is he is and he will remain as he is.  Treat a man as he can and should be and he will become as he can and should be".  The musical Man of La Mancha (which I sadly can't recommend) also expresses this idea.  Don Quixote saw the beautiful virtuous Dulcinea when the reality was a women named Aldonza but this has a transforming affect on her.  As Don Quixote is dying, Aldonza comes and pleads for him to see her as he did before.  "Won't you please bring back \ The dream of Dulcinea... \ Won't you bring me back \ The bright and shining glory \ Of Dulcinea... Dulcinea...".

Now on to my second point about needing to forgive a person when there might not be need of repentance.  Is sometimes the offense we are forgiving really in our self, that we judged them harshly and took offense where none was meant?

A great example of this is the correspondences between Moroni and Pahoran.  Moroni's armies had not been receiving the needed supplies to defend and retake lost territory.  His first letter to Pahoran receives no response.  After losing even more territory and lives, he writes again and accuses Pahoran of joining in with others in their effort to overthrow their republic with a monarchy.  Pahoran responds humbly that such a overthrow did happen but that he was a victim of it and was gathering strength to retake the kingdom if it be right to turn against their own people.  When sending the letter Moroni probably expected himself to be needing to forgive Pahoran to only find out there was no offense in Pahoran.

Regarding this concept, President Spencer W Kimball quotes the following in Miracle of Forgiveness:
"There is but one quality necessary for the perfect understanding of character, one quality that, if man have it, he may judge-that is, omniscience. Most people study character as a proofreader pores over a great poem: his ears are dulled to the majesty and music of the lines, his eyes are darkened to the magic imagination of the genius of the author; that proofreader is busy watching for an inverted comma, a misspacing, or a wrong font letter. He has an eye trained for the imperfections, the weaknesses. …
"We do not need to judge nearly so much as we think we do. This is the age of snap judgments. … [We need] the courage to say, 'I don't know. I am waiting further evidence. I must hear both sides of the question.' It is this suspended judgment that is the supreme form of charity"
William George Jordan

Orson Scott Card in the Ender series has a societal role called "Speaker for the Dead" who seeks to understand a person's life and correct the misunderstanding of us proof readers.  The idea that we see through a glass darkly lit is and can come to understand and love others is a powerful running concept in that series.

Forgiving someone does not mean that they not face the consequences of their actions.  Going through the consequences, paying the price for their actions, is a portion of what need to go through as part of repentance.
President Kimball speaks of a son talking to his father’s murderer “Tom, you made a mistake for which you owe a debt to society for which I feel you must continue to pay, just the same as I must continue to pay the price for having been reared without a father”.

Just as King Mosiah guarded his kingdom against his sons falling back to sin (See Moshiah 29:6-7), we need not put ourselves back in a position to be hurt.  It is a tough balance to meet, forgiving someone and recognizing they can repent and be a different person while not putting oneself in the path of their destruction while they are still in error or at risk to return to their errors.

Whether we properly administer mercy these two above cases comes down to whether we are loving the person as Christ does.  In addition to the son forgiving his murderer, another great example of these principles is the Nephites protecting themselves, both passively and actively, against the Lamanites without seeking for revenge.  When the Nephites act out of revenge is when their nation is on decline and on the verge of destruction.
Recompense to no man evil for evil … Dearly beloved, avenge not yourselves, but rather give place unto wrath: for it is written, Vengeance is mine; I will repay, saith the Lord.
Romans 12:17, 19

The most important element I have left for last, the healing power of Christ's Atonement.  Christ's Atonement does not just offer us a healing balm for our sins but for our heart.  Elder Featherstone has provided one of my favorite descriptions of this and I will leave it to him.
Lately I have decided that I need to talk more about justice. We don't understand justice completely, and there is so much out in the world that seems unjust and unfair that it is probably a good time to discuss this.
Who suffers most, the guilty or the innocent? The adulterer can go see the bishop. If he or she has truly repented, the bishop can say, on behalf of the Church, "You are forgiven." And they leave the office and that burden is lifted. What about the innocent? Who suffers most, the adulterer or the mother and father with a wayward son or daughter?
When will that hurt and suffering go away? It won't--not until the straying son or daughter comes back home. Should the innocent suffer? The parents quite often are innocent; and they hurt and they ache and they pray, and the pain will not go away.
Who suffers most, the incest perpetrator or the incest victim? Little ones are sometimes violated at a very tender age.
Who suffers most--the fornicator? the thief? those involved in drugs, homosexuality, and other perversions--or the innocent? Or do sometimes the innocent suffer more--the paraplegic, the quadriplegic, those with debilitating diseases, the "innocent" man or woman who has been involved in divorce, and dozens of others?
I believe sometimes the innocent suffer far, far more than the guilty--and that would not be justice, would it? It wouldn't be fair.
Now then, if the sinful one can go in and sit down with the bishop and have the burden relieved, then why should not the innocent? There are those who watch a spouse slowly die with cancer--a husband eventually becomes a widower or, if a man dies, a wife will be left alone. There are those who have other kinds of debilitating diseases--for instance, the quadriplegic who goes through a difficult life that way--isn't it only just that somehow the Atonement cover that kind of suffering? The innocent must be able to find the same relief as the guilty; that would only be just.
In Alma 7 we discover that the Lord suffered not only for the transgressions and sins of the world but for our afflictions and our illnesses and the sicknesses of the world. That is the part of the Atonement that I have missed somehow, and I want to suggest to you it is not left undone. Justice according to the supreme goodness of God will be satisfied. When we have a heart like unto God's own heart, we know justice will take place. Now, the innocent ones must do the same thing that the guilty do; that is, they must go to him who has a right to lift that off of their hearts.
President Harold B. Lee said, "I came to a night, some years ago, when on my bed, I realized that before I could be worthy of the high place to which I had been called, I must love and forgive every soul that walked the earth" (CR, October 1946, p. 146). If you have been violated, if you have been abused as a child or as an adult, or if you are later on in this life, would you remember that we must forgive the offending one? Justice "according to the supreme goodness of God" means that we do turn it over to him. It will not be left undone. We can have that absolute assurance. That would only be just. We must take it off of our hearts. Some modern psychiatrists might say, "Well, you don't get healed that way," but you do. You do get healed by turning justice over to God and forgiving the offender. We must be merciful if we would obtain mercy. The Lord can lift all burdens from us. Once we turn it over to him and simply say, "It is between that person and God. I forgive," then the burden will be lifted quietly and easily. If you are sitting here today and have had those problems in the past and can in your heart forgive and simply turn justice over to the Savior, then through his Atonement those sicknesses and illnesses and the abuses will be lifted from you. That would only be just.
The innocent must forgive the perpetrator, then transfer the burden to the Savior; and that is justice. That, again, does not mean that it is left undone; it just means that we have turned it over to the Savior.
Vaughn J Featherstone, “A Man After God’s Own Heart”

Friday, February 11, 2011

And what do I do now?

I felt a great disturbance in the Force, as if millions of voices suddenly cried out in terror and were suddenly silenced. I fear something terrible has happened. 
That quote was the first thing that went through my mind when I heard the announcement about the MS/Nokia partnership.  As a community member I feel betrayed but I feel even worse for the employees.  Nokia has been building up a strategy that attracts a very passionate group.  The main supplier of your mobile platform switching strategies away from your needs is a drop in the bucket to your employer switching strategies to the exact opposite of where your passion lies.  Whether you quit, get layed off, switch to developing a product you dislike, or even move to a project in the forgotten shed that gets no attention are all options that are not fun.

So drop in the bucket time.

I first switched to Nokia Linux-based products from Palm because I needed pocketable internet access.  I was moving to a lot of internet services so my Palm wasn't doing a good job fulfilling my needs.  I was annoyed with the Linux support which was purely a community effort.  Momentum is important so that I will have the apps I need and the lifetime to make the switch worth while.  I bought the 770 more as an experiment and found it fulfilled my needs.

I started developing applications for it to fit different needs and have come to appreciate it as a development platform.  I can develop and use my applications on the desktop and have them also work on Maemo.  That makes development easier and means I can make greater use of my work.  I've also come to appreciate a flexible architecture with things like Telepathy allowing VOIP/IM service to be first-class, sharing system, libsocialweb (Meego), and hopefully in the future libfolks for contact aggregation.

Writing mobile applications has grown beyond fulfilling my needs as a user.  I enjoy the opportunity to provide benefit for people as well as the chance to experiment and play with things that I don't get to in my job.  Releasing my applications for free changes the feeling of user support, fixes, and new features from have-to to get-to and keeps things very liberating and fun.


Where do I go from here?

Meego: Intel is sticking with Meego.  I am curious to see what all devices are announced next week.  If they look like they have life to them then maybe I'll stick around.  Nokia is still keeping Meego development around as a project and is releasing a device this year.  I wonder if this is to fulfill some item in a contract with Intel.  If so and when the contract ends, this is dead.  If not, I wonder how long it will survive.  I am sure the financial analysts will be telling them to kill it to shift even greater investment to money pot they will expect WP7 to be.

Android: Android would probably offer me the apps I need.  Linux being under the hood is meaningless when you don't have the full Linux experience.  I feel no motivation to develop for it, either in Java, C++ and the Python supported seems grotesque at first brush.  I dislike the siloed approach that apps focus on.  You don't get the power of frameworks like Telepathy, libsocialweb, or libfolks where the backend is decoupled from the front end, allowing for choosing the front-end and back-ends that best fulfill your needs rather than sacrificing one over the other.  I dislike the idea of a manufacturer holding back updates and feel too lazy to always be following the latest custom ROMs (or some of the feats you need to go through to load one on some devices).   I've played with friends Android devices and follow high level developments in the Android community but I could be mistaken on some things either good or bad.


webOS, something else? WP7 and iOS are out of the question.  webOS seems a bit limited in both apps and development platform but does offer "synergy" which sounds like it provides a similar experience of a plugin architecture that Maemo has.  I feel a bit concerned over the momentum of the platform especially in terms of how well it'll stick around.  Being from a single vendor adds to that risk and limits device options (which was why I was glad Nokia partnered with Intel to create Meego).  I only have cursory knowledge of webOS and have never played with a device whether this biases me in its favor or against it is to be seen.

I think I'll wait for next week to see what Meego devices come out of MWC before making my decision.

In the mean time I'd be curious if people have recommendations:
  • Pocketable (3-5 inches) devices with modern specs (Required)
  • Google Voice / VOIP Support regardless of network connection (Required)
  • Good support for desktop Linux (Required)
  • Support for Google services (GMail, Reader, Calendar, etc) (Option because I'm used to using the mobile website)
  • Access to a Linux command line with VIM and SSH (Optional but encouraged)
  • Support for Python or some other higher level language (maybe I'd even be willing to venture into Javascript which always felt dirty to me). (Optional but encouraged)
  • Apps run on both desktop and handheld without modification or emulation (Optional but encouraged)
  • Official way to distribute free apps without charge (Optional but encouraged)

I'd also be curious what users of my applications will do.  There have been some stalwarts on Maemo 4.1 (n800, n810).  Will you all be sticking around or giving up on it?  Will there be a similar stalwart community on Maemo 5 (n900)?  If I move from Maemo to Meego and everyone jumps ship from Maemo 4.1 and Maemo 5 then there is no reason for me to put in the extra effort to maintain compatibility with Maemo.

Friday, January 07, 2011

Porting Dialcentral: The Last "10%"

I had thought I was "almost done" with the rewrite of DialCentral from GTK to Qt.  I've even started investigating my Meego ports and started helping package / develop a new project.  Oh the joy of rewriting software and reimplementing old bugs and the creation of all new ones.

Maemo 4.1 was leading in being the least polished.  Somehow I kept missing the setIconSize method on QTabWidget to override the default tab size on that platform which was incredibly small.

I also had to fix some modality issues.  I had not set the parent window of my dialogs because rather than a new window appearing, the dialog's contents would be drawn on the parent window on top of everything else.  It took me a bit to discover the variant of setParent that I also needed to set the Qt::WindowsFlags which you can conveniently do both with a setParent overload.  The other side of this modality issue was with close buttons on Ubuntu on tap-out-of-window on Maemo 5, I forgot close buttons on some dialogs.

The last major user complaint is for those who haven't yet installed a Qt application on Maemo 4.1.  The Application Manager reports the size of a package as its own size plus all of its dependencies.  This makes sense for if a program has a separate data package or uses a rare but large library.  The downside is if you see 5 packages listed at 24 MB "each" then that is a bit discouraging for installing any of them.  Not much can be done about this one though.

I think most of the other Maemo 4.1 issues have been resolved or are "good enough".

Maemo 5 is now presenting the bigger challenge.  Take a look at the following screenshot.

If you can't tell "Tell Me" is my number of choice for testing DialCentral.
Problems:
  • The box/line in the text box are an artifact of scrolling
  • The "Cancel Call" button is marked as not-visible but the "Send SMS" and "Call" buttons are marked as visible.  Sure doesn't look that way in the UI.  Well, until you press on part of "Cancel Call", then the "Call" button is drawn on top.
The best I can figure is that it is glitches in Qt dealing with the compositing.  While the window is hidden and in the time that it is sliding in I am changing up the UI in response to changes in the model.  If you cause something in the UI to change, like going back and adding another contact or entering some text, some or all of the glitches go away.

I could just chalk this up as a Qt bug, file it, and move on.  Even if I can find a simpler reproduction case what is the chance that Maemo 5 users will see the fix?  Even if there is a chance that they do see it, how does that help them in the mean time?  I've been experimenting with update, activate, enableUpdate with and without delays aimed to arrive after the slide-in animation and have not gotten any results.  I might just have to queue up the UI changes for a timed delay after show to hope it is after the animation.  This will take a bit of rewriting this dialog for a problem that is only on one platform.  I'm not looking forward to this.

Primitive Debugging

At the end of a release at work our product has to be tested mixed in with other products.  In development we tend to be focused on our individual product and we try to keep things simple for reproducibility sake.  Our customers focus on a problem and need multiple products to be used in complex ways.  This helps give us some comfort that things won't break terribly in the customer's environment.

These are no the most fun issues to be had.  It is difficult if at all possible to reproduce these issues outside of the test lab.  The test lab also exists on an isolated network.  These combine to reproduce some interesting challenges when debugging.

By dumb luck I ended up being the one to usually go down to look at these problems.  This time around a different developer got wrangled in.  This is an experienced person who previously only dealt in app software.  His favorite tools like remote desktop and Visual Studio debugging (remote or even local) are thrown out the window.
 
Normally I end up using WinDBG but some quick looking leads us to believe it is an issue with the startup of a service we have.  Debuggers aren't much use in these situations because you can't start the service from inside it and you can't always attach in time.  So even though my coworker dreads WinDBG, he can't even use this tool.  That leaves us with print messages from a debug build of our service.  I am the one to generally maintain the service in question and I've been sure to put in debug messages in all the most useful spots.  I also showed my fellow developer a few tricks with debugging through DebugView.

This just gave me pause to reflect on how useful it is to use (in my case exclusively) these "primitive" tools.  In regular day-to-day debugging I can use the right tool (user space debugger, kernel space debugger, prints).  In addition I have the experience to deal with these more extreme debugging situations.  This is another great benefit for tools like VIM which you can use in a GUI, local command prompt, and through SSH.

Saturday, December 11, 2010

Porting DialCentral: Meaningless Results

I'm not sure why I like to wrap up each port with these meaningless results but here we go.

Qt Version
  • Near feature parity with GTK version (no custom callbacks, not re-implemented Alarm UI, no rotation for now)
  • Access to call cancel
  • Divider on various lists (for time ones, tried to balance heavy/light phone users)
  • Condensed history
  • Changed SMS Entry letter count style from GV to Nokia
  • Tabs are cached between launches
  • Display when history/messages tabs where last refreshed
  • 4,866 LOCs
  • From August 18th to December 2nd
GTK Version
  • 7,207 LOCs
  • For forever :)
That is quite an impressive difference in size.   I think a lot of that is owed to a cleaned up design that only needs to worry about Google Voice and not Grand Central.

I've still got some things to clean up, a couple bugs to fix, and improving some UI glitches on Maemo 4.1.  After that my plan is to get all of my applications into the Community OBS so they are available for Meego.

Friday, December 10, 2010

Threading in Dialcentral

So this is a bit more boring of a post.  Pretty much everything went as expected.  The only annoyance  as part of my zeal to avoid concrete inheritance was that Maemo 4.1 seems to have too old of a version of Qt to avoid inheriting from QThread.  That page has some better practice listings for QThread.

DialCentral original used threading to be lazy about startup and to avoid the slowest of operations from blocking the UI thread.  I've now pushed all blocking operations to a thread.  The main question was what approach I would take to  threading in PyQt.  I was tempted to keep using Python threads using GObject callbacks but I keep to one toolkit for simplicity.

In The One Ring I had some code that used generators to trampoline code to the worker thread.  I just had to refactor it so that there were toolkit specific and toolkit agnostic components.

I was glad that python logging works smoothly with QThreads.  The messages get marked with some kind of distinguishing identifier.

See, nice and boring.  No real issue which to me is a plus.

Thursday, December 09, 2010

Latest Lessons on Widgets from Dialcentral

This is a bit of a catch-all post to go back over some previously covered items with some new things learned.

TreeViews


HTML Delegates
I previously couldn't find the way to do custom cell renderers.  In part the oddity is that they provide default ways to render that are meaningless when you provide Delegates.  I did some searching and found an example HTML Delegate.  It had some issues with dark themes so I had to fix several bugs in it.



Simple heirarchy
Next I wanted Dialcentral to have letter separators in the contact list.  I never messed with hierarchical views in GTK before so I can't really compare.  My first time branching out to applying this to Messages and History turned out bad because it seems to have the parent items' columns aligned with the child's columns.  The original History view had 3 columns with the left two scrunched together.  These didn't provide much space for the parent row's text.  When I switched to a condensed history view this became moot.

Condensed history view, allowing the parent text to fit.
When learning about hierarchical views I found out that the root expander decorator is given space by default even if there are no children and it isn't shown.  This saved some space in the UI and will clean up the look of my other applications.

Layouts

The only real comment I have for layouts regards QGridLayout which I've not used before this.  Early on I was looking at using my pie menus for the buttons which had some issues, so I setup the alignment.  This didn't help but when I switched to buttons I eventually found out that it caused the buttons to fit to their minimum size rather than expand.  I probably fixed the pie menu issue without realizing I had thwarted myself.

Combo Box

The only real trouble I ran into with QComboBox was when I wanted it editable.  I was going to use this to allow choosing an existing GV configured callback or a custom one.  On the desktop the only way I've gotten it to insert into the list the item I'm creating is when there is nothing else to capture the enter key press.  Otherwise what gets activated is the "Apply" button (or worst "Clear Account" button when I remove the "Apply" button).  I've not found my way around this issue yet.

Callback Combobox caused problems on desktop Qt

Wednesday, December 08, 2010

Porting Dialcentral to Qt

GrandCentral Dialer
Dialcentral started its life as Grand Central Dialer for the 770.  I got involved by adding support for desktop Linux (which also made possible porting to future versions of Maemo).  Soon after the name change to Dialcentral (out of trademark paranoia) I took over maintaining it.  Google Voice support was added while maintaining Grand Central support as long as possible.  Over time other features were added like texting and group texts.  Eventually I provided an alternate way of interacting with Google Voice through a telepathy connection manager called The One Ring.


DialCentral 1.0.7
This port to Qt has taken longer for many reasons.  The backend has slowly become more compartmentalized over time but the complexity grew faster.  I ended up needing to rewrite everything but the direct wrapper around Google Voice.  Besides some other misc parts of life during this time I was also contacted by a recruiter from a very good company, an opportunity I felt I shouldn't pass up.  My interests have have focused on system programming, programming practices, and software architecture and so I've ended up ignoring algorithms a bit too much.  Their process spread over 2 months which I spent refreshing and expanding my knowledge of algorithms rather than working on Dialcentral.  After a couple trips out seeing the company and the office's city I came to the conclusion that Austin and the company I work for are the place for me to remain for now.  Location was the biggest clincher to me and that was after I researched all of their branch locations and interviewed for one of two I found that I had a chance of liking.

DialCentral 1.2 Beta
I'm still putting some finishing touches on this port.  I'm cautiously testing the waters with releasing this to extras out of concern that Google might break the brittle unofficial API and i have to do an immediate release.  I released a snapshot and have moved on to putting it in extras-devel with dire warnings especially since if an issue arises I might start having the GTK/Qt versions leapfrogging each other (joy of not having PPAs or a stable API).

For me the interesting part is this was my first Qt app that involves threading.  Related to this is that I want to maintain as much common code with The One Ring as possible.  Also with more UI work comes more insight into the better ways of doing things.  I try to keep all of my UIs fairly simple but this is one of the more involved ones.

Sunday, November 21, 2010

Dublin and Meego Conference

Thanks to the generosity of the Linux Foundation I flew out and attended Meego Conference this year as well as payed for a couple extra days to see Dublin.  This is my first time out of the United States (I did pop across the border into western Canada for 10 minutes but I don't think that counts).  I've been a Maemo user since the 770 but I never before attended any of the Maemo Summits.  This was a great experience.

I arrived on Saturday the 13th and left on Friday the 19th.  I ended up site seeing rather than participating in any of the early bird events.

On Day 1 I attended Rob Bradford's location/social aware presentation.  I had not known about libsocialweb before which I thought was interesting.  More interesting is I got some ideas of things to do with geoclue.  I also went to a presentation about the Touch Input Method Framework.  The thing that saddens me about these frameworks being created is that they are in-process and limit you to developing in C++ unless someone goes through the effort for each one to write a proxy plugin.  I try to exclusively deal with Python because it let's me focus more of my time on developing rather than worrying about cross-compiling, debugging, etc.  I can understand that there can be performance issues for some frameworks passing a lot of data over dbus, that was the reason I was given for libfolk.  At the evenings receptions, timeless and I had some interesting conversation.  I just hope I remember all the UI feedback he gave.

On Day 2 I attended the two telepathy related sessions (the project, not the super power though that would have made an interesting and confusing unconference day session).  I am looking forward to telepathy 1.0 despite the extra work it is going to put on me for updating The One Ring (and any future CMs I write).  It will be disappointing if I end up having to drop a couple of platforms (currently I support Maemo 4.1, Maemo 5, and desktop Ubuntu with work being done to prep for Meego).

Some worries of fcrochik and I were eased a bit when Mikhail brought up the QtContact plugin backed by libfolk (a bit before a blogpost hit the various planets).  It still seems odd that QtContacts is built with support for plugins yet you would either need some kind of layer on top to aggregate the plugins (needing retrofits for apps using the old API) or else only have one plugin and it aggregates things that plugin to it (plugin for plugins, joy).

The third day was unconference which is more of a good-chaotic everyone-present-what-they-want kind of day.  Sadly due to a conflict I missed Christian's Wayland presentation.

During one of the slots is when I picked up my Lenovo Ideapad that they were giving away.  A bit weird that it comes with a UK power chord and keyboard (I suspect I'm not the only American that set it to US layout to our confusion).  Sadly there is still some work that needs being done which is not giving people the best perception of the netbook/tablet and of Meego.  Hopefully it'll all be worked out in the thread on f.m.c.

I ended the unconference with leading a session about experiences porting from Maemo to Meego but due to conflicts and being the end of the last day I only had fcrochik in attendance.  We still had the good time.

Being from the US and having seen pretty much no professional football games, I enjoyed the Ireland v Norway game.  I heard from others later that both teams weren't playing all that well.  We had free tickets, the pre-game premium lounge with drinks and pretty good snacks.  We had a good number of rounds of the food because they came in such small bowls.  Thankfully texrat was nearby to take all of our dishes.  I didn't take part much in the half-time or pot-game festivities since the lines were long.

I have to say the venue was great, having the hacker's lounge was great, and it all felt top notch.  Amy, Dawn, Quim, and everyone else involved did a great job and there are many thanks to go around. One lesson learned I think was to have more power (and maybe even power converters at the "Power Plant" for people like me who forgot one).  If my laptop I brought actually had power, it would have been fun to have a day like what I heard happened in Barcelona.

I enjoyed being out in Dublin on the other days.  I managed to do everything by foot besides going from and to the airport (so 10+ km of walking on non-conference days).

On Saturday I spent my time at the city centre.  I saw Marions Square, St Stephen's Green, Dublin Castle, Christ Church Cathedral, and walked Grafton Street.  I enjoyed exploring the city but none of those sites really moved me.  I had some good lamb stew at some place near Dublin Castle.  Coming from Austin and freezing out in Dublin, that stew hit the spot.  That evening I also went and saw Tosca performed at the Gaiety Theatre.  That was a very powerful production.

On the Thursday after the Conference I ended up going to some of the further out spots.  I saw the National Gallery and then walked out to O'Connell Street to see the Spire, the James Joye Statue, the Remembrance Garden (very beautiful both in design and in idea), and the James Joyce Centre.  I then went out west and saw the Leprechaun Museum on my way.  Eventually I was at Kilmainham Gaol and the Ireland Museum of Modern Art.  I then had to rush back real quick to get on the internet to see when I flew back.

Those last three sites ended up being my favorite.  It was fascinating to learn the political history of Ireland from the perspective of a jail, including the execution of the leaders of the Easter Rising.  The Garden of Remembrance was a great place to contemplate.  The Leprechaun Museum was fascinating for learning Irish Mythology.

The things I sadly didn't get to see are the Ireland Botanical Gardens, Mallahide Castle, Knowth/Newgrange, the War Memorial Gardens, and a Famine Memorial I saw on my tour map (if it exists, couldn't find it).  I wasn't even sure how I would get to Knowth/Newgrange but at the Leprechaun Museum they aid that the Dublin Tourism place on O'Connell does a tour up in those parts, you jut need to arrange it a head of time it sounded like.  Something to know for the next trip out to Dublin.

I find it interesting that a friend had recommended I see a lot of the Churches but instead I saw or at least tried to see war memorials, jails, execution sites, ancient burial tombs, etc.  A bit different of priorities I guess.

See Pictures

Wednesday, September 01, 2010

DAQpy

Once upon a time I needed to write an application that interfaced with the real world.  I decided I wanted to use a data acquisition device from NI but I'm picky.  I want easy prototyping with fine control in the finished product.  That kicks out LabVIEW (luckily I'm forgetful or else I could write post after post about the good and bad of LabVIEW).

So I decided to use the C with DAQmx.  For prototyping I decided to use Python with its ctypes library.  I found some example bindings on a scipy page but they were hand generated and didn't seem very pythonic.  So I wrote my own generator and then added some custom helpers on top to make common operations more pythonic.  Unlike pydaqmx (which I just now found out about) I include my code-gen tool and I don't try to create a fake OOP system on top of the DAQmx API.

I even took some of the basic examples included with DAQmx and created the Python equivelants.

You can find a copy of DAQpy on github.  I would caution I re-organized the code on my Linux box which means I don't have access to DAQmx to validate things.  Patches welcome :)

Monday, August 16, 2010

Porting ejpi: Meaningless Results

So let's see how the two versions of ejpi compare:

Qt Version
  • Feature parity with the GTK version
  • Improved pie menu performance but two pie menu display bugs
  • Simplified layout with the potential for rotation
  • 3382 LOCs
  • From June 8th to July 16th
GTK Version
  • 4473 LOCs
  • From January 30th to February 25th
LOCs are measured by "wc -l" rather than getting fancy.  I wrote both apps and they were written in a similar style with similar amounts of whitespace and documentation.


The LOC counts look nice, more drastic than my Gonvert port for what it is worth.  I had a lot more distractions going on during my port of ejpi so a comparison of implementation times between Gtk/Qt or Gonvert/ejpi is as meaningless as the title of this post suggests.

My main Qt disappointment in this port is what seems like high coupling both in Qt itself and in code written by others (the example pie menus).

Now for some of the upsides.  Though I implemented them differently, the similarity in the drawing code between Qt and Cairo helped.  Also finding out about QStandardItemModel made my life easier.

I'm split on which direction I want to go in my learning of Qt.  Originally I had planned on porting Dialcentral for gaining experience with threading.  I have too many ideas though and not enough time.  Possible directions include: porting other apps of mine, a new app using QGraphicsView, or some QtMobility contacts (and eventually calendar) plugins (though then I'd also have to learn the quirks of Qt in C++ and deploying compiled apps to Maemo).

Learning Ruby: Vampire Numbers

Instead of the traditional book group at work I'm in a group where each person chooses to learn a new language.  For me to make it feel worth while it either needs easy C bindings, existing bindings, or be used for scripting at work.  That left me with Go, Lua, Io, and Ruby.  Go was out due to error handling and generics.  I decided to stick with Ruby so it would be work practical (Python is heavily used by the company-wide build tools but my group has a lot of Perl and Ruby scripts).

Our first assignment was simple, identify vampire numbers.  They seem arbitrary and useless but oh well.

One of the first things I did was "gem install rubydoctest".  I like doctests from Python for their providing examples for the code and that they provide very low friction low coverage tests.

My work computer is sadly running Windows.  I did not have tool chains setup to install ruby-prof from source and I couldn't figure out how to install the pre-built version referenced from their site.

A quick summary of my initial thoughts
  • rubydoctest has poor error output but I love that "!!!" drops you into irb (though I didn't find out about it until I was done).
  • I was kind of surprised Ruby doesn't have a factorial function.  I'm not as surprised about a lack of a permutation function, Python's just special like that.
  • Very few examples show how to separate module logic from executable logic (Python's "if __name__ == "__main__" idiom)
  • Optional return's are ugly for most code.  The one place they work well is used inside of a block as a predicate for a function (like the comparator for sorting).
  • Optional parenthesis make it confusing what is a property or method.  Not knowing what is going on feels sloppy to me
  • I got thrown off by changing fairly standard names (exception handling, next/continue) and at first didn't think "next" existed.
  • Find it a strange concept to use next, break, retry, redo inside of blocks.  I'd be curious what the underlying principles are for how the block communicates with its caller to execute those.
  • Retry and redo seem cool though I am unsure how often I would ever use them
  • I like Python's separation of repr from str which makes debug output easy.  I was wanting to figure out what some lists I was using were doing but each element was printed on a separate line, making it take up a lot of space and making it hard to distinguish one array from another.  I didn't notice some of the pretty print functions till later and haven't had a chance to try them yet.
  • My program was slow and according to profiling most of it was in iterating.  (0...5).each was the fastest, next was 0.upto(5), and then last was doing the looping raw (I think).  All of that kind of surprised me, most especially how slow looping was in Ruby.  I was impressed the closures for blocks didn't add much overhead (or at least it isn't noticeable compared to how slow ruby is in general).
  • I kept mixing up whether I was working with an actual iterator and an Enumerable (and it took me a while to notice the difference)
  • I really miss the composable iterators of Python (enumerate plus everything in itertools)
  • Remembering  ".." vs "..." is annoying and I end up having to look it up every time (which is very bad for code readability).
  • A problem that drove me nuts for a while is "x = false or true".  The "=" has higher precedence than "or".  What I needed is "x = false || true".  A blogpost I later came across tries to frame "or" and "and" as flow control operators rather than logical operations. I think there are way too many operators.  Can you name the difference between ".."/"...", "=="/"==="/"eq?"/"equal?", etc?

Thursday, July 29, 2010

Porting ejpi: Tree Models in Qt

For me, one thing that differentiates the quality of a calculator on a mouse or touch driven device is having a calculation history and having it be interactive.  In Gtk I implemented this with a TreeView and a ListStore.  I had never implemented a custom model in Gtk, the included models were simple enough and flexible enough that I didn't have the need.

When I ported Gonvert to Qt, all I could find information for was custom models with QAbstractItemModel and QTreeWidget/QTreeWidgetItem.  QTreeWidgetItem's seem to only be good for Text.  This worked for parts of Gonvert but not for others so I went through the complicated affair of implementing a QAbstractItemModel.  I never felt like I fully understood the relationships of various items which usually worries me.  I also found it slow due to all of the protection I "should" have in my code which causes a lot of calling back and forth between C++ and Python.

I'm unsure how I missed it but when I started on ejpi I came across QStandardItemModel/QStandardItem.  This seems to at least allow a little more flexibility.  I can put icons and checkboxes in as well as text into the model.  I can also attach random python objects to each item.  The downside to a stock model is that you have to externally maintain any invariants but I was already managing those with my Gtk version.

I would be curious about the various performance merits to each approach but I'll have to pass on that for now.  The two main things I found frustrating was finding out about these and how each API was helpful in its own way, sometimes better, sometimes worse than its fellow approaches.

Most of my API issues were due to being unfamiliar with them and having to fight with the different approaches each model system took to presenting itself to the developer.  I still have one unfortunate piece of code in ejpi's calucation history which implements peek through a pop and a push.

I've not messed with setting the font on any of these (I should have for Gonvert and also for ejpi) so I'm unsure how the font experience is in Qt.  Mainly I'm interested in what formatting Pango html-esque tags allowed, changing relative size and basic formatting while keeping everything else to theme defaults.  A quick look through the API seems to suggest this is simple but that is yet to be determined.
I still miss GTK's generic way of handling rendering with its use of CellRenderers.  You don't have to be stuck with the built-in choices for representing items in your model.  It also keeps presentation information away from the model.

I did enjoy how easy QStandardItem's made user edits (sadly only seems to work on the desktop) and activating of individual items.  I didn't get around to exploring drag and drop for history re-arrangement (helpful for RPN calculators) but I don't think I implemented that for the GTK version either.

My GTK version and my Qt version of my ejpi history are available for comparison.

I guess the summary would be that overall I'm a fan of QStandardItemModel and wish I had found it sooner.

Porting ejpi: Icon Theming

ejpi includes some custom icons as well as using theme icons.

The custom icons are used for a couple of buttons.  I know the path to the custom icons and I load them up and everything works as expected.

The stock icons are used for deleting items in the calculator's history as well as a severity indicator and close button for the error info box.

I ported the GTK code from using theme icon names to QIcon.fromTheme.  It was fun for me to find out that fromTheme was added in Qt 4.6 (I still support Maemo 4.1 with my applications and it only has Qt 4.2 I think).  How did applications do this before 4.6?  I don't think I've used KDE since v2 but I think its generally supported icon theming along with everything else which precludes the application building all icons in as resources.

I also had fun with fd.o icon names not being available on all platforms so I had to find alternatives for each and put in fallback code.

I guess chock this up as another thing to abstract away when running on various platforms.

I'm not saying this was hard or anything but just another lessons learned in porting to Qt.