Browsing articles by " Rob Warner"
Jun
30

Brandon from Windows

By Rob Warner  //  Uncategorized  //  No Comments

I just got a call from “Brandon from Windows” that I wish I’d recorded. He, of course, told me (in a Bangalorean accent) that my computer had malware issues. Our conversation went something like this:

“Brandon”: This is Brandon from Windows. Your computer has malware issues.

Me: Oh, no! Should I throw it away?

“Brandon”: No, we can fix it. Are you in front of your computer now?

Me: Yes

“Brandon”: Is it turned on?

Me: Yes

“Brandon”: What do you see on the screen

Me: (Hmm . . . dilemma . . . do I tell him I have iTerm2 in fullscreen, running tmux, with one pane running vim, one running gulp, and a third prompt for running git commands? Nah.) Um, I see some icons. And some clicker things.

“Brandon”: OK, let’s look at your keyboard. Do you see, in the lower left, a control key? It might say “CTRL”. 

Me: Yes. Is that how you control my computer?

“Brandon”: No. What key do you see to the right of that key?

Me: (Panic time. I have three keyboards in front of me: 2 MacBook Pros with keyboards and a Logitech K750 Mac keyboard. I don’t remember what key Windows keyboards put next to the control key. Is the jig up?) Um, the option key.

“Brandon”: We are looking for the Windows key. Do you see that?

Me: (Phew) Yes.

“Brandon”: Hold that down with one finger, and press the ‘R’ key.

Me: Capital “R” or lowercase “r”?

“Brandon”: It does not matter. Any “r” will work.

Me: (Mind racing — how can I yank his chain about “any r”? Maybe the “r” from a different keyboard? Nah — over the top.) OK.

“Brandon”: What do you see?

Me: (Ooh, that “run a command” thingie.) A dialog box?

“Brandon”: We are looking for the Run Dialog. Is that what you see?

Me: Oh, yes.

“Brandon”: OK, type the following: e as in echo, v as in victoria, e as in echo, n as in november, t as in tiger, v as in victoria, w as in whisky, r as in romeo, and press enter. What do you see?

Me: (I got nothing. Mind is blank.) File Not Found. It says File Not Found.

“Brandon”: No, what do you see on your screen?

Me: (I’m sticking to my guns here) File Not Found

“Brandon”: Let me get a senior support person.

“Joshua”: Hello. My name is Joshua. I am a senior support technician. What do you see on your screen?

Me: (I ain’t changing my story now!) File Not Found

“Joshua”: OK, do you see the Run Dialog?

Me: Yes.

“Joshua”: OK, let’s clear it all out.

Me: (Wishing I were funnier — just like my children do) Clear it ALL out? Or just the part you type in?

“Joshua”: Just the part you type in.

Me: OK

“Joshua”: Now type e as in eagle . . .

Me: Wait! “Brandon” said e as in echo!

“Joshua”: It does not matter. It is all the same e.

Me: Oh! OK.

“Joshua”: e as in eagle, v as in victor, e as in eagle . . .

Me: Ah, eagle again.

“Joshua”: Just the e.

Me: OK.

“Joshua”: n as in november, t as in tiger . . .

Me: Are these supposed to be uppercase? Or lowercase?

“Joshua”: All lowercase.

Me: OK, e as in eagle . . . n as in november . . . does it matter that it’s not November yet?

“Joshua”: Motherf****r

*Click*

This was my public service for the day — the entire time they were talking to me, they WEREN’T scamming your parents!

Sep
2

Making “java -v”, “java –version”, and “java version” Work

By Rob Warner  //  Java  //  No Comments

To get the version of most CLI tools, you type the tool’s command name followed by one of these:

  • -v
  • –version

Some CLI tools, like Git, support a “version” subcommand, so you type the tool’s command name followed by “version”.

Java supports none of these.

Instead, you must type:

java -version

I’m too old to remember that, so I’ve created a bash/zsh function:

https://gist.github.com/hoop33/e02d8ae9113616e2cd60

Now I can type any of the following:

java -v
java --version
java version
java -version

And they all give me Java version information.

Apr
17

Two Things I Learned About Vim from an Emacs User

By Rob Warner  //  Development, Mac, Software  //  6 Comments

