For people who like to make things

Blog Archive

Goodbye, Twitter (Updated)

Wed 06 December 2017

After more than nine years on Twitter, I finally deactivated my account. I refuse to contribute to the success of any platform that promotes the hatred of the villainous Donald Trump. I hope Twitter CEO Jack Dorsey never has to face the persecution that the vile Trump is trying to inflict on people like me. However, if anyone deserves it for enabling hatred, it is him.

You can find me here, and on micro.blog.


Update 1/8/2018: After two weeks away from Twitter I came back when I learned that Twitter suspended the hateful account that was retweeted by Trump. There is a story about that here.

It was this action that prompted me to re-enable my account.

Those two weeks I wondered if I made the right decision. There are people I care about that I can only contact on Twitter. When I saw the news above, it was enough to change my mind. I would have been happier, of course, if they had removed Trump’s account.

more...

CocoaConf: How I Prepared, & What I Learned

Sun 30 April 2017

Last week I attended CocoaConf Chicago for the 6th year in a row. In this post I would like to share with you how I prepared as a speaker, and what I learned as an attendee.

more...

Running External Commands in LLDB via Python

Wed 11 January 2017

Many iOS apps today are clients of some sort. They request data from a remote server. Typically this data is served over HTTP (with SSL) and formatted as JSON. At FastModel Sports our iOS app is constantly requesting large amounts of JSON data. While debugging the app I inevitably have to compare what I’m displaying in my views to what the server sent me.

This meant saving the server response into an NSString, printing it out to the console with NSLog, copying that output, switching to Terminal, pasting that output into a file and then running jq on that file. That’s a lot of steps. In this post I’ll show you how to do all of that directly from the LLDB command prompt.

more...

Rotation and Adaptive Layouts

Tue 27 December 2016

Another in a series of posts documenting my process of updating an aging app.

For this rewrite of Qur’an Memorizer I’m using Auto Layout. This is the first time I’ve used Auto Layout for this app. You know when the Apple Engineers said Auto Layout makes things easy? They weren’t kidding. Even though Qur’an Memorizer has some unique behaviors for autorotation, I was able to implement this in a few hours with Auto Layout and about 25 lines of code. Read on to see what I did.

more...

Updating an Aging App

Sun 25 December 2016

It’s been more than three years, but I’m finally updating my most popular app, Qur’an Memorizer. This is the first in a series of blog posts tagged with QMUpgrade, where I’ll write about the issues I faced updating an aging app.

more...

Examining JSON Data With jq

Tue 25 October 2016

Earlier tonight I spoke at NSCoder Chicago about how to use jq to examine JSON data. This post contains links and information that I would like to share with the attendees.

more...

Letterpress Symmetry

Sun 28 August 2016

This is the first in a series of posts where I share the final screen of Letterpress games. When I was showing my daughter this game, she mentioned that she liked it when games ended in pleasing patterns. So then I started to try to win (or lose) games with a symmetric pattern, if possible.

Most of the patterns are symmetric about an axis (reflection). Some display rotational symmetry. Where possible, I will also include a link to the replay URL of the game. Here’s my first one.

more...

My Tiny Challenge

Tue 01 December 2015

Well, it’s happened. I decided to join @jaimeejaimee and @bradheintz in another 30 days challenge. This month’s challenge isn’t about writing. It’s about playing the long game and changing my body. A little background, first:

more...

Shapeshifting DIY Robots

Tue 01 December 2015

Last night, right before going to bed, I decided to play The Room 3. It’s a beautiful game with elaborate puzzles. I was completely lost in the world of intricate models and mind-bending transformations. Later that night I had the most awesome dream:

more...

Tools I Use in Class

Sat 26 September 2015

I’d like to share with you the various tools that I’ve found work well for my iOS class. I’ll show you what I use for video, displaying keyboard shortcuts, slides, and class notes.

more...

Level Up In Photography

Sat 12 September 2015

Remember what I said a few days ago about fitness? “Just show up”? Today is such a day with this blog for me. I’m tired, I have a headache and I would rather not write. But I’ve shown up, with the idea that a small, helpful blog post is better than nothing. So, here goes. I’m gonna talk about taking better pictures.

