Author Topic: General Programming Megathread - New OP  (Read 29895 times)


Codeacademy is also a nice place to learn.

Too bad they don't have any courses for decent languages. I went there hoping for Java, but only found a few scripting languages.

did you forget torque?
lol

Too bad they don't have any courses for decent languages. I went there hoping for Java, but only found a few scripting languages.
i still find their tutorials really helpful for the languages that they do have, though.

well i mean it's kind of hard to not like it when you grew up with it
I 'grew up' with Torque and I despise Torque.

My favorites are still in the OP, lol.

I 'grew up' with Torque and I despise Torque.

My favorites are still in the OP, lol.
grew up with it and well

like it

lol


decided to do some moonscript stuff again and



that's like, seriously loving lenient; i really shouldn't be able to do that, lol
« Last Edit: November 12, 2012, 05:54:37 AM by Kingdaro »


For SCIENCE!

Making a neat little program that plots out the path of electrons around an atom in SOOPER SLOW MOTION.

Sorry to burst your bubble, but according to quantum physics, electrons follow no tracable path.

Sorry to burst your bubble, but according to quantum physics, electrons follow no tracable path.
Heisenburg

Sorry to burst your bubble, but according to quantum physics, electrons follow no tracable path.
Yes, I'm just tracing the general shape of each orbital. (IE: physics are suddenly really simple)

Just added the <gossip> tag to ProgramR, I've also fixed the <system> tag to properly eval ruby.

I suddenly feel really dirty for adding eval into my code but it's sort-of (I decided not to implement OS shell access) based on the <system> tag so that makes me feel better.

I'm not sure how to do this in Ruby, but I need to access a class instance from within a class that was initialized from within the first class. I need to be able to run an instance method from a separate class instance method.

I've looked all over the internet but I've found very little. Is it generally considered a bad programming practise to do this? Should I send an extra parameter such as initialize(parameter1,self) then pass it down? I'm going to test the method argument thing.

EDIT:

I've used the pass "self" as an argument and accessed the method that way. I feel this is very hacky but it works flawlessly.
« Last Edit: November 13, 2012, 04:42:47 PM by aludane »

Okay, what the hell is going on here?

Code: [Select]
    Function vectorLen(ByVal x As Decimal, ByVal y As Decimal) As Decimal
        Return Math.Sqrt(x ^ 2 + y ^ 2)
    End Function
    Function vectorNorm(ByVal x As Decimal, ByVal y As Decimal) As PointF
        Return New PointF(x * vectorLen(x, y), y * vectorLen(x, y))
    End Function
    Function vectorAddTheta(ByVal x As Decimal, ByVal y As Decimal, ByVal theta As Decimal) As PointF
        Try
            Dim l As Decimal = vectorLen(x, y)
            Dim n As PointF = vectorNorm(x, y)
            Dim t As Decimal = Math.Asin(n.Y)
            t += theta
            Dim nn As PointF = New PointF(Math.Cos(t) * l, Math.Sin(t) * l)
            Return nn
        Catch
            Me.CreateGraphics.DrawString("ERROR IN CALC", Font, Brushes.Red, 32, 32)
        End Try
    End Function
...
Code: [Select]
            Case 2
                'dxy orbital - 2 p orbitals crossed
                e1 = vectorAddTheta(120, 0, phaseState * 360)
                e1.X *= e1.Y / 120
                e1n = vectorAddTheta(e1.X, e1.Y, 45)
                e1n.X += 256
                e1n.Y += 256
                e2n = vectorAddTheta(e1.X, e1.Y, 360 - 45)
                e2n.X += 256
                e2n.Y += 256
One of these vectorAddTheta's is returning an error that has something to do with a decimal being either too large or too small. 'phaseState' is a value that is always between 0 and 1.


:loop
echo lol
goto loop


i m the progremin master!