• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 11:04
CET 17:04
KST 01:04
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Winners8Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
Starcraft, SC2, HoTS, WC3, returning to Blizzcon!33$5,000+ WardiTV 2025 Championship6[BSL21] RO32 Group Stage4Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly2Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win9
StarCraft 2
General
RotterdaM "Serral is the GOAT, and it's not close" TL.net Map Contest #21: Winners Starcraft, SC2, HoTS, WC3, returning to Blizzcon! 5.0.15 Patch Balance Hotfix (2025-10-8) Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win
Tourneys
$5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Merivale 8 Open - LAN - Stellar Fest Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace
Brood War
General
BW General Discussion [ASL20] Ask the mapmakers — Drop your questions [BSL21] RO32 Group Stage BGH Auto Balance -> http://bghmmr.eu/ SnOw's ASL S20 Finals Review
Tourneys
[Megathread] Daily Proleagues [ASL20] Grand Finals [BSL21] RO32 Group B - Sunday 21:00 CET [BSL21] RO32 Group A - Saturday 21:00 CET
Strategy
Current Meta PvZ map balance How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Stormgate/Frost Giant Megathread Dawn of War IV Nintendo Switch Thread ZeroSpace Megathread General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube Thread Dating: How's your luck?
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Why we need SC3
Hildegard
Reality "theory" prov…
perfectspheres
Our Last Hope in th…
KrillinFromwales
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1707 users

The Big Programming Thread - Page 103

Forum Index > General Forum
Post a Reply
Prev 1 101 102 103 104 105 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
ccherng
Profile Joined June 2010
20 Posts
January 02 2012 07:46 GMT
#2041
Does anyone have a detailed explanation of how to use cookies to implement both of the following logins securely.

1) Login meaning either one time login that which is NOT persistant meaning when the browser is closed a new browser is opened to the site a new login is required.

2) Login meaning its persistent for some number of days like you usually see with sites like gmail.

How does one implement this using raw html, javascript for the frontend, and SQL, C++ with a very barebones basic html server for the backend. I would like to understand the low level details. I don't want to see some PHP high level implementation. Oh and it needs to be ultra secure.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
January 02 2012 12:31 GMT
#2042
+ Show Spoiler +

public class Driver
{
public static void main (String[] args)
{
Person First = new Person (First, 15, 01, 01, 1991);
Person Second = new Person (Second, 16, 01, 02, 1990);
Person Third = new Person (Third, 14, 12, 03, 1992);

Person array = {First, Second, Third};

Person.partition(array, 0, 2);
System.out.println("The merge sorted 2nd array is as follows: ");
for (int i = 0; i < array.length; i++) {
System.out.println(array[i]);

}

}
}


+ Show Spoiler +

public class Person
{
private String name;
private int age;
private int mm;
private int dd;
private int yyyy;

public Person (String name, int age, int mm, int dd, int yyyy){
this.name = name;
this.age = age;
this.mm = mm;
this.dd = dd;
this.yyyy = yyyy;
}

public static int partition(int arr[], int left, int right)
{
int i = left, j = right;
int tmp;
int pivot = arr[(left + right) / 2];

while (i <= j) {
while (arr[i].getAge() < pivot.getAge())
i++;
while (arr[j].getAge() > pivot.getAge())
j--;
if (i <= j) {
tmp = arr[i].getAge();
arr[i].getAge() = arr[j].getAge();
arr[j].getAge() = tmp;
i++;
j--;
}
};

return i;
}

void quickSort(int arr[], int left, int right) {
int index = partition(arr, left, right);
if (left < index - 1)
quickSort(arr, left, index - 1);
if (index < right)
quickSort(arr, index, right);
}
public int getAge(){
return age;
}
}


i would like help from TL's java programmers.

im still a complete noob in using java and our prof has given us homework where we have to sort an array of persons based on their name, age and birthdate.

so i made the name a string and the age as a integer. i divided the birthdate into 3 integeres, mm, dd, and yyyy for proper sorting.

my problem now is that if i fill an array with person objects, how do I 'extract' the age data so that i can compare it for my quicksort?

p.s. it has to be quicksort
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
Herper
Profile Joined January 2011
501 Posts
January 02 2012 12:36 GMT
#2043
On January 02 2012 21:31 icystorage wrote:
+ Show Spoiler +

