Spheres

http://deepcoder.blogspot.com/2013/01/spheres.html

A simple idea, but very hard to do I believe:
If we can write the programming code, modeling how electrons move during the heating of hydrogen or helium within a glass tube. Then maybe we can find a link between the radiated wavelengths and the physical movement of the electrons in our programming code.

Think of Balmer’s formula but with a for more complicated formula written in programming code to explain not only the wavelengths but also how the particles move.

The programming code would be the mathematical proof to the theory of everything. I mean a theory that links the strong nuclear force, the weak nuclear force, the electromagnetic force, and gravity.

Alright this is too hard to do… Never mind.

If you just want to write a cool but significant C program, you could write one to emulate space itself and particlisation. From there atoms would form naturally so confine a few within the matrix and apply “heat” to see what happens. You apply that heat merely by initiating the atoms with high velocities.

Of course it would take a very large memory matrix, but you can do it in C … eventually. And it would be a whole lot faster and better than my MSBS version.

the code in your avatar, btw, isn’t very meaningful.

as far as I can tell, it looks like this:

if (x != y)
{x = y;}
if (y != x)
{y = x;}

This syntax is a pretty regular syntax for a lot of programming languages, and will have a nearly identical meaning in programming languages that use this type of syntax.
So, for the sake of simplicity, I’ll describe what it does in JavaScript, since it will do the same in languages such as Java, C#, and probably C and C++ as well.

The first line checks if the variable x has the same value as y.
If it doesn’t, then in line 2 it sets the value of x to the value of y.

In line 3, it checks if y has the same value as x.
But, because of line 1 and 2, we already know it has the same value. We just gave it the same value – no need to check it.
Line 4 sets the value of y to x, but it was already equal to x, so … it doesn’t really do anything useful. It just sets a variable to be the same as it already is.

So basically, so far, all the program has done is set the value of one variable to be equal to the value of another variable. Twice.

It’s kinda funny to see the stuff that non-programmers do with code. It’s unlikely that a programmer made that picture, because a programmer would not think that code was very interesting. There’s all sorts of goofy stuff in movies and shows with stupid programming. For example, I recently read about this show that showed a computer screen full of ‘code’ and the code on the screen was supposed to send commands to a Nuclear Launch facility. But in fact the code on the screen was only html for a shitty website – it wasn’t even code, it was just text describing the content and layout of a web page.

Sorry, this is all off topic. I just found that amusing.

http://moviecode.tumblr.com/

In that snapshot of code, line 4 would never execute since the boolean parameter in line 3 will always be false.

Your breakdown was amusing, though. I’ve been learning Java (my first programming language) and HTML/CSS/JavaScript for the past few months. My best achievements so far are a Java program that lets people make super simple custom webpages and a full website about chipmusic that I designed. I’d share but it’s all got personal info on it right now. The site you linked also showed a picture from the movie Ex Machina which I just watched a few hours ago. It had some vague programming jargon that I didn’t understand. It was an interesting movie, but underwhelming.

You’re right. I remember thinking that at the beginning of writing my post, but at some point I got mixed up and for some reason started thinking that rather than never executing, it always executes.

:blush:

I’m really looking forward to ex machina. I hope I’m not as underwhelmed as you…

I’ve been programming for a couple years now. I learned the beginnings of Visual Basic in maybe 2010 or 2011, stopped for a while, learned a bit of Java and stopped that for a while, but really started getting into Python not last december but the prior one. I’m doing Java in school but outside of school now I’m mostly doing Javascript (which I’d rather wasn’t called javascript – to many people mistakenly think it has something to do with Java. Some people call it ECMAscript or escript; I hope something like that catches on).

Just imagine you write a program with high velocity particles and atoms confined within a box, and then… you add a fixed spur like geometric particle cluster, and that cluster rotates giving the radiated wavelengths of helium. These particles are certainly not like billiard balls because they play with TIME which makes them move in a complex manner I suppose.

Maybe I could make my “avatar code” about existence.

