« first day (1620 days earlier)      last day (3339 days later) » 

9:00 AM
"Websockets" are just a fancy name for "TCP socket upgrade".
Java-Websockets library implements RFC 6455.
... Which is good.
 
fge
@Unihedro yeah, I might just end up using this library instead of Spark
That's a pity, but...
 
@fge Why instead? Do you not need HTTP?
 
fge
Well, yes I do
 
Why not both then?
 
@SecondRikudo The more the merrier :)
 
9:03 AM
Can't see deleted messages.
Me no gusta.
 
1 min ago, by Unihedro
IN TXT "v=spf1 a mx ip4:<cloud IP> ?all"
-_-
It was a mispost k.
 
Cuz I'm RO
 
dafuq...
 
I'l show you
@Nordehinu will be our test subject for a moment.
 
wut?
 
3 mins ago, by Unihedro
IN TXT "v=spf1 a mx ip4:<cloud IP> ?all"
 
failed
 
Eh.
 
or rather... bug?
did you reload?
 
9:07 AM
4 mins ago, by Unihedro
IN TXT "v=spf1 a mx ip4:<cloud IP> ?all"
 
hmm...
 
Oh, I see - I have access to my history of messages that I deleted, because they're mine.
Btw, that's the TXT Record configuration for mail.unihedro.com. :/
Not anymore.
 
9:14 AM
@kiheru by hold more than one item, do you mean that any collisions are stored in a linked list?
 
@cp101020304 Negative. What they're stored in are merely an implementation detail and are not limited by abstractions.
What you need to know is that collisions results in duplicate items in the hash bucket.
That's what the HashMap contract tells you in the javadocs anyway, if only OakBot is still alive for me to show it.
 
hmm so why would the run time of the put method in a hashmap of load factor 1 be faster than that one which has a higher load factor?
more collisions?
 
... Because that's what a load factor is.
 
But I thought that the hashmap data structure doesn't allow for duplicate items?
 
That's different. A return value of true of A.equals(B) does equate to A.hashcode() == B.hashcode(), but not the other way. Different items can have the same hash code.
 
9:20 AM
it does not allow duplicate keys, but keys can be sorted to the same hash bucked
 
^
 
I see! but i still dont get why there is a massive difference in the runtime
 
and it does not even require the same hash code. the table needs to place items to a reasonable number of hash buckets, so items with different hash codes can end up in the same bucket as well (with probability depending on the hash code quality, load factor, and chance)
 
So increasing the load factor pretty much means that you can store more duplicate values in a given hashbucket until you have to re-hash?
duplicate items*
 
a low load factor tries to keep the buckets small, so lookups are fast. a high load factor forces many items to the buckets, where lookup ends up being linear search
 
9:25 AM
Keys.
 
hello to all
is there developer for scala and play-framework ?
 
... Not here, go to the Scala room.
 
the scala rooms are not active
 
@kiheru so a higher load factor would also make insertion slower?
 
@HarmeetSinghTaara Doesn't matter, it's not like anyone here deals with any part of it.
You'd have better luck in an inactive room, that is.
 
9:28 AM
@cp101020304 typically. since insertion too requires comparing the keys
 
@cp101020304 Usually you'd stick with the default values and they're optimal for most use cases.
It's scaling, so.
 
Yeah the default LF is about 0.75 if im not mistaken?
 
Look it up, it's in the JDK source since 1.3
 
i'm just trying to compare what happens with lower/higher load factors
yeah its 0.75
 
9:29 AM
it's even in the documentation
 
" Higher values decrease the space overhead but increase the lookup cost (reflected in most of the operations of the HashMap class, including get and put). "
What does space overhead mean?
 
Pre-allocated space?
 
sorry i'm new to programming so the majority of things are still jargon to me
 
means it uses more memory basically
 
Generally reinventing the standard library is wrong, but for learning how data structures work a fun exercise is writing your own. A hash map is not overtly difficult to implement. (After doing that, get back to using what is provided by the library)
 
9:33 AM
If you're new to programming you should learn from writing code (if you have tons of time, write trash code and tinker with everything) and understanding constructs, not to deal with ridiculous stuff that CS experts pulled together that took ages for them to even understand themselves :p
 
my lecturer thinks this is the way to go apparently
i dont quite agree but meh
 
Your lecturer sucks. Drop school and teach yourself programming. Then take a career certificate exam and you'll thank me for the time you saved.
Unihedron is not your career adviser. Take everything he says with a grain of salt.
... No but seriously.
 
if only modern day employment took into account actual skill rather than your degree
 
ASR
@Unihedro Hi
 
@ASR Hiya
@cp101020304 I'm 16 and I have 2+ years of professional development thru part-time and freelancing..
 
ASR
9:36 AM
I want to see source code of BinarySearch in source code , how can I see?
 
And I have yet to graduate -_-
@ASR The implementation of binary searching?
 
