Time Management – The Eternal Problem

As I face another end of month without a blog post (for some reason I feel the need for at least one post a month, perhaps to give the crickets something to chirp about) I realize I do have something to blog about – time management.

Here’s my time management theory: Much of life is divided into two groups, the stuff you need to do, and the stuff you want to do. The goal in life is to merge the two if at all possible. This can be by:

  1. Doing only what you want, which ceases to be practical once you turn seven (unless you’re a pathological narcissist, of course)
  2. Learning to love what you’re doing (which sounds vaguely masochistic).
  3. Change.

Now, there is a case for #2, learning to love what you have. A bird in the hand is worth two in the bush, and all that. Builds character, and so on. However, I prefer change. Of course, sensible change is to follow your dream while still working at whatever pays the bills. And it also involves analysis about what you want to do. Often, it’s not a specific thing, but an aspect.

Take art. I imagine a lot of people would like to be artists. But “art” is broad. Some people may want the smocks, the gallery showings, and the hob-nobbing with the intelligentsia; others may want to design graphics for magazines and such, or create clothing, and so on. Zeroing in on the actual aspect helps, since you avoid doing the parts you don’t like, again saving time.

But there’s another aspect: If you work at what you enjoy, you’ll likely work better at it, which means faster; this in turn makes your time more valuable, freeing up more time to do more of what you want, resulting in a sort of virtuous cycle.

Of course, we’re talking work, right? Well, if you make good money in art, you can pay someone to clean your clothes. Many business people pay chauffeurs, giving them extra time to work in the car to/from work. And so on. With enough success, even the non-work items can be offloaded if you want.

Adjusting your life to include more of what you truly enjoy is vital to a happier, healthier life. So analyze what you really want to do, and take steps to do more of it. I believe that is time management at its best.

A Fond Goodbye (And Hello?) to “Top 10 Tricks To Conquer Your Niche With WordPress!”

Top 10 Tricks To Conquer Your Niche With WordPress!With the release of “”How To Promote YOU With A WordPress Blog!” it’s time to say goodbye to the previous edition.

“Top 10 Tricks To Conquer Your Niche With WordPress!” was oriented to information businesses online, whereas today a WordPress blog can be much more – including an online presence for a ‘bricks and mortar’ store. So the new edition reflects that a WordPress blog is less about “tricks” and more about common-sense promotion techniques.

I’ll miss the old title and cover – the title was the same as the first 2005 whitepaper on the topic I wrote. However the cover might get new life – at one point, it was used for WordPress Project Gutenberg, so who knows, you might see it again sometime.

Meanwhile, you can get the latest edition of the book – same good info, different title – on Amazon for Kindle viewing, or in genuine tree pulp:

“How To Promote YOU With A WordPress Blog!” Now Available On Amazon

At long last, “How To Promote YOU With A WordPress Blog!” is finally up on Amazon, both in digital (Kindle) form and also available there in printed form.

The book is a heavily-revised edition of my earlier WordPress guide, “Top 10 Tricks To Conquer Your Niche With WordPress!” which is already eight years old (where does the time go?) and which is in turn a revision of the original whitepaper released in 2005.

Besides the obvious changes to the cover and title, the focus is now on getting up to speed with business simply and easily on the Internet – getting a good domain name, using inexpensive hosting, and so on – basically, explaining all the “gotchas” that a new business shifting to the Internet needs to avoid. And the key benefit? Using WordPress, site creation and maintenance is much easier than trying to do everything from scratch.

As mentioned, you can get it for your Kindle (or any device that runs the free Kindle viewer) via this link, and if you want the paper kind of book, it’s available from this link.

Enjoy!

Review: “Beyond jQuery” by Ray Nicholus

Fascinating book. In it, he shows the benefits of direct JS calls, rather than going through a library (specifically jQuery.) While much of his focus is on speed from direct coding instead of working through the library, I found another benefit – code size.

I’m currently working on code with an embedded server in VB.net, rather than using a MS server and ASP.net. The advantage is that the code is portable and license-free – no Microsoft server to pay for. The disadvantage is that everything has to be coded directly – file uploading and downloading for example, and especially file aging/checking. At about 85k, the jQuery library is not small – on typical browsers the first 85k file load is the only one, since the cache is hit from then on. But on a single-page app, that 85k is not trivial, and on a custom server, bypassing jQuery means the extra code for handling caching checks is code I don’t have to write immediately.

The book has other goodies in it. He goes through typical jQuery uses, and then shows how direct JS calls handle it the same, or often much better (by the by, I say JavaScript, but mean ECMAScript, for those purists reading).

Most significantly, the book shows the code to use depending on what browser support you need. When jQuery first came out in 2006, it was a glue that bound a variety of browsers with a variety of non-standard ways of doing things (I’m looking at you, Internet Explorer) As a result, jQuery made calls work crossplatform, and reduced the workload of programmers everywhere.

But over a decade later, the glue isn’t as necessary. Throughout the book, just about everything worked as long as you stayed with Internet Explorer 11 or later – and since that’s been out since 2013, and now replaced by Edge, we are finally getting mainstream scripting consistency.

And ultimately, it’s fun to code bare to the metal. Working your way through the DOM should be a rite of passage, like coding in assembler language, or writing a Windows dialog directly via API calls.

Would I stay away from jQuery all the time? No – for most projects, 85k one-time isn’t too bad. Especially for the jQuery UI effects like slides and closes, it’s worth working with. But it is frustrating to load a large package for a few DOM searches and calls. Of course, if you think jQuery is big, look at Angular, which can weigh in at close to 1/2 meg!

So if you want to see how far we’ve come in browser coding, give it a read – it’s well worth it!

Tomato Time Your Way To Success