Yesterday I was working on a problem with an Emacs wizard, and I saw him do a couple things in Emacs that made me squirm. You see, I badger and belittle him at every opportunity for not embracing The One True Editor, but I saw him perform two actions in Emacs that I didn’t know how to do in Vim. And no way was I going to admit that, at least not to him.

Here are the two items:

When he ran a command from a shell with a lot of output, he piped the output directly to Emacs like this:

$ some_command | ecbuffer

I’m on a Mac, so I typically do this:

$ some_command | pbcopy

And then I open a new MacVim window and hit Shift+P to paste (I use the system clipboard in Vim). Inelegant in comparison. So, while his back was turned, I googled and discovered that passing – to vim causes vim to read from stdin, so I can just do this:

$ some_command | mvim -

Works great! I breathed one sigh of relief, but still had a second item to tackle: we were trying to solve a build issue in which a required jar file was not being included in the 1.2GB deployment file (that’s not a typo — we really roll that large). I noticed that when he opened a zip file in Emacs, it churned for awhile (hey — 1.2GB is a lot of data!), and then showed the zip file’s table of contents. Cool! My best thought for how to do that in Vim, using what I’d just discovered, was this:

$ jar tf foo.zip | mvim -

Not bad, but not as cool as what my coworker was doing in Emacs. So, before getting too worked up, I tried opening the zip file in Vim to see what would happen. Immediately, the table of contents for the zip file appeared in Vim. No churning. No wait. And then I could press Enter on one of the file names to view the file contents.

So, my Emacs-loving coworker made me learn two cool things about Vim. I need to work with him more often!

Jan
12

URLs as Pictograms

By Rob Warner  //  Uncategorized  //  No Comments

I started my car to the chime of a low fuel alert, so I stopped at the Kangaroo for gas and my Morning Mormon Coffee (today’s edition: Diet Dr Pepper). While filling my cup, I noticed the graphic on a napkin dispenser:

2015 01 12 08 38 01

The social media icons looked familiar, of course, but it took me a moment to realize that they’d abandoned the traditional ‘@‘ prefixes for the user names — instead, they’d used the icons as pictograms for the URLs, followed by a slash, and then the rest of the URL (the username). Interesting take, and probably a little too geeky to catch on, but I like when people experiment to see what sticks.

Dec
17

hc: Hex Color Command-Line Tool for OS X

By Rob Warner  //  Development, Mac, Software  //  No Comments

I’ve been working a lot lately with LESS and Bootstrap, and wanted an easier and quicker way to visualize colors and what the various LESS operations do to them. So, I built hc — Hex Colors on the Command Line. It’s written in Objective-C and works on Mac OS X 10.9+.

It’s still in its infancy, of course, but it lets you do things like show, lighten, or darken colors. To show the color red, for example, type:

hc show f00

That will display, in your console, the text:

hex: #ff0000
rgb: 255, 0, 0
hsl: 0°, 100%, 50%

You can pass 3- or 6-character hex codes. You can also change the output format using the -o/–output option. To write the color to an image file, for example, type:

hc show f00 --output file

This will create a 256×256 PNG file in your current directory called ff0000.png that looks like this:

Ff0000

You can also write the textual results to the clipboard using -o clip, or to a user notification (thanks for the idea, Rob!) using -o note. The notification looks like this:

ITermScreenSnapz002

Be sure to read the README for more information. Check it out and give me feedback!

 

Nov
17

Giving Firefox Developer Edition a Go

By Rob Warner  //  Development, Software  //  1 Comment

I love that I can run Chrome on my work MacBook Pro, my personal MacBook Pro, and my iPhone 6 Plus and keep my browsing history in sync. I love that I can install a plugin on one Mac and have it available on the other. I love that my logins are available whichever device I use. I love that I can bring up my open tabs from any device. My web experience transparently moves with me, and it makes life so much easier.

I just launched Firefox, as I do periodically to keep it up to date, and noticed the message on the home page:

Choosing Firefox isn’t just choosing a browser. It’s a vote for personal freedom online.

Ouch. I’m not really clear on Firefox’s business model, but I know Google’s: to sell me to retailers, advertisers, or anyone else that aims to profit from me by knowing more about my habits, my data, my income, my purchases, et al. I can’t pretend that I’m outraged at the arrangement — I generally have nothing to hide, and I’d rather see advertisements for things I’m interested in than for things I care nothing about. Lately, however, I’m getting more creeped out about privacy invasion, and I’m tentatively deciding to cloak myself a bit better.

