Bay 12 Games Forum

Please login or register.

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

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

McTraveller

  • Bay Watcher
  • This text isn't very personal.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11775 on: May 27, 2020, 08:24:16 am »

Ugh VSS... never again (have more than 2GB in your repo? Have !!fun!!)  And have you ever suffered through sccs? Whee!

I don't find SVN to have that many problems to be honest, it seems about the same quirkiness for my own internal projects compared to Git.  And SVN fits my mental model a bit better than Git*.

The cloud? What kind of programmer are you? T ;D 8)

Incidentally, I did manage to get Apache up and running.  Turns out that Apache hard-codes a few paths in the executable (Bad! Bad developers!) and at some point in my process of the ./configure, make, make install sequence the executable I built and installed in /usr/local/apache2 was compiled to look at /usr/sbin, so was blowing up.  Some make clean and re-./configure-ing got it all up and running.  I still have to get https and the SVN hooks, and then I have to migrate my repo over**...

Spoiler: * (click to show/hide)

Spoiler: ** (click to show/hide)
Logged

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #11776 on: May 28, 2020, 07:50:01 am »

A programmer who doesn't want to fork the electric bills to keep a server running 24/7 in his rented accommodation, and recognises that DigitalOcean Kubernetes is cheaper and easier than AWS EC2 or EKS :) And a programmer who wants to be able to have his Continuous Integration run against a yaml file and have his websites deployed because damnit this is 2020 and I want my declarative infrastructure!

I think with Git it's less that you don't have a central repo and more that you just have a repo which happens to be the central one, whilst SVN enforces it. It's a 'nothing is inherently special from a technical point of view' vs 'this is the god repo' approach. Making nothing special technically offers more flexibility since it allows for centralization to be decided via procedure not mandated by the software.

Now I do think the best design for software in general is to provide a happy path that's mandated and then give people the option to drop down into power user mode. Gits flexibility allows that in a lot of ways through services like GitHub, GitLab providing a constrained environment whilst the command line letting you go nuts power user.

Aside, is why I don't think Apple do good design, I think they cheat. Where is the power-user mode for the iPhone? Oh right you jailbreak it, which they are actively trying to stop you doing. They cut out power users to provide the best walled garden experience, rather than finding a way to provide that experience without blocking power users. That's not good design, that's cheating.

But yeah how much different source control chaffes is going to depends on use-case. For one-man jobs the main thing I'd miss when working alone with SVN is is being able to do multiple commits locally then push them up in one go, but still being able to undo local changes back to my latest local commit. Don't like pushing broken code but less concerned about locally committing it if I need to stop working for a bit.

Whilst for working with teams and adopting an agile-derived approach, I think a branch per issue, pull requests and code review are a best practice and SVN really does feel like it's fighting you whilst 'decentralized' designs are much more suited for that approach.
« Last Edit: May 28, 2020, 08:08:41 am by MorleyDev »
Logged

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11777 on: May 30, 2020, 04:41:41 pm »

going on a tangent/fishing expedition here, but I'm annoyed at the state of 2020 mobile/tablet css media queries, with tablet having low resolution, samsung edge phones reporting themselves as tablet on the user agent and the likes.

Logged

McTraveller

  • Bay Watcher
  • This text isn't very personal.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11778 on: June 02, 2020, 02:18:37 pm »

Dammit Apple.  Why won't you let my httpd daemon access files on a removable drive?

Some nonsense about sandbox daemon and system policy.  But bugger me how to add permission to access removable drives to httpd.  And if the Internet has the answer, I can't figure out the magic query to find the answer.

I've also been trying to figure out how to potentially make my external drive show up as an internal drive, but am not sure if it will work.  Supposedly you can change a byte in block 0 of the drive. I might have to try it and see...


EDIT: Wow ok, definitely a violation of the principle of least astonishment:  you have to grant "Full Disk Access" permission not to httpd, not to apachectl, but to sh to get the permission granted.
« Last Edit: June 02, 2020, 03:02:27 pm by McTraveller »
Logged

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11779 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
Through pain, I find wisdom.

McTraveller

  • Bay Watcher
  • This text isn't very personal.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11780 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 #11781 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
Through pain, I find wisdom.

Eschar

  • Bay Watcher
  • hello
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11782 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

Telgin

  • Bay Watcher
  • Professional Programmer
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11783 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
Through pain, I find wisdom.

bloop_bleep

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11784 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
  • This text isn't very personal.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11785 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 #11786 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
  • hello
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11787 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

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #11788 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 #11789 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
Through pain, I find wisdom.
Pages: 1 ... 784 785 [786] 787 788 ... 795