The Ant Mound

One of my earliest childhood memories is traumatic. At least it would seem traumatic to a three-and-a-half-year-old little boy. Though it didn’t turn out to be the end of the world, it seemed like hell when it happened. I still carry the memory with me more than a half-century later, so it damaged me on some level.

My family – mother, wicked step-father, newborn baby sister and me – were living in an old two-story house in Lancaster, California, which in the late 1960s was still mostly desert scrub and Joshua trees. We were located far enough away from everything else that it could be called the middle of nowhere. Today, a strip mall stands where the house once did.

We were so remote that my mother didn’t really pay attention to what I was getting into. She trusted I would not stray too far and everything would just work itself out. She had a newborn baby to worry about and didn’t give me the attention I probably should have gotten. With nothing to do and no watchful eye, I would wander the acre-sized property, trying to keep myself entertained. This ended up being a theme in my childhood.

One day, I thought I could make friends with the ants who had built a nest out in the open area far behind the house. I was fascinated by how they scurried back and forth, some appearing from the mound while others disappeared into it.

To make friends with them, it seemed I should get close and be down at their level. This meant I had to sit next to the mound. So I planted myself there on the ground, wearing my tan shorts, striped t-shirt and little red sneakers. When the first few ants crawled on me, I thought they were welcoming my invitation to be friends.

These were not your garden variety ants, mind you. They were those red and black kind that are nearly a quarter of an inch long with strong mandibles. These ants were big, fast, and as it turns out, very aggressive.

Before I knew it, I was covered with dozens of ants that saw me as a threat to their home. The hive sounded the alarm and went on the attack. First, I felt one bite, then a few more and several more soon after that. Before I knew it, my skin was on fire as the big red and black ants bit me over and over. They were all over me. No matter how hard I tried, I couldn’t get them all off my body. This was pain unlike any other in my short time on earth.

I got up from the ground in a panic and began stripping off my clothes as I ran toward the house screaming like a banshee. By the time I got to the back door, I was down to my underwear and little red sneakers, covered with big red welts. I ran upstairs where I found my mother nursing my half-sister. I’m sure the sight of her little boy bursting into the room practically naked with tears streaming down his face alarmed her.

She was able to calm me enough to get the story from me. She squished the few remaining ants she found in my hair, then broke out ointment to soothe the swollen bites. Her motherly attention dissolved my anxiety and I calmed down.

My mother and I reminisced about this many times over the years. We even talked about it the last time I saw her before she passed away. She always thought it was hilarious. I, however, remember it differently.

To this day, ants give me the heebie-jeebies – even the tiny black ones you see after leaving greasy or sugary food out. If I find even one ant crawling on me after sitting in the grass, I’ll start doing a very unmanly arm-flailing dance to get the critter off me as fast as I can.

I learned a big lesson that day… Don’t sit on an ant mound without knowing the consequences, because you might get eaten alive. It was the last and only time I did.

Start Somewhere

Eventually you use up every excuse in your book for not doing the thing you keep saying you’re going to do. You’ve procrastinated yourself into a corner and realize it’s either time to just do it, or finally forget about it and move on.

That’s me, sometimes…

I’ve had this blog for nearly 14 years. In all that time, I only have 11 posts to show for it. That’s less than one post per year, with the newest one being more than a year old. At one point, I had written dozens of posts. But like any good artist is prone to doing, I trashed most of them because I felt like they were fodder. I regret making that choice.

I’ve seriously slacked in my writing since, which is sad, because I’ve always enjoyed the process. To me, putting words down, then moving them around to communicate an idea is fun. When I get into a flow, the words come out and land on the page. I don’t have to struggle with what I’m trying to say. They’re just there all of a sudden. When I tell a story through my writing, I feel like I’ve created this thing that lives and breathes on its own.

To be truthful, I made a fatal mistake a few years back. Struggling to find my own voice, I began modeling my work after what other people were doing. However, since it wasn’t my voice, I began to believe what I had to say didn’t make a difference, so why should I even bother? This grew into the worst case of writer’s block there ever was in the history of man.

Well, probably not. I’m sure there have been worse cases by far better writers, but I became so utterly uninspired to write during the last five years that it literally hurt to even think about putting words down. The three posts I made in 2018 were not easy.

To make up for my lack of creativity, I found a great way to procrastinate – tweaking my WordPress theme about a hundred-gazillion times. It became all-consuming to get things just pixel perfect and then start over from scratch again. I’ve written and tweaked more CSS code than I’m willing to admit, though I have gotten pretty good at it. My site theme is practically everything I’ve ever imagined in my head at this point. I can’t improve on it much more, if at all.

