« first day (1679 days earlier)      last day (3262 days later) » 
02:00 - 13:0013:00 - 00:00

1:00 PM
Aww, no SysRq binding for LOCK unless you're in XLATE
 
I'm struggeling with a bad error:
I created a List<Obj> and want to add an obj to it, but get a NPE
I declared List<Obj> = null; at beginning because it prints errors if I don't initilize it.
If I put the add driectly under the declaring of the List, this don't produce a NPE, but I get errors where I want to fetch data from the list (whch works if I declare the list on top of the class)
 
wat..
please please please don't initialize with null
 
@Zorian You can't just create a list without assigning a List into it before using it.
 
it's such a pain..
 
yeah i know
 
1:02 PM
List<Obj> foo = null; // foo is null
foo.add // dereferences a null pointer
@Zorian Then don't do it.
 
Word
 
but if i try to initialize with List it prints errors
 
@Zorian How are you trying to initialize it?
 
List<Obj> list = new List<Obj>
 
ya... this is not C#
List is an interface
 
1:04 PM
@Zorian yo List is an interface, you can't call new on it
 
you need to instantiate a class that implements that interface..
List<Obj> list = new ArrayList<>();
^ should be working., (needs java 7)
 
List<Obj> list = new ArrayList<>();
List<Obj> list2 = new LinkedList<>();
// ...
 
^ [possible duplicate]
 
was just about to criticise the missing parens
 
@Vogel612 I blame my keyboard cat.
 
1:05 PM
I haven't declared which list I use because in the rest of the program, i don't need to initilze the list and it works
 
@Zorian "in the rest of the program, i don't need to initilze the list and it works" - Then don't use a list. Get rid of it.
 
i have to use it
-.-"
 
No you don't, you just said you didn't need to.
 
There is no contradictions in logic.
if there is: check your premises
 
@Zorian the initialization is the only place where you need the exact type. Elsewhere in the program you can (and should), keep using it by the interface
 
1:08 PM
yeah but it's confusing that in one class it works and in another not
 
omg coffeescript is quite awesome ^^
@Zorian You're using it wrong.
 
basically new requires to be given a type, so that it know which class object is created
 
hm
 
@kiheru interface types are not allowed to have constructors, that's it. End of story. :p
 
How otherwise could it work?
 
1:10 PM
other thought, whats the default list, that is used when i call the interface list?
 
@Zorian There is no default list.
 
there's no default list
 
We just showed you ArrayList and LinkedList. Look up other implementations.
 
yeah but let give me a short example why i'm confused
 
3 mins ago, by Unihedron
@Zorian You're using it wrong.
Design your class over again.
 
1:11 PM
scratch that one..
but... ya...
 
> For a given 2D vector described by cartesian coordinates of its initial point and terminal point in the following format: [[x1, y1], [x2, y2]], your function must return this vector's length presented as a float.
Ok, wth is a "vector length"?
maths sucks
 
@Unihedron the result of applying the pythagorean calculation over the deltas for the respective coordinates
 
ohhhh
awesome
 
public List<obj> test (List<obj2> obj2)
List<obj> objL;
return objL;
this works but not if I try: objL.add(obj);
 
1:13 PM
@Zorian when you have a List<Object> foos;, and call a method of that, the corresponding method of the relevant list implementation is called. You don't need to care at that point which implementation that is
 
@Zorian "this works" -> no it doesn't
You returned null, that's all./
 
sure
 
@Unihedron well.. it doesn't blow up..
so there's that.
 
I do some operations to populate that objL
 
@Vogel612 That's not what defines "works".
 
1:14 PM
@Zorian no you don't
that's a misconception.
 
The expected behaviour is, as previously mentioned, to create a list to be populated.
 
in that example not, but thats a lot of code
 
what you're actually doing is:
 
top of the mornin to you all
 
> Unfortunately you tend to be rather absent minded because most nights you stay up late playing video games and coding.
 
1:15 PM
public List<Obj> test (List<Obj2> obj2) {
     List<Obj> list /*= null */;
     return list; /* return null;*/
}
 
lol, that's a brilliant description :)
@Vogel612 /* */
 
ya...
 
I'm going to shower, then try my luck on another tourney
 
uni it will remove the fungus of luck
 
