Java Script
Sep 14 2007, 2:28 am
By: InsolubleFluff  

Sep 14 2007, 2:28 am InsolubleFluff Post #1



Anyone here familiar with Java script? I am learning Java this year and I wouldn't mind having somebody I could refer to incase of a need for help.



None.

Sep 15 2007, 1:50 am Temp Post #2



Are you learning java or javascript? they are different



None.

Sep 15 2007, 2:49 am InsolubleFluff Post #3



I guess I am learning just regular Java, sorry ;o

wait... nvm, what's the difference?



None.

Sep 15 2007, 3:01 am Cole Post #4



Javascript is an interpreted langauge integreated direclty with HTML that browsers read and display.

Java is a cross-platform programming language that can be used to make applications. Programs get compiled into java-byte code, and compiled into machine code when ran on the OS.



None.

Sep 15 2007, 4:04 am Centreri Post #5

Relatively ancient and inactive

One's for browser's, other is regular programs. One is easy, other is hard as hell. I can help a tiny bit in some basic stuff, but my knowledge of Java is extremely limited.



None.

Sep 15 2007, 10:57 pm Cole Post #6



I'd like to point out, the only thing Java and Javascript have in common is that they both have Java in there name. Nothing else. They are completely different and have nothing in common besides name.



None.

Sep 16 2007, 3:57 pm InsolubleFluff Post #7



Oh well I am doing the java for like making games, programs etc... so I guess im learning straight up Java?

In that case is there anybody here that could help me if need be?

Would be much appreciated, thanks.



None.

Sep 18 2007, 12:40 am InsolubleFluff Post #8



Anyone?



None.

Sep 18 2007, 3:18 am Cole Post #9



Well for one you should really have some background knowledge of C or C++.

How Java and C++ work arn't all that similar, however the better understanding you have of how memory is handled in C++ the better understanding you will have of how Java automatically handles the memory for you.

Java is a language who's whole purpose is to make cross platform applications. It does this with a series of ideas.
1.)"Garbage Collector". In C++ you have to declare *I want ex amount of memory for my buffer*, in Java you have something called a "Garabge Collector" to do this for you. In C++ you also have to delete the memory by hand. Java automatically figures out when you don't need the memory and deletes it. Java needs this to be cross platform, because different operating systems and architecture types can handle memory differently.

2.)Java does not compile down into machine code until it is ran. This is something you need to understand. When you compile a C++ program it gets put into machine code. When you compile a Java program it gets put into byte code. When you run the java application it will then get into compiled into machine code. This allows Java programs to be ran on any OS, because they are never pre-compiled for a specific OS.

3.)Java does not have pointers and can't directly work with memory. This is one thing I hate about Java. Pointers allow you to read/write a specific portion of memory. There are so many advantages I can't really get into it all. Java simply doesn't have it, and it's why C# > Java.

4.)You will never be good at Java until you understand how the garbage collector works. You will take strings for granted and not realize they are immutable at first. Once you get it down, you will realize that strings are a very very bad thing when working with lots of data.

5.)If you don't plan to make cross-platform applications you are an idiot for taking the course. Personally i'd stick with C# and utilize Mono for Linux/Mac compatibility. C# is Java with pointers, better structure, and IDE.



None.

Sep 18 2007, 7:35 pm who Post #10



C# is better for non-cross platform applications, because it has pointers and stuff like that.
you can make applets that run in the browser with java though, that's an advantage



None.

Sep 18 2007, 9:13 pm InsolubleFluff Post #11



Quite funny because all those points you just covered, I already learnt.
I don't know what I am planning on making, whether it is for a specific OS or not, I am yet to figure out. However the question at hand is; if I presented you with a problem, using code, would you be able to tell me what to do in order to correct the situation.
We already talked about pointers, doesn't pointers open potential to delete memory?



None.

Sep 18 2007, 10:59 pm Cole Post #12



Quote
C# is better for non-cross platform applications, because it has pointers and stuff like that.
you can make applets that run in the browser with java though, that's an advantage
C# is a cross-platform platform language. See MONO.
To further expand on this:

C# is an open language. Most of the .NET framework is open. There is one strict set of specifications for the language and .NET Framework set up by Microsoft that everyone can access and view. Microsoft does not directly support putting C# on other platforms. However!!! Because C# is an open language, most of .NET is open, the open source community took it upon themselves.

