« first day (1739 days earlier)      last day (3200 days later) » 
00:00 - 13:0013:00 - 21:00

fge
1:04 PM
@Hans1984 no... Not in C at least
I don't know for C++ (I stay as far away as this language as I can manage)
<-- still has to schedule his JSR 203 hangout
 
cout << "stay away!" <<"\n from boilerplate"
 
printf("I just can c ... \n");
found a question after 5 mins it had -13 and get deletet by admins :D
 
fge
@deadlydragon00 yeah, that's one of the problems of C++; according to the context, the meaning of << differs
Well, not that I am not immune to such "feats" with the language I parse; in fact it's even worse
 
I'm having an issue creating an array. I know what I want created into an array, but cannot understand how to word it so it will work. http://hastebin.com/idururehid.coffee
Can someone help me?
 
fge
Example of the possible insane code I have to deal with (OK, I made up this one; FWIW, it raises a runtime error)
@jams your base class is Patient, correct?
 
1:13 PM
yes, I might have it wrongly stored as an array too.
 
fge
Change your first line into Patient[] patients = new Patient[5]
 
shouldnt it be new Patient
 
fge
And then what @Hans1984 said for each of the following lines
X[] foo = new X[], where X is the type and foo the name of the array
Substitute, and voilà
 
ahh okay I'll give it a go!
 
@TobiasLiefke Java actually has 3 character operators: >>> and <<<
 
1:18 PM
Patient[0]=... Patient[1]=.. etc
 
fge
@Hans1984 NO
Here it is patients
Since patients is the array reference
 
yes
you re right
 
fge
@kiheru more than that -- instanceof
 
Greetings
 
@fge oh, right. I tend to forget it is an operator, despite that being obvious from the syntax
 
1:19 PM
hola
 
I have method like this
public static Function<Integer,Integer> curriedTables(int first){
Function<Integer,Integer> fn = (Integer second) -> { return first * second; };
return fn;
}
Function<Integer,Integer> twoTables;
twoTables = curriedTables(2);
System.out.println(twoTables(new Integer(4)));
 
Hi first
nice to meet you
 
o/
\o
 
Hans I always think on something different when I see this smiley ._.
 
because your from germany?
 
1:22 PM
yep ...
 
\o/
and now?
 
or more because it looks like it xD
now it looks like a cheerleader :D
 
/o\
and now?
 
\o/
OIO
/ \
 
ok lets stop it
 
1:24 PM
afraid of something falling
 
jep xD I think its better
 
I hate when the "Documentation" refuses to show any kinda code to refer to when it cites stuff
 
@kiheru rigth ! xD
@JohnSnow Documentations are sometimes just usless ...
 
fge
@JohnSnow still, some documentation is better than no documentation
(speaking from experience)
 
Like this:
Just so you know, you can configure the thread pool for this DB, but we won't tell you where or how to fit it, but it's called `setMyTreads = n` (D
@fge You're right, but this is still hell
 
1:34 PM
java can detect time of move file?
 
@fge just returning to &&= etc. Wouldn't &= do the job? For the non-combined operators the difference would be in the short circuiting behaviour, but for the combined it should make no difference
 
@kiheru: >>> is an operator, <<< is not
>>> signed bitshift right, >> bitshift right, << bitshift left
 
@Unihedron right. Wrote the other for symmetry without thinking, despite it making no sense
 
lol
 
I damn hate bytecode manipulation
 
1:53 PM
@JohnSnow as long as it doesn't lie...
 
I don't know if it's lying or not yet since I have no idea what to even try
 
fge
@kiheru that wouldn't work since &= applies to numeric operands, and booleans "aren't"
And that's only for Java
For C, well...
@JohnSnow that's a lesser kind of hell
 
Yes, but still hell
I am allowed to dislike it
 
fge
Sure
But the odds to get out of this hell are still better if you do have some documentation :p
 
Java peeps: why did my used permgen space just drop? On 1.6 JVM, XX:+UseParallelOldGC
 
2:04 PM
I don't know but thanks for not calling us nerds or anything :P
 
Haha
In here, you'd be a Python nerd :)
 
My cover is blown!
They get more similar with Type Hints now anyway. I'm doing a little lightning talk at a usergroup titled "How you can transform your Java to Python with a few simple tricks!"
 
fge
@RobertGrant the permgen space management has always been a b*tch to deal with; this is why Java 8 has removed it altogether
But then why use Java 6 in 2015?
This is like driving a Trabant to work
It makes no sense
 
It's not my call, is why :)
And yeah glad mainstream JVM went with more of a jrocket approach
But I can't fathom why its (1.6 JVM) size would ever reduce
 
fge
Well, be glad it does at least
And don't ask me why; I have no idea how it is managed at all
I'm just glad it's gone :p
 
2:19 PM
:)
 
