Dinghy tow harness

I have a Highfield 330 Sport dinghy and I’ve been through a few dinghy tow harnesses. I now believe I have a solution that will stand the test of time, allowing all 3 attach points to be used for redundancy, and still allowing close control of where the dinghy tows behind the larger boat. This post details the design and provides photos of the end product, I hope it can be useful to others trying to solve the same problem.

Yes, that’s a new dinghy! Yes, I bought a tow harness when bought the dinghy. NO, the carbineers on that original tow harness did not fit onto the boat connections and even the replacements I first used were not up to the job, and stretched. Solving this problem right requires going full on Tim Allen on the carbineer size, moving up to some really good strong rope for the dinghy bridle, and selecting rope for the connection to tow boat that will stretch.

Wanting to do this right, instead of a 2 point connection for the dinghy, I have gone with 3, with the center connection always slack, only to take on load should one of the port/starboard connections fail. This will pull the dinghy toward the middle as it bounces around in the normal configuration, yet not pull the dinghy sideways, and likely sink it, or rip the cleats out of the back of the towing vessel if one of the side connections fails. I’ve never seen that happen, but the idea of it is pretty terrifying, so I’ll add that 3rd connection.

While I’m pretty good at splicing 3 part rope, moving up to dyneema requires some special skills, so I have enlisted the paid support of the rigging specialists at West Marine main store in Fort Lauderdale. I provided specs on the length of lines, they built to spec and I must say, the outcome is pretty much spot on. The splice on the tow boat line is also impressive – I’m not sure how one splices a thimble into the middle of a rope, but here it is, done.

First problem, how long should the 3 bridle segments be from the dinghy to the attach point? The length from my prior dinghy harness was 6 feet and this worked pretty well, so stuck with it for the port/starboard connections. This time though, I’m adding a center connection and this is from a spot closer to the tow point, so it has to be shorter. How much shorter? Long enough that it will never take a load unless something else breaks, but as short as possible so that if it ever does take a load, it will tow the dinghy as near to straight as can be accomplished. Very little slack!

Here is a diagram of the dinghy’s three tow points. The two main points are at same position from forward/aft point of view and the center point is closer to the front. The forward point and the aft points are “same height” or close to it, so there is little to worry about from an up/down perspective changing the required length of the center connection.

Tow point locations – Highfield dinghy

A side note on Metric vs. American. I know this will come up, so best to get ahead of it. The dinghy is a Highfield 330. That is METRIC, even though it seems to be off by a factor of 100. My tape measure however only knows inches, and feet, so that’s what I used for the measurements. I would prefer to use a cm tape measure, but unfortunately, I don’t have one of those. I’ll work on this. Back to the math…

Broke out geometry and Pythagorean theorem to calculate the required length of the center connection.  

a2 + b2 = c2, or as programmers prefer to write a**2 + b**2 = c**2.

With the side connections at 72″ and the middle connection 22″ ahead, the “same” length for the middle connection computes out to 70.2″, less the 22″ head start, equals 48.2″. We want a little slack – very little slack – so I had the middle line built at 50″ vs. the sides at 72. This provides 1.8″ of slack on the middle line, which worked out about perfectly. Details in the diagram that follows.

Dinghy tow bridle center line length calculation

Adding a float on the front completes the assembly and it looks like this connected to the dinghy. Notice that the center connection is “loose”, the carbineer on its connection at the dinghy has a bit of slack. The end connections take all of the load and given this is dyneema, nothing should appreciably stretch.

Dinghy bridle connected to dinghy

I add that this is 1/4″ dyneema and that’s pretty light, but according to wise people, this has a break strength well beyond the tow rope that will go from the dinghy bridle to the tow vessel. The connection points on this aluminum bottom Highfield are also pretty impressive, large and welded right into the foundation of the boat.

I have had trouble in the past though with carbineers stretching, so went with West Marine “4 inch” carbineer part number 274340. They aren’t giving these away! At $32.29 each, times 3, this adds up to nearly a 1/3rd of the full bill of materials.

The next photo shows what happens when one side fails…

3 point dinghy bridle showing move to center when a side fails