So what do I do now?

Just write.

Now is the time to stop procrastinating and make something. It doesn’t require perfection. My work will get better with practice. It doesn’t need to have meaning or impart some deep zen-like wisdom to the reader. I just need to start getting the stuff in my head out into written word.

Here and now is the best place for it, so this is where I’ve decided to begin again.

What have you been putting off? Is now the time for you to start again too?

Memorable Cigarettes

After nearly fifty years, I can still remember the first time I smoked a cigarette. It was early spring and my family lived on a farm in a semi-rural part of Colorado, a little north of Denver, at the foot of the Rocky Mountains.

I lived there with my mother, wicked step-father (I’m not even sure they were married, to be honest) and little half-sister. The closest kid my age lived more than five miles away, so I had no one to play with. This meant I had to find ways to keep myself entertained. Most of them ended up being things little boys are not supposed to do. Left to my own devices, it’s a wonder I lived through all of my escapades.

I was seven years old and had stolen a pack of my mom’s Kool Menthol 100s. I had a pack of matches from somewhere (yes, I was a pyro too, but that’s a post for another time) and thought I could smoke just like mom and wicked step-father did. After taking a pack from her carton in the refrigerator, I snuck outside and hid behind the juniper trees where I wouldn’t be seen. I opened the pack, took the long cigarette out, put it between my lips, struck a match, lit up and took a big puff like I’d seen the adults do.

Oddly enough, I wasn’t repulsed by the taste. In fact, I actually liked it. I still remember the menthol sensation on my tongue. It had a little bit of burn to it, but the taste wasn’t that bad. I felt very grown up.

Of course, my little boy brain didn’t know you should inhale the smoke from a cigarette, which is probably good because I’m sure if I had, I would have wound up puking my guts out behind the trees. Sometimes I wonder; if I had inhaled, would I have ended up picking up the habit nine years later, or would I have been turned off completely?

There were other experiments with smoking through my childhood, but none really stuck. I’d smoke here and there and eventually lose interest.

Until the day I met Tracy. He had just moved into the neighborhood where my mother, step-sister and I were living (wicked step-father was long-gone now). I think he said he was from New York. He was my age but had already become a pack-a-day smoker. I vividly recall the summer evening he offered me a Marlboro Red from his hard pack box. You weren’t cool if you smoked soft pack, you know. It had to be hard pack and it had to be Marlboro Reds.

I began taking him up on his offers of free cigarettes. Before I knew it, I was smoking every day, bumming cigarettes from friends whenever I could. Then the moment I knew I was hooked came: I wanted to smoke while I was alone.

My mother, being the spectacular parent she was, started buying my smokes for me, so I had a steady supply of my own stashed in the refrigerator. Her rationale was that she’d rather I smoke openly instead of hiding it. I think she hoped I’d come to hate the habit and give up. Well, thanks mom, that didn’t quite work out as planned.

So at the tender age of sixteen, I became a confirmed pack-a-day smoker. All the other kids my age were doing it, so why not me too? The problem was, I really liked smoking. I knew I wasn’t going to stop. Other kids did it to be cool. I did it to feed the nicotine addiction.

Twelve years went by, and then I met Pam.

I still see the moment from our very first date in my mind’s eye. We were running across a busy street in downtown Santa Monica to get to the club where we were headed to see a band. In the middle of the street, the hard pack of Marlboro Lights fell to the ground from my shirt pocket with a loud plop sound. I bent down and picked them up. When we got to the sidewalk on the other side, she immediately told me “I don’t date people who smoke.

That was a punch to the face, but one I’m glad I took. Naturally, I didn’t light up on that date, or any other we had after that. We’re still married 25 years later and she’s my best friend. I made the choice to quit because of her and I’m proud to say I haven’t smoked a cigarette since before we were engaged.

I can remember a bunch of different cigarettes I smoked through my life, but thanks to someone who is very special to me, I can’t remember the very last one. For that, I’m forever grateful.

Eliminating Digital Distractions

If you take time to look up from your own phone for a minute, you’ll find a sea of humanity with faces buried in their own devices.

Life is so full of distractions. It seems everything is vying for our attention in one way or another these days, with most of it coming from our electronic gadgets.

If you take time to look up from your phone for a few minutes, you’ll find a sea of humanity with faces buried in their own device. It’s painful to watch.

Personally, I’ve come to a point where I’ve had it with the digital distractions in my life, so this is what I’ve done about it.

