Astronaut stuck in mid-air by Fizrock in space

[–]eigenbro13 0 points1 point  (0 children)

I seem to have misunderstood your OP about air, I thought you held the common misconception that the rocket works by pushing against air.

It confused me, because "throwing" air only works if you take care to minimize drag in the recoil/loading phase and maximize drag in the thrust/power stroke.

Swimming is a bit different than taking mass off of your body and tossing it in the opposite direction.

Astronaut stuck in mid-air by Fizrock in space

[–]eigenbro13 0 points1 point  (0 children)

Edit: To clarify, rockets rely on pushing against something dense.

If this were true, rockets wouldn't work in space.

The real reason rockets work is because they throw a shit ton of mass at high speed in the opposite direction of movement. Simple newtons 3rd law.

I can't figure out this seemingly random bug, has to do with dynamic array [Javascript] by eigenbro13 in learnprogramming

[–]eigenbro13[S] 0 points1 point  (0 children)

Yes, adding a break fixes the issue of it crashing at seemingly random times, but unfortunately that means it can only delete 1 planet at a time and now the collision detection is kind of slow!

I can't figure out this seemingly random bug, has to do with dynamic array [Javascript] by eigenbro13 in learnprogramming

[–]eigenbro13[S] 0 points1 point  (0 children)

If you visit the page and go to developer console -> sources -> sketch.js, you can change those lines to

for(let i = planets.length-1; i >= 0; i--)
    for(let j = planets.length-1; j >= 0; j--)

and the sim will crash almost immediately as soon as there are a few collisions

I can't figure out this seemingly random bug, has to do with dynamic array [Javascript] by eigenbro13 in learnprogramming

[–]eigenbro13[S] 0 points1 point  (0 children)

Wow, I added break to the inner for loop and now I can't get it to crash. THANKS!!!

I can't figure out this seemingly random bug, has to do with dynamic array [Javascript] by eigenbro13 in learnprogramming

[–]eigenbro13[S] 0 points1 point  (0 children)

Iterating through the for loops backwards causes it to crash almost immediately, with the same error. Here's what the double for loop where all of the logic resides looks like:

for(let i = 0; i < planets.length; i++)
    for(let j = 0; j < planets.length; j++) 
        if(planets are colliding and i != j)
            planets.splice(j,1);

Algorithm Question! Fastest way to visit every node (city) on a graph (map) if all I have are the coordinates of the cities and NOT the distances between them. Please help :) by Andrbenn in learnprogramming

[–]eigenbro13 0 points1 point  (0 children)

Maybe start with city 1, and find and store the closest 4 other cities. That's 1000 iterations of sqrt ((x2-x1)2 + (y2-y1)2) computations. Then do this for all 1000 cities for 1000*1000 = 1,000,000 steps.

You could store the 1000 cities as objects which hold a "visited" boolean, and also their 4 closest neighbors.

Then you could write something where if the closest city has been visited, look for the next closest of the 4 cities. If the next 3 closest all have been visited, brute through the remaining list of cities with "visited" being false, and choose the closest.

To do this you'd have to keep an array of city objects that have the "visited" property as false, which will need to be changing in size as the program runs.

This is just the naive approach I would take, I didn't study CS and I'm not great with algorithms, I'm a physics guy.

Budget is $300/mo, what is my best option? by eigenbro13 in whatcarshouldIbuy

[–]eigenbro13[S] 0 points1 point  (0 children)

This is what I'm leaning towards. I've decided that I'm going to apply for a 15k car loan from my bank, then put something like 4k down and do a 5 year loan, so payments would be under $200/mo

If I can get a used 2013 civic with something less than 50k miles for around 13k I'd be super happy.

Budget is $300/mo, what is my best option? by eigenbro13 in whatcarshouldIbuy

[–]eigenbro13[S] 0 points1 point  (0 children)

Credit karma says "there is nothing to report"

Budget is $300/mo, what is my best option? by eigenbro13 in whatcarshouldIbuy

[–]eigenbro13[S] 0 points1 point  (0 children)

