Author Topic: Hot Code! enhancement  (Read 4004 times)

Offline ajmast

  • Member
  • **
  • Posts: 51
    • View Profile
Hot Code! enhancement
« on: April 02, 2019, 01:58:52 PM »
So now that I have Hot Codes! working, here is a suggestion:

As it stand now I have to have a code replacement line for each potential match to a Code Generator.
i.e.:
8DA03988   Dennis Walker   Walker   Photo Nerd   A
67890   Dennis Walker   Walker   Photo Nerd   A
DJW   Dennis Walker   Walker   Photo Nerd   A


What if you let me put in a | between potential Code Generator Code matches?
8DA03988|67890|DJW   Dennis Walker   Walker   Photo Nerd   A

It would still be backward compatible with basic code replacement if no 2nd, etc... option exists.
And it would decrease the complexity of the Code Replacement file (each photographer at a big event would have just one line with their data, with the Code listing their Cameras)





Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Hot Code! enhancement
« Reply #1 on: April 02, 2019, 04:26:39 PM »
I would have thought of that if it wasn't 2 AM when I came up with the Hot Code concept 8)

Brilliant AJ!

Should be a one-liner change for Kirk to add (hahahahaha)

--dennis

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Hot Code! enhancement
« Reply #2 on: April 02, 2019, 04:55:37 PM »
Seriously, for photographers with multiple bodies (serial numbers) this makes a lot of sense even without Hot Codes involved.  But in your example, I assume "Dennis" has a camera without a serial number so you need to use Hot Codes and the alternate code is filename prefix.

Frankly, if you can just get photographers to use a consistent filename prefix (e.g. DJW) then Hot Codes wouldn't be needed (for this type of scenario - to identify photographer).  I think all camera makes let you change this 3 char filename prefix.

But it would still be nice to have a single code "DJW_|_DJW" with replacements instead of two entries with same replacements.

--dennis

Offline ajmast

  • Member
  • **
  • Posts: 51
    • View Profile
Re: Hot Code! enhancement
« Reply #3 on: April 02, 2019, 06:05:00 PM »
What would you think about putting the code generators all piped on one line as well?

I like tiddy structures.

Offline dennis

  • President
  • Camera Bits Staff
  • Sr. Member
  • *****
  • Posts: 462
    • View Profile
    • Camera Bits, Inc.
Re: Hot Code! enhancement
« Reply #4 on: April 02, 2019, 06:55:59 PM »
AJ this is a great idea and we will likely implement it. But every time someone suggests a feature that sounds like a great idea, we have to think about how that may affect other users in a negative way.  We could improve John's workflow and break Sue's.

I realized that I sometimes myself have created codes that include a pipe symbol '|'.  I do this when I want to have a code that is based on more than one variable.  For example, lets say you want to have a code based on {model}, but there are two photographers (or more) using the same camera model.  So you can make a code that is more specific that combines their initials with model, and for editor sanity I use the pipe symbol.

={model}|{fbas:0,3}=

This assumes the photographer shoots in sRGB not AdobeRGB.

Then codes could be like:

D900|DJW

(assuming you have more than one photographer with a hypothetical D900 camera that didn't have a serial number in Exif)

So by adding this feature, it would not be "backward compatible" for anyone (besides me?) with a code replacement file as above.

So..., maybe a more obnoxious character such as '&'?  But even this could break if someone uses an IPTC field as a code and the value of this IPTC field contains that character.  A contrived example:

={event}=

and this evaluates to "Sue&John" because that's how the photographer notates her wedding events (because she is organized).

So ={event}= would look for codes "Sue" and "John" but they don't exist.  The code is "Sue&John".

This is why I don't recommend mathematicians using PM to write their formulas since they may involve something like an '=' character.  8)

--dennis

Offline ajmast

  • Member
  • **
  • Posts: 51
    • View Profile
Re: Hot Code! enhancement
« Reply #5 on: April 03, 2019, 04:14:42 AM »
I really do appreciate your cautiousness on such things and considerations.

Unless you think people use a pipe in the actual Code to be evaled,  I would think it is safe to use to build the array of Codes.
In your example ={model}|{fbas:0,3}= either {model} or {fbas:0,3} would have to resolve with the pipe in them to break anything I think.
i.e. I think the only prohibition would be on using the pipe in the actual Code. In the Replacement, you just treat it as a regular character.

Thanks again for listening.