greptilian logo

IRC log for #javaee, 2014-03-22

Please see http://irclog.greptilian.com/javaee for which days have been logged.

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
01:35 aspire joined ##javaee
01:37 SoniEx2 I kinda need something
01:37 SoniEx2 let's say I have 3 objects: obj1, obj2, obj3
01:38 SoniEx2 then let's say I want to map something to a number
01:38 SoniEx2 I mean
01:38 SoniEx2 Map<Identifier, Integer> or something
01:39 SoniEx2 then I want each object to map to a specific part of the map
01:40 SoniEx2 but I want to distribute randomly between the objects
01:40 SoniEx2 or... idk how to explain this
01:46 SoniEx2 should I just map to a map?
01:46 SoniEx2 and do some math?
01:58 SoniEx2 meh I wish Java had ?.
02:01 SoniEx2 I have a question: null checks vs object construction?
02:04 pdurbin SoniEx2: I'm pretty sure you can make a map of a map. But at some point, just make an object, right?
02:13 SoniEx2 is there anything like a "random access" map?
02:13 SoniEx2 like a map where you can get entries by index?
02:18 AartBluestoke1 joined ##javaee
02:19 gandalfpimp joined ##javaee
03:27 aspire joined ##javaee
03:50 aspire_ joined ##javaee
04:09 aspire joined ##javaee
04:19 sfisque soniex2  look at the linkedhashmap
04:20 firebird1 joined ##javaee
05:37 firebird1 joined ##javaee
06:12 AartBluestoke1 left ##javaee
06:41 firebird1 joined ##javaee
06:47 ashkanr joined ##javaee
07:11 AlexCzar joined ##javaee
08:45 firebird1 hi guys
08:55 AlexCzar joined ##javaee
08:59 firebird1 can someone guide me on custom identity generator
09:08 firebird1 any tut
09:15 firebird1 http://blog.anorakgirl.co.uk/2009/01/custom-hibernate-sequence-generator-for-id-field/
10:14 firebird1 joined ##javaee
11:24 AlexCzar joined ##javaee
11:24 SoniEx2 what do Java dreams mean?
11:25 SoniEx2 (a Java dream being a dream where you're programming your Java stuff)
12:55 neuro_sys joined ##javaee
12:55 neuro_sys good day
12:55 neuro_sys beautiful weekend
12:56 SoniEx2 I need a map where I can get stuff by slot
12:57 SoniEx2 as in listPoweredMap.get(int index)
12:57 SoniEx2 or listPoweredMap.get(Object key)
12:58 SoniEx2 (or as in I want both)
13:06 neuro_sys you need a bidimap
13:06 neuro_sys is that it
13:06 neuro_sys oh you say you need indexing
13:07 neuro_sys I don't know one that's provided as an api, but it'd be easy to extend the default implementation to get one
14:01 philbot joined ##javaee
14:01 Topic for ##javaee is now Java Enterprise Edition | http://en.wikipedia.org/wiki/Java_EE | logs at http://irclog.greptilian.com/javaee/today
14:04 javaeebot joined ##javaee
14:07 Sircle_ joined ##javaee
14:15 Sircle joined ##javaee
15:00 neuro_sys http://vertx.io/
15:00 neuro_sys hmm?
15:42 sfisque if you're willing to accept an O(n) lookup cost, you can use LinkedHashMap
15:43 sfisque otherwise you can extend HashMap and implement List or extend ArrayList and implement Map
15:44 neuro_sys I had checked that when he asked about it, but couldn't see a method with signature get(int index)
15:45 neuro_sys he'd have to get the keyset iterator, and count until hitting the index
15:57 firebird1 joined ##javaee
16:19 firebird1 i slept the whole day
16:19 firebird1 too much tired
16:20 firebird1 human body is not machine
16:42 SoniEx2 how do I do public and private keys in Java?
16:48 sfisque aye neuro_sys.  that's why i indicated the O(n) aspect
16:48 sfisque but for fairly small sets, O(n) is barely worse than O(log n)
16:49 sfisque the other way, he'd have to write code integrating a List and Map into a single impl
16:49 sfisque which if the set is fairly small, is overkill
16:51 neuro_sys using another internal map to index by a linear counter would be interesting :p
16:51 neuro_sys anyways
16:51 firebird1 sfisque, like in js integrating a List and Map
16:51 sfisque the aspect of a LinkedHashSet is that it guarantees every iteration to be identical betweeen invocations
16:51 sfisque aye
16:51 sfisque i'm a big fan of leverage over reinvent if the problem does not require it
16:52 sfisque if his set is big (thousands, millions, etc.) then the custom impl would be the way to go.  if the set has ~100 entries, LHM would do just fine perf-wise and be "off the shelf"
16:53 firebird1 joined ##javaee
16:56 * SoniEx2 flips sfisque
16:56 * sfisque does somersault in the air and lands on his feet
16:57 * SoniEx2 slaps sfisque
16:58 * sfisque performs the shaolin thousands hands of death move on SoniEx2
16:58 SoniEx2 also I expect the map to have about 262144 objects
16:58 SoniEx2 anyway
16:58 SoniEx2 call me a they
16:58 sfisque which operation do you anticipate more often, key lookup or index lookup?
17:01 SoniEx2 both
17:01 sfisque "more often"
17:01 sfisque both isnt an answer
17:01 SoniEx2 both
17:01 sfisque nm
17:02 SoniEx2 both/neither
17:02 sfisque the other issue is, why would you manage that in memory
17:02 sfisque why wouldnt you query and page?
17:03 sfisque minus any internal info, you're already looking at giving up over 2m of memory just for the pointers
17:05 SoniEx2 I expect this to use 500MB of memory
17:05 SoniEx2 2M is nothing
17:05 sfisque 2M is not nothing for a single object in memory
17:06 * sfisque shakes his head, muttering, walking out of the room
17:12 SoniEx2 MC uses 1GB+, 2M is nothing
17:18 * SoniEx2 flips sfisque
17:20 * sfisque sighs
17:42 firebird1 aaaaaaaaah
17:42 firebird1 building reports in java without doc is heck difficult
18:27 tjsnell then use the docs
19:13 kobain joined ##javaee
19:46 firebird1 left ##javaee
20:40 nsdk joined ##javaee
20:41 nsdk hi guys
20:41 nsdk I would like help with validation
22:00 tjsnell and?
22:00 tjsnell you're a great person
22:00 tjsnell people like being around you
22:00 tjsnell do you feel validated now?
22:25 pdurbin tjsnell: good try
22:25 tjsnell :)
22:30 pdurbin maybe it was more of an issue with parking
23:08 AndroidLoverInSF joined ##javaee

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

Please see http://irclog.greptilian.com/javaee for which days have been logged.