Notice with the starboard line disconnected, the load immediately transfers to the center, and port. Still being pulled by two cables, and still mostly “forward”. This is the goal of the 3rd connection. Keep it long enough so it isn’t involved in normal towing, but when one side fails, it immediately picks up the work and keeps the dinghy towing mostly “forward”.

Dinghy bridle close up

Here is the dinghy bridle in one photo. The dyneema splices on the big carbineers are … clean. All go back to the tow point, where a float is added to keep the whole thing in front of the dinghy when not actively towing and keeping it from going deep when trying to get things disconnected. The full dinghy bridle is also “short enough” that even if we drive over it when disconnected from the tow boat’s tow line, the lines will not make it all the way back to the dinghy’s prop.

The next step is connection from the dinghy bridle to the tow boat bridle.

Tow boat bridle – equilateral triangle

For the tow boat connection I like an equilateral triangle, which makes the normal pull be from both cleats, and when going through bridges, easy to pull the dinghy up tight on one side, without having to mess with the other side. This keeps the lines out of the props and keeps the dinghy close where it can’t get into mischief while waiting for bridges. Yes, it bangs into the tow boat during this maneuver, but it is inflatable, so no worries. You can even “back over it”, and the lines stay out of the props! Doing it again, I’d probably make this triangle “taller”, moving the dinghy away from the tow boat by another 5 or so feet. Still safe from ropes in propellers, but making the tow pull on the cleats more direct to the rear.

The 60 degree angle coming off the back of the boat in my case though makes the tow bridle not hit any railings, so it works. For these lines, I used 7/16″ nylon, which will stretch. And yes, when towing offshore, it will be wise to add 50 to 100 feet of additional line on the connection between the tow boat bridle and the dinghy bridle, or just raise it up on the dinghy lifter, which I’ll save for a later post.

Dinghy bridle full rig

The full rig is in this photo. Notice that the eyes for cleat connection to boat are large; they are about 16″ going over 12″ cleats which is really unnecessary, but it makes it easy to connect and disconnect. The blue connect point is a dyneema soft shackle. I am suspicious of soft shackles, I’m not yet sure if this is a winner. It was much kinder to the wallet than the alternate solution of Tylaska Snap Shackle at $192.95. Time will tell how this decision plays out.

My concluding thought is a question. Why does it seem that everyone builds their own dinghy bridle? To take a stab at the answer, I expect the variety of connection points on dinghies make the “right” configuration a per-boat item. Bridles from mass product companies have to hit the majority consumer so really are not “right” for anyone. Boat widths vary, adding a 3rd connection point really messes up the mass market configuration. In the case of the bridle I purchased when got this boat, it was also too wimpy for the job.

In today’s case of this custom build, by taking careful measurements of the dinghy and adding some math for calculations of desired length of the middle connection, plus good help from the West Marine rigging shop (Thank you Charlie) the outcome is a dinghy tow harness that I expect will serve me well for a number of years.

Joe Nord

Activated Disqus

Thank you all who have commented on this blog and gone through the manual steps to sign up with an account on the WordPress system, author a comment and then wait for me to see it, and approve before it becomes visible. This whole thing can take a day or two on a good case and that lag time really plays against interactive nature of discussion.

In an effort to make comment posting “immediate” it is necessary to remove humans from the loop. I have set up an account on Disqus and added this site to the discussion forums.

Near as I can tell, when set up Disqus, this deactivates methods of posting on WordPress blogs which are not Disqus. That feels a bit overreaching, but its likely the right call as the real goal on this is to involve reputation in the automatic approval and posting of comments. If you are a known person who hasn’t spammed the world in other forums, then you get immediate posting here.

If you have experience in the Disqus blog commenting space I appreciate hearing what you have learned, please comment below. I fear what can happen when the world of possible robots can comment without filters. Time will show how this experiment plays out.

Update: August 20, 2021

Received notification from Disqus that my site has been approved for ads! Or, I could sign up at the paid level for $11 / month. That’s more than I want to pay and the idea of putting ads on my site to pay for the tool, well no. So I’ve bowed out and removed the plugin. It was a good experiment, I’m back to WordPress comments and a return to delayed vision of reader posts as I have to review them before they are shown.

Triangle Peg Game – All Solutions

Many years ago I wrote a web posting of how to solve the Cracker Barrel golf tee triangle board peg game puzzle. This is now located on this blog in a preceding post here.

