Advertise Here

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - |-|Java()|-|

Pages: [1]
1
Advertise Your Board / Rpg Makers
« on: February 13, 2008, 06:45:55 pm »
Hey guys and gals go to www.rpgmakers.tk to learn how to make a rpg based game!

2
PHP / PHP Tuts
« on: July 19, 2007, 12:51:18 pm »
I do not take credit for these tutorials, and they are for the sole purpose of learning.


1. Introduction
2. Installation
3. Syntax
4. Variables
5. Echo
6. Strings
7. Operators
8. Comments
9. Include File
10. Require vs Include
11. If Statement
12. If/Else Conditional Statement
13. Else/If Statements
14. Switch
15. Forms
16. Functions
17. Arrays
18. While Loop
19. For Loop
20. For Each Loop
21. Do While Loop
22. Post and Get
23. Magic Quotes
24. Htmlentities Function


After the tutorials, we hope that you further gained some knowledge of PHP.

3
C,C++ / C++ resources!
« on: July 18, 2007, 10:35:27 pm »
Well, here are some VERY handy resources for learning C++;

E-Bookz;

OReilly Programming Embedded Systems in C and C++
Addison Wesley - C++ Coding Standards; 101 Rules, Guidelines and Best Practices
Addison Wesley - C++ Common Knowledge; Essential Intermediate Programming
Addison Wesley - C++ Gotchas; Avoiding Common Problems in Coding & Design
Addison Wesley - C++ Standard Library; A Tutorial and Reference
Addison.Wesley,.Beyond.the.C++.Standard.Library.An.Introduction.to.Boost.(2005).BBL.LotB
Addison_Wesley_-_Bjarne_Stroustrup_-_The_C++_Programming_Language._3rd_Ed
Addison-Wesley C++ Standard Library - A Tutorial and Reference
Addison-Wesley C++ Templates, The Complete Guide
Addison-Wesley Modern C++ Design, Generic Programming and Design Patterns Applied
Biblio Distribution - C++ for Artists; The Art, Philosophy and Science of Object Oriented Programming
C++ From the Ground up Third Edition
C++_Programming-HOWTO
c++_unleashed
Charles River Media - C++ Programming Fundamentals
John.Wiley.and.Sons.C.plus.plus.for.Dummies.5th.Edition
John.Wiley.and.Sons.You.Can.Program.in.C.plus.plus.A.Programmers.Introduction.Jul.2006
Mcgraw_Hill_-_C++_Demystified
Mcgraw-Hill.Schaum's Outline of Programming With C++
New Riders - C++ XML
O_27reilly_-_C++_In_A_Nutshell
O_27reilly_-_Practical_C++_Programming
Sams.Sams Teach Yourself C++ in 21 Days (4th Edition)
Thinking_In_C++

Links to download;


http://rapidshare.com/files/16156809/cpp.part1.rar
http://rapidshare.com/files/16158374/cpp.part2.rar

Website Tutoirals;

http://www.cplusplus.com/doc/tutorial/
http://www.tutorialized.com/tutorials/C-and-Cpp/1
http://www.intap.net/~drw/cpp/
http://www.functionx.com/cpp/
http://www.swtech.com/cpp/tutorials/
http://www.cpp-home.com/
http://www.tutorio.com/cpp-tutorials.html
http://www.codepedia.com/1/CPP-Beginners-Tutorial-III
http://www.tutorio.com/cpp-tutorials5.html
http://wiki.services.openoffice.org/wiki/Uno/Cpp/Tutorials
http://wiki.services.openoffice.org/wiki/Uno/Cpp/Tutorials/Introduction_to_Cpp_Uno
http://www.advancescripts.com/detailed/1050.html


Note: C++ requires a compiler.
I would suggest the following compilers;
Dev-C++
Link;

http://optusnet.dl.sourceforge.net/sourceforge/dev-cpp/devcpp-4.9.9.2_setup.exeSize:9mb+

Microsoft Visual C++
Link;

http://www.microsoft.com/downloads/details.aspx?familyid=a8494edb-2e89-4676-a16a-5c5477cb9713&displaylang=enSize: 50mb+

Intel C++
Link;

http://www.intel.com/cd/software/products/asmo-na/eng/compilers/284132.htmSize: 30-50mb+ Last Time I checked.


Those are the 3 best compilers. I use Dev-C++. I highly suggest you do to.
If you would like an E-Book Seperate.. Just tell me, and I will upload to a separate link for you. If you would like the linked Pm'd to you, just say.


