« first day (1649 days earlier)      last day (3297 days later) » 

11:01 AM
Hi could anyone help me understand this Java problem:
When type is not specified for a generic type, Object is assumed.
 
... that's not a problem, that's a statement that defines how Java works
what exactly are you asking about?
 
So: List l = new ArrayList<Integer>() would imply List<Object> = new ArrayList<Integer>() internally
why then I can't write List<Object> = new ArrayList<Integer>()?
 
@deadlydragon00 hey Shallow
 
@KshitizSharma not really
When you don't define a type, like this: List list = new ArrayList(); You get a rawtype List, not a List<Object>
 
fge
@KshitizSharma that is wrong
 
11:05 AM
But doesn't it internally use Object where ever T is used?
 
@KshitizSharma no
Generics works because types are erased. Consider T an erasure of #0-capture-of-Object.
When T isn't specified (rawtyped), it is #0-capture-of-(nothing)
 
But it needs to translate into some type of reference eventually. class Kshitiz<T> { private T var; } would need T to be a class/interface reference of some type.
 
@KshitizSharma No.
I repeat: Generics works because types are erased.
In the end, <T> of T becomes, well, capture-of-Object in language syntax, and its type abstraction is erased when the code actually runs.
<T extends Vehicle> of T would be capture-of-Vehicle, but when the code runs it doesn't care if it's an Object or a Vehicle even, because type erasure kicks in and is how generics in Java works.
Note that this is why Java generics are pretty broken in that aspect.
I'll give you an example:
10
Q: How exactly do Generics work?

WiErD0While looking up (testing) information for another question, I came across something and had completely no clue why it was happening. Now, I know that there is no practical reason to do this, and that this is absolutely horrific code, but why is it that this works: ArrayList<Quod> test=new Array...

 
Hi All
I need help
Do have any idea about CRM>
?
 
Just bear in mind that rawtypes are wrong. Not that they really are because it works, but hey, just don't use it.
 
11:11 AM
Is CRM available in JAVA code?
 
@Zealous This room is for discussion related to the Java programming language. JAVA talk belongs somewhere else, sorry.
 
fge
Meh
What is CRM?
 
@Unihedron i knew it.
 
Hi everybody.
 
It's you again! Hello, hello!
 
100 lines are too few to be worth a joke :p
 
yes, Generate Getter and Setter are enough
 
@Unihedron This is way over my head. I should read some more documentation. Thank you for your help. :-)
 
@KshitizSharma Oh, I didn't realize you were a learner. Was "capture" too behind the hood for you?
 
@Unihedron, do you know where I can ask software questions on stackoverflow?
 
11:18 AM
To make it simple, Generics in Java works by not caring about its types at all - while in syntax it's enforced that dimensions are Object and push/pull are respectively what you specify T as, rawtypes (when you don't specify it) it's represented as Object - not that they really are.
@Goldbones ya kant iz not wat dis is 4
^^^ go there
take their tour first
 
@Zealous CRM as in ... "Customer Relationship Management"? as in "Business Software"?
 
Don't ask about...

Anything not directly related to computer software or computer hardware
Not what I want
 
What do you mean by "software questions" then?
 
I will explain what I want. I did a lot of webMethods. Each weabMethod has his own logic implementation. I dont want to use Javadoc. I want to create a notepadfile(or other format for each webmethod) to explain how i did that like - go to this page, introduce parameter a,b, introduce this query.... So, I want a professional software to help with this
 
too broad, won't fit anywhere on Stack Exchange
 
11:26 AM
@Unihedron might be okay for Software Recommendations
 
@Vogel612 software recs has high barriers
 
sure it has, but it's the best bet....
> Good software recommendation requests have two components:

A purpose — a task to accomplish, a user story
Some objective requirements — a minimum set of features
44
Q: What is required for a question to contain "enough information"?

FlykThis is the question edition of What is required for an answer to be high quality? One of the key problems that I see Software Recommendations having, is people asking extremely vague and simple questions that ultimately boil down to one of the two close reasons we see on the rest of the network...

 
@Goldbones I wouldn't dance if I were you. I don't write 100 lines of code without writing tests for them first.
Otherwise "works" is subjective :P
 
hey @Sword
 
yes, i will try that
 
11:29 AM
hiya @deadlydragon00
 
What are your opinion about stackoverflow nowadays?
 
hi @Unihedron
beep beep
 
@MadaraUchiha, I prefer to test code that is working
 
@Goldbones wth
why write tests then, it already works
Tests that helps you are the tests that you write before the code.
 
@Unihedron to make sure it doesn't break in the future or more likely detect future breakage
 
11:33 AM
@Nisk if your code can break over time you're already doing it wrong ;)
 
@Unihedron are you...fucking serious
 
@Nisk YES
Have you seen ANY library depend on Date.now()?!
 
