hypersoniq's Blog

Updating the app to remove Cash 4 Life

Since it will be a swap, certain things will have to be done to remove the data for Cash 4 Life and introduce the Millionaire for life game.

1. Obtain the new image

2. Update the config.py file to remove the PACashForLife.csv file and replace it with the PAMillionaireForLife.csv

3. Change the game metadata for the name, Icon, number of draws for the sample size (870), high ball (from 60 to 58) and also change the nonus high ball from 4 to 5.

4. Rename the button on the game select screen to match the new game.

5. Introduce the logic that will disable the "classification" script until the .csv file contains 870 draws. This will be a wide universal change that checks the .csv row count with the value in "classifier draws" for all games.

6. Determine the new ID number for the URL query parameter to select the right data to scrape.

 

I am also considering placing a Quick Pick button for each game, it will go in line with the classification and frequency Analysis buttons on the game action screen. A true QP generator that will display the QP appropriate for each individual game when pressed on that screen.

The first step of all is to make the above changes to the windows app. Then simply rebuild and update the Android app. Also adding an icon to the windows desktop for a 1 click launch of the app. Still plenty to work on, but the look and feel of the UI on both platforms seems solid!

Entry #621

Skipping the last Cash 4 Life draw.

As tonight is the final sale of tickets for the Cash 4 Life draw, I have decided to stay on budget for the week and skip it.

I did not ask for a new $5 game, the $2 C4L was fine exactly how it was.

I liked all the history available (10 years) when I did have a go at the game. 

I will try this game once, on July 12th, 2028, as the night before will hit the 870 draws required to run the classification function in the app. By then hopefully I will have learned how to read it. 

They can do without my $5 until then.

Entry #620

What the first 2 days of the cash 5 have been like.

Draw 1 mid day had 4 of 5 numbers, but none in order.

Draw 1 eve had 2 of 5 numbers, none in position.

Draw 2 mid had 4 of 5 again, one in position.

Draw 2 eve had 4 of 5, one in position.

The cluster of numbers would only matter if I had also played boxed, 3 near misses... however, the pick 5 has a $1 minimum bet, so going with straight only to stay @ the $14/week budget.

I suppose we will see if there are missed box hits maybe a redistribution of the available budget may be in order (play st + box for 3 weeks and cut out 3 of 4 weeks of the Match 6, which seems to be hit by everyone in PA but me...) then the full cycle would include 3 weeks "off"... but there would need to be more than 1 missed box hit to justify anything like that. It does pay $425 on a 120 way box.

Still interesting to see 4 of 5 three times in 4 draws...

Entry #619

The strategy for tomorrow with the pick 5 cycle

Since there are 3 weeks, a different strategy will be applied each week.

Week 1: Taking the Markov Chain follower direct result, using the classifier as a tie breaker on equal frequencies.

Week 2: taking the 10 most recent followers per position, and finding the one highest on the list in the classifiers for each position.

Week 3: taking the digit in each column that is simultaneously highest on both classifier and follower tables, that also appears on the 10 most recent followers list.

They could all be way off, one may get closer than the others, maybe a dumb luck coincidental win... I should have mixed it up with the match 6 and pick 3 cycles, but I was too busy making the Android app work.

After this P5 cycle, I may consider going back to playing the games on days I have opportunity, which would reduce plays to 3 or 4 days a week and directly reduce the cost. But that depends on the ongoing lag test.

The idea I have for the classifier as a back test might finally help define that "churn", or how the numbers are random, but the frequencies are closer to the same. This would involve tracking the average time it takes for numbers to transition from hot to neutral, from neutral to cold and also from cold to neutral and neutral to hot.

The app was not the end game... only the beginning of understanding and interpreting the data it produces.

After the last draws of the pick 3, the tally stands at -$82, adding round one of pick 5 tomorrow takes that to -$96.