In updating that blog for a solution of finish hole equals to the starting empty hole, I was troubled that the solution provided by reader Merv Eberhardt included a solution for 4 of the possible 5 starting holes, but did not include a solution for the evil hole #5

Related, I had never been able to get to the goal position or “magic diamond” from a starting position of 5, 8 or 9. Recall that once 3 moves are complete for all the other starting positions, the solution to the puzzle is the same in all cases. I mean, a solution to the puzzle is the same in all cases, there are lots of variations on the solution to the puzzle. The nice thing about the solution discussed in the prior blog is that after 3 moves, all the solutions are the same no matter where you started, except position 5 which is same as 5, 8, 9. Goal position or “magic diamond” is listed below.

I asked that if anyone could figure out how to get to the goal position from start position 5, please let me know. Today: I know there is no such solution.

Wrote a program

Troubled that I did not have a finish position equal starting position for hole #5, I wrote a program to solve the puzzle. Solve it yes, but I mean solve ALL of the variations.

From any position, you can jump up-left, up-right, left, right, down-left, down-right. The program starts with one position empty and then solves ALL of the possible solutions for that position, and then moves onto the next starting position, until all of the solutions are known. As a programmer, this was itself a good puzzle, much like playing the game.

The answers are

  1. There is no path to the magic diamond from starting position 5 (5, 8, 9)
  2. There is no finish in same hole as started for position 5 (5, 8, 9)

Some other neat stuff came out of the exercise though! Among the more interesting observations is that while there are 1,550 solutions to starting hole 5, every single one of them finishes with the last peg standing in position 13! This means that in reality there are very few solutions to starting position 5.


Just as the starting holes of 1, 11 and 15 are really the same puzzle rotated, there are numerous methods of solving the puzzle which are just variations of the same solution. If you switch a couple jumps in sequence, or jump in opposite directions, you can produce many more solutions which are really the same solution.

How many solutions are there for each starting hole? Glad you asked!

Peg game winning solutions and losing positions

Solutions posted online

In case anyone else wants to tear this apart, I have posted in CSV form, ALL of the 438,984 solutions to the game. You can download here. This file is 45MB in size.

Joe Nord

Triangle Peg Board Game – Solutions to amaze your friends

When visiting the Cracker Barrel restaurant, you will find a 15-peg triangle board game on each table.  This page describes how to solve the puzzle from any starting position.

Update: June 2021. Moved from web page to blog and added solutions for finish position equal start position.

The game board is a triangle with 15 holes in the same shape as bowing pins, except with an extra row.  The game starts with pegs (golf tees) in all the holes except one; the goal is to jump pegs one at a time, removing the jumped peg until only one peg remains.  The instructions on the board say that if you leave only one peg, you are a genius.  I suspect that the genius title is overstated, but if you follow the instructions on this page and you’re sure to impress the family!

For the pages that follow, the puzzle is viewed in this orientation and the hole numbers referenced.   

Triangle peg game hole numbers

Photographs follow showing the board from start of game through completion.

The normal starting hole (empty hole) is hole #1.  The initial discussion on this page shows how to solve the puzzle with hole #1 empty.  That is followed by instructions on how to solve for the other starting positions, with the happy addition that most of the starting positions are just variations of the standard #1 start.  After 3 moves, they all look the same; except the evil #5!

The first 3 jumps are:  4-1, 6-4 and 1-6.  With these complete, the “magic” base follows.  This shape will be referenced later in this document as the “goal position” for the other variations of the game using different starting holes.  Learning to solve the puzzle from this point is the key to success with the game.

The next moves, 7-2, 13-4 and 2-7. This shape is not too critical, the photo just shows the puzzle progressing.

The next steps are to clear the second from bottom row (the yellow tees) and the bottom row.

First, 10-8, 7-9 clears the second row.

15-13 and 12-14 clears the bottom.  To mix it up, jump them in reverse and it won’t look like you’re solving the puzzle the same way every time.

Almost there, the diagonal jump clears all but the bottom of the puzzle and the bottom clears “easy”.

6-13, 14-12 and 11-13 ==> Winner!

Starting position (1) – Full solution