Called the Pomodoro Technique of time management, it’s very simple: Time yourself doing a job for 25 minutes, then give yourself a break for 5. After a couple of hours (4 “Pomodoro” or tomotoes) take a coffee break of 15 minutes. Repeat for the rest of the day.

Of course there are variations. In my case, I’ve moved to 30 minutes on/5 minutes off, since I consult (most businesses would naturally stress over paying you for 30 minutes work when only 25 is done!) and I admit I frequently skip the 5 minute “off” break.

Having done it now for the better part of a year, I can attest it makes a difference, namely for two reasons: Accountability and Gamification.

A famous quote insists that if you don’t track it, you can’t fix it. The Pomodoro Technique encourages tracking in a way a simple time log doesn’t – by viewing the time as discrete “bite-size chunks” instead of either very small-sized units of minutes, or monolithic blocks of many hours (like a week of hours). Adding a 1/2 hour block of time is simple and shows results – even one a week is growth – growth that can be done immediately, say on a Monday. In contrast, telling yourself you’re going from 30 to 35 hours in a week sounds good, but it’s easy to push that extra amount of hours further down the week, until it becomes too much to get on the last day.

By the way, this is a key point in programming: Software projects are often encouraged to have many little milestones, rather than one big one, to avoid a project getting away.

Nonetheless, I can say the technique has made it easier to increase time on various projects, by increasing the numbers. Look online for a timer and give it a try. In may not be for everyone, but it does have the advantage of being a low-cost way to manage time effectively. Plus, it’s fun to talk about Tomato Timing!

How To Remove The URL From The Commenter’s Name In WordPress

This isn’t an article about ordinary comment removal – it’s the URL in the comment’s name, not in the comment itself.

The problem is simple: A person leaves a comment, and includes their URL. In the comment display, the name is a live link.

One day I decided I wanted to clean that up, and prevent links. No live links, just comments. That way, comments are just comments, no SEO (search engine optimization) benefit, and less spam.

You might argue that preventing links in commenter’s names is naughty, and against the spirit of the Internet, or bad karma/mojo. I acknowledge your feelings, and so I recommend you DO NOT do it on your site. However, when I comment elsewhere, I regularly see my URL removed, so I don’t think it’s such a big deal. And don’t forget, the URL has not been useful for linking for a long, long time – it merely gives the comment reader a place to go if he/she wishes to click, which I think happens very, very rarely.

Many solutions recommend hiding the URL entry in the comment form – but that does nothing for comments already in the system, unless you want to do some fancy SQL-FU on them. I didn’t, so it took awhile to research another solution, one that was low impact: I just removed the HTML from the commenter’s name before displaying.

The end result is rather straightforward – WordPress has a hook called get_comment_author_link which can be passed another function to remove the URL (HTML) code for the name field. Easy Peasy – just add this to your theme’s functions.php file code:

function utopia_authorCommentFilter( $link ) 
{
  global $comment;
  return strip_tags( $link );
}
add_filter('get_comment_author_link', 'utopia_authorCommentFilter');

functions.php is loaded with every page, so any page that displays the comments will add this hook, and remove the URL from all author names in comments. Ta-Da!

How To Close Forms Properly In Visual Basic 6

Yes, it’s 2018, and I still consult in Visual BASIC 6. Microsoft’s perennial product for programmers is alive and kicking, although mostly for software maintenance, not new builds (I feel my age when I realize I’ve worked with it now for 23 years, since 1996…) And while it has some advantages over the current crop of languages (speed and ease of delivery, for instance, unlike .net) it does have one very big issue – documentation for it is shrinking every year.

I’ve done my best by scanning eBay for any old books, but sometimes you just have to roll up the sleeves and test things yourself.

For instance, this month the question arose: Just how do you kill a form?

Normally, it’s not an issue – once you have your project set up, forms appear magically, and then they disappear the same way.

It gets trickier when you have more than one, or use SET to create a form object.

In any case, after I scoured my books and the Internet, I decided to do a simple app, using Form1 through Form3 (with Form1 the main one), tried different ways to create them, and then displayed the results when closing them. The results were surprising:

  • You don’t need an “Unload Form” unless you do something with the form. VB6 forms have two parts – the data and the form itself. Until you change the data or do something with the form, the data needs no cleanup, so form closings aren’t a problem. Do something as simple as Form2.Caption=”X” though, and VB generates that form, which then needs to be gotten rid of. And while it will try to remove it at the end, it’s best to use an Unload.
  • For safety, add a “Set Form=Nothing”. If you’ve created a form and set it, unload should work – until it doesn’t. I found that if you used a local variable to set up a form, there was no link for unload to use to get rid of it, so you had a problem. Of course that was a bit contrived – who sets up a form without keeping the form variable? But still, for added safety, setting the form to Nothing will force cleanup.

How to combine the two? The easiest way is to use a function like this:

Private Sub CloseAllBut(ByVal formNameLeftOpen As String)
  Dim frm As Form
  For Each frm In Forms
    If frm.Name <> formNameLeftOpen Then
      Unload frm
      Set frm = Nothing
    End If
  Next
End Sub

Then use this call in your main form’s Unload event:

CloseAllBut(Me.Name)

The function will close everything but the current form, regardless of whether the form’s variable is still around, and no matter how the form was created.

Of course, this function will allow the program to close, but doesn’t explain why it doesn’t close on its own. For that, you can use another function, which lists the name in a ListBox1 on your form, to help troubleshoot:

Private Sub ListOpenForms()
    Dim frm As Form
    List1.Clear
    For Each frm In Forms
      List1.AddItem (frm.Name)
    Next
End Sub

Even in 2018, VB6 holds some mysteries. But if you use Unload and Set form variables to Nothing, then at least this won’t be a mystery any longer…