« first day (1568 days earlier)      last day (3381 days later) » 
00:00 - 14:0014:00 - 00:00

12:07 AM
Question about private variable access. I'm having trouble googling this, but I'm sure it's a common question so I want to avoid posting an embarrassing dupe.
I'm getting an error trying to access a private variable from a subclass instance. Here's a fer instance:
class A {
private int foo;
void bar(B b) { b.foo = 42; }
}

class B extends A { }
Can someone point me to documentation about why this is illegal? This is surprising to me and my google-fu isn't getting me any answers.
 
fge
@JohnKugelman this is illegal since a private variable is private to instances of this class only; if you want this variable to be accessible to subclasses as well, make it protected
 
I don't want it accessible to subclasses. I just want to access it from the parent class, but via a subclass instance.
 
fge
Uh?
Define "parent"?
 
Original?
 
fge
Uhuh
 
12:19 AM
I can't access B's A.foo from the method A.bar()
 
fge
That looks like a XY problem
For one, a base class should not require to know about any of its subclasses
 
It's more a point of curiosity. I can workaround it by adding public int getFoo() to A.
 
fge
So, what if you explained what you really wanted to achieve?
Well, you can't do what you tried to do in any event
Not in Java, and for good reason: this breaks encapsulation
 
Yeah I guess I'm just curious why I can't. It surprised me when it failed to compile.
How does it break encapsulation? (Not arguing, genuinely curious.)
 
fge
Well, a private variable is, uh, private, you know
It breaks encapsulation in the sense that you try and access the state of a child class from a parent class
This shouldn't happen
If you have to do so, you have a problem with the design of your parent class to begin with
 
12:25 AM
But the variable is from the parent class.
A is trying to access its own variable.
 
fge
But B cannot access foo
Since A defines foo as private
A private variable will only ever be accessible to instances of A and not to anyone else, in any situation
But to all instances of A
 
fge
12:42 AM
20 minutes before the event, huh
wonders whether the event will even take place at this rate
 
fge
12:56 AM
Starts in 5 minutes
Hmm, that's what I figured
OK, event cancelled
 
it's 2am here :P
 
fge
Yeah, here too
 
oh, france :P
 
fge
But none of the people who said they would be here and join did
So...
 
1:02 AM
Just in time
 
So good night hahaha
 
fge
@ItachiUchiha eh? You're late, man
 
Can barely open my eyes
 
fge
And you're the only one
 
fge
1:03 AM
So, uh, what should be done, eh?
Unless @HamZa is interested as well?
 
I'm not here for too long. I need to get up at 7:45
 
fge
In any event I need to go drink a coffee first
Ohwell, OK, it all starts in 5 minutes
 
we should wait
people will show up
 
fge
But no need to record that one I surmise
 
you can do it :P
i will be right back
 
fge
1:08 AM
Well, here's the link, but...
 
vogel is out of town
uni must be sleeping
@BrianJ heya
 
hey
its 1.20 here might be a bit late to the party
 
not at all, you can join in too
:P :P
 
is this an Illuminati party?
that I've heard of.
whats the secret hand shake?
 
well, you will be disappointed :P
 
1:23 AM
btw I got on pretty good with that Android project I was working on @fge, 70%
 
1:34 AM
Hey, I am new to java and learning still. I have test cases written and running it from the command line. Now when i do it, how can i run test on files that are in different folder than test case them self
 
@ItachiUchiha aaand it just crashed....
 
@Vogel612 hangout?
 
Mobile hangouts is a joke... can't even chat there
Ya..
 
hehe
@Vogel612 can you even see the code? :P
 
I'm graduating soon with an hons degree in dev, think I should go for a graduate position straight after I finish in May or take a
break until I get my actual degree in November?
What did you do in my situation?
did you start work straight away or travel a bit?
I've been working part time from my laptop while doing my degree, bit daunting to think of going back to a 9-5 just yet.
 
2:04 AM
haha @ItachiUchiha you said something?
 
did i?
 
Yes that worked :)
 
@Vogel612 did you even see something ?
 
@ItachiUchiha "left, oh"
 
But not chat and code simultaneously ...
 
2:05 AM
hehe, may be
@Vogel612 hope you enjoyed
nio != io
FS, FSP, FS <<<< dang! dang! dang!
 
Not io (badumm tish)
 
haha
 
Lol filesystem filesystemprovider and filestore, eh?
Anyways I'll sleep now.
Night!
 
yeah
Night!
@HamZa you must go to sleep as well
 
