NimbleText is now a Machine Learning Platform

(TL/DR NimbleText 2.9 is available now. It can *infer* a pattern from a single example.)

I saw this image on twitter a few weeks ago, and it got me thinking...

machine learning 66.jpg

The first part of the diagram is a perfect description of NimbleText: given some data and a pattern (the 'rules') it produces an answer.

I started to wonder:

hmmm

How hard could it be to turn it around? Could I make it act like the second part of the diagram?... given some data and a single example of an answer, can I make it produce the rules (the pattern) to produces this answer?

Soon after, I had a satisfactory result and NimbleText can now act like the second part of the diagram.

Here's an animated movie of it in action:

Pattern inference in action

If you leave the "pattern" textbox blank, but insert an example result in the result textbox and hit "calculate" it will deduce the pattern.

In other words, you can use an example to deduce the required pattern.

For example, if you have this data:

Jones,Jenny
Smith,Sam
Johnson,Jack

...and you don't have a pattern, but you know the result you want, just enter an example result based on the first row, for example:

Hello there Jenny Jones 

Hit Calculate and the miracle of “machine learning” will use your example result to deduce a pattern:

Hello there $1 $0

Hit Calculate again the result will become:

Hello there Jenny Jones
Hello there Sam Smith
Hello there Jack Johnson

It's cleverer than that though. NimbleText also deduces any functions that are needed.

If you had the data above, with an empty pattern, and the example result you provided was:

jenny JONES

Press Calculate and it will use your example to deduce THIS slightly more delightful pattern:

<% $1.toLowerCase() %> <% $0.toUpperCase() %>

Press Calculate again, and the new pattern will be applied, giving you the result:

jenny JONES
sam SMITH
jack JOHNSON

...without you ever having to waste your finger's precious few remaining keystrokes typing out (or remembering) all those nasty function names. It can deduce quite a few other functions as well.

Try it for yourself!

Let me know about any bugs via a comment, or via email to support at nimbletext.com. cheers!


(It's probably worth pointing out that any "machine learning" occuring here is just "classical programming"... it's a very handy feature all the same!)

 

I have some feedback for you...

I read this excellent thread from Amanda Silver about "feedback":

...and it reminded me to blog about what I learned from the book "Thanks for the Feedback" by the authors of "Difficult conversations" (Douglas Stone and Sheila Heen).

There is a lot of depth to this book. I want to share the first major insight they provide:

When someone says "I'd like some feedback" there are several different things they might mean.

They might mean:

  1. "I'd like appreciation and encouragement," or
  2. "I'd like coaching/training from an expert," or
  3. "I'd like to be evaluated."

And, if someone says "I have some feedback for you" they might mean to provide any one of those three distinct things. That feeling, by the way, is the blood draining from your face. And it's in part because you're not sure what sort of feedback they're about to hit you with.

If my daughter has just played trumpet in front of 300 people and she says "How did I go?" it's not the time for coaching or evaluating: it's good old appreciation and encouragement. This applies even if, in addition to being a mum or dad, you are a world class trumpet player.

When you've applied for a job and you've heard nothing, you write and ask for feedback. You might be chasing type 3: "Did I get the job?" If they respond with "Your choice of shirt was excellent," (a weak type 1), you're not completely satisfied.

Other times, it's less clear.

So before replying with feedback, the magic trick is to ask the person what sort of feedback they want.

And if requesting feedback, be specific about the type of feedback you'd like to receive. (And then try to accept whatever you get!)

As I said, the book goes a lot further. It digs deep into the psychology of feedback, the overlap between different types, the way different people respond to different stimuli ("baseline", "swing", "sustain", "recovery," oh my!) and much more. Feedback is a crucial part of life in civilization.

I found it a worthy book.

 

Convergent versus Divergent modes of thought

Sometimes you need to expand your mind and find more ideas: Divergence.

Sometimes you need to focus, cut scope, and ship it: Convergence.

Understanding these two modes of thoughts, and switching to the right one at the right time, is a vital skill.

"Thinking exercises" are often divergent; they help you find more ideas. Brainstorming exercises; Lateral thinking exercises; Idea generation; Surveys to gather data; Seeking feedback. These all increase the possibilities. They are divergent.

