Subscribe: Jon Aquino's Mental Garden
http://feeds.feedburner.com/JonAquino
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
ago jonathan  ago  aquino  bug  command  days ago  facebook  final  git  good  ideas  jonathan aquino  press  purpose  things  time 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Jon Aquino's Mental Garden

Jon Aquino's Mental Garden



Engineering beautiful software



Last Build Date: Sat, 14 Oct 2017 22:52:43 PDT

 



Git command to show you the largest commits you did in the past week

Mon, 29 Sep 2014 12:28:00 PDT

At Ning, we have a weekly meeting where we give feedback to the team based on how the week went. However, it's hard for me to remember the most important things I did in the past week.

The following git command will help. It gives you the commits from the past week sorted by number of lines:
git fetch; git log --author=Aquino --shortstat --pretty=format:'%C(yellow)%h %C(blue)%ad (%ar) %C(green)%cn %C(reset)%s' --date=short --since='1 week ago' "--remotes=*" -C | perl -ple 's/.*, (\d+ insertion).*/\1/' | perl -0 -ple 's/(.*\d\d\d\d-\d\d-\d\d.*)\n(\d+) insertion*/\2 \1/g' | sort -nr | less
(Make sure to replace Aquino with your name.)

It produces output like this:
90 0d9214a 2014-09-26 (3 days ago) Jonathan Aquino ABC-487: Extract uploading code into AbcUpload class.
68 0978007 2014-09-25 (4 days ago) Jonathan Aquino [no-jira] Remove hardcoded numbers...
54 d28dc90 2014-09-23 (6 days ago) Jonathan Aquino ABC-330: Make cropping actually work.
52 94afa2f 2014-09-24 (5 days ago) Jonathan Aquino [no-jira] Show full text of post in the detail view.
47 77e4710 2014-09-25 (4 days ago) Jonathan Aquino ABC-487: Extracted controller function into AbcCamera...




Final causes

Fri, 01 Aug 2014 08:40:18 PDT

I'm interested in understanding more about final causes, after reading Edward Feser's blog post, The Return of Final Causality, and the paper it links to, Does Efficient Causation Presuppose Final Causation.

What is a final cause? From what I understand, Aristotle said that every change requires four things (four "causes"):

  • efficient (the doer of the change)
  • material (what the changing thing is made of)
  • formal (the nature of the changing thing, common to all things of that type)
  • final (the normal result of doing what the doer is doing)
For some reason, most contemporary philosophers reject #3 and #4. I'm not sure why.

The basic idea of a final cause is given by the last sentence of the paper:
It is not empty to assert that all efficient causes are aimed at something.
Sometimes when you do something, the result is different than normal. Regarding this, the paper quotes Aquinas:
...in inanimate beings, the contingency of causes arises from imperfection and deficiency: because by their nature they are determined to one effect, which they always produce, unless there be an impediment due either to weakness of power, or some extrinsic agency, or indisposition of matter. For this reason natural causes are not indifferent to one or other result, but more often produce their effect in the same way, and seldom fail.
 I am going to re-read Feser's book The Last Superstition. Some questions I will have in mind while reading it are:

  1. I would like to understand Aristotle's ideas better (act and potency, form and matter, the four causes.)
  2. What reasons have we to believe that these ideas are true?
  3. Which of Aristotle's ideas do moderns reject and why?
  4. What problems does the rejection of these ideas cause?


Media Files:
http://philosophy.ucr.edu/wp-content/uploads/2013/07/Does-Efficient-Causation-Presuppose-Final-Causation.pdf




On Purpose in the Universe

Sat, 14 Oct 2017 22:52:43 PDT

Atheism doesn't work for me because it is connected to the idea that there is no purpose in the universe, no purpose in a person's life. Aristotle, on the other hand, argues that purpose is a fundamental part of reality (one of his Four Causes).

I fully agree with something that Steve Jobs said in his Stanford commencement address: "You can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something - your gut, destiny, life, karma, whatever." In atheism, you can't have that magic. You are pitted against a hostile environment of random chance, illness, and misfortune. But in Catholicism, there is purpose: purpose in good things, and God can even pull good out of evil things. It is about life, hope, love, and flourishing; in other words, purpose. And I like that.




Continuing quest to wean myself off Google services

Sat, 14 Oct 2017 22:51:22 PDT

I found a good replacement for google.com and the Chrome browser, and they are both from Yandex, which is a search engine based in Russia. (Those Russians are smart!)

Replacement for google.com: yandex.com. It seems to give better search results than DuckDuckGo... maybe. I'm continuing to try it out, but it is looking good so far.

Replacement for Chrome: Yandex browser. It is based on the open-source Chromium project. (Review.) And you can install 1Password on it via the Chrome web store.




What I like about zsh

Sat, 14 Oct 2017 22:50:24 PDT