For the other starting positions (except position 5 which we will cover later), the same solution is used after the third jump.  The “trick” is to get to the same pattern after the first three moves, the goal shape.  From there, solve solve as if it were starting position 1.   Notice that there is only one sequence to remember as you can get to the goal position from any of the starting positions based purely on shape.

Here are the moves for “after” the goal position is reached.


How many starting positions are there?

There are 15 pegs in the board, but only 4 starting positions.  For example, all the points are position “1”, even if they are otherwise called “11” or “15” the puzzle is the same once you rotate the board; even if only mentally.   2 and 3 are really the same if you view them “mirrored”.  Even if seen backwards, after the first 3 moves, both line up for the same standard solution.  Starting positions 4/6 are also swappable; 13 is the same as 4/6 once you rotate the board.

Here are all the starting positions.

11, 11, 15
22, 3, 7, 12, 10, 14
44, 6, 13
55, 8, 9

The neat thing to observe is that start positions 1, 2 and 4 and 11, 15, 3, 7, 12, 10, 14, 6 and 13 are really the same as they have the same solution once you get past the first 3 moves!   This means that there are only 2 puzzle solutions that need to be memorized to solve all positions on the puzzle.  If someone figures out how to get to the “magic” 3rd position when start with hole 5 empty, please let me know.

  • Update June 10, 2021 – there is no set of moves to get to magic position from “5”

First three moves for starting position (1, 11, 15 — Collectively called “1”).

Starting holeMove 1Move 2Move 3Comments
1, 11, 154-16-41-6 
2, 3, 7, 12, 10, 147-213-411-13Rotate right
4, 6, 1313-410-815-13Rotate left

The middle holes

I have not found a method to get to the “same as the others” solution when start with hole #5 (aka 8, 9).  A full solution follows and interestingly, it also ends with the final peg standing in hole 13; there must be a good reason.  With practice, solving this “hard one” is really just remembering that there are only 2 possible first moves and this solution starts from the right, the next couple moves are filling the pegs just jumped over or from and the 4th is opening the middle hole on the right side of the triangle.  From there, it pretty much solves itself! ?


Finish hole same as start hole

Feedback from reader Merv Eberhardt provides an interesting twist on the above solution. He wanted a solution where the last peg ends up in the same position which was empty at the start. Taking genius to a new level…

The solutions below achieve this goal, and I note that they all also achieve the magic diamond after 3 moves, so it is really the finish that is varied to move the ending position from hole 13 as is listed above to instead finish at the position which was empty at start.

1 (11,15) 2 (10,12) 3 (7, 14) 4 (6,13)
Peg Game solutions finishing in same hole as start

WordPress SMTP email notifications on GoDaddy

In setting up WordPress recently on this website, I discovered that getting SMTP working for blog email notifications was more complicated than I expected. This post shows the solution.

No, I don’t have the ability for anyone to post or comment yet, but someday that will come and it will be sure welcome to get notifications. In past, before moving to WordPress, I posted some nice content on things like how to tie boats up in canal for hurricane preparation, link. People commented and I saw the comments a month or more later. I send apologies to the folks that wrote comments that seemed to go into a black hole. Having notifications now working will allow me to be more timely in response and even will allow me to respond inquiries on “contact me”, assuming robots don’t send too much spam. Yes, they will. I know.

Convincing WordPress to send email notifications though was a tricky process. For starters, GoDaddy with CPANEL has TWO email systems:

  1. The right one, which is email system which is secureserver.net and
  2. CPANEL based site hosting of own mail server – yoursite.com/cpanel email accounts

The 1st one is the one needed to get email notifications to a place you can see them, so its the one to work with. The 2nd one is a distraction and will only send emails within your own domain. An interesting note is that in my prior usage of B2evolution, the automated setup of email in that tool configured the UNIX email system in “2”. This didn’t work but once I figured it out, wow were there a lot of emails in those invisible accounts.

Build an email account for sending messages

The first step is establishing an email address dedicated to this purpose and on GoDaddy, the way to define new email addresses is on the GoDaddy account management area, not in CPANEL of an individual domain. Logon at godaddy.com and then ignore the following panel in the top right which is a distraction. Hitting the main menu on the main website is NOT the way to define new email accounts. Here is the panel that you shouldn’t use.

