Blog

All Posts (93)

Parachute Randomized Prioritizing Grid

This tool helps you to rank a list of your preferences by comparing them a pair at a time. The idea is based on Richard Bolles' Prioritizing Grid (as implemented by Beverly Ryle). But one think I don't like about it is that the pairs aren't randomized, which makes the exercise a bit more boring than it has to be. Also once you start getting as high as 30 items, the grid becomes hard to use (the online version scrolls off-screen on my laptop).

So this version presents random pairs to you. It still uses the same sorting scheme (by number of wins). I basically took my Elo Preference Ranker UI and modified/simplified it.

Simply paste in a list of items to rank, one per line (e.g., your favorite skills). Then press "Start ranking!". You will then be presented with a pair of items at a time, and you are asked to choose which is better or more important. As you go, the sorted list will appear at the bottom.

Input Strings

Enter the strings to rank, one per line. Then press "Start ranking!". You will be presented with pairs of strings - click the button corresponding to which item is more important or better.

Sorting

Click the button corresponding to which item is more important or better. You can also press "J" for the left item and "L" for the right.

Something. Something else.

0 remaining

You have finished comparing all items!

Sorted Output Strings

The sorted strings are:

Read more…

Hacker News favourite categories

It can be instructive and fun to figure out what your interests are by looking at what kind of Hacker News articles you link.

I am going to tabulate my interests here - try the same if you like.

  • 2 - Work: How to make it better
  • 3 - Work: How to make it worse
  • 1 - Improvements to software engineering 
  • 13 - Promising new coding practices or tools
  • 4 - Product successes
  • 13 - Product failures
  • 3 - Promising new technology
  • 3 - Retro tech
  • 4 - Low tech
  • 4 - Personal self-improvement
Read more…

Pressure-mounted baby gate comparison

After spending way too many hours on researching this topic, I have come to the conclusion that when looking for a pressure-mounted baby gate, you have the following options:

Price Example Comfortably wide door Latch is easy to open Gate auto-closes behind you
$40 Regalo Easy Step Walk Thru
$60 Evenflo Easy Walk-Through Yes
$80 Brica/Munchkin Wood & Steel Designer Yes Yes
$100 Munchkin Auto Close Designer Yes Yes Yes
Read more…

An objective definition of beautiful software

Beautiful software is code that you can add features to while only needing to modify a few lines to allow the change to come in.

So the most beautiful software is code that requires 0 line changes before adding a feature.

But if it requires a handful of line changes, it's still beautiful to me.

Ugly software needs shotgun surgery when a feature needs to be added - changes in a bazillion places.

Read more…

5-minute journal

I'm trying out a cool thing called the 5-Minute Journal. It is a journal that you buy for $25 CAD (there is also a $5 app, but I think I prefer pen and paper). Basically it is a guided journal that asks you the same set of questions each day (with some variations: inspirational quote, weekly challenge). I have always had trouble keeping a journal, but I think this will really help. 

Read more…

Turning right on red is tricky

When driving, there are a lot of things you need to consider when turning right on a red light:

  • Is there a vehicle going straight?
  • Is there a vehicle turning left?
  • Is there a cyclist in your blind spot, or crossing either of the crosswalks?
  • Is there a pedestrian crossing either of the crosswalks from either side?
  • Is the light about to turn green? If yes, is there a pedestrian about to cross, or a cyclist in your blind spot?

It seems like a huge amount of factors to consider.

Read more…
I would like to stress the importance of using a 3-way diff to resolve merge conflicts. With a 3-way diff, you get:

                     Remote lines            Common ancestor lines            Local lines

It is very important to see the common ancestor, so that you can see exactly what changes were made to the remote file, and what changes were made to the local file. This gives you insight to see how you should combine the remote change with the local change.

I have made this 5-minute video to show you how to use a free 3-way diff called P4Merge (available for Windows and Mac) to resolve your conflicts:

http://screencast.com/t/jagvXzRI


To set up P4Merge with Git, just google for: p4merge git windows or p4merge git mac.


Read more…

I used Google Sites to create free websites for a couple of businesses for my friends and family. First, my friend's electrical contractor business: Trivino Electrical Services. Second, my dad's tutorial center: Young Ones.

They have a bunch of average-looking templates that you can use to quickly create the website.

It's free, but if you want a custom domain, you need to pay $10-$20/year to Namecheap or another domain name registrar.

Read more…

Catholic Lifetime Reading Plan (Sorted by Subject)

Here is Fr. John McCloskey's Catholic Lifetime Reading Plan, sorted by subject:

Catholicism Explained/Theology – Adams – The Spirit of Catholicism
Catholicism Explained/Theology – Bouyer – Spirit and Forms of Protestantism
Catholicism Explained/Theology – Catechism of the Catholic Church
Catholicism Explained/Theology – Hahn – Rome Sweet Home
Catholicism Explained/Theology – Kreeft – Christianity for Modern Pagans
Catholicism Explained/Theology – Newman – Essay on Development of Christian Doctrine
Catholicism Explained/Theology – Ott – Fundamentals of Catholic Dogma
Catholicism Explained/Theology – Pieper – The Four Cardinal Virtues
History and Culture – Belloc – How The Reformation Happened
History and Culture – Belloc – Survivals and New Arrivals
History and Culture – Belloc – The Great Heresies
History and Culture – Carroll – History of Christendom (All Volumes)
History and Culture – Crocker – Triumph
History and Culture – Dawson – Christianity and European Culture
History and Culture – Guardini – End of the Modern World
History and Culture – Hannam – God's Philosophers
History and Culture – Knox – Enthusiasm
History and Culture – Leclercq – Love of Learning and the Desire for God
History and Culture – Walsh – Our Lady of Fatima
Holy Men and Women – Chesterton – St. Francis of Assisi
Holy Men and Women – Day – Long Loneliness
Holy Men and Women – John XXIII – Journal of a Soul
Holy Men and Women – Merton – Seven Storey Mountain
Holy Men and Women – Muggeridge – Something Beautiful for God
Holy Men and Women – Newman – Apologia Pro Vita Sua
Holy Men and Women – Simon Peter – Chevrot
Holy Men and Women – St. Thomas Aquinas – Chesterton
Holy Men and Women – Suarez – Mary of Nazareth
Holy Men and Women – Trochu – Cure of Ars
Holy Men and Women – Wegemer – Thomas More
Holy Men and Women – Weigel – Witness to Hope
Literary Classics – Benson – Lord of the World
Literary Classics – Bernanos – The Diary of a Country Priest
Literary Classics – Cervantes – Don Quixote
Literary Classics – Dante – Divine Comedy
Literary Classics – Eliot – Christianity and Culture
Literary Classics – Endo – Silence
Literary Classics – Hopkins – Hopkins: Poetry and Prose
Literary Classics – Kristen Lavransdatter 1
Literary Classics – Kristen Lavransdatter 2
Literary Classics – Kristen Lavransdatter 3
Literary Classics – Newman – Idea of a University
Literary Classics – O'Connor – Flannery O'Connor: Complete Stories
Literary Classics – Percy – Lost in Cosmos
Literary Classics – Percy – Love in the Ruins
Literary Classics – Sienkiewicz – Quo Vadis
Literary Classics – Tolkien – Lord of Rings
Literary Classics – Waugh – Brideshead Revisited
Misc – Benedict XVI – Day by Day with the Pope
Misc – Benedict XVI – Opera Omnia
Misc – Bennet – The Emotions God Gave You
Misc – Bennet – The Temperament God Gave You
Misc – Enzler – My Other Self
Misc – John Paul II – Opera Omnia
Misc – Masson – Companion Guide to Rome
Misc – Neuhaus – Catholic Matters
Misc – Rice – 50 Questions on the Natural Law
Misc – Sertillanges – Intellectual Life
Misc – Stein – Woman
Misc – The Privilege of Being a Woman – Hildebrand
Spiritual Classics – Augustine – City of God
Spiritual Classics – Augustine – Confessions of St. Augustine
Spiritual Classics – Chesterton – Everlasting Man
Spiritual Classics – Chesterton – Orthodoxy
Spiritual Classics – John of the Cross – Dark Night of the Soul
Spiritual Classics – King's Good Servant but God's First – Monti
Spiritual Classics – Lewis – Mere Christianity
Spiritual Classics – Lewis – Problem with Pain
Spiritual Classics – Lewis – Screwtape Letters
Spiritual Classics – Mother Teresa – Meditations from a Simple Path
Spiritual Classics – Oursler – The Greatest Story Ever Told
Spiritual Classics – St. Catherine – Little Talks with God (modernized version of "The Dialogues")
Spiritual Classics – St. Teresa of Avila – Interior Castle
Spiritual Classics – St. Therese of Lisieux – Story of a Soul
Spiritual Classics – St. Thomas Aquinas – My Way of Life
Spiritual Classics – Teresa of Avila-Way of Perfection
Spiritual Classics – The Lord – Guardini
Spiritual Classics – Transformation – Hildebrand
Spiritual Reading – Aumann – Spiritual Theology
Spiritual Reading – Baur – Frequent Confession
Spiritual Reading – Baur – In Silence with God
Spiritual Reading – Boylan – Difficulties in Mental Prayer
Spiritual Reading – Boylan – Tremendous Lover
Spiritual Reading – Burke – Covenanted Happiness
Spiritual Reading – Caussaude – Abandonment to Divine Providence
Spiritual Reading – Chautard – Soul of Apostolate
Spiritual Reading – Cizek – He Leadeth Me
Spiritual Reading – d'Elbee – I Believe in Love
Spiritual Reading – de la Palma – The Sacred Passion
Spiritual Reading – de Sales – Introduction to Devout Life
Spiritual Reading – de Sales – Treatise on the Love of God
Spiritual Reading – Escriva – Christ is Passing By
Spiritual Reading – Escriva – Way of the Cross
Spiritual Reading – Escriva – Way, Furrow, Forge
Spiritual Reading – Faber – All for Jesus
Spiritual Reading – Garrigou-Lagrange – Three Ages of Interior Life, I
Spiritual Reading – Garrigou-Lagrange – Three Ages of Interior Life, II
Spiritual Reading – Granada – Sinner's Guide
Spiritual Reading – Holzner – Paul of Tarsus
Spiritual Reading – Kelly – Rediscovering Catholicism
Spiritual Reading – Kempis – The Imitation of Christ
Spiritual Reading – Liguori – 12 Steps to Holiness and Salvation
Spiritual Reading – Liguori – The Practice of the Love of God
Spiritual Reading – Liguori – Uniformity with God's Will
Spiritual Reading – Lovasik – The Hidden Power of Kindness
Spiritual Reading – Manzoni – Betrothed
Spiritual Reading – Martinez – True Devotion to the Holy Spirit
Spiritual Reading – Montfort – True Devotion
Spiritual Reading – More – Sadness of Christ
Spiritual Reading – Opera Omnia – (Jacques?) Phillipe
Spiritual Reading – Perquin – Abba Father
Spiritual Reading – Plus – Winning Souls for Christ
Spiritual Reading – Rohrbach – Conversation with Christ
Spiritual Reading – Scupoli – Spiritual Combat
Spiritual Reading – Sheed – Theology for Beginners
Spiritual Reading – Sheed – To Know Christ Jesus
Spiritual Reading – Sheen – Life of Christ
Spiritual Reading – Sheen – Three to Get Married
Spiritual Reading – Tanqueray – Spiritual Life
Spiritual Reading – The Divine Pity – Vann
Spiritual Reading – The Rule of Our Warfare – Newman

