• cheeser
  • ernimril
  • joed
  • kinabalu
  • lunk
  • ojacobson
  • r0bby
  • ThaDon
  • ricky_clarkson
  • topriddy

« 2020-01-14


2020-01-16 »

Nick Message Date
feannag [feannag!~feannag@2405:204:9321:b824:c96:39f:af01:444] has joined ##java [12:28]
ChaiTRex [ChaiTRex!~ChaiTRex@gateway/tor-sasl/chaitrex] has joined ##java [12:29]
shan [shan!~shan@unaffiliated/jasatso1301] has joined ##java [12:29]
nurupo [nurupo!] has joined ##java [12:38]
johnau cheeser, hmm. Does it have any benefits? [12:42]
johnau or is it outdate in javaee8 [12:43]
cheeser it has it's place, i guess. i've never used/needed it [12:45]
tasse [tasse!] has joined ##java [12:56]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [12:57]
Kol [Kol!] has joined ##java [01:02]
Hal9k [Hal9k!~Hal9k@unaffiliated/kusanagi] has joined ##java [01:04]
begui [begui!~begui@] has joined ##java [01:04]
benskey [benskey!] has joined ##java [01:11]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [01:13]
treeman5 [treeman5!~treeman5@] has joined ##java [01:17]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [01:28]
rajrajraj [rajrajraj!uid72176@gateway/web/] has joined ##java [01:30]
benskey [benskey!] has joined ##java [01:32]
sauvin [sauvin!sauvin@about/linux/staff/sauvin] has joined ##java [01:33]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [01:34]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [01:37]
TomyWork [TomyWork!~TomyLobo@] has joined ##java [01:38]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [01:44]
led_dark_1 [led_dark_1!~Thunderbi@] has joined ##java [01:45]
that_lurker [that_lurker!] has joined ##java [01:48]
snowmanbamm [snowmanbamm!snowmanbam@gateway/vpn/privateinternetaccess/snowmanbamm] has joined ##java [01:50]
that_lurker [that_lurker!] has joined ##java [01:51]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [01:59]
feannag [feannag!~feannag@2405:204:9321:b824:c96:39f:af01:444] has joined ##java [02:12]
donofrio [donofrio!~donofrio@] has joined ##java [02:15]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [02:20]
bluewhistle what can cause minor gc to occur very frequently? [02:22]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [02:23]
Zee- [Zee-!~Zee-@] has joined ##java [02:25]
serdar [serdar!~serdar@2a02:908:5c0:540:49a2:8323:4f2f:f626] has joined ##java [02:31]
Secret-Fire [Secret-Fire!] has joined ##java [02:37]
Secret-Fire [Secret-Fire!] has joined ##java [02:39]
deebo objects being created? so just normal execution [02:40]
that_lurker [that_lurker!] has joined ##java [02:45]
ogradyd [ogradyd!] has joined ##java [02:52]
odinsbane Getting close to max memory can cause more frequent gc. [02:54]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [02:56]
benskey [benskey!] has joined ##java [02:56]
ankk [ankk!b9dc98f9@unaffiliated/ankk] has joined ##java [02:58]
ankk hi [02:58]
ankk i am trying to understand @Cacheable annotation properties [02:59]
ankk what does key do exactly? [02:59]
ankk it is like a table's primary key? [02:59]
Tichodroma [Tichodroma!~lutz@fsf/member/Tichodroma] has joined ##java [03:00]
ankk should it be unique for each method definition? [03:00]
FabioP [FabioP!] has joined ##java [03:02]
deebo ctrl-click the annotation and read [03:02]
Matthijs [Matthijs!~quassel@unaffiliated/matthijs] has joined ##java [03:09]
sdu [sdu!] has joined ##java [03:20]
dtrott parted the channel: [03:27]
erts [erts!erts@gateway/vpn/privateinternetaccess/erts] has joined ##java [03:30]
EgonX [EgonX!~Egon@2601:2c6:47f:98f4:ed99:9381:d944:3a40] has joined ##java [03:32]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [03:34]
srm [srm!~Adium@unaffiliated/srm] has joined ##java [03:36]
bluewhis_ [bluewhis_!~bluewhist@] has joined ##java [03:39]
tomboy64 [tomboy64!~tomboy64@gateway/tor-sasl/tomboy64] has joined ##java [03:40]
hinst [hinst!509c193b@gateway/web/cgi-irc/] has joined ##java [03:48]
enoq [enoq!] has joined ##java [03:55]
treeman5 [treeman5!~treeman5@] has joined ##java [03:58]
lxsameer [lxsameer!~lxsameer@unaffiliated/lxsameer] has joined ##java [03:59]
lxsameer hey folks, how can i add a test time dependency to gradle ? [04:00]
ankk @Cacheable(value="books", key="#isbn" [04:00]
ankk [04:01]
ankk ankk's title: "29. Cache Abstraction" [04:01]
ankk i really can't understand this already [04:01]
ankk why checkWarehouse and includeUsed values are unnecessary for cache key? [04:01]
ankk they change the result [04:01]
SerialSmile [SerialSmile!~SerialSmi@] has joined ##java [04:04]
coalado [coalado!~Thomas@unaffiliated/coalado] has joined ##java [04:05]
SpiceMan ankk: it's an example. what if you don't care about anything but isbn? -> use key="". [04:10]
SpiceMan otherwise, "If more the one param is given, return a key computed from the hashes of all parameters." [04:10]
SpiceMan so... don't use key="" [04:10]
SpiceMan /topic reading comprehension 101 [04:10]
AcTiVaTe [AcTiVaTe!] has joined ##java [04:13]
snowmanbamm [snowmanbamm!snowmanbam@gateway/vpn/privateinternetaccess/snowmanbamm] has joined ##java [04:15]
sa02irc [sa02irc!] has joined ##java [04:16]
SpiceMan ankk: "Since caches are essentially key-value stores, each invocation of a cached method needs to be translated into a suitable key for cache access." [04:16]
SpiceMan read about key-value stores and memoization [04:16]
SpiceMan that's all @Cacheable does. memoizes. [04:17]
benskey [benskey!] has joined ##java [04:17]
ankk that example made me confuse because it specifies key as #isbn while other parameters change the result [04:19]
Jonopoly [Jonopoly!~Jonopoly@unaffiliated/jonopoly] has joined ##java [04:19]
ankk i was expecting something i couldn't figure out [04:19]
hooper [hooper!] has joined ##java [04:23]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0::449] has joined ##java [04:23]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [04:24]
coalado [coalado!~Thomas@unaffiliated/coalado] has joined ##java [04:24]
ItsNotRSX [ItsNotRSX!] has joined ##java [04:34]
coalado1 [coalado1!~Thomas@unaffiliated/coalado] has joined ##java [04:36]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [04:39]
tilerendering [tilerendering!~tilerende@c-base/crew/conx] has joined ##java [04:40]
tilerendering hola [04:41]
exonity01 [exonity01!uid364582@gateway/web/] has joined ##java [04:42]
LaSombra sup [04:42]
snowmanbamm [snowmanbamm!] has joined ##java [04:43]
cpplearner Guys, I'm currently looking into `getfield` from the JVM specification. But, the one thing I don't understand is that, the spec says it uses run-time constant pool of the `current class`. The class we're supposed to invoke on is pushed on the top of stack, but it uses the current class? [04:43]
cpplearner I'm not sure what the spec means... [04:44]
cpplearner cpplearner's title: "Chapter 6. The Java Virtual Machine Instruction Set" [04:44]
coalado [coalado!~Thomas@unaffiliated/coalado] has joined ##java [04:45]
Diablo-D3 looks [04:51]
Bombe The name of the field to get is taken from the constant pool. [04:52]
cpplearner Bombe: That makes sense. Sorry for my ignorance. [04:54]
Bombe Well, symbolic reference really, so name plus descriptor plus reference to the class. [04:54]
cpplearner Bombe: Thanks for your time! [04:56]
ron Bombe: you can symbolically reference me anytime, anywhere ?? [04:57]
Bombe ron, I know! ? [04:57]
tomboy64 [tomboy64!~tomboy64@gateway/tor-sasl/tomboy64] has joined ##java [05:06]
Gazooo [Gazooo!~Gazooo@] has joined ##java [05:07]
serdar [serdar!~serdar@2a02:908:5c0:540:49a2:8323:4f2f:f626] has joined ##java [05:18]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [05:19]
tomboy64 [tomboy64!~tomboy64@gateway/tor-sasl/tomboy64] has joined ##java [05:22]
matsurago [matsurago!~matsurago@240b:10:b3a1:1700:227c:8fff:fe9b:7ad6] has joined ##java [05:24]
snowmanb_ [snowmanb_!snowmanbam@gateway/vpn/privateinternetaccess/snowmanbamm] has joined ##java [05:24]
Aquazi [Aquazi!uid312403@gateway/web/] has joined ##java [05:27]
zalt__ [zalt__!~devp@unaffiliated/lambda443] has joined ##java [05:31]
bluewhis_ [bluewhis_!~bluewhist@] has joined ##java [05:35]
rajrajraj [rajrajraj!uid72176@gateway/web/] has joined ##java [05:35]
Lengsdorfer [Lengsdorfer!~Lengsdorf@unaffiliated/lengsdorfer] has joined ##java [05:46]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [05:51]
bernard_ [bernard_!] has joined ##java [05:52]
bernard_ Hey [05:52]
dreamreal how's it GOIN [05:53]
bernard_ Not so good. I need some help if someone of you can XD [05:54]
dreamreal can't, haven't seen a question that has an answer [05:55]
dreamreal not from you at least :( [05:55]
bernard_ I try to send my jwt key back in the header, but he tells me all time he need a Builder ?! Only without header he allows me that [05:55]
bernard_ Here it is ^^ [05:55]
dreamreal not a question *I* can answer easily, so I'll defer to someone with more expertise in that domain [05:56]
dreamreal but this sounds like a compiler problem? [05:56]
matsurago I am just curious, why would you use auth header in the *response*? They are usually used in requests as far as I know. [05:57]
bernard_ @matsurago How you mean that ? So what I thought is, after the first login he need to generate a JWT Token and send it back to save it ? [06:01]
bernard_ So I thougth it should be in the header or not ? [06:02]
royal_screwup21 [royal_screwup21!89de72f1@gateway/web/cgi-irc/] has joined ##java [06:02]
CuriousErnestBro Hello [06:03]
CuriousErnestBro I have a something that I want to do twice but I need some (not all) of the variables available later on [06:03]
CuriousErnestBro Do I create a function with this variables? [06:03]
matsurago bernard_: no, why. Such headers are normally used in client's requests to a protected server. In your case I think it may be as well in JSON response body. [06:04]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [06:05]
_xor [_xor!~xor@] has joined ##java [06:06]
dreamreal CuriousErnestBro: errr... what? [06:06]
con3 [con3!~kvirc@] has joined ##java [06:07]
CuriousErnestBro dreamreal, I want to do something twice, do I do it in the same file or create 2 files with similar code? [06:08]
dreamreal ... [06:08]
dreamreal why would you... not create a method for it somewhere? [06:09]
dreamreal I mean, do what works for you, if you want to create separate sections of code it's no skin off of my teeth [06:09]
CuriousErnestBro Okay thanks [06:10]
mbooth CuriousErnestBro: Why not create one method and call it twice? [06:10]
CuriousErnestBro Yeah that's what I'm gonna do now [06:11]
dreamreal also: brush your teeth and wash your hair, change your underwear, mind your finances (just in case you need external approval for beneficial practices) [06:12]
dreamreal be decent to people, even if you don't know them; don't lie, cheat, kill. Those are kinda the biggies, I guess, the rest is more detail [06:13]
dreamreal lastly, stop relying on others for approval to do things you think are best [06:14]
xbyte1024 [xbyte1024!] has joined ##java [06:15]
bernard_ @matsurago Hm ok because he don't give me the option for the body, thats why its a bit weird. But thank you I will try it that why [06:19]
bernard_ way* [06:19]
Diablo-D3 dreamreal: but without the approval of others, what is going to stop me from violating the ten commandments? [06:20]
CuriousErnestBro dreamreal, is that directed to me...? [06:20]
CuriousErnestBro Yes it in :/ [06:21]
CuriousErnestBro is* [06:21]
Diablo-D3 thou shalt comment your code, thou shalt keep it simple, less is more isn't an excuse for code golf, ... [06:21]
Diablo-D3 forgets the rest [06:21]
CuriousErnestBro For real though, some people I know would benefit from that advice immensely [06:21]
CuriousErnestBro The finance industry is full with people like this [06:21]
matsurago Diablo-D3: The very idea that the person who will be supporting this code may be you? [06:22]
Diablo-D3 pretty fucking much [06:22]
Diablo-D3 I dont write comments for other people [06:22]
CuriousErnestBro (But it also has some of the most humble people I have met) [06:22]
Diablo-D3 I write comments for me people. [06:22]
Diablo-D3 I am 100% going to forget what this code does by the end of the week [06:22]
CuriousErnestBro Diablo-D3, I write comments for my teacher [06:22]
CuriousErnestBro Also I am very slow at reading my own code (even if well commented), even slower in reading other people's code [06:23]
Diablo-D3 I literally had someone go "diablo, why is this code so verbose, you could write it (this much shorter way)" [06:23]
dreamreal Diablo-D3: if you need the approval of others to be a good person, then BY ALL MEANS consider yourself approved for that behavior. The ten commandments themselves... whatever floats your boat, dude [06:23]
Diablo-D3 and then I beat them over the head with the compiler which produced the same fucking output [06:23]
gnufr33d0m [gnufr33d0m!~gnufr33d0@] has joined ##java [06:23]
CuriousErnestBro Verbose is good [06:23]
dreamreal *correct* is good [06:24]
dreamreal *pretty* is good but less relevant than *correct* [06:24]
CuriousErnestBro Correct is great [06:24]
sbalmos [sbalmos!] has joined ##java [06:24]
dreamreal *fast* is good, but less important than *pretty*, which is itself less important than *correct* [06:24]
Diablo-D3 I wrote it in the style of self-documenting code [06:24]
Diablo-D3 it does this, very explicitly, and I wrote it that way for a reason [06:24]
dreamreal mostly documents with "// TODO document this, eh" [06:25]
sbalmos dreamreal: /** gets the foo */ [06:25]
Diablo-D3 man, remember when we all used javadoc? [06:25]
bluewhistle [bluewhistle!~bluewhist@] has joined ##java [06:25]
dreamreal and since my codebase therefore has a lines-of-code to comments ration better than 1:0, I consider it completed [06:25]
tomboy64 [tomboy64!~tomboy64@gateway/tor-sasl/tomboy64] has joined ##java [06:26]
Jantz [Jantz!] has joined ##java [06:26]
dreamreal sbalmos: leave some mystery, dude [06:26]
Diablo-D3 related, Im kind of glad we're circling back to DSLs being en vogue [06:26]
sbalmos dreamreal: not until you write a test that proves that you will write the documentation later, with eh [06:26]
dreamreal is imagining sbalmos' noir detective novel now: "Sam beat Stella over the head with a candlestick. The police noted the evidence and the fingerprints and arrested Sam for Stella's murder. The end." [06:26]
matsurago Some companies actually enforce javadoc on all public methods, or the build pipeline would fail on lint check [06:26]
Diablo-D3 the actual meat and potatoes of your code is simple, the magic is hidden behind a compiler plugin/transpiler/whatever your language does [06:27]
Diablo-D3 matsurago: I made that mistake like once [06:27]
CuriousErnestBro Okay I'm just going to create two files with similar code [06:27]
Diablo-D3 used default javadoc lint settings in... eclipse? something [06:27]
sbalmos dreamreal: was her last name Artois? [06:27]
CuriousErnestBro Just because I don't know what this library is doing under the hood [06:27]
Diablo-D3 I very promptly fucking turned that off [06:27]
CuriousErnestBro And I can't be bothered to find out [06:27]
dreamreal sbalmos: I don't know, "Stella" seems really common in noir fiction for some reason [06:27]
Diablo-D3 and then I turned javadoc off entirely [06:28]
CuriousErnestBro dreamreal, my noob teacher puts ALL THE CODE in one try block [06:31]
CuriousErnestBro lol [06:31]
CuriousErnestBro I don't think this is good practice, but I'm not sure [06:31]
sbalmos depends [06:31]
Diablo-D3 CuriousErnestBro: eh, Ive done it [06:32]
usempire [usempire!] has joined ##java [06:32]
Diablo-D3 dealing with badly written but popular frameworks that literally every method could drop an exception in my lap [06:33]
Diablo-D3 but the whole operation was a failure if any of the methods called failed, in my case [06:33]
Diablo-D3 so fuck it, try the whole thing, like 30+ lines [06:33]
Diablo-D3 also, once wrote an app that tried to keep itself running at all costs, had a main that caught the exception, printed it, and then started the actual real main function again [06:35]
shan [shan!~shan@unaffiliated/jasatso1301] has joined ##java [06:36]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0::449] has joined ##java [06:36]
FabioP [FabioP!] has joined ##java [06:38]
oxum [oxum!~oxum@] has joined ##java [06:39]
bluewhistle Hi, I'm going through gc logs, and I see that the size of the eden space goes on shrinking to about 5% of the total heap size before a mixed gc occurs. Why is this happening? [06:46]
bluewhistle please help [06:47]
mbooth bluewhistle: What would be the point of gc'ing before it is necessary? What problem are you trying to solve? [06:48]
Diablo-D3 are you actually having performance issues? [06:48]
bluewhistle My java app evening hangs, i.e. all API latencies shoot up 10x after a few days of running [06:48]
bluewhistle Upon restarting, everything goes back to norma [06:48]
bluewhistle This usually happens after 1,2 or 7 days of running [06:49]
Diablo-D3 that seems very weird, are you sure you're not accidentally leaking memory and you're now swapping? [06:49]
bluewhistle I've already investigated thread dumps and everything seems to be fine [06:49]
mbooth Heap dumps would be more instructive that thread dumps, don't you think? [06:50]
bluewhistle total heap used remains below the max heap size [06:50]
bluewhistle I don't get any Out of memory errors in the logs [06:50]
Diablo-D3 whats your actual max heap size? [06:50]
bluewhistle 10gb [06:50]
Diablo-D3 and how much ram is in the machine? [06:50]
bluewhistle 16gb [06:50]
Diablo-D3 and is anything else running on that machine? [06:50]
bluewhistle the app is running on a mesos cluster [06:51]
Diablo-D3 I mean in that vm [06:51]
bluewhistle yes [06:51]
bluewhistle there are other apps running as well [06:51]
Diablo-D3 okay, so, does that vm have swap? [06:51]
bluewhistle No, I don't think so [06:51]
Diablo-D3 if it does, it shouldnt [06:51]
Diablo-D3 but Im assuming you actually have a sizable chunk of free ram and theres no swap [06:52]
bluewhistle yes, there should be adequate ram [06:52]
Diablo-D3 max heap size is also a suggestion, btw, the VM will continue using more if it has to [06:52]
bluewhistle I see that minor gc is happening very frequently [06:53]
bluewhistle application time is typically 1-2 seconds [06:53]
bluewhistle many times below 1 s [06:53]
bluewhistle I have not explicitly passed any VM parameters to set the young and tenured gen sizes [06:54]
bluewhistle But I see that the eden space is only about 1gb [06:54]
CuriousErnestBro Can you declare this. Variables in a method without initializing it in the class body? [06:54]
bluewhistle Should I explicitly increase the young generation size? [06:54]
Diablo-D3 bluewhistle: try it [06:55]
Diablo-D3 try all the knobs and see which direction it sends you [06:55]
bluewhistle ok [06:55]
benskey [benskey!] has joined ##java [06:57]
con3|2 [con3|2!~kvirc@] has joined ##java [06:59]
surial just put some positive lookahead in a negative lookbehind section in a regexp. [07:00]
surial If the world ends in a paradox soon, it wasn't CERN, and I apologize. [07:00]
Diablo-D3 surial: as ugly as that is, that SHOULD work [07:03]
mbooth CuriousErnestBro: Are you asking if you can declare class member variables without declaring class member variables? [07:05]
CuriousErnestBro mbooth, yes.. [07:05]
mbooth Okay, then no, you need to declare them. [07:05]
CuriousErnestBro Coming from python I thought this would be available [07:05]
CuriousErnestBro What do I need to do if I want to execute a non-static function in my main function? [07:06]
mbooth CuriousErnestBro: You need an instance of the class in order to call non-static methods (this *is* like python...) [07:07]
mbooth static methods are kinda like python class methods [07:07]
CuriousErnestBro Alright [07:09]
CuriousErnestBro Thanks :) [07:09]
ankk [ankk!b9dc98f9@unaffiliated/ankk] has joined ##java [07:10]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [07:12]
ankk hi [07:12]
ankk i am configuring ehcache and there is an example here, [07:12]
ankk there are on-heap, off-heap, disk options as memory [07:13]
ankk but they specify probably entry count for heap option and MB value for offheap option [07:13]
CuriousErnestBro while declaring an array, can you already tell java how long it's going to be? [07:14]
CuriousErnestBro Without creating it [07:14]
ankk hmmm [07:15]
ankk so we create array on heap? [07:15]
db CuriousErnestBro: no. what would that mean? [07:15]
ankk ahah.. somehow i get that as answer to my question [07:16]
db ankk: I don't see a question [07:16]
CuriousErnestBro db, something like: public class SomeClass { someVariable[] myArray "is 6 long"} [07:16]
surial CuriousErnestBro: you're confused. [07:16]
ankk db why do we specify entry count for on-heap but we specify MB value for off-heap on ehcache? [07:17]
surial CuriousErnestBro: REALLY confused. [07:17]
db CuriousErnestBro: not possible - which problem are you trying to solve? [07:17]
surial CuriousErnestBro: first of all, 'myArray' is the variable, and what you wrote as 'someVariable' is in fact the component type. [07:17]
surial 'variable' is completely the wrong name there. [07:17]
CuriousErnestBro surial, my bad I wanted to say "component type" but didn't know the name [07:17]
surial CuriousErnestBro: int[] would be a type. Java does not support the notion of 'I am a variable; I point either at null, or, at int arrays exactly 6 slots large". [07:17]
mbooth ankk: This is probably a question for the library authors... [07:17]
ankk hmmm.. it is not an obligation.. [07:17]
surial in fact, virtually no languages do and that is a bizarre restriction. [07:17]
ankk thank you [07:17]
surial CuriousErnestBro: int[] x = new int[6]; is fine; here x is a variable, restricted to point either at nothing (null) or at an instance of an int array. and 'new int [6]' makes a new int array with 6 slots, each slot pre-filled with 0. [07:18]
CuriousErnestBro surial, so myArray is just a pointer [07:18]
ankk i thought it is somehow techical limitation [07:18]
CuriousErnestBro Got it [07:18]
surial CuriousErnestBro: indeed. [07:18]
conan [conan!] has joined ##java [07:19]
db ankk: I can only guess - on heap you're storing objects, the size of which is not 100% known (like how many bytes is your object?) and the vm handles the memory. but when you go off-heap, you need to declare at least how much memory to allocate [07:20]
Peste_Bubonica [Peste_Bubonica!~Peste_Bub@unaffiliated/peste-bubonica/x-4612396] has joined ##java [07:21]
CookieM [CookieM!] has joined ##java [07:22]
feannag [feannag!~feannag@2405:204:9321:b824:c96:39f:af01:444] has joined ##java [07:25]
CuriousErnestBro On another note: holy shit IDEA is battery hungry [07:26]
AMcBain [AMcBain!] has joined ##java [07:26]
matsurago CuriousErnestBro: File -> Enable Power Save Mode [07:26]
db srsly? IDEA has a power save mode? [07:27]
matsurago db: always had [07:27]
CuriousErnestBro Thanks matsurago [07:28]
CuriousErnestBro My battery is at 0% and it's barely charging [07:28]
Diablo-D3 it just turns off anything that automatically does something [07:29]
Diablo-D3 kinda wish it could snoop on win10's battery api [07:29]
CuriousErnestBro Oh no more autocomplete :( [07:31]
Diablo-D3 you know what I want in normal windows? [07:32]
CuriousErnestBro That's the most useful feature because it auto imports stuff [07:32]
Diablo-D3 that per-app rdp stuff rdp servr has [07:32]
Diablo-D3 I think it can autocomplete, but not recompile the index [07:32]
Diablo-D3 its documented in the docs somewhere [07:32]
snowmanbamm [snowmanbamm!snowmanbam@gateway/vpn/privateinternetaccess/snowmanbamm] has joined ##java [07:34]
con3 [con3!~kvirc@] has joined ##java [07:52]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [07:55]
di0_ [di0_!~di0_@unaffiliated/di0-/x-5053590] has joined ##java [07:59]
serdar Good Afternoon [08:08]
serdar Here is my stupid question of the day: [08:08]
serdar If B is a subclass of A, so B is driven from A, why can I not cast (Set<B>) setOfA [08:09]
odinsbane serdar: because there could be a C implements A, that you could add to a Set<A>, but not a Set<B>. [08:11]
db because now you could add C (subclass of A) to your set of B [08:11]
surial serdar: Wait, hold on. You CAN do that. [08:11]
surial serdar: odinsbane and db both gave you a wrong answer. [08:11]
surial serdar: I presume what you're asking about is the fact that, when you write Set<Number> numbers = numbers; Set<Integer> integers = (Set<Integer>) numbers; ? you get a _warning_. [08:12]
serdar Inconvertible Types, yes [08:12]
surial serdar: generics are compiled-checked documentation; they are figments of the compiler's imagination. This stuff disappears after compilation and the VM doesn't check any of this. the cast operation means 3 very different things... [08:12]
odinsbane What's wrong with what I said? [08:12]
surial serdar: if the thing in the parens is a primitive: double x = (double) z; it is conversion. It converts values. [08:13]
surial serdar: if the thing in parens is not primitive and doesn't have generics, it is a runtime-checked type assertion: String x = (String) someObject; is not a conversion; it is a no-op: It does nothing... unless 'someObject' is NOT a string (at runtime), then it throws. [08:13]
surial serdar: finally, if the thing in parens has generics, it is an UNCHECKED type assertion. You are asserting a fact and the compiler AND runtime will just assume you're right without checking anything. [08:13]
surial serdar: so, List<String> x = (List<String>) someListButNotOfStrings; _IS A LITERAL NO-OP_ ? that does nothing whatsoever other than make the compiler not complain about it. if non-strings are in there, that will work. and later on when you READ from that list, you'd get a ClassCastException even though you aren't casting anything then. [08:14]
db error: incompatible types: Set<Integer> cannot be converted to Set<Number> [08:14]
surial so.. List<Object> list = new ArrayList<Object>(); list.add(new Integer(5)); List<String> thisIsALie = (List<String>) list; // this runs and compiles... [08:14]
db it's not a warning [08:14]
surial that's bizarre. [08:15]
surial but then add: Integer z = thisIsALie.get(0); and you get a ClassCastEx here, even though tehre is no cast. [08:15]
surial The solution is not to cast to generics at all, because this is too confusing to allow. [08:15]
surial Then I guess java in trying to be 'helpful' is ALSO applying generics invariant/covariant/contravariant assignment rules, which are an entirely different beast. [08:15]
surial and also complex to explain. [08:16]
surial serdar: still need that explanation too? [08:16]
db [08:16]
surial db: okay, so, there are 2 separate issues. What I said, plus invariant rules. [08:16]
CuriousErnestBro int a; and int a = null; is the same thing right? [08:17]
surial CuriousErnestBro: no. [08:17]
surial CuriousErnestBro: first of all, int a = null; is a compiler error; ints cannot be null. [08:17]
CuriousErnestBro Oh okay [08:17]
surial CuriousErnestBro: secondly, fields default to null/0/false/'\0', locals do not default to anything. [08:17]
surial you can't use 'a' until you are in a code path that definitely assigns something to it. [08:18]
surial so 'int a;' and int a = 0;' are the same only if a is a field; if a local, they are not. [08:18]
CuriousErnestBro What does "field" and "locals" mean? Are fields this. variables? [08:18]
spuz [spuz!6dee4b8e@gateway/web/cgi-irc/] has joined ##java [08:18]
surial public class SomeClass { int iAmAField; public void method() { int iAmALocal; } [08:19]
CuriousErnestBro Okay got it [08:19]
serdar I got something like this [08:19]
serdar [08:19]
CuriousErnestBro So componentType a; defaults to null? [08:19]
CuriousErnestBro surial, also are component types and fields the same thing? [08:20]
serdar The instance of B, C, D always get's Set<A> for nodes [08:20]
odinsbane serdar: What are you trying to accomplish? [08:20]
serdar instanceOfB.getNodes() is always Set<A> [08:20]
odinsbane It's a Set. [08:21]
serdar I want to cast it to Set<B> instead :) [08:21]
odinsbane serdar: you might want a parameter of your class then. [08:21]
surial CuriousErnestBro: not at all. [08:22]
surial CuriousErnestBro: you're extremely confused. [08:22]
surial CuriousErnestBro: all of this stuff can just be looked up in the tutorials or the JVM. If you don't have a good grasp on terminology, ask / google. [08:22]
CuriousErnestBro okay [08:22]
serdar odinsbane, not sure what exactly you mean [08:22]
odinsbane serdar: Also, I was a bit confused by your instanceof. If you want the generic parameter of your Set to change you'll need to parameterize it. [08:22]
surial CuriousErnestBro: 'component type' refers to the X in X[] - it means the type before [] symbols. Outside of arrays the term means nothing. [08:22]
CuriousErnestBro Okay gotcha [08:22]
surial CuriousErnestBro: fields are 'variables' belonging to an instance (or if static, to a class) - they occur immediately inside the {} that goes with a class/interface declaration. [08:23]
surial serdar: then your getNodes() method is badly defined. I suggest you fix that instead. [08:23]
surial serdar: it is in fact, BROKEN. [08:23]
surial serdar: it should return either a Set<? extends A>, which is not that useful but at least not broken, or, it should return a Set<Z> where Z is itself, which is possible but a little tricky. enum does it. [08:24]
led_dark_1 [led_dark_1!~Thunderbi@] has joined ##java [08:24]
odinsbane serdar: It's a little tricky because it is not clear what you want to accomplish. You could make a, class A<T extends A>{ Set<T> nodes;}, then class B extends A<B>; [08:26]
serdar Hmm I try to explain: I am trying to populate information from BModel to BData Object. So I am copying everything over and it looks okay so far, but copying nodes seems tricky [08:31]
hussam [hussam!uid193284@gateway/web/] has joined ##java [08:34]
Pillus [Pillus!sid14656@gateway/web/] has joined ##java [08:34]
surial serdar: sounds like 'self-type' is useful then. [08:36]
surial serdar: public abstract class ParentNodeType<S extends ParentNodeType<S>> { .... use 'S' as self type, so if getNodes() returns only self elements.. public abstract Set<S> getNodes(); } [08:37]
surial serdar: then to extend it: public class ConcreteNodeType extends ParentNodeType<ConcreteNodeType> { public Set<ConcreteNodeType> getNOdes() { ... }} [08:37]
dreamreal re [08:38]
serdar I am trying to build a new HashSet and add all entry while casting [08:39]
surial serdar: that's a solution, not a problem. (a bad solution). There is probably no need for casting, and in addition, those casts aren't doing what you want anyway. [08:39]
surial serdar: perhaps it is time for you to pastebin something. [08:39]
led_dark_1 [led_dark_1!~Thunderbi@] has joined ##java [08:42]
zalt__ [zalt__!~devp@unaffiliated/lambda443] has joined ##java [08:44]
Suchorski [Suchorski!~regex@unaffiliated/suchorski] has joined ##java [08:44]
serdar [08:45]
tomboy64 [tomboy64!~tomboy64@gateway/tor-sasl/tomboy64] has joined ##java [08:47]
dreamreal YEEEKS [08:47]
dreamreal serdar: delete that immediately [08:47]
dreamreal remove it from the interwebs [08:48]
dreamreal lines 1-7! ARRGH [08:48]
spuz pastebin is blocked at work and now i'm curious [08:48]
Arlion [Arlion!~Arlion@unaffiliated/arlion] has joined ##java [08:48]
odinsbane It's a license agreement, to not share the code. [08:49]
dreamreal spuz: the code itself is not interesting, but line 2 is: "copyright (c) 2020 by..." and line 3 is "this software is the confidential and proprietary..." [08:49]
spuz lolllll [08:49]
dreamreal i.e., abort abort abort danger will robinson! [08:49]
surial serdar: random notes as I go through it: You can remove those validate things and replace em with lombok @NonNulls... and other than that this code doesn't do anything and doesn't make it any easier for us to help you :( [08:50]
dreamreal serdar: pasting real code is a good thing, pasting COPYRIGHTED and LIMITED code - again, lines 1-7 - is an AWFUL thing for all involved [08:51]
dreamreal you're better off writing an analog and pasting THAT [08:51]
odinsbane Also, the names are kinda long. [08:52]
odinsbane (for an example, maybe not the actual codebase.) [08:52]
dreamreal I didn't read them enough to judge, as I have no right to read the code and have not entered into any agreement with the rightful owner of the code and have no interest in doing so [08:52]
spuz sounds like the copyright notice worked then [08:59]
surial dreamreal: did I tell you the parable of the brick through the window and the email disclaimer? [08:59]
spuz lesson: when posting confidential code, make sure you take out the copyright notice first [08:59]
yottabyte [yottabyte!uid195082@gateway/web/] has joined ##java [08:59]
surial dreamreal: If it causes legal issues for you to read this code because it has that disclaimer on the front, then legally speaking I can take a brick, write a note saying: By accepting this brick through your window you indemnify me from all costs associated with this action, wrap it around the brick, and throw it through your window. [09:00]
surial of course, you do live in a fucking banana republic with an idiotic legal system, so I get that you're a spot more concerned about it all, but even in that backwater you should really be fine. [09:00]
surial always has trouble with being condescending to the colonies. [09:01]
yottabyte surial: can we continue that discussion from last night when you get a chance? about the concrete class method dispatching [09:01]
surial yottabyte: probably. Refresh my memory ;) [09:01]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [09:01]
rajrajraj [rajrajraj!uid72176@gateway/web/] has joined ##java [09:01]
dreamreal surial: I think you're misidentifying my concern [09:02]
yottabyte so I have like MyAbstractClass a = new ConcreteTypeA(); and MyAbstractClass b = new ConcreteTypeB(); I have methods that accept ConcreteTypeA and ConcreteTypeB. I want the proper one to be called without having to do instanceof all over the place. What is the best approach for this? [09:02]
surial yottabyte: depends. [09:02]
dreamreal your point's not mistaken or missed, but it's not in the same arena as MY point :) [09:02]
yottabyte I saw this: but it's a bit different than what I'm dealing with, nor am I sure if it's a good way of doing it [09:03]
serdar [serdar!] has joined ##java [09:03]
surial yottabyte: so many ways to go. (SPI or hardcoded) + (map-o-handlers or list-o-handlers), instanceof in preparation for pattern switch in JDK14, overloads... [09:03]
dreamreal yottabyte: for context, what are you trying to do? What's the problem? [09:03]
dreamreal ah, I see [09:03]
yottabyte SPI or hardcoded? map or list? not sure what those are [09:04]
yottabyte I do have overloaded methods here [09:04]
surial yottabyte: if the multiple dispatch nature of things is a runtime effect (so, the expression of type AbstractParent, but it is an instance of ConcreteSubType, and you have code specifically for dealing with ConcreteSubType.. in contrast with having an expression of type ConcreteSubType), then forget the overload issue, or that wikipedia link. [09:04]
serdar How can I delete it? [09:05]
surial serdar: with the mouse, select the text. Then, press the backspace button. [09:05]
serdar I already did that, but is it deleted then in pastebin? There is no save button [09:05]
surial serdar: heh. just pastebin again, I think. [09:05]
surial serdar: however, as Isaid, that paste is just boilerplate, no actual code and doesn't help us help you. [09:06]
surial yottabyte: well, the problem is, there are so many approaches... perhaps elaborate on the specific situation. [09:06]
surial yottabyte: some useful answers would be answers to these questions: [09:06]
yottabyte surial: it is indeed a runtime effect. so I'm using the JOINED inheritance strategy for JPA entities, my repository returns concrete types, but it's a List<AbstractParent>. I want to do things with them based on the instances [09:07]
yottabyte well I guess my repository returns the abstract types, but they are instances of the concrete type (naturally) [09:07]
surial yottabyte: Is the list of concrete sub types large (let's say 10+) or small? is it hierarchical (children, grandchildren, grand-grand children, or just 1 parent class and 20 subclasses of that, that is all)? Will the list of sub types likely grow in future or are updates to the list of child types not common? Is it supposed to be 'pluggable'? [09:07]
surial yottabyte: okay, well, that's wrong in any case; it should be List<? extends AbstractParent>. [09:07]
surial But that's a minor niggle. [09:08]
surial actually, nevermind, List<AbstractParent> may even be right. [09:08]
yottabyte list of subtypes will indeed grow. it's only one level deep, 1 parent, with many sublcasses. List<AbstractParent> does work [09:08]
surial 'work' isn't the same as 'correct', but let's move on from that, it mostly doesn't matter. [09:08]
surial so, many is, like, what, 100? [09:09]
surial The general outlay is going to be that you have a data structure with handlers. Most likely Map<Class<? extends Parent>, Handler<? extends Parent>>. Possibly List<Handler>. [09:09]
yottabyte no, like 3, but I have other inheritance hierarchies which are like 30+ subclasses [09:09]
yottabyte so I'm trying to design this one better [09:10]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0::449] has joined ##java [09:10]
surial In the map case you look up the concrete type in the map, on failure look up the superclass until you hit Parent or null and then fail (no handler found). In the handler case, you just give the object to allllll the handlers and each handler decides itself whether it is capable of handling it or not. [09:10]
yottabyte because the last one is riddled with instanceof [09:10]
yottabyte wow [09:10]
yottabyte how can the handler decide itself whether it's capable or not? [09:11]
dreamreal lots of ways for THAT, too [09:11]
dreamreal it might use instanceof itself, for example [09:11]
surial yottabyte: whatever way you want. It does mean that every lookup will hit every handler (if you have 500, there is a small chance this is a performance issue); a bigger issue is that every handler now needs code to decide. With the map solution the handlers just have a method accept(ConcreteSubTypeThisIsAHandlerFor obj); [09:15]
waz_ [waz_!~waz@pdpc/supporter/active/waz] has joined ##java [09:19]
CuriousErnestBro I have something I can do using functions and return statements [09:22]
CuriousErnestBro Should I do it this way or use classes [09:22]
dreamreal excellent! [09:22]
CuriousErnestBro I feel like classes aren't necessary in this case tbh [09:23]
dreamreal I dunno, make it work, learn to trust yourself, stop asking us [09:23]
dreamreal you're using java? [09:23]
CuriousErnestBro Of course [09:23]
dreamreal then classes are necessary. [09:23]
dreamreal next [09:23]
dreamreal Another satisfied customer. Next! [09:23]
CuriousErnestBro wouldn't dare to show his face here otherwise [09:23]
CuriousErnestBro dreamreal, yeah the class that is like the filename but in this use case I could also do it with static functions [09:23]
CuriousErnestBro So I don't need to keep track of some state [09:24]
dreamreal CuriousErnestBro: I said it earlier: just MAKE IT WORK [09:24]
dreamreal then make it pretty if necessary [09:24]
CuriousErnestBro It's working [09:24]
surial yottabyte: [09:24]
dreamreal but step 1 is still the king [09:24]
surial yottabyte: thta should get you going. [09:24]
CuriousErnestBro Now is refactoring time dreamreal [09:24]
bluezone [bluezone!uid104970@gateway/web/] has joined ##java [09:24]
CuriousErnestBro I got all the answers I needed for my assignment [09:24]
yokel [yokel!~yokel@unaffiliated/contempt] has joined ##java [09:24]
dreamreal CuriousErnestBro: if step 1 is accomplished, then step 2 becomes curiously irrelevant. Especially for homework. [09:25]
surial yottabyte: SPI is an addition to this principle, where you no longer have to call .register() at all; all you need to do is put 1 annotation on any handler class and thingsj ust work out; all such classes are found automatically (and it is thus pluggable: if a class that handles things is on the classpath, it gets registered automatically, if not, it won't). [09:25]
CuriousErnestBro dreamreal, yeah they will read our code and give points for good code [09:28]
matsurago CuriousErnestBro: that what everyone does when switching languages. Trying to apply the way of programming in one language to another just with a different syntax. That of course produces strange code and the new language seems more like constraining than liberating. Once you abandon Python thinking and learn Java way, you'll be fine. [09:28]
CuriousErnestBro Then again, my professor is a shit coder [09:28]
surial CuriousErnestBro: the problem is, not quite everybody agrees on style.. especially professors who have bizarre notions. So if you tell us: Hey, I get graded on style, okay, great! Please provide a clear and specific style guide and we'll help you out. Without it.. Ż\_(?)_/Ż dafuq you want us to do about ut :P [09:29]
CuriousErnestBro matsurago, alright, I'm doing it the classes way even though classes are not necessary. You're right, I did it because the python way is "only use classes if necessary" [09:29]
dreamreal CuriousErnestBro: and what you get is "does it work? yes? finito then" [09:29]
CuriousErnestBro is a java programmer now :D [09:29]
dreamreal without a functioning rubric that's really all we CAN do [09:30]
CuriousErnestBro Yeah, it's time to struggle with LaTeX now [09:30]
Anticom [Anticom!] has joined ##java [09:30]
dreamreal hands CuriousErnestBro LyX [09:30]
CuriousErnestBro dreamreal, I'll take a look, but I was intending on using Rmarkdown [09:31]
xSama [xSama!] has joined ##java [09:31]
matsurago wrote the entire thesis in Geany [09:31]
dreamreal shrugs. Whatever floats your boat, man [09:31]
dreamreal I wrote my last book in asciidoctor, decided I'd never do that again - writing the book itself was *great* but getting it ready for submission was awful [09:31]
dreamreal had to generate docbook and PDF from THAT [09:32]
dreamreal a friend is using asciidoctor for ANOTHER book, I'm trying to figure out what his toolchain will be, because if it's better I'd rather do that [09:32]
dreamreal otherwise... Word [09:32]
matsurago Well, most of the time TeX is nice, because you can download the needed style directly from publisher's website [09:32]
matsurago But I guess it works better with papers than with books :) [09:33]
dreamreal possibly, I've never written a formal paper with TeX and most publishers want submission in Word although they'll accept PDF [09:34]
Diablo-D3 asciidoctor looks kinda neat [09:34]
dreamreal Diablo-D3: it's great, it's like what markdown would want to be when it grows up. It's just that the tooling around .docx blows... not really asciidoctor's fault [09:34]
Diablo-D3 oh, thats its native format? eh [09:35]
Diablo-D3 could be worse [09:35]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [09:35]
enoq [enoq!] has joined ##java [09:35]
Diablo-D3 you havent lived until you've shot yourself in the foot with odt [09:36]
cheeser dreamreal: talk to dan allen maybe? [09:39]
jamezp [jamezp!~jamezp@redhat/jboss/jamezp] has joined ##java [09:40]
bluezone TeX drives me crazy [09:43]
Arlion [Arlion!~Arlion@unaffiliated/arlion] has joined ##java [09:45]
Xiti` [Xiti`!~Xiti-@unaffiliated/xiti] has joined ##java [09:47]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [09:57]
dreamreal cheeser: I have [09:58]
db bluezone: use word [09:58]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [09:58]
tilerendering hey [09:59]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [09:59]
db hey! [09:59]
tilerendering I do a em.createNativeQuery ?> the query updates several entries in a table. in order to invoke that query, should I use getResultList ? [10:00]
tilerendering I tried to use .executeUpdate but I get the exception that this is the wrong type of query for that [10:00]
dreamreal is it an update query? [10:01]
tilerendering it is, but it s a native query [10:01]
dreamreal I got that, because you said it was a native query [10:01]
tilerendering ok [10:02]
dreamreal what's the exact message executeUpdate() gives you [10:02]
tilerendering it doesnt - I get an illegalstateexception [10:02]
tilerendering ? java.lang.IllegalStateException: You cannot call executeUpdate() on this query. It is the incorrect query type.? [10:02]
dreamreal that's indeed a message executeUpdate is giving you. Can you show us more detail? [10:03]
tilerendering the query is q, and it s declared as: Query q = em.createNativeQuery(?UPDATE tablename SET fielda=?bla? .. ? etc. [10:03]
maroloccio [maroloccio!~marolocci@] has joined ##java [10:03]
dreamreal hmm, that is... odd [10:04]
tilerendering maybe the query string itself is flawed. [10:04]
tilerendering I ll have to test that. just wondered whether executeupdate was the right method to call for a native query [10:05]
dreamreal It would be, yes [10:05]
tilerendering (if it involves updates) [10:05]
tilerendering ok [10:05]
tilerendering so it s probably the query itself [10:05]
tilerendering I ll give it another try with q.getResultList however. [10:05]
tilerendering ahhhh! now I get a more verbose error msg. this time from the postgresql driver. very good. [10:07]
tilerendering indeed I referenced a wrong fieldname. [10:08]
cixx [cixx!~user@] has joined ##java [10:09]
dreamreal tilerendering ++ finding the solution [10:09]
dreamreal tilerendering has a karma level of 1, dreamreal [10:09]
yottabyte surial: thanks, very cool stuff. I'll try to understand your post and ask questions if I have any [10:12]
tilerendering dreamreal: thanks, it s not yet the solution yet however [10:19]
fahadash [fahadash!uid44972@gateway/web/] has joined ##java [10:25]
CuriousErnestBro The downside of doing it the java way is that I have a bunch of this. Variables in my code [10:27]
surial Oh no! Not variables! [10:27]
CuriousErnestBro or.... I could create a variable that points to that like: Type a = this.a; [10:27]
surial pastebin your stuff. [10:28]
CuriousErnestBro Is this bad somehow? [10:28]
surial pastebin your stuff. [10:28]
CuriousErnestBro Yeah I'm going to paste a gist because this is going to be graded [10:28]
CuriousErnestBro One sec [10:28]
CuriousErnestBro surial, [10:31]
dreamreal ponders [10:31]
dreamreal bwahaha, line 66 [10:31]
dreamreal Why do you need "this." in your code? [10:32]
dreamreal That sounds like a pythonism, not a java-ism [10:32]
CuriousErnestBro dreamreal, what's funny about line 66 [10:32]
dreamreal you don't need "this." unless you're scoping to the instance, by default a name is scoped to the instance unless it's shadowed by something locally [10:33]
CuriousErnestBro e.printStackTrace() [10:33]
CuriousErnestBro dreamreal, ohhh okay [10:33]
CuriousErnestBro So I can remove all "this" [10:33]
Arlion [Arlion!~Arlion@unaffiliated/arlion] has joined ##java [10:33]
dreamreal I dunno, I'm not reading the code deeply enough for that [10:33]
dreamreal Probably, though [10:33]
CuriousErnestBro So if I have: int a; in my class body (what's the name for such a variable again?) and I create: int a = 3, I can still refer to the class body variable by doing this.a [10:34]
surial CuriousErnestBro: do not. ever. write catch(Thing) { e.printSTackTrace() }. [10:34]
CuriousErnestBro That's what you mean right? [10:34]
surial CuriousErnestBro: 'in the class body'? A field. yes, 'this.a' will definitely refer to a field even if 'a' is shadowed. Just.. don't shadow, and you don't need 'this.'. [10:34]
CuriousErnestBro surial, I blame my teacher for it, I copied that try catch block from her [10:35]
surial CuriousErnestBro: it's weird that your constructor does this much work, but, I guess. Put 'throws IloException' on there. [10:35]
surial CuriousErnestBro: well, it's fucking idiotic. [10:35]
dreamreal CuriousErnestBro: yes, the INSTANCE "a" is shadowed by the local "a" in a method. To refer to the instance you'd have to use this. - thus, mutators often look like "void setThing(int a) { this.a=a;} [10:35]
surial CuriousErnestBro: exceptions contain 4 useful bits of info: Type, message, trace, and cause. [10:35]
surial CuriousErnestBro: you're tossing 3 out of the 4 things AND continuing with the program even though shit is broken. So that's 4 losers. [10:35]
surial CuriousErnestBro: i.e. fucking idiotic. [10:35]
dreamreal tried to gently warn CuriousErnestBro that the tsunami was on its way [10:36]
surial CuriousErnestBro: if you must catch stuff and have no idea what to do, your fallback is 'throw new RuntimeException("Unhandled", e);' instead of 'e.printStackTrace();' - this preserves ALL 4 bits of info AND ensures execution does not continue. [10:36]
surial CuriousErnestBro: it's just as short. Strictly superior. Hence: Never. ever. write e.printSTackTrace() again. Don't even copy again. [10:36]
CuriousErnestBro dreamreal, I didn't see your warning, besides I like this: I learn. [10:36]
dreamreal CuriousErnestBro: it's why I pointed out line 66... [10:37]
CuriousErnestBro Ahhh :) [10:37]
Arlion [Arlion!~Arlion@unaffiliated/arlion] has joined ##java [10:37]
mizi [mizi!] has joined ##java [10:37]
surial CuriousErnestBro: same for 112, etc. Note, you can put 'throws Exception' on your main. no problem. [10:37]
surial in fact, any entrypoint should usually have that. [10:37]
waz CuriousErnestBro ++ [10:37]
waz curiousernestbro has a karma level of 1, waz [10:37]
dreamreal and yes, learning is a lot better than internalizing invective, which is an option many on IRC choose [10:38]
CuriousErnestBro surial, so I can put 'throws Exception' in my main and remove the try-catch blocks? [10:39]
dreamreal and this is pretty mild as far as such invective goes [10:39]
dreamreal CuriousErnestBro: try it and see (and yes) [10:39]
CuriousErnestBro -tias [10:39]
CuriousErnestBro tias [10:39]
CuriousErnestBro Try it and see. You learn much more by experimentation than by asking without having even tried. [10:39]
CuriousErnestBro this is confusing me even further: [10:42]
CuriousErnestBro [10:42]
CuriousErnestBro CuriousErnestBro's title: "java - Throwing exception in main method - Stack Overflow" [10:42]
CuriousErnestBro Is this what you guys mean? [10:42]
surial CuriousErnestBro: what's confusing about it? [10:42]
dreamreal CuriousErnestBro: look... public static void main(String[] args) throws Exception {} // now fill in that method with whatever crap you want [10:42]
dreamreal make it compile (i.e., have the constructor throw the exception if you don't want to handle it) [10:43]
surial CuriousErnestBro: a thrown exception will just keep 'aborting' the method call stack until it hits a catch block that handles it. if it 'aborts' your public static void main(), then the app exits, and you get all 4 bits of relevant info printed on the console, which is generally what you want. The one caveat is that if you have a so-called checked exception, the compiler forces you to either catch it, or add a 'throws X' line. [10:43]
surial We're telling you that adding the throws X to the method signature is the best solution here. [10:43]
dreamreal the advice in the first answer ("I don't think it is really a good idea...") is ... easily debated [10:43]
CuriousErnestBro dreamreal, can I also do throws IloException {}? [10:44]
surial yes. [10:44]
dreamreal did you try it? :) Seriously, get a decent IDE, type the code, see what the IDE says [10:44]
dreamreal all of the good ones will point out when you've done something you can't do [10:45]
dreamreal even Eclipse! [10:45]
CuriousErnestBro ohhh this makes sense now [10:45]
CuriousErnestBro I tried it [10:45]
CuriousErnestBro I need to put throws IloException at every function where I have a try-catch block [10:45]
dreamreal and so the world is made a tiny tiny bit better through the inculcation of knowledge [10:46]
dreamreal well... no [10:46]
dreamreal you need to put a throws statement whenever you DON'T resolve an exception, that means the exception is passed to the caller [10:46]
CuriousErnestBro dreamreal, and remove the try-catch block [10:46]
dreamreal ah, well, you didn't say THAT [10:46]
CuriousErnestBro It makes sense [10:46]
dreamreal but that's workable, yes [10:46]
CuriousErnestBro Yeah sorry [10:46]
dreamreal no worries, I was just answering the situation you actually presented and not the conditions you meant [10:47]
dreamreal "Put the peanut butter on the bread" "Okay, the jar is on the bread, now what" [10:47]
sbalmos dreamreal: crack open the jar [10:48]
dreamreal sbalmos: on the counter? got it! [10:48]
dreamreal watches the jar shatter. Now what? [10:48]
cheeser there's glass everywhere. now what? [10:48]
sbalmos dreamreal: well, that works [10:48]
dreamreal cheeser ++ [10:48]
dreamreal cheeser has a karma level of 1,527, dreamreal [10:48]
sbalmos cheeser / dreamreal: You said you preferred crunchy peanut butter! [10:48]
dreamreal I said nothing of the sort, although I do - it's great for weeding out the allergic [10:49]
sbalmos dreamreal: You should've been more specific in your requirements definition. That now requires a change order, $$$, and another 3 sprints. [10:49]
jamezp [jamezp!~jamezp@redhat/jboss/jamezp] has joined ##java [10:49]
dreamreal I didn't want the freaking... oh wait [10:50]
cheeser sbalmos: sounds sweaty [10:50]
sbalmos cheeser: It's good for you. No pain, no gain. [10:50]
cheeser No pain, ... no pain! [10:51]
CuriousErnestBro Should I email my professor with this suggestion? [10:52]
CuriousErnestBro will start my email with "FYI..." [10:52]
CuriousErnestBro waz, why did you give me the points? [10:52]
CuriousErnestBro Thanks btw [10:53]
dreamreal CuriousErnestBro: if the prof is open to learning from people who actually know what they're about, sure [10:53]
waz because you ignore the over the top insult and listened to the solid advice included with it [10:53]
dreamreal the points are for a good attitude [10:53]
dreamreal you'll do fine in the industry (and life) with that kind of approach [10:54]
cheeser who's a good boy? who's a good boy? you are! yeah. you are! good boy! *tummy scratches ensue* [10:54]
matsurago Well, personally I think it makes little sense to learn Java in a college. Professors would not know the common/best practices, would not teach necessary tools (like to always create a project with Maven or Gradle), and in general Java is not the best language to teach Computer Science. [10:54]
CuriousErnestBro This is my approach tbh: [10:54]
dreamreal sure hopes cheeser cleaned all the peanut butter with embedded glass shards first... [10:54]
CuriousErnestBro doesn't take things personally that quickly anymore [10:55]
cheeser dreamreal: he's not *that* good... [10:55]
surial dreamreal: My gf told me to to the store and get some bread. and if they have eggs, get 10. They had eggs, so I returned with 10 loaves of bread. [10:56]
CuriousErnestBro As my little brother says: "A wise man once said: it's better to shut up than to talk out of your ass, and that wise man is me" [10:57]
surial matsurago: there is a huge difference between teaching 'convention' java, using modern libraries and code styles (no arrays, a build system, libraries for just about everything you wanna do that has a proper library, etc) ? and teaching someone the basics of how computers work, using a language. [10:58]
mbooth CuriousErnestBro: You'd be amazed at how many people get offended when we simply ask them about the problem they are trying to solve.... [10:58]
CuriousErnestBro Alternatively, as my dad says: "If you want to learn something, you can even call a donkey your father" [10:58]
dreamreal CuriousErnestBro: hahaha [10:58]
Diablo-D3 what. [10:58]
sbalmos store->breadAisle.remove(1); store->eggs.remove(10) if store->eggs.length > 1; [10:58]
surial matsurago: so, being asked to write a sort algorithm or some such? In 'convention' java that is a firing offense, it's that dumb: Collections.sort, _OF COURSE_. But to learn something it makes perfect sense. [10:58]
CuriousErnestBro The second one doesn't translate that well from dutch [10:58]
surial CuriousErnestBro: toch niet TU Delft? [10:58]
matsurago surial: yea, but if you teach wrong Java that sticks. So it is better to explain such concepts in C++ or Python. [10:59]
surial matsurago: yeah, I see that point. But you have to pick _SOME_ language. I still vote we pick logo. [10:59]
CuriousErnestBro surial, mijn broertje gaat naar TU Delft ja, ik ben een econometrie noob op Maastricht (vandaar dat mijn prof shitty java schrijft) [10:59]
dreamreal logo's an excellent language to learn stuff in [10:59]
sbalmos logo was fun [10:59]
surial CuriousErnestBro: ah :( [10:59]
CuriousErnestBro surial, you go to TU Delft as well? [11:00]
dreamreal and damn it SPEAK ENGRISH! If it was good enough for Jesus it's good enough for you [11:00]
surial CuriousErnestBro: got the degree and everything. [11:00]
CuriousErnestBro dreamreal, the irony lmao [11:00]
CuriousErnestBro surial, CS? [11:00]
dreamreal CuriousErnestBro: :D [11:00]
surial yup. [11:00]
CuriousErnestBro He's doing aerospace eng. [11:00]
surial Good choice. [11:00]
CuriousErnestBro I'm doing econometrics, horrible choice [11:00]
dreamreal CuriousErnestBro: I was trying to figure out a way to use colloquially horrible grammer but failed in the time I was willing to spend on it [11:01]
greggerz [greggerz!~greggerz@unaffiliated/greggerz] has joined ##java [11:02]
mbooth Huh, "econometrics" is a new word to me... [11:02]
dreamreal dang it. My idiot cat has made a nest right by my computer - and occasionally when she shifts position she disconnects the dock :/ [11:02]
CuriousErnestBro surial, dm'd you because dreamreal wants to keep it English [11:02]
dreamreal CuriousErnestBro: It's not that big a deal :) [11:02]
spuz is your dock warm, dreamreal? [11:03]
dreamreal spuz: yes, USB-C dock so it's providing power. The real idiot isn't the cat, her brain's the size of a walnut, it's me for allowing her to nest on my desk. She's just so cute, though... [11:04]
mbooth dreamreal: Yeah, there's a pet embargo in my home office since the great Thinkpad keyboard destruction event of 2018 :-/ [11:04]
CodePoint [CodePoint!~CodePoint@2600:1700:1060:d580:f11d:f5d2:b015:a7de] has joined ##java [11:04]
Devastator cuteness beats all [11:04]
dreamreal makes cute puppy-dog eyes at Devastator [11:04]
Devastator people marry because of cuteness [11:05]
matsurago I heard there is a new trend to allow dogs and cats in office workplaces. Such companies report a drastic raise in number of job applicants [11:05]
dreamreal hmm, that reminds me, I really need to get my wife to an eye doctor [11:05]
CuriousErnestBro Someone from a bank just told me to learn C and C++ because Java isn't low level enough [11:05]
dreamreal CuriousErnestBro: from a ... bank? Few banks really NEED low-level [11:05]
dreamreal I mean, they're the last great bastion of COBOL and it ain't going away and there's no NEED for it to go away [11:06]
mbooth CuriousErnestBro: COBOL is where the money is in banking :-p [11:06]
CuriousErnestBro this is from a call where I got rejected from a trading desk internship (while they were impressed with my technical skills) because they didn't have an assignment for me [11:07]
dreamreal trading is different, true [11:07]
CombatVet [CombatVet!~c4@gateway/tor-sasl/combatvet] has joined ##java [11:07]
dreamreal but some of the big trading centers use Java as core tech [11:07]
CuriousErnestBro dreamreal, it's not HFT [11:07]
matsurago CuriousErnestBro: the most software is written in high-level anyway nowadays. It is good to know how a computer works though, but the good chance is that the real work you'll be doing will not be in C++ [11:07]
CuriousErnestBro dreamreal, *cough* optiver *cough* [11:07]
dreamreal The chances of even a big bank needing something better than Dow Jones is... unlikely [11:08]
dreamreal I don't know what Optiver is [11:08]
CuriousErnestBro a-are you implying that Dow Jones is a programming language [11:08]
dreamreal no, I'm implying that Dow Jones uses Java for trading [11:08]
CuriousErnestBro dreamreal, one of the big dutch market making houses, they have some java talks [11:08]
dreamreal that's fine, I don't know enough about dutch trading [11:10]
EgonX [EgonX!~Egon@2601:2c6:47f:98f4:8915:689e:1d5e:8a10] has joined ##java [11:11]
matsurago It seems that for a good job nowadays you need just to know one language+ecosystem well + to have domain knowledge + nice soft skills, that's it. [11:12]
dreamreal well, that's often ENOUGH [11:12]
dreamreal knowing multiple languages helps you think well though [11:13]
Diablo-D3 spoken language or programming language? [11:13]
Arlion_ [Arlion_!~Arlion@unaffiliated/arlion] has joined ##java [11:13]
matsurago The problem is it is hard to be an expert (and maintain the expertise) in multiple languages, especially if they are drastically different, like Java and C++. [11:13]
tilerendering hm. [11:13]
dreamreal Diablo-D3: yes [11:14]
Arlion [Arlion!~Arlion@unaffiliated/arlion] has joined ##java [11:14]
Diablo-D3 best answer [11:14]
dreamreal I'm fluent in English and Moran, as well as Java, C++, C, JavaScript (well... node), Python, and a host of others [11:14]
white_shadow [white_shadow!~white_sha@unaffiliated/whiteshadow/x-9072] has joined ##java [11:14]
dreamreal Give me a problem and a language to solve it in, and I can EASILY complain that $other_language could do it [11:15]
tilerendering i m trying to execute a native query (em.createNativeQuery), its sql statement updates entities on a table. I tried to execute it via executeUpdate() : result is: ?java.lang.IllegalStateException: You cannot call executeUpdate() on this query. It is the incorrect query type.? - errm? when I call getResultList or getSingleResult or whatever, it throws the exception that it is not returning any results. however I need to make this query [11:15]
tilerendering execute somehow. [11:15]
Devastator I can barely speak my native language.. [11:15]
matsurago dreamreal: so if you add an element to a deque, would the iterators be invalidated? [11:15]
dreamreal tilerendering: can you do it with raw JDBC [11:15]
tilerendering dreamreal: how would I do that? [11:15]
dreamreal tilerendering: get a JDBC connection from the entity manager, run it with that, as one option [11:16]
dreamreal jdbc [11:16]
dreamreal dreamreal, jdbc is the Java Database Connectivity API. It's the low-level standard Java API that provides access to SQL-based database-engines. See - but you need a driver for your DB engine which you can get from your DB vendor. See also ~jdbi, ~jooq, ~jdbctemplate, ~hibernate, and ~jpa for higher-level APIs built on it. [11:16]
tilerendering sure but how much effort is there in transforming my createnativequery code into the ?jdbc variant" [11:16]
dreamreal matsurago: errrr... I think you'd get a concurrent modification exception but I'm not entirely sure [11:17]
Diablo-D3 i no speaked gud [11:17]
dreamreal tilerendering: should be three lines of code [11:17]
tilerendering dreamreal: do you have an example that matches a createnativequery call? [11:17]
dreamreal errr... not super-handy but which JPA provider are you using [11:17]
tilerendering toplink, but pretty ancient. it s a legacy backend from 2010 or sthg [11:18]
dreamreal yeeks. Um... I'd have to google for getting the JDBC connection from toplink [11:18]
dreamreal and if I'd have to do it, well, you can do it just as easily as I can [11:19]
CuriousErnestBro Here's my refactored code: [11:19]
tilerendering well yeeks nr 2: I d have to handle the database connection strings in the code [11:19]
matsurago dreamreal: That's about C++. Sorry, my point was that to maintain expertise in something performance-focused like this, you need to know all such performance-related details (all data structures; also know well move semantics, and when it fails). The difference in performance can be tenfold and even hundredfold. [11:19]
dreamreal yes, you would, but you're doing it with a native query too [11:19]
tilerendering the thing I wonder about: why is it telilng me that it is the wrong query type? [11:19]
tilerendering what query type would be suited then? [11:19]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [11:20]
tilerendering I ll try it with getResultList ?> then do a committx nevertheless when it jumps into the exception handling block. [11:21]
tilerendering it s a bit durty but it might work. [11:21]
tilerendering dirty [11:21]
Cyp_ [Cyp_!~Cyp_@2a05:f6c7:2883:0:2f1d:5968:2fed:3169] has joined ##java [11:22]
tilerendering oh no... [11:24]
tilerendering still doesnt work... [11:24]
EmmaT_ [EmmaT_!~EmmaT@] has joined ##java [11:28]
yottabyte [yottabyte!uid195082@gateway/web/] has joined ##java [11:28]
tilerendering I use java persistence 2.0 though [11:28]
tilerendering maybe there s a way of telling the driver or the api that it is indeed an update query and that executeUpdate _can_ indeed be called [11:29]
tilerendering (i.e. it s the right query type) [11:29]
tilerendering maybe there s a way to set a query hint? [11:29]
paws_ [paws_!uid89121@gateway/web/] has joined ##java [11:35]
paws_ [paws_!uid89121@gateway/web/] has joined ##java [11:39]
TobTobXX [TobTobXX!~TobTobXX@] has joined ##java [11:42]
tilerendering dreamreal: I found the problem. the problem was I used .createNativeQuery(sqlstring,class) instead of just using createNativeQuery(sqlstring) [11:44]
tilerendering copy/paste from another place in my code. [11:44]
tilerendering that made the entitymanager think that I wanted to cast the outcome to some object. so it expected a return set [11:45]
AcTiVaTe [AcTiVaTe!] has joined ##java [11:45]
dreamreal *nod* [11:46]
tilerendering should have pasted the code in the first place. [11:46]
tang^ yup [11:46]
dreamreal if only we'd said "show us", right? :) :D [11:47]
hsiktas [hsiktas!sid224847@gateway/web/] has joined ##java [11:48]
lithium [lithium!~lithium@unaffiliated/lithium] has joined ##java [11:49]
tilerendering sigh, yep - shame on me. [11:51]
tilerendering + sry for wasting your time [11:52]
dreamreal no worries, I'm glad you figured it out [11:53]
tilerendering merci [11:54]
dreamreal read that as "merde" at first, whoops [11:54]
tang^ dreamreal++ dirty mind [11:56]
tang^ dreamreal has a karma level of 2, tang^ [11:56]
troulouliou_div2 [troulouliou_div2!~troulouli@unaffiliated/troulouliou-div2/x-0271439] has joined ##java [12:04]
white_shadow tang-- [12:06]
white_shadow tang has a karma level of -1, white_shadow [12:06]
white_shadow oh it works [12:06]
white_shadow tang+ [12:07]
white_shadow white_shadow, what does that even *mean*? [12:07]
white_shadow + not working [12:07]
dreamreal tang++ because postinc and postdec are different than unary operations, duhhhh [12:07]
dreamreal tang has a karma level of 0, dreamreal [12:07]
dreamreal tang^ ++ for putting up with all of his [12:08]
dreamreal tang^ has a karma level of 35, dreamreal [12:08]
dreamreal this [12:08]
tag [tag!sid271787@p3m/member/tag] has joined ##java [12:08]
white_shadow where does javabot stores all this data? [12:09]
dreamreal it's connected to a mongodb instance [12:09]
dreamreal source [12:09]
dreamreal you can download my source at [12:09]
white_shadow who created it? [12:09]
white_shadow is it like Alexa? [12:09]
dreamreal ricky_clarkson originally, I think [12:09]
dreamreal what does "like Alexa" mean to you [12:10]
robamman2020 [robamman2020!] has joined ##java [12:10]
white_shadow Smart bot [12:10]
dreamreal what does "smart" mean to you? I mean, it's basically an infobot [12:10]
white_shadow ok nice creation [12:10]
robamman2020 dreamreal, what deam did you have last night [12:10]
robamman2020 ? [12:11]
white_shadow lol [12:11]
tang^ they're both as smart as the people programming them make them seem [12:11]
robamman2020 I had something to do with escaping from a prison [12:11]
dreamreal robamman2020: I don't think you'd understand it without a lot of context, and it's not relevant anyway [12:11]
robamman2020 ok [12:11]
mbooth Play my get out of bed playlist [12:12]
mbooth mbooth, what does that even *mean*? [12:12]
mbooth Not like alexa then :-) [12:12]
robamman2020 I saw one night such a dream, that when I woke up, i didn't understand anything anymore, that I saw [12:12]
white_shadow yeah [12:12]
troulouliou_div2 [troulouliou_div2!~troulouli@unaffiliated/troulouliou-div2/x-0271439] has joined ##java [12:12]
white_shadow mbooth maybe if its connected with my device then it will [12:12]
white_shadow it needs some improvement [12:12]
robamman2020 parted the channel: [12:13]
white_shadow dreamreal can i work on this bot and push an update? [12:13]
tang^ fork and pr is valid here [12:13]
dreamreal only if it's open source and the maintainers accept the update [12:13]
feannag [feannag!~feannag@2405:204:9321:b824:c96:39f:af01:444] has joined ##java [12:13]
white_shadow so how you guys are using if its not opensource :o [12:13]
dreamreal sighs [12:13]
dreamreal missed the "if" there, huh [12:14]
dreamreal for one thing, if it's ours, we could use it REGARDLESS of the license. For another, "if it's open source..." ... note the "if." It IS open source, and the source code repo makes that clear. [12:15]
sdu [sdu!~doo@] has joined ##java [12:16]
white_shadow Its made in kotlin [12:18]
dreamreal *shock* *awe* WHAAAAA? [12:18]
tang^ holy! [12:18]
dreamreal Actually, we still need to go through bits of the code and remove the vestiges of the conversion... there're bits where it gets an iterator() and then loops through the iterator to process information [12:19]
white_shadow ok [12:19]
white_shadow kotlin is good [12:19]
white_shadow you use Eclipse as IDE? Pardon but I am an Android Dev [12:20]
dreamreal Why does my IDE matter? [12:20]
white_shadow not your [12:21]
white_shadow in general [12:21]
dreamreal who are you... asking? I mean, most Java devs use an IDE, a good percentage use Eclipse... [12:21]
mbooth white_shadow: You're in luck android dev has it's own IRC channel right here on freenode ;-) [12:21]
white_shadow ok will try something with javabot, wish me luck! [12:22]
white_shadow brb [12:22]
dreamreal good luck [12:22]
CuriousErnestBro Not gonna lie, I'm kinda enjoying working with java [12:22]
dreamreal I'd actually like to see someone fix rivescript so it was suitable for something other than english-like lexemes [12:23]
dreamreal CuriousErnestBro: it's a good ecosystem [12:23]
white_shadow ok noted but its like 3 years i ran any java project [12:24]
orbyt_ [orbyt_!~orbyt@] has joined ##java [12:27]
ricky_clarkson white_shadow: Right, I started javabot almost 20 years ago. It will soon be old enough to drink, assuming it doesn't already. [12:27]
ricky_clarkson white_shadow: The first version took 8 minutes to develop, and it went downhill from there. [12:27]
tang^ given what it has to put up in this channel, I'd be surprised if it wasn't drinking already [12:27]
tang^ "put up with in..." [12:28]
ricky_clarkson Sadly, it's probably my most successful project ever and almost certainly no longer has a single line of code written by me. [12:28]
CuriousErnestBro ricky_clarkson, is that the irc bot here? [12:31]
ricky_clarkson Yes. [12:31]
CuriousErnestBro Damn that means you're at least 20 years old [12:31]
ricky_clarkson Shit! [12:31]
ricky_clarkson starts drinking [12:31]
mbooth CuriousErnestBro: Funny how time works [12:32]
CuriousErnestBro is pretty young/old depending on who you ask [12:32]
ricky_clarkson I've been programming since 1985 or 1986, assuming BASIC counts. [12:33]
mbooth ricky_clarkson: I don't why it wouldn't. I cut my teeth on BASIC too, people wrote serious applications with it [12:34]
ricky_clarkson Dijkstra's comments, the lack of actual subroutines (depends on the flavour of BASIC..) [12:35]
ricky_clarkson I first saw a $ symbol in BASIC, I pronounced it as an 's' [12:35]
ricky_clarkson It's now hard to imagine developing something without a stack and not going crazy. [12:36]
dreamreal well, even basic had a stack in 1985... [12:36]
ricky_clarkson Spectrum 48k and Commodore 64 just had global variables. [12:37]
surial PowerBasic was fucking amazing. First software I ever bought, after cutting my teeth on dev on a c64. [12:37]
dreamreal timex/sinclair's basic had gosub, too [12:37]
surial I wrote an S3M player for DOS (terminate and stay resident), in powerbasic, with a bunch of assembler injected which PB would let you. Christ it was awesome. [12:37]
dreamreal they didn't have stack LOCALITY, sure, but... [12:37]
ricky_clarkson dreamreal: right, but still only global vars. [12:37]
ricky_clarkson you could define one line functions on the spectrum (DEF FN...) [12:37]
white_shadow [white_shadow!~white_sha@unaffiliated/whiteshadow/x-9072] has joined ##java [12:38]
mbooth I'm pretty sure Locomotive BASIC had gosub too [12:38]
ricky_clarkson surial: I helped a friend with TSRs that would either cycle the Windows 3.1 colour pallette or steal users' passwords.. [12:38]
surial ...... are you me? [12:39]
dreamreal man, what a piece of junk the zx/81 was [12:39]
ricky_clarkson I'm the null-hostile version. [12:39]
dreamreal I loved it. Now it'd horrify me. :) [12:39]
dreamreal Actually... heck, I don't even remember what CPU it had [12:39]
surial I wrote that TSR (the one that would cycle the palette, which 'survives' win3.11 start) as an easter-egg/joke on a friend. [12:39]
white_shadow dreamreal he is that guy? [12:39]
dreamreal white_shadow: yes [12:39]
ricky_clarkson dreamreal: I never used the zx/81, but what I appreciated about the spectrum was how easy drawing stuff was, PLOT x, y [12:40]
ricky_clarkson dreamreal: Every programming envrionment since then involves so much setup. [12:40]
white_shadow ricky_clarkson Glad to meet you sir! [12:40]
dreamreal oh wow, it was a z80 [12:41]
ricky_clarkson doffs his hat to white_shadow and moves slowly away [12:41]
surial so who here remembers screen 13 and using OUT 0x3c8 to cycle the palette? [12:41]
ricky_clarkson Vaguely. [12:41]
dreamreal remembers poke 53280,12 for some reason [12:41]
robamman2020 [robamman2020!] has joined ##java [12:42]
robamman2020 hello people [12:42]
sbalmos dreamreal: Wasn't that a C64 poke? [12:42]
dreamreal and JSR $ffd2... [12:42]
ricky_clarkson I guess that wasn't the zx/81, too many bytes. [12:42]
dreamreal sbalmos: yeah, was the border color if I remember correctly [12:42]
sbalmos dreamreal: vaguely rings a bell (hah!) [12:42]
dreamreal 53281 was the screen color? [12:42]
robamman2020 I made a java chatroom. but the server i can run it is using cycling.... and the message logs are therefor deleted.... what should I do ? [12:42]
sbalmos don't cycle? [12:43]
ricky_clarkson On the spectrum I discovered that RANDOMIZE USR 16 would reboot the system. It was about 10 years later I realised it was crashing the system. [12:43]
dreamreal $ffd2 was the kernel entry point to output the contents of... the A register? Gosh, it's been wayyyy too long [12:43]
dreamreal the contents of memory pointed to by A, rather [12:43]
dreamreal robamman2020: this channel doesn't do tech support [12:44]
robamman2020 yes [12:44]
ricky_clarkson will be back after a brief commercial break and mandatory reboot [12:44]
tang^ ka-chunk [12:45]
treeman5 [treeman5!~treeman5@] has joined ##java [12:46]
xbyte1024 [xbyte1024!] has joined ##java [12:48]
xalen7 [xalen7!~ztr8x@] has joined ##java [12:52]
sizeof_void34 [sizeof_void34!] has joined ##java [12:53]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [01:08]
gAb1 hi, i hope someone can help me, i feel like this is pretty basic stuff but i'm trying to figure out a way when i have a method that receives a string as a paramter and tries to parse it to int inside a try block and shows an error message in the catch block, this method returns an int number but what i can't make sense is that i come from php language where i could return different data types to know if i get a int number or a bool false [01:13]
gAb1 in case the parsetInt() fails, how can i do this if i can only return int data type? if i use a for example 0 what if the user wants to actually enter 0, how do i differentiate between an error number and the actual number the user wants to convert from string to int? [01:13]
conan [conan!~conan@] has joined ##java [01:14]
otto_j [otto_j!] has joined ##java [01:15]
LKoen [LKoen!~LKoen@] has joined ##java [01:16]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [01:16]
yawkat just dont catch the exception [01:17]
yawkat this is what exceptions are for [01:17]
Arlion [Arlion!~Arlion@unaffiliated/arlion] has joined ##java [01:17]
Arlion [Arlion!~Arlion@unaffiliated/arlion] has joined ##java [01:18]
sa02irc [sa02irc!] has joined ##java [01:21]
gAb1 if i don't catch the exception it crashes, i feel like i should place a while somewhere to keep asking for a number until the user gets it right? like moving the part where i ask the user to enter a number inside the method all inside a while(!ok) and then break it after the parseInt(string); ok = true; [01:24]
gAb1 unless there's a better or more correct way? [01:25]
puppy_za [puppy_za!uid277586@gateway/web/] has joined ##java [01:31]
Teckla_ [Teckla_!sid172075@gateway/web/] has joined ##java [01:31]
rann [rann!sid175221@gateway/web/] has joined ##java [01:31]
pdg [pdg!sid395042@gateway/web/] has joined ##java [01:32]
exonity01 [exonity01!uid364582@gateway/web/] has joined ##java [01:32]
AfroThundr|dev [AfroThundr|dev!sid328387@countervandalism/AfroThundr3007730] has joined ##java [01:32]
lucifer [lucifer!lucifer@gateway/web/] has joined ##java [01:32]
yottabyte [yottabyte!uid195082@gateway/web/] has joined ##java [01:32]
mindfulStoic [mindfulStoic!sid172528@gateway/web/] has joined ##java [01:33]
lineos [lineos!sid103986@gateway/web/] has joined ##java [01:33]
egp [egp!sid237851@gateway/web/] has joined ##java [01:33]
merkazu [merkazu!sid148003@gateway/web/] has joined ##java [01:34]
xoke [xoke!sid184609@gateway/web/] has joined ##java [01:34]
Karyon [Karyon!~Karyon@unaffiliated/karyon] has joined ##java [01:34]
altendky [altendky!uid135382@gateway/web/] has joined ##java [01:34]
Sina [Sina!uid230776@gateway/web/] has joined ##java [01:34]
pr3d4t0r [pr3d4t0r!] has joined ##java [01:35]
dmlloyd [dmlloyd!uid331705@redhat/jboss/dmlloyd] has joined ##java [01:35]
stryek [stryek!uid332574@gateway/web/] has joined ##java [01:35]
tang^ [tang^!sid382663@gateway/web/] has joined ##java [01:36]
paws_ [paws_!uid89121@gateway/web/] has joined ##java [01:36]
Secret-Fire [Secret-Fire!] has joined ##java [01:38]
pdg [pdg!sid395042@gateway/web/] has joined ##java [01:42]
Secret-Fire [Secret-Fire!] has joined ##java [01:43]
ricky_clarkson [ricky_clarkson!~rjclarkso@unaffiliated/rickyclarkson/x-000000001] has joined ##java [01:49]
Secret-Fire [Secret-Fire!] has joined ##java [01:49]
nebulae [nebulae!] has joined ##java [01:49]
bourbon [bourbon!ragersynap@gateway/shell/] has joined ##java [01:50]
KnownSyntax [KnownSyntax!sid233169@gateway/web/] has joined ##java [01:54]
KnownSyntax [KnownSyntax!sid233169@gateway/web/] has joined ##java [01:56]
pdg [pdg!sid395042@gateway/web/] has joined ##java [01:57]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [02:01]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [02:08]
stigz [stigz!sid371747@gateway/web/] has joined ##java [02:09]
l8j [l8j!~l8j@] has joined ##java [02:10]
jamiejackson [jamiejackson!c7df1efe@gateway/web/cgi-irc/] has joined ##java [02:13]
jamiejackson [jamiejackson!c7df1efe@gateway/web/cgi-irc/] has joined ##java [02:14]
sagax [sagax!~sagax_nb@] has joined ##java [02:17]
stigz [stigz!sid371747@gateway/web/] has joined ##java [02:19]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [02:20]
Sasazuka [Sasazuka!~Sasazuka@unaffiliated/sasazuka] has joined ##java [02:25]
extor [extor!~extor@unaffiliated/extor] has joined ##java [02:32]
benskey [benskey!] has joined ##java [02:33]
zalt__ [zalt__!~devp@unaffiliated/lambda443] has joined ##java [02:34]
SanguineAnomaly [SanguineAnomaly!] has joined ##java [02:41]
mizi [mizi!~mizi@2a02:8106:208:5283:d08a:8327:4448:7fc7] has joined ##java [02:44]
sa02irc [sa02irc!] has joined ##java [02:50]
l8j parted the channel: [02:51]
gAb1 is it possible to compare two numeric strings with the greater operator? [02:52]
lineos [lineos!sid103986@gateway/web/] has joined ##java [02:52]
gAb1 i mean the same way with integers, but with strings? [02:53]
LunarJetman [LunarJetman!] has joined ##java [02:54]
tachoknight [tachoknight!~tachoknig@] has joined ##java [02:58]
sb35 [sb35!~sb35@] has joined ##java [03:00]
cheeser tias [03:03]
cheeser gAb1, Try it and see. You learn much more by experimentation than by asking without having even tried. [03:03]
Arlion_ [Arlion_!~Arlion@unaffiliated/arlion] has joined ##java [03:05]
gAb1 i tried but i get an error > doesn't work with String [03:05]
cheeser there you go [03:08]
Arlion [Arlion!~Arlion@unaffiliated/arlion] has joined ##java [03:09]
gAb1 so it is not possible? [03:10]
gAb1 without converting to integer? [03:10]
ChaiTRex gAb1: It depends what kind of comparison you want. [03:11]
bourbon Possible isn't what matters [03:11]
Bombe Well, do you get an error when you try? [03:11]
ChaiTRex gAb1: If you want numeric comparison, go with numbers. [03:11]
bourbon Of course it's possible. You just have to write the Comparator<String> [03:12]
ChaiTRex gAb1: If you want a String comparison where "100" is less than "5", go with a String comparison. [03:12]
bourbon Oh wait. You want to straight up use the > operator? No chance. [03:12]
bourbon Java doesn't do operator overloading [03:13]
bourbon At least, not for the app code to define [03:13]
Alina-malina [Alina-malina!~Alina-mal@unaffiliated/alina-malina] has joined ##java [03:13]
gAb1 ok [03:14]
bourbon But really, what you're saying doesn't make sense w/o some conversion from a string type to a numerical type [03:14]
bourbon Other languages just make the operator do the conversion for you [03:14]
Peste_Bubonica [Peste_Bubonica!~Peste_Bub@unaffiliated/peste-bubonica/x-4612396] has joined ##java [03:14]
bourbon Java is like the best porn/violence: explicit as hell [03:14]
RedSoxFan07 [RedSoxFan07!] has joined ##java [03:15]
gAb1 without using a method like parseInt() i have to check if a String is lesser than Integer.MIN_VALUE by removing the minus character and checking if it is greater than the MIN_VALUE without the minus [03:17]
Bombe That sounds suspiciously like some stupid homework. [03:17]
ChaiTRex gAb1: You can use BigInteger for that. [03:17]
gAb1 Bombe: it is [03:18]
cheeser homework [03:19]
cheeser We don't answer homework-style questions here. Homework assignments often intentionally ask you to produce bad code: You generally HAVE to use some mechanism even though it isn't the best tool for the job, and '.. just use this library that does all that in a very nice way!' is usually not acceptable. That makes them VERY frustrating questions. [03:19]
gAb1 i'll go yell into my pillow [03:22]
cheeser it's absolutely doable but it's for you to do. [03:23]
MIC132 [MIC132!] has joined ##java [03:23]
gAb1 then i'll send a mail to my teacher asking politely how am i supposed to know if a numeric string is supposed to be greater or lesser than another without converting to int [03:23]
gAb1 doable without converting to int? [03:23]
gAb1 using a for? comparing one by one? [03:23]
Bombe And he should talk with you about it because he?s getting paid to do it. Good luck! [03:23]
cheeser without converting to an int, yes [03:24]
Teckla [Teckla!sid172075@gateway/web/] has joined ##java [03:26]
conan [conan!] has joined ##java [03:26]
extor [extor!~extor@unaffiliated/extor] has joined ##java [03:29]
Jantz [Jantz!] has joined ##java [03:29]
Jabbslad [Jabbslad!sid25161@gateway/web/] has joined ##java [03:31]
Alina-malina [Alina-malina!~Alina-mal@unaffiliated/alina-malina] has joined ##java [03:33]
bobek [bobek!~bobek@unaffiliated/bobek] has joined ##java [03:33]
jaziz [jaziz!~jaziz@unaffiliated/jaziz] has joined ##java [03:46]
bourbon oh wait, we're doing homework? [03:48]
bourbon if that's the case, I suggest we use the clojure-python bridge to solve it all in python [03:48]
bourbon now you can use > to compare strings [03:48]
bourbon that's how it works, right? [03:48]
surial bourbon: which wouldn't do what you want, of course. [03:49]
bourbon you're right... python is strong types, but only when it's annoying [03:50]
bourbon gAb1: you should use jRuby, not the clojure-python bridge [03:51]
bourbon much less work, anyway [03:51]
Jantz [Jantz!] has joined ##java [03:52]
jaziz1 [jaziz1!~jaziz@unaffiliated/jaziz] has joined ##java [04:06]
gAb1 can i ask about specific code not doing what i expect? [04:07]
Diablo-D3 only if you pastebin it first. [04:07]
gAb1 even for 1 line? [04:08]
dougquaid [dougquaid!dougquaid@gateway/vpn/privateinternetaccess/dougquaid] has joined ##java [04:08]
gAb1 why does numericString.compareTo(Integer.MAX_VALUE + "") > 0 return false for strings "0","1" and "2" but it returns true for "3","4","5"... [04:10]
ChaiTRex gAb1: Do you understand how String comparison works with lexicographic ordering? [04:11]
ChaiTRex gAb1: It's sort of like alphabetic ordering where you compare the first character and only continue on to further characters if they match. [04:12]
[twisti] xy [04:12]
[twisti] gAb1, XY Problem: You have problem X, and you think Y is a good solution, so now you are asking about how to do Y. However, maybe Y is not a good way to solve X. Maybe you should take a step back and tell us about X first. More: [04:12]
ChaiTRex [twisti]: They already said their homework problem. [04:13]
ChaiTRex [twisti]: It's to detect whether a numeric String is within the bounds of int without using parseInt or something like that. [04:13]
[twisti] oh, sorry. ~~ [twisti] 5 minute rule, i guess [04:14]
cheeser /3/3 [04:15]
[twisti] wow thats an obnoxious link in the xy factoid [04:16]
manualcrank [manualcrank!] has joined ##java [04:16]
cheeser could use a stylesheet that doesn't look like something from the early 90s [04:17]
[twisti] and a much, MUCH less aggressive, condescending and self congratulatory prick as source for the examples + as author [04:23]
deavmi [deavmi!~quassel@] has joined ##java [04:35]
merkazu [merkazu!sid148003@gateway/web/] has joined ##java [04:42]
mizi [mizi!] has joined ##java [04:42]
ChaiTRex [ChaiTRex!~ChaiTRex@gateway/tor-sasl/chaitrex] has joined ##java [04:45]
paddyez [paddyez!~Patrick-E@wikipedia/paddyez] has joined ##java [04:46]
ChaiTRex [ChaiTRex!~ChaiTRex@gateway/tor-sasl/chaitrex] has joined ##java [04:49]
tomboy64 [tomboy64!~tomboy64@gateway/tor-sasl/tomboy64] has joined ##java [05:04]
killvenom [killvenom!~killvenom@] has joined ##java [05:13]
wedr [wedr!~tom_mai78@] has joined ##java [05:18]
donofrio_ [donofrio_!] has joined ##java [05:18]
royal_screwup21 [royal_screwup21!89de72f1@gateway/web/cgi-irc/] has joined ##java [05:21]
TGiske [TGiske!~apetiss@2a00:c440:11:38d:d0d1:6a14:89ce:3eaa] has joined ##java [05:26]
orbyt_ [orbyt_!~orbyt@] has joined ##java [05:27]
cpplearner Hmm, does the JVM specification formally define `a symoblic reference`? [05:31]
ernimril [ernimril!] has joined ##java [05:32]
yawkat same as any linker? [05:34]
sb35 [sb35!~sb35@] has joined ##java [05:35]
jaziz1 [jaziz1!~jaziz@unaffiliated/jaziz] has joined ##java [05:35]
cpplearner Is it just a string, or refers to the actual memory entity? [05:36]
ChaiTRex cpplearner: Looks like it refers to something in the constant pool: [05:37]
ChaiTRex ChaiTRex's title: "Chapter 2. The Structure of the Java Virtual Machine" [05:37]
yawkat cpplearner: it's just a thing [05:41]
yawkat a symbolic reference references something [05:41]
yawkat it depends on context [05:41]
Arlion [Arlion!~Arlion@unaffiliated/arlion] has joined ##java [05:44]
benskey [benskey!] has joined ##java [05:44]
ChaiTRex [ChaiTRex!~ChaiTRex@gateway/tor-sasl/chaitrex] has joined ##java [05:45]
cpplearner Hmm... as per the link by ChaiTRex, a symbolic link is to be translated into a concrete reference. Thanks. I wonder how exactly it's done. [05:46]
xeno_ [xeno_!~xeno@unaffiliated/xeno] has joined ##java [05:48]
yawkat just like any linker... [05:48]
tang^^ [tang^^!~tang^@] has joined ##java [05:48]
AmVarPG [AmVarPG!] has joined ##java [05:50]
Anthaas [Anthaas!~Anthaas@unaffiliated/anthaas] has joined ##java [05:52]
cpplearner Hmm, thanks for your time! I'll dig further. [05:56]
killvenom [killvenom!~killvenom@] has joined ##java [06:02]
merkazu [merkazu!sid148003@gateway/web/] has joined ##java [06:16]
Ragnor [Ragnor!] has joined ##java [06:38]
extor [extor!~extor@unaffiliated/extor] has joined ##java [06:51]
ChaiTRex [ChaiTRex!~ChaiTRex@gateway/tor-sasl/chaitrex] has joined ##java [06:54]
ChaiTRex [ChaiTRex!~ChaiTRex@gateway/tor-sasl/chaitrex] has joined ##java [07:03]
Lewix [Lewix!sid158496@gateway/web/] has joined ##java [07:09]
Jabbslad [Jabbslad!sid25161@gateway/web/] has joined ##java [07:19]
Teckla [Teckla!sid172075@gateway/web/] has joined ##java [07:19]
merkazu [merkazu!sid148003@gateway/web/] has joined ##java [07:20]
sebhoss [sebhoss!sid168260@gateway/web/] has joined ##java [07:20]
stigz [stigz!sid371747@gateway/web/] has joined ##java [07:20]
wyvern [wyvern!sid40333@gateway/web/] has joined ##java [07:20]
altendky [altendky!uid135382@gateway/web/] has joined ##java [07:20]
lineos [lineos!sid103986@gateway/web/] has joined ##java [07:20]
dmlloyd [dmlloyd!uid331705@redhat/jboss/dmlloyd] has joined ##java [07:21]
rager parted the channel: [07:21]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [07:22]
barq [barq!sid103986@gateway/web/] has joined ##java [07:26]
di0_ [di0_!~di0_@unaffiliated/di0-/x-5053590] has joined ##java [07:31]
pdg [pdg!sid395042@gateway/web/] has joined ##java [07:37]
usempire [usempire!] has joined ##java [07:37]
ricky_clarkson [twisti]: the xy link seems good to me. I used to interact with the author on #debian many moons ago, he was amazingly efficient and it was a very high traffic IRC channel, I guess he needed that article to stay sane. [07:43]
NorthwestVegan [NorthwestVegan!~Northwest@gateway/tor-sasl/northwestvegan] has joined ##java [07:48]
NeXTSUN [NeXTSUN!~textual@] has joined ##java [07:58]
squirrel [squirrel!~mj@unaffiliated/squirrel] has joined ##java [08:00]
toytoy [toytoy!~toytoy@unaffiliated/t0yt0y] has joined ##java [08:06]
TGiske [TGiske!~apetiss@2a00:c440:11:38d:d0d1:6a14:89ce:3eaa] has joined ##java [08:09]
NeXTSUN [NeXTSUN!~textual@] has joined ##java [08:13]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [08:15]
Lewix [Lewix!sid158496@gateway/web/] has joined ##java [08:16]
wyvern [wyvern!sid40333@gateway/web/] has joined ##java [08:25]
rann [rann!sid175221@gateway/web/] has joined ##java [08:40]
AcTiVaTe [AcTiVaTe!] has joined ##java [08:45]
deavmi [deavmi!~quassel@] has joined ##java [08:45]
Kol [Kol!] has joined ##java [08:45]
fowlduck [fowlduck!sid2258@gateway/web/] has joined ##java [08:51]
xoke [xoke!sid184609@gateway/web/] has joined ##java [08:52]
p[a]ddy [p[a]ddy!~Patrick-E@wikipedia/paddyez] has joined ##java [08:52]
snowmanbamm [snowmanbamm!snowmanbam@gateway/vpn/privateinternetaccess/snowmanbamm] has joined ##java [08:55]
snowmanb_ [snowmanb_!snowmanbam@gateway/vpn/privateinternetaccess/snowmanbamm] has joined ##java [09:03]
NeXTSUN [NeXTSUN!~textual@] has joined ##java [09:04]
dmabs [dmabs!~dmabs@unaffiliated/dmabs] has joined ##java [09:09]
Goplat [Goplat!~Goplat@reactos/developer/Goplat] has joined ##java [09:13]
Kaedenn [Kaedenn!~kaedenn@unaffiliated/kaedenn] has joined ##java [09:18]
Kaedenn private static TreeMap<BigDouble, String> scaleMap = ...something...; Can I initialize this inline or do I need to write a function to do it? [09:19]
fizzie You can initialize *a* map using the static Map.of / Map.ofEntries methods, and one of the TreeMap constructor takes a map to make a copy of. You *can* put those two things together, though whether you want to isn't obvious. [09:23]
fizzie It would look like [09:25]
Kaedenn ...I do not know if writing a static initialize() function is better/worse than that. [09:27]
Kaedenn I will propose both to the head dev. [09:31]
Kaedenn (modifying code that's converted from a different language is always fun) [09:31]
fizzie We initialize a lot of maps with Guava's ImmutableMap.Builder, which has a reasonable fluent method-chaining interface, but most of the time they stay as ImmutableMaps. [09:32]
snowmanbamm [snowmanbamm!snowmanbam@gateway/vpn/privateinternetaccess/snowmanbamm] has joined ##java [09:38]
wyvern [wyvern!sid40333@gateway/web/] has joined ##java [09:44]
db [db!~db@unaffiliated/db] has joined ##java [10:03]
nav2002 [nav2002!~nav2002@] has joined ##java [10:07]
RoriconKnight [RoriconKnight!~RoriconKn@] has joined ##java [10:12]
ChaiTRex [ChaiTRex!~ChaiTRex@gateway/tor-sasl/chaitrex] has joined ##java [10:18]
pingveno [pingveno!sid269408@gateway/web/] has joined ##java [10:33]
snowmanbamm [snowmanbamm!snowmanbam@gateway/vpn/privateinternetaccess/snowmanbamm] has joined ##java [10:50]
di0_ [di0_!~di0_@unaffiliated/di0-/x-5053590] has joined ##java [10:51]
dtrott [dtrott!] has joined ##java [10:55]
jackhum [jackhum!~jackhum@] has joined ##java [10:58]
RedSoxFan07 [RedSoxFan07!~Thunderbi@] has joined ##java [11:09]
cpplearner So, the JVM spec says: `There are two kinds of class loaders: the bootstrap class loader ..., and user-defined class loaders.`. As suggested by many tech articles, obvisouly there are more to that, but there are not covered by the standard? [11:29]
cpplearner *they are not covered [11:29]
usempire [usempire!] has joined ##java [11:34]
djhworld [djhworld!~djhworld@] has joined ##java [11:43]
shan [shan!~shan@unaffiliated/jasatso1301] has joined ##java [11:43]
pingveno [pingveno!sid269408@gateway/web/] has joined ##java [11:43]
usempire [usempire!] has joined ##java [11:54]