public class Driver
{
public static void main (String[] args)
{
Person First = new Person (First, 15, 01, 01, 1991);
Person Second = new Person (Second, 16, 01, 02, 1990);
Person Third = new Person (Third, 14, 12, 03, 1992);

Person array = {First, Second, Third};

Person.partition(array, 0, 2);
System.out.println("The merge sorted 2nd array is as follows: ");
for (int i = 0; i < array.length; i++) {
System.out.println(array[i];

}

}
}


+ Show Spoiler +

public class Person
{
private String name;
private int age;
private int mm;
private int dd;
private int yyyy;

public Person (String name, int age, int mm, int dd, int yyyy){
this.name = name;
this.age = age;
this.mm = mm;
this.dd = dd;
this.yyyy = yyyy;
}

public static int partition(int arr[], int left, int right)
{
int i = left, j = right;
int tmp;
int pivot = arr[(left + right) / 2];

while (i <= j) {
while (arr[i].getAge() < pivot.getAge())
i++;
while (arr[j].getAge() > pivot.getAge())
j--;
if (i <= j) {
tmp = arr[i].getAge();
arr[i].getAge() = arr[j].getAge();
arr[j].getAge() = tmp;
i++;
j--;
}
};

return i;
}

void quickSort(int arr[], int left, int right) {
int index = partition(arr, left, right);
if (left < index - 1)
quickSort(arr, left, index - 1);
if (index < right)
quickSort(arr, index, right);
}
public int getAge(){
return age;
}
}


i would like help from TL's java programmers.

im still a complete noob in using java and our prof has given us homework where we have to sort an array of persons based on their name, age and birthdate.

so i made the name a string and the age as a integer. i divided the birthdate into 3 integeres, mm, dd, and yyyy for proper sorting.

my problem now is that if i fill an array with person objects, how do I 'extract' the age data so that i can compare it for my quicksort?

p.s. it has to be quicksort


Why not just use a Date class for the birthdate or are you not allowed?
Sanix
Profile Joined April 2011
Switzerland37 Posts
January 02 2012 12:38 GMT
#2044
You want other people to do your homework. Interesting ;-)

First of all. Follow the java conventions. Variables are always lowercase letters. Then you're missing the " for strings. Your code won't even compile. Have you tried it?

Use Calender for dates, not 3 integers. E.g Calendar birthDate= new GegorianCalendar(2000,1,1);

Now about the comparing things. Your Person class needs to implement the Comparable interface. So will force you to implement a compare(...) method, which will in turn allow the Arrays.sort() method to sort your array.

Now you will need to use google and java doc a lot
FranzP
Profile Joined November 2010
France270 Posts
Last Edited: 2012-01-02 13:08:19
January 02 2012 13:04 GMT
#2045
you have
Person First = new Person (First, 15, 01, 01, 1991);
Person Second = new Person (Second, 16, 01, 02, 1990);
Person Third = new Person (Third, 14, 12, 03, 1992);

Person array = {First, Second, Third};

Person.partition(array, 0, 2);


and then


public static int partition(int arr[], int left, int right)


I don't understand what you did there (no pun intended). Shouldn't it be :
Person First = new Person (First, 15, 01, 01, 1991);
Person Second = new Person (Second, 16, 01, 02, 1990);
Person Third = new Person (Third, 14, 12, 03, 1992);

Person[] array = {First, Second, Third};

Person.partition(array, 0, 2);


and then


public static int partition(Person[] array, int left, int right)


Anyway I don't think you can use comparators (yeah it should run in n log n but i guess the point of the exercise is to make a quicksort.

First you should use a java.land.Date for the birthDate, you can then use the before and after methods.

Before I can give other advice it would be good to comment your code so we can know where you're at right now. I don't fully understand your code just by looking at it as it is.

edit : fuck can't bold in code tags...
"Cyberhacking is kind of like masturbation I guess, all countries do it but nobody actually talks about it. China just was accidentally doing it with the door wide open." Newbistic
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
January 02 2012 13:18 GMT
#2046
public Person (String name, int age, int mm, int dd, int yyyy){..}
Person First = new Person (First, 15, 01, 01, 1991);

that doesn't really match by the way.. you should have:

Person First = new Person ("First", 15, 01, 01, 1991);

also, you should get used to writing variable names in lower case, so ideally it would be:

Person first = new Person ("First", 15, 01, 01, 1991);

