I've come to some conclusion. I'm still not sure if it's complete. It goes like this. You took my problem in a slightly personal perspective, to put it with all my natural delicacy, BUT you showed me the fundamental truth here. Namely, bin search. You went with it the way opposite to what I asked for, that is instead of reducing the downlink transfer - you doubled it. Why? Because of the tertiary if-elsif-else. The third option introduces the second bit in reply, and effectively doubles the transfer. BUT you might use the timeout property of the net link, taking no answer for a negative, and the result would be fine. Thus I consider you answer as correct in structure. Binary search shows the fundamental truth here, which is the following. The server can refrain from providing a n-bit portion of of data at the cost of 2^n of reverse transfer. Which is obvious, but then - who said it has to be wiser? But there is one more uncertainty in this conundrum. Would there be no way to reduce this high exchange rate of spared link to cost? With some number theory and statistical magic, most likely. And to be completely honest - I don't know the full answer here. But I found out one trivial fact. All that magic is already applied in standard compressions. Maybe that's the place of it here also... I wondered about something like reverse compression (hence those mysterious "hashes", which so many here took literally, without much imagination). I mused and concluded that basically, it can still be applied but in the traditional form - the file is compressed before the transfer and not as part of the transfer (I am sure this phrasing will raise many an eyebrow...). In the end... I consider this question
basically closed. Intuitively, I feel thought, that there must be other, more mystical, unpractical, ways to do it. There are always more than just one way to do it...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.