Here's just some more links:

I suggest you look at all of the links because you can learn from them.

C++ original site.

www.cplusplus.com tutorial/
www.cplusplus.com

C++ Games
http://www.codebeach.com/index.asp?tabID=1&categoryID=3&subcategoryID=11

http://www.codejunction.com/scripts/c-and-c--/games

C++ Tutorials and links.
http://en.wikipedia.org/wiki/C++

http://www.cprogramming.com/

http://newdata.box.sk/bx/c/

http://www.cprogramming.com/begin.html

http://cplus.about.com/od/introductiontoprogramming/a/cppbeginners.htm

http://www.cprogramming.com/tutorial.html

http://www.charlesriver.com/Books/BookDetail.aspx?productID=124286

http://computerprogramming.suite101.com/article.cfm/getting_started_in_c_programming

http://www.faqs.org/faqs/C-faq/learn-c-cpp-today/

http://www.cyberdiem.com/vin/learn.html

http://www.research.att.com/~bs/C++.html

http://msdn2.microsoft.com/en-us/visualc/default.aspx
 

4
Java / Move Mouse
« on: July 18, 2007, 10:34:23 pm »
Well it's sloppy and not that great but I'm not good at java programming well here it is you can modify it to your needs IDK.

Code: [Select]
import java.applet.*;
import java.awt.AWTException;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Robot;
import java.util.Random;

public class Main extends Applet implements Runnable {



public void wait(int time){
   try {
Thread.sleep(time);
} catch (InterruptedException e) {
}
}

public void moveMouse(int x,int y) {
Robot rob=null;
try {
rob = new Robot();
} catch (AWTException e) {
}
rob.mouseMove(x,y);

}


public int random(int ran) {
Random Ran = new Random();
return 0+Ran.nextInt(ran);
}

public boolean more(int a, int b ) {
boolean ret = false;
if (a > b) {
ret = false;
}else {
ret = true;
}
return ret;
}

public void move(int x){
int yspeed=0,ypos=50;
int a=10,b=x;
moveMouse(10,50);
wait(100);
for (int i = 10; i < b- 4; i++){
for (int c = -1; c < random(3); c++){
yspeed = c;
} if (i < b  / a * 9) {
switch (yspeed) {
case -1 : yspeed= +1;break;
case +1 : yspeed= -1;break;
default : yspeed= 0; break;
}
if (more ( ypos, i)==true) {
for (int w = 2; w < 2; w--){
yspeed = w;
} if ( ypos > i) {
yspeed = +1;
}


}
}
ypos += yspeed;
moveMouse(i,ypos);
wait(random(20));
}

moveMouse(x,50);
}

public void init() {
move(200);
}


public void run(){

}
public void start(){
Thread th = new Thread (this);
th.start();
}

}

 

5
Java / Java Resources!
« on: July 18, 2007, 10:33:09 pm »
Basic resources for learning Java
Java Technology FAQ's
Classpath resources
Servlets & JSP
New to Java™ Technology FAQs
Java™ Programming FAQs
Java™ - Reference FAQs
The comp.lang.java FAQ List
Javapedia: Classpath
How Classes are Found
Setting the class path (Windows)
Setting the class path (Solaris/Linux)
Understanding the Java ClassLoader

Here are some resources I've found especially helpful for folks new to Java:

Installation Notes - JDK 5.0 Microsoft Windows (32-bit)
Your First Cup of Java
New to Java Center
The Java™ Tutorial - A practical guide for programmers
The Java™ Tutorial - Trail: Learning the Java Language
Java Programming Notes - Fred Swartz
How To Think Like A Computer Scientist
Introduction to Computer Science using Java
The Java Developers Almanac 1.4

Object-Oriented Programming Concepts
Object-oriented language basics
Don't Fear the OOP

Books:
The Java Programming Language - 4th Edition
Head First Java, by Bert Bates and Kathy Sierra
Thinking in Java (Free online), by Bruce Eckel
Core Java, by Cay Horstmann and Gary Cornell
Effective Java, by Joshua Bloch

Resources for learning about Servlets & JSP:

Head First Servlets & JSP
The J2EE™ 1.4 Tutorial - Java Servlet Technology
The J2EE™ Tutorial - JavaServer Pages Technology