same with second, third obviously.
Gold isn't everything in life... you need wood, too!
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
Last Edited: 2012-01-02 13:24:44
January 02 2012 13:21 GMT
#2047
now these are the reasons i ask in tl because our profs doesnt teach us anything, i didnt even know theres a Calendar class!

@Sanix yes i have tried compiling it, i didnt expect it to run, just checked for errors, and the errors said the int cant be dereferenced (w/c i didnt understand but i guess my mistake was pointed out by FranzP)

@FranzP thanks for pointing that out ._. im such a noob.

im not asking tl to do my homework for me im just asking for advice on how to proceed coz sometimes people can see what's wrong on your code

thanks guys!

edit: btw, if i use the Calendar datatype, can it determine if one Calendar is larger than the other Calendar? when comparing
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
FranzP
Profile Joined November 2010
France270 Posts
Last Edited: 2012-01-02 13:32:06
January 02 2012 13:28 GMT
#2048
On January 02 2012 16:46 ccherng wrote:
Does anyone have a detailed explanation of how to use cookies to implement both of the following logins securely.

1) Login meaning either one time login that which is NOT persistant meaning when the browser is closed a new browser is opened to the site a new login is required.

2) Login meaning its persistent for some number of days like you usually see with sites like gmail.

How does one implement this using raw html, javascript for the frontend, and SQL, C++ with a very barebones basic html server for the backend. I would like to understand the low level details. I don't want to see some PHP high level implementation. Oh and it needs to be ultra secure.


When you say C++ do you use a web framework or just pure C++. Because I actually have no idea how to develop a web site with just C++ (and I don't think a lot of people do).

I ask that because you won't go anywhere without a big layer of abstraction to handle session and cookie. At least HttpRequest, HttpResponse, Cookie and Session object. The security behind your web site doesn't depend on the language you use but more on how people can interact with it and how you deal with interaction (a website without any user interaction like comment etc will be a lot safer).

As for your points :
1) You should just store a sessionID in a session cookie. It will reset itself when the browser is closed (or leave the website) then reopened.
2) just store a sessionID in a persistent cookie and save it to your DB. He you want to be extra safe use a secure cookie and HTTPS

If you want to understand more about session and cookie implementation just go look for it there is plenty of documentation on different implementation. http://en.wikipedia.org/wiki/HTTP_cookie provides a lot of explanation.

The point is, you can't be more secure than cookie let you be. You can generate the httpresponse with the cookie yourself but I don't think there is any point in that. Just PHP or something else. If you're just curious about cookie implementation read the HTTP specification :D
"Cyberhacking is kind of like masturbation I guess, all countries do it but nobody actually talks about it. China just was accidentally doing it with the door wide open." Newbistic
Warri
Profile Joined May 2010
Germany3208 Posts
January 02 2012 13:31 GMT
#2049
Can anyone recommend me a rather recent tutorial on how to create 3d games in java? All i can find with google are tutorials from 2004 and older, but i guess a lot changed since then so its better to use a more recent one?
FranzP
Profile Joined November 2010
France270 Posts
January 02 2012 13:37 GMT
#2050
On January 02 2012 22:31 Warri wrote:
Can anyone recommend me a rather recent tutorial on how to create 3d games in java? All i can find with google are tutorials from 2004 and older, but i guess a lot changed since then so its better to use a more recent one?


The most obvious reason I can think of "Why there is no tutorial to do 3D java games" is because java sucks for making games. Most 3D engines are not made for java because it is not in the philosophy of the java language (and it is a lot less efficient than other language because of the JVM).

