Jump to content

Epicblood

Member
  • Content count

    59
  • Joined

  • Last visited

3 Followers

About Epicblood

  • Birthday May 19

Profile Information

  • Gender
    Male

Recent Profile Visitors

662 profile views
  1. completed

    Bumpies Doesn't need to be fancy
  2. I don't :/
  3. Everything is multiplied because your SQL server has no idea what the relationship between those two tables is, so for each entry it gets from Stats, it adds on every entry of methods. What you want to do is give methods a structure like: user_id| user_hours |user_method 0| 5 | hacks 1| 10 | morehacks 2| 150 | nolife then do a join on the user_id so it matched them correctly.
  4. that would return something like this: 'GoldHacker', '5', 'hacks' 'RussianHacker', '5', 'hacks' 'Farmer', '5', 'hacks' 'GoldHacker', '10', 'morehacks' 'RussianHacker', '10', 'morehacks' 'Farmer', '10', 'morehacks' 'GoldHacker', '150', 'nolife' 'RussianHacker', '150', 'nolife' 'Farmer', '150', 'nolife' if you wanna run it yourself here is the test query I used:http://paste.epicblood.club/view/f8e868d3
  5. completed

    I like it, but the stroke around "Epicblood" is a bit much, maybe make it a bit less. Also the font/shading in CoderMan is a bit weird :/ would love if you could change those bits. Other than that is wonderful
  6. inactive

    you only do the second x6 if the number can appear more than once I believe, however that doesn't account for the last two having once less possible, and 4 of the digits are already known. so you have 0 - 9, with 5, 1, 7, and 0 already being taken, leaving you with six (6 * 4) + ( 5 * 2) = 24 + 10 = 34
  7. yep! you can definitely do that
  8. Good day class, Today I will be talking about the various maps in Java, and how/when to use them. Forgive me if I kinda ramble, just kinda making this up as I go. Before I get started, I recommend using an IDE such as IntelliJ IDEA Let's start with a Hashmap. These are the most common maps in java and imo the simplest/most versatile. you define a Hasmap like so: HashMap<Integer, String> myMap = new HashMap<Integer, String>(); So, what have we done here? We made an object, called it myMap, and told it the key is going to be an Integer, and the value is going to be a String. Now we can start using it like so: myMap.put(0, "Epicblood"); myMap.put(1, "iDeath"); myMap.put(2, "someOtherFag"); Cool, we added values.*Note: depending on how your key object (In this case String) implements hashcode() it may be possible to have duplicate keys We can do some cool things such as check to see if the map contains a certain key or value: myMap.containsKey(1); myMap.containsValue("Epicblood"); Both of these return the boolean `true`. We can iterate and loop through each key/value pair in the hashmap by doing this: for(Map.Entry pair : myMap.entrySet()){ System.out.println(pair.getValue() + " is awesome!"); } Remember that hashmaps are not ordered! They are sorted based on hashcode and are likely not even remotely in the order you place them in. Getting a Value stored at a Key is very simple; String myName = myMap.get(0); Note that 0 is not the index as it is with an array, it is the key! You can also get the size of a Hashmap by using the `size()` method. int mapSize = myMap.size(); If you want an ordered Hashmap (Hashmap that is in the order that you add ****), you will want to use a LinkedHashmap, it has all the same methods as a Hashmap, however is slightly slower. Now on to a TreeMap. A TreeMap is sorted by keys, and therefore whatever object you use as the key must implement the Comparable interface. Because of this, TreeMap cannot have duplicate Keys, and it is not ordered, however it's methods are the same as Hashmap and LinkedHashMap
  9. completed

    Hello, I'd like a cool Signature that matches me avatar : Render/Stock : None/pick whatever Text : Epicblood Subtext : CoderMan Color Scheme: Purple What Type of Request is This? : Signature Size : 500 x 200
  10. Alright class, today we will be learning about SQL Joins (que moans and groans). SQL Joins are something I myself only just learned about so bear with me here. Let's say you have two tables Players: user_id | user_name | ip_addr ----------|----------------|----------- 0 | "Epicblood" | 127.0.0.1 1 | "iDeath" | 72.65.12.56 2 | "someOtherFag | 85.254.23.46 and Kills: user_ded | user_kill | how -------------|------------|-------- 0 | 1 | "knife" 2 | 0 | "rpg" Now we want to find All kills involving player "Epicblood" how do this? simple really, you use a join (Hurray!!) First let me show you the final query: SELECT ded_guy, user_name AS murderer, how FROM( SELECT user_name AS ded_guy, user_kill, how FROM ( SELECT user_name, user_kill, how FROM Kills JOIN Players ON ( Kills.user_ded = Players.user_id ) ) AS ded_logs ) AS murder_logs JOIN Players ON ( user_kill = Players.user_id ) WHERE ded_guy = "Epicblood" OR user_name = "Epicblood"; Now this is a confusing query, no?let's break it down. First we are doing this: SELECT user_name, user_kill, how FROM Kills JOIN Players ON ( Kills.user_ded = Players.user_id ); This is just grabbing the row in `players` that have the `user_id` of `user_ded`, so this will return both tables more or less combined.then we basically filter that query, to only get the parts we want. SELECT user_name AS ded_guy, user_kill, how FROM ( SELECT user_name, user_kill, how FROM Kills JOIN Players ON ( Kills.user_ded = Players.user_id ) ) AS ded_logs This is saying I want to get the field `user_name` and name it `ded_guy`, I also want the fields `user_kill` and `how`.Now we have the username of the dead player in the column `ded_guy` and the user_id of the murderer in `user_kill`, all that's left is to get the username of the murderer: SELECT ded_guy, user_name AS murderer, how FROM( SELECT user_name AS ded_guy, user_kill, how FROM ( SELECT user_name, user_kill, how FROM Kills JOIN Players ON ( Kills.user_ded = Players.user_id ) ) AS ded_logs ) AS murder_logs JOIN Players ON ( user_kill = Players.user_id ) Here we are doing a JOIN, similar to the one we did earlier, but instead of using `user_ded`, we use `user_kill`. This is again going to return both tables, but we dont want all those values.so we name `user_name` `murderer`, and grab `ded_guy` and `how`. Lastly we want to filter it to only return kills involving `Epicblood` SELECT ded_guy, user_name AS murderer, how FROM( SELECT user_name AS ded_guy, user_kill, how FROM ( SELECT user_name, user_kill, how FROM Kills JOIN Players ON ( Kills.user_ded = Players.user_id ) ) AS ded_logs ) AS murder_logs JOIN Players ON ( user_kill = Players.user_id ) WHERE ded_guy = "Epicblood" OR user_name = "Epicblood"; Which we can do with a simple WHERE clause. This will return: ded_guy | murderer | how -------------|-----------|------ someOtherFag | Epicblood | rpg Epicblood | iDeath | knife
  11. anyone who has done java for over a month will agree with me it had to be said
  12. no, javascript is a scripting language for web although in this case it looks like NodeJS which is javascript running on the V8 engine so it can be used as server side code but still, not even a little bit related to java...
  13. but why? they aren't even slightly simliar... the only thing they have in common is that they both have java in the name.
  14. For the love of all that is good and holy, don't use netbeans. You will hate yourself and every moment using it feels like you are slicing your own wrists with a serrated blade. IntelliJ Idea is best IMO, eclipse second, notepad third, nano/vi fourth, pen/paper fifth, my own blood and a slab of rock sixth, then maybe netbeans seventh.
  15. This isn't java this isn't even remotely related to java java is not javascript javascript is not a derivative of java They are not even a little bit the same...
×