This quote attributed to Antoine de Saint-Exupery, "Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away," is about convergence.

Chasing down leads, library research, finding and following references: these are divergent.

Considering is divergent. Choosing is convergent.

Scope creep is divergent. Bug fixing is convergent.

Explorers are divergent. Settlers are convergent.

Writing is divergent. Editing is convergent. (Note the saying "Write drunk. Edit sober." (Often falsely attributed to Hemingway.))

I have made this longer than usual because I have not had time to make it shorter.
—Blaise Pascal

...has time for divergences, but not for convergence.

When you've decided what color to paint the bikeshed, you have converged. When Darryl chips in with info about three more colors he quite likes, he's being divergent.

"We're re-imagining the boundaries of the enterprise, because our CEO read an article in Time magazine on the flight back from Helsinki" is too divergent. "It's just the way we've always done things" is too convergent.

Steve Jobs was convergent, "Get rid of the crappy stuff", "More wood behind fewer arrows", he never saw a feature he didn't want to remove. But he would harness divergence: harnessing divergence is the goal of the divergent/convergent dichotomy. Separate teams would work in parallel on their own prototypes and implementations: divergence. Then they'd bring all the results together and kill off the crappy ideas: convergence.

Ted Nelson (inventor of hypertext) is divergent. "The Laws of Subtraction" are convergent.

Inspiration is divergent. Taste is convergent.

shipit award.jpg

concept car.jpg

A "Ship it!" award is convergent. A concept car is divergent.

Amy Hoy and Alex Hilman's book title "Just F*cking Ship" is convergent. Bob Dylan's "Tangled Up In Blue" is divergent.

Wikipedia hosts the long-running battle between Inclusionists and Deletionists. In other words, Divergence versus Convergence.

Map|Reduce... map is divergent, reduce is convergent.

Scatter is divergent. Gather is convergent.

Sylvia Duckworth knows what's going on:

Refinement and exploration are convergent and divergent:

Refinement vs Exploration
(from Intercom blogpost referencing Bill Buxton)

Dreams are divergent. Goals are convergent.

Santa Claus is divergent. The tooth fairy is convergent.

Ward's Wiki is divergent. Getting Things Done is convergent.

Sketching is divergent. Inking is convergent.

Riggs is divergent. Murtaugh is convergent.

Divergent people think they're too convergent. Convergent people think they're too divergent.

Distraction is divergent. Focus is convergent.

Tag clouds are divergent. Inbox Zero is convergent.

"Ideas man" is a divergent title. "Man of action" is a convergent title.

Yes, And... is beautifully divergent.

A question mark is divergent. An exclamation point is convergent.

Both are good. Neither is enough.

May all your divergences converge.

See also

innovation dreamers, realists, and spoilers

 

How do you get things done?

Personal productivity is one of those things you work at every day of your life. A forever project. Right now, I've got a lot of different "systems" that work together and I'm pretty happy with some of it, so that's a nice change.

I just want to write it down and share it. There might be something you can take away from it. Or something you can add or replace and tell me about. It's very personal and I don't expect this to be completely useful to anyone. I am very interested in how you get things done.

Below is a list of the different systems, followed by a brief description of what they each do. But before getting into the systems, I want to talk about two critical concepts: Commitments and Habits.

Any time you decide to work on a new project, whether it's with other people, for other people, or for yourself, there is more work involved than you can readily see. This is the "total commitment" of the project. Over days and weeks and months and years, the project will chew up a bunch of hours. And you always have a limited number of hours.

Hence there are only so many commitments you can take on. For any project you need to decide if you're committed or not, considering the "total commitment". And the best answer is "not." You can quickly say "I can't commit to this."

When you hear about a new television series, you can think about the total commitment and say, "I don't have room for that television series right now." And that's a really liberating thing to say!

When people are super busy I think that really they're over-committed. You can't please everyone. But you can displease everyone. I'm not saying this to insult you: I point the finger of blame at myself first of all.

The other concept is "Habits". Charles Duhigg's book on "the Power of Habits" is excellent. You need to develop good habits if you want to be productive.