you're 16? wtf
 
ASR
yes
 
Look up JDK source code of TreeMap
 
in bin, 8 hours ago, by EnglishMaster
user image
/hides under rock
 
9:38 AM
I like the plot twist when the gif reveals that the expert is of C++ xD
It's unrealistic, but meh :p
 
@Unihedro lolwut. Dropping out of school is almost never a good option. Trust me
 
4 mins ago, by Unihedro
Unihedron is not your career adviser. Take everything he says with a grain of salt.
 
he's got a point though...
 
@ASR binary search? GOogle it :)
 
Me? I was kidding.
 
9:40 AM
If you want to learn programming... school in 80% of the cases isn't the way to go
 
ASR
private static <T>
245     int More ...iteratorBinarySearch(List<? extends Comparable<? super T>> list, T key)
246     {
247         int low = 0;
248         int high = list.size()-1;
249         ListIterator<? extends Comparable<? super T>> i = list.listIterator();
250
251         while (low <= high) {
252             int mid = (low + high) >>> 1;
253             Comparable<? super T> midVal = get(i, mid);
254             int cmp = midVal.compareTo(key);
255
256             if (cmp < 0)
257                 low = mid + 1;
 
Congrats, you know how Google works!
 
ASR
I found it why they mentioned method is private?
 
@Vogel612 True but as a professional. A degree is necessary. Also a developer isn't just about programming. It has become way broader
 
@ASR Because it's used internally.
 
ASR
9:41 AM
@Unihedro :)
 
@HamZa also correct
 
Arrays.binarySearch also has an implementation, but it sucks.
 
ASR
@Unihedro all the jdk is implemented with generics?
 
Negative, but trust the ones that are.
Every other implementation are sketchy.
 
For all the students out there, bookmark rosettacode.org and thank me later :)
http://rosettacode.org/wiki/Binary_search
2
 
9:43 AM
@HamZa sysadmin, qa, designing, ...
I have't recommended rosetta for a while. :/
 
@Unihedro I was more referring to social and procedural skills
 
@HamZa Should had been more specific than "way broader" :D
 
what is rosettacode?
 
@cp101020304 click on the link -_-
 
@HamZa I did hahahahha
 
9:45 AM
@Unihedro true
@cp101020304 I hereby think you might be a troll...
 
@cp101020304 lmddgtfy.net/?q=rosettacode
> Rosetta Code is a programming chrestomathy site. The idea is to present solutions to the same task in as many different languages as possible, to demonstrate how languages are similar and different, and to aid a person with a grounding in one approach to a problem in learning another.
 
Oh, someone reminded me of google code jam. Who's going to participate in it?
 
Not me.
 
!!wiki chrestomathy
oh dammit
 
Cap is dead.
Eh, use wiki:thinghere
 
9:47 AM
oh shit this shit is actually pretty useful
 
Chrestomathy (/krɛsˈtɒməθi/ kres-TOM-ə-thee; from the Greek χρηστομάθεια desire of learning = χρήστης user + mathein to learn) is a collection of choice literary passages, used especially as an aid in learning a subject. In philology or in the study of literature, it is a type of reader which presents a sequence of example texts, selected to demonstrate the development of language or literary style. It is different from an anthology because of its didactic purpose. == Examples == Bernhard Dorn, A Chrestomathy of the Pushtu or Afghan language, St. Petersburg: 1847 Mencken, H. L., A Mencken...
oh, cool
 
fge
Ohwell
 
a good programming degree teaches you a lot more than just the language
 
fge
No websockets for now
 
learning a language you can do easily on your own if you are any good
 
9:53 AM
@TimB There are no good programming degrees.
 
fge
@Unihedro there are
 
and how many have you tried? ;)
 
fge
In France in particular
 
I don't speak by experience.
 
fge
Try and study at lip6
 
9:54 AM
@Unihedro disagree! I quite like software engineering
 
fge
You'll see
 
At our school, they tell you to buy a book and go through it. Worst case they give you a lynda course :P
 
I went to uni nearly 20 years ago and I still went to a good programming degree
 
lyndaaaa!
 
(well actually I did Maths & Computing joint honours)
but it covers a lot of stuff that isn't obvious or a matter of just learning the language
things like understanding algorithms, boolean algebra, etc
 
9:55 AM
My worst experience was that I needed to buy a book for C but it was in dutch -_-
 
parallel processing, threading
 
fge
@HamZa K&R
This book is timeless
 
not just being able to copy some code and use them but properly understanding them
 
The paper i'm doing right now which is making me go through these meticulous tests is actually an algorithm paper
optimisation & algorithm to be precise
 
I'd already been programming for 10 years when I went to uni, and I still learnt stuff there. Not the languages because I knew that, but what is going on behind the languages or ways to understand and use the languages
 