Read more…

Code smell: Schizophrenic method

A schizophrenic method is a method that is begging to be split into two. It has a lot of if statements, but closer inspection reveals that most of the ifs can be eliminated by splitting the method into two. It may take some effort to unravel the two cases from the hodgepodge of ifs on various variables, but it's beautiful if you can do it.

Read more…
Here is how to simulate perfect pitch using your teeth:
  • Tap your teeth together. You should hear the same pitch every time you tap your teeth together.
  • Go to a piano and find what note corresponds to the pitch coming from your teeth. For example, my teeth give me a Db.
  • Hum your way up (or down) from that note to C.
Now you have a way to hum a C without aid of any instrument, tuning fork, or app. Just your teeth.
Read more…

Liking MYN better than GTD

I'm really liking MYN better than GTD. Instead of having a bunch of context lists, now I have one short list based on urgency (yes, urgency, or "start dates"; the book explains why). The list is short because stuff to do/review in the future is hidden.

Here's what my list looks like:

First, it's remarkable how short it is, compared to my huge GTD lists.

"High" is things that must absolutely be done today, even if I have to stay up late.

"Medium" is things to consider doing in the next couple of weeks. Some of them are recurring (every 3 days, every 4 months, etc.). The starred ones should preferably be done today, although they don't have to be.

"Low" is things that are "over the horizon" that I should at least review each week.

Also note what is not shown: the 136 hidden tasks. They are not shown because they have start dates in the future. Those are 136 tasks that I don't need to include in my weekly review, unlike in GTD. I really appreciate that.

Read more…

I tried this once so far and it worked: FirstGlobalMoney. The charge is $5.99 to your debit card, which is better than Western Union ($10 + $3.50 credit card cash advance fee). You have to wait a few days the first time for them to verify your information. After that, recipients should receive it in half an hour. You select from a list of pickup locations for the recipient (typically a grocery store or pawn shop with remittance services).

Read more…

MYN vs GTD

