• 0

    posted a message on Programming fun
    Awesome console printing with boxes :D (Java)


    static void box(String [] paragraph, String title) {
    
    ArrayList<String> buffer = new ArrayList<String>();
    String at = "";
    
    int side1 = (int) Math.round(25 - ((title.length() + 4) / 2d));
    int side2 = (int) (26 - ((title.length() + 4) / 2d));
    at += '+';
    for (int t = 0; t < side1; t++)
    at += '-';
    at += "{ ";
    at += title;
    at += " }";
    for (int t = 0; t < side2; t++)
    at += '-';
    at += '+';
    buffer.add(at);
    at = "";
    buffer.add("|												 |");
    for (String s : paragraph) {
    at += "| ";
    int left = 49;
    for (int t = 0; t < s.length(); t++) {
    at += s.charAt(t);
    left--;
    if (left == 0) {
    	 at += " |";
    	 buffer.add(at);
    	 at = "";
    	 at += "| ";
    	 left = 49;
    }
    }
    while (left-- > 0)
    at += ' ';
    at += " |";
    buffer.add(at);
    at = "";
    }
    buffer.add("|												 |");
    buffer.add("+---------------------------------------------------+");
    
    System.out.println(" ");
    for (String line : buffer.toArray(new String[buffer.size()])) {
    System.out.println(line);
    }
    System.out.println(" ");
    }
    Posted in: Hardware & Software Support
  • 0

    posted a message on Should I get Java For Dummies on iPad?
    It's very introductory, use the book to get a hang on the language, but I wouldn't stick to it since it doesn't cover details like some other books do. I find it's best to start with if you're trying to get an idea of what it's all about and getting some OOP concepts.. but then again there's already a lot of good resources for that.
    Posted in: Computer Science and Technology
  • 1

    posted a message on Castle Siege TEST GAME TONIGHT
    ...?

    More detail?
    Posted in: PC Servers
  • 0

    posted a message on Looking for a C/C++ Teacher? I'm willing to learn!
    A good teacher for a programming language?

    Yourself. You know how you learn, what pace you learn at, and the ways you can learn the best.

    And please ignore the programming video tutorials.. text is the way to go.
    Posted in: Computer Science and Technology
  • 0

    posted a message on Which language would be best to create a text-based game?
    Quote from Krontical

    I recommend Javascript or Lua for a text based game. I'm more leaning towards javascript though.


    Javascript is primarily used in webpages. Using that for a text adventure game within a webpage might not be best approach for this.

    However, Java is a programming language that operates on it's own interpreter as a program in your computer. This would work for a text adventure.

    MacModder - There really is no ideal language for a text adventure, because it's such a simple task. Choose one that's attractive to you and learn it!
    Posted in: Hardware & Software Support
  • 0

    posted a message on Domain resolution extremely slow
    Quote from willfurnell

    Are they both on the same vlan too?

    Quote from jacobdb

    if they are not on the same vlan, do both vlans share the same wan side configuration?


    Both machines are on the same vlan. To clear things up, 2/3 machines on this vlan are fine, but the last, running Linux Mint, is having these issues. This is most likely a local issue on the OS, so maybe some Linux guru could show me the light.
    Posted in: Hardware & Software Support
  • 0

    posted a message on Domain resolution extremely slow
    Quote from willfurnell

    Are you using the same DNS servers on both machines?
    Pop the Google Public DNS servers in your /etc/resolv.conf (8.8.8.8 8.8.4.4) instead of what is currently there and see if it makes any difference.


    I tried both the google DNS and my ISP's DNS (Shaw, Vancouver). Both have the same results.
    And yes, both machines are using the same DNS. I'm sure it's something specific to how this machine is resolving its DNS.
    Posted in: Hardware & Software Support
  • 0

    posted a message on Domain resolution extremely slow
    Hey, I thought I'd give this issue a run by these forums.

    So, recently I've been having extremely laggy domain name resolution through my Linux Mint machine. My laptop seems fine, along with my Debain server, but for the life of me I don't know why. I have a vlan splitting up my network, two network cards in my machine (I've tried both), and a perfectly fine Internet connection. I can ping external IPs and connect to them just fine, and my download / upload speed is just as it should be (50Mbs down / 5 up). But when I try to ping or connect to anything with a domain name, there is a massive delay, as long as 25 seconds, before the IP is retrieved from the DNS. Additonally, I had both the primary and secondary DNS specified in my OS.

    I can bring up a ping window for 'google.com', and '173.194.33.39' (google server), and the domain returns the ping very explosively and slowly, while the IP pings just like normal. My Windows 7 laptop can resolve host names perfectly fine, but this particular Linux Mint machine cannot.

    If anyone has any clue what could be causing this, please let me know!
    Posted in: Hardware & Software Support
  • 0

    posted a message on What language next?
    BC_Programming, thanks for the input.

    I'll try to educate myself more on handling these issues with garbage collection. I just never knew whether to try something different, or learn more about my current language. I had assumed I needed a native language because of the extra capabilities provided by them. Thanks for providing some insight on the differences between them.

    My ideal feature in Java is to have a single method within the Object class which instructs the garbage collector to dispose of the object and sets all existing references to it as null. However, I could accomplish the same if I were to structure my applications out better, so that objects that do consume a large amount of memory lose all its references when need be.

    Quote from BC_Programming

    No, you don't. You need a better understanding of the one you are using and the ability to realize that you cannot simply blame the technology when there are plenty of other people who don't have the problems you are doing the exact same things.


    I'm not blaming the technology here, I'm questioning whether there's something better suited for me, and with what I'm doing, hence why I'm posting here. I've never gotten a taste in many languages before, so I don't know whether managing memory is easier in others than in Java.

    Quote from BC_Programming

    This may actually explain your situation. One common pattern for accepting connections is to keep them in a list of active connections. They get added. In your case, you could be assuming that sockets that you close yourself or that get closed remotely are magically cleaned up. But this is not the case; those instances stick around after they are closed and will stick around until the entire list is cleaned up- which will usually be after the program terminates.


    This is part of my situation. I was scrambling to remove references throughout the application to truly clean up the client instances...

    Quote from BC_Programming

    -when you .close() a socket, remove it from the list. closeing it doesn't magically make the List know to remove the reference, so it sticks around.


    Except the list isn't the only place in the application holding references to the socket. This is my issue, and I should be passing these references throughout the program, rather than creating entirely new ones.



    Thanks for providing some education on the topic. I'll stay with Java and learn to work with its current garbage collector, and I'll be more aware when creating references to objects that are crucial to be removed and freed up. I think my huge issue in that project of mine is that I was being extremely messy with my references.

    +1 for you.
    Posted in: Computer Science and Technology
  • 0

    posted a message on What most schools don't teach
    I really think that computer programming courses should work their way into schools more, but the idea that everyone should know it is a little ridiculous. Where I live, I'm having a lot of difficulties going further with computer programming, especially at my age. The introductory level courses that are offered around in American high schools are enough to introduce the concept, but students who are truly interested have nowhere to get taught but from themselves.

    I can get a huge amount of education in sciences, mathematics, and history, but why can't I learn about computer programming in my high schools? Even the schools that try to become extremely diversified still exclude technology.
    Posted in: Computer Science and Technology
  • 0

    posted a message on FTB server crashes, shuts down host comp in the process, Inventories lost on restart, and I can't figure out why.
    I know this may sound repetitive, but have you tried updating your Java version? A lot of less known Linux distros still use Java 6, while Java 7 is probably a good idea to upgrade to.

    However, if you're out of obvious solutions, the best idea to go to is to report it to the developers: http://www.minecraft...-redstone-v161/

    NPEs occurring at the server tick loop are most likely not an error that would occur because of a user mistake. But this:
    net.minecraftforge.event.ASMEventHandler_104_WRCoreEventHandler_onWorldSave_Save


    shows that the error is occurring on a world save. Because you're on a different OS, there could be an error specific to it. In this case, there's nothing you can do but report it to the developers.
    Posted in: Server Support and Administration
  • 0

    posted a message on What language next?
    I've spent a huge amount of time with Java. In fact, I regret not investigating other languages...

    To cut it short, I really dislike how memory is managed and disposed of in Java. I have to be wary of what the garbage collector will pick up and dispose of, and what it won't. I'm writing server software for a project of mine, and on top of the multi-threading and synchronization, the memory management is difficult. I have to make sure I dispose of every reference to an object so the memory can be freed, which becomes more irritating as I progress through this sluggish project. I'm dealing with an extremely annoying bug: the main client object will not be disposed of after a connection is closed. I'm finding myself re-structuring my application so the all the references are removed, causing the object to be removed.

    On top of my issues with Java, I need a native language.

    But I hear in other languages you can dispose of memory manually. C# seems rather appealing, and it looks very similar to Java. C++ seems a lot different, and I don't know what are the pros and cons are regarding it. I'm debating on whether to choose C++ or C# right now. My big requirement is to be able to handle memory more directly.

    I've done an enormous amount of work and study with Java, and I enjoy its syntax. I find myself comfortable creating large applications with Java, and I don't want a drastic change to my programming language that will leave me uncomfortable. Other programmers: what's a language that harnesses more power but isn't far from what the Java language is like?

    EDIT: Crap, accidentally posted in the wrong section. Could this be moved to Software Discussion & Support ?
    Posted in: Computer Science and Technology
  • 1

    posted a message on How to fix "Failed to Login:null"? Someone help please!
    This:
    2013-02-05 01:04:42 [WARNING] Failed to load operators list: java.io.FileNotFoundException: .\ops.txt (The system cannot find the file specified)
    2013-02-05 01:04:42 [WARNING] Failed to load white-list: java.io.FileNotFoundException: .\white-list.txt (The system cannot find the file specified)

    Is not healthy. Normally these are generated if they don't exit, so there could be something wrong with your file permissions. Make sure your server folder (and all of its subfolders) has read/write access.

    Now,
    2013-02-05 01:05:09 [SEVERE] java.io.IOException: Server returned HTTP response code: 503 for URL:


    HTTP Error 503 = Service unavailable

    If the login service is unavailable, you will have to wait or put your server into offline mode for now. There's nothing you can do to make the minecraft servers respond.
    Posted in: Server Support and Administration
  • 0

    posted a message on These sites are blocked?
    Hey guys, I just noticed that Google Chrome is blocking access to a few websites like planet minecraft and funnyjunk.com due to malaware suspisions. The google search engine itself (regardless of the browser) is also blocking access as well, giving this additional information about the sites:

    planetminecraft.com

    What is the current listing status for planetminecraft.com?
    Site is listed as suspicious - visiting this web site may harm your computer.
    Part of this site was listed for suspicious activity 31 time(s) over the past 90 days.
    
    What happened when Google visited this site?
    Of the 5532 pages we tested on the site over the past 90 days, 47 page(s) resulted in malicious software being downloaded and installed without user consent. The last time Google visited this site was on 2013-02-03, and the last time suspicious content was found on this site was on 2012-12-23.
    Malicious software includes 2 exploit(s). Successful infection resulted in an average of 5 new process(es) on the target machine.
    Malicious software is hosted on 3 domain(s), including tios.from-in.com/, erikss.dyndns-at-home.com/, rltk.us/.
    2 domain(s) appear to be functioning as intermediaries for distributing malware to visitors of this site, including gamerpublishing.com/, rltk.us/.
    This site was hosted on 44 network(s) including AS29791 (VOXEL), AS35908 (VPLSNET), AS32244 (LIQUID).
    
    Has this site acted as an intermediary resulting in further distribution of malware?
    Over the past 90 days, planetminecraft.com did not appear to function as an intermediary for the infection of any sites.
    
    Has this site hosted malware?
    No, this site has not hosted malicious software over the past 90 days.
    
    How did this happen?
    In some cases, third parties can add malicious code to legitimate sites, which would cause us to show the warning message.


    And funnyjunk.com:


    What is the current listing status for funnyjunk.com?
    Site is listed as suspicious - visiting this web site may harm your computer.
    Part of this site was listed for suspicious activity 17 time(s) over the past 90 days.
    
    What happened when Google visited this site?
    Of the 3460 pages we tested on the site over the past 90 days, 568 page(s) resulted in malicious software being downloaded and installed without user consent. The last time Google visited this site was on 2013-02-03, and the last time suspicious content was found on this site was on 2012-12-23.
    Malicious software includes 19 exploit(s), 1 trojan(s). Successful infection resulted in an average of 5 new process(es) on the target machine.
    Malicious software is hosted on 6 domain(s), including iicl.tk/, rltk.us/, erikss.dyndns-at-home.com/.
    1 domain(s) appear to be functioning as intermediaries for distributing malware to visitors of this site, including rltk.us/.
    This site was hosted on 2 network(s) including AS16265 (LEASEWEB), AS15169 (Google Internet Backbone).
    
    Has this site acted as an intermediary resulting in further distribution of malware?
    Over the past 90 days, funnyjunk.com did not appear to function as an intermediary for the infection of any sites.
    
    Has this site hosted malware?
    No, this site has not hosted malicious software over the past 90 days.
    
    How did this happen?
    In some cases, third parties can add malicious code to legitimate sites, which would cause us to show the warning message.


    The weird thing is that both these sites have the same addresses (rltk.us for example) that appear malicious.

    This occurred in the past hour or so.. does anyone know what's happening?
    Posted in: General Off Topic
  • To post a comment, please .