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

12:00 AM
Set<Integer> set = new HashSet<Integer>();
it says HashSet cannot be resolved to a type
 
import it
 
I did
 
fge
@Unihedro reason why you moved those two messages of mine to bin?
 
oh i just had to delete the import header and import it again
its telling me to rename my hashmap
 
fge
@cp101020304 I fail to see what you want to really do
 
12:06 AM
would you like me to explain everything from the start @fge
 
fge
If all you wish to do is calculate the frequency of collisions in some keys in a map, just use Guava and its ForwardingMap
Sure, because for me you are just embarking into pointless procrastination
Sorry for being so blunt, but the last I have seen from your questions don't seem to me as having any useful real life implications
 
analyze string hash codes coming from different string generators, as far as I know. a multiset would do better job counting, but for checking uniques a Set is enough
 
@fge ^ pretty much what he said
 
I don't know either what it's useful for, but trying various things with code is not exactly harmful either. Especially when learning
 
fge
@kiheru sure, but what use is that exactly? Especially string "generators"; what are they supposed to generate in the end? Human readable strings?
 
12:13 AM
It has no real use, apart from learning
 
fge
Also, what are those strings generated from generators supposed to be used as?
Then, as I said much earlier on, google for "java.lang.String catechism"
Then you will learn a lot, and probably more than you ever wanted to know about it
But if you wish to learn about hashing, Java's .hashCode() is not where you should start
And from the video which you'll hopefully have a link to by now, certainly not java.lang.String's .hashCode() either
And what do you want to "learn" anyway?
Learning the intrinsics of String's .hashCode() won't help you program any better in the long run
 
can anyone help meeeee
 
@kiheru I created a Set, and the size of the set just returns the number of strings in the Hashmap
i.e suggests there are no collisions
like you said, the size of the set will be the number of unique hash codes
This is interesting
Keygen2 only has one unique hash code
 
fge
12:29 AM
@cp101020304 what?? Who said you that?
This is not true!
 
@fge what exactly are you referring to?
 
then it probably does not generate all that many different strings either. (likely one)
 
fge
A Set will accept a further element as long as no elements already present in said Set satisfies the same conditions as the added element
 
Set of hash codes
 
It will not accept a duplicate
thats the whole point
@fge
 
fge
12:34 AM
Well yes
So what is your point?
The fact that for some reason the results of .hashCode() may not be sufficient?
Java makes no guarantee about this at all
This is a valid hashCode() implementation: public int hashCode() { return 42; /* the answer */}
The only guarantee of hashCode() is that two objects which are .equals() must have the same .hashCode()
There are zero guarantees about distributions etc
And there are zero guarantees either that for any two objects of the same type o1 and o2, if o1.equals(o2) is false then o1.hashCode() != o2.hashCode()
The above statement is clearly false
 
obviously
 
fge
So, again
What is your point?
 
I think you didn't quite understand what kiheru and I were discussing
 
fge
No indeed
 
it's alright dw :)
 
fge
12:41 AM
It just looked to me as you wanted to study String's hashCode implementation for some unknown reason
Why would you do that is my question
 
nah that's not the case at all
 
fge
So, what is it?
 
just needed some basic insight on the hashCode implementation (which kiheru covered)
 
fge
And why do you want to know that?
There is just no point
And again, if you want to know the full story --> google "java.lang.string catechism"
Just use String and don't be bothered about the details, they are not worth your time at all
Unless you are a core JRE developer
 
thats the goal x0
 
fge
12:45 AM
There are things far more interesting to learn in the Java ecosystem (and far more useful) than how String's .hashCode() behaves
OK, then just google what I told you to
And weep
Really, that's a sad state of affairs
 
kidding
game dev is the goal
 
fge
But it's a proof that sometimes "just enough" is good
Then why do you care about string hashcode
What if you stepped back and explained the actual problem?
 
i'm still in university so i dont exactly get to choose what im taught
 
fge
And the problem is what?
 
solved
 
fge
12:49 AM
...
Ohwell, nevermind then
 
I was never interested in algorithmic stuff like hash codes myself. I've always been interested in design patterns and such.
 