I'm trying out a new task management system called MYN ("Mind Your Now"). I have ported all of my GTD tasks into MYN. It seems to be quite good:

  • The best thing is that lists are kept small because you can hide items for a given number of days/weeks/years. You choose the next time that the item should pop in for review. So the weekly review becomes very quick.
  • Another good thing is that the system gives you good suggestions for what to do next: your list is sorted, so the stuff you need to focus on appears at the top. It is sorted first by urgency (counterintuitively) (with 3 classes of urgency), and then by start date (not due date) (so newer tasks appear first). I have always wanted a system that could suggest to me what to do next.

There is a free e-book called The One Minute To-Do List that has the MYN  system (with implementation using Toodledo) in its closing chapters. I liked it so much that I bought one of Michael Linenberger's books to get advanced details on the system.

Read more…

Code Reviews in Iambic Pentameter

A few months ago, I tried doing an experiment: Writing my code reviews in iambic pentameter. When you write in iambic pentameter, you can't write nasty things—and if you tried, it would come off as humorous.

In the end, I stopped doing it though because people weren't responding to my reviews.

Anyway, preserved for posterity are the following 42 actual code reviews in iambic pentameter.


1. A 404 is when the story's gone.
But if the problem's that you're not allowed
To see it, then you want a 403.
ForbiddenException, that it should be.

2. To make SOLR respect a private field,
getBooleanSearchFields helps you to be healed.
Mode videos, without this, were all concealed.

Oh, but I see the same thing you did wield.

3. isPrivatePublic makes but little sense;
isPrivacyEnabled has defense.

4. You speak after you sleep, but if announce
That you will sleep, t'were best announced before.

5. IDs are not sequential - oft they jump
From high to low, then high again, then low,
createdDate were better for this flow.

6. Wherefore psw? I think you password mean,
Abbreviating's tasty as benzene.

7. .ban-top-center-cta as a class
Refers to "top" and "center" which are not
Semantic - no they're presentational.
Would that you chose .ban-publish-add-image
Then there'd be no semantical scrimmage.

8. Sort by createdDate, but you should know
ID does not increase in the same way.
Consider:

> select from_unixtime(_created_date/1000), _id from _collection
    -> order by _created_date asc
    -> limit 10;
+-----------------------------------+-------+
| from_unixtime(_created_date/1000) | _id   |
+-----------------------------------+-------+
| 2012-11-08 20:17:29.4910          | 17499 |
| 2012-11-09 01:07:31.3610          | 17610 |
| 2012-11-09 01:09:04.3650          | 17618 |
| 2012-11-09 01:18:07.1550          | 17637 |
| 2012-11-09 01:18:57.7690          | 17556 | <- Jumps down
| 2012-11-09 20:06:21.7750          | 17574 |
| 2012-11-09 20:08:05.8680          | 17579 |
| 2012-11-09 20:08:54.1530          | 17654 | <- Jumps up
| 2012-11-09 20:33:14.9920          | 17593 | <- Jumps down
| 2012-11-10 00:24:31.0810          | 17695 | <- Jumps up
+-----------------------------------+-------+
10 rows in set (0.15 sec)

beginFrom should be *date*, I'd recommend,
else you'll have to account for some loose ends.

9. This use of :not is not the greatest thing.
Can we step back and think what's going on?
.l-cnt-topad - is that content or not?
If no, .l-content should from it be gone.
If yes, .next-bg needs another class,
Perhaps .l-next-bg-content would pass.

10. Instead of papering o'er the problem here
It would be best to ask, what's the root cause?
allOptions.smarty's $defaultMsgKey
On line 282's not specified.
If you put there the $defaultMsgKey 
Then this line will not be needed by thee.

11. You added $defaultMsgKey right here
Beside $newMsgKey, like man and wife.
But in collect.js, I'm 'fraid to say
$newMsgKey, without her partner, lay.
Two places in collect.js she stands
Alone, and quite rejected by her man.

If $defaultMsgKey were put beside,
She and YOKO-6863 be bride.

12. For keeping it top level, I you thank.
The more we do, it's money in the bank.

And these module prefixes are real swank.

13.                             These strings
Should be in en_US's list of things.

14. For every other field, it ends with "-field",
Why was the suffix from this field repealed?
I'd recommend you change to "site-url-field".

15. How this did ever work, I do not know.
The initImagePicker function calls
To processImages, which I'm sure sets
this.images. Unlike the comment says,
We can have images and videos both
Which you can see if you do bookmark this:

http://mightymega.com/2015/07/14/star-wars-tie-fighter-music-box/

16. I thought the powers at be did think it best
To put all z-indexes in _defs.less.

17. I wish we did not have to nest so deep,
Nest here, nest there, it multiplies like sheep.

