Software Developer Mega Thread

I tackled this in College back in the day. So I believe the significance of the problem is that you cannot use a straight edge and compass to solve this problem. I don’t remember if it is because of the dimensions or not. But basically, as it was schooled into me by my awesome professor…

A cube is a box in three dimensions where the edge length of X is equal for all edge lengths (read not a rectangular cube).
If you have an edge length of X = 1, then the volume of your cube will equal 1 because X^3 = 1^3 = 1. If you want to double the cube, it is not as simple as doubling each edge length. So you need to find a value such the X^3 = 2 essentially.

To find the new value of X, lets call it (Xx) you need to find the third root of 2 or as the problem states, the cubed root of 2. So Xx =3rdRT(2) (I don’t know how to do this outside of Wolfram).

So with a little inference and proofing, Xx would need to equal a value of r, where r is a construct-able value. In Geometry, that means Xn needs to be a real number that is construct-able with a straight edge and/or compass in a finite number of steps. Thus Xx must equalt |r|, which must be real.
In Algebra, r can only be construct-able IFF it can be constructed with values of integers 0 and 1 and only using Addition, Subtraction, Multiplication, Division, and SquareRoots only.

Taking what we have just established, we can say that Xx needs to be equal to |r|, which must be real, which means Xn must also be rational. So working backwards, Discreet numbers are integers. Integers are rational numbers, and thus Rational numbers are real numbers (R(Q(Z(N)))) (where N are natural numbers).

All of that to say is that since we are trying to find the Value of Xn such that the cube with volume 1 will be doubled is impossible, because the smallest polynomial that will get you the volume of 2 is of the 3rd degree, making the value of Xn a non integer, which means that it does not satisfy the requirements to be a Real number, thus it cannot be a real number and thus is not rational and would never satisfy a value of |r| such that it can be geometrically construct-able using a compass and straight edge in a finite number of steps.

Did that make sense. Been out of college for a little bit but I remember most of this because it was a week long assignment, only to find out that our professor put us on a fools errand. Also, my mathematical proofs may be a little dusty as I don’t really do this in the IT space anymore.

**Edit
I was working out the proof in real time as I type it out. So yes, how ever you want to look at it, the easiest answer is that due to the dimension of the polynomial, you cannot square the cube and keep it construct-able. So yea, the dimensions are probably the biggest significance of why the problem exists.

4 Likes

Lesson learned in the fire academy. On the first day, my entire candidate company had our personal belongings dumpted into a big pile while we were on a 3 mile run and told we had 5 minutes to sort our belongings into our luggage again. This was impossible and resulted in pushups.

Turns out the same people who complained during the pushed ups also washed out and quit sometime later.

This is an excellent life lesson your professor showed you. You cannot win. “Fools errand” or not, sometimes you CANNOT win.

I love this simple, ancient, example.

2 Likes

Wrote a shim for an interface today. It made me wonder… do software systems ever get shimmed so much it would take less code to refactor the system or interfaces than “pile on the patches?”

…?

Yes, they do. I’m currently stuck working on one, and it sucks.
Everything takes forever because you’ve got to sift through 15 years of stupid shit every time it’s involved.

Avoiding that is hard though unless you’re lucky enough to have a ninja behind the project who’s able to see where things are headed, and make a convincing argument in the language of the bean counters.

Otherwise, if you’re too early, then it’s not worth the effort, and if you’re too late, then it becomes another sacred cow that everyone hopes won’t just scream and die.

1 Like

In this case, it wasn’t to bad, but it was obvious that the interface they wanted to use was never designed to work in the context they want to use it in.

It wouldn’t be too difficult to refactor the code to make it more generic and idempotent, which would actually make it way more useful and do exactly what they not only want, but need. However, because there is an arbitrary deadline, which if missed wouldn’t cost us loss, but as you said the - bean counters need to stay employed, so they like to make these things up to stay employed.

I just hope they don’t make this a habit of doing things right now when there is really no business advantage lost to not doing it correctly, or in this case actually add value to organization.

Oh, there’s this topic here?

I was kind of making my introduction in another topic

[…] This is the application layer of the navigation program of some european car brand (one of those which makes its own navi).