Yeah, I'm going to sleep as well. I got less than 5h to sleep ~_~
 
2:08 AM
you need to wake up @ 7.45
NIght! Night!
 
Need to work at 9 until 18
 
9-18?
that is pretty much the official time to work :P
 
yup.
 
but it is saturday
@BrianJ It is what you need to decide
 
I got a non-dev job
 
fge
2:10 AM
Well, done
 
in a diy shop
 
@HamZa babysitting :P
 
fge
So, was it OK? :p
 
@fge it was great !
@Hamza chair kept making the creaking voice, until vog muted him out :P
 
Very nice. I didn't even prepare and I understood most of it
@ItachiUchiha oh sorry haha
 
2:12 AM
Well I was jk. It was not a problem at all
@fge Jokes aside. Great session. Kudos!!!! :D
 
Looks like I came late.
 
fge
OK, good, I didn't prepare it very well either, so that's a relief
 
@TheLittleNaruto you are late
:P
 
fge
@HamZa "most"? What part(s) didn't you understand?
 
@fge well, I basically need to get java 8 and clone your repo and practice on it. For example, the PRINT part, I had no idea that was possible.
 
2:16 AM
@HamZa When you come to fge's classes, you need Java8 :P
 
fge
Oh
Well, I can give a "crash course" on functional interfaces and lambdas I guess, but most people in there understand that, so...
(and I would need to learn more about Collector anyway
 
haha forgive this php guy.
That said, I last made an Android app and it went pretty well!
I will probably need to make another one so there will be more java for me to come!
@fge it's an rtfm homework :-)
 
@HamZa android doesn't support java 8 :'(
 
@ItachiUchiha not yet :P
 
fge
Android doesn't even have support for java.nio.file, meh
 
2:18 AM
yeah Feeling hopeful
@fge it eventually will
 
fge
"eventually"? The API is 4 years old already
 
woops
 
and we are learning about it today
 
fge
Oh, don't feel guitly
Just look at most questions related to file I/O on SO even today
Nearly nobody uses java.nio.file
 
I picked up Java 8 features before learning anything about Java nio
 
fge
2:20 AM
And I'm not joking about this, but with my 3 published filesystems, I account for 50% of all published JSR 203 filesystems on Earth
 
hahaha
 
fge
(and I have two more in the works to boot)
 
then you will probably account for 75%
 
alright guys
it was nice having this session but now I'm really going
cyaa
 
fge
<-- wants to do the next session about Unicode, chars and bytes
 
2:25 AM
c ya
@fge you can take a session on whatever you want to ;)
 
fge
Well, I call it a day/night, so see you next
 
c ya
night
 
2:51 AM
@TheLittleNaruto You should go back to sleep as well
 
3:40 AM
how to enter debug mode in eclipse from entry point of program (without setting breakpoint)?
 
you need to set a breakpoint
 
 
1 hour later…
5:01 AM
@Swordy welcome!
 
@ItachiUchiha hii.. :)
Shin Chan i see.. :D
 
yeaha
 
is this the main chatroom for Java?
 
yeah
it is
 
and you are the owner?
I know unihedro , he is an owner in many rooms and visits us in python and tcl
 
5:06 AM
no I am not
But, yes uni is and few others are as well
There was a room owner competition which took place few months ago and Uni won
But I didn't take part in it :P
 
ohhh
 
May be I will take part in the next one :)
 
you should then.. you seem happy here..
 
yeah, everyone is :P
 
haha , right.. be an owner.. unihedro is a downvoting legend
 
5:08 AM
we have a lot of people in here and we have a hangout almost every weekend
 
cool , I'll join you guys then.. Java wasn't cup my cup of coffee until recently..
 
well you are most welcome
You will learn a lot in the hangout. We pick up a topic and someone explains it :)
 
ohhh great.
will be fun
what time?
 
well you can join the events and we will keep you updated. We had one today @ 1 GMT
It was about nio.file.
 
my timezone is +5:30 GMT
does it mean 6:30 pm every saturday for me?
 
5:13 AM
the timings change
it must be morning for you :P
 
ohh , yes
and in mornings i attend prayers and go to the gym
so I won't be able to visit :(
 
haha, well today most people opted out, so most probably the timing will change
 
yeah..please change it to noons or evenings
I'll just be back , putting my pc to sleep so it will log me off for sometime.. :)
 
Well it depends on fge's accessibility as he is the one who is normally presenting
C ya
 