Like most web developers, I leverage Chrome’s Developer Tools in my work, and would sorely miss their absence. The release of Firefox Developer Edition might be able to fill that void. I’ve just downloaded it and will try to use it for my web development. I have high hopes.

Nov
12

Clojure, Emacs, and Evil Mode

By Rob Warner  //  Development, Software  //  1 Comment

I work with one of those functional language kooks who end every thought with “Haskell,” use xmonad or Ratpoison while scoffing at GUIs, and edit everything, even selfies, in Emacs. Serendipitously, he just walked by, read my opening sentence, and said, “Actually, Emacs DOES support graphics editing. Haskell.”

Also at work, a group of us are learning Clojure, evidenced by our once-a-week Clojure Club meetings. Progress has been slow but steady and we’ve found a lot to like about Clojure.

One uncomfortable truth has emerged in these meetings, however: most of us are Vim users, and Clojure Cool Kids clearly prefer Emacs. We’ve been trumpeting that Vim + Fireplace >= Emacs, but I see resolve crumbling. It’s not just us, of course — other Vim users chasing Clojure are wrestling with the same editor conflict: do we really have to forsake our beloved modal editor and familiar key bindings to achieve Clojure zen?

This morning a club member displayed his weakening resolve via email with this gem:

Have you ever tried evil mode for Emacs? Maybe it could provide a robust Clojure environment without having to type meta-control-bucky-O shift-N to delete a line

“Evil” is collapsed from “extensible vi layer”, and grants you some form of vi emulation in Emacs. You can find it here, and apparently many Vim users adopting Clojure are finding it as well. I emailed back:

Not sure how I feel about Evil mode. Somehow, it feels like you’re marrying Emacs but having an affair with Vim. If you’re going to commit, you’ve got to commit!

His response, which actually made me LOL, was:

Don’t think of it like an affair. Think of it like asking Emacs to wear a nice dress. It’s installing a nice text editor into the Emacs operating system!

Haskell man refused to see the levity and frumpily chimed in:

It’s definitely cheating. It’s like writing getters and setters in JavaScript. Haskell

I’ve gotten as far as installing Emacs and Projectile, but haven’t embraced Evil yet. And I’ve made any edits to ~/.emacs.d/personal/config.el in Vim. But I’ve been eyeing my unread copy of Gnu Emacs Manual and thinking how deeply I want to commit to Clojure. Haskell.

Oct
8

Recovering My MacVim

By Rob Warner  //  Development, Mac, Ruby, Software  //  No Comments

Although I usually edit files with (graphical) MacVim, I occasionally launch terminal vim. When I do, I see this:

github-issues.vim requires Python support, sorry :c

I always smile a bit at my nephew’s use of an extra-frowny mouth, but I also wince a bit to know that I’m letting this issue linger, rather than fix it.

The simplest fix is to use terminal macvim as my system vim, so last Friday I opted for what I expected to be the easy route and typed:

brew uninstall macvim
brew install macvim --override-system-vim

My system churned a bit while I watched the github-issues.vim animated GIFs, and then reported:

if_ruby.c:677: error: 'rb_encoding' undeclared (first use in this function)

Years of raising children has taught me that I can’t expect proper results without diligent monitoring, so I ran the install command again, but this time I watched it like a hawk, and actually expected different results. After the same system churn, of course, I got the same result. Then my stomach began to churn a bit, and I downloaded the MacVim source from GitHub, followed the build instructions, and got the same result. 

I’m nursing this work laptop, a 2010 MacBook Pro with Snow Leopard, along until I come due for one of the shiny new retina MacBook Pros with Mavericks. I may not get one until they sport Yosemite, though, and I don’t think they plan to upgrade the OS on this laptop. You never really want to get on IT’s radar anyway, because them looking closer at your work-issued gear tends to go in directions you didn’t anticipate (“Is that the approved wallpaper? Is Homebrew even approved? Are you running a web server on here???”). What this means, though, is that I can’t use any of the latest editors (Sublime Text 3, Atom) because they’re not supported on Snow Leopard. Which means I can run Sublime Text 2 (Vintage mode, of course), but for some reason its display goes wonky on my laptop, and I really didn’t feel like investigating display glitches in a dead-ended editor. Besides, I’ve got my vim set up perfectly with settings and plugins, and anything else is a step backwards.

