I rather be this walking metamorphosis than having that old formed opinion about everything!
Let's build a transpiler! Part 52 ½
This is a brief return to my transpiler series.
You can find the previous parts here.
For a moment, I signed up an Internet host. They advertise they are as cheap as $2.95/month and offer unlimited space.
Alas, it costs $2.95 only if you choose their 3 years plan, paying the whole amount in advance.
As I can't afford over one hundred bucks, I've chosen their 3 months plan. The exchange rate does not favor me right now.
By the way, this company will remain unnamed.
Let's just say that that MAN in the title is formed by their initials and if you inspect this page carefully you will be able to learn who they are.
I intented to upload a quarter-million images and build a page where one could search and browse them.
With that in mind, I started uploading my images using FTP. It took forever.
Then I noticed they offer a page where you can select multiple files and upload them. This way was much faster.
The first problem I got was when I saw an upload error saying I've reached a 10,000 files limit.
I've opened a ticket and they informed me that there is a 10,000 files cap indeed.
My bad. I did not read the TOS. OK, time to re-plan the whole thing. With some creative measures,
I managed to stay below the file count limit.
Time to start uploading again.
The second problem I had was that it started to error out saying I've reached a 5GB limit.
I opened a second ticket and was informed that they do enforce this "soft" limit. Whaat? In what universe does "unlimited space" mean 5GB?
Pissed off I canceled it and was refunded for 2 months.
Their main offense is false advertising, of course, but there is a minor one I would like to bring to your attention, too.
How many mistakes can you find in the image below, depicting their upload page?
Let me count them:
You have a success message and an error message together. Does it mean we succeeded or not?
The error message does not mention which files went wrong. You must figure them for yourself.
The amount of bytes uploaded per second is negative. Does that mean that instead of uploading files, I have - gasp! - downloaded them?
You can't see it in the image because it is not animated, but the percentage varies wildly.
It goes up and down erratically.
It could be replaced by a random number generator and be as informative as it.
Is that time displayed there how long will it take to complete the upload, or how long has it been going? Your guess is as good as mine.
Another thing you can't see in the picture is that when the green bar is about to touch the percentage,
the percentage avoids it by "ducking".
So we have that percentage number bouncing up and down on the screen, averting bar's "jabs". It's almost hilarious.
It is/was an awful experience. The first time I saw it I was confused as hell.
I guess that every single file being uploaded reports its progress at the same time, and they compete for screen time.
That's why the percentage changes at will without making any sense.
And that negative speed gives me the impression that some kind of global state is being messed up by the concurrent reports.
All in all, even though I was screwed and lost some money, I'm grateful I was refunded for two months.
Due to not reading their TOS, I might or might not have been in disagreement with it, and they could have chosen not to give my money back.
It would be worse to be screwed twice...
Back to business
I counted my chickens before they were hatched. In my post of 2021-07-21, I said "One thing I am proud of is DecToStr. (...) A flawless decimal to string conversion."
Woe is me. It is flawed. It did not pass some more tests.
So I worked on it once more, and this time I am more confident it does its job as it should.
It is written in make-believe VB, but it was tested for real using VB6.
The basic logic behind it is: We have a number (Decimal) that is comprised of three Longs. So we split it into Longs.
Every unit we have in the third higher Long, means we have to add 18,446 to a "higher" Double (variable H) and 744,073,709,551,616 to a middle Double (variable M).
Then apply the same logic to the two lower Longs. After that, convert the Doubles to a Currency and two Longs and start extracting the digits.
This is not me working back full time in the transpiler yet, but a small fix.
2021-12-22 Private Type TwoLongs
Low As Long
High As Long End Type
Function DecToStr(ByVal Value As Decimal) As String Dim C As Integer'Count Dim D As Integer'Digit Dim G As Integer'Goal Dim I As Integer'Index Dim U As Integer'Unit Dim E As Long'Exponent Dim Y As Long'Middle 9 digits Dim Z As Long'Low 6 digits Dim X As Currency'High digits (up to 14) Dim H As Double'High number Dim M As Double'Middle number Dim L As Double'Low number Dim B As String * 31 'Result Dim S As TwoLongs 'To split M (Double) into two Longs Dim T As DecimalStruct