more...

30 Days to Life

Tue 01 September 2015

As I started planning what to write about for my 30 days posts, I realized that this isn’t the first time I’ve been exhorted to try something for 30 days. In fact, I’ve been doing this every year for about 30 years.

more...

30 Days

Mon 31 August 2015

Inspired by @jaimeejaimee and reminded by @bradheintz, I too will start a #30days writing experiment tomorrow. Let’s give it a shot.

more...

Thanks for the memories, CocoaConf

Sun 26 April 2015

Last week at Yosemite by CocoaConf was one of the most memorable weeks of my life. I would like to thank all the people who helped make it such a wonderful event.

more...

Switching from being a consumer to a creator

Fri 24 April 2015

Three talks at the Yosemite by CocoaConf conference made me think about my relationship with Twitter and convinced me to switch from being a consumer of social media to a creator and a writer.

more...

Viewing OmniGraffle Files in XCode

Tue 17 February 2015

When I work on complex iOS apps, I like to diagram the complex relationships between classes and subsystems in OmniGraffle. In this post I’ll show you how to add OmniGraffle files to XCode, view them from within XCode and keep them updated automatically.

more...

Recreating David Hobby’s Profile Picture

Sat 01 February 2014

When you’re a beginner learning a new skill, it’s okay to try to recreate the Masters’ works as practice (in private). With that in mind, when I was learning to use external flashes with the Fuji X100S I gave myself the task of recreating David Hobby‘s iconic profile picture. I asked David for his permission to blog about it and he graciously granted it. There are serious ethical issues involved with publishing this sort of practice work. To jump directly to that discussion, go here.

more...

PostgreSQL Advisory Locks

Thu 14 November 2013

A recent post by Derek Parker introduced me to advisory locks in PostgreSQL.
Advisory locks are a very straightforward way to prevent multiple instances of a program from running at the same time. However, there are some cases when you shouldn’t use the database to enforce this constraint.

more...

Links from my Sublime Text Talk

Tue 10 September 2013

At today’s CocoaHeads meeting I gave a little demo of Sublime Text 3.
I’ll write a more detailed blog post about why I chose Sublime Text in the near future. In the meantime, here are the links:

more...

Dropping a Napalm Bomb on a School

Fri 30 August 2013

A Syrian fighter jet apparently dropped a napalm bomb on a school playground. Tragically, just another day in Syria. It’s images and scenes like this that anger me all the more when people tell me their opinions on foreign policy using statements like “Syrians are stupid.”

more...

Evolution of Objective C Database Code

Mon 06 May 2013

First

One of the features of Qur’an Memorizer, my first iOS app, is the ability to highlight a verse (ayah) when it’s tapped. To do this I access a database of verse x and y locations and retrieve the 4 coordinates I need to draw the resulting polygon.

The first version of the code released to the App Store looked a little bit like this:

more...

More on Passwords

Mon 24 September 2012

After my recent Blitz Talk at SecondConf I had some great conversations with fellow attendees in the meal lines and around the beverage table. I’m presenting them here for further discussion.

more...

Not as expected

Sun 01 July 2012

Over the past year I have written about moving over to Google+ and switching away from emacs. Both of those experiments didn’t achieve the intended results. I told you I’d keep you updated, and now I’ve added some updates to each of those articles.

more...

Excluding Yourself From Google Analytics

Tue 20 December 2011

In my last post I wrote that I followed some instructions to exclude myself from Google Analytics’ reports on my Octopress blog. There was an error in the Javascript that was preventing the required cookie from being set. Here’s what I did that finally worked:

more...

How To Wrap Text In Vim

Wed 07 December 2011

[Another in my series of posts on Vim]

If you’re writing natural language text you may wish to format your paragraph so that the text wraps before lines get too long. Here’s how you do it:

To set the maximum width of a line of text, go to Normal mode and enter

:set textwidth=72
more...

Understanding Your Camera’s Histogram

Mon 05 December 2011

In a previous blog post we learned what a histogram is.  In today’s post we’ll see how to use histograms to help take properly-exposed photographs.  If you haven’t read the previous post, or are not familiar with histograms, I would recommend you read that post before continuing with this one.