x = early;
y = earlier;
z = anotherParadox;

if early is not earlier
make early equal to earlier

if earlier is not early
make earlier equal to early

Never early enough.

That machine is wasting its processing time.

…not really. But you’re right, they are not billiard balls.

Yeah, I kind of regret casting the movie in those terms now. There are a lot of factors that make up a movie experience including viewer attention and mindset. So yeah, disregard what I said.

I keep hearing about the demand for good developers, so since I haven’t found my career yet and I’ve always loved tinkering with computers, I’m trying to get up to speed so I can break into the field. I know a few people who are really into Python. I figure I’ll focus on Java for a little while more until I’m at a decent level and then branch out. I guess the languages you need to know really depend on what you end up trying to do. Spot on about JavaScript - I was wondering why it was named that.

In programming you never make 8 = 7. You reassign the variable that holds the value of 8 with a new value of 7. The consequents of those “if” statements are called assignment operations. Early never becomes earlier, and vice versa, in the same way 8 never becomes 7 and vice versa. x and y are just being reassigned. So you wouldn’t get the paradoxical result above.

I started out hating javascript but now…it’s the love of my life.

I just published my first package on npm actually (I don’t expect anybody to use it, but hey :-k )
npmjs.com/package/linnjs

And I just got finished building a new website (won’t link it here). Built on Shopify but I had to use javascript in clever ways to enable features Shopify doesn’t have.

ha congratulations on your engagement, then.

Your linnjs has some key words I don’t know so I have no idea what it does, but that’s cool. I’ve been meaning start a GitHub account. I might actually do that today.

It’s not too bonkers. The linnworks api is a resource that you send HTTP Post requests to in order to both get and send information to the server about your Linnworks database (which is a database that holds information about products and orders for products).

Connecting to the API is a three-step process which is a bit tedious – what my library does is it just takes your username and password and does all of the work for you in terms of connecting to it, and it makes it really simple to send requests to it. It essentially means you don’t have to worry about the nitty-gritty of dealing with the api direcly yourself. You still have to specify the things you want from the api etc, but the work of connecting to it and properly formatting your URLs to make requests to it is taken care of.

if (x != y) {x = y;} if (y != x) {y = x;}

You are probably not going to believe this. If x and y equaled to nan line 4 would execute. A NaN is never equal to itself.

I was tempted to mention that, but …
And what is NaN earlier than?

Whether it’s a NAN or not, the second IF statement is useless.

He’s absolutely right. Line 4 executes if Y is NAN.

Open devtools of whatever browser you’re using and plop this shit in the console:

x = 2; y = NaN; if (x != y) { x = y; } if (y != x) { y = x; alert('if an alert box comes up with this text, the previous line executed'); }

Of course I think we can all agree that this is an edge case (possibly a somewhat unique edgecase to JavaScript, which has all sorts of quirks). If that check is only useful in the case of a NaN, then the code is at the very least stylistically wrong, since it doesn’t clearly express that in any way (eg better to just isNaN(y) as that’s more explicit and doesn’t have anybody scratching their heads wondering why you’re checking whether x and y are equal when you just made sure they’re equal).

Actually, I have changed my mind about this. It’s possible that the second IF statement serves a useful function. Depends on how the source language handles variable type, comparison and implicit conversion.

Sure, with NaN line 4 would execute and maybe the code has the potential to be useful. But what was that early-earlier paradox about?

Oh, btw, I said earlier I had created my first public package. I also recently just got my first Pull Request on Github accepted for a popular JavaScript library, the ‘request’ library!

It wasn’t a bug fix or a feature implementation, sadly. It was more a stylistic error (I consider it an error): a bunch of functions were defined in a way that an IDE wouldn’t pick it up, so I defined them in a way that the IDE would pick them up! At first one of the maintainers of the package didn’t seem to like my submission, but another maintainer stepped in and said he thought it was valuable to have those sorts of considerations in how functions are defined.

So…hurray!

Sorry for derailing the thread so much.