6:00 AM
Anyone good with math here?
Its related to java
 
shoot
 
6:20 AM
Ive got this custom scrollmenu that ive made
And the scrolling and all that works fine
But I need to have the speed it scrolls at change depending on how many items are in the list
So when scrolling you can actually get through them all without going past the bottom or not getting there
 
Is it Javafx?
 
Swing?
 
Nope :P
Its for a custom gui in a game
This is what it is atm
Everything is done its just I need to fix the scrolling
 
and the game is made using ?
 
6:24 AM
OpenGL
To draw/render everything
 
Ahh, I have no idea about it
 
The problem isnt with opengl though
This is how im drawing it atm
listItems.clear();
int i = 0;
int speed = (player.playlist.size() / 6);
int scroll = (int)(-GameGUI.musicScrollBarDrag) * (speed);
for(Object o : One.getMP3Player().playlist){
File file = (File)o;
boolean isScrollItemHover = MOUSEX >= getPosX() && MOUSEY >= getPosY() + 3 + i + scroll && MOUSEX <= getPosX() + 100 && MOUSEY <= getPosY() + 14F + i + scroll;
listItems.add(new ListItem(i / 13, isScrollItemHover));
One.guiFont.drawString(getTitle(file), getPosX() + 2, getPosY() + 5.5F + i + scroll, NahrFont.FontType.PLAIN, (isHoverScroll && isScrollItemHover) ? 0xFFFF5050 : 0xFFFFFFFF, 0);
 
use CTRL + K to format code ..
 
    		listItems.clear();
		int i = 0;
		int speed = (player.playlist.size() / 6);
		int scroll = (int)(-GameGUI.musicScrollBarDrag) * (speed);
		for(Object o : One.getMP3Player().playlist){
			File file = (File)o;
			boolean isScrollItemHover = MOUSEX >= getPosX() && MOUSEY >= getPosY() + 3 + i + scroll && MOUSEX <= getPosX() + 100 && MOUSEY <= getPosY() + 14F + i + scroll;
			listItems.add(new ListItem(i / 13, isScrollItemHover));
			One.guiFont.drawString(getTitle(file), getPosX() + 2, getPosY() + 5.5F + i + scroll, NahrFont.FontType.PLAIN, (isHoverScroll && isScrollItemHover) ? 0xFFFF505
 
How to implement the above tree
in java
 
6:28 AM
@Lucky You need to show some effort first
just don't come in and ask how it can be done
 
ok. sure
thank you
 
If you ask such questions on SO, you will be bombarded with dv's and cv;s
 
ohh. Ok
 
stackoverflow isn't a code writing service platform, so you should try doing work yourself and if you are stuck , you should come back with a specific problem after trying to look for similar cases on SO .
@ItachiUchiha you know the timzone of fge? I could get an idea of the meeting time..
 
@Swordy Just stuck to the room, you will get updates.
 
6:33 AM
ohk.. seems legit..
 
btw, you can find the files to the first hangout here github.com/fge/javaniofile
the classes are pretty self-explanatory
 
wow
nice thing.. Push all stuffs to github .. Is this done for every week's hangouts?
 
yup, you can see it is updated 7 hours ago, just after the last hangout
 
7:18 AM
i'm starting off with this series
 
yawn
 
Morning
 
@Unihedro looks like u took that winter bash hat seriously
 
Welcome aboard :P
 
thanks.. looks like i'll be following you around every chatroom that u visit..
 
7:31 AM
Uni got a stalker
 
LOL
~stalkers++
 
Success measureofSuccess = uni.getStalkers();
 
<- is rather rich, not famous :P
 
I rather be famous then rich ;D
(Just kidding to get to make that grammar pun)
I prefer being rich to famous too
Though if i was rich, I'd probably become famous since I have so many ideas for things to do with the money. I want to build a compact living apartment house to house people in need for various reasons
 
@Unihedro honestly , i dint follow u here , i was starting up with Java so decided to join some chatroom..
~stalkers--
:D
 
8:10 AM
too late
you have been already added
 
one does not simply say "looks like i'll be following you around every chatroom that u visit.." and not get added to the stalker list ;P
 
fge
9:05 AM
Moo
 
hey @fge
 
 
1 hour later…
10:22 AM
@Gemtastic 've you used headers n footers with thymeleaf?
 
No I made my entire template in it
 
I didn't really have a design suitable for headers and footers
 
fge
@Gemtastic so, awake today? :p
 
10:37 AM
Yes
As I said I'd be
:P
 
fge
Good, then if you want I can give a crash course on Unicode, chars, bytes and charsets
 
I beilve I'm fairly up to date on that though :O
 
fge
Oh, really?
 
yeah
 
fge
So, tell me: do you know about CharsetDecoder? ;)
Do you know how to read from an input stream and fail if the stream is badly encoded?
Do you know about U+FFFD? :=)
 
10:41 AM
that's not the crash course, that's the next step course
@fge That I know about
 
fge
OK then, no need for the course :p
 
I haven't worked in IOstreams much, but I did get the introcourse to them
 
If there's any course , I'm in for it..
 
fge
@Swordy for one person only, that's not really worth it
 
i guess im not the only one..
 
10:49 AM
@fge I guess we will ask uni to give you owner access, so that you can create events :D
 
I mean the one that follows up.. Dont worry , I will catch up on the ones you have done already..
 
fge
Well, we'll see
Let's say, at 12:30 my time I'll start a session and we'll see what's what (40 minutes from now). Subject: Unicode, bytes, chars, charsets
 
I need to rush now :/
Got some work
 
fge
Meh
 
one hour from now , i'll be afk for 15 minutes :(
 
10:53 AM
Will be back in about 4 hrs
 
i think we should see what time we all can be free.. so that fge can use his resources for max benefit
 
fge
Yep
 
@fge what is your time zone?
 
that is why I asked him to create events :P
 
mine is +5:30 GMT
yeah
 
fge
10:54 AM
GMT+1
 
his is GMT + 1
 
fge
I do have my own room
 
so lets decide on what time we are present.
so should i put up my time here as per +1 GMT ?
so it will be easy for all of us
btw i have dealt with unicode , byte strings recently in python.. :) but i guess i lack that insight..
my timings as per +1 GMT timezone:
04:30 - 08:30
09:45 - 12:45
13:00 - 14:00
14:30 - 15:30
16:30 ----- I'll keep my eyes wide open O_O
 
