« first day (1592 days earlier)      last day (3357 days later) » 

7:30 PM
Cheers guys, it was a good one :)
 
Cheers :D
 
:D
 
@Gemtastic you said you had different questions?
 
@SecondRikudo I have ton of questions regarding SQL still
 
7:46 PM
@Gemtastic Fire away, I'll do my best
(And if I can't, fge will likely help you :P)
 
<--- Busy watching Zankyou no Terror
 
@ItachiUchiha Awww yisss
Where are you now? :P
 
Sphinx 1 has just turned him in to the police
 
8:24 PM
@sec So there will be no season 2 for the same?
 
8:36 PM
Sorry, I went showering
 
@Gemtastic It's okay
I'm just heading for the shower as well
But ask your questions and I'll answer them when I'm back
 
I'll need more time to formulate tham; I don't even know where to begin!
 
hello
I had a quick question about how to appropriately handle variable initialization to be rid of compiler warnings. If you have something like:

String s = null;
try
{
s = SomeFunctionThatThrows();
}
catch (Exception e) {}

if (s.indexOf(":")) { .... }

you seem to get stuck in a sorta catch 22 with the compiler. If you dont initialize the variable to null, its a strait up compile time error. If you initialize it to null, you get a dereferencing potential null warning... and if you assign it a string constant it complains that youre not using the value.
whats a good way to do this correctly
 
the question is: why are you trying to continue after catching the exception? that obviously only happens in situations when you should not continue
 
well thats not exactly what I have in code
its just an example
I have a hard coded string literal for a text encoding
which is used everywhere
I need to get the bytes from a string, that method throws an UnsupportedEncoding exception
which should never happen
but thats how I ended up in this position
its pretty much all because I use a string literal to specify the encoding im using on my strings when getting the bytes... but that method throws an exception, which means I have to wrap it in a try or throw
I dotn wanna throw so I use the try, which makes me initialize my variable to null
 
8:52 PM
I'd throw an appropriate runtime exception in the catch block - it's a "should not happen" situation, so you can have a "die" clause there
 
hum
how does that solve the compiler warning?
right now I just ignore the exception
I guess thats an exit
the compiler should detect that
 
by not initializing s before the try block. the compiler won't complain about unitialized vaue, since there are no paths that result in that
 
and not complain about a potential null
ill try it
thx kiheru
 
Not sure which would be the most appropriate exception. IllegalStateException came first to mind, but there may be better ones
(I prefer exceptions to System.exit(), for the stack trace. It's nice to know at least where the corrupted program state was noticed)
 
right
it would be really really screwed up if someone hard coded an unsupported encoding because A the hardware this communicates with only uses ASCII, and second... they would have to never so much as start the app to miss getting the exception in testing
lol
 
 
2 hours later…
10:53 PM
Well, in all fairness, Java makes plenty of people cry. — Sterling Archer 2 mins ago
 
=about
 
OakBot v0.0.2 by Michael | source code | built: About 3 days ago. | started up: About 3 days ago.
 
@SecondRikudo I was planning on waiting until Saturday (one week) to end the election.
 
@Michael It's pretty obvious who won, but, your call :P
 
Well, it is still pretty close.
 
11:12 PM
@Michael: so soon? :P
 
@Unihedro Do you think I should end it now?
 
no
I was expecting Wednesday, just two days before the messages are automatically unpinned
 
Oh, I didn't know why automatically unpin themselves.
Wednesday is fine by me.
 
11:36 PM
@Michael Takes 2 weeks for that
 
I don't mind when the election ends. I just want to be fair.
 

« first day (1592 days earlier)      last day (3357 days later) »