The right place to define email address

The right place to define a new email address is https://account.godaddy.com/products. Scroll down, way down, and find Workspace Email. Click “Manage All”.

Now in the right place, define a new email address such as wpadmin@yourname.com or similar. Emails sent from blog system will come from this address. You should also set this up in your email program to verify it works. I note that it is POP3, not IMAP in my case and this has to be correctly configured or the email send/receive will not work. Once get the email account functioning, it is time to configure WordPress to send notifications via SMTP.

Configuring WordPress to send email

You would think this is as simple as installing a plugin in WordPress that knows how to use SMTP to send email, but there is more to it. A plugin is required and I selected Easy WP SMTP. The WordPress “Add Plugins” page looks like this.

After installing the plugin, it must be activated

The next step is to configure the plugin to use the email address earlier created. The first page of the settings is straight forward.

The second page of the settings is where the issues arise and where I hope this blog can help other folks who have got caught by the same confusion as me.

For me, the critical piece of missing information was explained in this youtube video by David Repasky. In that post he covered additional items, but the key material for me was learning that the port for SMTP send via smtpout.secureserver.net should be port 80 and not 465! Thank you David.

On the GoDaddy hosting, the UNIX machine hosting your website is close to local network and can talk to smptout.secureserver.net over ports that are not correct on the external Internet network. Notice that this means that information is traveling not encrypted on GoDaddy’s internal network segments. Is that a problem? I don’t know, but I must expect that GoDaddy have evaluated this configuration.

The final step is to send yourself a test message, as here.

With Easy WP SMTP configured as above, the email comes straight through and arrives almost instantly.

This took some time for me to dig through. I hope this write up helps others.

Joe Nord

Moving into WordPress

Updated my website to use version 8.0 of PHP and B2evolution stopped working. Was able to repair it enough to see blog posts again and managed to extract the content. This was the sign I needed to retire the old blog manager and move into the times with WordPress.

Technically I used WordPress before B2evolution, but it had some security issues that inspired me to move away. See blog post on this site about LAVE is Eval spelled backwards, link, and checking the date, wow, looks like that was 2014. From there, I moved to Blogger and some time after moved everything, except one post back to personal website. That post had wide reading and lots of links to it, so left it be.

Why did I select B2evolution? It was not WordPress and wasn’t something bad actors were attacking. I had become very tired of spam comments continuously showing up on on blog in prior usage of WordPress. Yes, this is security through obscurity, but hey, it worked.

Years gone by, it is 2021 and I move back to WordPress. I must say that with 7 years of active maintenance and enhancements, WordPress is very impressive compared to the B2evolution blogging system. I’ll write some posts on the experience.

Joe Nord

Keeping computer from waking immediately after it sleeps!

Bought a new computer a couple months ago and its nagged me since, that about half the time after the machine goes to sleep, it immediately wakes up.  Windows 10.  I’ve “solved” this so far, by holding the power button down until power is removed and that makes the machine quiet and without lights, but a better answer is to figure out why this thing is waking up immediately after sleeping.  The diagnosis and fix are detailed below.

Machine is an IBuyPower gaming computer, Windows 10 64-bit.  Comes with a very good Nvidia graphics card and big quiet fans, so winner.  Generally a good box, the machine has a bad habit of waking up immediately after it goes to sleep and that’s a headache.

Machine wakes up immediately after sleeping 

Click on Start / Power / Sleep and the computer immediately wakes.  This is normally followed by me pressing the power button for 5 seconds to tell the power supply to cut power to the machine and that generally makes the computer quiet, but this is not the right solution or behavior.

Took some time today to debug it and the problem is now solved.

Step 0 – Verify the machine is configured to sleep 

Start / Settings / Power & Sleep / Additional power settings (over on the right side)  / Choose what the power buttons do

And survey says that the power buttons are configured in Windows to tell the computer to sleep, okay, good.

Power Settings – Sleep when press power button

Step 1 – Figure out why the computer woke up 

Start / cmd (run as administrator).  It runs, then elevated power, run eventvwr.msc