fge
11:15 AM
I guess the best would be 14:30 - 15:30
 
convenient for you?
 
fge
11:38 AM
Yep
I have all my time ;)
Now, will other people be here...
 
Nope, I'm not up in mornings.
Or rather, chances are lower than bedrock.
 
does it happen on google hangouts via video calls?
 
fge
@Swordy right now that is indeed what I use, yes
 
ohhk gr8 ..
I appreciate your efforts :)
 
fge
I'd really like to make regular events like this, but then gathering attendance is the hardest part of it all, huh
 
11:42 AM
yeah.. that is..
 
Another tricky thing is if you make them too frequently, participants would burn out. :P
 
what is your view on this series
burnout as in?
brb...
 
fge
@Unihedro yeah, but then this is a trials period right now
I do enjoy making such stuff in fact
 
I enjoy watching as well, though unfortunately (no-sarcasm) I don't have all twenty four hours to invest :p
 
 
1 hour later…
fge
1:01 PM
 
Nice
 
fge
1:23 PM
@Gemtastic compared to your designs, it's rather plain ;)
 
It's getting more detailed and I think you have a very nice layout for it
 
fge
1:47 PM
Well, thanks :p
Now I need to add yet another tab and that will be it for version 0.3.0
 
:)
 
wtf tag?
 
Gave me a good laugh :P
 
Good morning, Java!
 
1:56 PM
it is so easy to guess who the downvoter is ..
 
@Swordy [tag:wtf]
 
Morning, @Michael! Please take the time to review the above linked question, and vote to close where appropriate.
 
fge
Hello @Michael
 
Hey @Uni, @fge
 
i know how to get tags in here, but a wtf tag stands for "what the ****"???
 
1:57 PM
and?
 
fge
No, it means Wings To Fly
 
Winning Tournament Fishes
 
in other news the latest git available from git-scm.com is 1.9.5 when recently 2.3.0 was released..
 
@Swordy That's exactly why I used the tag. The question gives the reaction of a WTF.
 
hmmm , so whose method uses the @override ?? Unihedro or fge?
 
1:58 PM
@Unihedro Why don't you like that question?
 
fge
Eh?
 
Eh, I think it's OK.
 
@Unihedro your downvote lost its charm.. someone upvoted it ..
 
@Michael $reason
@Swordy I'm not surprised, it's only been up for 10 hours and has not attracted enough attention.
 
00:00 - 14:0014:00 - 00:00

« first day (1568 days earlier)      last day (3381 days later) »