A project was formed called "MONO". Mono is an open source project that replicates the .NET Framework for Mac and Linux (and Windows).

Quote
Quite funny because all those points you just covered, I already learnt.
Good. I had no idea how far you were.

Quote
I don't know what I am planning on making, whether it is for a specific OS or not, I am yet to figure out. However the question at hand is; if I presented you with a problem, using code, would you be able to tell me what to do in order to correct the situation.
I could give you a basic idea or concept of how to do it. The actual code, no. I never learned Java. A bit of C++ and a ton of C#.

Quote
We already talked about pointers, doesn't pointers open potential to delete memory?
Pointers have thousands of uses. However they can be incredibly risky if you arn't using them right. However the advantages of pointers outweighs all the negatives. Speed and you can use it to minipulate data types.



None.

Sep 18 2007, 11:19 pm InsolubleFluff Post #13



K so is there ANYBODY else that knows java?



None.

Sep 20 2007, 7:03 pm Temp Post #14



If you have any questions you can ask me, my knowledge of java is fairly decent.



None.

Sep 20 2007, 7:43 pm InsolubleFluff Post #15



okay so earlier I was trying trig with java, I imported the java.lang.Math file, and then I did a test run, I did tan(12) and of course, like several other languages, it comes out in radians, I checked with my calculator and it was the same number as if I had used radians, now, I do believe that the equations are like this:

X = Tan(12)
X = (X / Math.PI) * 180

or the other way around

(X * Math.PI) / 180

but non the less, when converting it to degree, I get the wrong number everytime compared to my calculator.



None.

Sep 21 2007, 1:08 am Temp Post #16



Can you give me the output it gives?
Also what type is X? (should be a double)



None.

Sep 21 2007, 2:47 am ShadowFlare Post #17



Quote from Shocko
okay so earlier I was trying trig with java, I imported the java.lang.Math file, and then I did a test run, I did tan(12) and of course, like several other languages, it comes out in radians, I checked with my calculator and it was the same number as if I had used radians, now, I do believe that the equations are like this:

X = Tan(12)
X = (X / Math.PI) * 180

or the other way around

(X * Math.PI) / 180

but non the less, when converting it to degree, I get the wrong number everytime compared to my calculator.
The first one is correct for converting radians to degrees. However, why are you trying to do the conversion on the output? Did you mean to do the conversion on the angle input into the Tan function?

Also, if accuracy matters at all you may want to rewrite the equation do make the multiplication be done before the division, to minimize loss of accuracy in the number (I think that was called underflow). It is good to get into the habit of doing that in your code for that reason. This change would make that line in your code look like this:

X = (X * 180) / Math.PI

However, in other cases where you may be multiplying by very large numbers and then dividing, it can be better to do the division first to make the number smaller before the multiplication to minimize the chances of overflow. This only applies for floating point numbers. If working with integers, doing the division first will definitely reduce accuracy.

Post has been edited 2 time(s), last time on Sep 21 2007, 3:09 am by ShadowFlare.



None.

Sep 21 2007, 5:29 pm InsolubleFluff Post #18



I just wanted degree for the sake of it, I will make a bigger post later but right now i've been kicked out my house



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:00 pm]
lil-Inferno -- benis
[10:41 am]
v9bettel -- Nice
[01:39 am]
Ultraviolet -- no u elky skeleton guy, I'll use em better
[10:50 pm]
Vrael -- Ultraviolet
Ultraviolet shouted: How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
hey cut it out I'm getting all the minerals
[10:11 pm]
Ultraviolet -- :P
[10:11 pm]
Ultraviolet -- How about you all send me your minerals instead of washing them into the gambling void? I'm saving up for a new name color and/or glow
[2024-4-17. : 11:50 pm]
O)FaRTy1billion[MM] -- nice, now i have more than enough
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- if i don't gamble them away first
[2024-4-17. : 11:49 pm]
O)FaRTy1billion[MM] -- o, due to a donation i now have enough minerals to send you minerals
[2024-4-17. : 3:26 am]
O)FaRTy1billion[MM] -- i have to ask for minerals first tho cuz i don't have enough to send
Please log in to shout.


Members Online: Roy, Ultraviolet