This launches Microsoft Management Console, event viewer.  Scroll to System tab and scroll back in time to find out when and why the computer most recently woke from sleep.  Answer in this case is that the machine went to sleep at 23:57 UTC and woke up 6 minutes and 3 seconds later.  Odd, I thought it was 3 seconds total.  No matter, the time of this is just a curiosity, the real problem is that the event viewer says that it DOES NOT KNOW why the machine woke up. 

Event Viewer wake source not helpful

 Step 2 – Never trust a GUI 

 Command line tools can ask the system the same question and here, get a more helpful answer

C:\Windows\system32>powercfg -lastwake
Wake History Count - 1
Wake History [0]
  Wake Source Count - 1
  Wake Source [0]
    Type: Device
    Instance Path: PCI\VEN_10EC&DEV_8168&SUBSYS_E0001458&REV_16\01000000684CE00000
    Friendly Name: Realtek Gaming GbE Family Controller
    Description: Realtek Gaming GbE Family Controller
    Manufacturer: Realtek

OKAY – We have a hint.  Took me a while to figure out that “Gaming” in this case was just there to confuse matters, the real key is the “GbE”, which means Gigabit Ethernet.  Off to Device Manager to find this device and see if it is configured as a “wake source” for power management.

 Step 3 – Off to device manager to fix it 

Start / devmgmt.msc (run as administrator).

Locate network adapters in Device Manager. 

Device Manager – Network adapters

Find the Realtek Gaming GbE Family Controller, select it’s properties 

Clear checkbox – do not allow this device to wake computer

And success! Clear the checkbox for “Allow this device to wake computer” and the problem is solved.  If I were an enterprise, I might have some use for wake on LAN or similar, but here, I do not want the network adapter to be able to wake my machine and certainly don’t want it to in this case as it appears the Realtek Gigabit Ethernet is waking the computer for just about no reason at all. I hope this helps other people experiencing the same.

Joe Nord

Originally posted April 16, 2021

Stop windows from relaunching applications

When Windows 10 starts and users logon, the operating system by default will automatically restart all the applications that were running when the system was rebooted including launching them to reload the documents and revisit web browser URLs.  Handy in concept this is not how I want the machine to behave.  I would like a clean desktop, that looks the same everytime the machine boots. Thankfully, there’s a setting for this, not well advertised, but it does exit.

Search internet as I could, couldn’t find the answer, but after posting the question on twitter, the  question was quickly solved by @JenMsft on the Windows shell team.  

Answer: Settings, Accounts, Sign-in options, scroll down, “Use my sign-in info to automatically finish setting up my device and reopen my apps after and update or restart”.  By default, this is enabled, click the button to turn if off and everything now works … “as it should”.

Once I knew what to search for, was able to find the online documentation.  The option exists only in machines not part of a domain.  Appears I’m more of the enterprise user even on home computer. 

Warren Simondson  @Caditc  noted that that changing this setting enables or disables the following item in registry.

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\UserARSO\<usersid>\OptOut

DWORD setting (boolean).  1 means “opt out” => do not restart applications at machine start.

As a once upon a time programmer of User Profile code, this has just become neat!  Why the in wholly h@ll is WinLogon using a HKLM based setting to control the behavior of a per-user setting when the user registry must already be loaded before launching the applications?   I note that this makes it really difficult to place this opt out into a default user profile to make this standard policy for the machine.  If anyone has good ideas to why the machine registry was used for this per-user setting, do please add them in the comments below.

Final thought: the above prevents a machine wide default of opting out.  There “could be” a separate setting to make that global and if I had to guess, it would be in the same WinLogon space with no SIDs.  Have not had a chance to check it, but its a possibility.

Joe Nord

Originally posted July 22, 2018

Explorer shows MP4 internal date rather than date of file on disk

Among the jobs of an operating system is to maintain the disk file system including the directory structure, file names and for each file, the file size and the pertitent date information for when the file was created, modified and potentially accessed.  I have been editing some videos lately and after producing a MP4 using ffmpeg; I used PowerShell to set the file create and modified times to the date that the video was recorded.  This makes it easier to sort and allows viewing software to display timelines, good things.  MP4 files also have an internal date that is set by cameras to note the datetime of when the video was recorded.  I was surprised to learn that Windows Explorer displays the MP4 date rather than the file date and this can be problematic if the MP4 file does not contain valid date data.  This post describes the issue in detail and provides steps for adjusting all the dates to the same datetime.

