In-Development TradeDangerous: power-user trade optimizer

Just found a small error in eddblink.

I installed python to my Window development computer which did not had python installed previously and tried to run -u "C:\Development\tradedangerous\trade.py" import -P eddblink -O clean". This gave me an error "urllib has no attribute request" - line 136 in downloadFile dDL = urllib.request.urlopen(url).getHeader("Last-Modified").split(" ").

So I added "import urllib.request" after the "import urllib" in eddblink_plug.py and ran the command again. This time eddblink asked if I wanted to install the request module to which I said yes and after pip had done its thing, eddblink ran as expected.
 
EDDBLink Enhancement Request.

Please would add a new parameter to the eddblink plugin that allows the display of the percentage complete update to be limited to the specified number.

For example:

--percentage=0.1 would only update the display when the percentage changes by 0.1. i.e. 0.1, 0.2, 0.3 ....
--percentage=1 would only update the display when the percentage changes by 1. i.e. 1, 2, 3 ....
--percentage=-1 would not display the percentage complete.

Reason for request.

The TDHelper uses a worker thread to issue the command to python and as a callback for displaying the output from the plugin, but the update displays on a separate line in the TDHelper output window, not overwriting the existing line as happens in the command window. Updating as often as it does right now a) bollixes the display and b) really, really slows down the execution time.

Note:
You may want to limit the output to 0.1% increments anyway as no-one needs to know the percentage complete to anything less than this.

Thanks.
 
EDDBLink Enhancement Request.

Please would add a new parameter to the eddblink plugin that allows the display of the percentage complete update to be limited to the specified number.

For example:

--percentage=0.1 would only update the display when the percentage changes by 0.1. i.e. 0.1, 0.2, 0.3 ....
--percentage=1 would only update the display when the percentage changes by 1. i.e. 1, 2, 3 ....
--percentage=-1 would not display the percentage complete.

Reason for request.

The TDHelper uses a worker thread to issue the command to python and as a callback for displaying the output from the plugin, but the update displays on a separate line in the TDHelper output window, not overwriting the existing line as happens in the command window. Updating as often as it does right now a) bollixes the display and b) really, really slows down the execution time.

Note:
You may want to limit the output to 0.1% increments anyway as no-one needs to know the percentage complete to anything less than this.

Thanks.

Issue it on the github so I don't forget, I'll get on it after I've dealt with the removed item thing.

In the meantime, do you think you can get TD Helper to respect control characters?
 
Just found a small error in eddblink.

I installed python to my Window development computer which did not had python installed previously and tried to run -u "C:\Development\tradedangerous\trade.py" import -P eddblink -O clean". This gave me an error "urllib has no attribute request" - line 136 in downloadFile dDL = urllib.request.urlopen(url).getHeader("Last-Modified").split(" ").

So I added "import urllib.request" after the "import urllib" in eddblink_plug.py and ran the command again. This time eddblink asked if I wanted to install the request module to which I said yes and after pip had done its thing, eddblink ran as expected.

Yay, trying to replicate that led to discovering a bug in TD:
Code:
  File "S:\Elite Dangerous Programs\Trade Dangerous\eddblink-listener\transfers.py", line 63, in import_requests
    pip.main(["install", "--upgrade", "requests"])
AttributeError: 'module' object has no attribute 'main'

Double-fixing FTW.
 
Okay, fixed both problems. Both the solo-EDDBlink plugin that can be installed on bgol's TD and my TD fork that includes the plugin have been updated with the fix.

I'm not going to bother to release a new version on the solo side, and in fact am getting rid of the one(s) already there.

