| |
Discussion: ATRL Programmers & Tech Club
Member Since: 12/7/2011
Posts: 18,969
|
Quote:
Originally posted by like2throw
does anyone know any books on simulations in gaming, any books regardless of the specified language? I would like to learn more but I found very few examples and tutorials on this topic, and the examples didnt help.
|
Have you tried thenewboston channel on youtube?  Bucky is so hot. 
|
|
|
|
Member Since: 6/18/2012
Posts: 18,768
|
Quote:
Originally posted by mrmaiko
I refuse to let another programming thread die.
I'm thinking that perhaps we can give weekly lessons to the girls that want to educate themselves to help keep the thread active.
What do you guys think?

|
Yes please help the noobs like me.
I'm just starting C language and felt so dumb.

|
|
|
|
Member Since: 5/4/2012
Posts: 12,811
|
Quote:
Originally posted by Mong Mong
I did really basic stuff with it, up until functions, but that's about it. And this was 3-4 years ago in high school 
|
So you know about return methods, and parameters, right?
|
|
|
|
Member Since: 12/7/2011
Posts: 18,969
|
Not ATRL database doing a rollback after crashing
And @ Jon, yeah I use those all the time with Python. Except Python doesn't really use pointers in functions though.
We use a lot of dictionaries and such.
If you know your methods and classes, then you basically mastered Python  That's how easy it is.
The only thing I NEED to use as OOP goes is how to make classes and objects from scratch. I dropped out of C++ when it was about time to learn them, but I dropped out to go into the hacking degree (I realized I was in the wrong program early.)
But I kind of regret not finishing C++. I could have known how to make classes and objects.
As far as Java go:
1. I need to refresh my memory with basic syntax: variable assignments, function declarations, STDI/O prints.
2. I need to get started with OOP (classes and objects).
In return, I'll teach you basic Python 
|
|
|
|
Member Since: 12/7/2011
Posts: 18,969
|
Quote:
Originally posted by Mariah4life
Yes please help the noobs like me.
I'm just starting C language and felt so dumb.