Notice the use of term “datetime” rather than “date” and “time”.  In Windows and its probably an ISO standard, computers store file dates and times as one field, which on Windows NTFS is a 64-bit signed count of 100ns periods since January 1, 1600.  The point is that it can handle splitting a second up into 100 pieces intervals per second and 64-bits is a bit enough space that it can accurately store both date and time for a very long time.  As users, we never see this and as programmers, we usually don’t need to worry about the detail of the field, its a 64-bit number that represents the file’s date and time in one go, “datetime”.  Since it’s one field, comparisons of before, after and same become very easy and can be done in one operation and since its signed, you can “”subtract” datetimes to figure out how long it was between two times.

Windows stores 3 datetime fields for every file on disk

  1. Created
  2. Modified
  3. Accessed

MP4 stores its own datetime of when the file was created – normally stored by a video camera assuming you remembered to set the clock!

On Windows NT systems, the Create date is not the date that the file was first created, it is the date that this specific file was created, so if you copy the file from one location to a new location, that new file will have a fresh Create date equal to “now” and if you then edit the image/video with a program, this will update the “modified” date and all concept of when the file was created will be lost.   Image and video cameras work to solve this by storing the date that the picture was taken of video recorded directly inside the image/video file.  

As a side note, the technique in PowerShell to adjust the fle create date back to what it is supposed to be is:

$fdate = "1941-12-07 07:00"    
$dname = Get-ChildItem ("Pearl*.jpg")
foreach ($name in $dname)
    Write-Output $name.FullName, $fdate;
    $name.CreationTime = $fdate
    $name.LastWriteTime = $fdate

In my recent case, the files were MP4, videos of the kids in their younger days and I had imported these from analog camera to computer and after processing through a few different tools, the last step was using ffmpeg to convert to MP4.  This worked great!  Then I set the CreationTime to the historic datetime of the video being recorded and … though I was done.

View with Windows Explorer and … the DATE DID NOT TAKE!

Explorer is showing that the video’s datetime is 12/31/1969 7:00pm.  That isn’t right!  

Compare the GUI view to command prompt view.  Never trust a GUI!

Command prompt has the “correct” datetime.

As the explorer GUI to show file details, and we have a match!  It is listed as “Media Created” date.

And use EXIFTOOL to show the innerds of the data and we have a winner! 

The dates inside the MP4 file are all zeros!  Actually, this makes sense.  I captured the video content from one tool, plumbed it through a few others, and out the other side, ffmpeg produced the MP4 file.  By the time it got there, the only record of the datetime that the video was recorded was in the name of the file.  The MP4 file has zeros as its internal record of when the file was created.

Sometimes things try to do too much

The job of an operating system is to maintain the file structure on disk.  Esoteric concepts like what is in the files for video editing applications, is IMHO an application responsibility.  BUT – Windows Explorer is trying to help out and is displaying the MP4 internal date rather than the Create, Modified, Accessed time from the file on disk.  Explorer is trying a bit to be a video display application, something that really isn’t its job.  Then again, it can also show thumbnails for images and … people like that.  Is it something that SHOULD be in an operating system?  The lines blur and we can all have a nice debate on whose job it is to display the video content and whose job it is to display the image/video content.

Back to reality – this is not showing the date that I want it to show and the solution is to either configure Explorer to show a different date field as date or to modify the MP4 files to have datetime information embedded.  “B” is the better solution.  I went looking on the internets and found this fine post on StackOverflow, link.  Bingo!  I am not the first person to have this problem.  In the post, Edward Brey even provides Visual Basic source code to modify the MP4 datetimes to be any date you want.  Awecome.  Took a bit to compile that up and ran it and everything looked good, but I wasn’t done.

In running the VB code to adjust the MP4 datetime, the file modified date was also modified, so I ran my PowerShell bat file one more time to modify the file date times and … by magic, the MP4 datetime is now incorrect. For some files, off by 5 hours, for others, off by 4.  A bit of study concluded that the 4 vs. 5 is daylight savings time or not of the date of the files set against the create time in the file.  When PowerShell (.NET) is adjusting the CreateTime, it is also adjusting the MP4 internal create date!  What?  Why.

  1. I did not ask PowerShell to adjust the datetimes that are in the file contents, only the file “date”.  But, the embedded date in the MP4 file did change!
  2. And we’re back to the job of operating systems vs. the job of applications, but this could be a very long diversion