I Removed the Useless Apps from My Phone

There was a time I had more than four screens of apps on my iPhone. I know many people who have far more than that. I don’t know how they manage all those screens since I could barely cope with the number I had. I’d regularly forget where an app was, which would usually be somewhere on the third screen, beyond two other screens of mostly unused apps.

Though I wasn’t aware of it, I’d made a game out of shuffling apps around on my home screens, hoping to one day land on the perfect combination that made perfect sense and put the universe back in order. Honestly, I think most of the apps on my phone back then got moved around more often than they were ever used.

Once this dawned on me, I decided it was time to purge. The first order of business was to get rid of the useless time-wasting “social” apps. I removed them from my phone without hesitation, deciding if I want to spend time on Facebook, I’ll make time specifically for it. Now, I’m lucky if I look at the site more than three or four times a month. I don’t miss Facebook and could probably go without it entirely if I decided to. I only keep it around to stay in touch with extended family and old friends. I intentionally pared my “friend” list down to less than 50 people that I actually know too.

After nuking the useless apps, I started an experiment with the remaining by moving the ones I didn’t absolutely need to a “folder” on the second home screen. If I used an app more than a few times in a week, it got “unpacked” and promoted back to the first home screen. After a month of this, I ended up with just 16 apps on my first screen – including the four I’d left in the dock as “must-have” when I started.

For apps that I didn’t touch after two months, I completely removed them from the phone. I know if I ever need a particular app, I can download it again — where it will find its rightful place on the second screen with all of the other lesser-used apps.

I evaluate my home screen every few weeks now to demote or remove apps if I feel they’re not serving a purpose. This has helped me stay laser-focused when I’m using my phone.

I Set All But the Most Important Apps to a Badge Notification

For the apps I keep on my phone, if I need to see a notification of some kind, I’ll set it to badge only. No sounds, vibrations, banners or alerts to distract me. I’ll check it on my schedule, thank you very much.

This includes email — both personal and work. I purposely decided I didn’t want up to the moment email notifications, and I’ve found it quite liberating. Now, when I see a badge on an app, maybe I’ll look at it, maybe I won’t. It pretty much depends on the number displayed on the badge whether I decide to act.

Of course, there are exceptions to this rule, but they are few. The Phone app obviously needs notifications — otherwise, my phone isn’t a phone. Same for goes for Messages. I communicate with my immediate family by text a lot, so I leave this notification enabled.

The only other notifications I allow are OmniFocus for task management and Fantastical for calendars. I definitely need to be on time for meetings and appointments, and I must complete my tasks on time too.

Finally, I turned on “Do Not Disturb” mode between the hours of 10pm and 6am — which is when I go to bed, and an hour after I get up. That first hour in the morning with no distractions helps me get focused on my day ahead.

If you’re a notification junkie like I was, it’s hard to get used to working this way. But if you give it some time, you’ll find you’re picking your phone up a lot less and getting a lot more done during the day.

Give it a try. You’ll feel less tethered to your phone, I promise.

I Set Limits on Use

As a family, we’ve agreed to set limits on when and where electronic devices are acceptable. Never, ever can any one of us bring a phone to the table during a meal. This rule extends to restaurant outings too. Once a meal is on the table, all gadgets go away until after the last person finishes their meal.

If we’re in a family setting for the holidays or a birthday, all devices get put away in pockets and purses so we can spend time socializing face-to-face. It’s okay if a phone comes out for a photo or two, but if any family member gets caught zoning out on their phone, everyone else reminds them of the rule. It’s worked pretty well so far.

These are some of the ways I’ve started breaking the twitch to reach for my phone and check it. Sometimes I forget, but I find every day gets a little easier. If you’re looking to lessen your own digital distractions, give some of these a try yourself. You might find there’s a lot more going on around you than you realized.

Spin Cycle

I’ve been around long enough to know life moves in cycles.

Things that were new and exciting one day eventually become dull and boring the next. The pursuit of shiny objects and interesting paths quickly fall by the wayside before you realize it. We move from one thing to the next and then another in search of a quick thrill, because we’ve become instant gratification junkies.

What if, instead, we intentionally slowed our lives down? What if we deliberately chose to look at the world in wonder like we did when we were young? What if we took time out to play like we did when we were children? What if we stopped to listen to what’s going on inside instead of burying our faces in smart devices that make us dumb?

We spend our adult lives working, chasing dreams, and running after material possessions we think will make us happy. But let me ask you; in all of your pursuits, are you truly content?