more...

Inspiration vs. Imitation

Mon 05 December 2011

Jessica Hische has just published a very well written article on “why it’s ok to copy people to learn, but never ok to publish that work.”  I love the tone of her writing.  Even though I’m not a designer and won’t ever be as good a letterer as she is, I hope to be able to write as well as her.

more...

How To Quickly Delete Words While In Insert Mode In Vim

Fri 02 December 2011

[Another in my series of posts on Vim]

Sometimes when you’re typing natural language text, you find yourself wanting to rephrase the sentence you’ve written so far.  You could hit backspace many times to delete the characters to the left of the cursor, or you could type Ctrl-W.  When you’re in Insert mode, Ctrl-W will delete from the cursor to the beginning of the previous word.

more...

How To Insert A Line Of Dashes In Vim

Mon 28 November 2011

[Another in my series of posts on Vim]

If you’re a developer, you will often find yourself having to insert a line of dashes or hashes (#) or asterisks into your comments.  In this post I’ll show you how to do this quickly.  Memorize this because you’ll wind up doing this often.  Position the cursor to the beginning of a blank like (in command mode) and enter the following:

80a#<ESC>
more...

There and Back Again - A Hacker’s Switch from Emacs Back to Vi

Mon 21 November 2011

When I first learned how to exist on UNIX, in 1988, I used vi as my primary editor. During the next nine years I taught myself how to become a power user - migrating from the simple motion and copy and paste to more complex skills like marks and named registers. When I started graduate school I saw many of the professors and grad students using emacs.  I tried it out a couple of times, but it was not until 1997 that I decided to take the time to stick with emacs and take the time to learn the right way to do things even when I could get the job done faster in vi.

more...

Backing Up Data With rsync

Sun 18 April 2010

In a earlier post I wrote about how important it is to have your data backed up.  On my Macs, my main backup utility is Time Machine, which comes pre-installed with the Mac OS.  Time Machine can also back up external hard drives, even though it may not be obvious how to do it.  This article shows you how to change the default settings to do this.

more...

Google Now Considers Website Speed In Its Ranking

Sat 10 April 2010

Google reported yesterday that their search engine will now include a website’s speed in the list of factors it uses to decide how high to rank the site in its search results.  In this post I consider what this means for web developers and what steps you can take to make your site faster.

more...

Firefox Search Shortcut

Sat 03 April 2010

Wow.  This cool Firefox feature has been around since 2005, but I just found out about it a few months ago!  I swear I haven’t been living in a cave all this time.  So if you’re like me and don’t know about this yet, listen up:  In Firefox, you can bookmark a search with a keyword, and then use that keyword in your URL entry field.  As this article shows, you right-click on the input field and select “Add a Keyword for this Search.”  This will allow you to bookmark the search and add a keyword.  I usually use two letter keywords like ‘we’ for weather.com and ‘im’ for imdb.com.

more...

TaskForest Write-up at SourceForge

Fri 02 April 2010

SourceForge.net has a blog in which they feature a different hosted project every day.  Today’s blog entry features my open-source job scheduler, TaskForest.  I’d like to take this opportunity to thank SourceForge for their support of open source software.

more...

The Performance Cost of Using WordPress

Wed 31 March 2010

Happy with my experience with a custom WordPress installation for this blog, I decided to try using the blogging platform for the TaskForest website.  The two main reasons were the ease of creating RSS feeds and the ability for users to comment on posts or articles.  After a few days of tinkering around, I’ve come to the conclusion that, at least for TaskForest, WordPress would cause more problems than it would solve. Here’s how I came to that conclusion:

more...

Don’t Submit Photos To Frommer’s Contests

Fri 12 March 2010

I’m not a professional photographer.  I’m merely an student of  the art and science of photography.  Sometimes I think of submitting my pictures to contests or for use by others - not for the money, but for the personal satisfaction.  Now after reading this post by Bob Krist, I’ll make sure to pay attention to photographers’ rights when I submit my pictures anywhere. I will also refuse to buy any product from Frommer’s Travel Guides, and urge you to do the same.

more...

David duChemin On Being A Professional Photographer

Wed 10 March 2010

I recently discovered David duChemin’s blog.  I’d like to share a couple of his posts with you.  In ‘Just?’ he offers advice to people who consider themselves ‘just an amateur photographer.’  In his follow-up piece ‘Confessions of a So-Called PRO he serves up an ‘anti-pep-talk’ that demonstrates that professional photographers aren’t necessarily that different from amateurs like you and me.

more...

Adding A Grid To Your Websites

Fri 05 March 2010

The #grid website has a great tool for web designers -it “inserts a layout grid in web pages, allows you to hold it in place, and toggle between displaying it in the foreground or background.”  Go to their website and have a look.  It’s pretty impressive. Simple, but impressive.  I think I’m gonna give this a shot for the next web site I design.  I think it would be really useful in development, not as much in a production environment.

more...

The Most Dangerous Programming Errors

Fri 26 February 2010

The Common Weakness Enumeration (CWE) has released their list of Top 25 Most Dangerous Programming Errors. This list and the explanations of the errors are very instructive and should help both novice and expert programmers.  If you’re a developer, I strongly urge you to read this document and make sure you understand the concepts it covers.

more...

Navigating the Directory Stack in ‘bash’

Sat 20 February 2010

If you’re like me, you spend a lot of time jumping from project to project in a Linux shell.  I find that I have to switch back and forth between directories.  The bash shell has commands to maintain a stack of directories.  I’ve written some functions that use these utilities to make directory navigation easier. I’ve found these functions very useful, and perhaps you will too. Let’s see them in action first with some examples, and then look at the code:

more...

Follow up: Google Admits Buzz Was Only Tested Internally’

Tue 16 February 2010

In yesterday’s article about Google Buzz, I guessed that “the problem was that the population for whom the system was designed wasn’t necessarily the only population actually using the system.”  I gave Google the benefit of the doubt:

I am certain Google tested their application thoroughly.  They’ve been known to do extensive usability tests for the seemingly tiniest of changes to their web site.  But even the most well-implemented tests are incomplete if they’re not performed on a statistically representative sample of the audience.

But today, the BBC reported that Google has admitted that they only tested Buzz internally, and bypassed their regular rigorous testing procedures — possibly in an attempt to get it out the door as soon as possible. I’ll let the pundits decide if it did more harm than good to the firm, but it’s a warning to other software developers: skipping testing can lead to embarrassing failures.

more...

Sometimes Testing Isn’t Enough

Mon 15 February 2010

In the first few days after the release of Google Buzz many people (including myself) criticized Google for exposing their users’ private information.  This was a couple of weeks after Apple got a lot flak for their unfortunately-named iPad, and the same week that we heard reports of a woman who broke up with her boyfriend after finding some suggestive text messages on his cell phone - messages that came pre-loaded on the phone.  I think that all these cases were not caused by a lack testing, but by testing the wrong audience.  Let’s examine these three cases and see what we can learn from them:

more...

What Is An F-Stop?

Thu 04 February 2010

In a previous article we looked at how lenses work.  We learned about the focal length.  Today we’ll focus on camera lenses and what the term f-stop means.

The term f-stop is a ratio.  It has no dimensions.  You don’t measure an f-stop in meters, inches, kilograms or even degrees Fahrenheit.  An f-stop is the ratio of two distances.  It’s the ratio of the focal length of a lens to its diameter.  In figure 1, the f-stop is f/d _where _f is the focal length and _d _is the diameter.

more...

Digitally Blending Photos With Adobe Photoshop

Mon 25 January 2010

I’m interested in tinkering with High Dynamic Range photography, but before I get Photomatix, the software that’s recommended most often, I thought I’d try out a technique that’s a very crude approximation of HDR.  It involves taking one image that’s underexposed, and one that’s overexposed, and merging them in Photoshop.  The technique is described in this article at luminous-landscape.com.  Essentially, you put the underexposed image in a layer above the overexposed one.  Create a layer mask on the darker layer, and copy the brighter image to the layer mask. Apply a Gaussian blur to the layer mask, and you have your blended image.

more...

© 2019 Aijaz Ansari
The Joy of Hack by Aijaz Ansari is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Powered by Pelican