I populate that list with data from a database therough sql
so it doesN't return null
 
1:18 PM
So it's back to the original issue: you need to initialize the list, and for that you need to use the concrete type. The declaration can still use List, but object creation needs the implementation
 
I tried Arraylist and the others: gives me error to chose other list and if I chose, i should choose another and so on
 
The runtime won't try to guess which list you want. Java does not follow the philosophy "when the code makes no sense, guess", like some other languages
"gives me error" <- please be more specific. List<Foo> foo = new ArrayList<>(); should work in Java >= 7 provided the type Foo is defined and both List and ArrayList have been imported.
(if the code needs to be compiled with older Java, then the <> operator can't be used, and the type parameter must be written explicitly: new ArrayList<Foo>())
 
Or you can use rawtyped new ArrayList(); if you're on Java <5
 
@deadlydragon00 Omg hahahah. Hilariously gross
 
@deadlydragon00 I'd rather ditch luck for my own condition :)
 
1:34 PM
Does anybody know if the @Produces method works in a abstract class?
or should work?
 
@Erates What framework is that from again?
 
CDI
 
@Unihedron that's CDI...
@Erates why wouldn't it?
 
cause it doesn't :D
 
brrr, raw types
 
1:35 PM
lol I just had a mind backlog
 
And at this point, I'm not sure if I'm doing something wrong, or if there's a bug in CDI
 
@kiheru using rawtypes in java>=5 is just wrong
 
so I have an abstract class that has 2 producers
then I have a @Singleton that extends that abstract class, and adds one more producer
not the producers from the abstract class can't be found
now*
 
short update
-.-" I'm idiot, got 2 misstypings in the code of that class (400 lines of code)
I should stop and do other things.... self code blindness
 
1:45 PM
...
 
but thank you anyways for your help
 
use an ide that helps with that
syntax coloring, content assist, etc
 
if you're coding for at least 8h thats the result
 
Tell me more about it, sometimes my sessions lasts over 12 hours
 
yeah but if you've got several variables caused by style convention named both identicaly with only 1 or 2 chars differnet, the ide wnt help
 
1:47 PM
That must be a set of really bad conventions
 
but i think you're a better coder than me xD
yeah -.-"
 
No way, I suck at coding :)
 
You should clean up your variable names and use things like "thisVariableSucks" "thisVariableSucksLess" "iReallyHateThisVariable"
 
I highly doubt that helps
 
rofl#
 
1:48 PM
I just simplify my designs to use streamlining and linear implementations; whenever something gets cyclomatically complex soon, I break it modular in time
That helps with reducing the amount of global / clustered variables.
 
sometimes it really helps to use "int floot" or "int striing"
 
Yeah, if you're drunk.
Debugging that will be fun.
 
that are e.g. for sets to use a little s after a variable like class and classs or Strings to be named with st in front and class name and if you need more it ends in stclass, st1class etc
 
hahahaha
 
I want to do this instead of a null pointer exception in a java method
return new ResponseEntity<String>(HttpStatus.BAD_REQUEST);
but my method returns an int not a string
What can I do?
 
1:51 PM
This is clever...
@apkisbossin Return an int.
 
The client is shrouded in darkness
 
Or, alternatively, throw new IllegalArgumentException(arg + "is not a valid argument; positive value expected");
 
Interesting
 
@Unihedron sometimes I feel so -.-" xP
 
@Zorian I took on someones code who had variables names like this: "xxyz, xxxyz, xyzz, xyyz, xxyyz, xxxyyzz, xyzxz, etc" lol fricken' idiot
 
1:54 PM
@Dustiny Want my advice?
 
My boss didn't let me install a debugger on the super computer either... ugh lol
This was a few years ago, but sure lol
 
Find out the name of the coder who developed that. Perform a voodoo ritual.
 
@Dustiny I know that and by some these are there super good conventions -.-"
 
haha I probably could have figured it out, he developed his PhD on that code... -.-
 
...
wait, seriously?
DON'T DEPLOY ACADEMIC CODE AS BUSINESS CODE!!!!!1!
 
1:56 PM
it was molecular dynamic simulations lol.. so the equations were things like "xxxyz^2 + xyzz^3 * xyzz^yzx" GAH
 
yo wot xD
 