18. No value for the href? Please explain
Why you thought href="" worthy to disdain.

19. The only thing that the jira required
Is “return path.replace(/.*\/\/[^/]*(.*)\?.*/, '$1')”. Or am I tired?
That regex will return the stuff that's parked
Between the domain and the question mark.

20. After a year, the meaning of "SB"
Will be but a forgotten memory.
Could you rename: collectStoryBuilder?
Then it will surely never bewilder.

21. Why nest these classes in l-bookmarklet?
l-bmk prefix does not suffice?
Removing all this nesting would be nice.

22. You import a big file into a small,
Why not just make this file contain it all?
It would be turning Saul into St. Paul.

23. In recent conversation we agreed
That underscore CSS class names suck.
Please use a hyphen; underscores, please chuck.

24. The top of this file says the prefix is
ems-. But you put ath- here.
Should you not use ems- to cohere?

25.                               I do not understand
Why this has to be so deeply nested.
If it were not nested, would it not work?
If we stopped nesting, it would be a perk.

26. "$googleAnalyticsSecondaryId"
Don't match "googleAnalyticsSecondary"
I would make them same for consistency.

27. This is not the "number of stories viewed",
It is the "IDs of the stories viewed".
I think this comment needs to be renewed.

28. Uma, why did you add _.storyChainedCount,
When we already have _.shownStoryCount?
    Are they not the same?
    Just a different name?
I'd recommend that you remove your count.

29. I'm sorry, but I don't quite understand.
Isn't the status 'active' or 'optout'?
How does the new code differ from the old?

30. If I do showOnBoarding($user, true),
Then showOnBoarding($user) should be true
But it is false. Is not this a boo-boo?

31. A boolean var name begins with "is"
But this is string and not a boolean.
Please rename this to $downloadBtnClass,
And then this name will be as clear as glass.

32. There is no need to strtolower this,
storeLink() already does it, like a kiss.

33. These offsets will be messed up either when
- pruneWaterfallBoxes kills earlier stuff
- reverse infinite scroll adds earlier stuff

How you will deal with these things will be tough.

34. <span class='ban-help-text'> should be changed to be
<span {FEATURED_LINK_ATTRS}>, right?, to agree.

35. newOffsetIndex is indeed array,
So it should be "newOffsetIndexes".
_.offsetIndex too is a list of things;
"_.offsetIndexes" would have better wings.

36. selector ain't a string - it's jQuery
If you rename to "$node" it would be good,
To make it clearer what's under the hood.

37. The activeKeys are keys, so why not make
Them actually keys in _.itemsList? I ache
To see _.getActiveElements looping
Through all the items. No! If they are keys,
activeElements = _.itemsList[activeKeys[i]].
O(n^2) becomes O(n). Gods are pleased.

38. I recommend that you make unit tests
For RedisImitatorService please.
It's easy to make bad bugs when you sneeze.

39. This kind of thing leads to XS attacks.
Could you encode title using this way?
http://stackoverflow.com/a/1219983/2391566
You'll make malicious users cry, "Mayday!"

40. This no longer inits imagePicker;
I'd rename: "getDocumentImages",
The wrong meaning then won't be contagious.

41. I do not grok this logic; woe is me.
.bnd-cvr-featured-author, if parent,
Causes the buttons to be hidden. Why?
Connection I don't see, and so I sigh.

42. I do not know why this is called $events.
It's just the current target, is that right?
So wouldn't $currentTarget be more tight?
Read more…

The kind of work I like to do

While talking with my wife, I gained a big insight into the kind of work I like to do.

The greater this fraction, the more I will like the work:

        Importance

        -----------------

        Time Spent

The greater the importance (e.g., to the company, or to me), the more I like it. The quicker I can do it, the more I like it. But if the project isn't very important, I won't really like it. Or if it takes a lot of time, I won't like it.

This is why I really enjoyed building Yubnub (high importance to me, only 24 hours spent). Conversely, I hate debugging intermittent production issues (the bug isn't really important to the company, and it takes days or weeks to figure out).

Read more…

Did you know?

I'm a software engineering consultant. This means I can help your company with your software engineering needs:

  • providing temporary manpower for short-staffed software projects

  • helping new software projects get off to a good architectural start

  • improving the performance and reliability of old, legacy software systems

  • doing an important investigation or small project that you've always wanted to do but haven't had time for

Since 1999, I have done software engineering projects for the Canadian government, for Silicon Valley startups, and for established Bay Area companies, for small companies and medium-sized companies, for successful commercial projects and open-source projects. 

Currently accepting small projects. If you have one, email or call me.