@michael same as myself
 
fge
Well, hashing is an interesting field of study, but when it really matters, Object's .hashCode() is not what you would use anyway
 
Algorithmic stuff is very math intensive.
 
fge
--> use Guava's Hashing
=javadoc Hashing
 
12:51 AM
@fge com.google.common.hash.Hashing: Static methods to obtain HashFunction instances, and other static hashing-related utilities. (1/2)
 
59 mins ago, by fge
Again: a bazillion of people have attempted to "optimize" String hashing and whatnot
 
cryptography is really quite interesting on the surface level, but other than that, no
 
fge
=javadoc Hashing#sha512()
 
@fge HashFunction sha512(): Returns a hash function implementing the SHA-512 algorithm (512 hash bits) by delegating to the SHA-512 MessageDigest.
 
59 mins ago, by fge
None of them have succeeded; NONE
Except for Guava, I presume? ;)
 
fge
12:52 AM
@Michael even them, yes
They would not come even close to native performance ;)
@cp101020304 eh? Cryptography is a crucial part of 100% (yes, that 100) of transactions caring about at least confidentiality (without even talking about integrity and non repudation)
And hashing is not cryptography
 
I know hashing isn't cryptography
I was just saying in general
 
fge
And you find cryptography uninteresting?
Ohwell
It depends on your fields of interest, I guess
 
What field are you in?
 
fge
Previously, systems engineering; now, your run-of-the-mill Java dev
 
im studying software eng
 
fge
12:59 AM
(with a previous, extensive systems engineering experience)
And what in your studies prompted you (if your studies did) to have so much interest in String's hashCode()?
 
nothing specific really
kinda just like learning stuff that i dont understand
weirdly enough
anyway i better get going
thanks for the help
:)
 
In java, is it possible to get access to the object given one of the object's data fields?
 
fge
@ray9209 not unless you access that field by reflection
=javadoc Field#getDeclaringClass()
 
@fge Class getDeclaringClass(): Returns the Class object representing the class or interface that declares the field represented by this Field object.
 
fge
OK, zero progress on websockets, switching off :/
 
1:15 AM
OakBot Online.
 
=javadoc JsonSerialize
 
@Michael com.fasterxml.jackson.databind.annotation.JsonSerialize: Annotation used for configuring serialization aspects, by attaching to "getter" methods or fields, or to value classes. When annotating value classes, configuration is used for instances of the value class but can be overridden by more specific ...
annotations (ones that attach to methods or fields). (1/4)
 
@Unihedro Done and done.
 
fge
Oh, Jackson's javadoc available now,
 
@ray9209 Unless the data field contains a reference to the object, no.
 
fge
1:19 AM
Off; have fun
 
Later.
 
1:42 AM
Hello~
 
2:01 AM
If you have any ideas for OakBot, feel free to post them here: github.com/mangstadt/OakBot/issues
 
2:18 AM
anyone can help me?
how to output csv file with utf8 -bom
 
 
1 hour later…
3:21 AM
Anyone around?
 
@fge It's totally irrelevant.
@Michael Awesome!
 
Ready for the noob question of the day @Unihedro
 
Don't really care, I'm not here for long.
 
What am I doing wrong here / what do I need to google to see my mistake?

int counter, increment;
increment = 10;
counter = 0;


while (counter < 100){
System.out.println(counter);
counter+increment;

}
why can't the counter be incremented by the variable increment here?
 
counter+increment; -> +=
 
3:32 AM
boom!
thanks :p
 
Morning
 
Morning
 
good morning to all
 
... Morning
 
3:48 AM
lotsa repeatin' for uni this morning ;P
 
Playing chess online at school ftw :p
 
4:01 AM
good morning..
 
That split second when I thought my better half seriously forgot my age, only to realize I was just being trolled about looking old. I prefer the second.
 
can anyone help mmeeeee
 
4:50 AM
It doesn't seem like it
Your best bet is google
 
5:34 AM
How to fix windows vista; install win 7 or linux.
 
5:53 AM
Good Morning too all java lovers
 
Morning
 