Is your soul really at peace?

If there’s any hint of hesitation in your answer, it might be time to step back, take a look at the bigger picture, and find what really fulfills you.

Your time on this pale blue dot is finite. It would be a tragic waste to get to the end and say “I wish I could have…” Maybe today should be the day you stop spinning cycles on unnecessary things that don’t matter.

The choice is yours. It has been all along.

Passing Your Salesforce ADM201 Certification Exam

I passed the Salesforce ADM201 certification exam today. It’s been a five-year road to get here. From the first week I began working with Salesforce, I decided attaining certification was something I wanted to pursue.

Now that I’ve done it, I thought it might be good to share the things that helped me be successful with those looking to do the same.

Continue reading “Passing Your Salesforce ADM201 Certification Exam”

Making a Field Appear Required on a Visualforce Page

I’ve been working on a force.com app with the requirement that a user must enter a valid email address on a Visualforce page before being able to save a record.

But they must also be able to insert the related contact’s email address by clicking a button instead of having to leave the edit page to go find it. That seemed simple enough, but it wasn’t. This is my solution for making a field appear required on a Visualforce page.

Gift card screenshot.

In my original Visualforce page, it seemed logical that if I set the recipient email field as required, all would work as expected. However, defining the field as required prevented my custom action in my page controller from firing and entering the email address.

Original Page Controller

public class GiftCardTestController {
    private ApexPages.StandardController std;
    public String cEmail {get;set;}
    public Gift_Card_Order__c gc {get;set;}
    public GiftCardTestController(ApexPages.StandardController stdCtrl) {
        std = stdCtrl;
    }

    //selects the email address of the related contact
    //and inserts into recipient email field.
    public void fillEmail() {
        gc = (Gift_Card_Order__c)std.getRecord();
        cEmail = [select Id, Email from Contact where Id = :gc.Contact__c].Email;
        gc.Recipient_Email__c = cEmail;
    }
}

Original Visualforce Page

<apex:page standardController="Gift_Card_Order__c" extensions="GiftCardTestController" title="Gift Card Test">
    <apex:form>
        <apex:pageblock title="Gift Card" mode="edit">
            <apex:pageblockbuttons location="top">
                <apex:commandbutton action="{!save}" value="Save"></apex:commandbutton>
                <<apex:commandbutton action="{!cancel}" value="Cancel"></apex:commandbutton>
                <apex:commandbutton action="{!fillEmail}" value="Fill Email"></apex:commandbutton>
            </apex:pageblockbuttons>
            <apex:pageblocksection title="Email Info" columns="1">
                <apex:inputfield value="{!Gift_Card_Order__c.Contact__c}"></apex:inputfield>
                <apex:inputfield value="{!Gift_Card_Order__c.Recipient_Email__c}" required="true"></apex:inputfield>
            </apex:pageblocksection>
        </apex:pageblock>
    </apex:form>
</apex:page>

In this example, the fillEmail() action should select the related contact email address, and put the value in the Recipient_Email__c field so the user can see it.

But it’s not that simple it seems. When the field had the required=“true” attribute set, the action would not fire because all validation is done on the client side and the page never posts back to the server — so the controller action never gets called.

So after some digging and asking for help on the Salesforce discussion boards, the solution was to make the Recipient_Email__c appear as if it’s required on the page (though it’s really not), and add a new save method to my controller to handle field validation on the server side when the record gets saved.

New Page Controller

public class GiftCardTestController {
    private ApexPages.StandardController std;
    public String cEmail {get;set;}
    public Gift_Card_Order__c gc {get;set;}
    public GiftCardTestController(ApexPages.StandardController stdCtrl) {
        std = stdCtrl;
    }

    public void fillEmail() {
        gc = (Gift_Card_Order__c)std.getRecord();
        cEmail = [select Id, Email from Contact where Id = :gc.Contact__c].Email;
        gc.Recipient_Email__c = cEmail;
    }

    // add custom save method...
    public pageReference save() {
        gc = (Gift_Card_Order__c)std.getRecord();

        // if the recipient email is null, add an error to the field
        // and return null to remain on the current page...
        if(gc.Recipient_Email__c == null) {
            gc.Recipient_Email__c.addError('A valid email address is required.');
            return null;
        }

        // otherwise, the field is filled, so it's okay to redirect to view page.
        // standard field validation will check for valid email format.
        else {
            return std.save();
        }
    }
}

New Visualforce Page