Most of these links provided by: Yawmark from Devshed forums. Others by me a LONG time ago. Dev shed is dead now :(

Hope you find these useful :) Feel free to post links so I can add them ;)

Other Links:
Java Lessons, by Jon Huhtala
Java Books List, Tons of books
LeetCenter
List of Java shit
Swing API
LeetCenter2
Java Olympus
J2ee Olympus
Jsp Olympus
J2me Olympus
Java Lecture
Lwjgl.org
Golden Studios
Remote File Access
Jmonkey Engine
The Final Word
Java/AWT Example
Java Cooperation
Soft lookup.com
Some E-books


6
Java / Java for Beginners!
« on: July 18, 2007, 10:32:23 pm »
Hi, welcome to my beginner Java tutorial. I, like you, am learning Java. If you really are eager to learning Java, but think you are not able, think again! You would be surprised how far a strong will for learning can take you. Let us begin with a simple exercise:


--------------------------------------------------------------------------------

Exercise 1: Creating a simple 'HelloJava' program

Hopefully you have your environmental variables set up. Because I assume you do, this will be our compiler using the Command Prompt:



Code: [Select]
javac -cp . *.java
The javac will call upon the Classpath environmental variable to redirect it to the bin folder of the Java Development Kit (JDK). The '-cp' tells the compiler to be ready to change directories depending on where the Java files are, and where the outputed class files should be placed. The reason why we use the 'Change Directory' tag is because it helps the compiler better understand where the Java files should be compiled to and where they are themselves. Using the default 'javac *.java' at some points can cause issues. This tag also helps you in the future when you want to use simpler methods of cross-compiling.