So, I opened the source code referenced in the error message. Line 677 of if_ruby.c was housed in this block:

673: #ifdef RUBY19_OR_LATER
674:   int isnum;
675:   long lval;
676:   char_u *sval;
677:   rb_encoding *enc;

Hmm . . . I remembered that last week I’d installed Ruby 2.1.3 via rvm. Before that, though, I was definitely using at least Ruby 1.9, so I was a bit confused, but really all I wanted to do was get MacVim working and go home. It was Friday evening, after all. So I typed:

rvm use system

This took me to ruby 1.8.7. Then I typed:

brew install macvim --override-system-vim

This time, after the churn, I got a successful completion, and now MacVim runs and vim uses terminal macvim and github-issues.vim no longer gives me the turbo frown.

And if you’re from my IT department and are reading this, I have only the company-issued wallpaper, I’m totally joking about Homebrew, and I don’t know what a web server is. And can I get a shiny new rMBP with Yosemite?

Apr
17

The Pinnacle of Fitness Failure: Samsung’s Gear Fit Activity Tracker | DC Rainmaker

By Rob Warner  //  Uncategorized  //  No Comments

The Pinnacle of Fitness Failure: Samsung’s Gear Fit Activity Tracker | DC Rainmaker: “Samsung built a cloud-based service that lacks the cloud.  We’ll just call that a rock.”

I haven’t yet taken the plunge into the activity tracker market–I run with a Nike+ GPS watch, but only while running–because I haven’t yet understood why I’d want one. This review didn’t push me any closer, but I LOVED that line!

(Via. Daring Fireball)

Mar
24

The Internet Is Too Small to Be Snarky

By Rob Warner  //  Development, Mac, Software  //  No Comments

Last week, I was frustrated with Oracle SQL Developer (on Mac OS X) for two reasons:

  • When a connection times out (after being left idle too long), the application hangs and I have to Force Quit and restart it.
  • Every 90 days, the passwords for our databases change, so an updated connection XML file is put into source control (passwords are encrypted, and we aren’t allowed to know the passwords) and we have to import the new connections. You can’t delete multiple connections at a time from the SQL Developer interface, and importing over an existing connection pops up a Yes/No dialog box asking you if you want to overwrite the existing connection. Since the file contains about 30 connections, this means clicking Yes to the same dialog box 30 times.

I decided to vent, and tweeted this:

The first part of the tweet contains sage advice: developers should indeed use their own software regularly, and that will encourage them to build better software. Then, however, I took a snarky swipe at the developers who work on Oracle SQL Developer. Oracle is a soulless corporation after all, right? And it’s not as if real people work on that software, right? My tweet is in no way offensive, right?

Then I got this tweet:

Wow. Not so soulless after all: a real person who not only cares enough to respond to my tweet, but also chooses to ignore my snark and answer with an attitude of helpfulness and class. Properly chagrined, I explained the two issues I was having, and he asked which version of Oracle SQL Developer I was using. Um . . . it turns out that the version I have is pretty old, so he encouraged me to upgrade, and even told me the latest version that would work on my (work) Snow Leopard machine. I downloaded it, connected to a database, and then let it sit for hours. Then I ran another query. In the past, this would cause SQL Developer to hang, and I’d have to Force Quit it. With this new version, however, it automatically reconnected to the database and ran the query. Success!

Let’s look at what I did wrong:

  • When I had a problem, I just felt victimized and did nothing about it. For years.
  • I never bothered to look for any updates to this piece of software.
  • When I got frustrated enough, I took a public swipe at the developers.

I’m a developer. I should know better. I ship buggy code. I release updates all the time that fix bugs and add new features. I don’t enjoy criticism, especially snarky criticism, and especially about something I’ve already fixed!

So, Jeff, I apologize, and I thank you for your help. And for the unspoken reminder to stay classy. I’m still hoping for a smoother, less-interactive import of updated connections, but this time I’ll ask nicely. 

And, since Jeff deserves the last word on this far more than I, here’s his response when I told him the new version corrected the application’s hanging:

About

I'm Rob Warner, and I'm a software developer. I live in Jacksonville, Florida, and work for Availity, LLC. The postings on this site are my own and do not necessarily reflect the views of Availity.