I've been using zsh as my shell for a few weeks now, and I quite like it. Here's why:

  • I can customize the prompt to show the current directory, the current Git branch (and whether it is dirty), and the current time.
  • The history-substring-search plugin lets me type in any substring and press the Up arrow, and it will show me history entries matching that substring (with the match highlighted in purple).
  • History is shared across shell instances. And I can save a year's worth of history to a file.
  • I can replace a substring in the previous command by doing ^foo^bar^:G
  • When I mistype a command or script name, it offers suggestions.
  • When I do !456, it confirms which command that would run.
  • I can do "less **/XG_Media*" to open a file buried in some subdirectory, e.g., src/main/webapp/lib/XG_MediaUploaderHelper.php

I also like running zsh in iTerm2. iTerm2 is cool because:

  • It lets me map Alt+Arrow and Command+Arrow to behave like I want them to.
  • It offers auto-completion using all strings in the window, when I do Command+;
  • It lets me use the Solarized theme.
  • It has a couple of cool features that I don't use much yet:
    • Find text
    • Instant replay



Hotmail lets you use custom domain for free

Sat, 14 Oct 2017 22:49:15 PDT

It takes some setting up, but you can map any custom domain to your Hotmail account. I don't think any other free email service offers custom domains.

https://domains.live.com




On Heaven

Sat, 14 Oct 2017 22:48:25 PDT

I used to think that heaven is a place with wide expanses of green grass, blue skies, and billowy clouds. Yeah, God is there, but the main thing was to get to this wonderful Place.

But now I understand it to be different. Heaven is more like entering God. At least that's how I understand this quote from the Catechism of the Catholic Church:

The ultimate end of the whole divine economy is the entry of God's creatures into the perfect unity of the Blessed Trinity. But even now we are called to be a dwelling for the Most Holy Trinity.

Which I think is pretty cool.




Elo Preference Ranker

Sat, 14 Oct 2017 22:47:11 PDT

This little tool helps you to rank a list of your preferences by comparing them a pair at a time. 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.

It uses the Elo ranking algorithm, which is used to rank chess players based on whether they win/lose/draw against each other. The more pairs you compare, the better. Once you have compared all combinations, the process ends.

What is this good for? Suppose you are buying a home or a car and you have several dozen preferences, and you want to know, which of these are most important to me, and in what order? Or suppose you are working through What Color Is Your Parachute? and you want to sort your list of skills and interests to find your favorite ones. Simply throw your list into the tool and start ranking them.

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.

You have finished comparing all items!

Sorted Output Strings

The sorted strings are:





The Facebook Like Bug

Sat, 05 Aug 2017 23:02:24 PDT

I'll be honest - there are certain kinds of debugging that stress me out - such as when the bug is intermittent. One example is a bug that I've been looking at for the past day and a half: for quite a while, our users have been finding that Facebook Like buttons aren't working on their sites. They click Like and the popup appears for a second before disappearing. And it doesn't happen all of the time.

Well, we finally carved out some time this week to take a look at the issue. And yes, I could reproduce it yesterday. So I did my tried and true method of "deconstruction", in which I keep taking things away from the page until the problem stops. Well, I whittled the page down to just the Facebook Like snippet and it was still happening. So it was something to do with the URL we were giving to the Like button.

And then I couldn't reproduce it anymore.

Anyway, I was able to reproduce it again today. I put a bunch of Like buttons on a page: some that worked, some that didn't. And I eventually got it so that the only difference was that the Like buttons that didn't work had URLs that redirected to another URL.

By the way, throughout this saga, I was trawling the Facebook Bug Database and Stack Overflow for a silver bullet - someone who fixed the problem and here are the steps. I couldn't find any silver bullet, but it was still valuable because I heard mention of the Facebook Debugger, which sometimes fixes things when you put a URL through it because it clears Facebook's cache.

I tried putting my URL into Facebook's Debugger but it didn't fix my Like button. But I took a second look at the debugger results, and 'lo, there were some warnings about missing OpenGraph tags. I browsed around a bit and found that three of those tags are required (og:type, og:url, and og:title). So I put those tags on my page and...

yes...

the problem was fixed! Yay!




What's on your dock?

Sat, 05 Aug 2017 23:00:48 PDT

Tell me what's on your Mac OSX dock. These are the apps that you value the most.

Here's what's on my dock right now:

  • Finder
  • PostBox
  • Calendar
  • Adium
  • Notational Velocity
  • jEdit
  • iTerm2
  • Safari
  • Firefox
  • 1Password
  • Network Connect
  • Colors
  • Clock Chimes
  • iTunes
  • App Store
  • System Preferences
  • Microsoft Excel



Useful Git tool: tig

Sat, 05 Aug 2017 23:01:33 PDT

Here's a great article describing a useful Git tool called tig.

One thing it doesn't mention is that you can actually press comma (,) when doing a tig blame, to do a blame on the parent commit. This is useful if the blame on the current commit isn't showing who really changed the line. You can do blame on the line all the way up the parent tree.

Other tig tips:

  • Use this to browse the tree of another branch: tig origin/rel-1.5.
  • If while browsing the commits on another branch you press Shift+C on a commit, it will cherry-pick it into your current branch.