|
Sure! I need to refresh my rusty C skills anyways, so we'll teach you!
~If only I can find my C Programming Handbook from 2 years ago...
You should check out Buckey's  thenewboston channel on YouTube.
Although you should learn Python first, in my opinion because it's the easiest programming language out there. 
|
|
|
|
Member Since: 5/4/2012
Posts: 12,811
|
Quote:
Originally posted by Mong Mong
Not ATRL database doing a rollback after crashing
And @ Jon, yeah I use those all the time with Python. Except Python doesn't really use pointers in functions though.
We use a lot of dictionaries and such.
If you know your methods and classes, then you basically mastered Python  That's how easy it is.
The only thing I NEED to use as OOP goes is how to make classes and objects from scratch. I dropped out of C++ when it was about time to learn them, but I dropped out to go into the hacking degree (I realized I was in the wrong program early.)
But I kind of regret not finishing C++. I could have known how to make classes and objects.
As far as Java go:
1. I need to refresh my memory with basic syntax: variable assignments, function declarations, STDI/O prints.
2. I need to get started with OOP (classes and objects).
In return, I'll teach you basic Python 
|
Building an object from scratch is easy really.
So I assume you know about making classes and the such, so I'll skip over that.
Everything you use in Java is an object from some class.
when you create a new String like
Code:
String s = "string";
"s" is a object from derived(?) from the String class.
not to be confused with variables, like int, double, float, byte,char etc. Classes in java always start with an uppercase letter. More on that later.
Parts of a class
For example, lets build a class that will hold a person's name, age, and country
There are different parts of a class where you will want to declare variables or even other objects, for different functionalities.
There's fields, which can be used in any part of the class. These are declared outside of any methods.
Code:
public class Person{
//you can modify these at any point of the program
String name;
int age,
String country;
public void doSomething(){
name = "Jon";
age="400";
country="Trinidad";
}
}
Local variables are variables that are declared within a method or a block of code. These are exclusive to whatever method or block of code (like a loop) they are declared in.
Code:
public class Person{
public void doSomething(){
//could only use them inside here
String name;
int age,
String country;
}
public void doSomethingElse(){
name="Jon"; Would Not work
}
}
Constructor
a constructor is a special method for a class. It specifies the very first thing that is executed when an object of this class is called. It also specifies what a object, using this class, would need in order to run properly. It has tthe same name as the class. You can have an unlimited amount of constructors for a class through overloading which I'll show you a little later.
Code:
public class Person{
public person(){
//top priority code goes here
}
public Person(String name, int age, String country){
}
I'll continue a little bit later. Getting tired for some reason lol
|
|
|
|
Member Since: 5/4/2012
Posts: 12,811
|
Setters and Getters
Setters are methods that set a value to a variable. These are usually used in conjunction with constructors that have parameters, to set the fields declared in the class to the arguements entered when creating the object (which you will see later)
Code:
public class Person{
String name;
int age;
String country
public Person(String name,int age, String country){
}
//setters
public void setAge(int age){
this.age=age; //when this method is called, whatever argument is set will be set to the //name field of the class, same with the other methods.
}
public void setCountry(String country){
this.country=country;
}
public void setName(String name){
this.name=name;
}
}
When creating a object, most fields are set as private and cant be accessed from outside the class for security reasons. Getters are methods that "get" data from a class with the object is called. These usually have a return value, and are used to return values of fields in the class.
Code:
public class Person{
private String name;
private int age;
private String country
public Person(String name,int age, String country){
}
//setters
public void setAge(int age){
this.age=age; //when this method is called, whatever argument is set will be set to the //name field of the class, same with the other methods.
}
public void setCountry(String country){
this.country=country;
}
public void setName(String name){
this.name=name;
}
//As you would know, return methods return a data type, or an Object. Getters are pretty much that.
public String getName(){
return name;
}
public int getAge(){
return age;}
public String getCountry(){
return country;
}
}
and that is pretty much a basic class.
creating an object
You create an object in pretty much the same way you create a variable, except you instantiate is by using the new keyword, the classname followed by the arguments in brackets, if any. If there isnt any empty brackets are used.
Our Person class
Code:
public class Person{
private String name;
private int age;
private String country
public Person(String name,int age, String country){
}
//setters
public void setAge(int age){
this.age=age; //when this method is called, whatever argument is set will be set to the //name field of the class, same with the other methods.
}
public void setCountry(String country){
this.country=country;
}
public void setName(String name){
this.name=name;
}
//As you would know, return methods return a data type, or an Object. Getters are pretty much that.
public String getName(){
return name;
}
public int getAge(){
return age;}
public String getCountry(){
return country;
}
}
creating a new object
Code:
public class CallingPerson{
public static void main(String [] a){
Person p = new Person("Jon",400,"Trinidad"); //this is your object
//You can use your object to call any public method inside of the class it belongs to.
System.out.println(p.getName());
System.out.println(p.getAge());
System.out.println(p.getCountry());
}
}
Output:
and that's the basics.
|
|
|
|
Member Since: 6/18/2012
Posts: 18,768
|
Quote:
Originally posted by Mong Mong
Sure! I need to refresh my rusty C skills anyways, so we'll teach you!
~If only I can find my C Programming Handbook from 2 years ago...
You should check out Buckey's  thenewboston channel on YouTube.
Although you should learn Python first, in my opinion because it's the easiest programming language out there. 
|
Different languages have different rules and styles. How do people remember all of them without getting them mixed up???? Does it also depend on your career? Like if you work for blah blah, you're likely to be working with C++, etc?? Are we supposed to be experts in all of the languages or what?
It would also be great if you guys can list your career or something, or if you do coding just for fun 
|
|
|
|
Member Since: 12/7/2011
Posts: 18,969
|
I can't believe the last post was 3 days ago
We can't let this thread die!
And Mariah4Life, ALL programming languages have the SAME rules. Just different syntaxes
And for an ARP request/reply, what does it mean when the ARP packet length goes from 42 to 46? This is a really basic question, but I kind of need answers. Does it have to do with decapsulation and encapsulation? 
|
|
|
|
Member Since: 5/4/2012
Posts: 12,811
|
Quote:
Originally posted by Mong Mong
I can't believe the last post was 3 days ago
We can't let this thread die!
And Mariah4Life, ALL programming languages have the SAME rules. Just different syntaxes
And for an ARP request/reply, what does it mean when the ARP packet length goes from 42 to 46? This is a really basic question, but I kind of need answers. Does it have to do with decapsulation and encapsulation? 
|
I admit, I had to do a little reading as a refresher, but when a packet goes from 42 to 46 I assume its added the IP address headers (which are about 4 bytes long). That's Layer 3 encapsulation.
|
|
|
|
Banned
Member Since: 12/29/2002
Posts: 19,803
|
Is anybody experienced in SOA/Web Services? I'm gonna be assigned to a 3-week project using these technologies and I'm completely clueless 
|
|
|
|
Member Since: 12/7/2011
Posts: 18,969
|
Hi, I'm back! I need to ask a lot of things about nmap, and router configurations, and ftp!
How is everyone!
|
|
|
|
Member Since: 5/4/2012
Posts: 12,811
|
The php guy is definitely getting canned, lol Error reports acre coming up on screen
|
|
|
|
Member Since: 12/7/2011
Posts: 18,969
|
Jonothan! Is there a way for me to install a "virtual router" on VirtualBox to act as a real router between two VM hosts?
|
|
|
|
Member Since: 5/4/2012
Posts: 12,811
|
Quote:
Originally posted by Mong Mong
Jonothan! Is there a way for me to install a "virtual router" on VirtualBox to act as a real router between two VM hosts?
|
Honestly, I've never tried it.
I always use a real router, and set the network card to "bridged", I'll give it a try though. If you get it to work, let me know.
|
|
|
|
Member Since: 12/7/2011
Posts: 18,969
|
Quote:
Originally posted by Big Smoke
Honestly, I've never tried it.
I always use a real router, and set the network card to "bridged", I'll give it a try though. If you get it to work, let me know.
|
I have to set up two VMs with two different Host-Only Adapter so they're two different networks, because my assignment this week is to capture traffic flow from a router, and analyze as a graph 
|
|
|
|
Member Since: 5/4/2012
Posts: 12,811
|
Quote:
Originally posted by Mong Mong
I have to set up two VMs with two different Host-Only Adapter so they're two different networks, because my assignment this week is to capture traffic flow from a router, and analyze as a graph 
|
Use your wireless router. Set the default gateway on both VM's to the router's address, and set the Network Card as bridged. It'll work the same way. Your are using Virtual Box right?
|
|
|
|
Member Since: 12/7/2011
Posts: 18,969
|
Quote:
Originally posted by Big Smoke
Use your wireless router. Set the default gateway on both VM's to the router's address, and set the Network Card as bridged. It'll work the same way. Your are using Virtual Box right?
|
I have no router though, I only have a switch
And yeah I'm using VBox.
|
|
|
|
Member Since: 5/4/2012
Posts: 12,811
|
Quote:
Originally posted by Mong Mong
I have no router though, I only have a switch
And yeah I'm using VBox.
|
Then how do you get internet lol.
Okay, try this:
go in command line and type the command ipconfig
youll get a bunch of addresses... Under "default gateway" whatever address you get for that, use it as the default gateway in your VM's.
and take off your firewalls, or when you ping to confirm the ping will just just hang there and fail.
|
|
|
|
Member Since: 12/7/2011
Posts: 18,969
|
Quote:
Originally posted by Big Smoke
Then how do you get internet lol.
Okay, try this:
go in command line and type the command ipconfig
youll get a bunch of addresses... Under "default gateway" whatever address you get for that, use it as the default gateway in your VM's.
and take off your firewalls, or when you ping to confirm the ping will just just hang there and fail.
|

I'll try, thanks
I still need to read your Java tutorials though.
I can't thank you enough, how do I thank you?
|
|
|
|
|
|