@deadlydragon00 this might interest you..
 
@Unihedron have you ever worked with multiple people on one project?
 
@Sword new acc?
 
11:34 AM
@Nisk Yes. Have you? I hope by multiple people you mean multiple programmers who write sane code.
 
@Unihedron yes...
 
:D
 
@deadlydragon00 same account , dated 18th September.
 
:D so thath you then
 
7 months back..
see the difference..??
 
11:36 AM
@Unihedron great majority of programmers do not fit that criteria. You might as well say fuck testing, by that definition.
 
totally differ
 
@Nisk Just because incompetent programmers are incompetent doesn't change what tools for development are tools for development.
Wasting time hammering nails that are already in is an antipattern.
This is an awesome metaphor. I should write it down.
 
@Unihedron do you even have a point, or do you just want to argue?
 
6 mins ago, by Unihedron
Tests that helps you are the tests that you write before the code.
I'm surprised by your inability to read what I throw at you.
 
@Goldbones Tests don't verify your code works
 
11:39 AM
@Unihedron that's rendered irrelevant by your claim about programmers being " programmers who write sane code."
 
@Sword I'cant post mine :( J an-25-2015
 
@Unihedron, I don´t have skills to do this, but it´s the right way to do
 
They verify your code reliably behaves as you expect under known conditions
 
@deadlydragon00 why?
 
It is on my IPAD and I dont have the rep to post pic
 
11:40 AM
@Nisk That's rendered irrelevant by your claim of coding with multiple people important, because that's poorly defined.
 
@Nisk ehhhhm... no
 
Also, look in my github and bitbucket profiles if you really care.
 
Look at my REP its 99 -9 a reverse "ILUMINATE" XD
 
@deadlydragon00 case lost...
 
lol ^^
 
11:41 AM
so sad. use imgur
 
try editing some post
u will get a rep of 2
 
my rep looks cool :D
 
(*until the post gets deleted)
You can join us at Tag Burnination if you're going on an editing spree:
... it moved to MSO
 
tnx @Unihedron
 
11:49 AM
@Unihedron acutally... there should be some search on MSO for -
 
@Vogel612 also hasaccepted:no
 
are you RO??
 
RO of Tag Burnination?
 
ya..
 
yes, along with Sam & Fox
 
11:51 AM
also... why the crap is StackExchange undefined for that room??
 
@deadlydragon00 wow , 2 of my barbarians could take it down !!!
 
chat.SO and chat.SE works differently
 
@Sword your are not aware its a Tesla base :P and it is filled with spring trap unless you solve the minesweeper
 
no it isnt . teslas need th 7
 
@Unihedron well it isn't defined for here either, but this chat works....
 
11:57 AM
@Vogel612 A lot of those hasn't even built a consensus...
 
well... maybe sort by active desc?
 
According to When Should A Tag Be Burninated, a burninate request should have sufficient views and votes and resistance accounted for before it's commenced.
 
true that, but it still is an interesting query... and you could already add a restriction about viewcount...
 
^ this is the query we use for powering Phamhilator's bad tags database.
Haha, schools really do suck.
> Dear Madam Principal,

While I appreciate your concern for our children's education, I can promise you they learned as much in the five days we were in Boston as they would in an entire year in school.

Our children had a once-in-a-lifetime experience, one that can't be duplicated in a classroom or read in a book.

In the 3 days of school they missed (which consisted of standardized testing that they could take any time) they learned about dedication, commitment, love, perseverance, overcoming adversity, civic pride, patriotism, American history culinary arts and physical education.
Would totally do the same if I ever have a family.
 
12:12 PM
kudos to that father
 