fge
9:57 AM
If I were to choose one "computing hero", that would be Brian Kernighan
@TimB ever heard of coq?
Now that is some interesting language
 
no, never worked with it
 
@fge if only they suggested that book :/
 
fge
@HamZa just buy it for yourself
(unless you have already done that)
 
10:20 AM
@kiheru how does the runtime of the put method scale with the load factor? is it linear?
anyone?
 
fge
@cp101020304 OK, if you wish to go that deep into collections, try and hack on this
It has no Set for now -- add it ;)
And Map while you are at it :p
 
Three years later.
 
@Unihedro you go back to... one of your countless projects
tell me... how long will JCE take?
 
fge
10:35 AM
And where is my mail? :p
 
@cp101020304 once you understand how the load factor works, that should be fairly easy to figure out
(or measure it, with all the caveats of bench marking stuff with the jit :-P)
 
(loadFactor) / (1 - loadFactor) @kiheru
is that relevant or no?
 
fge
My word, I have forgotten everything about webapps
<-- has done way too much server-side stuff
 
have a beer mate
 
hello
how do you design MVCs usually. Mine, I have the controller take on a one view. But one use case popped that I needed one controller for multiple same views.. Its like, whichever GUI first that it interacts with does the action and prevent the other view from updating it
that was a rather vague question. ok, off to some more research
 
10:50 AM
@cp101020304 you can start by figuring out what happens 1: when the load factor huge (simplifies to start with capacity = 1) 2. when it's very small
 
@kiheru both scenarios would result in a slower runtime than that of a default load factor of 0.75. We talked about what would happen when the LF is huge above, and something similar would happen when the LF is very small. The hashmap would re-hash prematurely and waste quite a bit of memory, increasing the runtime. How does this show me how it scales though?
 
Guys, if I .getString() on a resultset, will it return null when the database column is NULL?
Or will it try to be a smartass?
 
rehashing in general complicates the situation with put() a lot. in case of small load factors the behaviour is very different when the key is already present, and when it isn't. get() is more consistent
 
@kiheru then what does this represent? (loadFactor) / (1 - loadFactor)
 
iirc ResultSet does not refine the toString() behaviour from Object(), for which it's "the string representation of the object". Null would not be a valid representation of a non null object
@cp101020304 if you read what the page says, it's about hash conflict resolution. and the time complexity is dependent on the resolution strategy. by reading the HashMap source you could check what strategy it uses - but it's an implementation detail and the documentation does not specify it. So in principle it could change between different java versions/implementations
(you cold deduce something from the fact that the HashMap accepts load factors > 1 though)
 
11:15 AM
I can't find what strategy the hashmap source uses
 
I don't think it states it explicitly
 
@kiheru i dont understand how i can deduce something based on that fact
 
@cp101020304 consider what would happen with the open addressing strategy discussed in your link if you tried it with load factor > 1
 
@kiheru it would return a negative value
does this mean that performance is really bad
or does it mean that it is not the correct way that it scales
 
do you understand how that conflict resolution strategy works?
hmm, actually, read the chapter "complexity analysis", it tells you what would happen
 
11:25 AM
That chapter only covers the behaviour of the probing sequence for load factors that are less than one (and/or very close to 1) but not above
Does the collision resolution strategy change to chaining if the load factor is greater than 1?
and so the runtime is directly proportional to the load factor?
 
What would happen that there simply would be no free slots
 
free slots in the buckets?
 
An implementation could in principle choose strategy based on the load factor. Anyway, the documentation of HashMap does not specify anything, and there are different ways of conflict resolution. Reading the source can tell what it does, but it is not required to stay that way (or be the same in different implementations - the implementations used by android and openjdk are different for instance, and could in principle use different strategies (I don't know if they do))
 
Does Java not automatically use open addressing if the load factor is below 1? and then use chaining if its above 1?
 
read the previous comment
 
11:36 AM
19
Q: Chained Hash Tables vs. Open-Addressed Hash Tables

Andrei CiobanuCan somebody explain the main differences between (advantages / disadvantages) the two implementations? For a library, what implementation is recommended?

 
posted on March 31, 2015 by Yolande Poirier-Oracle

This fall, Java's leading developers and visionaries will gather in San Francisco, California, to create the future and commemorate 20 years of Java— you are invited to join them This year's eight tracks are:  Core Java Platform Java and Security JVM and Emerging Languages Java, DevOps, and the Cloud Java and the Internet of Thin

 
that link suggests that both conflict resolution techniques are employed in different scenarios
and it makes sense for it to be that way
 
Unihedro has stopped a feed from being posted into this room
 
No one cares about JavaOne...
 
i think thats enough hashmap for an entire year
sleep time
 
11:47 AM
sleep well then
 
hi all
 
H
 
@Unihedro I signed jar it work well but can any way so we can run unsigne jar
 
K
 

« first day (1620 days earlier)      last day (3339 days later) »