Now that our compiler is set up, lets make our first Java file. Open up Notepad (unless you have an IDE [Integrated Development Environment] set up, there is a link for both Eclipse and Visual J# at the bottom of this Exercise) and add this code:



Code: [Select]
public class HelloJava
{
public static void main(String[] args)
{
JFrame frame = new JFrame("Hello, Java!");
JLabel label = new JLabel("Hello, Java!");
frame.add(label);
frame.setSize(300, 300);
frame.setVisible(true);
}
}

Now save this code as 'HelloJava.java'. After you are done with that, lets use our compiler command prompt code to compile our new Java file:



Code: [Select]
javac -cp . HelloJava.java
If you wish to, you could use the wildcard '*' to cover all the Java files in the directory. This will be needed in future exercises. Now, you should have a file called 'HelloJava.class'. Lets use some new command prompt code to run our class file:



Code: [Select]
java -cp . HelloJava
Note that we do not use wildcards (will not work with the Java interpreter) or a '.java' extension while calling the interpreter. We do not do these things because they will cause an error whilst running the Java Runtime Environment (JRE). After you have started your application, you should see this:



Congratulations, you have just created your first Java program! Lets relook over the code that we have just used.



Code: [Select]
public class HelloJava
This will create a new public class file called 'HelloJava'. Instead of creating an 'heir' class file (used with just the 'class' without 'public', this will be explained more in future exercises) you are creating a Java file that represents its name. That is why it is essential to have the Java file named 'HelloJava' and nothing else (it does not ignore capitals.) You should also notice the brackets ('{', '}') that are both after this lin at the end of the class file. These brackets start the parsing of the code in that a class or other code that use brackets (integers, voids, booleans, etc....) The final bracket will also end the parsing of the code. If the final bracket is not implemented, you most likely will have a parsing or public errors.



   
Code: [Select]
public static void main(String[] args)
This is a public static (unchangeable unless the creator changes it) void that the interpreter auto-maticly looks for. Without one of these, it is impossible to run a class file directly. However, you can still run it be calling it from another file (hence comes the static [static will be used for every void and boolean that is called from another class file].) Also, you may notice the 'String[] args'. This will String the basic argument (args) to the main void. This will implement basic System code inside of the application (used in 'System.out.println' and other System code, depending on the arugement implemented.) You will be using many Strings while coding in Java. I will teach you more about strings in the future exercises.



      
Code: [Select]
JFrame frame = new JFrame("Hello, Java!");
This code will start a new JFrame class and input it with the text 'Hello, Java!'. This will serve as the title of our Java application. The JFrame is also out Graphical User Interface (GUI) whilst coding basic Java applications. It is very important while making a visual Java program. Also note the semicolon (';') at the end of this statement. This tells the interpreter that this is the end of the line. Without a semicolon on most statements, a Java error will occur during the compiling.



      
Code: [Select]
JLabel label = new JLabel("Hello, Java!");
This will call the Java heirarchy JLabel and set it as a new class. It will then input the quoted text 'Hello, Java!' inside of the public JLabel and will set it equal to that String. JLabel then will create a new Label called 'label' with the value of its String (in thise case, 'Hello, Java!'.)



      
Code: [Select]
frame.add(label);
This will add our JLabek 'label' to our JFrame 'frame'. The method 'add' comes from the JFrame heirarchy class.



      
Code: [Select]
frame.setSize(300, 300);
The method 'setSize' is also from the JFrame class. In this case, it is setting our JFrame 'frame''s size to three hundred by three hundred pixels, a good size for the purpose of our application.



      
Code: [Select]
frame.setVisible(true);
Of course, you could have guess that the 'setVisible' method also comes from the JFrame class. In this case, it is setting our JFrame 'frame''s visiblity to 'true'. We could always change the value of the boolean to 'false' instead, but then we would not be able to see our GUI  .

I hope you enjoyed this Exercise. I will, in the future, hopefully add more to teach you a little more about basic Java. Thank you for reading.


-----------------------------------------------------------------------------------------------------

Here are some useful Java resources:

Eclipse Open-Source-IDE
Visual J# Express IDE (for J# development)



7
C,C++ / Rock paper scissors!
« on: July 18, 2007, 10:29:26 pm »
Well, here's rock paper scissors in C++. Made in like 5 mins.


Code: [Select]
/*Script in C++. Rock paper sicrrors!. Enjoy.*/

#include <iostream>
#include <cstdlib>
#include <ctime>

         using namespace std;
    int main()
    {

    srand((unsigned)time(0));
    int choice;
    int againchoice;
    int computerchoice = (rand()%2)+1;
    cout <<"Type 0 for Rock, 1 for Paper and 2 for Scissors.\n";
    cin >> choice;
   
    if (choice == 0)
    {
              if (computerchoice == 0)
              cout << "It has resulted in a Tie!\n\n";
              else if (computerchoice == 1)
              cout << "Paper has beaten Rock. You have lost!\n\n";
              else if (computerchoice == 2)
              cout << "Rock has beaten Scissors. You have won!\n\n";
    }
   
    if (choice == 1)
    {
               if (computerchoice == 0)
               cout << "It has resulted in a Tie!\n\n";
               else if (computerchoice == 1)
               cout << "Paper has beaten Rock. You have won!\n\n";
               else if (computerchoice == 2)
               cout << "Scissors has beaten Paper. You have lost!\n\n";
   }
   
   if (choice == 2)
   {
              if (computerchoice == 0)
              cout << "It has resulted in a Tie!\n\n";
              else if (computerchoice == 1)
              cout << "Scissors has beaten Paper. You have won\n\n";
              else if (computerchoice == 2)
              cout << "Rock has beaten Scissors. You have lost!\n\n";
   }

   cout << "Would you like to play again? 1 for Yes and 2 for No.\n";
   cin >> againchoice;

   if (againchoice == 1)
   {
              system("cls");
              return main();
   }

              else if (againchoice == 2)
   {
              system("EXIT");
   }
}
Can't compile? I'll upload the .exe. (C++ compiles to .exe)
http://www.megaupload.com/?d=5ZX82RC6

Yes, it's clean. Scan yourself. I'm not uploading scan results to proove it is clean.

8
Visual Basic / Find colour.
« on: July 18, 2007, 10:28:06 pm »
Remember, this returns the coordinates of the color in a window, not the position on the screen, you'll have to use GetWindowRect to get the rect and add the needed numbers to the coordinates for the position on the screen.

Code: [Select]
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long

Private Type POINTAPI
    X As Long
    Y As Long
End Type

Function FindColor(Color As Long, X1 As Long, Y1 As Long, X2 As Long, Y2 As Long, _
                            Window As Long) As POINTAPI
Dim xx As Long, yy As Long, TestDC As Long, WndRECT As RECT, temp As POINTAPI
    TestDC = GetDC(Window)
    For yy = Y1 To Y2
        For xx = X1 To X2
            If GetPixel(TestDC, xx, yy) = Color Then
                temp.X = xx
                temp.Y = yy
                FindColor = temp
                Exit Function
            End If
            DoEvents
        Next xx
    Next yy
    FindColor.X = -1
    FindColor.Y = -1
End Function

Enjoy  :cool:

Pages: [1]