(The only difference between the solo and eye-TD versions of the plugin is that the solo still has the code to make the changes to TD it needs, whereas the eye-TD doesn't bother since eye-TD already has those changes made to it.)

Does anyone actually care about the solo version anymore, or is everyone using the beta eye-TD now? I've been keeping it apace with the eye-TD version because the eye-TD fork isn't officially "ready" yet, but I'm beginning to think I'm wasting my time working on something no one's bothering with. Not that's hard to maintain, mind you. It's almost literally a copy/paste job whenever I make any changes.
 
Last edited:
I just want to say, to no one in particular, that I really appreciate everyone testing this stuff, finding bugs, and making suggestions for improvement. It's because of you that I've been able to do so much improvement to all this in such a short time.

I am, however, beginning to regret taking on TD development myself. :D
 
Issue it on the github so I don't forget, I'll get on it after I've dealt with the removed item thing.

In the meantime, do you think you can get TD Helper to respect control characters?

I've added the request to GitHub.

As for the control characters question, I don't know. It would certainly solve the display issue but would not do much for the performance hit. I'll see if there is a way to respect the CR and not throw a LF at the same time.

I just want to say, to no one in particular, that I really appreciate everyone testing this stuff, finding bugs, and making suggestions for improvement. It's because of you that I've been able to do so much improvement to all this in such a short time.

I am, however, beginning to regret taking on TD development myself. :D

After all these major changes and updates, it will probably all settle back down again.

Hopefully.
 
Last edited:
So, I now have a copy of TDHelper working with EDDBlink along with a few other bug fixes such as the pilot's log not updating correctly due to net log file changes back in March 2017.

I am trying to get in touch with olklei for his permission to modify his code and publish it before I start asking for users to test it out.

Watch this space...
 
An engineer and a mathematician are put into a room 20 feet square and told to stand with their backs to opposite walls. In the centre of the room stands a naked object of their desire. They are then told that they can half the distance between them and centre of the room every 10 seconds. The Mathematician walks out of the room stating that the was an impossible task since he would never reach his objective. The engineer, however, says that he will happily do this since in a minute or so he would be close enough for all practical purposes.
So an engineer, a physicist, and a statistician are all sleeping in a hotel room when suddenly an outlet catches fire. The engineer wakes up first and says to himself "this is an electrical fire, water won't work!" And runs to grab a fire extinguisher. The physicist wakes up next and thinks to himself "we have to cut the electricity off!" And runs to the power panel in the basement. The statistician wakes up and looks around, he then screams "we need more data!!" And he sets the curtains on fire.

An engineer, an architect and an actuary are stranded on a desert island with only one can of baked beans and no can opener. The engineer suggests lighting a fire to heat up the can so that the contents will expand and force the can to open. The architect says the contents would scatter all over the place, so he suggests building a structure around the fire to catch the contents. The actuary says, “Assume a can opener…"

A psychologist was studying the problem-solving abilities of engineers and actuaries. During a joint interview with one engineer and one actuary, the engineer was asked “If there was a fire in the wastebasket and a bucket of water on my desk, what would you do?” The engineer responded that he would put out the fire with the bucket of water. Then the actuary was asked “If there was a fire in the wastebasket and a bucket of water on the window sill, what would you do?” The actuary’s studied reply was “I would move the bucket to the desk, thus reducing the problem to the previously solved one.”

Two people are flying in a hot air balloon and realize they are lost. They see a man on the ground, so they navigate the balloon to where they can speak to him. They yell to him, “Can you help us – we’re lost.” The man on the ground replies, “You’re in a hot air balloon, about two hundred feet off the ground.” One of the people in the balloon replies to the man on the ground, “You must be an actuary. You gave us information that is accurate, but completely useless.” The actuary on the ground yells to the people in the balloon, “you must be in marketing.” They yell back, “yes, how did you know?” The actuary says,” well, you’re in the same situation you were in before you talked to me, but now it’s my fault.”
 
I just want to say, to no one in particular, that I really appreciate everyone testing this stuff, finding bugs, and making suggestions for improvement. It's because of you that I've been able to do so much improvement to all this in such a short time.

I am, however, beginning to regret taking on TD development myself. :D

I've added the request to GitHub.

As for the control characters question, I don't know. It would certainly solve the display issue but would not do much for the performance hit. I'll see if there is a way to respect the CR and not throw a LF at the same time.



After all these major changes and updates, it will probably all settle back down again.

Hopefully.

Well, we really appreciate your stepping up and taking the lead on resuscitating TD after maddavo went belly up. I agree with Mark in that the main problems of TD have been solved: refreshing the data (eddblink), allowing it to work for distant stations (penalty correction), and allowing it to work on more than trivial cases (greedy approximation). Things should be much calmer now. Also, you don't have to shoulder the burden yourself. You already have given Tromodor write access, so he can accept pull requests and make commits. You can simply require any suggestions to be made as issues on github and demand PRs, or at least pseudocode outlines in those issues, to minimize your workload. Should someone chafe, they can fork your repository the way bernd forked kfsone. Take as long a break as you want; you've certainly earned it. Thank you!!
 
I like these versions better:

So an engineer, a physicist, and a statistician are all sleeping in a hotel room when suddenly an outlet catches fire. The engineer wakes up first and says to himself "this is an electrical fire, water won't work!" And runs to grab a fire extinguisher. The physicist wakes up next and thinks to himself "we have to cut the electricity off!" And runs to the power panel in the basement. The statistician wakes up and looks around, he then screams "we need more data!!" And he sets the curtains on fire.
An engineer is working at his desk in his office. His cigarette falls off the desk into the wastebasket, causing the papers within to burst into flames. The engineer looks around, sees a fire extinguisher, grabs it, puts out the flames, and goes back to work.

A physicist is working at his desk in another office and the same thing happens. He looks at the fire, looks at the fire extinguisher, and thinks "Fire requires fuel plus oxygen plus heat. The fire extinguisher will remove both the oxygen and the heat in the wastebasket. Ergo, no fire." He grabs the extinguisher, puts out the flames, and goes back to work.

A mathematician is working at his desk in another office and the same thing happens. He looks at the fire, looks at the fire extinguisher, and thinks for a minute, says "Ah! A solution exists!" and goes back to work.

An engineer, an architect and an actuary are stranded on a desert island with only one can of baked beans and no can opener. The engineer suggests lighting a fire to heat up the can so that the contents will expand and force the can to open. The architect says the contents would scatter all over the place, so he suggests building a structure around the fire to catch the contents. The actuary says, “Assume a can opener…"
There was a mad scientist who kidnapped three colleagues, an engineer, a physicist, and a mathematician, and locked each of them in separate cells with plenty of canned food and water but no can opener.

A month later, returning, the mad scientist went to the engineer's cell and found it long empty. The engineer had constructed a can opener from pocket trash, used aluminum shavings and dried sugar to make an explosive, and escaped.

The physicist had worked out the angle necessary to knock the lids off the tin cans by throwing them against the wall. She was developing a good pitching arm and a new quantum theory.

The mathematician had stacked the unopened cans into a surprising solution to the kissing problem; his desiccated corpse was propped calmly against a wall, and this was inscribed on the floor in blood:

Theorem: If I can't open these cans, I'll die.
Proof: assume the opposite...
A psychologist was studying the problem-solving abilities of engineers and actuaries. During a joint interview with one engineer and one actuary, the engineer was asked “If there was a fire in the wastebasket and a bucket of water on my desk, what would you do?” The engineer responded that he would put out the fire with the bucket of water. Then the actuary was asked “If there was a fire in the wastebasket and a bucket of water on the window sill, what would you do?” The actuary’s studied reply was “I would move the bucket to the desk, thus reducing the problem to the previously solved one.”
One day a mathematician decides that he is sick of math. So, he walks down to the fire department and announces that he wants to become a fireman.
The fire chief says, "Well, you look like a good guy. I'd be glad to hire you, but first I have to give you a little test."

The firechief takes the mathematician to the alley behind the fire department which contains a dumpster, a spigot, and a hose. The chief then says, "OK, you're walking in the alley and you see the dumpster here is on fire. What do you do?"
The mathematician replies, "Well, I hook up the hose to the spigot, turn the water on, and put out the fire."

The chief says, "That's great... perfect. Now I have to ask you just one more question. What do you do if you're walking down the alley and you see the dumpster is not on fire?"
The mathematician puzzles over the question for awhile and he finally says, "I light the dumpster on fire."
The chief yells, "What? That's horrible! Why would you light the dumpster on fire?"
The mathematician replies, "Well, that way I reduce the problem to one I've already solved."
 
I have been saying for ages that pip install requests is a required step in the installation procedure.

You just confirmed the exact step by step that I posted some pages back.

Eyeonus, now do you believe me?
I never said requests didn't need to be installed.

I said that since TD offers to install it if it isn't, it isn't needed to manually install it beforehand.

Also, that little bug has nothing to do with whether or not the requests package is installed. It has to do with my not correctly importing 'urllib.request', which has now been fixed.

'urllib.request'
and 'requests' are two different packages.
 
Last edited:
Okay, listener has been updated with the fix for items no longer existing in a station remaining in the database.

I'm done for the day. I need to actually play this game at some point, it being over a week since last I did.
 
Last edited:
I never said requests didn't need to be installed.

I said that since TD offers to install it if it isn't, it isn't needed to manually install it beforehand.

Also, that little bug has nothing to do with whether or not the requests package is installed. It has to do with my not correctly importing 'urllib.request', which has now been fixed.

'urllib.request'
and 'requests' are two different packages.

I guess you don't remember back to April.
https://forums.frontier.co.uk/showt...de-optimizer?p=6651312&viewfull=1#post6651312
Hence my annoyance.

From memory Python doesn't even demand you install the package unless you add the extra line and once the package is installed, the extra line isn't needed anyway.
 
Last edited:
Back
Top Bottom