FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Health.Control.Statistics
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Health.Control.Statistics
Posted: Fri Jul 22, 2022 12:28 AM
Hello friends,
I have redone a program I created in 2005 with FIVEWIN PocketPC with mod harbour.
The collection of data now works and is also easy to use on the smartphone.
This is from 2005.
viewtopic.php?f=19&t=1051&p=4180&hilit=diaet&sid=7f14ae41b1a52ffc4287fdedb7bf61f7#p4180
Best regards,
Otto

Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
Re: Health.Control.Statistics
Posted: Fri Jul 22, 2022 02:14 AM
Otto wrote:Hello friends,
I have redone a program I created in 2005 with FIVEWIN PocketPC with mod harbour.
The collection of data now works and is also easy to use on the smartphone.
This is from 2005.
viewtopic.php?f=19&t=1051&p=4180&hilit=diaet&sid=7f14ae41b1a52ffc4287fdedb7bf61f7#p4180
Best regards,
Otto



Dear Otto,

Good job.
Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Health.Control.Statistics
Posted: Fri Jul 22, 2022 04:01 PM
Hello Richard,
Now the gallery also works.
Best regards,
Otto

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Health.Control.Statistics
Posted: Mon Jul 25, 2022 06:45 AM
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Health.Control.Statistics
Posted: Tue Aug 02, 2022 04:01 PM
Hello friends,
The mod harbour HCS system is working fine.
I made a field test the last 10 days.
Here you see the statistics and the gallery view per day and over a period.

Best regards,
Otto





Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Health.Control.Statistics
Posted: Tue Aug 16, 2022 04:18 PM
Dear friends,

I think this should also work with webview2!

The mod harbour program: Health.Control.Statistic works very well.
I have walked over 300 km in the last 2 months.
Not so bad for someone who hasn't done any exercise at all for 20 years.

I have added a target value function to the Health.Control.Statistics program.
A linear function is used with minus 0.1 kg/days.
But you can define the value in a setup.
I use plotly for the graphical statistics evaluations
https://www.w3schools.com/js/js_graphics_plotly.asp
Best regards,
Otto










Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Health.Control.Statistics
Posted: Fri Aug 19, 2022 10:01 AM
Dear friends,
now with build in motivation system.
Best regards,
Otto


https://mybergland.com/fwforum/hcswow.mp4

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Health.Control.Statistics
Posted: Sat Aug 30, 2025 12:23 PM

Hello friends,

I’ve recently revived an old project that I originally started back in 2005 – at the time it was built for PocketPC with SMS input, inspired by John Walker’s “Hacker’s Diet.” The concept was simple: rate your eating habits after each meal, get a daily reminder, and receive short motivational SMS messages to help you stay on track.

As so often happens, the project eventually ended up in a drawer. In 2022 I found it again on an old hard drive and ported it to mod_harbour. That made it web-based, easier to use, and technically more robust.

Now – in 2025 – I’ve picked it up once more and started using it actively again. The new twist is that the app can now be integrated directly into the WinHOTEL PWA. This means that, alongside professional applications, personal tools can also be pinned to the start menu. For me, it’s a perfect fit: a private application seamlessly embedded in the environment I use every day.

From a technical point of view, the solution works far better than it did 20 years ago – whether it achieves the same purpose just as effectively, I’ll find out in a few months.

Best regards,

Otto

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Health.Control.Statistics
Posted: Sun Aug 31, 2025 01:29 PM
IT-Diet – Next Feature: AI-Based Calorie Estimation

I’m extending my IT-Diet system with automatic calorie estimation.
The idea: The meal is photographed, the AI recognizes the components, and the nutritional values are estimated.

Since I have a ChatGPT Pro subscription but no API access, my workflow looks like this:

Drag the photo from a folder into the chat
Paste the prompt from the clipboard
Download the result as JSON
The JSON is then automatically imported into the system

The only manual step is uploading the photo into the chat window – everything else runs automatically.

Example



Here is the result that the AI automatically determined from the photos. It’s incredible.

Perfect – let’s break down the dish into its individual components and estimate the calories:

**Plate contents**
4 small boiled potatoes
One small potato (\~80 g) has about 70 kcal.
4 pieces = approx. 280 kcal
Herring in tomato sauce (about 3 pieces, \~100 g)
Herring (in sauce) has about 200 kcal per 100 g.
Estimated amount here: \~100 g → 200 kcal
Blue cheese (\~30 g piece)
Blue cheese has about 350 kcal per 100 g.
30 g = 105 kcal
Butter (\~10 g piece)
Butter has about 720 kcal per 100 g.
10 g = 72 kcal

**Drink**
Red wine (\~150 ml glass)
Red wine has about 85 kcal per 100 ml.
150 ml = 128 kcal

**Total**
Potatoes: 280 kcal
Herring in tomato sauce: 200 kcal
Cheese: 105 kcal
Butter: 72 kcal
Red wine: 128 kcal

Total: approx. 785 kcal
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Health.Control.Statistics
Posted: Mon Sep 01, 2025 12:13 PM





API-mode:

Quick cost model (in English) and a ready-to-run PHP example that uploads an image and returns a compact JSON nutrition estimate.

Cost scenario (approx.)

Assumptions: ~4,000 input tokens + 500 output tokens per photo.

Model Cost / 1M input Cost / 1M output Cost / photo 30 photos/day (≈900/mo)
GPT-4o-mini (Vision) $0.15 $0.60 ~$0.0009 ~$0.81 / month
GPT-4o (Vision) $2.50 $10.00 ~$0.015 ~$13.50 / month


PHP: upload → JSON calories (using OpenAI API)

What it does

Accepts an image upload (photo)
Sends it to OpenAI (vision) with a strict “JSON only” instruction
Returns the model’s JSON (items + total kcal)
Put your API key in the environment as OPENAI_API_KEY.

Continue the discussion