-
Posts
155 -
Joined
Content Type
Forums
Downloads
Blogs
Events
Gallery
Articles
Everything posted by GhostSnyper
-
What revision should FailScene's official server be?
GhostSnyper replied to GhostSnyper's topic in Gamers Den
Of course you are stevie... updated the first post will a small description of them -
What revision should FailScene's official server be?
GhostSnyper replied to GhostSnyper's topic in Gamers Den
vote, guys damn two replies in the time i made the poll -
So uh, I wanna know whether what I dev will be liked... I kinda don't wanna do 500+ because of all the map data bullshit, but if people want the revisions, they'll have to live without some areas. Vote! 317 (333) - classic runescape as we know it! Technically we all load 333 cache from our 317's, so it includes slayer and farming! 377 - Introduction of the pest control minigame! 474 - update before wilderness ditch and trade limit. Newer graphics, and updated gameframe 508 - HD with fullscreen (if I decide to enable it) 525 - d claws spec, I think, and a couple of other things
-
i3? horrible pricing... I have a server that runs better than an i5 dual p4 HT @ 2.8 ghz. intel's core series is really over priced
-
Closed. No warez allowed
-
Here's your Letter - Blink 182
-
If you're on a budget, get amd and ati parts. for 1000 american, I have a quad core @ 2.6, 4 gigs of high end ddr2, a 320 gig hard drive, a really nice case, and an ATI Radeon 5770. Runs every game I have had the urge to play nicely. Video is your biggest expense, and Nvidia is in no way a bang-for-your-buck product
-
I'm not like the 2f2f junkies. I like the older skyline. Honestly, the 92 is on dated hardware, but it's so much higher in performance than the r34 or r35... The new GTR is a fat pile of shit. Although, fair enough, the ATTESA tranny and the Q35(I think) motor in it are wild
-
92 Skyline, bitches :3
-
they most likely are uploading avatars too large... and if you increase the bandwidth, you'll cause lag problems :/
-
[Java] Stop creating overhead with Strings!
GhostSnyper replied to GhostSnyper's topic in Techno Geeks Unite
When I wake up again, I'll edit the first post to make it easier to understand -
If you had one million dollars, what would you buy?
GhostSnyper replied to MxRE's topic in General Discussions
Average savings account in the states will double the amount of money in there every 7 years. You get a CD (certificate of deposit) for a 5 year locked savings account, and you could triple it in 5 years, maybe more -
[Java] Stop creating overhead with Strings!
GhostSnyper replied to GhostSnyper's topic in Techno Geeks Unite
Well to give you an example, I'll modify a program I wrote to show you guys just how big this problem can be. This snippet of code comes from my conversion tool I wrote. This chunk of code's purpose is to format the cached items to a database query, so it may be inserted. I chose not to use prepared statements, as that was too much work (if you don't know what a prepared statement is, I'm makng a post about it later on in the future). We're also going to add a timer, for hilarity's sake public void sendData (ArrayList list) { try { Statement statement = con.createStatement(); String query = "INSERT INTO core_itemdefinitions (ID, Name, Description, LowAlch, HighAlch) VALUES "; int lol = 0, numObjects = 1; // numObjects starts at 1, because the string is already set, as you see above. long timeElapsed = System.nanoTime(); for (String[] s: list) { if (lol != list.size() - 1) { query += "('" + s[0] +"','" + s[1] + "','" + s[2] + "','" + s[3] + "','" + s[4] + "'), "; lol++; numObjects += 3; //When you append to a string, you actually have to create three objects to replace the original string. } else { query += "('" + s[0] +"','" + s[1] + "','" + s[2] + "','" + s[3] + "','" + s[4] + "');"; numObjects += 3; //When you append to a string, you actually have to create three objects to replace the original string. } } timeElapsed = (System.nanoTime() - timeElapsed) / 1000000L; System.out.println ("Querty created.\nTotal number of objects created: " +numObjects +".\nTime taken to process: " +timeElapsed +"ms, or " + (double) timeElapsed /1000 +" seconds.\nAttempting to sumbit to database"); //statement.executeUpdate(query); //Leaving this out, because I've already submited the stuff I need. } catch (SQLException e) {e.printStackTrace(); } } The output of the program? Item.cfg found. File put into scanner buffer Array list has been created. Starting the reading and conversion of the file Configuration file read. Converted a total of 6541 items. Preparing and initiating Database connection/transfer Querty created. Total number of objects created: 19624. Time taken to process: 27745ms, or 27.745 seconds. Attempting to sumbit to database Press any key to continue . . . Now let's modify this program. We're going to use a StringBuilder instead. The reb, bolded text are the modifications I did to achieve the output public void sendData (ArrayList list) { try { Statement statement = con.createStatement(); [color=red][b]StringBuilder query = new StringBuilder("INSERT INTO core_itemdefinitions (ID, Name, Description, LowAlch, HighAlch) VALUES "); String formattedQuery = null; //We technically haven't created this object yet, so don't count it[/b][/color] int lol = 0, numObjects = 1; // numObjects starts at 1, because the string is already set, as you see above. long timeElapsed = System.nanoTime(); for (String[] s: list) { if (lol != list.size() - 1) { [color=red][b]query.append("('" + s[0] +"','" + s[1] + "','" + s[2] + "','" + s[3] + "','" + s[4] + "'), ");[/b][/color] lol++; //We don't add any objects, because we haven't created any! } else { [color=red][b] query.append("('" + s[0] +"','" + s[1] + "','" + s[2] + "','" + s[3] + "','" + s[4] + "');");[/b][/color] [color=red][b]formattedQuery = query.toString();[/b][/color] numObjects++; // only created one object, so increment it instead of causing overhead } } timeElapsed = (System.nanoTime() - timeElapsed) / 1000000L; System.out.println ("Querty created.\nTotal number of objects created: " +numObjects +".\nTime taken to process: " +timeElapsed +"ms, or " + (double) timeElapsed /1000 +" seconds.\nAttempting to sumbit to database"); //statement.executeUpdate(query); //Leaving this out, because I've already submited the stuff I need. } catch (SQLException e) {e.printStackTrace(); } } The output? Item.cfg found. File put into scanner buffer Array list has been created. Starting the reading and conversion of the file Configuration file read. Converted a total of 6541 items. Preparing and initiating Database connection/transfer Querty created. Total number of objects created: 2. Time taken to process: 17ms, or 0.017 seconds. Attempting to sumbit to database Press any key to continue . . . Now do you understand a bit more? We essentially did the second version of our program more than six thousand times, to achieve the same result. Now, even if you aren't a programmer, isn't that a huge difference? Imagine a RuneScape server that does this sort of string manipulation several times per player, per cycle. No wonder most servers are shit, eh? -
I would recommend using a program like teamviewer, to be honest. it supports a large amount of users with ease
-
So I have been looking into different ways to optimize and tune my code, when I ran into an article about strings. Now there are two types of objects in java, mutable objects, and immutable object; rather, changeable and unchangeable objects. Unfortunately, a String is among those immutable objects. It cannot change once it has been created. Now you say, "Well, how is that possible? It's easy to set a String to a new value!" Of course that it is easy, but that is because the String class handles all the low level operations to 'modify' the String. For example, let's say we have a simple class that takes a name input import java.io.Serializable; import java.util.Scanner; public class RegisterUser implements Serializable { private static transient Scanner iReader; private static transient boolean nameOK = false; private static String username = null; public static void main (String args[]) { println("Hello, Welcome to the new user registration."); println("Fortunately, all we need at this point is your name."); iReader = new Scanner(System.in); while (!nameOK) { println("If you please, what is your first name?"); username = formatCase(iReader.nextLine()); println("Is " +username+ " correct? if it is, please enter Y"); if (scanner.nextLine().toString().equalsIgnoreCase("y")) nameOK = true; } nameOK = false; while (!nameOK) { println("Thank you. Now, what is your last name?"); String lastName = formatCase(iReader.nextLine()); println("Is " +lastName+ " spelled right? if it is, please enter Y"); if (scanner.nextLine().toString().equalsIgnoreCase("y")) { nameOK = true; username += " " + lastName; } } println("Thank you very much, " +username+ ", your username has successfully been registered."); } static String formatCase(String s) { return (s.length()>0) ? Character.toUpperCase(s.charAt(0))+s.substring(1) : s; } static void println(String s) { System.out.println(s); } } This class, from our point of view, is simple, and gets the job done quick. However, if we were to modify this to serve a large number of users concurrently, we'd run into a problem. When we do things, such as modify a string, we are not actually modifying it. We are creating two objects to replace it. When we used the line:
-
You use paintballing as inspiration?
-
Band? Blink 182 DJ? DJ Eros Producer? Tiesto
-
If you had one million dollars, what would you buy?
GhostSnyper replied to MxRE's topic in General Discussions
I'd move to the UK, buy a small house, a car, and save the rest -
[MySQL/RuneScape] My RuneScape Storage Solution
GhostSnyper replied to GhostSnyper's topic in Gamers Den
It's very worth it... half assed system loads 4x faster using the standard rsps method.. Still runs slow. Going to fix that In the end, it's going to take 5 times longer to load, but that's the compromise when you have <1ms load times- 9 replies
-
- mysql or runescape
- runescape
-
(and 2 more)
Tagged with:
-
[MySQL/RuneScape] My RuneScape Storage Solution
GhostSnyper replied to GhostSnyper's topic in Gamers Den
I'm putting together the mock design for the rest of the system today. Let's see if I can't get some things done this evening- 9 replies
-
- mysql or runescape
- runescape
-
(and 2 more)
Tagged with:
-
Get in line. At least you don't have spouts of "oh, I realized I haven't slept in 4 days... Fuck I'm tired"
-
Not bad at all, mate. I would suggest that the "1 time(s) in a row be removed. If you wanted to keep it, you could have it used in instances like "blah blah has raised his strength level x times today!"
- 7 replies
-
- adventurer
- log
-
(and 1 more)
Tagged with:
-
[MySQL/RuneScape] My RuneScape Storage Solution
GhostSnyper replied to GhostSnyper's topic in Gamers Den
Oh? What do you mean, mike? From what I have been able to research, I think they use a form of oracle database. I don't know what or how they store their data, but I'm implementing my best efforts at what I think they'd do to manage their data- 9 replies
-
- mysql or runescape
- runescape
-
(and 2 more)
Tagged with:
-
He's asking the goat about politics...
-
FailHotel.FailScene.com? Make it a subdomain with a reroute to your web server