Recent content by Adyssa

  1. A

    Enrollment in C programming course

    There's a good C tutorial here you might want to look at, to get warmed up a bit. http://c.learncodethehardway.org/ I would recommend you do it with Cygwin (in Windows) or a Linux virtual machine so you don't have to deal with Windows and can use the standard tools (gcc, gdb, valgrind, make)...
  2. A

    Best way to start making a website?

    Java and servlets in general are quite separate from HTML and CSS. They serve up HTML and CSS to a requesting client. So you can make your front end, in HTML and CSS, however you want. Where servlets come in handy, is when you want to process a request differently each time.So if you have a...
  3. A

    Using a length() function in a loop's condition

    It's still good to notice these things I think. This one is quite trivial, but they aren't all trivial and the more you spot them the more you spot them.
  4. A

    Best way to start making a website?

    It depends whether you want to build a static website or a dynamic website (with a database behind it). A static website only requires HTML/CSS and perhaps some JavaScript if you want to make it a bit fancy/flashy. If you are building a dynamic website that has lots of content sitting in a...
  5. A

    Java How do I iterate and enter values from a mapped entrySet into an array?

    You are printing out the whole set in your for loop, don't you want to look at each item? Like this: Set<Map.Entry<String,JsonElement>> mySet = jsonObject.entrySet(); System.out.println("mySet as 'key : value'"); for(Map.Entry<String,JsonElement> singleItem : mySet) {...
  6. A

    Java What is the Best Way to Decode a JSON Object in Java?

    I made it a bit more readable: {"columnGridContainer":"[[1,\"1\",\"bridge_routine_link\",\"Y\",\"Y\",\"100\",\"CENTER\",\"Cheese\",\"\",\"\",\"\",\"LEFT\",\"LEFT\",\"LEFT\",\"LEFT\",\"\",\"0\",\"string\",\"string\",\"\"]]", "header_row_2_enabled":"N", "header_row_3_enabled":"N"...
  7. A

    Java How to Change Default Comment Block in Java with NetBeans 7.4

    Go to Tools > Templates > Java > Java Class, and click the "Open In Editor" button at the bottom. It looks like the template is written with Freemarker or something similar, but you should be able to work from what's there. I think that's what you're after.
  8. A

    PHP My php code skips a user request please look inside

    $user[0] is array notation for the first (0th) element of an array (and a 'string' of characters can be thought of, and accessed, as a character array). The start of the string you received from the input is the first character they typed (and remember, a newline '\n' character is appended to...
  9. A

    Why cant I create 1 million threads?

    The pid of a process is just an incrementing integer, I get pid's of 20000 or so fairly often, but most of the processes that had lower pid's are long gone. I guess the OS just keeps incrementing until it's safe to start again at some lower number.
  10. A

    PHP My php code skips a user request please look inside

    Be VERY careful with fgetc and fgets, for reasons already mentioned (the consumption, or non-consumption of the newline '\n' character. I'm not sure if PHP has the concept of buffer overflow, but if it does, you should watch out for that too (someone enters an essay instead of the small number...
  11. A

    Java Coding in Java - replacement for a global variable

    Indeed. Like this: class DatabaseClass { private static DatabaseClass databaseInstance = null; private DatabaseClass() { } public static DatabaseClass getInstance() { if(databaseInstance == null) { databaseInstance = new DatabaseClass(); } return...
  12. A

    Java Coding in Java - replacement for a global variable

    I'm not the greatest OO designer, but in this situation I just make a database class that handles it all, with a runQuery(myQuery) method that returns the query results to me in list. When another class needs database, I instantiate the database class and call runQuery(myQuery).
  13. A

    Simple Big O analysis question

    I was under the impression that you could ignore constant factors, and lesser terms when deducing the Big O of a function. So 2n^2 => O(n^2). Or 5n^3 + 8000000000n^2 + 4612876198274194109438109284n + 8 => O(n^3). When you reach large values of n, the n^3 term eclipses the other terms.
  14. A

    Java Can This Java Code Generate Dynamic Game Environments?

    I'm not sure what's going on here, it's only a small portion of the code, and some of the logic makes no sense at all to me. It's pretty difficult to decipher code without seeing it all. What is the TiledLayer class? What's with calling methods on an int primitive: paramInt.setCell(j, k...
  15. A

    Java Can This Java Code Generate Dynamic Game Environments?

    You will have to spend some time to learn the Java language, or at least some programming language before someone can explain this to you. Do you recognise any of the constructs? Do you know what an object is? A function? An array? With some basic knowledge, you can decipher this yourself...
Back
Top