Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 785 786 [787]

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 554933 times)

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11790 on: June 02, 2020, 06:36:09 pm »

That's weird... how is Apache running?  As a system service?  And how are you trying to access the data, serving documents from a removable drive?
Logged
Success requires no explanation.  Failure allows none.

McTraveller

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11791 on: June 02, 2020, 08:08:35 pm »

Yes httpd is being launched through launchd, like a good little daemon.

And yeah, because Macs' internal SSDs are super-expensive per unit storage, I got the minimum 250GB and bought an external 2TB drive for 1/2 the cost of upgrading that single SSD to even 0.5TB.  So of course I want to serve off the external drive.

But starting in OSX 10.14 I guess (my previous computer is still running 10.11...) Apple added some security features like requiring special permissions for programs to access resources like removable media.  So there is a mechanism where you can sign an app bundle in a way that makes it give a prompt to the user to allow access to removable drives, but this mechanism doesn't exist for non-bundle things like httpd.

There is a way you can manually add access to the programs, but it's not well documented. I had to keep looking at web info and the error logs in console for the security deaemon that just said "no permission for httpd!" but it wasn't clear that I had to give the permission to the most parent process for httpd (instead of just httpd itself), which turned out to be sh for some reason.

I'm also weary because Apache doesn't tell you you have to build against OpenSSL and can't use LibreSSL, and OSX now comes with LibreSSL by default. The worst part is it *builds* fine, but only fails at runtime because it can't find a symbol in a .dlyd.  So first I had to rebuild several times (including dependencies!) just to get httpd to run with ssl in the first place, then have it work off my test folders hosted from the internal drive because those have permissions just fine thank you, only to fail when I put it where I wanted on the external drive.

Also the documentation for how to self-sign a cert is a pain because I'm not paying for a cert for my own internal network, and then Google screams that non V3 certs are security risks even when you manually add them to your trusted certs store,so you have to find tutorial number 73 to create a V3 cert that makes chrome happy.  What a cluster.

I'm actually amazed the internet hasn't crumbled into a million pieces by now.  It's amazing any of this crap works.

Spoiler: why mac anyway? (click to show/hide)

Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11792 on: June 02, 2020, 08:27:12 pm »

Yeah, the internet is in a state of constantly being a few fat fingers away from not working.  And as irritating as all of that is, it really is an artifact of all of the web server technologies being Linux first.  It can still be a massive pain in the butt to get working on Linux, but it's generally going to be a lot easier than on a Mac.

For SSLs, if you ever have to generate a certificate for something you want to host on a public domain, look into Let's Encrypt.  It's very easy to get working with the standard web servers like Apache, at least on Linux, and the certificates are free.

SSLs and HTTPS are a constant source of irritation though.  I'm reminded of issues I've had with getting PHP's file_get_contents to read HTTPS URLs because I didn't enable some PHP module, which required me to install a few SSL libraries on Windows, then I installed the wrong version... etc, etc.
Logged
Success requires no explanation.  Failure allows none.

Eschar

  • Bay Watcher
  • Not a Pathos alt
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11793 on: July 01, 2020, 03:40:03 pm »

I'm using selenium. So I downloaded the chromedriver. I added the folder I'm keeping chromedriver in to PATH, which I know worked because I can see the folder path in the path list and I can start chromedriver from the command prompt no matter what folder I'm in. Yet selenium keeps throwing "driver must be in PATH" errors unless my code chdirs to that folder or I copy the driver into the folder my program is in. StackOverflow only has solutions for adding chromedriver to PATH. Which I have done. Grrrrrr.
Logged
"Continue struggling, laws of physics be darned."
 - NRDL
"What, are you stupid or something? Every one of the snake's bones is crushed! Its internal organs are torn apart! There is no way you can - (6) You resuscitate the snake."
- Gatleos

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11794 on: July 01, 2020, 06:11:03 pm »

What OS?  And did you set the PATH in the command prompt / shell you're launching it from, or is it set for your user or system?
Logged
Success requires no explanation.  Failure allows none.

bloop_bleep

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11795 on: July 01, 2020, 07:14:15 pm »

Often environment variables are reset after the shell closes on Windows, you should go through Control Panel in that case. Also make sure you added the directory of the driver (which I assume should be a shared object file (.dll/.so)?) instead of the root chromedriver directory.
« Last Edit: July 01, 2020, 07:16:12 pm by bloop_bleep »
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

McTraveller

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11796 on: July 01, 2020, 08:15:42 pm »

Chromium, selenium - sounds like a case of heavy metal poisoning  ;D

(Incidentally this sounds very similar to my earlier frustrations with open-source software... things work, until they don't, and good luck finding out why.  Like Strongbad once said... "Why can't you get ye flask!")
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11797 on: July 01, 2020, 08:25:34 pm »

Also make sure you added the directory of the driver (which I assume should be a shared object file (.dll/.so)?) instead of the root chromedriver directory.
Chromedriver is an executable, actually (or was, the last time I used it).
It has been a while since I've dealt with Selenium, but I remember either the Chrome or Firefox driver not respecting the PATH variable, and I think I fixed it by passing the absolute path to the chromedriver executable to Selenium.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

Eschar

  • Bay Watcher
  • Not a Pathos alt
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11798 on: July 02, 2020, 11:02:34 am »

OS is Windows.

Yes, the chromedriver I'm using is an executable.

I set PATH in the command prompt, so that might be the issue.

Passing the path into webdriver.Chrome is probably the solution I'll go with, but I'm gonna check that %PATH% isn't being reset when I restart too.
Logged
"Continue struggling, laws of physics be darned."
 - NRDL
"What, are you stupid or something? Every one of the snake's bones is crushed! Its internal organs are torn apart! There is no way you can - (6) You resuscitate the snake."
- Gatleos

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11799 on: July 12, 2020, 05:18:23 pm »

cellular automata procgen for another space game experiment I'm working on

Spoiler (click to show/hide)


any idea/literature on how to superimpose structures so they don't "stick out"? got to add bridges, hangars, turrets and the like and I'd happily generate these too, but they need to stand out from the ship noise (I can reduce ship noise too but then it becomes a little too roshrach).

Spoiler (click to show/hide)

Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11800 on: July 12, 2020, 09:12:48 pm »

That's really cool.  How is the structure of the ship represented?  Is it entirely 2D?  If so, you could just randomly place turrets and such symmetrically around the ship, assuming they can fire like that.  Hangars and the bridge could just be placed randomly along the center line where they fit.

If turrets need to fit on wings and other protrusions then it's harder, and I'm not sure how to easily recognize them.   Maybe something checking the derivative of the contour line.
Logged
Success requires no explanation.  Failure allows none.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11801 on: July 12, 2020, 09:17:01 pm »

For features I'd suggest doing the same procgen on a smaller scale but with a different system-appropriate color.
Logged

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11802 on: July 13, 2020, 10:34:38 am »

for now I used 2/3 of the contour line for secondaries, while placement is equidistant along the side for secondaries and along aft/fore 2/3 for others.

here's a sample destroyer, with 2 primaries aft, 1 fore and 2 secondaries per side

Spoiler (click to show/hide)

legibility is ass, I know, but destroyer are going to be cheap and disposable, turret scale with volume so it should work out for cruiser battleships and the likes.

turret layer of a larger ship:
Spoiler (click to show/hide)

full ship
Spoiler (click to show/hide)

in order: triple railgun, triple missile launcher, double cannon (yeah cannon and rail have the same gfx for now I was out of time)

« Last Edit: July 13, 2020, 05:52:37 pm by LoSboccacc »
Logged
Pages: 1 ... 785 786 [787]