Friday, July 21, 2017

The Cigar Profiler review tool

It’s been a while but the Cigar Profiler project isn’t dead – yet. It has proven to be impossible for me to secure financing for a full-fledged web application, so I decided to become a programmer myself. Since I only know Pascal from my younger days in a previous century (literally) and a little bit of VBA from my equally ancient experience with Microsoft Access, my options were limited.

The backend is a postgresql databse hosted on Amazon, which Bjorn set up for me. The frontend is in Access but I’m currently looking into Visual Studio because the postgresql-Access combination isn’t very stable on wifi. Since I do my smoking outside, this is a problem, but more on that later.

The work progresses slowly (but surely) because I only code for an hour or two after dinner each day. In this post, I want to share what I have come up with so far. The start screen is inspired by Google: one singe search field:


You can search the database using any part of a cigar name. This may sound simple but it took little amateur me quite some time to get it right.


If a cigar is not in the database, the user can add it. Since a lot of data is the same for all cigars in a particular line, I also included a button “Add a copy”. Once the user has added the robusto, for instance, he can easily go on and add the toro, churchill, etc. of the same line without having to re-enter the data about the blend, the factory, etc.


Once you found the cigar you want to review, you can complete missing data if you want, and then hit “Review” to start the review tool:


But first you need to identify yourself, so your review can be tied to your user name:


And then it’s on to the first impressions: how do the band and the wrapper look?


With the preliminaries out of the way, the review tool appears:


You can enter text remarks or use the buttons to log flavor observations. Everything gets logged in the database with a timestamp attached. Although, not quite. This is where the instability of the postgresql-Access combination over wifi kicks in.

When you’re on a wireless network, the connection can be lost for a brief moment (we're talking milliseconds). A browser can handle this but Access can’t. It just stops working and restarts the application. That’s not only pretty annoying when you’re doing a review, but it also means your review is essentially lost.

So I created a workaround where review data gets stored locally while doing the review, and gets sent to the database in a controlled transaction only when the review is done. If a review is interrupted and Access restarts, it will notice there is data in the local table and ask if you want to resume the review.


With only the nub burning your fingers and lips, it’s time to wrap up the review. The final observations concern construction and strength, and everything gets sent to the database.


This is how that looks in the database:



From this raw data, you could construct a text review (if remarks were entered):


Or you can make various calculations to arrive at a score:


This is as far as it goes for now. I can get the data in, the next step is to get it out for the world to see. I have some ideas about that, which I have tried out in Excel earlier, like matching a cigar profile (blue bars) with a personal profile (red outline):


But for now, this is it. Development work will be stalled in the next few weeks to months as I consider my technical options moving forward, performance being the main issue.

No comments:

Post a Comment