Here are the systems that I use habitually:

overdrive/libby/borrowbox

I get free audiobooks from the library via these apps (OverDrive, Libby, and Borrowbox) that integrate with many libraries, including my own mega local library complex (Brisbane City Council Library). (Brisbane is a massive local government, with an excellent library service; use it, people!)

Most of the time when I'm out walking (I consistently meet my daily step goals... I'm still committed, yay!) I listen to audiobooks at 1.5 or 1.75 times normal speed, with frequent pauses for "thinking". (Thinking pauses! Use them!)

A recent addition is that I try to listen to each non-fiction book a second time.

"The reading of a single text twice is more proftable than reading two different things once (provided of course that said text has some depth of content)"
Nassim Nicholas Taleb: Skin in the Game

The first time is entertainment. The second time is to make the information really soak in. The second time around I listen faster, at up to 2.5 times normal speed. It really flows. (There was a study that listening to audio at faster speeds is good for depression. It might be bad for mania though, so be careful with this power.)

I find that listening to audiobooks has really improved my skills at "performing" a book out loud to my kids at night, instead of just "reading" it. Every character can be unique, and there's no such thing as "over-acting". Audiobooks also give me deep immersion in different accents, which carries over into performing books for the kids.

pocket + kobo

When I see an interesting long-form article online I save it using the pocket extension, which I've installed both in my desktop browser and on my phone. I also use this extension when I'm researching a topic. I try to save a broad swathe of articles I can read all at once.

This way the article will be available (in a readable form) when I open my Kobo ereader at night. Kobo has great pocket integration.

I mark an article as a "favorite" to indicate I've read it completely. I wish there was a better way to indicate things about an article and to take notes or store snippets directly in the ereader. I'd pay a small fistful of coin for this ability.

k2pdfopt

If I have a scientific article I want to read later I convert it to a "mobile-reader" pdf using this strange program, k2pdfopt, and then use Calibre library to convert it to epub.

It's difficult to transfer the epub to the Kobo ereader, wirelessly. The simplest way I've found is to turn on the "Calibre content server" on my latop, so I can serve the file out to anyone on my network. Then, from my Kobo, I can browse to it and download the files I want. (I store a "favorite" on my Kobo, that makes it faster to browse to the Calibre content server on my laptop. I think it's hilarious that the 'web browser' feature in the Kobo is buried under "Settings | Beta Features" and introduced with this text: "Take the on-ramp to the information superhighway" like it's 1997)

With a Kindle I believe you can email files directly to the device, using a private email address.

(To investigate further: PDFMunge "Improve PDFs on eBook")

TIL

When I learn things I want to be able to access later, I write them into a markdown file in a repository on my computer. I run a command (via ok) and it's published to the internet, at TIL.secretGeek.net in html, pdf and epub format, thanks to gitbook.

This is a modern take on an ancient practice called the commonplace book or "commonplace".

"Commonplaces" are a way to compile knowledge, usually by writing information into books. Such books are essentially scrapbooks filled with items of every kind: recipes, quotes, letters, poems, tables of weights and measures, proverbs, prayers, legal formulas. Commonplaces are used by readers, writers, students, and scholars as an aid for remembering useful concepts or facts they have learned. Each commonplace book is unique to its creator's particular interests. They became significant in Early Modern Europe.
—Wikipedia

CleverDeck

When I need to memorize a fact, such as the name of my friend's new pet dog, I put it into a spaced repetition app called CleverDeck.

These are different from TIL facts, these are little things I need to be able to instantly recall without looking them up.

Facebook does a good job of remembering birthdays for the people that are on there. But other people I have to remember for myself, so I put them in CleverDeck and find them easy to memorize.

I think I'll start putting a lot more things, including technical things, into CleverDeck.

Here are two lengthy articles on spaced repetition that cover a lot of ground:

devoir

This iphone app, devoir, is the latest addition to my systems.

There are some recurring maintenance tasks I want to remember to do. They're basically "chores". I put them into devoir.

When a task is marked as done in devoir it is immediately set to be redone at a certain distance into the future. For example: wash the car. If I wash the car and tell devoir I've done it, it will disappear, only to re-appear in 6 weeks. It's very easy to change the frequency of any task or add a new task.