then there were like 10 different equations with variations of that, and the major bug was he mixed up "xxyz" and "xyyz" lmao
 
Is there an equivalent of with () in Java?
In several other languages you can use:
 
as if molecular dynamics equations were not error prone enough without obscure variables
 
@Unihedron It was a research position at the university, so I was just improving his academic code
 
1:57 PM
@Unihedron That outputed the message but didnt return a 400 status code, it return a 500 still
 
with ("hello") {
  console.log(length, split("")); // 5 h, e, l, l, o
}
@apkisbossin What container are you using?
 
@kiheru Lol exactly. I guess he figured actually documenting the direction of the forces interacting on each particle would make it useful
 
afaik there's no with () equivalent
 
Java EE server?
I am building a web service
 
2:03 PM
Maybe this is a good question for stack exchange
 
@Vogel612 Oh them 90's feels! (sidenote the comment thread on the first comment is so painful to read) haha
 
Muahahahaha
Well played
Now I must listen to boys don't cry
 
2:26 PM
Thank Satan it's friday
 
why satan?
.5h left till weekend..
 
1.5h here
 
7h here... (T-T)
@Vogel612 Just felt like running against the grain on that one
 
> viewed
7410 times
I swear if that question gives me a gold badge for the views I will throw it into a fire.
 
Which question? Is that the ants in the keyboard one lol
 
2:30 PM
...yes]
 
So the question is.. are you going to throw the question into a fire, or the keyboard?
 
that would get rid of the ants
 
Yeah definitely. You could shoot the keyboard into space as well
 
@Dustiny the badge
 
2:36 PM
wth
why
even
 
You can throw your virtual badge into 8 hours of virtual fire
 
@Dustiny well with my monitors, the heat is actually realistic...
 
\o/
I need someone to turn this ^ into an 8 hour version
 
@Vogel612 That's good for some winter coding sessions
 
2:40 PM
@Vogel612 Yay, this site has the set start-stop feature!
 
yes.. use it wisely, young padawan
 
ok you can totally predict what I'll be using it for in the next two weeks
 
Listening to a virtual fire for two weeks instead of 8 hours?
Now that I think about it, it's probably to listen to this for the rest of your life on repeat
 
Nah I'm good on enough audio for two weeks.
 
fresh pots?
 
3:07 PM
Coffee = nectar of the gods
 
3:30 PM
@Gem
Hows your Friday going?
 
fge
<-- yet again surprised by the language
Yay
It never ceases to amaze me :/
 
by "the" I am assuming you mean Java
?
 
fge
No
The language I parse at work
 
Ah, I am not familiar with your work, which language is that?
 
@Dustiny a bad one that makes fge constantly rant about :S
 
3:38 PM
Yeah I've seen him ranting on here a bunch but not sure which! Enlighten me, so I can avoid it indefinitely
 
@Dustiny Going just fine ^^
 
http://www.commitstrip.com/en/2015/05/29/always-stuck-somewhere-in-my-head/
CommitStrip - Blog relating the daily life of web agencies developers
Always stuck somewhere in my head
CommitStrip
1432913790
 
cc @Vogel612 ._."
 
@Gemtastic Good! I'm suck writing documents for the next 5.5 hours so I'm trying to find entertainment.. suggestions? lol
 
@Unihedron XD
@Dustiny I was doing that too today XD
 
3:41 PM
@Dustiny Chess.
 
Docs for my Google scripts :P
 
Hmm chess does sound like it would be a worth while waste of my time lol
@Unihedron I always wondered why there were so many french comments on that comic until now, the english is unusually poor on that comix
 
@Dustiny it is translated from french
 
Usually its translated a lot better than that lol
Alright wheres a good chess that I won't get caught playing lol
@Uni I see you posted on this
52
Q: How to cope with complaints from tutors who want to fight cheaters?

Thorsten S.One tutor complains here (the answer is deleted now): how to solve Exception in thread "main" java.lang.ArithmeticException: / by zero? This post contains solution code to one or more of our homework assignments here at University of [redacted]. It is indexed by Google, which enables student...

 
@Dustiny It's not like I don't participate on Meta.
 
3:47 PM
Reminds me of the time I stole an assignment in my beginners Java class from the Prof. himself and he somehow didn't notice
 