6:09 AM
Hey, I have an issue with Primefaces (I think it's Primefaces)
When I do an update on a Form, it does an AJAX request, but I get this as result:
The call should update a field on the backend, and then reload the form
the update on the backend was done, but the reloading of the form not
I know the backend was updated because when I refresh the page, the update did happen
 
Good morning, Java!
 
Ellow
 
ASR
6:27 AM
what is the difference between list!=null and list.isEmpty() ?
 
list != null is when the list isn't instantiated. So it has a pointer to a NULL object
list.isEmpty() will check if the list has no variables stored. So the pointer does point to a List object, but that object has no elements inside it
 
ASR
@Erates thanks
 
@Erates of course, if "list" itself exists (i.e. list != null) ;)
@Erates Shouldn't be list == null?
 
ow yea, my mistake :)
short nigth :)
 
6:37 AM
All nights are short nights for a programmer XD
 
6:56 AM
heya fellas
 
hello
 
how does programming feels, in general?
 
What do you mean?
 
I mean to say that at times its just algorithm after algorithm. How to not get frustrated with it?
 
hiiii
 
7:06 AM
getting frustrated is part of the journey isnt it?
 
If you don't like deciphering logic or applying it, programming might not be for you.
 
quick question, whats the fastest way to open an existing java project in eclipse?
I try to open the source file but it doesnt let me compile and run because the rest of the project files are missing
 
Yes it is. But at times its just too much and you feel like this can't be it..it must be finished. I just fail to keep up at times.
 
If I can say something..
 
@cp101020304 Did you download all the dependencies?
 
7:14 AM
always check if your html id's don't have a space in them..
it'll **** ur code up
 
Might be called "sources" in eclips and not dependencies
 
what?
 
Typos; the source of so much frustration
 
it was an existing project that I was working on yesterday but I found how to do it
you have to go file -> import and import the project from the directory
imports all the source files too
@user4275686 I'm in the same boat right now man, you just gotta keep going
 
typos..been there!
@cp101020304 how far have you been into programming?
 
7:19 AM
@user4275686 well i started learning about a year and half ago at university
@user4275686 you can imagine though, we don't get much assistance in terms of how to actually code, so most of it is a solo journey
brand new to java (like 1 month maybe)
 
@cp101020304 I am studying java from past 6 months. Most of the time I am stressed about the algorithm and not he language. Once you learn a language, they will tell you that was a baby step..now got to fight harder. I am into programming from past 3 years..(C/C++).
 
@user4275686 anything specific you're finding hard?
 
20 mins ago, by cp101020304
getting frustrated is part of the journey isnt it?
@cp101020304 true words
 
@cp101020304 java is ok as a language given that I had a very deep c/c++ era. But yeah, most of the times its implementations like DEQUE,doubly linked list,binary search tree deletions...they are quiet complicated , you see!
 
Good Morning, All
@user4275686 meh.. that's just data structures.
 
7:28 AM
@Vogel612 VERY GOOD MORNING.
 
there's existing solutions for that
 
@vo
@Vogel612 what kind of solutions?
 
But since you are doing data structures over and over... are you a student?
std::vector would be the first to jump to mind
probably because my C / C++ knowledge is close to inexistant
 
@Vogel612 yes, yes I am!
 
is C even useful nowadays?
 
7:29 AM
@cp101020304 sure it is
 
@cp101020304 Depends on what you do, sure.
 
what is it used for primarily?
 
kernels and embedded systems, from what I gather.
performance intensive stuff
 
@Vogel612 now that you have mentioned , I find c++ quiet complicated to implement data structures compared to java. That's a true story though even if I have an edge over c++.
 
that's because C++ has templates and macros and is generally a PITA concerning types
also you have to manage lots of the memory issues yourself
java does a lot of that for you
 
7:31 AM
if only C had the encapsulation that Java does
 
then it would be slower
and mostly... java.
or if you will, C#
 
I haven't learned C# yet
maybe in the future
 
C# is a cool language
But I'm not going pay anyone for writing text and running it through a compiler.
 
hmm.. shouldn't have learned LOLCODE then
 
