Blog Archive
TMUX
There are times when I have to log into Linux systems that don’t have window managers. I have a single terminal window in which to work. With the help of tmux, I can have multiple virtual windows in my single window. Each window can be split into panes. I can also save sessions so that I can bring the environment back after I disconnect from the system and reconnect several days (or weeks or months) later. In this blog post I’ll share the most important tmux commands.
Keyboard Maestro Snippet Video
I’m gonna have to blog about how I did this (later). I’m giving a live-coding talk on Tuesday. I was gonna use Snippety but it lacks a minor feature and I didn’t wanna bug the author Marin Todorov this week of all weeks. So I hacked up a pretty workable facsimile using KeyboardMaestro.
Cat
I have became that person who takes tons of pictures of his cat.
Panorama Point
-
© 2022 Aijaz Ansari, and is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License ↩
QuranReflect
After exactly two long months of development, and just in time for Ramadan, I’m pleased to announce the public release of my latest app, QuranReflect
Goodbye, Twitter (Updated)
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.
CocoaConf: How I Prepared, & What I Learned
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.
Running External Commands in LLDB via Python
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.
Rotation and Adaptive Layouts
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.
Updating an Aging App
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.
Examining JSON Data With jq
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.
Letterpress Symmetry
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.
My Tiny Challenge
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:
Shapeshifting DIY Robots
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:
Tools I Use in Class
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.
Open Workouts
This is one of my favorite things about the Workout App on the Apple Watch: the ability to start a workout without having any specific goal in mind.
I love that I can just start and see where the workout takes me. There’s no pressure reach a certain time or calorie count. I can just play it by ear.
See you tomorrow.
This is the 13th of my 30 days posts.
Level Up In Photography
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.
Walking and Running to Explore New Places
I’ve hated running for ever. I first tried running for exercise by the shore of the Indian Ocean when I was fourteen. Didn’t get very far. Did get a bad case of shin splints. Over the next couple of decades I tried again a few times, but never really got into it. Every time I tried the result was the same: it was painful, frustrating, and just not fun. I tried focusing on mechanics, but it was making running just that: mechanical.
How Not to Recruit
Someone asked me if I wanted to work for them this morning. But they did a really poor job doing it.
30 Days to Life
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.
30 Days
Inspired by @jaimeejaimee and reminded by @bradheintz, I too will start a #30days writing experiment tomorrow. Let’s give it a shot.
Thanks for the memories, CocoaConf
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.
Switching from being a consumer to a creator
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.
Viewing OmniGraffle Files in XCode
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.
Recreating David Hobby’s Profile Picture
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.
PostgreSQL Advisory Locks
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.
LinkedIn Can Read Your Emails
The stupidity of this is mind-boggling. Essentially, LinkedIn is asking you to insert a man-in-the-middle IMAP server that parses ALL your email and modifies the body so as to ‘enhance mobile email, giving professionals the information they need to be brilliant with people.’ The following tweet from Justin Miller first brought this to my attention:
Links from my Sublime Text Talk
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:
Dropping a Napalm Bomb on a School
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.”
A List of iOS URL Schemes
A handy wiki page that lists URL schemes being used by iOS apps is no longer being mantained. I copied the page over to this site in an effort to preserve the data and continue accepting submissions.
Evolution of Objective C Database Code
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:
Using Octopress as a Photo Blog
As an amateur photographer I like displaying my photos on my blog, especially when there are particularly interesting stories behind them. In this post I’ll show you how to modify the default Octopress theme and add a type of layout that highlights a single photograph. You can see an example of this in this sample blog.
More on Passwords
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.
Protecting Your Users’ Privacy
Here are the slides and links from my recent Blitz Talk on password security at SecondConf.
Update: I have just posted some followup discussions in a new blog post.
Horseshoe Bend
This is a bend of the Colorado River located near Page, Arizona. In Page you can find the famous Antelope Canyons.
Bokeh Fireworks
I attended the Glendale Heights SummerFest fireworks display last night. As the fireworks started I tried to take a video of them on my iPhone. I must have placed my finger in front of the lens because the focus locked on a short distance (as opposed to the infinity needed in such situations). The resulting bokeh was unexpected but very beautiful.
Not as expected
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.
Excluding Yourself From Google Analytics
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:
How To Wrap Text In Vim
[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
Understanding Your Camera’s Histogram
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.
Inspiration vs. Imitation
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.
How To Quickly Delete Words While In Insert Mode In Vim
[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.
How To Insert A Line Of Dashes In Vim
[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>
A Different Kind Of Running
I don’t like running unless I’m running towards something or away from something. But I do run often because of the health benefits. I’ve always thought the right way to run was to land on my heel and then transfer the weight to the ball of my foot, and finally the toes. Now according to this article and this site I may have been doing it wrong.
There and Back Again - A Hacker’s Switch from Emacs Back to Vi
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.
Glen Ellyn Volunteer Fire Company
Fire marks were used in the 1700s to designate homes or buildings protected by the fire insurance companies. They were generally oval plates placed on the outside of a structure to let volunteer fire brigades know which buildings carried a “reward” if saved.
You can read more on this here.
Backing Up Data With rsync
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.
Google Now Considers Website Speed In Its Ranking
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.
Firefox Search Shortcut
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.
TaskForest Write-up at SourceForge
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.
The Performance Cost of Using WordPress
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:
Don’t Submit Photos To Frommer’s Contests
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.
David duChemin On Being A Professional Photographer
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.
Adding A Grid To Your Websites
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.
The Most Dangerous Programming Errors
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.
Navigating the Directory Stack in ‘bash’
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:
‘Follow up: Google Admits Buzz Was Only Tested Internally’
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.
Sometimes Testing Isn’t Enough
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:
Why Should I Use CPAN?
I came across some comments made about an open source program that I had written in perl. The user was complaining about how he couldn’t get it to install. The reason was that the program relies on other modules from the archive of open source perl software known as CPAN (Comprehensive Perl Archive Network), and one of them failed to install.
What Is An F-Stop?
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.
Digitally Blending Photos With Adobe Photoshop
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.