The new home will bet at veganswithtypewriters.net once I finsih getting things set up. If you want to stop by and check it out, the beta non-responsive version of the site is up now.
CBC Report: Free Android App Allows Easy Credit Card Skimming →
via CBC News
Using a Samsung Galaxy S3 -- one of the most popular smartphones available in Canada -- and a free app downloaded from the Google Play store, CBC News was able to read information such as a card number, expiry date and cardholder name simply holding the smartphone over a credit or debit card.
Time to start carrying the tinfoil purse I guess.
Title Case THIS
title: Title Case THIS date: April 20, 2013 category: Mac Nerdery tags: Objective-C
Panning for gold in the stream that is Twitter this afternoon led to a pretty good nugget from Gabe over at Macdrifter in the form of a blog post by Megan Taylor titled “I finished Codecademy, now what?” Megans post is a compilation of resources aimed at Python, Javascript and PHP developers who have finished up introductory level courses and are looking for places to apply their newfound skills.
One thing led to another and I founf myself over at reddit’s Daily Programmer board. The first challenge I tried was the easy level Title Case. Basically, the task was to write some basic code that would capitalize a string. The catch was that your code needed to not capitalize certain words that appeared in a list of exceptions, except if the word was the first word of the sentence. Here is my crack at the solution, in Objective-C:
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSString *theInput = [@"sometimes THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG." capitalizedString];
NSArray *theExceptions = [[@"jumps, the, over" stringByReplacingOccurrencesOfString:@" " withString:@""] componentsSeparatedByString:@","];
for (NSString *exception in theExceptions) {
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:exception options:NSRegularExpressionCaseInsensitive error:&error];
theInput = [regex stringByReplacingMatchesInString:theInput options:0 range:NSMakeRange(0, [theInput length]) withTemplate:[exception lowercaseString]];
}
NSMutableArray *result = [[theInput componentsSeparatedByString:@" "] mutableCopy];
result[0] = [result[0] capitalizedString];
theInput = [result componentsJoinedByString:@" "];
NSLog(@"%@", theInput);
}
return 0;
}
A couple of Javascript tutorials
Things have been kind of quiet in the Vegans With Typewriters labs on the Objective-C front lately. GDIP is somewhat stable and I haven’t really been motivated to mess with it lately, mostly because I’ve been putting things back together after replacing the hard drive in my iMac, but partly because I was trying a demo of a codeless document based core data app that just would not load the document I had just saved. I ended up putting Xcode down for a while and having a look at some other stuff.
One of the other things that I’ve been playing with is setting up my own server from scratch. Eventually, I’d like to move the Vegans With Typewriters blog to a platform that I have a little more control over. Squarespace is nice and everything, but for some reason I just can’t seem to wrap my head around their template system. As much as it pains me to say it, for me, php and Wordpress is slightly less inscrutable and there are a lot more examples and tutorials out there on how to customize it.
That being said, tonight I was dicking around with Javascript (my first somewhat serious attempt at it) and I found a couple of great free tutorials over on YouTube. They’re both by Derek Banas and can be found here and here.
The first tutorial is a 31 minute plow through the fundamentals of the language covering the basic syntax and flow control. The second tutorial is a pretty good introduction to monitoring events such as onMouseOver() and stuff like that.
If you’re interested in playing around with Javascript, pur yourself some coffee, fire up your favourite text editor, and give these a watch. You’ll be surprised at how easy it actually is to do stuff.
Running Shell Scripts on a Mac
Dear Vegans With Typewriters,
I’m trying to do XYZ on my Mac and I need to run a shell script to set it up. How do I do this?
Thanks
Bill in Cincinatti
Ok, so this didn’t really happen. What did happen though was I was doing some maintenance on my budding git repositories, and thanks to Brett Terpstra’s Vulcan logic, you were spared an article on how to set up Hazel to automatically add a .gitignore files into new git repositories. Instead, I just set up a .gitignore_global file located in the root directory of my Dropbox folder. In order for this to work, I needed to tell git that there were new global ignore settings by typing git config --global core.excludesfile ~/path/to/.gitignore_global
During this process, I decided that this might be something handy to automate if I need to set it up on another machine, so I wrote a shell script for the git config and stuck it in my ~/Dropbox/Setup/ folder. All of this is a really long introduction for what I really wanted to tell you about (and save to my external brain) which was how to actually run a shell script in Terminal on your Mac.
The simplest way to do this is to cd your way over to where the script resides and type in:
> sh myScript.sh
That’s about it. Depending on what you’re doing, Terminal may complain that you need to have root permission to do something, so in that case you would type in:
> sudo sh myScript.sh
An alternative way of doing this is to set up your file with executable permissons like this:
> chmod +x myScript.sh
Which then allows you to run your scripts by simply typing in:
> ./myScript.sh
GDIP
So, GDIP is a thing now. One of you wrote and said that you needed something like this, so I went ahead and released an early beta version.
GDIP is a little app that rides in your status bar and shows your internal and external IP addesses and host names. The current functionality is:
It shows your local and external IP addresses and host names.
It lets you one-click copy any or all of them.
I know, it's a pretty limited feature set, but I'm pretty much a rookie developer. If you're looking for a snazzy high-art app, go check out Flexibits
If you're intersted in playing with GDIP you can find the project page for it here.
Tinfoil Radio
I'm approaching the nexus of crazy on late night AM talk radio. Tonight I beat my personal best of the right-wing fundamentalist Reganist with a full-on Revelationist served with a side dish of New World Order, HAARP earthquakes as the spicy sauce and topped with sprinkles of EMP attacks and Obama is the antichrist. It was almost like what I imagine listening to the love child of Alex Jones and Harold Camping would sound like. This one is going to be hard to beat.
From the ZOMG WE'RE GONNA DIE!!! file:
NASA warns 'something unexpected is happening to the Sun'
Basically they're expecting the solar maximum to be double peaked like it was in 1989 and 2001, so, we're probably not going to die from the sun exploding.
As pointed out by Bambi Blue, the comments are totally different from YouTube comments:
Jasper my friend do some research before posting comments. I am embarrassed for you. Our sun is currently a G2 star on the Main Sequence,its mass was determined at it's birth and it was never a O type super giant. As it ages it will get larger and cooler but the mass will not change significantly until the end of it's life when it's outer layer will evaporate leaving behind a White Dwarf. Ignorance of science gives me great pain. Do the research, expand your knowledge and enjoy the experience.
PopClip for Mac
Ever have one of those apps hanging around your system that was sort of meh the first couple of times you played with it, then all of a sudden, out of nowhere, it jumps up and becomes one of your favourite apps? PopClip for Mac by Pilotmoon did that to me the other night. It went from just kind of hanging around, to being right up there with TextExpander and Hazel on my list of apps that I find indispensable. What is PopClip you may ask? Here is how Pilotmoon themselves describe it:
PopClip appears when you select text with your mouse on your Mac. Instantly copy & paste, and access context-specific actions like search, spelling, dictionary and more.
Ok, that’s pretty neat, but what pushed it up near the front of the queue for me? There were two things that really did it. First, PopClip has an extension that plugs in to TextExpander that allows you to create snippets from selected text. This is really handy for building a library of commonly misspelled words (for example, remembering to put the hyphen in Objective-C). Second, PopClip has an extension that will take a list, discard the duplicates, and sort it into alphabetical order. I had seen the trick of sticking the bash script sort | uniq into a service on a WWDC Video and thought it was a pretty neat way of cleaning up a list of header file imports. I was going to attempt writing an extension for PopClip that duplicated this, but someone beat me to it. Once I found this extension, I spent the next 15 minutes looking for things to alphabetize.
As of this writing there are 79 different extensions for PopClip supporting a wide variety of apps and functions. There is a free trial available at their site, but at $5.00 on the Mac App Store, just skip that extra crème brûlée latté and have some fun with PopClip.
Wish You Were Here
For the one reader who has been following along somewhat regularly and wondering just where the hell I’ve gone to, don’t worry, I haven’t abandoned the blog. Instead of writing, I’ve been spending a lot of time on two side projects that were previously simmering in the background.
The first project is to finally get around to learning to play the guitar. My dad used to play, my brother still does. I grew up with guitars around me and yet I never actually learned to play much beyond being able to pick out a basic G chord and calling it a day. Last summer, somewhat inspired by Jim Dalrymple’s show Amplified, I started taking lessons from a friend of ours who is a professional musician.
So far, the results have been promising. I’ve managed to improve from complete rookie status to being able to play a passable rendition of Wish You Were Here. I think David Gilmour’s job is safe for the time being though.
The other thing that’s been keeping me away from writing is, well, writing, sort of. I’ve been head down working on the other project that I’ve touched on before, namely learning how to code all over again, but this time with Objective-C and Cocoa.
After six months of scratching my way up from Hello World, I’ve managed to build something resembling an actual app. Thanks to the input of a few people on the NSBrief Glassboard, the project provisionally known as GDIP is approaching 1.0 status.
What’s GDIP you may ask? GDIP is a little app that rides in the status bar that answers the question, “What’s my GD IP?” The reason I’m writing it, other than being an exercise in coding, is to save having to load up WhatIsMyIP or go digging in Network Preferences those few times a month that I actually look at the site logs.
If you’ve managed to make it this far, you’re probably a) my one actual reader, and b) wondering what’s next. Well, the plan as it stands is to keep coding, keep picking, and keep writing. Expect to see more stuff about code and guitars, and less about current events. Other people are doing news much better than I am, so I’ll stick with topics that I actually enjoy writing about. Oh, and the how-to posts aren’t going away. Sorry.
Diminishing Returns
Definition: Albums by U2 recorded after The Joshua Tree.
Debugging tips for Xcode 4.5-ish →
Mike Hay, Director of Software Development at Black Pixel shares some of his favourite debugging tips at CocoaHeads, Dec 20, 2012.
References
I'll help you Rogers...