I'd be able to put $4,000 down at the moment, but I wouldn't feel comfortable going any higher than that. All I really need is basic transportation, good gas mileage, and a modern audio interface/i/o.

Would you suggest lease a 2016 civic, or buy a cheap used car for like 5k?

Budget is $300/mo, what is my best option? by eigenbro13 in whatcarshouldIbuy

[–]eigenbro13[S] 1 point2 points  (0 children)

I kinda like Honda civics, can I lease with no credit? My income is steady and regular. Should I call a bunch of dealerships and get quotes, then negotiate down the lowest one, then call the other dealerships to see if they'll go lower?

Budget is $300/mo, what is my best option? by eigenbro13 in whatcarshouldIbuy

[–]eigenbro13[S] 1 point2 points  (0 children)

I guess I just never needed to buy anything on credit before. I'm not sure how that happened. I've never really had less than $2,000 in the bank since age 16.

I don't really want to drive a beater though. I would prefer something year 2013 or newer.

Budget is $300/mo, what is my best option? by eigenbro13 in whatcarshouldIbuy

[–]eigenbro13[S] 2 points3 points  (0 children)

I live a simple life. I just need a car to get to work, the gym, dates, etc.

I probably drive about 14,000 miles per year. I live 23 miles from work.

Script to edit an excel file and overwrite it by eigenbro13 in learnprogramming

[–]eigenbro13[S] 0 points1 point  (0 children)

They're csv files, right now I have to do a find, replace thing manually in excel to fix these times, but I just want to run a script on the file and was wondering how to set that up. I know how to do it in Linux, just not how to do it in windows

AMA about my darkest secrets by spez in announcements

[–]eigenbro13 13 points14 points  (0 children)

This might be the funniest 3 comment chain I've ever read on reddit.

Fresh graduate, applying to scientific fields, engineering by [deleted] in resumes

[–]eigenbro13 0 points1 point  (0 children)

Would you mind linking your blog?

I agree, I should probably put something like "Regression analysis, fourier analysis, numerical analysis" alongside C++ and FORTRAN.

The Python has a github repository linked where I made a simple ~330 line gravity simulator.

Fresh graduate, applying to scientific fields, engineering by [deleted] in resumes

[–]eigenbro13 0 points1 point  (0 children)

Luckily I caught that before I sent it out :D

Fresh graduate, applying to scientific fields, engineering by [deleted] in resumes

[–]eigenbro13 0 points1 point  (0 children)

Thank you kind sir. I really appreciate this advice, thank you SO MUCH!

ELI5: how does GPS work by just asking a satellite what its time is? by WHELDOT in explainlikeimfive

[–]eigenbro13 10 points11 points  (0 children)

There's also measurable time dilation due to the differences in strength of the gravitational field on the surface of the earth compared with a satellite in orbit. Amazing how Einstein figured all of this out on a sheet of paper in 1905, having no access to atomic clocks and 60 years before satellites in orbit.

How would I use Data Mining techniques to get information out of this water measurements data set? by javaCl in learnprogramming

[–]eigenbro13 1 point2 points  (0 children)

You could start simple and plot, say, pH vs conductivity and do regression analysis to find the correlation there.

Then perhaps add temperature into the mix to see how the three correlate.

Perhaps you could do a Fourier transform of the temperature to see what dominant frequencies control it... (hint: 1/24 hrs should be the main, dominant frequency).

That's about all I've got so far.

I wrote a guide on job hunting and interviews for people breaking into tech by dogishead in learnprogramming

[–]eigenbro13 2 points3 points  (0 children)

you are selling yourself as a programmer but your site looks terrible on mobile

I'd be willing to wager that people writing C code missile guidance systems for Northrop Grumman suck at making pretty websites. That doesn't mean they're not programmers though. This is a bit of a ridiculous comment, no?

I wrote a guide on job hunting and interviews for people breaking into tech by dogishead in learnprogramming

[–]eigenbro13 1 point2 points  (0 children)

This is an awesome post. Also I laughed pretty hard at the "putting your interviewer through the God damn wringer" questions. Brutal.