|
qntm posted:I don't know what java.util.Scanner is exactly but I'm guessing that sitting there apparently doing nothing while waiting for you to type something is exactly the correct behaviour for that program wow, yes. I dumbed dumb the code to make it easier to ask about and then ended up confusing the process hanging for the actual intended result jesus that was dumb but one more thing, right clicking the jar and saying open with Java Platform SE Binary really does do nothing! which is kind of annoying because the whole point of using the jar is to avoid starting it with that command anyway
|
# ? Feb 22, 2015 00:07 |
|
|
# ? May 13, 2024 07:25 |
|
qntm posted:I don't know what java.util.Scanner is exactly but I'm guessing that sitting there apparently doing nothing while waiting for you to type something is exactly the correct behaviour for that program Also this. The program should just echo input after you press enter each time. C'mon Valeyard, the first rule of "my program isn't doing what I expect it to" is to loving pepper it with print statements. and then wishing you had instead used a debugger
|
# ? Feb 22, 2015 00:08 |
|
Luigi Thirty posted:sadly that doesn't work with ~metrics~ gotta spit the game to change the metrics
|
# ? Feb 22, 2015 00:08 |
|
gently caress that's what I get for phone posting while waiting for the bus
|
# ? Feb 22, 2015 00:09 |
|
gonadic io posted:yeah but gaming metrics is still not about being a competent programmer lol like programmers would min/max anything like imagine if there was a career based on doing such things
|
# ? Feb 22, 2015 01:12 |
|
Space Whale posted:lol like programmers would min/max anything i became a programmer because my dream job of being a gold framer in wow was unavailable to me (since i'm not asian)
|
# ? Feb 22, 2015 01:19 |
|
valeyard i guess you're a beginner or whatever and this is the terrible programmer thread but did you even like, read your code and attempt to reason about it before posting it??
|
# ? Feb 22, 2015 01:29 |
|
rrrrrrrrrrrt posted:valeyard i guess you're a beginner or whatever and this is the terrible programmer thread but did you even like, read your code and attempt to reason about it before posting it?? valeyard is a bad poster for many reasons but i think he does his due diligence w/r/t posting in this thread
|
# ? Feb 22, 2015 01:31 |
|
i've only seen a few of his posts but it seems pretty clear that he is just not an intelligent man and i mean that objectively,not like an insult
|
# ? Feb 22, 2015 02:13 |
|
sorry. its a combination of being legit stupid sometimes and (very often) jumping to worse case and start shouting about stuff before realising whats really going on
|
# ? Feb 22, 2015 02:28 |
|
you should talk to your senpai instead of random people on computerfunny
|
# ? Feb 22, 2015 06:50 |
|
MeruFM posted:you should talk to your senpai instead of random people on computerfunny he's clearly frustrated that senpai doesn't pay enough attention to him
|
# ? Feb 22, 2015 07:01 |
|
Valeyard posted:
moral: although there are general purpose strategies for debugging things like this, (i.e put print statements in everywhere. put them in bits you think are running, see where the print statements stop happening, or delete some code, or exit early, throw a specific error, to see if the program gets that far) it is hard to know what a program is doing when you don't know what it is meant to be doing in the first place welcome to the terrible programmers thread
|
# ? Feb 22, 2015 07:44 |
|
jesus christ debuggers exist you don't have to write in print statements left and right
|
# ? Feb 22, 2015 07:47 |
|
Logger is good, use logger. you can turn it on and off without having to comment it out like printfs make a shortcut for code:
|
# ? Feb 22, 2015 08:03 |
|
fleshweasel posted:jesus christ debuggers exist you don't have to write in print statements left and right
|
# ? Feb 22, 2015 08:15 |
|
Barnyard Protein posted:
lmbo @ java
|
# ? Feb 22, 2015 12:17 |
|
Valeyard posted:but one more thing, right clicking the jar and saying open with Java Platform SE Binary really does do nothing! which is kind of annoying because the whole point of using the jar is to avoid starting it with that command anyway
|
# ? Feb 22, 2015 12:50 |
|
Soricidus posted:sounds like you're on windows. there are two Java binaries for windows, java.exe and javaw.exe. one of them is for console programs and the other is for gui programs. it sounds like you're using the wrong one, so try the other. maybe you could use a shortcut or batch file to launch it with the right one. it's this, the default jar association on windows is with the console application. write a batch script that invokes a new command window and runs your jar then waits for you to close it alternately you can write a little gui code to create a UI and attach i/o to that
|
# ? Feb 22, 2015 15:12 |
|
Soricidus posted:sounds like you're on windows. there are two Java binaries for windows, java.exe and javaw.exe. one of them is for console programs and the other is for gui programs. it sounds like you're using the wrong one, so try the other. maybe you could use a shortcut or batch file to launch it with the right one. lol windows
|
# ? Feb 22, 2015 15:42 |
|
code:
|
# ? Feb 22, 2015 18:47 |
|
getloggerlogger getlogger
|
# ? Feb 22, 2015 19:23 |
|
Barnyard Protein posted:Logger is good, use logger. you can turn it on and off without having to comment it out like printfs this is the kind of garbage that makes pragmatic programmers look at java and say "you are dumb horseshit created to inflate LOC and source sizes" hth
|
# ? Feb 22, 2015 20:38 |
|
Jonny 290 posted:this is the kind of garbage that makes pragmatic programmers look at java and say "you are dumb horseshit created to inflate LOC and source sizes" hth what you can't see from all them words is that it only takes typing 'logger' then pressing Alt+Enter to make that if you write java/C# in gedit, well, that's your problem
|
# ? Feb 22, 2015 20:44 |
|
also lol at a guy who only writes in p-langs calling himself 'pragmatic'
|
# ? Feb 22, 2015 20:46 |
|
why use the class name when you can use the class object itself thoughcode:
|
# ? Feb 22, 2015 20:48 |
|
Brain Candy posted:also lol at a guy who only writes in p-langs calling himself 'pragmatic' oh ho let me get wound up and defend myself here! lol eat rear end
|
# ? Feb 22, 2015 20:48 |
|
hide this somewhere and assume no one will noticecode:
|
# ? Feb 22, 2015 21:04 |
|
are you sure that's expensive enough?
|
# ? Feb 22, 2015 21:08 |
|
Jonny 290 posted:this is the kind of garbage that makes pragmatic programmers look at java and say "you are dumb horseshit created to inflate LOC and source sizes" hth lol at caring about source code size ityool 2015
|
# ? Feb 22, 2015 21:12 |
|
rrrrrrrrrrrt posted:why use the class name when you can use the class object itself though older versions of log4j only took a string argument
|
# ? Feb 22, 2015 21:14 |
|
Subjunctive posted:are you sure that's expensive enough? adding an extra line and member to every class in the system to optimize performance is pretty expensive in its own way, and it would be pretty trivial to selectively reverse if performance actually became an issue i don't really suggest that though, clearly the correct solution is to write an Instrumentation agent which injects bytecode into the Object class to add a logger member and construction to its constructor: no performance hit, no clutter!
|
# ? Feb 22, 2015 21:16 |
|
Jonny 290 posted:oh ho let me get wound up and defend myself here! or you could stop saying dumb poo poo that betrays your limited experience bit of irony coming from me, but hey
|
# ? Feb 22, 2015 21:18 |
|
rear end eating's still on the table tho
|
# ? Feb 22, 2015 21:20 |
|
txt me
|
# ? Feb 22, 2015 21:25 |
|
Jonny 290 posted:this is the kind of garbage that makes pragmatic programmers look at java and say "you are dumb horseshit created to inflate LOC and source sizes" hth yeah but honestly who gives a poo poo because 90% of it gets autocompleted and you can tell instantly what it's supposed to do when you look at it
|
# ? Feb 22, 2015 21:53 |
|
Luigi Thirty posted:yeah i know i'm fine but it's my first actual computer job (even if it's glorified computer janitoring) and i don't want to mess it up! from what i read they want you to work at an impossibly fast pace and throw you out on your rear end in 6 months if you can't. its awesome how you have only been at this for a short time yet you sound like a seasoned pro now
|
# ? Feb 22, 2015 21:58 |
|
Blinkz0rz posted:yeah but honestly who gives a poo poo because 90% of it gets autocompleted and you can tell instantly what it's supposed to do when you look at it entirely meaningless clutter carrying the possibility that one of the 30,000 copies of the line is wrong somewhere (one obvious case being that the wrong class is sent and things don't get filtered as expected)
|
# ? Feb 22, 2015 22:05 |
|
i just annotate my classes with @Log
|
# ? Feb 22, 2015 22:09 |
|
|
# ? May 13, 2024 07:25 |
|
Cybernetic Vermin posted:entirely meaningless clutter carrying the possibility that one of the 30,000 copies of the line is wrong somewhere (one obvious case being that the wrong class is sent and things don't get filtered as expected) you could do this to avoid the wrong class thing code:
|
# ? Feb 22, 2015 22:09 |