And until the laser cannon is safely detached from the donkey I won't be able to properly use it.
 
fge
7:37 AM
Moo
 
Morning @fge
 
@fge Good Moorning!
 
@Vogel612 It's not that bad
 
yea I got some nice internet points on CR for it
 
rofl
 
7:46 AM
that being said, the waffle board seems to be misconfigured
 
Yeah, it's at Unihedro/JavaBot instead of Vincentyification/JavaBot now.
I decided to finally pull the trigger and renamed all profiles from my obsolete alias.
 
that far I got. I also already fixed the columns
 
It broke a LOT of things.
 
maybe.. I think they're still off to how it was before
 
7:49 AM
Morning people of the earth
And @Unihedro...
 
Hiya Madara
You're still alive!
 
@SecondRikudo Morning Kami-sama
 
pls no naruto spoilers
i only watch the anime :(
 
@cp101020304 Anime is currently a clusterfuck of fillers
I stopped following a while ago, will continue when they end
Damn greedy studio
 
fuck yeah man
 
7:51 AM
@cp101020304 Oh don't worry, there's no naruto action here.
 
they've been putting out fillers for the past 3 months
 
I stopped following the anime before the whole itachi-kabuto-sasuke thing
 
@Vogel612 thats when it got interesting!
 
well... I finished the manga
also: not really..
 
I've been added to waka-rockstars.slack.com!
 
7:52 AM
good morning
 
I mean there were a few unexpected things, but .... it was obvious how this would turn out
@Unihedro wth is that?
 
@Vogel612 its anime though, its always predictable :P try tokyo ghoul if you want unpredictable
 
@Vogel612 ... a series of private chat rooms
 
meh. the manga was completely uninteresting IMO
s/private chat rooms/unfortunate events/
 
high expectations man
 
7:53 AM
ya kinda
 
what did you find interesting then
 
interesting as in really mentally interesting?
trigun, ergo proxy, serial experiments lain,
Code Geass (the second season not so much)
 
are those anime or just manga?
 
there is anime of these all,
 
I quite liked Deadman Wonderland tbh
 
7:55 AM
that was fun to watch
 
DBZ forever ♥
 
@cp101020304 Eh
 
and the plot was good
 
Try Mirai Nikki, Zankyou no Terror
 
@SecondRikudo WATTT Deadman wonderland was amazing
 
fge
7:56 AM
Or Fate/Zero
:p
 
@fge meh. that's not nearly as "wtf" as the others
 
Steins;Gate was pretty good too
 
that is an understatement
and it only gets better on the second watch
 
I've only watched one anime throughout my life so I can't chime in here :p
 
anyone seen Hellsing Ultimate?
 
fge
7:59 AM
GitS-SAC fot the win
@Unihedro still waiting by the way
 
Hellsing Ultimate probably has the highest production value of any anime that i've seen tbh
didn't really keep me hooked though
 
I've been waiting a life time
For this moment to come
I'm destined for anything at all
 
@cp101020304 same
well... concerning the hook..
 
fge
Ohwell
 
8:19 AM
quick question
What would happen if a hashmap was created with a load factor of greater than 1?
Would it just behave the same as a hashmap with a LF of 1?
 
it'll allow the map become more full before resizing
 
fge
<-- still hasn't succeeded in making a functional websocket example :(
 
<--- got to the fun part of trying to sort out stuff by timestamp
 
how can the hashmap become more full if you have a load factor of greater than 1? @kiheru
I thought the maximum limit is 1
 
8:35 AM
@cp101020304 it's the threshold for rehashing. the hash buckets can hold more than one item
you can pass it any positive float for the load factor. it complains only about negatives or NaN
 
fge
@Gemtastic you should know how to generate column expressions by now; so that's an easy task :)
 
@fge Yup
I just gotta figure the syntax with jooq
 
(I think deserialization has some automatic limits, but normally you can set it to whatever you like. it expects the programmer to know what they're doing)
 
fge
DSL.decode().when(condition, response).when(condition, response).otherwise(response).as("someNameHere")
That generates a Field<?> which you can use in select, groupBy, etc
 
Hmm
 
8:39 AM
Does this look reasonable (I know there are libraries for it)
private static <T> String join(List<T> values, String delimiter) {
    String result = "";
    for (T value : values) {
        result += value.toString() + delimiter;
    }
    return result.substring(0, result.length() - delimiter.length());
}
 
fge
This is exactly what I have used in the JooQ video example
 
@SecondRikudo Do'tcocatenate stringi loop
 
@fge I can't just select from a table where all timestamps happen before timestam?
 
@Unihedro StringBuilder?
 
ye
 
fge
8:39 AM
@Gemtastic sure you can
 
OMG keyboard
 
@fge That's what I'm trying to figure :P
 
fge
Create your Condition
 
private static <T> String join(List<T> values, String delimiter) {
    final StringBuilder sb = new StringBuilder();
    for (final T value : values) {
        sb.append(value.toString()).append(delimiter);
    }
    final String result = sb.toString();
    return result.substring(0, result.length() - delimiter.length());
}
 
shouldn't this work:
create.selectFrom(APPOINTMENTS).where(APPOINTMENTS.SCHEDULED_DATE.le(DSL.currentTimestamp())).fetch();
 
8:40 AM
How's this @Unihedro? ^
 
Better, but does StringBuilder come with substring?
=javadoc StringBuilder#substring
 
@Unihedro Don't know, but String does.
 
fge
@Gemtastic it will
 
substring() also results in copying from java 8 onwards. (I know, premature optimization...)
 
fge
@SecondRikudo use .subSequence().toString() instead
 
8:41 AM
Looks better :)
 
Then I did figure it on my own :)
 