At first, I had only a few things in devoir. But now it has grown to effectively manage more and more of these Sisyphean chores. And since devoir is the only thing that knows when (for example) I last had my annual home pest inspection, there is a "lock-in" with this product.

Some recurring tasks I don't have to remember because the task will remind me. For example, dentists are not shy about reminding you to come in for an appointment. And each time I get my haircut I book in the next appointment right away (and add it to my calendar, see next item).

Amy Hoy's recently launched "pep" product may be a more powerful way to manage recurring tasks. I haven't looked into it. But her design work is out of this world, so I think it would be money well spent.

calendar reminders

How many calendars do you look after?

I've got my main calendar on my phone. And an analog family calendar my wife looks after on the wall of her study. There's my personal work calendar in outlook. And my teamwork calendar in Outlook/SharePoint. Sometimes I'm on projects that have their own calendars.

journal.md

I have a journal file that I use for processing what I'm doing. I press Ctrl-D to insert a timestamp.

alarms

I have alarms set at different times for every day of the week. I choose distinct ring tones for each type of reminder, to try and create pavlovian responses. I hear one alarm it means "gently start to awaken from your slumber". Another sound means "get the fuck out of bed, dipshit."

markjump / j now

I use the command line for all my computer work. Using markjump I can jump to any of my projects with the alias "j".

For example, to work on "Choose Your First Product" (the book) I type j yfp. To work on the website "YourFirstProduct.com" I type j yfp.com.

There is always a bookmark called now which I can jump to with j now which is the current project I am committed to working on.

.ok

Each project I work in has a .ok file (a little text file) that I can instantly peruse or execute.

As soon as I jump into a project, the .ok file is listed. It shows me a bunch of handy one-line commands for that project, with a number next to each one. I press ok 1 to run the first command, and so on.

I edit the .ok file with n .ok (because I have a function called n that opens a file or series of files in my text editor.)

wiki

There are some things I learn about that I find fascinating. I put those into the wiki at wiki.secretgeek.net, not into the other systems.

And other things become blog posts, or book ideas, or paintings or drawings or stupid tweets etc. Everything ends up somewhere.

Music

As previously discussed I use "deep focus" playlists to help me get and stay "in the zone."

Passwords

Passwords of course go into a password manager. I use PasswordSafe, aka PwSafe.

Weekly Email

But the best new thing that's helping me be productive, is the weekly email I get from Doctor Richard Mason. It's not a mailing list email, it's a personal email.

Talking to Doctor Richard we found we were both letting our side-businesses flounder with important tasks left undone for too long. There were easy tasks that we were simply not moving ahead with.

Now he sends me an email each week. He tells me what he's planning to do on his personal business projects. And tells me what he got done. I see him making steady gains. It's wonderful to witness!

Then I reply and say what I'm planning to do and what I got done. Things I could've put off indefinitely are getting moved along. It feels good.

It's a bit like a daily standup, but at a different pace, and more deliberate, less coerced.

Dread Task

Sometimes there is a dread task that I struggle with. These are often small, sometimes vague. They usually involve contacting a stranger or a person who has the whammy on me. Sometimes they are weird technical bugs that I can't resolve or reproduce.

As soon as I notice a task like this, I tell my brother about it. He doesn't need to tell me to do the task or anything. His role is just to acknowledge that I've said it. The reply "ACK" is sufficient. If he has a similar task, he can let me know about it. I try not to offer solutions unless he explicitly asks for them. Just an "ACK".

Having him there to hear about my dread task is really useful. It's a very trusted position. Thank you, John.


That's about it for the systems I use today. How bout you?

Here's some of the many many systems I've used previously:

  • TiddlyWiki
  • Trello
  • OneNote
  • Todo.txt
  • Ta-da list
  • Google Calendar
  • followupthen

Further Reading