So, this is embedded programming, and everything is moving. We need to change the “sdk” almost every week because interfaces above to HMI and below all keep changing. So, clean builds happen frequently… And then you get tickets from testers, for software 2 weeks old, you need to go back and forward, change branches…

So, I’m migle. I like C++ and also Haskell. I like vector processing, multi-core and GPU programming.
My current job with one car manufacturer gets me a bit far from my numeric inclinations, but it fits the family plans and socially it is a lot more satisfying than when you’re alone crunshing numbers.

My level is very, very low.

2 Likes

Does anyone else here have to become familiar with ISO standards and make sure your code correctly implements those specs?

I’m in the middle of having to implement actions based off the week number. To do this, the only “fair” way I’ve found to do this is to go off ISO 8601.

This is probably the 4th or 5th ISO standard I’ve had understand to correctly ensure my code is correct, given it’s context… Is this common for others?

Not ISO but I’ve had to read HDMI, HDCP and EDID specs. Luckily just to skim them. I didn’t need the whole thing.

Are you sure you aren’t reinventing the wheel? Most popular languages have a time package including ISO date functions like you’re describing.

1 Like

Time seems to always be a bit awkward especially when it comes to daylight savings time there are some shenanigans happening.

But generally, languages have that either figured out in the language itself, or you have readiely avaiable packages for dealing with time… so not sure why you need to actually fully understand ISO 8601 I never really bothered. Half the time when I´m doing manual queries again databases I don´t even know how to properly type it and end up typing new Date().toISOString() into my browsers console to see the format looks like and then I type my Date like that.

EIther way save your Date as UTC. Work with UTC. Then convert it when actually displaying it to the User. You´ll be fine. Things like daylight savings time also become mostly a useability problem in those few hours a year since UTC does not have that.


? :sweat_smile:

1 Like

hey peoples

I’m trying to figure out something and am failing

if someone could help me I’d be really thankful

you see, all the stuff related to php in ubuntu runs on /var/www/html but only sudo can access the documents, so far I’ve been keeping two different copies of projects and using sudo cp into destination…

is it best practice? should I chmod the directory I’m working at the time? should I suck it up and git gud at vim?

For production no not really. You would use a user like (lets call him) my_app_user with no console and have your /var/www/html owned by my_app_user and group www-data (usually). Then use only the permissions it absolutely needs and not edit things in production. The simplest thing is make a tiny script that runs essentially rm -rf on the directory and copies the new updated version into it, changes permissions etc. You don´t want your php process to run as root user when it is public as there is the possibility that hackers can make your php process “do things” and then them being able to “do things” as root is bad. So you would want them to only be able to “do things” as my_app_user instead and have my_app_user only be able to read what it needs to read to host your page and same applies to write. No write at all unless your app needs to write to an upload-directory or something like that.


For developement I would look into other options than running it straight from a “real server setup”, just for sheer developement speed.

  • For one you can try to use the appearently built into php dev server https://www.php.net/manual/en/features.commandline.webserver.php
  • If you are using a php framework such as laravel you have a built in CLI to start such a dev server (probably, not but either way would recommend it, it´s much better than just php, although it might be a bit complicated if you are just starting out)
  • You could look and see if visual studio code has some live server plugin that works with php (not sure).
  • If all else fails I would recommend you to make a docker container on your dev box and mount your directory into the container where it wants your files to be, but chances are one of the above works
2 Likes

thank you but that all seems very high end for a simple hobbyst in a dev environment

I’ll just sudo cp at every change, I’ll survive

:smile:

You underestimate what some of us do with our labs

4 Likes

When I upgraded the NAS a few months ago I moved all my local dev sites into jails with mount points for the project files, and then shared the data sets with the workstation. :stuck_out_tongue_closed_eyes:

2 Likes

all I gotta say

guessing I’m more of a designer than a software developer

sometimes I spent hours messing with bullshit in inkscape and figma, but dislike long coding sessions

Yeah, or you could just prefer the frontend doing stylesheets and stuff instead of PHP and SQL or whatever. I’d much rather be in the backend writing services or stored procs or something.
Responsive CSS is the bane of my existence.

2 Likes

I haven’t used it but isn’t that what vagrant is for?

1 Like

Yeah pretty much. If you’ve got to set up new dev sites frequently, then something like vagrant is a good idea.

Vagrant and Docker, yeah, they kinda accomplish the same thing.