There is still that 1:1000 chance on the last mid and eve draws in the pick 3 cycle today, but that has yet to work into a win. One or the other hitting today would give me back the $82 spent so far and fund the "experiment" into September! A hit on the pick 5 would refund the money spent on the lottery over my entire play history! (I had plenty of "off" times, sometimes spanning years, and I am cheap, and don't always lose)

I have had better luck over the years on the pick 4, now that the app can handle all 14 games (except cash pop, they can keep that money grab) I may also switch up games in the cycle pattern... maybe a cash5, pick 4, pick 5 cycle?

5 days away from my first major app update, removing Cash 4 Life and replacing it with Millionaire 4 Life. I have to put all of the parts together and test on the windows app before pushing the Android update, including deactivating the classifier button on that game until there are 870 draws.

While this project bas been a rewarding learning experience so far and a win would just be the icing on the cake, I am about ready for dessert!

Extra update... curiosity got the best of me. I tried putting the app on my decade old galaxy note 8... it works! Slower, but not unreasonably so.

Entry #618

So, why have 2 versions of this app?

The first reason was validating the data, the check for the same exact data display on both platforms was an easy confirmation that this works on Windows and Android.

The main goal was to gain experience in creating an application that was truly cross platform. There are no missing or watered down features when going from laptop to phone, it is line by line the same code!

And with the ability to view both programs running side by side, I can now view both classifier AND follower data at the same time!

So, with another opportunity for a coding day, I was taking notes since it worked on possible changes, mostly in UI appearance... nothing major, the biggest thing will be centering the game select buttons on the screen, a one line fix in the game_select.kv file.

Then I can start planning the most massive back test ever on the Markov Chain Follower part... once I see how it would have done, and find hints on how to better interpret the data, I can apply directly the concepts to the idea of vertical sums in pick N games. If there is anything to the vertical sums concept, it can be added as a new function right in the framework!

Those are the first 2 coding goals now that my entire 2026 plan was completed so early. If any ideas come up for how to better apply back testing to the classifications, that will be figured out and built as well. Also going to add jackpot games to back testing, that is new as well.

Now I have a clean work flow for projects... start on windows where debugging is so much faster, then port to Android where it becomes an instance of building from the working windows blueprint.

But tonight, after the evening draw, I will run the app for updates on the phone, and generate the pick for the first week of the pick 5 cycle... no laptop required!

Entry #617

Success! App running at 100% on Windows AND Android!

The diagnostic prints proved instrumental in zeroing in on the issue, the Android path join was being read as a string division error, so a change to the correct path for Android solved days of frustrating troubleshooting.

Updating works as well, so now the start of the pick5 cycle will be done from the phone!

There will undoubtedly be a few minor cosmetic changes as I take time to go over every screen with both the windows and android versions, but everything is holding up well. Hard to believe my Python app, which uses Numpy, Pandas, requests, beautiful soup 4 AND reads and writes to csv files is alive on 2 different platforms...

I was giving myself ALL of 2026 to get to this point... got there with PLENTY of time to start the other projects I have planned.

Also nice to know that my OLD MSI G62 Apache Pro is up to the task after all of these years. I bought that to start going part time for a degree in 2016... graduated in 2023 (not exaggerating the part time aspect), and have always used it to practice the Python coding craft.

Cannot update to windows 11 (too old, according to Microsoft), 16GB of RAM and a 1TB SSD... powered through building this app inside of a persistent docker container from the WSL/Ubuntu Linux command line, one big 6 hour build to start, a smaller 3 hour build when I realized I did not need a 32 bit version of the app, dozens of troubleshooting rebuilds (about 10 to 15 minutes each), side loading the APK onto my phone from a USB cable, running ADB in windows power shell... all on a completely unknown (to me) tool chain that included kivy, kivyMD, Docker, WSL, Buildozer (a tool for packaging python apps for Android, P4A, a tool for running Python apps in Android's OS, Inkscape for the graphics... so much stuff to get a handle on all at once., and now I have the app right in my hand... crazy!

 

The app icon

Entry #616

Got the time for an Android rebuild...

Takes about an hour when installing a missing component. This time I loaded the functions with debug prints, all tagged with "Sleepy_Hollow" so they can be filtered out from the thousands of lines of output in an unfiltered run of the Android Debug Bridge.

What it will display is

1. Confirmation of entering each function

2. A 5 row "tail" of the data imported into pandas from the csv files

3. Confirmation of ending the functions

4. The exact return values

This will zero in on the issue

If it never enters, then the issue is isolated to config.py

If it is receiving malformed data from the csv files, then that will have to be addressed.

If it is outputting malformed data, then that issue will need to be addressed.

The data was left stale ( to 2/5/2026) so the updater can be tested. So running the functions then updater and functions again will test everything in one run.

Amazing what a few days away from a project like this can do for clarity.

Ever forward!

Entry #615

Not every coding day is a win.

I was almost there, getting error messages that made no sense, string division in a script that literally has no division in it !?!?!?!?

The program does not crash anymore, because I now have the csv files copied to the correct directory on first run only. The error messages are properly read even though I wrapped them in a tuple to return properly... the error just makes no sense.

I finally configured docker to keep a persistent container, wrestled with the kivy buildozer.spec file (the mother of all configuration files) and got a crash course on using String Search in Windows power shell, which is much better than running the android debug bridge from an elevated command line (that's just running CMD as administrator)

The maddening part is the app worked except for reading stale data... fix that and the functions break... I even asked the LLM about the error when the stack overflow search returned nothing useful (nor did the kivy site documentation), and the LLM had no idea... perfect!

Won't have a chance to get back to it until at least Wednesday, and then the plan is to add more diagnostic print statements to each python file that stands between game select and game action screens. Maybe the kivy discussion on discord or reddit may turn something up... but usually if it cannot be found on stack overflow, then it cannot be found... hey, at least the Windows version of the app is 100% functional!

Entry #614

Slow progress on the Android App rebuilds.

Finally fixed the stale path issue! Now the updater works correctly in the app_user_data space, where it has permission to append the csv files with new data!

Next and hopefully final issue was a mismatch between a successful run of the main functions vs returning an error... type not compatible. A good run returns data in a tuple, if the except block runs, it was returning a standard error message. Simple fix to handle the mismatch, just package the error message as a tuple! Now on this rebuild I can catch the actual error in the ADB logcat and solve it... then the apps on both windows AND android will be 100%

With the error not returning properly, it is never displayed in the error logs. So one more problem to identify and solve.

What a journey!

Entry #613

Week 2 of 3 on the Pick 3 ends winless.

Even a fancy new wrapper for the logic has yet to make a match. Since I am tracking, the amount spent, counting today's week 3 plays comes to $82. (Even a frugal budget of $14 a week adds up!) It would have been $98 save for the $16 won on the Match 6 cycle.

Always have to assume that there will be zero hits. That means any actual win does reduce the year cost. With $16, I am down from an initially projected cost of $728 to $712.

Tracking the rolling out of pocket expense will make it easier to split a pick 3 win into payback + weeks on the state. But if dumb luck is still the most important component, I hope I get a coincidental win on the Pick 5 cycle! Then I can pick up a Macbook pro and get my app running on iOs devices like my iPad as well.

Entry #612

Today's coding... getting the csv files to the right location.

With this app, ALL of the engineering happened on the windows side. The Android part was basically assembling the app from the blueprint I had made in windows.

The plan...

I know that I must copy the csv from the data folder to the folder in the app that holds user data. I need to see what that path is so I can get it there. So, I am recompiling with some diagnostic prints that will spell out the path clearly in the ADB (Android Debug Bridge) logcat output, filtering the exact output of that print statement rather than going through thousands of lines of output. The print statement will reveal the exact path to the user data folder... then I will have my destination to put into the config file that will make the data "live" and will allow appending draws with the updater. Right now the "data" folder in the project files is read-only. This should be the last step in having the app 100% functional on 2 platforms!

And the ultimate test for data validation will be to match exact output of the windows and android versions for a few table and stats screens... 100% match = mission accomplished.

Anything else done to the app will be ui tweaks to make it look better... until they sunset Cash4Life...

At that point I will need to insert Millionaire 4 Life and remove Cash 4 Life, but here is the challenge... for that game, classifier sample data, following the formula, will require 870 draws (58 balls x the chance for each number to appear 15 times), so I am building logic that will keep the classifier button grayed out until the csv file has 870 draws in it (871, counting the header)

The Markov/Follower will run clean even with 0 draws, it just outputs nothing, but the classifier is not designed to run data starved.

After this, the work shifts back to the script lab for the major follower back test script that should provide some clues on how to best interpret the output. Also to determine if full history vs a sample yields better results... if the sample does a better job of holding onto the volatility, that can be changed in the app following the same formula... engineer on windows, assemble on Android.

Though this part is absolutely frustrating... 10 builds in and still the stale data problem... checking the data consuming funtions....

Entry #611

A shot of the Markov Chain / Follower output

This is for the pick 2 mid day, the output is simply (number, frequency). The frequency is how many times did these numbers follow the number last drawn. You read from top to bottom and can equate higher frequencies with higher transition probabilities. Keep in mind this is still stale data from the apl as I am working out where to copy the csv files for write access, but the fact that the app launches with zero crashes on my phone still = mind blown... this is pure Python running on Android!

Also, this obviously does not actually tell you the winner, as the Markov chain only needs the last state to calculate transition probabilities, but each draw is independent of the last... but it looks good! Had to try.

Entry #610

A shot of the classification output

Here is the classifier output of the pick 2 evening game. This is the classification (H is hot, N is neutral, C is cold) of the last 150 draws. Data is read as [number, frequency, classification, percentage to the sample, draws out]

Classifier

Entry #609

The splash screen image

After having windows update force a restart while I was sleeping, have to rebuild the whole thing from square one. Deflating for sure, but that 6 hour process (9 year old laptop runs slow for this type of heavy lifting) has been started again. Nkw I expect to have data available when re installing. Here is the screencap from the splash screen, logo and the acronym spelled out...

CHANCE splash

Entry #608

Quick screenshot from the app!

GameSelectScreenhere is a screen shot of the game select screen in my app. It scrolls down for the jackpot games. Had an issue with the csv files not being packaged in the app, so another 3 hour tour in buildozer, but the app does launch on the phone!

Entry #607