<apex:page standardController="Gift_Card_Order__c" extensions="GiftCardTestController" title="Gift Card Test">
    <apex:form>
        <apex:pageblock title="Gift Card" mode="edit">
            <apex:pageblockbuttons location="top">
                <apex:commandbutton action="{!save}" value="Save"></apex:commandbutton>
                <apex:commandbutton action="{!cancel}" value="Cancel"></apex:commandbutton>
                <apex:commandbutton action="{!fillEmail}" value="Fill Email"></apex:commandbutton>
            </apex:pageblockbuttons>
            <apex:pageblocksection title="Email Information" columns="1">
                <apex:inputfield value="{!Gift_Card_Order__c.Contact__c}"></apex:inputfield>

                <!-- Updated pageBlockSectionItem -->
                <apex:pageblocksectionitem>
                    <apex:outputlabel>Email Recipient</apex:outputlabel>
                    <apex:outputpanel layout="block" styleClass="requiredInput">
                        <apex:outputpanel layout="block" styleClass="requiredBlock"></apex:outputpanel>
                        <apex:inputfield value="{!Gift_Card_Order__c.Recipient_Email__c}"></apex:inputfield>
                    </apex:outputpanel>
                </apex:pageblocksectionitem>
                <!--// end pageBlockSectionItem -->

            </apex:pageblocksection>
        </apex:pageblock>
    </apex:form>
</apex:page>

Notice the <apex:pageblocksectionitem /> code to replace the original field. This is how we make the field appear with the “required” bar. A nifty trick that took some digging to discover. Hopefully, this post saves someone else the time it took me to figure it out — and me the time when I forget it.

For convenience, here’s a Github Gist with field label & inline help that shows exactly how to make a field appear required on a Visualforce page.

AppleScript to Toggle the Mac Desktop

Here’s an AppleScript I use to quickly toggle desktop visibility for taking screenshots and recording screencasts that I thought might be useful for others.

Copy the source and paste the code into AppleScript Editor, or your editor of choice, compile and save. As always, scripts like this work best using FastScripts from Red Sweater Software.

tell application "System Events"
    set frontMostApp to name of the first process whose frontmost is true
end tell
try
    set theDefault to ((do shell script "defaults read com.apple.finder CreateDesktop") as integer) as boolean
on error -- if the default value doesn't already exist, create it.
    do shell script "defaults write com.apple.finder CreateDesktop 1"
    set theDefault to ((do shell script "defaults read com.apple.finder CreateDesktop") as integer) as boolean
end try
do shell script "defaults write com.apple.finder CreateDesktop " & (((not theDefault) as integer) as string)
tell application "Finder" to quit
delay 1
tell application "Finder" to launch
tell application frontMostApp to activate

Note: This single script turns off the desktop if it’s on, and turns it on if it’s off – just to clear up the question if asked.

Rebuilding the Apple Mail Envelope Index

Some time ago, I set up my Gmail account in Apple Mail to copy over messages which were not sent to my jimmitchell.org account. I’m one of those guys who likes to have everything all in one place at my fingertips when I need it.

After copying over the messages I wanted, I completely removed the Gmail IMAP account from Mail and went about my business. Soon after, when I went searching for a specific email, I experienced the phenomenon of ghost emails in the search results.

These are messages that Mail once knew about, but no longer knows where they exist. The ghost emails were all from the since removed Gmail account.

If you’re experiencing the same problem, here’s a very simple fix to rebuild the Apple Mail envelope index.

First, quit Apple Mail if it’s running, then navigate your way to ~/Library/Mail/ (where “~” is your home folder) in the Finder. Once you’re in the Mail folder, you’ll see a file named “Envelope Index” which keeps track of where all messages are located. Rename “Envelope Index” to “Envelope Index Backup” (We don’t want to trash the file just yet).

A file explorer window displays a list of folders and documents with details like names, dates, and sizes on a blue gradient background.

Then, relaunch Apple Mail. You’ll be presented with a daunting “Message Import” dialog that looks like your email account was wiped out and you’re starting all over. Fear not. You’re simply rebuilding the Envelope Index at this point.

A welcome screen for a mail application instructs users to import existing messages and offers \

Click “Continue” to rebuild the index. Once it’s done, all those pesky phantom messages will be gone the next time you perform a search in Mail (Yay!). You can then go back to the ~/Library/Mail/ folder in the Finder and move the file you renamed to “Envelope Index Backup” to the Trash.

And there it is. Your Apple Mail Envelope index has been rebuilt. A very simple solution to a problem that has baffled some of the best Mac users.