guys can you help me with something
@Test
public void testAttachMarketRefTypeToEvent() {


client.attachMarketRefTypeToEvent(1, outcome);
for(MarketRefType marketRefType : ChelseaVSBarselona.getMarketRefTypes()){
if(marketRefType.getMarketRefName().equals(outcome)){
//test pass
}
}
how to make it ?
how to make the test pass in the if
 
assertThat(marketRefType.getMarketRefName()).equals(outcome);
get rid of the if statement.
 
@Unihedron I don't know that command. o_O Type =help to see my commands.
 
=javadoc assertThat
 
ok perfect thank you
 
12:21 PM
@Unihedron Sorry, I never heard of that class. :(
 
Dammit.
 
fge
It would be .isEqualTo(), not .equals()
 
assert(thing).isEqualTo(thing)
 
fge
=javadoc Assertions#assertThat()
 
@fge Sorry, I never heard of that class. :(
 
fge
12:22 PM
Meh, no javadoc link for assertj, it seems
 
=javadoc assert
 
Which one do you mean? (type the number)
1. junit.framework.Assert
2. org.junit.Assert
3. org.testng.Assert
 
@Mic pls assertj gibs
0
 
@Unihedron That's not a valid choice.
 
@OakBot YOUR FACE is not a valid choice.
 
12:22 PM
@Unihedron Type =help to see all my commands.
 
no
make me oak
 
12:44 PM
Finally, after the exams ^_^...
 
congrats?
 
I'm screwed up with the Java assignments. But today's paper (Y)
 
guys mb you didnt understood me
here i explain it better
also I am using JUnit 4.12
 
Hello
 
12:50 PM
assertThis(marketRefType.getMarketRefName()).equals(outcome);
is with Junit4.4
 
@naskobg13 JUnit in 2015?
use assertj or testng
 
@Unihedron I want to use JUnit
 
hehehe
 
@naskobg13 Continue?
 
@Unihedron how
 
12:51 PM
I think you can just use assert(boolean). Put the expression in it.
 
i will try
 
@Unihedron assert is a keyword...
 
@Vogel612 You have to enable that with an argument no?
 
it's disregarded if the argument isn't provided, but it's still a keyword.
 
yeah. It's KFC offer today :D
 
12:58 PM
Another question
If I have some complicated data structure
with lot of objects in it, and some method of my program use them. Where in my test I should create this structure
as fields int the testCase ?
 
@SetUp
 
but in @SetUp they will be invisible for me in my method
 
assign it to a class field from SetUp.
 
Hey guys, I need to write something quick and wanted to ask for some advice
 
1:01 PM
I need to parse an XML file simply to read a few tags
Should I just use SAX parser
 
If it works, use it.
 
I'll be honest, I've never parsed XML. If I have <tag EgTag="BlaBla" Title="XYZ">
May I parse for EgTag to match "BlaBla" and then obtain the Title?
 
Read a tutorial on SAX or something.
 
Got any solid article?
 
This is the case of teaching a man to fish instead of giving him the fish.
@Juxhin No, but search engines exist for this purpose.
 
1:04 PM
Yea and I would love to take my time to learn it myself
@Unihedron - I have searched but don't have all too much time to cherry pick one
 
Don't, then.
 
Aight.
 
usually a simple google search's results are ordered by usefulness..
the more often it was linked, the higher it's ranked
which also makes the probability of it being a good tutorial rather high
 
Except for w3schools. Their tutorials ALWAYS sucks.
 
point taken...
 
1:15 PM
Why am I required to specify in a local class an external variable used as final?

Does the local class not copy the reference value into it's own context? If it does, why would it care if the external context changed the reference?
I've seen multiple answers on stackoverflow and couldn't understand it properly.
 
@ReutSharabani And what is an "external variable"?
 
class someclass(){

// yada yada
Foo x = new Foo();
new ArrayList<Foo>(){

{
add (x);
}
}
x must be final - why?
 
1 min ago, by Unihedron
@ReutSharabani And what is an "external variable"?
 
@Unihedron x in that case
 
@ReutSharabani What is x? Your seemingly random field?
Define?
 
1:18 PM
external to the anonymous ArrayList class, I'm not sure that's the right word.
 
So I seem to be able to parse the tags correctly
 
No it's not. It means a concept that doesn't exist.
 
Just not the entire tag (including the details)
 
Probably just to make clear the time when the value of the reference is taken. Modifying the variable could be allowed, but that would likely confuse a lot of people
 
Oh well, inner classes in Java is messed up anyway.
can't inherit, can't modify through polymorphism, no states
 
1:20 PM
@ReutSharabani don't use anonymous inner classes.. They're dangerous
also why the crap would you do it like that?
 
@Vogel612 why? I'm using it a lot, what am I doing wrong by doing so?

@Unihedron my understanding is that java copies x's reference to the anonymous class. After reading a bit it seems to be called "variable capturing" which isn't explained thoroughly.
 
class SomeClass {
     private static final List<Foo> list;
     static {
          list = new ArrayList<>();
          Foo x = new Foo();
          list.add(x);
     }
}
@ReutSharabani tip 1: it doesn't.
 
anon inner classes are kind of hard to avoid (pre 8) (could be avoided, but the code sure would not be more readable)
 
@ReutSharabani And what is "external variable"? "Variable capturing" isn't even a real thing.
 
tip 2: anonymous inner classes create an additional class that's often unnecessary
 
1:22 PM
@Unihedron - "In addition, a local class has access to local variables. However, a local class can only access local variables that are declared final. When a local class accesses a local variable or parameter of the enclosing block, it captures that variable or parameter. For example, the PhoneNumber constructor can access the local variable numberLength because it is declared final; numberLength is a captured variable."
 
@ReutSharabani Link to source, please.
 
Huh, the doc seems to be making up terms as it goes.
 
it is..
 
This just defines conditions required to access scoped fields anyway.
 
1:24 PM
When parsing the following tag: <vuln Alert="foo" Title="bar"> the Handler's startElement is only returning "vuln"
 
> For example, the PhoneNumber constructor can access the local variable numberLength because it is declared final
^ That's the only point that matters.
 
Why is that a requirement, if I'd change numberLength later on, would it be visible in the anonymous class?
 
@ReutSharabani It is a requirement because when anonymous classes are spinned up, it will no longer be in scope to access the field; Doing that doesn't make sense anyway.
 
"spinned up"?
 
Oh well, it's part of the language syntax, so no point justifying it.
 
1:27 PM
just trying to get a better understanding of it :)
 
@ReutSharabani Runtime representations to mimic abstractions in compile-time.
For example, in Java 8, Runnable doNothing = () -> {}; spins up an instance type that represents a Runnable.
 
spins up = "actually compiles to..."?
 
Spinning up is a term, when used in software algorithm techniques, means when abstractions are implemented.
For example, Arrays.asList().
I don't like the "be sure there's someone smarter in the room" thing. Every person, in any room, has something they can teach the others.
^ so true
 
@Unihedron ehh. well... it's a bit more complicated on JVM level, but it's close enough ;)
 
@Unihedron That means that the assertion of "There's always someone smarter in the room" is always true.
 
1:37 PM
@MadaraUchiha You're smarter than me.
 
@MadaraUchiha that assertion is provably incorrect.
 
@Unihedron And yet I come to you with questions when I get stuck at Java.
@Vogel612 For some definitions of "smarter"
For the important definitions of "smarter"
 
that definition is irrelvant
 
@MadaraUchiha The eager person answers questions. The smart people avoid questions.
 
the assertion that "someone smarter" implies is: "someone else"
 
1:38 PM
@Vogel612 I don't know what you mean,
 
since A can't be smarter than A for any definition of smarter
 
@MadaraUchiha Me neither.
 
inb4 xkcd
 
which means if there's no two individuals in the room, the assertion is incorrect
 
too late
 
1:40 PM
@Vogel612 Unless you're a being that represents an absolute reference point in the multiverse. You can most certainly be smarter than yourself.
 
prove it.
 
^^^ lol this argument is SO META
 
@Vogel612 Kage bunshin lol
 
damnit
but not a perfectly executed one... that would be......
oh well
 
@Vogel612 Aleister Crowley can exist in more than one place at once in every given moment in time.
(Don't remember if you read/watch Index)
 
1:42 PM
isn't that a supernatural reference?
also, what about Alucard?
 
@Vogel612 Alucard (and Lt. Schrodinger) are also a pretty good example
Although it's a bit different
Alucard exists everywhere and nowhere. But he's essentially the same entity
Not sure my argument applies there
 
damn superpositioned entities
I am rewatching Ergo proxy right now... and reading Ayn Rand's Atlas Shrugged when commuting
I don't have the brain-capacity for this anymore
 
@Unihedron Hi Unihedron
 
hello hello!
 
Is there any practical difference between List<Integer> i = new Arraylist<Integer>() and List<Integer> i = new ArrayList()? Since the actual type parameter(Integer) would be determined only on the basis of reference type not Object type.
 
1:50 PM
@KshitizSharma the latter should be illegal, but at least gets you an "unchecked cast" warning
what you probably mean is List<Integer> i = new ArrayList<>();
 
@KshitizSharma new ArrayList() is unchecked
 
@Vogel612 No I'm not talking about diamond operator I'm talking about raw types.
 
When you do List<Integer> i = new ArrayList(), you're initializing a new ArrayList() with no type and casting it to List<Integer>.
 
It would get a warning but for all intents and purposes it should be the same no?
 
@KshitizSharma no
 
1:52 PM
And the same byte code would be generated?
 
@KshitizSharma no
 
no definitely not
 
These are two separate procedures. The later comes with side effects.
 
gotta love sideeffects
 
@Unihedron I can't think of any way to produce a side effect. The parameterization of reference type should ensure proper type check in every case...
 
1:54 PM
nope
no inference takes place here. The Java compiler compiles literally this: chat.stackoverflow.com/transcript/message/22996721#22996721
You'll have a rawtype-represented ArrayList in a List<Integer>.
When you do .iterator(), you get an Iterator<Integer> representing an Object, for example.
 
eeek
 
Okay. Thank you.
 
> An hour later you look at the clock again and ten years have passed.
Your best years are gone. They were so unremarkable that your brain didn't even bother storing memories for them.
You consider calling your ex-girlfriend, hoping to find purpose again. But you realize that she left eleven years ago. This hasn't been a week long rut - this has been a massive part of your life, wasted.
Your life will escape you before you can even see it slip away.
No one will notice it was ever there.
Then your manager tells you that productivity expectations are 33% higher this quarter and you get back t
I want to cry.
 

« first day (1649 days earlier)      last day (3297 days later) »