Ideas for what to write in cards

Sat, 05 Aug 2017 22:57:59 PDT

Here's a great list of ideas for what to write in a card, if you're stuck for ideas. From Hallmark.




Japanese method of folding t-shirts

Sat, 05 Aug 2017 22:56:43 PDT

I use this.

width="420" height="315" src="https://www.youtube.com/embed/b5AWQ5aBjgE" frameborder="0" allowfullscreen="">




Moving away from Google products: an experiment

Sat, 05 Aug 2017 22:56:00 PDT

I'm doing an experiment to see how well I can live without Google products. They have served me so well for so long, but I don't want to depend on them too much. So I have made the following moves:

  • Google search => Duck Duck Go
  • Gmail => Hotmail
  • Blogger => Ning
  • Chrome => Safari

So far, it has been OK!




Design email newsletter for programmers

Sat, 05 Aug 2017 22:55:22 PDT

Here's a great weekly email newsletter about design for programmers: Hack Design.

I was reading one of the newsletter articles today, called Making the Transition from Development to Design. It had some good quotes, such as these ones:

I think the future designer is going to look and act a lot more like a design technologist.

Avoid pixel-pushing at all costs – your job is to solve problems.

Our ideas should be bigger than reality, but our execution should be married to it.




Today's bug hunt

Sat, 05 Aug 2017 22:54:49 PDT

Today I worked on finding and fixing a bug that is difficult to reproduce. In fact, I couldn't reproduce it. So I had to look at the code and reason where the bug could possibly be located. From the error message in the bug report, I narrowed it down to a particular JavaScript file. And it sort of looked impossible that the bug could ever occur. Basically, the error message said that a variable was undefined, but we were clearly defining the variable before we were using it.

Or were we? It turns out that one of the places that used the variable was in a public method. So after thinking about it for a bit, it dawned on me that this method could be called before the object finished getting fully initialized. To prevent this, we always make sure to put all JavaScript that must run on page load in an "addOnRequire" callback. Anyway, the team that wrote this code doesn't work on this product much so they didn't do that.

So I thought about emailing the team to make them aware that they should use addOnRequire(). But then, they are not currently working on the product, and might not be for weeks or months, so how would they remember? So then I thought, I'll write a test that scans the JavaScript files to catch this pattern. Since our tests run frequently, we'll catch this problem any time it arises in the future. Cool!




An unobtrusive break reminder, for Mac

Sat, 05 Aug 2017 22:54:11 PDT

I was having trouble finding something to remind me to take an exercise break every hour or two. A lot of the break timers out there dim the screen and force you to press a button if you want to postpone it. This is problematic for programmers like me - you get into the "flow", and interruptions like that break your concentration, which is Not Good.

It turns out that it's not terribly hard to create your own (unobtrusive) break timer. Here's one that simply shows a Growl notification and makes a sound every hour, on a Mac with growlnotify installed:

breaktimer.sh

#!/bin/bash

while true

do

growlnotify -m "Take a break"

afplay /System/Library/Sounds/Blow.aiff

sleep 3600

done





On the importance of leisure

Sat, 05 Aug 2017 22:51:45 PDT

Likewise, your question refers to the classical notion of leisure, to the question, as I like to ask it: “What do we ‘do’ when all else is done?” As Pieper pointed out in his famous book, the Greek word for leisure, skole, is the origin of our word for school. The denial of leisure becomes the classical word for “business,” both in Greek and Latin. Thus, the time we devote to keeping alive, to making a living, while necessary and important, is not primarily time “for its own sake.” This latter time is the time beyond business. It is in this latter time that we should be “free” to think of the highest things. Not to have such time is to be a kind of slave to this world.

From an Interview with Fr. James V. Schall, S. J.




Soy Sauce Puzzle

Sat, 05 Aug 2017 22:50:59 PDT

So this is something that happened to me a few days ago, and it makes for a nice puzzle.

My wife asked me to pour soy sauce and vinegar into two saucers, equal parts (1:1 ratio).

I poured the vinegar into each saucer. But then I poured twice as much soy sauce as was needed into the first saucer.

Question: How do you fix this easily?

My wife solved it without thinking.




Growly Notes - like OneNote but for Mac

Wed, 06 Feb 2013 13:13:26 PST

I'm trying out a free Mac app called Growly Notes. I need a kind of "space" in which to record ideas, and I need it to be organized so I can find it again quickly later. This app may fit the bill. It has a bit of a following. And it's colorful, which is nice.

Also see the Lifehacker review.



Pine cones open up when you bring them inside

Fri, 23 Nov 2012 07:56:16 PST

My fiancee has been collecting pine cones for room decorations, and one cool thing we discovered is that they open up after you bring them inside. I'm not sure if it's caused by the warmth or the dryness or something else.

A day or two after you bring them in, you'll see that they gradually splay open. Evidently they are doing this to expose the seeds inside.