@fge so I personally would love to have a Trabant! :D better than this new car sh*t who all looks like metalic eggs
 
2:32 PM
@alovaros meh. not if the trabant doesn't have a lock or brakes
ignoring the significant lack of seatbelts and general accomodative extras
 
Yeah look < almost everything else
 
2:56 PM
i'm leaving
bye
 
fge
3:40 PM
Woosh
The check I'm currently writing is a good step to a JVM version of that language
 
Hello. Any JavaFXers here?
 
fge
3:57 PM
Nearly so
I have one project using JavaFX
 
4:32 PM
anyone alive?
 
you
 
dead
 
nooo!!!!
you know nothing john snow, Unihedron, on the other hand...
 
totally imagines Uni shouting "I am the king!"
 
I will never understand you
 
4:54 PM
@AdrianM. yeah?
 
fge
5:14 PM
sigh
How do you unit test an AST? :(
 
@fge &= is defined for boolean as well. Follows from &, ^ and | boolean operators (the non short circuiting boolean ops). The compound assignment works normally
still is not necessarily what you want (realized this shortly when I had left), due to the right side of the assignment being always evaluated
I had been using java for a good while before I encountered the non-short circuiting boolean ops. I think I encountered them in the JLS before seeing them in real code (since then I have seen them in use in the standard library source)
 
5:50 PM
http://www.commitstrip.com/en/2015/07/28/betting-on-the-right-horse/
CommitStrip - Blog relating the daily life of web agencies developers
Betting on the right horse
CommitStrip
1438105795
 
I have somewhere code that is roughly equivalent to boolean flag = fn1() | fn2() | fn3() | fn4(), but chickened out and wrote it as boolean flag = fn1(); flag |= fn2(); ... because each part being on their own line makes it clear I want them all executed, whereas ` |` for boolean is so damn rare that I'd have to write a comment to explain that yes, I really mean that.
 
hi all, have an issue with arrays returning memory address (i think) instead of their values, what am i doing wrong?
for (int i=0; i< patients.length; i++){
System.out.print(patients[i] +", ");
 
How is patients defined? Are the elements something that make sense in a print statement?
(unrelated, but enhanced for loops usually make code more readable)
 
6:07 PM
patients are a array of strings and an int
ie: public Patient(String patientNo, String patientName,
String procedureDate, int procedureType,
String injuryDescription, String doctorName)
 
I mean the array patients, that you use in the for loop. Also, what kind of results do you expect?
 
ie: patients[0] = new Patient("0000", "steve", "01/02/13", 5, "test", "perhaps");
i currently have it returning this, with my current for loop (which i think i should start again with) assignment2.Patient@5c647e05,
 
OK! So it's something like Patient[] patients;
 
and while i'm at it, how do I get a for loop to print out array elements 1,2,3,6 and not others?
 
if you want to print a Patient that way, you need to override its toString() method. Otherwise it uses the default from Object, which usually looks vaguely like a memory adress
 
6:10 PM
ah yes, that makes sense
 
fge
@kiheru sigh well, OK... I was aware of the short circuit boolean operators in Java too (and believe them to be an outright wart to the language, but meh)
 
@fge They're so unusual that I prefer to not use them, except in compound assignments, where I think the meaning is clear :-D
 
fge
@kiheru still, using &= for both "bitwise" and "boolean" compound assignments is... Uh
 
@kiheru, thanks for your help. one more thing, how do I get a for loop to print out array elements 1,2,3,6 and not others?
 
fge
Of course, in C you can do that but then C is C and you get what you pay for -- efficiency at the price of discipline
(which is a good tradeoff)
 
6:16 PM
as i'm trying not to use two for loops where one will suffice
 
fge
Still, Java differentiates booleans so much from "normal" numeric types that I'd have thought &&= and ||= to be no brainers, but no
 
@jams if you have only a few special things consider not using a loop. It's also possible to have conditions inside the loop (and lastly, it's possible to play with the language and write for (int i : new int[]{1, 2, 3,6 }), but consider what it might to do to readability)
 
Thankyou @kiheru!
 
I'd also prefer if there were &&= and ||=, but I guess the language designers decided they'd be unnecessary since there are already the obscure boolean ops :-(
 
fge
@kiheru yeah, I do believe that & and |, as boolean ops, are weird; still, that is nothing compared to the language I have to parse
@kiheru game of mind; see how this works (well, OK, I've documented it, so...)
 
6:26 PM
^ for boolean would be occasionally useful, but damn me if I'll ever actually use that in code
 
fge
@kiheru just FYI... The language does have short circuit boolean operators, && and ||; and it also has non short circtuit ones; those are... & and ! (and yes, I do mean an exclamation mark)
And of course, the story does not end here
I could go hours on end with the pecularities of the language :p
OK, just for fun, this is legal: set set = 1
The first set is a command; the second: a local variable whose scope is that of the method
And if that weren't enough, this is legal too:
set set = "d ..someMethod()"
do @set
sigh
And there is more :/
I can tell you I have fun parsing that
 
@fge I'm pretty sure "|" is the proper operator
 
fge
@Unihedron not in "my" language, no (that is, the language I parse), since a single vertical bar is used for other purposes...
But then if I go this way, uh
Honestly, this language is hilariously fun to parse, to some extent
 
... Wait, you were talking about a different thing?
 
fge
I was not talking about Java, no
Wait, did that come as a surprise? :p
 
6:36 PM
yes
it was so contextually matching
and... the information itself that ! is beyond an unary operator just put a chill down my spine
 
fge
Define "contextually" then :p
But I assure you, no, Java has no binary operator with symbol '!' :p
"My" language has, however (for some definition of language)
If anything, in Java, '!' is a prefix operator and what has to follow is a boolean expression
Clear, concise and to the point
 
fge
6:53 PM
Woo
A one liner in that effing language I deal with
 
Will you share it? This is exciting!
 
@kiheru, or anyone who cares to help, still having issues getting values returned out of an array. eclipse is throwing me errors for both System.out.println(Arrays.ToString(patients[i])); and
 
fge
i 1 w "hello" s $test = 0 else w " world" w !
 
        System.out.println(Arrays.deepToString(patients[i]));
 
fge
"Of course, this will print hello world and then a newline...
 
6:55 PM
@jams put toString in the proper casing
 
casting? sorry what do you mean
ah, gotcha.
hahahaha. fail
 
you have ToString with block T
 
fge
@Unihedron that's Arrays"s .deepToString() -- therefore the casing is correct
Get your eyes back in your sockets
 
@fge I wasn't even replying to that message
What is wrong?
 
Can't find a way for the elements from an array to be returned
eclipse keeps throwing me errors, my fault of course
 
6:59 PM
Maybe it would help if you read the error out loud.
 
fge
@jams does Patient define .toString(), at least?
 
I have a few of these:
patients[0] = new Patient("1111", "steve", "01/01/14", 2, "test", "incorrect");
and i'm not sure how to call the elements, ie 1111 or steve
 
fge
There seems to exist the fatal misconception here that using Arrays.toString(foo), for whatever foo, will magically use reflection and print out all fields of foo
 
what do you mean define .toString()? @fge
 
fge
But no
That's not the case
/javadoc Object#toString()
 
7:00 PM
@fge String toString(): Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. (1/3)
 
fge
@jams ^^^ that
 
I know it's giving back to memory address of the data's location, how do I get around that
 
fge
It is the second most important contract of any Object after equals()/hashCode()
What?
Why do you care about that?
Read the link OakBot sent you
 
I don't. I want it to return the stored values in the array
 
fge
And read it again
READ. THE. CONTRACT. OF. OBJECT.
And Object has, yeah, a .toString() method
How convenient, right? It's not final so you can override it to fit your needs
 
7:03 PM
If the object doesn't implement toString() then if you want to see its internal variables you have to use ugly hacks
In short: Don't. Implement toString() of the object.
 
@fge did you probably miss a "." in Uni's sentence earlier. (the one you said is completely backwards)
(I actually did, and thought "whaaat"?)
 
fge
15 messages moved to Trash
@kiheru indeed
 
Had a feeling that was coming.
 
~pointlessCounter["misunderstandings"]++;
 
@jams Anyway, the thing is sorted: everyone here agrees that you should implement toString()
 
7:11 PM
I can't because eclipse is throwing me errors to try to do it
 
Yes. And by peer pressure, if you don't implement it we will mail you a box of spiders.
 
fge
@jams wat?
 
all good fge, i'll keep trying by myself for now
thanks for your help though
 
(or more specifically override it. The one that looks like a memory address comes from Object)
 
7:23 PM
my issues was solved, answer was:
String name = patients[i].getPatientName();
public String getPatientName()
{
return this.patientName;
}
obviously the getPatientName() goes before ;)
 
ok, for simply getting the name that is better than overriding toString()
 
fge
8:25 PM
struggles for the contens of the slides for the next hangout
 
00:00 - 13:0013:00 - 21:00

« first day (1739 days earlier)      last day (3200 days later) »