private static <T> String join(List<T> values, String delimiter) {
    final StringBuilder sb = new StringBuilder();
    for (final T value : values) {
        sb.append(value.toString()).append(delimiter);
    }
    return sb.substring(0, sb.length() - delimiter.length());
}
 
You can use append(value), it calls toString automatically, and is more readable.
 
fge
@Gemtastic are you sure you want all columns from the appointments table though?
You can select only the columns you need
 
@fge Yes, for this thing I do
 
fge
8:44 AM
OK, good then
 
Since I want to list all the bookings
 
fge
@SecondRikudo aren't you allowed to use Guava?
=javadoc Joiner#on(CharSequence)
 
But I might want .ge instead of .le XD
 
@fge I don't want to add any extra dependencies on this project
It's a MAJOR PITA
 
Guava is awesome, but sometimes a bit too large dependency if you don't use lots of it
 
8:50 AM
Guava iz like jQuery
 
Guava probably does not get abused as much. Ooh, there's this one function that does what I want. Let's include jQuery
 
It already has a 2MB pom
 
@kiheru true
 
I'm currently looking at React
 
@SecondRikudo ... Holy.
 
8:53 AM
@fge you may find React beneficial to your debugger web interface
 
hi :)
 
Hi.
 
anyone here done a lot with HttpsURLConnection in Java?
 
Isn't that from the sun package?
 
=about
 
8:57 AM
javax.net.ssl.HttpsURLConnection;
 
nope... not even there.
 
Oh, that.
@Michael Oak is dead!
 
getting some really really weird behavior that has us stumped
0
Q: How can changing settings on one HttpsURLConnection affect a completely different connection?

Tim BI have a web service that I am connecting to on the internal LAN, using HTTPS with self-signed certificates. This is to make sure the data is encrypted but we are not worried about other attacks as we have full control over the network and the servers, we just want to encrypt the data to stop any...

 
soo... uni you had contact with that due to JCE / http/2?
 
@Vogel612 ?
 
8:58 AM
HttpsURLConnection
after all login is https
 
Nah, I think I used it during code golf sessions.
 
fge
@SecondRikudo before thinking about it I need to have websockets working :p
I can't do it at the moment :(
<-- no web programmer
 
@fge Having problems on which end?
 
fge
Java
 
Can't really help you there :(
 
But WebSockets are basically a glorofied and giftwrapped TCP socket
 
fge
I'm reading, trying, failing, rinse, repeat, and can't get out of that cycle at the moment
 

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