And its worse.  The MP4 datetime was “correct” per me in the before and after setting the datetime of the file create date, the MP4 datetime was now incorrect by a period of time equal to number of timezones away from GMT on the date that the file was recorded.

I studied this for about a day and concluded that MP4 internal datetimes are the datetime that the file was created/recorded/modified and that time shall always be ZULU!  The VB code didn’t know if the time I gave it was local time or GMT/UTC/Zulu, so it went with what it had.  When the file CreatedData was set from PowerShell, the .net runtime decided to help out and adjust the MP4 datetime to match the create date on the file itself.  Okay, problem now understood and dates all adjusted.  What is “odd” is that if PowerShell and .NET adjust the date of the MP4 file when the internal date is concluded “wrong”, why doesn’t it also do that when the internal datetime is zeros?  Consistency here would be a win.

Please add your comments below.  If you want the compiled version of the program to adjust the MP4 internal dates, drop a line and I’ll send your way.  email to joe at this domain.

Joe Nord

Originally posted Dec 22, 2018

DOS New Executable .EXE file format

The DOS world’s need for memory grew and the 64KB available to .COM executables was no longer adequate.  The NE “new executable” executable file format was invented and uses the .EXE file extension rather than .COM.  The first 2 bytes of these files includes a tag at the front to identify the format and if you guessed that this was “NE” to denote “new executable”, you’d be incorrect.  The first 2 bytes of every .EXE file are “MZ” famously because the name of the programmer at Microsoft who wrote the code was “Mark ZbikoNwski”.

The EXE file format allowed multiple segments to be defined, and included ability for separate compilation of portions of the program, and SDKs.  That is, different parts of the program could be compiled into .OBJ files, and then a LINK step is performed to assemble the resulting EXE file.  This enabled many good things like separate compilation of varied portions of programs and the ability to purchase libraries of code from other developers without them having to provide source code.  The NE format also permitted programs to be “large”, occupying space to all the memory available on the DOS computers.

I intended to write a detailed description of this evolution of file formats here, but there’s no need, it’s been well done in detail by others and I provide here a links here

Cutting to the meat of it, the NE (MZ) format executable has these portions

  1. Header
  2. Relocation list
  3. Code

Which is really

  1. Header
  2. Relocation list
  3. <Code>
  4. [Code]
  5. […]

The Header includes information for allocating a heap and a stack.  One grows up, one grows down, when they collide, the application is out of memory.  Notice that this is still DOS so it isn’t like the operating system is going to do anything when the application collides it’s memory.  Still, the executable format is starting to grow into a real concept of an operating system, with a loader.

The Code and Relocation list can use a bit more description as there can be multiple code regions, each limited to 64-KB (size of a SEGMENT).

The executable is defined in segments, each of which is loaded into memory at a paragraph boundary (16 byte boundaries).  The SEGMENT of that paragraph of memory can be addressed using the segment registers as 16:16 segment:offset addressing converts to physical address by shifting the segment left 4 and adding the offset.  At this time in the life of Intel processors, there was no such thing as virtual addresses.  The 8086 CPU is a pretty straight forward machine.  Segment:Offset converts staight to physical and when the CPU addressed it, it actually went all the way to the ISA bus where memory would respond.

After loading each code segment into RAM, the DOS loader applies the fixup records so that code calling between segments can call the 16:16 addresses where the program segment is actually loaded at runtime.  There is NO provision for DLL’s or dynamic linking.

This file format was the primary format for DOS computers through the long life of the DOS operating system and it is still with us today.  The modern PE file format includes a NE/MZ format executable as a “DOS Stub” at the front.  This is primarily so that programs intended for Windows 3.11 or OS/2 could display a message along the lines of “this program is intended to execute under Windows” and then the stub terminates.  Creative programmers can use the DOS stub to run a DOS version of a program when on DOS and a Windows or OS/2 version of program when on those operating systems.  We’re on a journey here; PC operating systems are starting to look like “real computers”.   The next post will take us into modern times of about 1990.