:P
 
@Unihedron Don't get sassy with me!
For some reason I get lost in meta sometimes. I find it the ultimate time waster lol
 
4:06 PM
I have some time to kill before I reach home
 
4:16 PM
does java have any support for conditional compilation? i'm pretty sure i've come across annotations before that were something like "if jre version is gte 5" but i can't find anything...
 
@WoodrowBarlow No.
 
sad. :(
 
Java is supposed to be infinitely forward compatible, so there's that.
 
maybe that was a buildtools thing? like maven or ant or something?
 
Just deploy multiple versions of jars. The client gets to pick which one they need to cope with dependencies.
 
4:18 PM
i'm more thinking about version control. i don't want separate repos for each variant of my library, because most of the code will be the same.
and i want to ship a version that's java 1.4 compatible and a different version that uses modern design methodologies that are only afforded by java 1.8 features.
in C, it would just be a matter of #ifdef and adding some custom targets to your main makefile.
 
@ItachiUchiha Did you ever frequency killsometime.com back in the day? lol brings back some memories of early internet time wasting
 
@WoodrowBarlow You do realize "modern design methologies" aren't something you can steal a line from and switch it into like a lambda form.
 
i know, but i'd only be changing my front-facing classes.
 
You'd scrap several type objects entirely to cope it with the new language features.
@WoodrowBarlow Just deploy two jars then.
One for 1.4+, one for 1.8+.
 
5:16 PM
hi
 
o/
 
o/ ;)
In all honesty o/ reminds me more of nazi's then of waving
o/` is kind of more of a wave
a limp-hand wave
 
5:42 PM
@Dustiny it should be \o for nazis.
the right hand is used...
 
...
I thought o/ initiates a greeting and the other guy waves \o in the other way
o/ \o <- see
 
@Vogel612 Good point I didn't really think of that. I guess I just see a straight arm in the air and I think nazi
 
6:07 PM
Massively under-utilizing my degree writing engineering documents..gah
 
6:23 PM
Also I think listening to dirt nasty at work is probably frowned upon. Should probably turn this off lol
 
6:40 PM
@Dustiny you're a pretty cool guy, keep on being awesome
Finally my prayers have been answered
 
Can anyone please answer to this question
http://stackoverflow.com/questions/30445611/unable-to-download-and-save-images-using-picasso?noredirect=1
 
7:30 PM
Uni der?
@Aqarain android is not java..
 
7:42 PM
Hello. I am using Deflater in JDK8. It looks like Deflater#finished() always returns false. Even when returned output size is 0.
Am I misreading JavaDoc or something is going wrong?
http://docs.oracle.com/javase/7/docs/api/java/util/zip/Deflater.html#finished%28%29
 
show code ...
 
Deflater deflater = new Deflater();
ByteArrayOutputStream baos = new ByteArrayOutputStream(512);
byte[] buffer = new byte[512];
deflater.setInput(args.checkByteArray(0));
while(!deflater.finished()) {
  int n = deflater.deflate(buffer);
  baos.write(buffer, 0, n);
}
deflater.end();
args.checkByteArray(0) returns byte[]
and while is endlessly stuck with n being 0
 
posted on May 29, 2015 by Grace Note

Closing Statistics Now Available for Moderators and 10k Users Statistics on closing on your site can now be found as part of the 10k tools. You can find these either by heading to /tools/question-close-stats. Alternatively, you can find them from “question close stats” found in the links section at the bottom of the Close view […]

 
/javadoc Deflater#deflate(byte[])
 
@Vogel612 int deflate(byte[] b): Compresses the input data and fills specified buffer with compressed data. Returns actual number of bytes of compressed data. A return value of 0 indicates that needsInput should be called in order to determine if more input data is required. (1/2)
 
7:48 PM
> A return value of 0 indicates that needsInput should be called in order to determine if more input data is required.
 
Thanks for that.
 
 
2 hours later…
10:13 PM
~JavaBot at your service
 
**help tell
 
@Vogel612 Syntax: tell [username] [command invocation / message]
 
11:18 PM
well... enough for today.
sleep well, Junior:
**shutdown
 
~going down
 
02:00 - 13:0013:00 - 00:00

« first day (1679 days earlier)      last day (3262 days later) »