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

« 2019-03-16


2019-03-18 »

Nick Message Date
mike802 parted the channel: [12:03]
mike802 [mike802!~IceChat9@unaffiliated/mike802] has joined ##java [12:07]
rruizt [rruizt!] has joined ##java [12:20]
subnaught [subnaught!~cloud9@2600:380:a539:a1eb:54e4:5d6b:e79f:73f5] has joined ##java [12:23]
qrestlove [qrestlove!~qrestlove@2601:446:c201:f560:4166:2e20:21a6:3912] has joined ##java [12:31]
Secret-Fire [Secret-Fire!] has joined ##java [12:33]
dino82 [dino82!~deeno@unaffiliated/dino82] has joined ##java [12:51]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined ##java [01:01]
rippa [rippa!] has joined ##java [01:04]
bobek [bobek!~bobek@unaffiliated/bobek] has joined ##java [01:35]
rruizt [rruizt!] has joined ##java [01:35]
suvdev_ [suvdev_!67534584@gateway/web/freenode/ip.] has joined ##java [01:45]
suvdev_ Hi [01:45]
suvdev_ If we delete an element from an array will its size be resized? [01:46]
LtHummus no [01:46]
suvdev_ what about arraylist [01:46]
LtHummus yes [01:46]
LtHummus java.util.ArrayList is resizable [01:46]
suvdev_ mwah babes [01:46]
suvdev_ thanks [01:47]
sainathvd [sainathvd!~sainathvd@] has joined ##java [01:48]
progart [progart!~kamee@] has joined ##java [01:50]
progart parted the channel: [01:50]
Jenetrix [Jenetrix!Jen@2600:3c01::f03c:91ff:fe6c:d27a] has joined ##java [01:50]
Snoober [Snoober!~Snoober@2601:644:103:8400:cc94:5c45:9e93:b5d6] has joined ##java [01:56]
immibis you can't delete an element from an array [02:06]
immibis you can from an arraylist [02:06]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [02:32]
suvdev_ do we have any concept of circular loops? [02:39]
immibis never heard of them [02:40]
suvdev_ like auto increment from last element to first ? [02:40]
suvdev_ oh ok [02:40]
suvdev_ this seems like of linkedlist [02:40]
fizzie A circular buffer (which is what that sounds like) is most likely what's backing an ArrayDeque, although the interface to it doesn't make it that visible. [02:45]
suvdev_ buffer? [02:46]
fizzie [02:47]
fizzie You did say "from last element to first". [02:47]
tracks [tracks!~tracks2@2600:1700:ade0:4400:68d2:57d8:5d43:d32] has joined ##java [02:53]
suvdev_ fizzie wow thanks mate [02:54]
forgottenone [forgottenone!~forgotten@] has joined ##java [02:54]
Guest73 [Guest73!424262b6@gateway/web/cgi-irc/] has joined ##java [03:00]
Kristine86 Hi, will this take O(n^2) or O(n) time complexity? for (int i = m - 1; i >= 0; i--) { for (int j = 0; j <= i; j++) {...}} [03:00]
immibis that's n^2 [03:01]
Kristine86 I thought so. thnx [03:01]
Kristine86 I thought this did it in O(N) but no, [03:04]
AugustusCaesar24 [AugustusCaesar24!] has joined ##java [03:06]
immibis Kristine86: depends what you count as N [03:11]
immibis if n is m then it's O(n^2). if n is the number of things in the triangle, then it's O(n) [03:11]
Kristine86 say N is the height of that pyramid [03:11]
rruizt [rruizt!] has joined ##java [03:11]
AugustusCaesar24 [AugustusCaesar24!] has joined ##java [03:11]
immibis i think for that problem it would be sensible to say N is the number of numbers in the triangle [03:11]
Kristine86 yes, that totally make sense. However, I'm looking for algorithm that solves it in O(N), where N=height of the pyramid. [03:12]
Kristine86 I guess probably its not possible if we want exact answer [03:13]
immibis well there are O(n^2) numbers that your algorithm has to look at so that's impossible [03:13]
immibis unless there's a way to do it without looking at all the numbers, which I doubt [03:13]
Kristine86 I'm thinking if we can reduce error of the estimate max sum, if we want to do it in O(height) time [03:16]
immibis O(N) means you get to look at a certain number of values on each level. so maybe you just take the highest value at each step, but you aren't going to get the maximum path, just a maybe okay path [03:17]
erg0s1 [erg0s1!~erg0s1@] has joined ##java [03:17]
Kristine86 I wrote a simple greedy algorithm starting from the root, then trinkle down each step with highest child. But there is going to some error. [03:18]
Kristine86 I'm now thinking instead of starting from root, will it make any difference if I start from other location like at the half of the height. Then move both direction (up and down) [03:19]
immibis well you only get to look at a certain number of items at each level [03:27]
immibis so idk [03:28]
progart [progart!~kamee@] has joined ##java [03:28]
Fossfile [Fossfile!] has joined ##java [03:32]
Kristine86 I know but I'm trying to reduce the possibility of error. Maybe taking max number from 3/4 height and using it as seed would decrease the error [03:32]
Kristine86 Given that it's harder for path to traverse at bottom. [03:33]
Kristine86 *traverse wider [03:33]
esro [esro!] has joined ##java [03:36]
Tobbi [Tobbi!~Tobbi@supertux/tobbi] has joined ##java [03:37]
gemini2019 Kristine86: Don't you sleep? [03:39]
Kristine86 haha you figured out where I'm from? [03:39]
gemini2019 Kristine86: I've known ;) [03:39]
Kristine86 when I'm stuck in problem I don't feel like sleeping :P [03:40]
AugustusCaesar24 i know the feeling [03:40]
gemini2019 Kristine86: Your problem now is not sleepning. [03:40]
AugustusCaesar24 hey im reading from 4 files and adding the contents of those 4 files to an arraylist. the way im currently doing it has a bunch of duplicate code. is there any better way of doing it that doesnt require duplicate code? [03:41]
AugustusCaesar24 heres what im looking at [03:41]
AugustusCaesar24 [03:41]
immibis Kristine86: given any algorithm I can make a tree that makes your algorithm do as poorly as possible [03:42]
immibis a triangle* [03:42]
gemini2019 AugustusCaesar24: Declare the instance variable fileData as a List<String> [03:43]
gemini2019 AugustusCaesar24: write a method that takes a file (and optionally fileData). [03:44]
gemini2019 Invoke that method 4 times, one for each of your files. [03:44]
AugustusCaesar24 well thats just genius [03:45]
AugustusCaesar24 brilliant. ill do that now [03:45]
Tobbi parted the channel: "Leaving" [03:48]
rruizt [rruizt!] has joined ##java [03:54]
sameerynho [sameerynho!~lxsameer@unaffiliated/lxsameer] has joined ##java [03:54]
timkofu [timkofu!~timkofu@] has joined ##java [03:55]
vdamewood [vdamewood!~vdamewood@unaffiliated/vdamewood] has joined ##java [04:11]
suvdev_ in arraylist if i delete element at index 1 then the elements at index 2 will now be at 1 right? [04:18]
suvdev_ in arraylist if i delete element at index 1 then the elements at index 2 will now be at 1 right? [04:19]
immibis yes [04:20]
ravenousmoose [ravenousmoose!] has joined ##java [04:43]
learningc [learningc!~learningc@] has joined ##java [04:48]
acidjnk [acidjnk!] has joined ##java [04:48]
Comstock [Comstock!Comstock@gateway/vpn/privateinternetaccess/comstock] has joined ##java [04:52]
palasso [palasso!~palasso@unaffiliated/palasso] has joined ##java [04:53]
gelignite [gelignite!] has joined ##java [04:54]
Kol [Kol!] has joined ##java [04:56]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [04:58]
magz_ [magz_!] has joined ##java [05:02]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [05:22]
rohdef [rohdef!] has joined ##java [05:23]
rruizt [rruizt!] has joined ##java [05:41]
Brilpikk3wyn [Brilpikk3wyn!~Segfault0@unaffiliated/segfault0x40] has joined ##java [05:46]
runlevel7 [runlevel7!~runlevel7@unaffiliated/runlevel7] has joined ##java [05:47]
kashike is there a jdk alternative to guava's AbstractExecutionThreadService? [05:48]
yawkat no [05:49]
kashike bleh [05:49]
fnoyanisi [fnoyanisi!~fnoyanisi@unaffiliated/fnoyanisi] has joined ##java [05:53]
dendazen [dendazen!] has joined ##java [05:57]
DTZUZO [DTZUZO!] has joined ##java [06:01]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [06:14]
immibis if there was it probably wouldn't be in guava [06:20]
nickel8448 [nickel8448!~rahul@] has joined ##java [06:25]
fnoyanisi I have some piece of code (that works on the static variables) in a static method [06:25]
fnoyanisi can I not do the same thing in the constructor rather than using a static method? [06:25]
ernimril fnoyanisi, your question is not clear. [06:31]
ernimril static [06:31]
ernimril fnoyanisi, static is a keyword which indicates that a member is scoped to a class rather than an object instance. Members of interfaces (except abstract and default methods) are always static. Nested interfaces and enums are always static. See and for more information. [06:31]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [06:31]
wolfeius [wolfeius!~user@] has joined ##java [06:34]
mbooth fnoyanisi: You probably want a static initialiser block [06:36]
discmuc [discmuc!] has joined ##java [06:36]
fnoyanisi ernimril , booth : thanks! [06:36]
wolfeius silly question, I am a bit confused about open-jdk and oracle-jdk. What I read seems to suggest that they are the same thing? [06:45]
skuuter [skuuter!] has joined ##java [06:46]
mike802 parted the channel: [06:47]
ivegotasthma oracle-jdk is a symlink to open-jdk :p [06:48]
wolfeius hah, yeah. But there are some things... like javaFX, which oracle has built in, and i don't have to mess with either make or gluon's build [06:49]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [06:53]
sakhd [sakhd!~sakhd@] has joined ##java [06:56]
led_dark_1 [led_dark_1!~Thunderbi@] has joined ##java [07:03]
waz [waz!~waz@pdpc/supporter/active/waz] has joined ##java [07:06]
sunri5e [sunri5e!~sunri5e@unaffiliated/sunri5e] has joined ##java [07:09]
ravenousmoose [ravenousmoose!] has joined ##java [07:11]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0::b0a] has joined ##java [07:14]
Gurkenglas [Gurkenglas!~Gurkengla@unaffiliated/gurkenglas] has joined ##java [07:25]
jamiemagee [jamiemagee!] has joined ##java [07:37]
ravenousmoose [ravenousmoose!] has joined ##java [07:43]
runlevel7_ [runlevel7_!~runlevel7@unaffiliated/runlevel7] has joined ##java [07:43]
Regon [Regon!~Regon@unaffiliated/regon] has joined ##java [07:46]
Witoszczak [Witoszczak!] has joined ##java [07:51]
Luiz_Navarro [Luiz_Navarro!~Luiz_Nava@] has joined ##java [07:55]
bukaboi [bukaboi!~bukaboi@] has joined ##java [07:58]
nickel8448 [nickel8448!~rahul@] has joined ##java [07:59]
Maxdamantus [Maxdamantus!~Maxdamant@unaffiliated/maxdamantus] has joined ##java [07:59]
wolfeius [wolfeius!~user@] has joined ##java [08:08]
rruizt [rruizt!] has joined ##java [08:16]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [08:24]
q9929t [q9929t!~Thunderbi@] has joined ##java [08:43]
SerialSmile [SerialSmile!~SerialSmi@] has joined ##java [08:43]
Katana [Katana!~hentai@unaffiliated/katana] has joined ##java [08:46]
gareppa [gareppa!~gareppa@unaffiliated/gareppa] has joined ##java [09:01]
Avaray [Avaray!] has joined ##java [09:03]
nickel8448 [nickel8448!~rahul@] has joined ##java [09:05]
dudek [dudek!~dudek@] has joined ##java [09:06]
kappa1 [kappa1!~kappa1@unaffiliated/kappa1] has joined ##java [09:11]
kappa1 what's the best way to implement a bitmap in java? [09:11]
togo [togo!~togo@2a01:5c0:e083:1d11:90c2:f140:a541:3daf] has joined ##java [09:11]
Addax a bitmap? [09:17]
Addax You mean, like, raphics? [09:17]
Addax graphics? (Sorry, something's stuck in my keyboard somewhere) [09:17]
VVD [VVD!~VVD@] has joined ##java [09:18]
kappa1 Addax, I mean just an array of bits or similar, and then using some hash function that maps unique strings to specific bits [09:21]
Addax kappa1: I'd need to see an example. This sounds like a simple Map. [09:21]
ernimril javadoc BitSet [09:22]
ernimril kappa1, ernimril: [JDK: java.util.BitSet] [09:22]
kappa1 [09:22]
Addax so bitset would be it, really [09:22]
kappa1 nice :-) [09:23]
Addax you want an individually-addressable bit in java, bitset is your friend; write a mapping function to go from your "unique string" to the specific bit [09:23]
Addax I wasn't sure what you meant, was trying to understand what the strings had to do with it [09:23]
kappa1 Addax, any hints on how to write such a function? [09:23]
Addax points to hashCode() as an easy start [09:23]
Addax note that hashcodes are not guaranteed unique for strings [09:24]
kappa1 each string will have a unique hash collision-free? [09:24]
Addax no [09:24]
kappa1 yes that's the issue [09:24]
Addax it'd be a start, not a guarantee [09:24]
Addax shrugs. Depends on what your input looks like. [09:24]
Addax try hashcode and see if you get collisions; if you do, well, dig further. [09:24]
kappa1 but I know the total number of unique strings that I can have [09:24]
Addax Why do you have strings as indexes and not integers or whatever? [09:24]
Addax then why not enumset? [09:25]
kappa1 Addax, because the ids of product are strings [09:25]
Addax if you know how many unique strings you have, write a quick test and see if there are collisions. If the strings look similar, collisions should be fairly rare if they exist at all. [09:25]
kappa1 and using an hash set consumes a lot of memory [09:25]
Addax does it? [09:25]
Addax How many products are there? [09:26]
kappa1 millions [09:26]
kappa1 and the strings are a bit big [09:26]
Addax I assume they live in a database, then [09:26]
Addax what is this bitset supposed to represent? [09:26]
kappa1 basically I want to implement something like it is described here: [09:26]
kappa1 kappa1's title: "Big Data Counting: How to count a billion distinct objects using only 1.5KB of Memory - High Scalability -" [09:26]
kappa1 it's just a more efficient (memory wise) way of keeping track of the ids that I already saw [09:27]
Addax well, if you have millions of entities, keeping track of "seen-ness" is going to take millions of bits, plus surrounding datastructure [09:28]
kappa1 "The basic idea with a bitmap is mapping the input dataset to a bit field using a hash function where each input element uniquely maps to one of the bits in the field. This produces zero collisions, and reduces the space required to count each unique element to 1 bit." [09:28]
kappa1 Addax, I know, but it is still better than hashset of strings [09:28]
Addax yes, I'm aware [09:28]
Addax kappa1: why wouldn't you let the database do it for you? [09:29]
NorthwestVegan [NorthwestVegan!~Northwest@gateway/tor-sasl/northwestvegan] has joined ##java [09:29]
kappa1 I need to figure out a way of implementing such a hash function [09:29]
kappa1 I am not using a DB, that was just an example [09:29]
Addax so where do these millions of keys come from? [09:30]
kappa1 from a socket stream [09:31]
Addax ouch [09:31]
kappa1 I am reading a stream of data from a socket server [09:31]
Addax yes, I gathered [09:32]
deavmi [deavmi!~deavmi@] has joined ##java [09:37]
bobek [bobek!~bobek@unaffiliated/bobek] has joined ##java [09:43]
rockyraccoonn [rockyraccoonn!] has joined ##java [09:57]
ogradyd [ogradyd!~Thunderbi@2a02:8070:88bf:9df0::b0a] has joined ##java [10:01]
Essadon [Essadon!] has joined ##java [10:08]
esro [esro!] has joined ##java [10:17]
esro [esro!] has joined ##java [10:19]
conan [conan!~conan@] has joined ##java [10:29]
DrowningElysium [DrowningElysium!uid190788@gateway/web/] has joined ##java [10:35]
Foxfir3 [Foxfir3!~Foxfir3@] has joined ##java [10:46]
ageis [ageis!~kevin@] has joined ##java [10:48]
togo [togo!~togo@2a01:5c0:e083:1d11:90c2:f140:a541:3daf] has joined ##java [10:59]
rruizt [rruizt!] has joined ##java [11:02]
dendazen [dendazen!] has joined ##java [11:06]
peaceguy [peaceguy!~yu68@unaffiliated/peaceguy] has joined ##java [11:06]
Harlin [Harlin!] has joined ##java [11:13]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [11:17]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [11:24]
javabot [javabot!~javabot@unaffiliated/javabot] has joined ##java [11:27]
Slartibart [Slartibart!] has joined ##java [11:31]
xeno [xeno!~xeno@unaffiliated/xeno] has joined ##java [11:35]
mr_lou [mr_lou!] has joined ##java [11:37]
ravenousmoose [ravenousmoose!] has joined ##java [11:40]
magz [magz!] has joined ##java [11:44]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [11:54]
orbyt_ [orbyt_!~orbyt@] has joined ##java [11:56]
Addax [12:02]
Addax Addax's title: "Notes to Myself on Software Engineering Featured Stories Medium" [12:02]
Crash1hd [Crash1hd!~Crash1hd@unaffiliated/crash1hd] has joined ##java [12:07]
xeno Addax: good list - missing the main one though: code is not an asset but a cost - functionality is an asset... [12:12]
Addax good point, you should add a comment [12:12]
xeno hmm... strike the last part [12:12]
xeno comment... on the web... that has a very high threshold for me... [12:13]
Addax shrugs [12:14]
Pieter12345 [Pieter12345!~Pieter123@] has joined ##java [12:15]
faceface [faceface!~dmb@unaffiliated/faceface] has joined ##java [12:18]
RedSoxFan07 [RedSoxFan07!~Thunderbi@] has joined ##java [12:18]
faceface hello, how to get the sort order of an array (not the sorted array) [12:18]
faceface i.e. for [3, 4, 1 , 9], to return [2, 0, 1, 3] [12:18]
faceface google is failing me... [12:19]
faceface Arrays.sort(arr) ... is there a similar java.util.Arrays? [12:19]
sonOfRa Do you need the whole *order* or do you just want the indices for one of the entries? [12:20]
faceface I need to go through the array and process the elements in order, but actually this is a pair of arrays of the same length, sorted by the first. [12:21]
faceface That is why I can't just sort the first array [12:21]
Addax faceface: well, how would you do it if you had to use pen and paper to do it [12:23]
Addax and what happens if you have to sort an array [3,3,3,1,5,2] [12:24]
faceface I dont' mind ties... [12:24]
Addax well, what's the expected output [12:24]
faceface I'd never sort an array with pen and paper ;-) [12:24]
Addax okay, never mind [12:25]
faceface [3,5,0,1,2,4] # but the 0,1,2 can bejumbled [12:25]
faceface ;-P [12:25]
Addax shrugs. It's all good, if you aren't willing to work out a process, why should I bother doing the same [12:26]
faceface I'm familiar with this paradigm in R where you can sort a vector or get it's order as a second vector of indexes [12:26]
faceface because I'm assuming there is a function for this, I dont' want to write my own [12:26]
Addax there is not, java isn't R [12:26]
faceface but yeah, I should just use R [12:26]
faceface java != R ?! #mindBlown [12:27]
faceface ;-) [12:27]
faceface thanks though [12:27]
wodencafe [wodencafe!] has joined ##java [12:29]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [12:36]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [12:46]
Snoober [Snoober!~Snoober@2601:644:103:8400:d45a:4742:65b6:2aa4] has joined ##java [12:51]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [12:51]
esro [esro!] has joined ##java [12:57]
orbyt_ [orbyt_!~orbyt@] has joined ##java [01:00]
pd09041999 [pd09041999!~pd0904199@] has joined ##java [01:02]
Snoober [Snoober!~Snoober@2601:644:103:8400:cd0d:8230:f9ab:24b3] has joined ##java [01:05]
fmccann [fmccann!] has joined ##java [01:09]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [01:10]
forgottenone [forgottenone!~forgotten@] has joined ##java [01:10]
pualj [pualj!~tux@] has joined ##java [01:10]
Fossfile [Fossfile!] has joined ##java [01:13]
Fossfile what is usually the purpose of having a try without a catch? I mean, if you don't catch anything why have the try at all, or is it like an empty catch? [01:16]
Fossfile like in the examples here: [01:16]
yawkat for the finally, or for try-with-resources [01:17]
karab44 [karab44!~karab44@unaffiliated/karab44] has joined ##java [01:17]
Fossfile if it were for the finally, wouldn't it be the same like without the try+finally entirely? [01:18]
Nightwing52 [Nightwing52!] has joined ##java [01:18]
royal_screwup21 [royal_screwup21!89de72f9@gateway/web/cgi-irc/] has joined ##java [01:18]
Snoober [Snoober!~Snoober@2601:644:103:8400:cd0d:8230:f9ab:24b3] has joined ##java [01:19]
Addax no [01:19]
cheeser try-with-resources [01:19]
cheeser cheeser, try-with-resources is a way of using resources without having to remember to close them - [01:19]
Fossfile Ah! thanks guys [01:20]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [01:24]
progart parted the channel: [01:24]
Imaginatrix [Imaginatrix!~imaginatr@unaffiliated/imaginatrix] has joined ##java [01:27]
t2mkn [t2mkn!~t2mkn@] has joined ##java [01:30]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [01:32]
grumble [grumble!~grumble@freenode/staff/grumble] has joined ##java [01:32]
beStKodErEveR [beStKodErEveR!] has joined ##java [01:34]
dez [dez!uid92154@fedora/deSouza] has joined ##java [01:34]
bear` parted the channel: "Textual IRC Client:" [01:43]
commanderkeen [commanderkeen!] has joined ##java [01:44]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [01:46]
somazero [somazero!~somazero@2600:8805:100:1a::11a6] has joined ##java [01:48]
commanderkeen [commanderkeen!] has joined ##java [01:51]
rockyraccoonn god Java's having to use .equals instead of == for strings is a nightmare coming from swift. Always forgetting [01:56]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [01:57]
Addax shrugs and points at kotlin [01:57]
rockyraccoonn does kotlin use ==? [01:58]
Addax yes, but so does java [01:58]
Addax but kotlin also uses String == to call "equals()" [01:58]
rockyraccoonn so when can kotlin replace java completely? [01:58]
Addax never [01:59]
yawkat hands rockyraccoonn an ide [02:00]
jackweb [jackweb!jackweb@gateway/shell/] has joined ##java [02:01]
Addax Every so often I think, "You know, me, programmers are total idiots!" and then I realize who's telling me that, and that guy's a moron [02:06]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [02:08]
wodencafe [wodencafe!] has joined ##java [02:17]
gelignite [gelignite!] has joined ##java [02:26]
rruizt [rruizt!] has joined ##java [02:30]
AndreYuhai Hello there, I've just copied classes in a project into another project. The code in the link works fine for the original project but throws "cannot infer type arguments for PriorityQueue()<>" error in the other project. Why could that be? [02:32]
Zee- [Zee-!] has joined ##java [02:36]
Viata [Viata!~Viata@2804:7f1:e106:fc74:817c:7ea9:f4e4:4319] has joined ##java [02:36]
fizzie Maybe there's a language level setting somewhere in the projects, and one is lower than the other? The list of things where type inference is legal expanded somewhere around Java 7. [02:37]
AndreYuhai fizzie: I guess that is the issue but my project should be using Java 8 because in project structure it is set to 8 and also maven is set to 1.8. But I still can't understand why this is not working [02:52]
sonOfRa AndreYuhai: show us the full file, so we can actually make sense of the line numbers and the context [02:52]
sonOfRa Error messages include line numbers, and line numbers as well as context are important [02:52]
AndreYuhai sonOfRa: Sure just a sec [02:52]
AndreYuhai sonOfRa: Here it is : [02:53]
AndreYuhai Actually if I pass PriorityQueue(int initialCapacity, Comparator comparator) then it works. Because this is in SE 7 but passing just comparator does not work even though I changed it to 8 in Project structure and also in pom.xml, I am using IntelliJ [02:55]
Katana [Katana!~hentai@unaffiliated/katana] has joined ##java [02:57]
Addax then you're doing something funky [02:58]
Pieter12345 Hello there, I'm trying to detect when a physical computer display is connected or disconnected in java using JNA. The problem is that I cannot figure out how to listen to system events. Does anyone here have experience with that or have an alternative solution? I prefer an event over polling. [02:58]
AndreYuhai Addax: I just copied the content of the pom.xml from original project to the copy one. And then run it. It worked. Then I undo the changes in pom.xml just like when it was throwing errors [02:59]
AndreYuhai Now it is working fine. I don't get it. Do we need to do anything after changing versions in pom.xml or in project structure? [03:00]
t2mkn [t2mkn!~t2mkn@] has joined ##java [03:00]
deavmi [deavmi!~deavmi@] has joined ##java [03:01]
Addax no, but you need to make sure the compiler version is set properly [03:01]
ElementKZ [ElementKZ!~ElementKZ@] has joined ##java [03:02]
ElementKZ parted the channel: "Leaving" [03:03]
faceface is there a java bot? I'm confused by something I think should work [03:03]
AndreYuhai I actually didn't change anything just copied pom.xml from the original project and then undid it. Then it started working. [03:03]
Addax faceface: errr... what do you mean by "a java bot?" javabot is on the channel right now, and it's... a bot [03:04]
faceface Does it compile and run java? [03:05]
Addax AndreYuhai: that sounds like idea sync worked after you changed it [03:05]
Addax faceface: no [03:05]
Addax faceface: see [03:05]
faceface ta [03:05]
Addax also see jshell [03:05]
Addax theoretically we could put a secure interface on javabot but... eh, why [03:05]
faceface Hmm... it works here. Wasn't working in a different environment. [03:06]
faceface Ah well. [03:06]
Gazooo [Gazooo!~Gazooo@] has joined ##java [03:07]
Addax what different environment is that? [03:07]
faceface Addax: was trying something in and getting an error [03:07]
faceface faceface's title: "Tech Recruiting Platform, Online Code Testing | Codility" [03:07]
faceface # The != here works fine [03:08]
Addax err... what datatypes were in the expression [03:08]
faceface I /think/ they were both int, but that's probably where the probem was [03:08]
Addax there are no primitives for which != acts inconsistently in java, ever, unless your JVM is broken and not a JVM [03:08]
faceface I had "int x = -1' and later 'value = A[i][j]'. When I used "x != value" it was complaining [03:09]
faceface but the 'value' should have been an int... (Perhaps it was an Integer) [03:10]
Addax even so [03:10]
faceface The challenge totally stumped me... Similar to map coloring, so I needed to use backtracking I think... [03:10]
faceface ah well. [03:10]
faceface Perhaps a typo [03:11]
faceface I can't see the code now because the challenge is over [03:11]
faceface thanks again [03:12]
eegad [eegad!eeden@gateway/shell/elitebnc/x-fwxbnapxyzzmpkar] has joined ##java [03:12]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [03:13]
Luiz_Navarro [Luiz_Navarro!~Luiz_Nava@] has joined ##java [03:16]
t2mkn [t2mkn!~t2mkn@] has joined ##java [03:18]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [03:24]
darkSeid [darkSeid!~textual@2a02:c7d:281c:e200:3d12:a6a6:4ef5:2e4b] has joined ##java [03:32]
Nightwing52 [Nightwing52!] has joined ##java [03:36]
orbyt_ [orbyt_!~orbyt@] has joined ##java [03:48]
Kristure [Kristure!~bob@] has joined ##java [03:52]
Pieter12345 Hello there, I'm trying to detect when a physical computer display is connected or disconnected in java using JNA. The problem is that I cannot figure out how to listen to system events. Does anyone here have experience with that or have an alternative solution? I prefer an event over polling. [03:54]
Maldivia that sounds like something that is very OS specific [03:56]
immibis [immibis!] has joined ##java [03:57]
Pieter12345 I'm running Windows 7 and my goal is to listen to the event. [03:58]
Pieter12345 Pieter12345's title: "SystemEvents.DisplaySettingsChanging Event (Microsoft.Win32) | Microsoft Docs" [03:58]
Maldivia for a pure Java way, poll GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() -- if array size/content changes, bingo [03:59]
Pieter12345 That's a nice pure-java polling method, but ideally I'd like to be able to inject a handler just before Windows starts to move applications and desktop icons around. [04:00]
Maldivia and what you linked is .net framework... that would be very hard to call from java [04:00]
forgottenone [forgottenone!~forgotten@] has joined ##java [04:01]
Pieter12345 The goal of the application is to detect a display disconnect, store the position of all windows, detect a display reconnect and restore the position of all windows. [04:01]
Pieter12345 I'm using JNA to access native code, I've already finished with the window position store and restore code. [04:02]
Maldivia well, you can also do it via javafc [04:02]
Maldivia Screen.getScreens() [04:02]
Maldivia that's an observable list, so attach your listener, profit [04:03]
Pieter12345 javafx or javafc? [04:03]
Maldivia javafx* [04:03]
Foxfir3 [Foxfir3!] has joined ##java [04:03]
Maldivia typo :) [04:03]
Pieter12345 Oh nice, I'll check when that event fires :) [04:03]
borkr [borkr!] has joined ##java [04:09]
Pieter12345 Maldivia: Screen.getScreens() has to be executed on the ¨event thread¨. I've tried the AWT-EventQueue-0 thread, but that doesn't seem to be it. Is there any simple way to schedule a task on the right event thread? [04:11]
Maldivia Platform.runLater [04:12]
katiex7 [katiex7!] has joined ##java [04:14]
Pieter12345 That's giving a java.lang.IllegalStateException: Toolkit not initialized now. [04:15]
Maldivia well, you need to have a javafx Application to use javafx, as far as I remember [04:16]
ravenousmoose [ravenousmoose!] has joined ##java [04:18]
Pieter12345 Hmh, ¨com.sun.javafx.application.PlatformImpl.startup(()->{});¨ did the trick. [04:20]
Maldivia wouldn't it have been easier to just have created an Application class and called Application.main [04:21]
Pieter12345 Since I'll just be using JavaFX to add one listener to something, it feels odd to convert the entire application just for that. [04:23]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [04:27]
Kol [Kol!] has joined ##java [04:28]
Maldivia did say that, just to create a proper Application class to get things started, instead of using an internal API class you can't rely on [04:28]
Maldivia didn't* [04:29]
fstd_ [fstd_!~fstd@unaffiliated/fisted] has joined ##java [04:29]
yawkat [yawkat!] has joined ##java [04:30]
treyG [treyG!~irc@] has joined ##java [04:39]
RedSoxFan07 [RedSoxFan07!~Thunderbi@] has joined ##java [04:40]
TimeTrap [TimeTrap!~TimeTrap@2601:44:c500:65f4:59f7:3272:430a:4212] has joined ##java [04:43]
treyG [treyG!~irc@] has joined ##java [04:45]
plitter Is there a list of java environmental variables with a description for what it is used for? [04:45]
plitter Or maybe a man page that I should? [04:46]
Pieter12345 plitter: can probably help you out [04:46]
Pieter12345 Pieter12345's title: "System Properties (The Java Tutorials > Essential Classes > The Platform Environment)" [04:46]
plitter Pieter12345: thanks :) [04:47]
themsay [themsay!~themsay@] has joined ##java [04:48]
yawkat thats not env variables though [04:50]
plitter Pieter12345: I was hoping for more of a JAVA_HOME and JAVA_TOOL_OPTIONS explanations [04:50]
yawkat those are not standard options [04:50]
plitter so it is more of a oracle/openjdk issue? [04:51]
plitter and not java? [04:51]
yawkat no, it is an application issue [04:51]
darkSeid [darkSeid!~textual@2a02:c7d:281c:e200:3d12:a6a6:4ef5:2e4b] has joined ##java [04:51]
plitter But some variables are given to the application on runtime though [04:52]
plitter Like JAVA_TOOL_OPTIONS [04:52]
plitter A guy at work added to it to fake different users [04:52]
treyG [treyG!~irc@] has joined ##java [04:53]
Pieter12345 Giving -D<property>=<value> sets a system property which the URL I sent is about. [04:53]
plitter yes, but my issue has been that we build our software ith maven and then run the application through shell files. So the shell files is overridden each time we build and me, having a nonstandard username have to add the each time... [04:56]
treyG [treyG!~irc@] has joined ##java [04:57]
darkSeid parted the channel: "Textual IRC Client:" [04:57]
plitter I saw that there was something like JAVA_OPTS, but that didn't work, and JAVA_HOME isn't what I want, but JAVA_TOOL_OPTIONS seems to be working for a guy at work [04:57]
Pieter12345 If you want to always override some system property, you can use System.setProperty() at the start of your application. [04:58]
plitter It is a company program and I don't want to put my test code in there like that :) [04:58]
plitter It would be better if I could get a better picture of what env variables are available so I can find what I should use [05:00]
Pieter12345 Passing ¨"bla"¨ yields the same result as calling System.setProperty("", "bla") at any point in your application before you use the value. [05:00]
Pieter12345 For your system specifically, you could print all System.getProperties() keys and look them all up. I don't know if there is a list of defaults. [05:01]
plitter Pieter12345: yes, but since the shell file is always overwritten when I build I have to enter the shell file to add that property [05:01]
Pieter12345 Or leave the shell file and add it to the application if it should always be overridden. [05:02]
plitter I don't want to add that to the code since it is a company program.. [05:04]
Pieter12345 So you're looking for a way to make the JVM pass a different to the application by default? [05:06]
mike802 [mike802!~IceChat9@unaffiliated/mike802] has joined ##java [05:07]
plitter yes [05:07]
plitter and in the process maybe learn if there are other variables :) [05:08]
Pieter12345 If maven overwrites your shell file every time, it means that you could add the option to the shell file through maven as well. [05:09]
yawkat java generally doesnt use env variables [05:10]
yawkat with a few exceptions [05:10]
yawkat but either way it's not the right way to set system properties [05:10]
plitter Pieter12345: I guess, but the pom files are under source control [05:10]
plitter yawkat: what would be the right way? [05:11]
yawkat making the shell files support an env variable [05:11]
Pieter12345 You basically want to add a way to execute your application without having that in the generated application or shell file to start it. [05:11]
Pieter12345 Perhaps just start it using your own shell file. If it is auto-started, write some shell script that replaces the auto-generated shell file [05:13]
plitter yawkat: since the shell files are overwritten I guess that means to go for Pieter12345's suggestion [05:15]
plitter yawkat: before I go and test things, what are the few exceptions that you mentioned? [05:16]
Zee- [Zee-!] has joined ##java [05:16]
yawkat _CLASSPATH, JAVA_TOOL_OPTIONS, but it depends on the actual java command being run [05:16]
plitter actual java command? [05:16]
Pieter12345 ¨java -jar <....>¨ [05:17]
plitter java <...> and javac <...>? [05:17]
Pieter12345 javac is the compiler, unless your application compiles java sources that shouldn't be called to start the app [05:18]
Pieter12345 java or javaw (without console window) executes your .jar application. [05:19]
plitter true enough, I was thinking back on what he said about application issue. [05:19]
ztychr [ztychr!~ztychr@unaffiliated/ztychr] has joined ##java [05:20]
plitter the application not being the compiled code, but the way it is run [05:20]
zmoo [zmoo!~zmoo@2605:ad80:40:280:b14a:da55:c86c:2a61] has joined ##java [05:22]
Kristure [Kristure!~bob@] has joined ##java [05:22]
zmoo hello java chanel [05:23]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [05:23]
zmoo Question I have a Java Class CPanel extends JPanel implements ActionListener [05:23]
zmoo Im having trouble doing a removeAll(); revalidate(); repaint() [05:24]
zmoo the remove all dosent seem to work? [05:24]
zmoo and the other equally ineffective [05:24]
Pieter12345 Maldivia: The Screen.getScreens() change listener sadly fires after Windows moves all applications to other displays. It's still better than polling though, so thanks for the proposal :) [05:30]
Snoober [Snoober!~Snoober@2601:644:103:8400:cd0d:8230:f9ab:24b3] has joined ##java [05:36]
junktext [junktext!~junktext@fsf/member/junktext] has joined ##java [05:39]
conan [conan!] has joined ##java [05:48]
sa02irc [sa02irc!] has joined ##java [05:50]
junktext_ [junktext_!junktext@fsf/member/junktext] has joined ##java [05:53]
plarsen [plarsen!~plarsen@redhat/jboss/pdpc.professional.plarsen] has joined ##java [05:54]
junktext__ [junktext__!junktext@fsf/member/junktext] has joined ##java [05:58]
moltencore [moltencore!~moltencor@] has joined ##java [06:09]
dendazen [dendazen!] has joined ##java [06:09]
Zee- [Zee-!] has joined ##java [06:20]
ravenousmoose [ravenousmoose!] has joined ##java [06:23]
Zee- [Zee-!] has joined ##java [06:29]
orbyt_ [orbyt_!~orbyt@] has joined ##java [06:38]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [06:44]
megaTherion [megaTherion!] has joined ##java [06:49]
Anticom [Anticom!] has joined ##java [07:01]
Kristure1 [Kristure1!~bob@] has joined ##java [07:01]
indistylo [indistylo!~aruns_@2406:7400:58:adba:2c03:1063:5f49:adfa] has joined ##java [07:04]
Nicmavr [Nicmavr!~Nicmavr@unaffiliated/nicmavr] has joined ##java [07:04]
wolfeius [wolfeius!] has joined ##java [07:09]
dsond [dsond!] has joined ##java [07:20]
Me4502 [Me4502!~Me4502@unaffiliated/me4502] has joined ##java [07:38]
iam730 [iam730!~iam730@] has joined ##java [07:40]
wbrawner [wbrawner!~wbrawner@] has joined ##java [07:40]
troydm [troydm!~troydm@unaffiliated/troydm] has joined ##java [07:47]
orbyt_ [orbyt_!~orbyt@] has joined ##java [07:51]
Matthijs [Matthijs!~quassel@unaffiliated/matthijs] has joined ##java [08:17]
happymeal` [happymeal`!] has joined ##java [08:17]
DistroTube [DistroTube!] has joined ##java [08:21]
Lildirt [Lildirt!~Lildirt@] has joined ##java [08:21]
[rg] [[rg]!] has joined ##java [08:44]
[rg] is it good java style to define final varibales or just wait until constructor? [08:44]
learningc [learningc!] has joined ##java [08:45]
cheeser ? [08:51]
treyG [treyG!~irc@] has joined ##java [08:52]
dez [dez!uid92154@fedora/deSouza] has joined ##java [09:02]
Gurkenglas [Gurkenglas!~Gurkengla@unaffiliated/gurkenglas] has joined ##java [09:09]
Snoober [Snoober!~Snoober@2601:644:103:8400:b07d:3330:2089:3670] has joined ##java [09:26]
ludocode [ludocode!] has joined ##java [09:32]
t2mkn [t2mkn!~t2mkn@] has joined ##java [09:34]
conan [conan!] has joined ##java [09:35]
AbrarSyed [AbrarSyed!] has joined ##java [09:35]
RedSoxFan07 [RedSoxFan07!~Thunderbi@] has joined ##java [09:55]
Goplat [Goplat!~Goplat@reactos/developer/Goplat] has joined ##java [10:00]
indistylo [indistylo!~aruns_@2406:7400:58:adba:c8c4:d27c:ce77:8134] has joined ##java [10:05]
erg0s1 [erg0s1!~erg0s1@] has joined ##java [10:09]
[rg] parted the channel: [10:13]
t2mkn [t2mkn!~t2mkn@] has joined ##java [10:18]
indistylo [indistylo!~aruns_@2406:7400:58:adba:c8c4:d27c:ce77:8134] has joined ##java [10:23]
Jonas___ [Jonas___!~Jonas__@unaffiliated/jonas/x-7723671] has joined ##java [10:32]
learningc [learningc!] has joined ##java [10:46]
Hanii [Hanii!~Hanii@2a00:23c5:c587:a800:dd78:fd16:5141:43e4] has joined ##java [10:53]
zeden [zeden!~user@unaffiliated/zeden] has joined ##java [10:56]
forgottenone [forgottenone!~forgotten@] has joined ##java [11:11]
tassee [tassee!] has joined ##java [11:13]
Sheilong [Sheilong!uid293653@gateway/web/] has joined ##java [11:23]
pd09041999 [pd09041999!~pd0904199@2405:205:8f:ddc:cc29:15dd:e5d8:6eb5] has joined ##java [11:23]
Jigsy` [Jigsy`!~Jigsy@unaffiliated/jigsy] has joined ##java [11:33]
dsond [dsond!] has joined ##java [11:42]
dsond parted the channel: "Leaving" [11:44]
Sheilong detached entity passed to persist [11:45]
dsond [dsond!] has joined ##java [11:47]
learningc [learningc!] has joined ##java [11:49]
Sheilong java.lang.IllegalStateException: Multiple representations of the same entity [ [11:49]
wbrawner [wbrawner!~wbrawner@] has joined ##java [11:53]
Anthaas [Anthaas!~Anthaas@unaffiliated/anthaas] has joined ##java [11:55]