(I finally found the link above, an essay from Simon Harriyott about his systems of organisation. It's from 2014 though, and everything was different in ye olden times.)

Addendum

Screentime feature in iOS 12+ is also helping me out now.

And I'm using an app called "Toned Ear" for learning Relative Pitch (i.e. musical training) in a form of deliberate practice.

For organizing papers/pdfs (which Pocket doesn't handle well) I use zotero ("your personal research assistant").

 

Spy Codes: a code booklet to help your little spies

A handy cheatsheet for helping your kids crack codes.

Download PDF (6 pages)

I love this! I built this and extensively field-tested it with my own crack team of super spies (my kids).

It's 6 pages of my favorite Spy Codes, for use with your own budding spy team (i.e. your kids).

It's a FREE PDF, a dense little book, guaranteed to bring you hours of fun. (And give your kids a lot of practice at performing lookups.)

spy codes preview

This 6 page booklet is simply a series of tables containing alphabets that help you translate:

  • Morse code
  • Braille
  • Pigpen cipher
  • Knights Templar Code
  • A Mayan Numbering System
  • Caesar Cipher (complete table)
  • Complete ASCII (in decimal, hex, and binary)
  • And more

It is vital that your child does not let this book fall into enemy hands.

Using these sheets to encrypt and decrypt messages is a practical introduction to substitution ciphers.

If your kids (or students) enjoy these, there are many, many more advanced concepts that pick up where these exercises end.

Last year I blogged about: Dadding 101: Give Your Kids A Trail of Codes To Break.... and of course coding trails are not limited to use by dads. Mums, grandparents, foster parents, step parents, guardians, siblings, cousins, friends... everyone should be giving trails of codes to break to all of their loved ones at all times. It's one of the most joyful things in life. I know my brother and I set these up for each other when we were not the grizzled old men we have transformed into today.

Simon Singh's delightful volume "The Code Book" is a great read on the topic of codes throughout history. It's a pleasurable read and goes qute in-depth. Fun for all ages.

Znl nyy lbhe pbqrf or nf rnfl nf guvf bar!


Hacker News discussion

 

The Book Is Ready

Choose Your First Product cover 200

Here's the thing. I wrote a book. It's out now. And you can get it here:

Get "Choose Your First Product"

This charming little tome, "Choose Your First Product," is for any first-time product creator who wants to find a product idea that they can sell with confidence.

There's a tragic pattern that I've seen too many times:

I've watched people around me as they make their first product. They find an idea they love, or a problem that intrigues them. They pour everything into it. They code in isolation. They delay shipping, again and again as they add features, or polish existing features. If they ever ship, which they almost never do, the product is full of beautiful code. Yet it can't find a single customer. Or very few.

And they're supposed to "pivot" at this point. But that's impossible. They're demoralized, for starters, and second, they have no meaningful feedback on which to pivot. They've failed completely. Defeated, they declare "I was just no good at marketing." And give up.

They think the problem happened after launch. They didn't hustle hard enough. They didn't choose the right font on their landing page. (Maybe they can A/B their way to success?) They don't realize they were on the wrong track before they even fired up the IDE.

This book is a practical remedy to that problem. How do you start with something people will pay for? How do you start with something that will be easy to sell?

I've boiled it down to a four-step plan, the T.O.A.D. It's a framework. Of course it is. I walk you through the TOAD, this four-step framework, showing how easy it can be to find an idea that will help real customers.

Because I like to overdo things, I made it available in four formats:

If you want to make a humble product that will help real customers, then it's possible this book will be useful. No pressure though.

Read more here.

bird1 row 230

 

Death to the Passive Voice

When I was a funny little school kid, my English teachers would moan:

Stop using passive voice in your writing!

I did not know what they meant and found no enlightment in their answer:

Passive voice is when a verb is used without a clear subject.

Now that I'm a big kid and I live in the modern futuristic utopia of 2018, I finally understand what passive voice is all about!

If you go to an application like "Hemingwayapp" and paste in the sentence:

Passive voice is when a verb is used without a clear subject.

...you will see the app highlight the words "is used" as a blatant example of passive voice...

We've employed a "doing-word", the verb 'used', but we haven't said who or what did the doing. There's no one to blame for this action.

With a little thought we can re-write the sentence in an active way:

"Passive voice is when writers use a verb without a clear subject."

Now we know who is doing the thing... writers did the thing!

As an editor it's hard to turn someone else's passive writing into active writing. Because when we turn passive writing into active writing we must decide "Who did this verb?" Only the original writer can be sure where to stick the blame.

Passive voice is completely reliant on weak verbs. Things are "done". But they're not done in an interesting and engaging way. Once you've made a subject responsible for the action, you can also enliven the verb:

"Passive voice is when writers dribble out their verbs with no clear subject."

"Passive voice is when tepid writers lay down their verbs with no clear subject."

Death to the Adverb

On this topic of choosing verbs we find another big suggestion from hemingway app: use fewer adverbs.

If you write:

The girl ran quickly across the lawn.

Hemingway app will ding you for "quickly" -- as it's an adverb, and Hemingway himself punched out as few of them as possible. You may have observed that he wrote the books "For Whom the Bell Tolls" and "A farewell to arms". He did not write "For Whom the Bell Merrily Tolls" and "A Cheery Farewell to Arms."

A writing coach won't just tell you to ditch the adverb: they'll get you to improve the verb.

So this is worst:

The girl ran quickly across the lawn.

This is better

The girl ran across the lawn.

But this is betterest!

The girl dashed across the lawn.

A single word, a verb, that contains within it more meaning than the verb plus adverb combo.

And again, only the writer, not the editor or the coach, can choose the correct verb.

The girl sprinted across the lawn.

The girl dashed across the lawn.

The girl flew across the lawn.

The girl tore across the lawn.

The girl fled across the lawn.

And so on. Each with different connotations.

(I'm hooked on these topics lately, as I've been writing the book Choose Your First Product (launching any day now!) and editing the book Evergreen Skills for Software Developers... I can't read anything without mentally taking out the red pen.)

 

I'm .ok you're .ok: introducing folder profiles for bash and powershell

ok

Summary: a .ok file holds a bunch of handy one-liners, specific to the folder it is in. It can be viewed or executed with a simple command. It makes you smarter and more efficient.

I work on lots of little projects and each one has its own nuances and tricks. Context switching from one project to the next is hard on the brain. Some projects are brand new, some are ten years old. Some are in Windows, some are in Linux.

Every time I go to resume work on a project there is that moment of confusion as the brain tries to reload a dusty tape of facts from cold storage.

To make it easier to recall all pertinent facts, I've started putting a little file called ".ok" in each project. This file holds any relevant shell commands I use with that project. (I have a powershell version and a bash version)

For example here's the .ok file from my "Today I Learned" project:

.\quick.ps1; .\deploy.ps1; # quick-build, prepare to deploy
.\build.ps1 # complete build, after which you can see preview
_book\index.html # see preview
.\wordcount.ps1 # custom word count script

If I type the command "ok" then I will see a listing of this file with a number against each line:

> ok
1. .\quick.ps1; .\deploy.ps1; # quick-build, prepare to deploy
2. .\build.ps1 # complete build, after which you can see preview
3. _book\index.html # see preview
4. .\wordcount.ps1 # custom word count script

And if I type "ok 3" then it will run line number 3, like this:

> ok 3
> _book\index.html # see preview

(And in this case I'll see a HTML preview of the current state of the book)

To make "ok" extra useful, I've setup my system so that every time I navigate into any folder (via cd), the command "ok" is run immediately. So if there is a ".ok" file I'll immediately see the available commands. (I did this by removing the "cd" alias, and making a custom "cd" function that does a set-location followed by a call to "ok")

If I want to add a command to the file, it is the work of a moment. I can do it immediately by editing the ".ok" file with "ed" or any standard editor.

Source code is here:

"ok" folder profiles for bash

And here:

"ok" folder profiles for powershell

Sometimes I write a thing and slowly stop using it. Other times I use it more and more, day after day, year after year, as happened with NimbleText. So far, "ok" seems to be one of those "use it more and more" solutions. So I think you would do well to give it a try.

Any issues, lemme know.

 

2017 by the Numbers

Being productive in 2017 was particularly challenging. The most powerful nation on earth elected a madman, and no-one could really think about anything else. If you produced nothing, but managed to survive, then good for you.

Here's a summary of things I shipped. Numbers in parens, e.g. "(3)", are last year's figures.

Things I didn't publish:

  • A massive pile of genealogical research.
  • Research into Python in Minecraft
  • "Epic Loot Quest of the Dungeon Raider" (threejs fps)
  • "Androids versus Electric Sheep" (Artificial Life program)
  • Linqpad scripts for generating Guitar chord/key/scale cheatsheets and progressions.
  • 65 stub articles at the wiki.
 

Your photos are a mess! Maybe this PowerShell script can help

As a family, you have a huge photo problem. Well, at least my family does.

After a holiday we have thousands of photos on two smartphones, two regular cameras, and a few on an iPads as well. From this horrible mess, my wife wants to select the best of the best and print them in a photobook.

Before she can start putting the photobook together, we need to collate the photos from all the devices in such a way that photos are in precise chronological order, regardless of which camera they came from. And to make matters worse, the smartphones have automatically adjusted for timezones, while the others have not.

Enter the "Rename-Photo" commandlet I put together in Powershell. This thing has improved my life far more than the average PowerShell script.

Disclaimers:

First: if you're going to use this, there is no warranty, and I advise testing on one or two pictures first, before blasting all of your photos.
Second: I'm not a great PowerSheller and haven't turned this into a reusable "module". If you want to help me turn it into a module please do!

With those caveats out of the way, I'll show you why I love this script and why it brings bliss to my whole family.

First, you bring all the photos together, from all the devices, onto one hard drive, in separate folders. This might itself involves lots of rummaging for cables and some cursing and various levels of frustration. But eventually you might have a structure like this, with one folder for each device:

photo folders

Once you've got those folders in place, you will need to run a script in each folder (more details below).

First, you can grab the script from here:

github/secretGeek/rename-photo

or by running:

git clone https://github.com/secretGeek/rename-photo.git

And to make sure the Rename-Photo function is available, "dot source" the PowerShell file, by running:

. .\RenamePhoto.ps1

(from Powershell!)

Done that? Now go into one of your photo folders (in PowerShell) and run the rename-photo function against all the files. You'll need to know what values to provide for a few snazzy parameters.

For example

dir *.jpg | % { Rename-Photo $_.FullName "iPhoneSally" "Martinique" }

This will rename all of the jpg files in the current folder, to have a filename like this:

2017-11-10-14-12-10_iPhoneSally_Martinique_53959339.jpg

Where:

  • 2017-11-10-14-12-10 — is a sortable representation of the date the photo was taken (from the Date taken EXIF data). It's not formatted in strict ISO 8601 format. If the file doesn't have the relevant EXIF data (for example if it's a png file) then the LastWriteTime is used instead.
  • iPhoneSally — is the device name you've supplied as a parameter. This can be helpful later if you need to work out who took a particular photo
  • Martinique — is from the 'location' parameter
  • 53959339 — is the number of bytes of the file, and acts as a useful tiebreaker in-case two photos were taken on the same device in the same second. (This was effective for me, over tens of thousands of photos, so I wasn't forced to use something like a checksum for tie-breaking.)

There's one more parameter, and you can use it for fixing the infamous timezone issue. Once you've worked out that the camera's internal clock was reporting times that were 10 hours earlier than the real local time, then add a final parameter of "10", e.g.

dir *.jpg | % { Rename-Photo $_.FullName "iPhoneSally" "Martinique" 10}

If you've made a small mistake, the script can be re-run. There's no limit on how many times you can re-name the same file. And you can alter the script to improve the format.

The real filename formatting work is done in the line that looks like this:

$newName = ("{0:yyyy-MM-dd-HH-mm-ss}_{1}_{2}_{3}{4}" -f $exactDate, $device, $location, $length, $extensionWithDot)

And if you change the script, just dot it again. There's no limit on the number of times you can do this either.

Once you're happy with the filenames, copy all of the files, from all of the devices, together into a single folder.

I tend to break them down into one folder for each year, so you don't totally overwhelm the file system.

Then all the files are together, and the joyous hurdy gurdy of a family trip has been sorted into a single stream of captured moments.

Any improvements, please submit a pull request or raise an issue on GitHub.

Any questions, the comments are open.

kind regards
lb