Info

Login

Channels

APIs

Credits

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

« 2019-04-14

2019-04-15

2019-04-16 »

Nick Message Date
acidjnk [acidjnk!~acid@mue-88-130-58-049.dsl.tropolys.de] has joined ##java [12:00]
Galactus [Galactus!~Galactus@unaffiliated/galactus] has joined ##java [12:04]
DrDonkey [DrDonkey!~DrDonkey@unaffiliated/drdonkey] has joined ##java [12:08]
rruizt [rruizt!~rruizt@83-84-23-124.cable.dynamic.v4.ziggo.nl] has joined ##java [12:12]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [12:16]
very_sneaky [very_sneaky!~very_snea@131.170.239.19] has joined ##java [12:20]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [12:20]
very_sneaky [very_sneaky!~very_snea@131.170.239.19] has joined ##java [12:30]
kgrimes2 [kgrimes2!~kgrimes2@172-11-18-93.lightspeed.irvnca.sbcglobal.net] has joined ##java [12:48]
progart [progart!~kamee@5.77.140.183] has joined ##java [12:57]
Akimb [Akimb!~Akimb@82-135-197-171.static.zebra.lt] has joined ##java [12:59]
bobek [bobek!~bobek@unaffiliated/bobek] has joined ##java [01:00]
very_sneaky hey guys, nooby question about streams - do all streams need to be closed after use? and does that include streams that have been passed as a parameter to another stream? [01:01]
very_sneaky i.e. an OutputStream that's been passed to a DataOutputStream -> do both need to be closed? [01:01]
deebo it's easier to just to always close them [01:02]
ernimril very_sneaky, the best way to deal with io streams is to use the try-with-resource. That means that the place that opens/creates it will close it [01:02]
very_sneaky ernimril: ahhh, yeah true. I'll definitely look into that in the future [01:02]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0::bbf] has joined ##java [01:03]
dez [dez!uid92154@fedora/deSouza] has joined ##java [01:03]
deebo there are probably stream types and edge cases where you don't need to close them, but it's just easier to always do it [01:03]
very_sneaky deebo: does each close statement need its own try catch block or can I try to close multiple in a try? [01:04]
deebo same as if you know a http api doesn't return anything, so you don't read the response because you don't care, e.g. with jersey this will leave the connection dangling as jersey won't properly handle non 204 ersponses [01:04]
ernimril very_sneaky, if you use try-with-resource it is all handled for you [01:04]
deebo very_sneaky: try with resources allows a full code block, you can open as many streams as you like [01:04]
ernimril arm [01:05]
ernimril ernimril, arm is Automatic Resource Management; the concept of closing resources after you're done with them. This can easily be done with javas try-with-resources syntax (http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html) - if you have to use Java older than 7 for some reason, you can use lombok's @Cleanup: http://projectlombok.org/features/Cleanup.html [01:05]
very_sneaky ernimril: appreciated, and will definitely explore in the future - I'm on a bit of a deadline and would rather be consistent about my implementation; i haven't used try with resources anywhere else [01:05]
ricky_clarkson try-with-resources allows multiple resources to be opened in one statement [01:05]
ernimril very_sneaky, you are on irc and claim that you can not spend 5 minutes to read the small tutorial? [01:06]
very_sneaky ernimril: no, i can read the tutorial [01:06]
very_sneaky refactoring the rest of my program for consistency is what would take some time [01:06]
very_sneaky and I've come accross some stackoverflow posts where there were issues with threading and concurrency where try with resources was concerned [01:06]
very_sneaky and it's an issue i intend to understand better, but don't have *that* kind of time right at the moment [01:07]
very_sneaky to understand regular try/catch/finally blocks better; is one require for each close oepration that I undertake? [01:07]
deebo no, second code example in the tutorial [01:09]
deebo every declared resource in the try () block will be closed [01:09]
very_sneaky oh, true. yep that answers my question thanks :) [01:09]
basiclaser [basiclaser!uid10861@gateway/web/irccloud.com/x-jzifelyaoubcfwat] has joined ##java [01:11]
AlexP11223 [AlexP11223!~AlexP1122@78-56-60-143.static.zebra.lt] has joined ##java [01:12]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [01:14]
AlexP11223 What should I use to parallelize a loop like that? https://gist.github.com/AlexP11223/939152c378f4735f45bc8e9279def5a4 [01:17]
AlexP11223 it's CPU bound, so the number of thread should not be higher than the number of cores, and I need to keep the counter and output after each iteration [01:17]
deebo create a threadpool, for each permutation add a task to the queue () => return runInstance.accept(perm), adjust threadpool params for optimal parallelism [01:18]
deebo jcip [01:19]
deebo deebo, jcip is Java Concurrency In Practice, a book focused on implementing threaded and concurrent applications in Java. You can read more at http://jcip.net and buy a copy at http://amzn.to/1pujbTy [01:19]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [01:23]
ricky_clarkson ImmutableMap<Double, Object[]> results = permutations.stream().parallel().map(permutation -> Pair.of(runInstance.accept(permutation), permutation)).collect(toImmutableMap(Pair::first, Pair::second)); [01:24]
ricky_clarkson That said, try to use something more specific than Object[]. [01:24]
Chuguniy [Chuguniy!~Chuguniy@80.232.218.96] has joined ##java [01:25]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [01:26]
AlexP11223 what about the output on each iteration? I guess I need some kind of lock/mutex for that [01:26]
ricky_clarkson You could do that inside the map lambda, or do a forEach instead of a .collect [01:37]
javaStudent [javaStudent!ac588277@gateway/web/freenode/ip.172.88.130.119] has joined ##java [01:45]
Raku [Raku!raku@2601:2c7:4300:1b00:230:48ff:fe32:d99f] has joined ##java [01:46]
veegee [veegee!~veegee@ipagstaticip-3d3f7614-22f3-5b69-be13-7ab4b2c585d9.sdsl.bell.ca] has joined ##java [01:51]
javaStudent Hello. I'm looking for a little help with a pretty simple graphic display project. I have only done console apps up til now so I am not even sure where to start. [01:52]
yawkat Or peek [01:52]
OnceMe [OnceMe!~OnceMe@unaffiliated/onceme] has joined ##java [01:52]
javaStudent For the record, this graphic display will be added to a college homework assignment but the graphics themselves are not part of the assignment. [01:52]
javaStudent Just me being an eager beaver and wanting to add a little flair. [01:53]
javaStudent What I am trying to do is as follows: [01:53]
javaStudent I have built a pseudo-random number sequence generator using the linear congruence approach. [01:54]
javaStudent I want to display the resulting number on the left of the screen and then on the right I want to plot a point that correlates to that number. [01:55]
javaStudent Then I want to "scroll down" and print the next number and point, but draw a line between the two points. [01:55]
newbieG [newbieG!~bhaskar@117.204.240.63] has joined ##java [01:57]
javaStudent The end result will be a zigag line chart that has the X coord = the random number, and the Y coord = the iteration. [01:57]
newbieG What is mean by --> "Inner Class can be created only in the context of Outter or enclosing class" [01:58]
exonity01 [exonity01!~exonity01@unaffiliated/exonity01] has joined ##java [01:58]
javaStudent SO my question is really basic ... which java library is the best (easiest) to do this kind of display in, bearing in mind that it will need to scroll off the top of the screen. ?? [02:00]
javaStudent If I can get started on the right library it would be a great help. [02:00]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [02:02]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [02:08]
DropItLikeItsHot [DropItLikeItsHot!~AfroThund@countervandalism/AfroThundr3007730] has joined ##java [02:10]
immibis [immibis!~immibis@222-153-253-249-fibre.sparkbb.co.nz] has joined ##java [02:11]
ricky_clarkson newbieG: An inner class needs the outer class' 'this' pointer to be constructed. [02:15]
ricky_clarkson newbieG: You may want a nested class instead of an inner one (needs the 'static' keyword) [02:16]
ricky_clarkson nested [02:16]
ricky_clarkson nested classes are classes that are members of other classes. They come in two flavors - "static nested classes" and "inner classes". The latter requires a reference to the outer class to work. See http://is.gd/kaM0 [sun.com] for more info. [02:16]
ricky_clarkson yawkat: Nice, I didn't know or had forgotten about peek() [02:19]
karab44 [karab44!~karab44@unaffiliated/karab44] has joined ##java [02:24]
kgrimes2 [kgrimes2!~kgrimes2@172-11-18-93.lightspeed.irvnca.sbcglobal.net] has joined ##java [02:26]
ravenousmoose [ravenousmoose!~ravenousm@194.78.35.195] has joined ##java [02:26]
AlexP11223 [AlexP11223!~AlexP1122@78-56-60-143.static.zebra.lt] has joined ##java [02:35]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [02:47]
Tichodroma [Tichodroma!~lutz@fsf/member/Tichodroma] has joined ##java [02:47]
tasse [tasse!~tasse@55d48dfe.access.ecotel.net] has joined ##java [02:49]
grosboulet [grosboulet!~unknown@unaffiliated/grosboulet] has joined ##java [02:50]
sbeex [sbeex!~sbeex@46.140.90.107] has joined ##java [02:51]
nebulae [nebulae!~nebulae@2a02:587:a3b:c000:9c0b:d7a4:6b94:9c48] has joined ##java [02:52]
indistylo [indistylo!~aruns_@2401:4900:275b:a52a:a5f3:f648:64c4:8057] has joined ##java [02:54]
newbieG [newbieG!~bhaskar@117.204.240.63] has joined ##java [02:56]
mitch0 [mitch0!~mitch@84-236-50-112.pool.digikabel.hu] has joined ##java [02:58]
newbieG ricky_clarkson: If I hava a class named *Out* and *In* is an inner class then the class behaves as member of *Out* So if we need an instance then -- new Out.In(); insted of new In(); [03:01]
newbieG ? [03:02]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [03:03]
flughafen can i force a object that uses hibernate to refresh from the database? [03:03]
aqd [aqd!~aqd@85-76-66-112-nat.elisa-mobile.fi] has joined ##java [03:05]
pd09041999 [pd09041999!~pd0904199@14.139.61.130] has joined ##java [03:05]
grosboulet parted the channel: [03:05]
Maldivia call refresh on the entitymanager? [03:06]
flughafen thanks Maldivia i'll look it up' [03:07]
Maldivia did you change the db externally? [03:08]
Maldivia if so , you might hsve to force evict the cache as well [03:08]
very_sneaky [very_sneaky!~very_snea@103.13.101.148] has joined ##java [03:09]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [03:09]
pd09041999 [pd09041999!~pd0904199@14.139.61.130] has joined ##java [03:09]
flughafen Maldivia: what's happeniung is i have (muitiple services) but there is a condition i found now, where it the other serivce is modifying it quicker , so i wanted to update the the object first, then make sure it's not set [03:09]
very_sneaky [very_sneaky!~very_snea@103.13.101.148] has joined ##java [03:09]
flughafen i found a case, where this job get's finishes and gets marked as completed by the main service, (which it did finish) but then gets marked as in progress by the other srevice. but the object is not reflecting the db in the smaller service. [03:11]
mayurvpatil [mayurvpatil!~mayurvpat@202.149.218.202] has joined ##java [03:11]
mayurvpatil parted the channel: "Leaving" [03:12]
mayurvpatil [mayurvpatil!~mayurvpat@202.149.218.202] has joined ##java [03:12]
deebo sounds like you have to fix something much more concrete than just refreshing a mapped object :) [03:12]
Maldivia so you have multiple services changing the database at the same time? [03:12]
flughafen yeah i guess. ;) [03:14]
flughafen well we have a main tomcat service, then a smaller scheduler kind of service. [03:15]
Maldivia the thing is, jpa generally assumes it's the only thing writing to the database, unless configured otherwise, and will cache thing in mem [03:15]
flughafen cdan i put a query kind of thing in the udpate attributeo n the hibernate mapping thing? [03:18]
aqd [aqd!~aqd@85-76-66-112-nat.elisa-mobile.fi] has joined ##java [03:18]
sa02irc [sa02irc!~sa02irc@155-079-043-212.ip-addr.inexio.net] has joined ##java [03:18]
Maldivia probably... but I don't know which -- JPA isn't really my strong suite :) [03:23]
flughafen thanks Maldivia [03:26]
bbbobbb [bbbobbb!~bbbobbb@2a02:8308:20c3:1300:f6ee:38ca:5688:9e23] has joined ##java [03:35]
shan [shan!uid207478@gateway/web/irccloud.com/x-fflnyqjepiytsvhq] has joined ##java [03:38]
Matthijs [Matthijs!~quassel@unaffiliated/matthijs] has joined ##java [03:40]
sbeex [sbeex!~sbeex@46.140.90.107] has joined ##java [03:41]
DrDonkey [DrDonkey!~DrDonkey@unaffiliated/drdonkey] has joined ##java [03:43]
progart [progart!~kamee@5.77.140.183] has joined ##java [03:48]
noodlepie [noodlepie!~Phillip@77.44.49.73] has joined ##java [03:52]
LtHummus [LtHummus!~lthummus@97-126-75-31.tukw.qwest.net] has joined ##java [03:59]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [03:59]
indistylo [indistylo!~aruns_@223.237.250.112] has joined ##java [04:10]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [04:15]
enoq [enoq!~enoq@2a02:8388:6a87:b080:649f:9456:c1b1:28e4] has joined ##java [04:20]
vusi [vusi!~vusi@41.56.43.72] has joined ##java [04:22]
ravenousmoose_ [ravenousmoose_!~ravenousm@194.78.35.195] has joined ##java [04:33]
alphazb_ [alphazb_!~alphazb@unaffiliated/alphazb] has joined ##java [04:35]
alphazb_ [alphazb_!~alphazb@unaffiliated/alphazb] has joined ##java [04:37]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [04:47]
ertiportline [ertiportline!~ertiportl@unaffiliated/ertiportline] has joined ##java [04:47]
bendem templating [04:48]
bendem Popular templating engines include ~thymeleaf, ~freemarker, ~velocity, ~stringtemplate, ~jtwig, and ~handlebars [04:48]
bendem rocker is Rocker is a Java 8 optimized (runtime compat with 6+), near zero-copy rendering, speedy template engine that produces statically typed, plain java object templates that are compiled along with the rest of your project. https://github.com/fizzed/rocker [04:50]
bendem OK, bendem. [04:50]
bendem no templating is <reply>Popular templating engines include ~thymeleaf, ~freemarker, ~velocity, ~stringtemplate, ~jtwig, ~rocker, and ~handlebars [04:51]
bendem OK, bendem. [04:51]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [04:54]
mitch0 java8 optimized? [04:55]
Maldivia mitch0: it uses lambdas :D [04:59]
Maldivia so "optimized" [04:59]
mitch0 yay [05:00]
magz [magz!~magz@68-168-184-223.fttp.usinternet.com] has joined ##java [05:02]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [05:02]
ravenousmoose_ [ravenousmoose_!~ravenousm@194.78.35.195] has joined ##java [05:04]
rruizt [rruizt!~rruizt@83-84-23-124.cable.dynamic.v4.ziggo.nl] has joined ##java [05:07]
BluesBoy [BluesBoy!~bboy@stotz2.com] has joined ##java [05:10]
yawkat adopt now offers redhat openjdk upstream builds https://adoptopenjdk.net/upstream.html [05:12]
yawkat yawkat's title: "Upstream | AdoptOpenJDK - Open source, prebuilt OpenJDK binaries" [05:12]
mz` [mz`!~mz@gandi/mz] has joined ##java [05:15]
plitter [plitter!~plitter@183.109.95.88.customer.cdi.no] has joined ##java [05:24]
indistylo [indistylo!~aruns_@2401:4900:275b:a52a:dc97:e686:7bd:57e0] has joined ##java [05:30]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [05:39]
hussam [hussam!uid193284@gateway/web/irccloud.com/x-wsluzxyksmebklou] has joined ##java [05:42]
computeiro [computeiro!~computeir@189.15.139.229] has joined ##java [05:43]
CombatVet [CombatVet!~c4@gateway/tor-sasl/combatvet] has joined ##java [05:44]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [05:48]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [05:50]
zwarag [zwarag!~zwarag@2a02:8388:a80:e080:1d8a:c651:b442:c0ab] has joined ##java [05:50]
indistylo [indistylo!~aruns_@2401:4900:275b:a52a:a5f5:65c7:d264:8af4] has joined ##java [05:52]
CombatVet [CombatVet!~c4@gateway/tor-sasl/combatvet] has joined ##java [05:53]
CombatVet [CombatVet!~c4@gateway/tor-sasl/combatvet] has joined ##java [05:57]
forgottenone [forgottenone!~forgotten@176.88.96.93] has joined ##java [05:59]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [06:06]
CptCaptain [CptCaptain!~CptCaptai@160.85.141.104] has joined ##java [06:09]
forgottenone [forgottenone!~forgotten@176.88.96.93] has joined ##java [06:23]
anna` [anna`!~anna@ahowell.io] has joined ##java [06:23]
beStKodErEveR [beStKodErEveR!~dannyD@94.234.37.80] has joined ##java [06:24]
nebulae Hi all. I'm having this code that should print two different values at lines 16 and 17 but it prints the same values, while inside the loops everything is OK. https://pastebin.com/zxSAGz1e [06:34]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [06:35]
odinsbane nebulae: you only created one Person. [06:38]
odinsbane put line four inside of your loop to create a new person for each iteration. [06:38]
lomex [lomex!~lomex@ip4d14ffaf.dynamic.kabel-deutschland.de] has joined ##java [06:38]
nebulae odinsbane: sh@t... you're right.! [06:39]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [06:42]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [06:42]
emx [emx!~bemx@adsl-84-227-37-89.adslplus.ch] has joined ##java [06:44]
emx I use spring with repositories. As I understand JpaRepository extends CrudRepository. So I used the @Repository annotation in my custom interface but when I autowire the repository and try to do a repository.findById() the realtime compiler already indicates that that method is not defined. What am I doing wrong? Or do I need to create the findById() method in the custom repository? [06:47]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [06:53]
exonity01 [exonity01!~exonity01@unaffiliated/exonity01] has joined ##java [06:58]
Cahaan [Cahaan!~Cahaan@static.88-198-39-148.clients.your-server.de] has joined ##java [07:01]
themsay [themsay!~themsay@149.254.234.91] has joined ##java [07:02]
snql [snql!~snql@unaffiliated/snql] has joined ##java [07:11]
gelignite [gelignite!~gelignite@55d4fb48.access.ecotel.net] has joined ##java [07:13]
nahra [nahra!~user@unaffiliated/nahra] has joined ##java [07:19]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [07:20]
mayurvpatil [mayurvpatil!~mayurvpat@202.149.218.202] has joined ##java [07:21]
coolcustomer [coolcustomer!~coolcusty@unaffiliated/coolcusty] has joined ##java [07:23]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [07:36]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [07:47]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [07:50]
pd09041999 [pd09041999!~pd0904199@14.139.61.130] has joined ##java [07:50]
kaniki [kaniki!~K4N1K1@196.121.35.151] has joined ##java [07:51]
kaniki hi guys I want to use @requestparam(value="file", defaultvalue="") multipartfile file, but I want this file if I didnt upload it I want it to get null so I can deal with it [07:51]
kaniki I mean the file is not required for me [07:51]
kaniki I found the solution its using (required=false ) in the @requestparam [07:57]
mohsen_1 [mohsen_1!~mohsen@79.127.64.105] has joined ##java [08:14]
indistylo [indistylo!~aruns_@223.237.243.134] has joined ##java [08:18]
indistylo [indistylo!~aruns_@2401:4900:2768:ecfc:695c:b921:cf4d:81da] has joined ##java [08:20]
spinningCat [spinningCat!~berat@air109.wispotter.com] has joined ##java [08:21]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [08:23]
Jigsy` [Jigsy`!~Jigsy@unaffiliated/jigsy] has joined ##java [08:23]
spinningCat can you suggest me a video tutorial about java wicked? [08:23]
cheeser about what now? [08:24]
cheeser *wicket* ? [08:24]
spinningCat is it wicked or wicked i am not sure about spellling [08:24]
spinningCat it is frontend thing of java [08:24]
cheeser eyes spinningCat [08:24]
cheeser http://wicket.apache.org/ [08:25]
cheeser cheeser's title: "Home | Apache Wicket" [08:25]
spinningCat any video tutorial :p [08:25]
cheeser \_(?)_/ [08:26]
cheeser google is your friend. [08:26]
cheeser http://wicket.apache.org/help/ [08:26]
cheeser cheeser's title: "How to Get Help for Apache Wicket | Apache Wicket" [08:26]
cheeser ##wicket is the place to ask [08:27]
sonOfRa wicket is probably not "modern" enough to have plenty of video tutorials [08:27]
sonOfRa The concept of video tutorials really came with, what, ruby on rails? Maybe you'll find some for things like dropwizard or spring boot, which are more modern in that sense, but a lot of the older stuff relies more on the medium of text [08:28]
Addax I think wicket postdates rails, though [08:28]
cheeser uh.... [08:28]
spinningCat wicket is old? [08:28]
sonOfRa no, hence "modern" in quotes [08:28]
Addax the tutorial video for programming idea is a recent thing itself [08:28]
cheeser so RoR is older than wicket and yet modern enough for video tutorials but wicket isn't? [08:29]
Addax I think the problem wicket has is that it's a web framework for rendering actual content, as opposed to a rich web client framework [08:29]
cheeser am I following that correctly? [08:29]
Addax Different communities, too, because the RoR people still eat crayons [08:29]
spinningCat i start working in a company [08:29]
spinningCat some of project was written with wicket [08:30]
Addax spinningCat: so ... learn wicket [08:30]
cheeser sounds like you should talk to your coworkers a bit [08:30]
sonOfRa cheeser: eh, I guess modern is the wrong word for it? It attracts different crowds. And from the people I know who use wicket, they're not the "video tutorial" crowd. A lot of RoR people are though. [08:30]
spinningCat about? [08:30]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [08:30]
spinningCat ror people? [08:30]
Addax Ruby on Rails = RoR [08:30]
Addax and you want video tutorials, and you can't keep up with jargon in a TEXT chat? This is ungood [08:31]
cheeser doubleplus [08:31]
Addax sonOfRa: and: bingo [08:31]
tassee [tassee!~tasse@55d46b15.access.ecotel.net] has joined ##java [08:33]
ArcherL [ArcherL!~ArcherL@unaffiliated/archerl] has joined ##java [08:41]
Secret-Fire [Secret-Fire!~Secret-Fi@2601:1c1:4201:458c:e2d5:5eff:fe73:3cb7] has joined ##java [08:42]
tasse [tasse!~tasse@55d4d38c.access.ecotel.net] has joined ##java [08:43]
aqd [aqd!~aqd@85-76-66-112-nat.elisa-mobile.fi] has joined ##java [08:48]
_noblegas [_noblegas!uid91066@gateway/web/irccloud.com/x-gryaoekvtcewzsbj] has joined ##java [08:49]
kqr [kqr!~kqr@vps.xkqr.org] has joined ##java [08:49]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [08:57]
acetakwas [acetakwas!~acetakwas@167.99.197.42] has joined ##java [08:57]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [09:03]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [09:07]
tassee [tassee!~tasse@55d4b785.access.ecotel.net] has joined ##java [09:11]
pd09041999 [pd09041999!~pd0904199@14.139.61.130] has joined ##java [09:22]
nebulae How can I avoid the Null pointer exception here and set an empty String ? https://pastebin.com/YRcPWw2s [09:23]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [09:24]
cheeser is element null? [09:26]
cheeser that expression is giving you a null reference at some point [09:26]
cheeser using Optional here abuses the notion of Optional [09:27]
cheeser it's ... not good. [09:27]
nebulae cheeser: the element is null. I thought that using the optional gives me the opportunity to set an empty String there is it doesn't exist right ? [09:27]
cheeser get rid of Optional. get the element. if (element != null ) { ... } else { "" } [09:27]
cheeser if Optional.get() returns null, sure. you're getting the NPE long before you get to the Optional [09:28]
cheeser that expression you pass in has to work. and it doesn't. Optional doesn't magically make NPEs go away. [09:28]
nebulae hmm. Ok. you suggest to check if element != null ? [09:29]
cheeser i literally just said that so yeah. [09:30]
indistylo [indistylo!~aruns_@106.51.25.10] has joined ##java [09:32]
Addax nebulae: optional is useful in very very few situations [09:33]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [09:33]
Addax for most places where people think "Hey, I could use optional!" they could NOT use optional and get the same result, except with less cruft in their code [09:34]
Addax streams are about the only place Optional has any value, and there it's in few situations [09:34]
Addax They're *common*, so they're not "rare" except in the statistical sense [09:35]
mluser-home [mluser-home!~mluser-ho@ip68-0-67-199.tu.ok.cox.net] has joined ##java [09:35]
cheeser i prefer kotlin's filterNotNull [09:36]
Addax cheeser: I use them for first() [09:36]
Addax for example [09:36]
surial nebulae: just so you know what's going on here: Optional is not magic (as in, the Java lang spec doesn't mention it at all, it gets no special treatment). [09:36]
surial nebulae: so, java will evaluate the expression element.getElementsByTagName("country").item(0).getTextContent() and will then hand the resulting value as parameter to the static 'ofNullable' method of the optional class. [09:36]
Addax cyclomatic complexity goes down when using Stream<Foo>.first().getOrElse( ... ), which is odd but true [09:37]
surial The resulting optional will return "" if you pass null to it and invoke 'orElse("")' on that, and the thing you passed if you passed anything other than null. The problem here is that evaluating element.getElementsByTagName("country").item(0).getTextContent() throws the NPE already; Optional isn't even invoked yet. It can't help here. [09:37]
nebulae surial: OK makes sense [09:38]
surial The one way to do this 'safely' is this bizarre line: Optional.ofNullable(element).map(e -> e.getElementsByTagName("country")).map(es -> es.item(0)).map(i -> i.getTextContent()).orElse("") [09:38]
surial that probably WOULD work, but.. I'd advise against doing this. [09:38]
surial Generally what I'd do here is realize that the API you are using to do is is fucking shite and find something else, but I'm picky. [09:38]
surial well, first I'd look for alternative methods inside this API, and if I can't find any, consider it shit and find an alternative implementation. [09:38]
cheeser everything is "fucking shite" to you so it loses value when you say that. [09:39]
surial This looks like some sort of XML or DOM tool. There are various jquery-esque (CSS selector style) libraries. jsoup for HTML, for example. [09:39]
surial And for XML, uh.. jesus it's been such an epically long time I had to mess with it. XPath? [09:39]
cheeser jxpath! [09:39]
surial cheeser: neither jsoup nor xpath are, so, I find your analysis of the value fucking shite mate. [09:39]
surial nebulae: My recollection of how both of those work is that you'd do something along the lines of String country = root.find("country:first-element").asText(""); [09:40]
surial something along those lines, in any case. [09:40]
Addax Based on that paste, it looks like he's USING jsoup already [09:40]
surial aright. well, then my first clause kicks in: First look for alternative ways to use this library. [09:40]
surial though, it says 'value read from xml', and jsoup doesn't parse that, so I'm not sure why you drew that conclusion. [09:41]
cheeser i'm not making any claims of shittiness just propensity for that judgment [09:41]
emx I don't want to hardcode the value of an enum into @Query (JPA, Spring). I guess that using something along "WHERE x = FQCN.SOME_ENUM" would do it but it doesn't. Any hints? [09:41]
Addax true enough [09:41]
nebulae Addax: jsoup ? no just xPath [09:42]
Addax surial-- I appreciate your greatness and all but I really find your casual dismissiveness to be wearying [09:42]
Addax surial has a karma level of 516, Addax [09:42]
surial Is there anyone here who feels this particular API is fine, versus the API concept of 'encode the entire traversal as a string and the API does intelligent things if the node is not found' style APIs such as XPath and jsoup? [09:42]
mitch0 emx: use a parameter? [09:42]
cheeser yes. that API is fine. especially given the era in which is was written. could it be improved? everything could be. [09:42]
Addax surial: here's what *I* feel: people are able to use it. Is it great? No. But functional, yes, as evidenced by the fact that people DO use it and are able to use it SOMEHOW. Working > nonexistent. [09:42]
surial I assume the answer is no, in which case, why don't y'all re-raise the point that I dismiss inferior librraies when I do it to a NOT inferior library? Then you might actually convince me you're on to something. [09:43]
cheeser but casual dismissal of something for the occasional wart is stupid. [09:43]
Addax Build a better mousetrap, and all that, but until then the old mousetraps work better than nothing, so fuck off. [09:43]
surial Addax: Working > nonexistent, but Better > Working. And, here's the thing. JSoup and XPath exist. [09:43]
Addax sure. [09:43]
surial Dafuq you on about? The better mousetraps are already built! [09:43]
Addax Are they available to him? [09:43]
emx mitch0, That is the straight forward solution, yes. But then I have to pass that parameter with each method call. I want to be lase and include the constant on the @Query level -- or can I set a default value for a parameter? [09:43]
Addax As in, does he know about them, understand them, anticipate the issues they, too, bring? [09:43]
Addax are you prepared to tutor him through learning XForms, XPath, etc.? [09:44]
Addax XQuery? [09:44]
Addax You ready for all that? I'm not. [09:44]
surial occasional? Seriously. The question is _EXPLICITLY_ about how this API is a bit tricky to use when you have possible-not-found results with it. Well, I will submit to the badgering by 2 ops. I'm out. Sorry nebulae, you're going ot have to make do with jack and jill over here. [09:44]
Addax I'm not an op. [09:44]
Addax (damn it, this comes up way too much: /msg chanserv access ##java list -- I am not on that list.) [09:45]
mitch0 emx: sorry, I don't know if it's possible [09:46]
emx mitch0, thanks for the try [09:46]
emx I guess I just create another method that passes the constant to the method executing the query... [09:47]
coolcustomer [coolcustomer!~coolcusty@unaffiliated/coolcusty] has joined ##java [09:47]
cheeser look, surial, you badger and harrangue people every fucking goddamn day. and now you get *mild* push back about this one question and you fold like a cheap suit? spare me your butthurt feelings. [09:48]
nebulae ...... [09:50]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [09:52]
mayurvpatil [mayurvpatil!~mayurvpat@202.149.218.202] has joined ##java [09:53]
lucid-lullaby [lucid-lullaby!lucid-lull@gateway/vpn/privateinternetaccess/lucid-lullaby] has joined ##java [09:54]
greggerz [greggerz!~greggerz@unaffiliated/greggerz] has joined ##java [09:55]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [09:57]
mcbain [mcbain!~mcbain@unaffiliated/mcbain] has joined ##java [10:02]
mcbain hello, everyone, quick question, in windows, where would i find log4net log files? its a bit tricky as this java app is a webstart app, didnt quite catching it writing to anything in filemon [10:04]
mcbain but in decompilation they statements are everywhere. [10:05]
mcbain the [10:05]
Addax log4net.... that wouldn't be log4j, that'd be the C# version [10:05]
cheeser tech support [10:05]
cheeser Hello, ##java is not a technical support channel for your Java apps or virtual machines; it's a development channel for enthusiasts to discuss programming with the Java language. Please ask the vendor of your software for support if you're having trouble with it. [10:05]
Rapture [Rapture!~textual@50-204-232-30-static.hfc.comcastbusiness.net] has joined ##java [10:05]
sbalmos Addax: dammit, too quick for me to type [10:05]
Maldivia also, where to find log files depends... that depends from program to program, depends where the config says to write to [10:06]
Addax sbalmos: and I'm still sick, too, bwahahahahahahahahahahahahahahahahahahahahahahaha*cough* [10:06]
cheeser picks Addax's lung up off the floor [10:06]
sbalmos Maldivia: There's other specific crap for log4net in the .Net realm, but that's not for here [10:06]
sbalmos Addax: You're always sick [10:06]
sbalmos Addax: As sick as the rest of us [10:07]
Addax no, this is actually physically ill, too [10:07]
mcbain log4j* sorry [10:07]
Addax gimme back my lung, dammit [10:07]
sbalmos Addax: You... weren't supposed to drink the absinthe... [10:07]
cheeser absinthe++ [10:07]
bluezone [bluezone!uid104970@gateway/web/irccloud.com/x-gmqtgqjmcxkyqcad] has joined ##java [10:07]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [10:08]
nebulae cheeser: sorry I got stuck ... if you say String something = somethingelse.toString(); if something else doesn't exist you will get a null pointer exception, right ? you can't check then if it's null or not [10:09]
mohsen_1 nebulae: you can check before [10:09]
cheeser you're declaring 'something' there. you can't get an NPE by declaring a variable. [10:10]
cheeser *somethingelse* might be null and that you'll need to check before dereferencing. [10:10]
Maldivia if "somethingelse" is null, the yeah, an NPE [10:10]
nebulae mohsen_1: even if I check I get a NPE.... like if(somethingelse == null || somethingelse.isEmpty()) //it throws NPE [10:11]
sbalmos do you have actual code and an actual stacktrace to show this? [10:12]
mohsen_1 nebulae: it sure throws [10:12]
mohsen_1 nebulae: read about operators at [10:12]
mohsen_1 tutorial [10:12]
mohsen_1 The Oracle tutorial for Java is probably your best starting point, at https://docs.oracle.com/javase/tutorial . Skip the Netbeans bits. Another option: https://www.ktbyte.com/java-tutorial - https://hackr.io/tutorials/java has a list of others as well. [10:12]
Revan- [Revan-!~Revan@host-72-174-107-194.static.bresnan.net] has joined ##java [10:13]
mohsen_1 nebulae: you're misuing the || operator [10:13]
cheeser well, kinda [10:13]
nebulae mohsen_1: Then I can't check if it's null. If I even TRY to check for something that it is null I get NPE [10:13]
nebulae geez [10:14]
Addax nebulae: check earlier then [10:14]
cheeser nebulae: you're checking wrongly [10:14]
mohsen_1 nebulae: not that's not true, you're checking wrongly: [10:14]
Addax if(ref!=null) { var next=ref.elementByName("foo"); if(next!=null) { ... and so forth and so on } } [10:14]
cheeser String something; if(somethinelse != null) { something = somethingelse.toString(); } else { something = ""; } [10:14]
sbalmos let's not even get into ternary assignments. ;) [10:15]
nebulae cheeser: ok let me try [10:15]
mohsen_1 I was going to write the exact same statements while you guys wrote it sooner [10:15]
mohsen_1 D [10:15]
Addax we are magic [10:15]
Cmaj6 [Cmaj6!~Cmaj6@212-127-131-106.cable.dynamic.v4.ziggo.nl] has joined ##java [10:15]
surial if(somethingelse == null || somethingelse.isEmpty()) //it throws NPE <-- incorrect. It does NOT throw. [10:15]
Addax but great minds and all that [10:16]
surial nebulae: x.foo() throws if x is null (excluding silly stuff that linters will fall all over). [10:16]
surial x = whatever, x == whatever.. those won't. [10:16]
indistylo [indistylo!~aruns_@106.51.25.10] has joined ##java [10:17]
surial nebulae: perhaps you're doing something like this: if (x.getFoo() == null || x.getFoo().isEmpty()) { ... }.. and you're getting an NPE and thinking: Dafuq, why can't I even check x.getFoo() for null ness?? But if that line of java code throws NPE? The problem is that _x_ is null. [10:18]
Addax yep [10:18]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [10:18]
nebulae cheeser: this is what I am trying [10:19]
nebulae https://pastebin.com/V9LDPAdj [10:19]
surial nebulae: element is null. or element.getElementsByTagName("country") is null. or element.getElementsByTagName("country").item(0) is null. [10:19]
cheeser nebulae: well no shit. [10:19]
surial nebulae: basically, the thingie in front of the . is null. [10:19]
cheeser you're still in the same problem with your Optional. [10:19]
surial nebulae: given that there are 3 dots in there, there are 3 separate things that, if they are null, will throw. [10:19]
cheeser break up that expression. check for nulls along the away. [10:19]
nebulae cheeser: yes :D :D :D [10:19]
nebulae still in the same [10:20]
surial nebulae: the solution is to use a different API to access this stuff, or to check everything that can be null. I'd do the API thing and weather cheeser and addax's panties being all in a wad, myself. [10:20]
surial nebulae: what library is this? Looks like the built in XML DOM stuff, no? [10:20]
kicked surial (surial) [10:20]
surial [surial!~surial@ec2-184-72-218-95.compute-1.amazonaws.com] has joined ##java [10:20]
surial parsing [10:20]
surial surial, what does that even *mean*? [10:20]
surial xml parsing [10:20]
surial Working with XML? Consider ~jackson, ~xstream, or ~jaxb to read and write XML. Avoid SAX (org.xml.sax) and DOM (org.w3c.dom); StAX is okay (https://docs.oracle.com/javase/tutorial/jaxp/stax/index.html ), but these days most use jackson. [10:20]
surial See? Avoid SAX and DOM. In my words I'd say those APIs are shit, but, you know. [10:21]
Addax nebulae: *sigh* What you should take from surial is pretty valid, in its way: he's suggesting using XPath to actually find the elements instead of walking a tree to get them. XPath can be a little arcane, but it's fine. [10:21]
Addax You can also possibly use selectors (which I think he mentioned earlier, but are LIKE XPath without being XPath) [10:22]
Addax just ignore all the judgemental crap, I don't think he even realizes how it sounds to mortals [10:22]
sbalmos Addax: I would kill for a real JS XPath equivalent that doesn't have all kinds of shitty caveats [10:22]
nebulae Addax: what I understand he says to break the whole statement ? [10:22]
Addax nebulae: say what, now? [10:22]
Maldivia sbalmos: tried JSoup's ? [10:23]
nebulae Addax: he said "given that there are 3 dots in there, there are 3 separate things that, if they are null, will throw." [10:23]
mohsen_1 nebulae: you can also read the documentation of your current library, and spot where it's throwing the npe [10:23]
Addax nebulae: he's correct [10:23]
Addax The bot uses jsoup's selectors rather often [10:24]
mohsen_1 maybe the library itself is throwing the npe [10:24]
freeone3000 the proper way to solve this here is to do a query against the dom. still, this makes me want to use kotlin. [10:24]
Addax nebulae: If I remember correctly from my casual scan, he's suggesting not doing it that way, period. Use XPath, selectors, etc., which freeone3000 ALSO just suggested. [10:25]
Addax But if you want to walk the DOM, break the statement apart. [10:25]
mohsen_1 nebulae: check the documentation, it provides a way of checking the null. if it doesn't, you shouldn't probably be using it [10:25]
Addax The question here is about pragmatism: you can do it "right" - i.e., use an API that's designed to do what you're doing - or you can figure out how to do what you're doing, except correctly. [10:25]
sbalmos Maldivia: Honestly, been a long while. I don't remember doing so in an actual project. I think I have when just poking around. [10:26]
Addax sbalmos: jsoup's is good enough to pull the twitter title out correctly :) [10:26]
led_dark_1 [led_dark_1!~Thunderbi@217.66.160.14] has joined ##java [10:31]
indistylo [indistylo!~aruns_@106.51.25.10] has joined ##java [10:32]
pd09041999 [pd09041999!~pd0904199@14.139.61.130] has joined ##java [10:35]
junktext [junktext!~junktext@fsf/member/junktext] has joined ##java [10:38]
tang^ [tang^!~tang^@2604:3d09:47f:fb80:c56:126e:c97d:94b3] has joined ##java [10:40]
spuz [spuz!6dee4b8e@gateway/web/cgi-irc/kiwiirc.com/ip.109.238.75.142] has joined ##java [10:47]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [10:47]
jamezp [jamezp!~jamezp@redhat/jboss/jamezp] has joined ##java [10:48]
Cmaj6 [Cmaj6!~Cmaj6@212-127-131-106.cable.dynamic.v4.ziggo.nl] has joined ##java [10:50]
spuz Hi, what is the correct way to use javac with a java 9 module project? [10:50]
spuz I want to say something like: javac <path-to-my-modules> [10:51]
mohsen_1 spuz: -p <path> specifies path, read the tutorial [10:51]
mindCrime [mindCrime!~mindCrime@216.85.170.148] has joined ##java [10:51]
spuz mohsen_1: can you point to the tutorial? [10:52]
mohsen_1 spuz: http://www.javamagazine.mozaicreader.com/SeptOct2017#&pageSet=23&page=0 [10:55]
Addax tutorial [10:55]
Addax The Oracle tutorial for Java is probably your best starting point, at https://docs.oracle.com/javase/tutorial . Skip the Netbeans bits. Another option: https://www.ktbyte.com/java-tutorial - https://hackr.io/tutorials/java has a list of others as well. [10:55]
spuz The oracle tutorial is for java 8 unfortunately [10:56]
mbooth_ spuz: You could always read the man page: https://docs.oracle.com/javase/9/tools/javac.htm [10:57]
spuz yes I did but it doesn't specify what format the sourcefiles parameter should take [10:57]
spuz and when I specify a directory, it just says "no source files" [10:58]
mbooth_ spuz: Like the third line on that page gives as example "such as MyClass.java" [10:58]
mbooth_ spuz: Did you try specifying java files and not a directory like it suggests? [10:58]
junktext [junktext!~junktext@fsf/member/junktext] has joined ##java [10:59]
themsay [themsay!~themsay@149.254.234.91] has joined ##java [10:59]
CptCaptain [CptCaptain!~CptCaptai@160.85.141.104] has joined ##java [10:59]
mbooth_ spuz: And then a few lines further down it says "There are two ways to pass source code file names to javac" and goes into more detail [11:00]
mbooth_ All the info is there [11:00]
spuz mbooth_ ah great, thanks [11:00]
junktext_ [junktext_!~junktext@fsf/member/junktext] has joined ##java [11:03]
rippa [rippa!~rippa@ppp-vpdn-37.1.85.157.yarnet.ru] has joined ##java [11:07]
esro [esro!~esro@user119-167.otvarta.com.pl] has joined ##java [11:11]
Sasazuka [Sasazuka!~Sasazuka@unaffiliated/sasazuka] has joined ##java [11:12]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [11:12]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [11:20]
maryo [maryo!~Maryo@unaffiliated/maryo] has joined ##java [11:31]
kgrimes2 [kgrimes2!~kgrimes2@172-11-18-93.lightspeed.irvnca.sbcglobal.net] has joined ##java [11:33]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [11:37]
led_dark_1 [led_dark_1!~Thunderbi@217.66.160.14] has joined ##java [11:38]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [11:38]
led_dark_2 [led_dark_2!~Thunderbi@217.66.160.14] has joined ##java [11:44]
sbeex [sbeex!~sbeex@81.221.239.154] has joined ##java [11:45]
RedSoxFan07 [RedSoxFan07!~Thunderbi@d-137-103-109-45.ct.cpe.atlanticbb.net] has joined ##java [11:46]
admin123 [admin123!~nope@ool-4350370b.dyn.optonline.net] has joined ##java [11:47]
junktext_ [junktext_!~junktext@fsf/member/junktext] has joined ##java [11:47]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [11:51]
Xgc [Xgc!~Jon@98.1.126.42] has joined ##java [11:51]
vdamewood [vdamewood!~vdamewood@unaffiliated/vdamewood] has joined ##java [11:52]
indistylo [indistylo!~aruns_@106.51.25.10] has joined ##java [11:55]
led_dark_2 [led_dark_2!~Thunderbi@217.66.160.14] has joined ##java [11:55]
sa02irc [sa02irc!~sa02irc@155-079-043-212.ip-addr.inexio.net] has joined ##java [11:59]
kgrimes2 [kgrimes2!~kgrimes2@172-11-18-93.lightspeed.irvnca.sbcglobal.net] has joined ##java [12:00]
upgrdman [upgrdman!~upgrdman@blender/artist/upgrdman] has joined ##java [12:06]
DrowningElysium [DrowningElysium!uid190788@gateway/web/irccloud.com/x-fgxztjljduxoltcd] has joined ##java [12:08]
junktext__ [junktext__!junktext@fsf/member/junktext] has joined ##java [12:08]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [12:09]
Krysto [Krysto!~user@162.219.178.66] has joined ##java [12:12]
maryo [maryo!~Maryo@unaffiliated/maryo] has joined ##java [12:13]
Krysto parted the channel: "ERC (IRC client for Emacs 26.1)" [12:14]
aqd [aqd!~aqd@85-76-66-112-nat.elisa-mobile.fi] has joined ##java [12:18]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [12:18]
ArcherL [ArcherL!~ArcherL@unaffiliated/archerl] has joined ##java [12:27]
ArcherL I am working on implementation of IP Fragmentation, I am confused as to what objects to make and how to make classes. any suggestions would be very ful. [12:29]
ArcherL helpful* [12:29]
freeone3000 A live demonstration! [12:33]
ArcherL [ArcherL!~ArcherL@unaffiliated/archerl] has joined ##java [12:33]
led_dark_1 [led_dark_1!~Thunderbi@217.66.160.14] has joined ##java [12:35]
Regon [Regon!~Regon@unaffiliated/regon] has joined ##java [12:37]
aqd [aqd!~aqd@85-76-66-112-nat.elisa-mobile.fi] has joined ##java [12:40]
morrowyn [morrowyn!~morrowyn@s55945b44.adsl.online.nl] has joined ##java [12:44]
rruizt [rruizt!~rruizt@83-84-23-124.cable.dynamic.v4.ziggo.nl] has joined ##java [12:46]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [12:47]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [12:55]
cfoch [cfoch!uid153227@gateway/web/irccloud.com/x-lxolkiucjhnlbcaz] has joined ##java [12:55]
karab44 [karab44!~karab44@unaffiliated/karab44] has joined ##java [12:56]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [12:59]
admin123 [admin123!~nope@ool-4354e00d.dyn.optonline.net] has joined ##java [01:01]
megaTherion [megaTherion!~therion@2001:470:1f0b:518::3] has joined ##java [01:04]
RedSoxFan07 [RedSoxFan07!~Thunderbi@d-137-103-109-45.ct.cpe.atlanticbb.net] has joined ##java [01:06]
bobek [bobek!~bobek@unaffiliated/bobek] has joined ##java [01:08]
mayurvpatil [mayurvpatil!~mayurvpat@116.74.149.252] has joined ##java [01:10]
sa02irc [sa02irc!~sa02irc@155-079-043-212.ip-addr.inexio.net] has joined ##java [01:13]
omonk [omonk!~omonk@unaffiliated/omonk] has joined ##java [01:14]
cliluw [cliluw!~cliluw@unaffiliated/cliluw] has joined ##java [01:21]
commanderkeen [commanderkeen!~commander@75-108-123-5.bcstcmta01.com.dyn.suddenlink.net] has joined ##java [01:22]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [01:27]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [01:27]
beStKodErEveR [beStKodErEveR!~dannyD@81.228.98.151] has joined ##java [01:28]
dez [dez!uid92154@fedora/deSouza] has joined ##java [01:32]
indistylo [indistylo!~aruns_@106.51.25.10] has joined ##java [01:33]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [01:36]
indistylo [indistylo!~aruns_@106.51.24.137] has joined ##java [01:39]
exonity01 [exonity01!~exonity01@unaffiliated/exonity01] has joined ##java [01:50]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [01:50]
lxsameer [lxsameer!~lxsameer@unaffiliated/lxsameer] has joined ##java [01:51]
junktext_ [junktext_!~junktext@fsf/member/junktext] has joined ##java [01:53]
morrowyn [morrowyn!~morrowyn@s55945b44.adsl.online.nl] has joined ##java [02:01]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [02:02]
lord_EarlGray [lord_EarlGray!~lord_Earl@125-41.echostar.pl] has joined ##java [02:03]
led_dark_1 [led_dark_1!~Thunderbi@217.66.160.14] has joined ##java [02:06]
bobek [bobek!~bobek@unaffiliated/bobek] has joined ##java [02:06]
Regon [Regon!~Regon@unaffiliated/regon] has joined ##java [02:11]
mindCrime [mindCrime!~mindCrime@216.85.170.148] has joined ##java [02:15]
LKoen [LKoen!~LKoen@2a01cb0407597a00f9ed6431dbad1b61.ipv6.abo.wanadoo.fr] has joined ##java [02:15]
kgrimes2 [kgrimes2!~kgrimes2@137.78.59.217] has joined ##java [02:15]
tokam [tokam!~tokam@unaffiliated/tokam] has joined ##java [02:18]
tokam Hi [02:18]
tokam I am struggeling with a bug where somehow I do not get a lock on a sqlite database [02:18]
tokam how can I best debug which thread gets the lock before me? [02:18]
Addax the sqlite lock? [02:19]
cheeser tech support [02:19]
cheeser Hello, ##java is not a technical support channel for your Java apps or virtual machines; it's a development channel for enthusiasts to discuss programming with the Java language. Please ask the vendor of your software for support if you're having trouble with it. [02:19]
Addax First off, why are you using sqlite [02:19]
Addax second this is a good question to ask #sqlite [02:19]
indistylo [indistylo!~aruns_@106.51.24.137] has joined ##java [02:20]
millerti [millerti!~millerti@cpe-66-24-91-119.stny.res.rr.com] has joined ##java [02:20]
tokam I have a local desktop application in java which uses sqlite as project files [02:23]
cheeser this isn't the place [02:23]
lomex [lomex!~lomex@ip4d14ffaf.dynamic.kabel-deutschland.de] has joined ##java [02:26]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [02:29]
MadLamb [MadLamb!~fabio@ip5b40f0ee.dynamic.kabel-deutschland.de] has joined ##java [02:30]
MadLamb I'm trying to deserialize a string to object with jackson, and my object has a fromString method, but jackson says "(although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value". Am I missing something obvious? [02:30]
freeone3000 MadLamb: It needs to either be a constructor or be annotated with @JsonCreator [02:32]
freeone3000 You appear to have a @JsonCreator, but is it on the correct method? [02:32]
MadLamb freeone3000, do you think/know if it would work on a kotlin companion object? [02:33]
tokam java.sql.SQLException: Unable to run insert stmt on object model.ProgrammSet ..... [02:33]
cheeser MadLamb: no [02:33]
cheeser companion objects are nested classes not the types themselves. [02:33]
MadLamb cheeser, :( [02:34]
cheeser tech support [02:34]
cheeser tokam, Hello, ##java is not a technical support channel for your Java apps or virtual machines; it's a development channel for enthusiasts to discuss programming with the Java language. Please ask the vendor of your software for support if you're having trouble with it. [02:34]
tokam i get internally a status code 5 [02:34]
indistylo [indistylo!~aruns_@106.51.25.10] has joined ##java [02:34]
tokam I am developing the software [02:34]
cheeser then 1) stop using sqlite and 2) ask in a sqlite channel about those locks. [02:35]
tokam I use ormlite [02:35]
cheeser don't care [02:35]
cheeser http://i.imgur.com/0umISkZ.jpg [02:35]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [02:35]
freeone3000 MadLamb: I'd define an additional constructor in that case. [02:35]
pd09041999 [pd09041999!~pd0904199@14.139.61.130] has joined ##java [02:36]
paddyez [paddyez!~paddyez@wikipedia/paddyez] has joined ##java [02:40]
RoBoT [RoBoT!~smitty161@207.195.63.244] has joined ##java [02:43]
smitty1616 [smitty1616!~smitty161@207.195.63.244] has joined ##java [02:43]
MadLamb freeone3000, secondary constructors must call the primary in kotlin... my primary constructor has 3 params [02:48]
nickel8448 [nickel8448!~rahul@2a02:8084:d6be:8300:61f6:29c3:95c5:c1c2] has joined ##java [02:50]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0::37a] has joined ##java [02:52]
Sasazuka [Sasazuka!~Sasazuka@unaffiliated/sasazuka] has joined ##java [02:56]
MadLamb freeone3000, managed to get it working with @JvmStatic [02:57]
MadLamb cheeser, ^ [02:57]
cheeser fair enough [02:58]
tete_ [tete_!~tete@85-195-252-28.fiber7.init7.net] has joined ##java [03:00]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [03:04]
acidjnk [acidjnk!~acid@mue-88-130-58-049.dsl.tropolys.de] has joined ##java [03:05]
grim001 [grim001!~grim001@ip24-253-15-145.lv.lv.cox.net] has joined ##java [03:06]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [03:07]
pd09041999 [pd09041999!~pd0904199@14.139.61.130] has joined ##java [03:11]
kicked pd09041999 (Banned: please fix your connection. you're bouncing in and out. this ban will expire after 7d) [03:11]
Addax Incidentally: I had to write some reflection code for a kotlin project, ended up dropping back to java for it because it was easier to pretend typing didn't matter [03:13]
ArcherL I am working on implementation of IP Fragmentation, I am confused as to what objects to make and how to make classes. any suggestions would be very helpful. [03:14]
ArcherL I have written a code but it doesn't seem to be working. [03:15]
Addax Did you not ask this earlier, verbatim? [03:15]
Maldivia Addax: he did, and then disconnected [03:15]
cheeser show us [03:17]
cheeser ArcherL, Paste the code (and any errors) in a pastebin where we can see it. See ~pastebin for options. Also see ~testcase for good examples as to how to help us help you quickly diagnose and solve problems. [03:17]
whaley [whaley!~whaley@192.133.78.19] has joined ##java [03:17]
Addax also: [03:17]
Addax doesn't work [03:17]
Addax ArcherL, doesn't work is useless. Tell us what it is, what you want it to do, and what it is doing. Consider putting some code and any errors on a pastebin. (use ~pastebin for suggestions) [03:17]
ArcherL https://pastebin.com/kKC864md [03:17]
ArcherL yes I was writing about the outcome i expect from the code [03:18]
cheeser don't use static. don't use LinkedList. [03:18]
freeone3000 oh line 19 is questionable [03:18]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [03:18]
freeone3000 ArcherL: Okay, so you seem to be using generics, but, like, halfway. [03:18]
ArcherL line 19 is something intellij added by its own [03:19]
freeone3000 ArcherL: Did you intend for the variable on line 5 to be a Queue of LinkedLists? What's in those linkedlists? [03:19]
freeone3000 ArcherL: No, you don't get to do that. You don't get to say "oh my tool did that so I don't have to understand it". [03:19]
ArcherL Like I am trying to achieve the output with Routers=2 Total data: 1600, MTU(1)=600 & MTU(2)=400 is [600, 600, 400] [03:21]
ArcherL and [400 200, 400, 200, 400] [03:21]
freeone3000 Why would that input produce that output? [03:22]
ArcherL I am trying to achieve that and which is why added the queue to be a linked list. [03:23]
ArcherL but it doesn't seem to be working at all now. [03:23]
freeone3000 You didn't make the queue a linked list. You made the queue contain linkedlists. [03:23]
freeone3000 Fully qualify your types and the problem is a bit more clear. [03:24]
freeone3000 Also, your fragmentPackets does too much to clearly understand now. It should apply one stage of the fragmentation algorithm, and subsequent stages should be done with subsequent invocations. Then, if you have one testably correct, you can extrapolate to multiple. [03:25]
ArcherL I tried using a simple approach here. -> https://github.com/realArcherL/Fragmenation/blob/master/MTU.java [03:26]
ArcherL ArcherL's title: "Fragmenation/MTU.java at master realArcherL/Fragmenation GitHub" [03:26]
ArcherL but couldn't get it to work for multiple MUTs any suggestions as to how to work around this problem. This is kind of driving me insane now. [03:27]
freeone3000 ArcherL: Okay, so you've got it working for one. What happens if you supply the output from the first as the input to the second? [03:28]
ArcherL I am not able to supply the output of the first as input to the other. [03:29]
freeone3000 ArcherL: Why not? It takes an packet size and outputs an array of packet sizes. [03:29]
freeone3000 One thing that may help is writing down, conceptually, what you want it to do, in very exact terms, before actually writing some code. What seems to be missing here is the understanding of the abstraction from 1-step to n-steps [03:31]
freeone3000 I don't actually have a good way of explaining this. [03:32]
ArcherL That would require me to store the output of the first in another array and then passing it as input for the other but that didn't work. [03:32]
freeone3000 ArcherL: Okay, what does that look like? [03:32]
ArcherL freeone3000, I did that sir, after which i wrote the code. [03:32]
ArcherL it works for the 2nd time. as in whenever i feed the output as input, but for the third (it should iterate over the output of second) instead its works again on the output of the first. [03:34]
ArcherL So like the output looks for MTU= 600, 400, 150 and Total Bytes = 1600 like Packets: 600, 600, 400 [2nd] Packets: 400 200 400 200 400 [3rd]: 150 150 150 150 and so on [03:37]
freeone3000 ArcherL: Show me. [03:37]
ArcherL give me a minute will upload it on pastebin and post it here. [03:38]
kgrimes2 [kgrimes2!~kgrimes2@137.78.59.217] has joined ##java [03:41]
k5_ [k5_!~k5@2001:16b8:a0ef:5300:b40b:16df:c032:cb80] has joined ##java [03:41]
CptCaptain [CptCaptain!~CptCaptai@65.96.198.178.dynamic.wline.res.cust.swisscom.ch] has joined ##java [03:42]
ArcherL https://pastebin.com/fcwT20kv [03:46]
cheeser stop using static [03:46]
cheeser only main() should be static [03:46]
ArcherL Will correct it immediately. Thanks [03:46]
ArcherL the problem i am facing in this one is that, the packets array gets over written by the dataset of the new packets and hence it only shows result of the one packet, or may be i am passing the parameters wrong [03:48]
ArcherL Like I am not able to make this code work for the multiple MTUs [03:49]
ArcherL and now I am confused as to how to give the output of the previous iteration in to the new, which is why i switched to using queues and linked list, [03:50]
coolcustomer [coolcustomer!~coolcusty@unaffiliated/coolcusty] has joined ##java [03:52]
ArcherL https://pastebin.com/db4gNhft --> removed static [03:53]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [03:54]
vdamewood [vdamewood!~vdamewood@unaffiliated/vdamewood] has joined ##java [03:56]
wisey [wisey!~wisey@80-44-185-183.dynamic.dsl.as9105.com] has joined ##java [03:57]
kgrimes2_ [kgrimes2_!~kgrimes2@137.79.214.65] has joined ##java [04:01]
freeone3000 If you were consfused by arrays you're going to be equally confused by a List, because the concept is the same. [04:03]
freeone3000 Yep, that's the problem. You're manipulating the data in place instead of working on a new instance of data each time. [04:03]
freeone3000 ArcherL: If you removed static what's that on lines 15-18? [04:03]
freeone3000 ArcherL: In fact, why are those anything other than local variables? [04:04]
royal_screwup21 [royal_screwup21!89de72f4@gateway/web/cgi-irc/kiwiirc.com/ip.137.222.114.244] has joined ##java [04:05]
ArcherL I thought making them static would make it easy to use between methods [04:07]
ArcherL freeone3000, how do i make it work for a new instance? [04:07]
freeone3000 ArcherL: Ah, but you shouldn't be using them between methods, and there's your confusion. [04:08]
freeone3000 ArcherL: You're doing processing on state. You do x on it, then y on it, then z on it, and there's no need to remember what happened previously, so you don't need to keep state in anything other than in local variables. [04:08]
ArcherL If I were to make them non static, this would require me to supplement each method with an additional parameter of an integer type array, wouldn't it? [04:09]
freeone3000 yep. [04:10]
freeone3000 which is what you want to do. so you can see how the data passes through methods. [04:10]
ArcherL No wait, I can simply remove the static from them, should work fine then as well right? [04:10]
ArcherL ohk freeone3000, give me a minute i will try it and post it here. [04:11]
mindCrime [mindCrime!~mindCrime@216.85.170.148] has joined ##java [04:11]
freeone3000 That'd make it instance, and wouldn't fix the problem. [04:11]
royal_screwup21 [royal_screwup21!89de72f4@gateway/web/cgi-irc/kiwiirc.com/ip.137.222.114.244] has joined ##java [04:14]
ArcherL freeone3000, I made them local to the methods but now I can't use them in my main class, it says: "Cannot resolve symbol packets", same for the other arrays. [04:18]
ArcherL which requires me to print them then and there in the method. any alternate to this? [04:21]
Addax ArcherL: step back. Think of your processing chain as *an object& [04:21]
Addax And if you don't know Java, well, learn java first [04:21]
lord_EarlGray [lord_EarlGray!~lord_Earl@125-41.echostar.pl] has joined ##java [04:21]
Addax Your last statement makes me think you are not proficient in java enough to solve this yet [04:22]
ArcherL I am bit worked up. and yes my java is rusty. [04:23]
Addax well, chill out, and refresh your java knowledge (note that C# would have the same concerns) [04:28]
wilbert [wilbert!wilbert@gateway/vpn/privateinternetaccess/wilbert] has joined ##java [04:33]
whaley [whaley!~whaley@192.133.78.19] has joined ##java [04:35]
lord_EarlGray hi, how to open h2 database admin panel (spring web app) in browser? What's the address for this console? [04:35]
Addax lord_EarlGray: are you using spring boot [04:36]
lord_EarlGray yes [04:36]
Addax then application.properties shoudl have a line: "spring.h2.console.enabled=true" [04:37]
Addax then localhost:8080/h2-console [04:37]
noahmg123 [noahmg123!sid89117@gateway/web/irccloud.com/x-smnufhzodjxdfvsb] has joined ##java [04:38]
noahmg123 I'm having issues with JavaFX in my project [04:38]
Addax noahmg123: cool [04:39]
noahmg123 Addax: I am getting this error: [04:39]
noahmg123 class com.sun.javafx.fxml.FXMLLoaderHelper (in unnamed module @0x5206bd7f) cannot access class com.sun.javafx.util.Utils (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.util to unnamed module @0x5206bd7f [04:39]
lord_EarlGray Addax: yeah, that works! :D Thank you so much! [04:39]
beStKodErEveR [beStKodErEveR!~dannyD@212.37.29.158] has joined ##java [04:40]
noahmg123 I've tried googling it, but I can't find any solutions that help [04:40]
Addax lord_EarlGray: this is the second time you've asked this and the second time you got the same answer, BTW [04:40]
Addax (see: 4/4/2019) [04:40]
Maldivia noahmg123: using OpenJFX 11 ? [04:40]
noahmg123 Maldivia: Yep [04:41]
Addax lord_EarlGray: https://javabot.evanchooly.com/logs/%23%23java/2019-04-04#5ca5f3320a975a35843b2767 [04:42]
Maldivia noahmg123: I would suggest making your app modular then, makes it a lot easier :D [04:42]
Maldivia noahmg123: and then remember to open your packages you want to use fxmlloader with to javafx.fxml module [04:42]
noahmg123 Maldivia: ....? This is a brand new project. I don't know how modularity would help when I literally only have three files. [04:43]
Addax sighs [04:43]
Addax noahmg123: 'modular' doesn't necessarily mean breaking your app into multiple modules, it might also mean module-aware, which isthe source of your problem [04:43]
noahmg123 I am pretty aware of that [04:44]
Maldivia noahmg123: https://openjfx.io/openjfx-docs/ is a good place to start [04:44]
Maldivia Maldivia's title: "Getting Started with JavaFX 11" [04:44]
Addax then why did you say what you just said? [04:44]
Addax I'm confused now [04:44]
noahmg123 I have JavaFX in my modules. I don't know what else to add to make it work. I think I may have found one thing. Let me try that. [04:45]
Jigsy` [Jigsy`!~Jigsy@unaffiliated/jigsy] has joined ##java [04:46]
yuriescl [yuriescl!~yuriescl@unaffiliated/yuriescl] has joined ##java [04:46]
Kol [Kol!~Kol@S0106bcd1656555bc.vc.shawcable.net] has joined ##java [04:46]
noahmg123 Ok, adding a module-info.java file makes it work now [04:46]
Maldivia which is exactly what I suggested :D [04:47]
Maldivia "adding a module-info.java" = "making your app modular" [04:47]
Addax you made it modular! [04:47]
noahmg123 Yay [04:47]
immibis [immibis!~immibis@222-153-253-249-fibre.sparkbb.co.nz] has joined ##java [04:48]
noahmg123 Ok... although why do all the tutorials say to add VM option flags? That sounds so much more unweildy [04:49]
noahmg123 Like, ok, the page you gave me does show that you have the option to create a module-info.java file, but it's seemingly buried under instructions on how to use VM option flags. [04:50]
Addax noahmg123: people who use javafx should document everything they learn, esp. if it's in opposition to what the docs imply, until tribal knowledge supercedes the crap [04:51]
noahmg123 Agreed [04:52]
cheeser s/who use javafx // [04:52]
Addax hell yes [04:52]
cheeser perhaps on a channel blog of some sort. :D [04:52]
noahmg123 College students doing projects for a grade do it [04:53]
noahmg123 Otherwise... I'm really not sure [04:53]
Addax Lots of professionals do it too [04:53]
noahmg123 Fair [04:53]
noahmg123 I know the general concept is very similar to how Android development works. [04:53]
orbyt_ [orbyt_!~orbyt@8.4.228.63] has joined ##java [04:57]
noahmg123 Funny thing though. If I remember my roommate correctly though. Their professor was like "Well JavaFX hasn't been bundled into the JDK since version 7(?), and I don't know how to include it separately, so you all just use that version for these projects." [04:57]
Galactus [Galactus!~Galactus@unaffiliated/galactus] has joined ##java [04:57]
yawkat [yawkat!~yawkat@cats.coffee] has joined ##java [04:58]
cheeser since 8 [04:59]
cheeser it hasn't been part of openjdk since ... well maybe ever. but Oracle bundled it with their JVM [04:59]
noahmg123 This is college. You think they're doing anything other than going to the Oracle download page? [05:00]
noahmg123 Most people here are developing on Windows *shudders* [05:00]
con3 [con3!~kvirc@ml.sun.ac.za] has joined ##java [05:00]
cheeser windows is fine [05:01]
noahmg123 I haven't used WIndows in years tbh. Besides on the school computers. [05:02]
noahmg123 Maldivia: ok now I see two different sources claiming two different things I should do with my module-info.java file. They both work, but idk if there's any significant difference. What should I put at the bottom? [05:03]
noahmg123 https://www.irccloud.com/pastebin/vq6ITZoG/ [05:03]
noahmg123 wait, stupid [05:03]
noahmg123 opens sample to javafx.fxml; exports sample; [05:04]
kgrimes2_ [kgrimes2_!~kgrimes2@137.79.214.65] has joined ##java [05:04]
noahmg123 or just: opens sample;? [05:04]
wildlander [wildlander!~wildlande@unaffiliated/wildlander] has joined ##java [05:06]
RedSoxFan07 [RedSoxFan07!~Thunderbi@d-137-103-109-45.ct.cpe.atlanticbb.net] has joined ##java [05:10]
kgrimes2_ [kgrimes2_!~kgrimes2@137.78.59.217] has joined ##java [05:11]
progart [progart!~kamee@5.77.140.183] has joined ##java [05:23]
brandonson [brandonson!~brandon@208.91.114.1] has joined ##java [05:27]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [05:31]
whaley [whaley!~whaley@192.133.78.19] has joined ##java [05:32]
sbalmos1 [sbalmos1!~sbalmos@2605:a000:1304:8078:5f0:368:824a:af86] has joined ##java [05:38]
Maldivia well, depends - do you want to open it to the world, or just to javafx ? [05:39]
magyar [magyar!~magyar@unaffiliated/magyar] has joined ##java [05:51]
TESTED123 [TESTED123!~blah@2001:8a0:6cca:3f01:f0fe:3ae8:433b:a8a7] has joined ##java [05:53]
TESTED123 hey. How come the code for generating a secret key is that same as generating a hash? [06:06]
TESTED123 im using PBKDF2WithHmacSHA256 [06:07]
royal_screwup21 this is a bit offtopic, but I was just looking through a thread on how to build a jar in intellij https://stackoverflow.com/questions/1082580/how-to-build-jars-from-intellij-properly The topmost answer has all these elaborate steps which I find a bit baffling. Isn't it just a simple one-liner gradle build (or mvn equivalent)? [06:11]
surial TESTED123: it's not. [06:11]
surial TESTED123: pastebin your code. [06:11]
surial royal_screwup21: it is a one-liner in maven and gradle, yes. IDEs aren't builders, don't build your artefacts from within your IDE. [06:11]
TESTED123 -pastebin [06:12]
surial that's like asking: "How do I catch a fish using a shopping cart". [06:12]
surial pastebin [06:12]
surial TESTED123, Please paste your code and any errors online. For runnable main-classes, try https://glot.io/new/java . For general code and errors, use for instance https://gist.github.com or https://www.hastebin.com [06:12]
i-make-robots [i-make-robots!~dan@184.70.142.222] has joined ##java [06:12]
surial TESTED123: tilde, not dash. [06:12]
TESTED123 oh ok :) [06:12]
cheeser kinda offtopic [06:12]
cheeser royal_screwup21, Anytime you start a statement with something like "this is kind of off topic," do us all a favor and stop. ask it somewhere else or just go to google.com and search there. [06:12]
cheeser there's #idea-users if you're interested [06:13]
surial royal_screwup21: let's make it simple. The answer to: "How to build jars from IntelliJ properly?", given that 'properly' is in there? The answer is: "You don't". [06:13]
surial royal_screwup21: for what it is worth, if you insist that IDEs ought to be able to do this, it's simpler in eclipse. [06:14]
TESTED123 https://www.hastebin.com/igadiwokaj.java [06:14]
junktext [junktext!~junktext@fsf/member/junktext] has joined ##java [06:14]
TESTED123 how come i need to generateSecret for a hash? [06:14]
surial whether that makes eclipse better or worse.. I guess that's an eye of the beholder thing. We could debate it, but, I doubt anybody gives a shit. Maybe IDEs should be able to build jars, but any serious project should definitely build its canonical jars with a build tool. At best, the IDE should have a shortcut to run said build tool inside the IDE, but definitely no further. [06:14]
surial TESTED123: because hash is a stupid fucking name here. [06:15]
surial TESTED123: make no mistake, this IS what it is called. 'password hashing'. But the term 'hash' has many meanings, and here it doesn't mean what you think it means. [06:15]
TESTED123 oh [06:15]
surial It would be better if this 'thing' (using PBKDF, bcrypt, scrypt, or any other cryptographic function to securely store passwords) wasn't called 'hashing'. [06:15]
surial TESTED123: let me run you through the basics. [06:15]
rburton- [rburton-!~rburton-@50-197-184-177-static.hfc.comcastbusiness.net] has joined ##java [06:16]
surial TESTED123: take SHA-1 which is a 'hash' function. The function describes the following operation: SHA1(input) -> output. The property is that the same input will always lead to the same output, it is very very fast, it is not all too feasible to derive input from output, and even a small change in input causes a large change in output. [06:16]
surial TESTED123: this sounds great for storing passwords but htere are MANY problems here. [06:16]
TESTED123 oh [06:16]
surial TESTED123: the obvious one is speed: 'hash' functions, for most jobs, should be fast. faster is better. [06:17]
surial For password storing, FASTER IS BAD. [06:17]
surial let's take the obvious security issue you're trying to solve with pass hashing. [06:18]
surial I steal your database. I have a complete copy of your db. It has a table with userids, usernames, and hashed up passwords. [06:18]
surial A $100 rig with customized hardware to run SHA256 can run a few billion SHA256s every second. [06:18]
surial Soo, great. I want to know the password user 1. I just.. fire up muh rig, throwing the entire dictionary at it and then some. If I can do billions of attempts a second, unless your password is exceedingly complicated, I'll find it. I can just start brute forcing. ANYTHING 8 characters or less I"ll ahve in an hour by trying it all. Any mix of dictionary words I can find in a day or less. [06:19]
TESTED123 those are the iterations i get it [06:19]
surial The solution is two-fold: 1. slow that shit way the fuck down, and 2. furthermore disallow sneakiness by reducing the hardware gap: The hash impl should not just be slow, it should be universally slow, regardless of custom hardware. bcrypt is very slow and reasonably but not perfectly defended against custom hardware. pbkdf and scrypt are very slow and slightly better at not running well on custom hardware. [06:20]
TESTED123 the more the iterations on the algorithm the slower it is to brute for ce right? [06:20]
whaley [whaley!~whaley@c-73-78-132-227.hsd1.co.comcast.net] has joined ##java [06:20]
surial We still do call these hash functions, they still do: HASH(input) -> output with all the properties as before, but whereas SHA-256 is supposed to be fast and is supposed to be designed scuh that custom hardware can be made for it.. these functions shoud be slow and should be designed such that custom hardware shold NOT be able to be made for it. [06:20]
surial TESTED123: it's not just iterations. [06:20]
surial TESTED123: the entire pbkdf algorithm (as well as scrypt, bcrypt, and all other pass hash functions) is explicitly designed to be fundamnetally slow. [06:21]
surial and yes the iterations count on these can make it even slower if you need that. SHA-256 doesn't have such a thing. [06:21]
admin123 [admin123!~nope@ool-3f8fc227.dyn.optonline.net] has joined ##java [06:21]
surial repeat application of SHA-256 (so, an algorithm of: Take the password. hash it with SHA-256. Then hash the hash. Do that 10 more times) is not 10x as slow as hashing once. [06:21]
surial the iteration counter on scrypt, bcrypt, pbkdf, etc IS designed to be slow in a way that you can't bypass. [06:22]
surial But that's only part of the picture. [06:22]
surial TESTED123: princess. dragon. iloveyou. abc123. letmein. [06:22]
surial these are extremely common passwords. [06:22]
surial Let's say I have a copy of your DB, and you do use PBKDF (the base crypto algorithm itself). [06:22]
surial I can only calculate, like, 1000 hashes a second. [06:23]
surial but, I can still calculate the hash of iloveyou in 1 millisecond. [06:23]
surial Let's say you are facebook. [06:23]
surial I guarantee you, there are 10,000 or more users on facebook whose password is iloveyou. [06:23]
TESTED123 oh [06:23]
TESTED123 ok [06:23]
surial let's say PBKDF(iloveyou) = 123456789. [06:23]
surial That means that your DB would contain 10k entries where 'passhash' contains 123456789... [06:23]
surial and I know that for those users their password is iloveyou. [06:23]
surial you can blame them for being a moron for choosing such a shite password... and some blame does befall them. But it'd be cool if it wasn't quite this easy. [06:24]
surial Enter: salting. [06:24]
surial instead of storing 123456789, a good password storage algorithm does something else. [06:24]
surial Anytime a user sets up a password, a good algo generates a random number, called the salt. It will then hash not 'the password', but the aslt + the password. So, let's say you create a new facebook account and want to use password 'iloveyou'. [06:24]
surial Bad password, but, hey. can't stop au ser from being an idiot I guess, right? [06:25]
surial So, I roll up a random number: 1960401. I then store: "user TESTED123, salt: 1960401, passhash: PBKDF(1960401iloveyou). [06:25]
ernimril surial, idiot is their default mode, they are using that service... :-) [06:25]
surial I can then verify you on login: you type in the password and your username, I look up in my db the salt and the result of hashing the concatenation of the salt and the password. I then take the salt, your entered password, concatenate them, PBKDF that, and check if it is the same as the passhash value in the DB. If yes, it's you. If not, it isn't. [06:26]
surial but now, all those 10k users with password 'iloveyou'? They all ahve different values for passhash, evne if they have the same password. [06:26]
surial without a salt, I can just make a table linking common passwords with their hash. This is called a rainbow table. [06:26]
surial salts stop rainbow table attacks. [06:26]
TESTED123 ok . what does the hashing function has to do with the secret key? [06:27]
surial So, a hash algo specially made for passwords stops custom hardware and brute force. salts stop rainbow tables. [06:27]
surial TESTED123: nothing. You don't need a secret key at all. [06:27]
surial but you do need a random number. [06:27]
surial your code is shit by hte way. [06:28]
surial here's a general, easy rule: [06:28]
surial do not. EVER. write e.printSTackTrace, ever. [06:28]
TESTED123 how do i generate a aes key from the password ? [06:28]
surial if you catch an exception, you have only 2 options: 1. handle it (and printing it, logging it, or ignoring it is NOT HANDLING IT), or 2. 'throw new RuntimeException(e)). [06:28]
freeone3000 (yay, someone using a key derivation function for the intended purpose!) [06:29]
surial If you don't know what to do, just make your method 'throws GeneralSecurityException' in this case for example. And if you can't do that, do the runtime thing. [06:29]
surial TESTED123: here if an error occurs (and I can easily MAKE an error occur by passing in null for password and the like), your code reutrns null, and if your hash comparator considers null to be equal to null, I can hack the system. [06:29]
surial hence, your cavalier attitude to handling exceptions (you're excused, 9 out of 10 newbies fuck this up as do most tutorials. Unfortunate that this anti-pattern is so damn prevalent!) means you have a security issue. [06:29]
surial TESTED123: aes keys are required to be precisely x bits long, and forcing the user to have a password of an exact length is a silly practice. So, you hash the password. [06:30]
surial something like pbkdf is fine for that. Lock in the salt. [06:30]
TESTED123 ok thanks mate :) [06:31]
TESTED123 for the detailed explanation [06:31]
TESTED123 ) [06:31]
TESTED123 gotta go thnaks once again [06:32]
conan [conan!~conan@mdproctor.plus.com] has joined ##java [06:51]
noahmg123 Is it standard practice to use a controller in JavaFX for methods that will be called for events such as onAction for a button? Or could I just do .setOnAction in my main? [06:51]
NorthwestVegan [NorthwestVegan!~Northwest@gateway/tor-sasl/northwestvegan] has joined ##java [06:56]
tasse [tasse!~tasse@55d4f06d.access.ecotel.net] has joined ##java [07:03]
mluser-home [mluser-home!~mluser-ho@ip68-0-67-199.tu.ok.cox.net] has joined ##java [07:08]
Velgor [Velgor!~Velgor@HSI-KBW-109-193-081-230.hsi7.kabel-badenwuerttemberg.de] has joined ##java [07:09]
Quick_Wango Hi! Is there a way to directly decode a string from a direct ByteBuffer without copying into a byte[] first? [07:11]
morenoh149 [morenoh149!~nope@ool-3f8fc227.dyn.optonline.net] has joined ##java [07:12]
TimeTrap [TimeTrap!~TimeTrap@2601:44:c500:65f4:4998:d81e:2a0e:baca] has joined ##java [07:17]
rruizt [rruizt!~rruizt@83-84-23-124.cable.dynamic.v4.ziggo.nl] has joined ##java [07:18]
whaley [whaley!~whaley@8.25.195.25] has joined ##java [07:19]
Addax Quick_Wango: not that I know of, but what's the problem with the byte[]? [07:26]
Quick_Wango Addax: feels like an unnecessary copy [07:26]
Addax is it really, though? [07:26]
Quick_Wango sure, it's very short lived, but still [07:27]
minimal_life [minimal_life!~minimal_l@2601:603:1500:1e9a:65fc:e924:c5e5:f7ba] has joined ##java [07:27]
Maldivia it is an unnecessary copy :D [07:27]
Quick_Wango direct memory -> java memory -> char[] [07:27]
Quick_Wango could be direct memory -> char[] [07:27]
Maldivia Quick_Wango: well, actually String today is also byte[] :D [07:28]
Quick_Wango it is? *checks the sources* [07:28]
Maldivia so it's direct -> byte[] -> byte[] [07:28]
Quick_Wango yep, the defensive copy stays [07:28]
Addax was digging in the API as well [07:29]
Maldivia Quick_Wango: there is an optimization now, since they found that most strings were in ascii range anyway, so having it as byte[] saved mem [07:29]
Quick_Wango makes sense [07:29]
Addax Quick_Wango: the lesson is, as usual, not to worry about it until you notice it in a profiler [07:29]
lord_EarlGray [lord_EarlGray!~lord_Earl@125-41.echostar.pl] has joined ##java [07:29]
Quick_Wango Addax: totally agree. just checking if there is something I missed [07:29]
Quick_Wango the service is already running for weeks [07:30]
Addax Well, if you didn't profile, yes :) [07:30]
Addax until you profile, it's all faptimization unless you actually KNOW what it's doing [07:30]
Quick_Wango it'll see a fair bit of hits, but I doubt it will be a problem given its very short lived [07:30]
Addax yep [07:30]
Addax JVM's really good at that sort of thing even if it does the worst-case sequence of operations [07:30]
Quick_Wango I thought about dropping direct memory and instead using a wrapped ByteBuffer, but never cared to profile it either [07:31]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [07:32]
Maldivia Quick_Wango: how do you have it saved in your ByteBuffer? [07:36]
Maldivia Quick_Wango: as ASCII, or? [07:36]
Maldivia Quick_Wango: StandardCharsets.UTF_8.decode(byteBuffer).toString(); <-- that would probably be the proper NIO way of converting a ByteBuffer to a String [07:41]
buttsanchez [buttsanchez!~buttsanch@pool-173-70-130-142.nwrknj.fios.verizon.net] has joined ##java [07:42]
Maldivia and then hope that things are correctly optimized [07:42]
Syzygy [Syzygy!~Syzygy@2a02:8388:381:da00:85b0:a7a0:49f0:a3da] has joined ##java [07:46]
Sleaker [Sleaker!~quassel@2604:880:a:7::e1b] has joined ##java [07:50]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [08:00]
brandonson [brandonson!~brandon@208.91.114.1] has joined ##java [08:02]
admin123 [admin123!~nope@ool-3f8fc227.dyn.optonline.net] has joined ##java [08:09]
themsay [themsay!~themsay@149.254.234.91] has joined ##java [08:11]
Sasazuka [Sasazuka!~Sasazuka@unaffiliated/sasazuka] has joined ##java [08:12]
nfd9001 [nfd9001!~nfd9001@c-67-183-33-240.hsd1.wa.comcast.net] has joined ##java [08:14]
SirNapkin1334 [SirNapkin1334!~SirNapkin@2601:648:8780:e0:7980:418a:a0f8:4450] has joined ##java [08:17]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [08:25]
orbyt_ [orbyt_!~orbyt@172.92.5.20] has joined ##java [08:26]
whaley [whaley!~whaley@8.25.195.25] has joined ##java [08:26]
yawkat [yawkat!~yawkat@cats.coffee] has joined ##java [08:27]
tassee [tassee!~tasse@55d4b27f.access.ecotel.net] has joined ##java [08:31]
themsay [themsay!~themsay@149.254.234.91] has joined ##java [08:35]
tassee [tassee!~tasse@55d4a1e4.access.ecotel.net] has joined ##java [08:38]
SebastianFlyte [SebastianFlyte!~sebf@pool-173-79-171-251.washdc.fios.verizon.net] has joined ##java [08:44]
bob14 [bob14!~bob14@162-197-52-45.lightspeed.livnmi.sbcglobal.net] has joined ##java [08:48]
tasse [tasse!~tasse@55d4ca60.access.ecotel.net] has joined ##java [08:48]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [08:49]
veegee [veegee!~veegee@ipagstaticip-3d3f7614-22f3-5b69-be13-7ab4b2c585d9.sdsl.bell.ca] has joined ##java [08:53]
tassee [tassee!~tasse@55d4b962.access.ecotel.net] has joined ##java [08:54]
dj_pi [dj_pi!~dj_pi@d4-50-214-166.col.wideopenwest.com] has joined ##java [08:55]
junktext [junktext!~junktext@fsf/member/junktext] has joined ##java [09:03]
themsay [themsay!~themsay@149.254.234.91] has joined ##java [09:12]
waz_ [waz_!~waz@pdpc/supporter/active/waz] has joined ##java [09:16]
RedSoxFan07 [RedSoxFan07!~Thunderbi@d-137-103-109-45.ct.cpe.atlanticbb.net] has joined ##java [09:20]
tasse [tasse!~tasse@55d4c7e5.access.ecotel.net] has joined ##java [09:22]
code_zombie [code_zombie!~code_zomb@2605:a601:aa1:da00:a00e:2261:41fb:5bb3] has joined ##java [09:26]
Addax freeone3000: you around? [09:32]
Buliarous [Buliarous!~gypsydang@unaffiliated/buliarous] has joined ##java [09:35]
tassee [tassee!~tasse@55d4d409.access.ecotel.net] has joined ##java [09:39]
g00s [g00s!~g00s@unaffiliated/g00s] has joined ##java [09:45]
arcsin_ [arcsin_!~alureon@unaffiliated/proxa] has joined ##java [09:47]
g00s so lets say i have a few english names, a few russian names, and a few greek names. I would like to sort them with their locale specific collators, of course, but the list should be english sorted | russian sorted | greek sorted. I'm not sure, iterating through the unsorted mixed list, how to associate a name with its locale specific collator. anyone have ideas ? [09:47]
g00s is there any way, given a character, to map it back to a locale? some chars would be available in multiple locates. [09:49]
g00s maybe i have to inspect each one ... [09:50]
Addax do you know which language the name is associated with at any point [09:50]
rruizt [rruizt!~rruizt@83-84-23-124.cable.dynamic.v4.ziggo.nl] has joined ##java [09:53]
led1 [led1!~Thunderbi@217.66.160.14] has joined ##java [09:55]
Goplat [Goplat!~Goplat@reactos/developer/Goplat] has joined ##java [09:59]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [10:03]
morenoh149 [morenoh149!~nope@ool-3f8fc227.dyn.optonline.net] has joined ##java [10:09]
tasse [tasse!~tasse@55d4acb9.access.ecotel.net] has joined ##java [10:15]
srisri [srisri!~srisri@204.14.239.17] has joined ##java [10:22]
g00s Addax no, unfortunately. [10:22]
g00s hmm http://icu-project.org/apiref/icu4jni/com/ibm/icu4jni/text/RuleBasedCollator.html [10:23]
Hanii [Hanii!~Hanii@2a00:23c5:c587:a800:1036:5fda:fcb7:d92] has joined ##java [10:23]
indistylo [indistylo!~aruns_@106.51.25.10] has joined ##java [10:26]
g00s i don't think that helps. oh well [10:26]
Hanii Where can I find a download link for the actual compiled version of Netbeans? [10:28]
Addax [Addax!~jottinger@unaffiliated/dreamreal] has joined ##java [10:29]
cheeser netbeans.org [10:29]
cheeser shockingly [10:29]
rruizt [rruizt!~rruizt@83-84-23-124.cable.dynamic.v4.ziggo.nl] has joined ##java [10:30]
Addax freeone3000: In case I forget: I need to find some decent resources on building an autocomplete that is better than brute force matching: i.e., "wh" should match "the who" as well as "what happened to baby jane". I'm not trying to implement it, just find good resources for it. I've found some, but I hoped you might know of others, or whether the ones I found were canonical enough [10:30]
Addax anyone else is welcome to chime in, too, but please /msg me or at least include my nick, because I'm about to take off for the evening [10:31]
Hanii netbeans.org now redirects to netbeans.apache.org, and the download page at netbeans.apache.org/download/nb110/nb110.html doesn't seem to link to a version I can just install and run [10:32]
Jigsy` [Jigsy`!~Jigsy@unaffiliated/jigsy] has joined ##java [10:32]
cheeser you should try #netbeans then and see what they think. [10:32]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [10:33]
surial Hanii: there's a binaries link right there! [10:34]
themsay [themsay!~themsay@149.254.234.91] has joined ##java [10:35]
surial Hanii: it's java. installing is a matter of unzipping it in a dir and that's all you have to do. [10:36]
g00s Addax there is a lib called fuzzywuzzy https://github.com/xdrop/fuzzywuzzy [10:37]
g00s g00s's title: "GitHub - xdrop/fuzzywuzzy: Java fuzzy string matching implementation of the well known Python's fuzzywuzzy algorithm. Fuzzy search for Java" [10:37]
Hanii I downloaded the the zip under the binaries link before I asked here, but I can't find the installer or program in the folder [10:38]
maryo [maryo!~Maryo@unaffiliated/maryo] has joined ##java [10:39]
cheeser tech support [10:39]
cheeser Hello, ##java is not a technical support channel for your Java apps or virtual machines; it's a development channel for enthusiasts to discuss programming with the Java language. Please ask the vendor of your software for support if you're having trouble with it. [10:39]
junktext [junktext!~junktext@fsf/member/junktext] has joined ##java [10:43]
whaley [whaley!~whaley@c-73-78-132-227.hsd1.co.comcast.net] has joined ##java [10:56]
dez [dez!uid92154@fedora/deSouza] has joined ##java [11:08]
tasse [tasse!~tasse@55d45a09.access.ecotel.net] has joined ##java [11:09]
Galactus [Galactus!~Galactus@unaffiliated/galactus] has joined ##java [11:11]
tasse [tasse!~tasse@55d4b818.access.ecotel.net] has joined ##java [11:18]
steven__ [steven__!~shicks252@ool-4354603e.dyn.optonline.net] has joined ##java [11:27]
indistylo [indistylo!~aruns_@106.51.25.10] has joined ##java [11:27]
forgottenone [forgottenone!~forgotten@176.88.96.93] has joined ##java [11:37]
alphazb [alphazb!~alphazb@unaffiliated/alphazb] has joined ##java [11:42]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [11:47]
javango [javango!~javango@188.244.142.69] has joined ##java [11:52]
dj_pi [dj_pi!~dj_pi@d4-50-214-166.col.wideopenwest.com] has joined ##java [11:56]