Saturday, April 4, 2020

Here We Go

For a long time, I felt the need for an application to keep my personal data in place. My requirements were next:

  • It should be lightweight and minimalistic.
  • It must present protected (hidden) and open (visible) data in the single set.
  • It should make the process of data input/edition easy, but still protects this data from an accidental unintentional change.
And here let me show you the one which I eventually built.

This application is written in Go. It is not a real Windows GUI but rather TUI and it uses an excellent Go package "rivo/tview" as the foundation. It looks and feels less like modern Windows commercial programs, but more like old fashioned PC Dos application.  Still, it does whatever expected in an efficient and straightforward way.

The terminal screen consists of two areas:

  • Top menu
  • Table with User Records

The application starts with a single argument: the path to the file with data storage. Storage is encoded and password protected. If such storage does not exist, the application will ask you to enter the new password and will create new storage.
At the start, the application puts focus on the top menu. Hitting "Enter", while button "Select" is in focus, move the focus to the table. To put the focus back on the top menu use "Esc".To navigate through the menu or the table user must use arrow keys.
Numbers of table rows and columns are unlimited but it is unlikely somebody will use more than a hundred rows or more than 3..5 columns. Each rows contains one cell (Record Name), which is always visible, and several values. Values on each row may be either all visible or all hidden.
The application supports four modes:

  • Clipboard-on-Enter. If the user hits "Enter" on the selected cell its content is copied into the clipboard.
  • Clipboard-on-Select. During navigation content of the selected cell is copied into the clipboard.
  • Visible-on-Enter. If the user hits "Enter" on the selected cell with hidden content it becomes visible. When the cell becomes unselected its content becomes hidden again.
  • Visible-on-Select. If the user selects the cell with hidden content it becomes visible. When the cell becomes unselected its content becomes hidden again.
The user may add new records (button "Add") or edit existing (button "Edit"). To edit existing record select record on the table, then by "Esc" go to the top menu and hit button "Edit". The record may be extended with one extra value. If there is a need to add several extra values repeat the process several times. The short clip below illustrates how the program works.

Source code is available . The project "readme" contains some additional details regarding its dependencies, platform support, how to build it and run the demo. If you will find the approach useful feel free to take this application as is or use it as a starting point for your own project.

Thursday, March 19, 2020

Home Improvement at Time of Coronavirus Outbreak

It is time to look for help from a screwdriver. No, I do not have in mind a mix of orange juice and vodka. There is no evidence it can serve as coronavirus remedy or prevention, alas. I am speaking about regular #2 Philips screwdriver which anybody can find in his toolbox.

Here is the story. What is the first step in fighting the coronavirus spreading? If you can't answer it at once, look for  Google "DO the FIVE" reminder. The first item on the list is "1. HANDS wash them often".  It seems easy to implement. But don't jump into conclusion. To wash my hands I have to reach the faucet in our bathroom. And here is the problem: doorknob.

You see: to open the door I have to grip the doorknob with my hand. And what if my hands already contaminated? Do you know how long that coronavirus can live on a metal?  Nobody can tell for sure but time can vary from several hours to several days. The solution? Change the doorknob with a levered door handle. I did not even need to buy one. One of our closets doors has the handle, so I only needed to switch places between the knob and the handle. And the only tool needed was a screwdriver. Here is the result: 

I hope such a  solution will serve me well even when the pandemic is over. I still may enjoy this improvement when I'll come home from the garage or backyard with my hands dirty.

Be safe! Keep calm and carry on.

Sunday, March 1, 2020

Less than Six Miles Apart

South San Francisco and Daly City are two neighboring cities in the San Francisco Peninsula. They are really close. Driving form one to another should take less than fifteen minutes.  

But that not how FedEx delivery service sees it. Here is my post about the small observational project which I would like to share with you, my friends.

I bought the book on Amazon. The book was used and I bought it from the SFGoodwill Amazon store. I work at Daly City and ordered delivery there. My assumption was that as far as SFGoodwill for sure means Goodwill of San Francisco even the cheapest delivery should not take long. Indeed pretty soon I got a delivery notification.  Item arrived at South San Francisco FedEx location. Based on that I expected delivery the next day. But,  alas, that not how it worked. The book was shipped to Sacramento, one hundred miles to the northeast either form South San Francisco or Daly City. After a couple of reroutes through the Sacramento FedEx locations, it was eventually moved to USPS and arrived at the destination. How that happened? The most probable explanation would be human error, right? One operator made a mistake and put the parcel into the wrong bin. It is good that eventually that was fixed.

Still, the human error idea needs to be verified. I looked into SFGoodwill Amazon store, found one more used book which had some value for me and ordered it, then tracked the package. Guess what?  The route was exactly the same: South San Francisco->Sacramento->Daly City.

Why it works that way?  Mystery. Sure SFGoodwill tries to find the cheapest service and probably FedEx Smartpost (which means the last leg of delivery is made by USPS) meets that expectation. But why FedEx ships it to Sacramento? Hard to tell. One thing I am sure Chuck Noland  (if you watched "Cast Away" you know what I am talking about) would make that delivery in a more efficient way.