Dear Rogers,
Your internet speed sucks and everyone knows it. Quit fucking around with consultants and either put some money into infrastructure, or light up some of that dark fibre that's buried in front of my house.
xo Phae
P.S. Your wireless service sucks too. The only reason I'm still your customer is because you don't suck as bad as Bell.
Nerdy Web Finds
Wikimapia
The first site that I want to bring you this update is wikimapia. Imagine, if you will, Wikipedia laid on top of Google Maps. Wikimapia lets users perform multi-layered annotation of maps, so you can describe stuff around you. I think my first project will be documenting the old Kingston and Peterborough railway line. I’ve traced it before on Google Earth, but now someone can actually see it.
Phone Trips
Straight out of 1996 is the Phone Trips website. Phone Trips is a collection of recordings made by Mark Bernay in the late 1960’s and early 1970’s of the pops, clicks and whistles made by the phone system as he and his friends played around with innards of what was the world’s biggest machine. If you’re wondering what I’m on about, check out this video of Captain Crunch and The Cheshire Catalyst from 2004 speaking at the Fifth HOPE conference.
Flexible Time Stamps in Drafts
I started using Drafts by Agile Tortoise on my iPhone about a month ago and haven’t looked back. Quick input and flexible output make Drafts a winner for me. On the latest revision of Drafts, the developers increased the flexibility of how timestamps are applied and this article by Dr. Drang explains how they work and gives some neat examples to play with.
VIM Weirdness and Git Tutorial Found
For tonight’s bit of weirdness, all of a sudden Markdown syntax highlighting started working in VIM. I had installed a pack from somewhere, but it never really worked, so I forgot about it, until I was writing a quick note for a project I was working on.
Anyway, in my last post, I talked about Ryan Hodson’s awesome Objective C tutorial. Just a couple of clicks away on the same site, Ryan has a step by step hands-on tutorial about Git. It’s awesome version-ey goodness that has applications beyond coding. That great novel you’re writing should be in a git repo just as much as anything. If you’re doing anything that involves changes and revisions, it’s worth implementing some kind of version control system.
Web Find: Objective-C Tutorial by Ryan Hodson
Ryan Hodson over at Rypress has a new Objective-C tutorial for Xcode 4.5/LLVM 4.1 posted on his site. It’s amazingly well written. Ryan has managed to take the fundamentals of the language and break them down in such a way that you don’t need to understand Objective-C in order to learn Objective-C.
The code examples Ryan uses are clean and well documented. The tutorial progresses through the material at a reasonable pace with each topic explained and demonstrated in a way that I found clear and helpful.
I found the tutorial wile browsing the NSBrief Glassboard group on my iPhone. The next thing I knew I had read more than half of it, something I don’t normally do on a mobile device: the layout of the site is that readable.
If you’re a coding rookie like me, and are interested in learning to develop with Cocoa and Objective-C, Ryan’s tutorial is a great place to start.
Guest Post at Reviewswithoutlegs →
Hey gang! I guest posted a review of Byword app over at my friend Oz's site Reviewswithoutlegs. If you're interested in reading what I have to say about it, have a look here.
Using Multiple NSViewControllers
Want to learn how to use multiple views and view controllers in Cocoa? Read this article. I adjusted the sample code to work with ARC. You can download it here.
Julie Burchill: Someone is Wrong on the Internet
For those not following along at home, Suzanne Moore’s essay in the New Statesman last week set off an internet shitstorm. The source of contention in the otherwise interesting article was the sentence “We are angry with ourselves for not being happier, not being loved properly and not having the ideal body shape – that of a Brazilian transsexual.” The backlash from those who took offense to that statement was enough to drive Moore off twitter.
Enter Julie Burchill. Burchill, a friend of Moore, poured gasoline on the fire with an invective filled defence of Moore article in The Guardian, which has since been pulled. I won’t direct you to the republication of the article by The Telegraph (see link bait). Instead, let me direct you to this article by Jane Carnall which summarizes the lowlights of Burchill’s screed. The one point that I want to pick out of Burchill’s ranting is that she was “incredulous” to “read that my friend was being monstered on Twitter, to the extent that she had quit it, for supposedly picking on a minority – transsexuals.”
Holy crap, are you new here? Have you never seen YouTube comments? Welcome to the Internet, Ms. Burchill, that’s how it works. If someone says something offensive, whether it be about gender, operating system of choice, or someone else’s favourite whatever, there’s going to be a response. People have made whole careers trolling other people, so expecting there to be no response when someone says something wrong, or even makes a typo, is simply ridiculous.
My advice for Ms. Moore and Ms. Burchill is simple; go and lurk on /b/ for a while. You’ll learn how things work.
Scott Lively Warns of End Times Because of Marriage Equality →
Via Right Wing Watch:
We need to remember that in the time leading up to the Flood what the rabbis teach about the last straw for God before He brought the Flood was when they started writing wedding songs to homosexual marriage and Jesus said that you’ll know the End Times because it will be like the days of Noah. There’s never been a time in the history of the world since before the Flood when homosexual marriage has been open and celebrated, and that’s another sign that I believe that we’re close to the end.
Well, what are you waiting for? You better grab your flock and head for the hills, preferably the ones without an internet connexion.