So you can make a game in 3D using java and Java3D (http://fivedots.coe.psu.ac.th/~ad/jg/) but I don't think that would be the right choice of language.

The simplest way to do a 3D game must be XNA and C# (it's not far from java anyway)
"Cyberhacking is kind of like masturbation I guess, all countries do it but nobody actually talks about it. China just was accidentally doing it with the door wide open." Newbistic
pettter
Profile Joined December 2009
Sweden1032 Posts
January 02 2012 13:44 GMT
#2051
On January 02 2012 22:37 FranzP wrote:
Show nested quote +
On January 02 2012 22:31 Warri wrote:
Can anyone recommend me a rather recent tutorial on how to create 3d games in java? All i can find with google are tutorials from 2004 and older, but i guess a lot changed since then so its better to use a more recent one?


The most obvious reason I can think of "Why there is no tutorial to do 3D java games" is because java sucks for making games. Most 3D engines are not made for java because it is not in the philosophy of the java language (and it is a lot less efficient than other language because of the JVM).

So you can make a game in 3D using java and Java3D (http://fivedots.coe.psu.ac.th/~ad/jg/) but I don't think that would be the right choice of language.

The simplest way to do a 3D game must be XNA and C# (it's not far from java anyway)


The JVM does not really add a lot to the pure CPU computations, and it is very possible to make games, even 3D games in Java. Still, I would stick with C++ for anything serious, and most non-serious games as well, as there are lots and lots more tools available for game-making there.
FranzP
Profile Joined November 2010
France270 Posts
January 02 2012 13:49 GMT
#2052
Yeah I know, but I actually have no idea how good a library like Java3D is at using openGL, and how easy it is to use the library to do cool stuff.
"Cyberhacking is kind of like masturbation I guess, all countries do it but nobody actually talks about it. China just was accidentally doing it with the door wide open." Newbistic
pettter
Profile Joined December 2009
Sweden1032 Posts
January 02 2012 13:54 GMT
#2053
On January 02 2012 22:49 FranzP wrote:
Yeah I know, but I actually have no idea how good a library like Java3D is at using openGL, and how easy it is to use the library to do cool stuff.

Well, the obvious example would be Minecraft...
Roban
Profile Joined August 2010
Netherlands73 Posts
Last Edited: 2012-01-02 13:58:56
January 02 2012 13:58 GMT
#2054
On January 02 2012 22:18 MisterD wrote:
public Person (String name, int age, int mm, int dd, int yyyy){..}
Person First = new Person (First, 15, 01, 01, 1991);

that doesn't really match by the way.. you should have:

Person First = new Person ("First", 15, 01, 01, 1991);

also, you should get used to writing variable names in lower case, so ideally it would be:

Person first = new Person ("First", 15, 01, 01, 1991);

same with second, third obviously.


Eh, don't type 01, 02, 03 as an integer value unless you mean octal....
in this case ( 01 ) it's still 1 but if you type 010, it's actually 8 instead of 10
heishe
Profile Blog Joined June 2009
Germany2284 Posts
Last Edited: 2012-01-02 14:41:04
January 02 2012 14:39 GMT
#2055
On January 02 2012 22:44 pettter wrote:
Show nested quote +
On January 02 2012 22:37 FranzP wrote:
On January 02 2012 22:31 Warri wrote:
Can anyone recommend me a rather recent tutorial on how to create 3d games in java? All i can find with google are tutorials from 2004 and older, but i guess a lot changed since then so its better to use a more recent one?


The most obvious reason I can think of "Why there is no tutorial to do 3D java games" is because java sucks for making games. Most 3D engines are not made for java because it is not in the philosophy of the java language (and it is a lot less efficient than other language because of the JVM).

So you can make a game in 3D using java and Java3D (http://fivedots.coe.psu.ac.th/~ad/jg/) but I don't think that would be the right choice of language.

The simplest way to do a 3D game must be XNA and C# (it's not far from java anyway)


The JVM does not really add a lot to the pure CPU computations, and it is very possible to make games, even 3D games in Java. Still, I would stick with C++ for anything serious, and most non-serious games as well, as there are lots and lots more tools available for game-making there.


The JVM adds absolutely HUGE overhead to the computations. This doesn't matter for business applications, but it's devastating for games. There are very good reasons why absolutely no high-end ("AAA") game get's made in either Java or C#, and all of them are done in C++ and one of them is that Java is just a lot slower than C++.

That's just that though. I'm not saying "don't use Java". By all means, if you like it, use it. You will never get anywhere near the places of games where you need that performance that C++ gives you.

To answer the question: You use OpenGL (I don't think there are any DirectX ports available) just like you would in C++. For that you use libs like lwjgl, which includes an OpenGL binding for Java.
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
Millitron
Profile Blog Joined August 2010
United States2611 Posts
January 02 2012 17:05 GMT
#2056
On January 02 2012 21:31 icystorage wrote:
+ Show Spoiler +

public class Driver
{
public static void main (String[] args)
{
Person First = new Person (First, 15, 01, 01, 1991);
Person Second = new Person (Second, 16, 01, 02, 1990);
Person Third = new Person (Third, 14, 12, 03, 1992);

Person array = {First, Second, Third};

Person.partition(array, 0, 2);
System.out.println("The merge sorted 2nd array is as follows: ");
for (int i = 0; i < array.length; i++) {
System.out.println(array[i];

}

}
}


+ Show Spoiler +

public class Person
{
private String name;
private int age;
private int mm;
private int dd;
private int yyyy;

public Person (String name, int age, int mm, int dd, int yyyy){
this.name = name;
this.age = age;
this.mm = mm;
this.dd = dd;
this.yyyy = yyyy;
}

public static int partition(int arr[], int left, int right)
{
int i = left, j = right;
int tmp;
int pivot = arr[(left + right) / 2];

while (i <= j) {
while (arr[i].getAge() < pivot.getAge())
i++;
while (arr[j].getAge() > pivot.getAge())
j--;
if (i <= j) {
tmp = arr[i].getAge();
arr[i].getAge() = arr[j].getAge();
arr[j].getAge() = tmp;
i++;
j--;
}
};

return i;
}

void quickSort(int arr[], int left, int right) {
int index = partition(arr, left, right);
if (left < index - 1)
quickSort(arr, left, index - 1);
if (index < right)
quickSort(arr, index, right);
}
public int getAge(){
return age;
}
}


i would like help from TL's java programmers.

im still a complete noob in using java and our prof has given us homework where we have to sort an array of persons based on their name, age and birthdate.

so i made the name a string and the age as a integer. i divided the birthdate into 3 integeres, mm, dd, and yyyy for proper sorting.

my problem now is that if i fill an array with person objects, how do I 'extract' the age data so that i can compare it for my quicksort?

p.s. it has to be quicksort

Use a single int for date, where the int represents the number of days since January 1st, 0 AD.

Sort based on this int.

Then, with a little division, it should be easy to get it back to mm/dd/yyyy.
Who called in the fleet?
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
Last Edited: 2012-01-02 17:09:56
January 02 2012 17:09 GMT
#2057
On January 02 2012 22:58 Roban wrote:
Show nested quote +
On January 02 2012 22:18 MisterD wrote:
public Person (String name, int age, int mm, int dd, int yyyy){..}
Person First = new Person (First, 15, 01, 01, 1991);

that doesn't really match by the way.. you should have:

Person First = new Person ("First", 15, 01, 01, 1991);

also, you should get used to writing variable names in lower case, so ideally it would be:

Person first = new Person ("First", 15, 01, 01, 1991);

same with second, third obviously.


Eh, don't type 01, 02, 03 as an integer value unless you mean octal....
in this case ( 01 ) it's still 1 but if you type 010, it's actually 8 instead of 10


without looking it up right now, i am quite certain, that 010 is still decimal 10 and you have to write 0x10 to get the hexadecimal 8, at least in java.
Gold isn't everything in life... you need wood, too!
Denar
Profile Blog Joined March 2011
France1633 Posts
January 02 2012 17:11 GMT
#2058
On January 02 2012 16:46 ccherng wrote:
Does anyone have a detailed explanation of how to use cookies to implement both of the following logins securely.

1) Login meaning either one time login that which is NOT persistant meaning when the browser is closed a new browser is opened to the site a new login is required.

2) Login meaning its persistent for some number of days like you usually see with sites like gmail.

How does one implement this using raw html, javascript for the frontend, and SQL, C++ with a very barebones basic html server for the backend. I would like to understand the low level details. I don't want to see some PHP high level implementation. Oh and it needs to be ultra secure.


I don't have exact links, but you should look at the HTTP Protocol documentation.

It will be a bit rough, but if you're interested in the low level, this is where it happens.

You can probably find a tutorial that will teach you how to create a web server that displays some text (Listen Socket, parse the incoming HTTP request, and prepare your answer before sending it back to the client.)

Then you can improve from that to learn new stuff one at a time
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
January 02 2012 17:13 GMT
#2059
On January 02 2012 12:31 CAPSLOCKLOL wrote:
Show nested quote +
On January 02 2012 12:17 MisterD wrote:
On January 02 2012 12:14 CAPSLOCKLOL wrote:
Hi guys I'm in an introductory java class (AP Computer Science A) and need some help. I was working on a program that imported information from a text file about hurricane data, applied it to arrays, and used the arrays to categorize the information and calculate some averages and such. At the end I had to write the statistics to an output file.

Well in BlueJ I got the right output whenever I compile the program, but when I write it to a file by replacing all the System.out.print w/ outFile.print I check the text file and the output is ALL messed up in note pad. Literally nothing is neatly organized and overall it looks like a clusterfuck! I have absolutely no idea what to do at this point. I have a feeling it might have something to do with my printf methods, but I don't understand why it would look normal when I compile it in BlueJ but look awful in notepad. I'll post any parts of program if needed.

try opening it with a different editor. If your program writes unix line breaks (\n), the windows editor screws up because it doens't display those. The windows editor only displays windows style line breaks (\r\n).
Oh ok that's it then. I use a lot of \n in my code. Good to know what the issue is! Thanks for the quick reply! :D I find it odd my class would encourage the use of \n and not mention that issue when outputting data. Does windows editor accept System.out.println(); as it seems my only option is to go back and change all the \n to println();

EDIT: Decided to just go with \r\n and it worked beautifully. If my teacher gives me crap about not yet learning anything about \r I'll just go back and fix it whatever way she wants. Once again thanks for the help!


if you want a operating system adaptive solution you can use System.getProperty("line.separator"); which will create \n on unix, \r\n on windows and \r on old mac systems. That's the behavior println() achieves, the line breaks are different depending on what system the code is executed.
Gold isn't everything in life... you need wood, too!
ParasitJonte
Profile Joined September 2004
Sweden1768 Posts
January 02 2012 17:35 GMT
#2060
On January 02 2012 22:31 Warri wrote:
Can anyone recommend me a rather recent tutorial on how to create 3d games in java? All i can find with google are tutorials from 2004 and older, but i guess a lot changed since then so its better to use a more recent one?


Go with jmonkeyengine http://jmonkeyengine.com/ .

Seems like a very serious project. Think they also support games on android if you want to do that.
Hello=)
Prev 1 101 102 103 104 105 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 57m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 572
BRAT_OK 90
Codebar 41
Livibee 31
StarCraft: Brood War
Jaedong 1495
GuemChi 1465
EffOrt 1325
Stork 698
Light 607
Larva 417
Snow 411
Mini 356
Rush 223
Barracks 222
[ Show more ]
Leta 119
hero 112
sSak 111
JYJ47
Aegong 37
Backho 34
sorry 29
zelot 26
soO 23
Terrorterran 16
HiyA 15
scan(afreeca) 12
Bale 9
Dota 2
qojqva3422
420jenkins258
syndereN218
Other Games
singsing2199
Sick375
DeMusliM352
crisheroes342
Lowko284
Hui .257
Liquid`VortiX150
oskar109
KnowMe96
XcaliburYe58
QueenE29
Trikslyr17
Organizations
Counter-Strike
PGL201
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Michael_bg 4
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2491
• WagamamaTV466
League of Legends
• Nemesis4280
• Jankos3067
• TFBlade809
Upcoming Events
LAN Event
1h 57m
Lambo vs Harstem
FuturE vs Maplez
Scarlett vs FoxeR
Gerald vs Mixu
Zoun vs TBD
Clem vs TBD
ByuN vs TBD
TriGGeR vs TBD
Korean StarCraft League
10h 57m
CranKy Ducklings
17h 57m
IPSL
1d 1h
dxtr13 vs OldBoy
Napoleon vs Doodle
LAN Event
1d 1h
BSL 21
1d 3h
Gosudark vs Kyrie
Gypsy vs Sterling
UltrA vs Radley
Dandy vs Ptak
Replay Cast
1d 6h
Sparkling Tuna Cup
1d 17h
WardiTV Korean Royale
1d 19h
IPSL
2 days
JDConan vs WIZARD
WolFix vs Cross
[ Show More ]
LAN Event
2 days
BSL 21
2 days
spx vs rasowy
HBO vs KameZerg
Cross vs Razz
dxtr13 vs ZZZero
Replay Cast
2 days
Wardi Open
2 days
WardiTV Korean Royale
3 days
Replay Cast
4 days
Kung Fu Cup
4 days
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
5 days
The PondCast
5 days
RSL Revival
5 days
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
5 days
WardiTV Korean Royale
5 days
RSL Revival
6 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
6 days
Liquipedia Results

Completed

BSL 21 Points
SC4ALL: StarCraft II
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
Stellar Fest: Constellation Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

BSL Season 21
SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.