« first day (3061 days earlier)      last day (2104 days later) » 
00:00 - 13:0013:00 - 22:00

00:00
Show me a man who is a good loser and I'll show you a man who is playing golf with his boss. (source)
00:57
morn
morn
01:13
morn
morn
 
1 hour later…
02:36
Question
I am doing hibernate mapping using xml
and I got this problem on mapping two tables (many to one) relation
usually I map columns that has the same name
but on this case they have different name
do you guys have idea how I can solve this ?
table 1 - name , table 2 - first_name
<many-to-one name="name" column="name" class="myClass.Names"/>
02:51
Oh I figured out
if you are going to map
or reference a column 'Many to one'
hibernate dont care of the column name of the referenced table, it just connects it to the primary key
 
3 hours later…
05:54
good morning guys
06:24
good morning
Good morning.
@Black Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
Thank you
07:01
@Black hey
welcome
@rekire what's up?
@Neil Working on an open source project to get my work done lol
@rekire is the open source project the work that needs to be done? o_O
No, but that enables me to make it faster. that means that is my plan
I need to create a tone of new intents for alexa and dialogflow and I try to generate the utterances at once so that I can upload them in one step per platform
oh cool, you're creating a program for alexa?
How does one go about that anyway? Do you have to register your program with Amazon like you would for a Play app?
I am working on a framework to generate diverse responses, also with the option to define the utterances in a single file
This is the project I am talking about: Konversation
The readme file should give you an impression what it does
07:11
@rekire cool, so it's like a platform for setting up Alexa programs
I got an Alexa and I've been wondering how to dabble in that
I think it would be cool to have a custom program :)
@Neil that is just a handy tool. A sister project (where I'm working on too) called dialog is the framework which you can use to host your own server.
regarding "how it works" you use for google most likely Dialogflow and for alexa you must use there developer site
in the end you need to have some logic where you create the responses you can use e.g. dialog as referenced above. konversation is to split your code from the actual text send to the user
right, sounds smart
feel free to star both projects 😁😁
I sort of have an idea how Alexa works. Like I have an app which plays noise like rain or whatnot, but you have to "start" the program before it will respond to said commands
you define those sounds via ssml...
we have there an artifact for that too. here is an example: github.com/rewe-digital-incubator/dialog/blob/master/…
Konversation has there no comparabilities for audio files yet.
07:18
starred :)
hey @ColdFire
@Neil thx 😄
However currently I try to create a zip file with a lot of files inside, that is something new for me
btw I created with Konversation once a 10GB json file 🤣
07:43
wow, that sounds like fun to read
I'd think that with files that big, would be worth considering saving it in binary or something
usually json files are best for structure, but not for holding a lot of data
I have a quick question. I am passing a Class variable to a function. Suppose the class that I am passing is A, i.e., function(A.class) Class A has nested classes say B and C. How can I get reference of class B inside function(Class aClass) ,i.e., I need something like aClass.B.class?
@Neil json is the only format amazon can handle. it didn't work for 5 other reasons anyway, but that was fun
@Shubham why are you using the "classes" instead of real instances?
@Shubham There are two things here, nested classes and inner classes
A nested class is static, and doesn't require an instance of the parent to use
an inner class isn't static, and to the contrary of a nested class, it can see the members of its parent class
For this reason, it must be associated with an instance of the parent class
To do that, you'd do A a = new A(); A.B b = a.new B();
@rekire I am using reflection. To describe in a gist, there's a function that takes a class and filename as parameter and returns a Properties object. It decides what properties to initialize by checking the fields defined in the class sent to it as parameter.
that said, don't use inner classes unless it makes sense to do so (like for say, an Iterator) and definitely don't have an inner class inside an inner class
07:54
@Shubham uh okay. 9 of 10 usages of reflection where dirty hacks in my case. think about if there is a better way^^
@rekire Okay. In my case, I haven't declared my "inside" class as static, so I think it is an Inner Class.
in my last case where I used reflection I was able to avoid the hack by adding a single if statement to another library
Basically there's different types of Properties that are being initialized based on the class that you pass as parameter. This greatly simplified my code because I was able to initialize the required things with just a for loop and a few if checks.
@Shubham I'm not sure if I can help you. Neil seems to be better informed related to the internals
@Shubham yes, should be an inner class
But it sounds to me like it could be a nested class instead
why should the instance of B know about A members?
that's tight-coupling, and tight-coupling when you don't need to is just silly
make it its own class
if you must use reflection here, it wouldn't change things for you
08:01
has anyone used the ZipOutputStream before? I cannot open the created zip file in the windows explorer
@rekire Yeah, I have some time ago
It's a little tricky. It helps to look at examples
To give an idea, my class looks like this:
public class A {
    public class B {
        public static final String name = "property_b1";
        public static final String name2 = "property_b2";
    }
    public class C {
        public static final String name = "property_c1";
        public static final String name2 = "property_c2";
    }
}

Class aClass = A.class;
function(aClass)

Properties function(aClass) {
    // access aClass.B.class or aClass.C.class here
}
@rekire It sort of treats each item in the zip as its own stream
@Neil with 7zip I can open the files 😕
@Shubham can you edit that message to format it (use Ctrl+k)?
08:03
@rekire make sure you're closing them properly
@Shubham Hmm, don't do it this way, I implore you
Read a properties file like:
a.b.name=property_b1
a.b.name2=property_b2
a.c.name=property_c1
a.c.name2=property_c2
One more thing, there are other classes similar to A like say A1 or A2. Basically aClass can refer to A.class or A1.class where the inner class name are same, i.e., B and C
@Shubham I know it seems clever to you now, but don't do it this way :P
I know because I have been there in your shoes
You'll regret it later
Anything and everything you require can be drawn from a properties file
@Neil The reason I am doing it this way is because I can get away by just looping over the fields of the inner class if I can just access the inner class from the outer class reference.
a.b.name=property_b1
a.b.name2=property_b2
a.c.name=property_c1
a.c.name2=property_c2
property_roots=a
root_subclasses=b,c
@Shubham you have everything here
you can cycle through them all without knowing which classes there are and without instantiating them
@rekire are there the contents of each file in the zip when opened using 7zip?
08:11
@Neil So you are suggesting to get the outer and inner class names from the .properties file?
I'd think you'd need to close each entry
@Neil I can extract all 4 expected files with 7zip
@Shubham No, I'm suggesting you skip the inner classes and just use the .properties file for all your data
/javadoc java.util.Calendar
08:14
/javadoc org.rewedigital.konversation.Konversation
@rekire Sorry, I never heard of that class. :(
that is not an "official" API
You can create data trees if you use prefixes
@KarelG I guessed that would happen^^
@Neil I am using .properties file for all my data. If you don't mind, may I show you the exact code that I am working on, it isn't too much.

The idea is to loop through the fields defined in the inner class and check if the `.properties` file has that field, if not it throws an exception, and if its there then it initialized the property.

    public static Properties getProperties(Class aClass, Configuration configuration, boolean mandatoryParameterCheck) throws Exception {

            Field fields[] = aClass.getDeclaredFields();
08:15
@Neil do you have an example?
@rekire That was referred to Shubham and the property files actually
@Neil ups lol
just wrote some javascript behavior in java :|
final ZoneId zoneId = timezone.toZoneId() || ZoneId.systemDefault();
@Shubham I think you could replace all that with a properties.load(clazz.getStreamAsResource("path/to/propeties.properties"))
@KarelG if you would use kotlin you could use the elvis operator (tbh no idea if that is in java too)
08:19
meh K0tlin
@KarelG common kotlin is cool
@Neil Will check this. Didn't know about this :D
idk why they named it as "elvis operator"
@Shubham :)
it is referred as "null coalesce operator" in another languages
I want to see that in Java, yes ...
but Optional works well in some situations
08:21
@KarelG ?: looks a little like the hair of elvis
superman has that kind of hair too
why not call it "superman operator"?
if you two ever create your own language, you must necessarily create a "superman operator" just to confuse
@KarelG optional is a nice idea, however it is a huge overhead you write a lot of code for that
@Neil 🤣🤣🤣
Optional was the "nice" solution in Java
the one that was backwards compatible and didn't wreck code
08:23
And I do appreciate their efforts to maintain "niceness", but sometimes I wish they'd be a little more aggressive, like change behavior with a jvm argument that lets you have old behavior
would introducing a null coalesce operator break Java?
I doubt it but seems so
as it stands now, if I do SomeClass a, a could be null
so yeah
if the default is for a to not be nullable, then that would break code
However Optional.of(xxx) just to provide null safety is ridiculous
The boxing and unboxing sucks to much that I would not use it
you wouldn't use it for null safety
you'd use it because you return an Optional
I know
08:26
If you call Optional.of on something which may be null, you risk for a NPE to be thrown, which defeats the purpose of Optional
In Kotlin I don't need to mess around Optional
I like how Kotlin does it
@Neil that method is just akward
In Assembly, I don't need to mess around with objects
@KarelG Yeah, I agree, not elegant at all
08:28
the implementation of Optional.ofNullable should be moved to Optional.of and then that first method should be removed
@JennaSloan you just need to love pain :-D
java could introduce the ! to types to guarantee that it isn't null
@rekire Nah, Assembly is super simple
❤ assembly
like, you couldn't declare a variable without assigning it immediately
String! notNull = "hello world";
08:29
tbh I never used it, if you are an expert I need to belive you
String! can convert to String but not the other way around
My professor once said that I am the best student he has met the past 20 years. I even came with nice macro tooling that he did not think of. He is now using some of these himself 😃
eg a macro for inputs.
Really. I was lazy to write those instructions each time again and again.
Remember folks, efficiency is just clever laziness!
2
hehe nice
@Neil yep
08:35
nice quote, wondering if it is real
@Neil bill gates did not say that tbh.
Truer words have never been said
lol
Yeah, I don't know. Seems like something he might say though
08:37
@Neil there are people out which will think that this quote is real
And I'm too lazy to find out if it's true or not
@rekire it wouldn't surprise me
well, it was from a Senator. But it got used (reworded) many times by managers. Even Bill.
ah, so he did technically say it
he just didn't coin the phrase
He figured out that lazy brickworkers are more efficient than expert brick workers
good thing that he deals with programmers and not brick layers
08:40
> Gilbreth studied the methods of various bricklayers—the poor workmen and the best ones, and he stumbled upon an astonishing fact of great importance and significance. He found that he could learn most from the lazy man!
Most of the chance improvements in human motions that eliminate unnecessary movement and reduce fatigue have been hit upon, Gilbreth thinks, by men who were lazy—so lazy that every needless step counted.”
Another important thing Gilbreth noted was that the so-called expert factory workers are often the most wasteful of their motions and strength. Because of their energy an
a study from 1911 ish lol
I've seen videos of bricklayers where one is on top slapping mortar and grabbing a brick from midair, and the other is at the bottom tossing them up
quite impressive really
I suppose the guy at the bottom not only has to be tireless to throw them up, but he has to be constantly looking up to be sure he's not about to be hit in the head with a brick because the guy up top messed up
if only programming were so straightforward
The interesting thing about this field is that if it becomes routine, we're out of a job
There is a long joke in German, about technology. I try to translate it in short. There was a toothpaste factory where they had the problem that there where a lot of empty boxed delivered to the supermarkets, they where thinking long about how to fix the issue. The Managers decided to buy a expensive machine to weight all boxes, then to raise an alarm and stop the whole process until the empty box is removed. that worked great but after a view days there where no more empty boxes detected
by the expensive machine. The manager checked why and found out that an employee just put a fan before the detector which just blow the empty boxes away so he didn't need to remove the empty boxes by hand.
I heard that. Like the one about the how NASA developed a pen that can be used in outer space spending millions of dollars while Russia used a pencil (while that is true, turns out graphite by the pencil could ruin circuitry)
hehe right
I do wonder if there is basis of fact also for the toothpaste factory one
08:47
You will never find that out, but I guess there is a true aspect
Could be true. That's also probably why these things remain in circulation
If it were just a joke, it'd be buried with the others
if there could be an element of truth, it comes up as anecdotes
09:03
@Neil I guess if we use `getResourceAsStream`, it'll initialize everything defined in properties file. I also need to throw exception if some Mandatory parameters are not present. The use case for this is, we only need to initialize a few properties that are defined as fields in class. The two inner class are actually named `Mandatory` and `Optional` There are fields defined inside Mandatory and Optional. First, we need to check if all the mandatory params are present and if present we initialize it in properties object. Then we go for Optional parameters.
@Shubham if you have particular requirements like this then yeah, I suppose you'd need to make a pass to set the defaults
do you guys know a tutorial
to make a multimodule maven project, including UI
@Neil yes. I need to do something like this:

    // aClass can be either `Consumer.class` or `Producer.class`
    public static Properties initialize(Class aClass, String filename) {

        Properties properties;
        try {

            Configuration configuration = new PropertiesConfiguration(filename);

            properties = ConfigurationSetup.getProperties(aClass.Mandatory.class, configuration, true); // problem with aClass.Mandatory.class
            properties.putAll(ConfigurationSetup.getProperties(Producer.Optional.class, configuration, false)); // problem with aClass.Option
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
    System.out.println(applicationContext.getClass());
}
> class org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApp‌​licationContext
A class name consisting of 7 words. Gotta love Spring :-D
morn
09:11
morn
09:31
@fredoverflow declarative name conventions
I imagine they pulled 5 buzz words from a hat and decided to name the class that way
or maybe they created an AI that generated the name
Zoe
Zoe
10:17
Send help xd I'm installing a 6th console on my system >.>
@fredoverflow classic Jabba
Hi guys I need to modify something when the jsp is loaded
can me suggest some method like onload or something?
.
@fredoverflow i think you already saw this gem, but still: projects.haykranen.nl/java
@Zoe ls console
I only have one console, xbox
10:26
@Doflamingo19 What do you mean with that? jsp pages should be static when returning responses (btw, scriptlets is a no-no nowadays)
Zoe
Zoe
@KarelG CMD, powershell, Git Bash, MinGW, Cygwin, and cmder
cmder is an emulator
ah ok so I use javascript
thanks!
in that situation, you should listen to onload event yes
then do your actions
@Wietlol Oh, I can add as many words as I want. Neat!
10:50
/fatcat
stop sharing my privat pictures
@AndersMetnik ikr ?
Zoe
Zoe
@KarelG and doesn't work :]
11:05
:P
I have WSL with its terminal as well :x
Zoe
Zoe
Doesn't wsl install the entire distro?
depends what you mean with that. But it takes up a half GB of your HDD yes.
that is not much IMO. My laptop came with a 500GB disk
Zoe
Zoe
@KarelG GUI + grub
WSL is only the core btw
no GUI
Zoe
Zoe
Oh ^^"
11:19
It has to be said that it is not useful for most IO operations. I have ps / git-bash for that
it is however useful for remote connections
or scripts that activates other cmd/powershell/node.js/... scripts.
I am fan of the tmux command that you can run in ubuntu
11:32
this perfectly explains my relationship with JS
Zoe
Zoe
@Wietlol clang suggests fixes on typos though
@Wietlol !!shrug
is that not a command?
@Neil !! is C-harp
(Cap)
/shrug
¯\_(ツ)_/¯
that is Jabba
11:38
ah, how could I forget?
This-is-Jabba!
well, that is simple
kicks caprica
/8ball will you forgive me this once?
@Neil Outlook not so good
11:39
completely irrelevant, but ye, Outlook is not so good
i hope you got the 300 reference
/shrug
¯\_(ツ)_/¯
@Neil how can you forget CapricaSix D: Such an awesome woman ( ͡° ͜ʖ ͡°)
!!forget forget
shes awesome indeed
but too smart for her own good
11:39
Tricia Helfer :)
unlike oak..
/8ball Am I right ?
@Hans1984 My sources say no
what sources?
/8ball Do you have any sources ?
@Hans1984 Are you kidding? No!
11:40
@Benjamin2002 Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
wth????
she's also present in Lucifer.
Yet ... that show is not so good. Kinda "okay"
Zoe
Zoe
Lucifer is pretty good :D
yeah, he's a pretty nice guy
I expected more "devilish" behavior from him
Zoe
Zoe
11:42
@Neil and a real devil ;)
yet there are episodes that are really good. I have to admit that
All hail Satan.
anyone likes cryptography here?
let's decipher your question!
Zoe
Zoe
@geisterfurz007 why would we hail you? :p
11:44
so basically i came across a database of bcrypt encrypted passwords
yes... ?
bcrypt is a hashing function based on blowfish.
you want to decrypt it?
yes but there's a salt
yes
Zoe
Zoe
Cool story, thanks for sharing
for example, hashed:salt
`f6kkxc706:$826y4$31226$dNbW2RfjeZ3DbJei4N0WcIc02Z4m1J8h7O7WfR6haM2ecl9Y0zbFo5OvftvjDUsnqKM0gntB5VnsyRW:e79a41b0d48ba27749b70243eb072f54`
f6kkxc706:$826y4$31226$dNbW2RfjeZ3DbJei4N0WcIc02Z4m1J8h7O7WfR6haM2ecl9Y0zbFo5Ov‌​ftvjDUsnqKM0gntB5VnsyRW:e79a41b0d48ba27749b70243eb072f54
11:47
mhh hashed salt
how to brute force this?
Zoe
Zoe
@geisterfurz007 I'm hoping it's not hacked xd
this chat is not about hacking
@Benjamin2002 should that not be salt:hashed ?
f6kkxc706:$826y4$31226$dNbW2RfjeZ3DbJei4N0WcIc02Z4m1J8h7O7WfR6haM2ecl9Y0zbFo5Ov‌‌​​ftvjDUsnqKM0gntB5VnsyRW
11:48
Considering that you didn't provide any info on where you got that stuff from, I'd rather have it that we don't talk about cracking passwords here.
okay, then it'll be this
e79a41b0d48ba27749b70243eb072f54:f6kkxc706:$826y4$31226$dNbW2RfjeZ3DbJei4N0WcIc02Z4m1J8h7O7WfR6haM2ecl9Y0zbFo5Ov‌‌​​ftvjDUsnqKM0gntB5VnsyRW
Zoe
Zoe
^
Looks really shady
well, i just want to know how bcrypt hashes are generated
and i want to know what "rounds" mean
you need to check how bcrypt works.
"How to brute force this?" sounded a little different.
11:51
well, actually i just want to know how it's generated
Zoe
Zoe
Yeah
@Benjamin2002 that's not what you said
like is there a function to generate salted hash in any programming language
> you need to check how bcrypt works.
prepare for a lot maths.
Ok google, how to bcrypt stuff in a programming language
well, knowing how to brute force is basically looping the generation
yeah but I don't get it
there's this weird thing called "rounds"
Zoe
Zoe
11:53
/lmgtfy bcrypt rounds
@Benjamin2002 you probably meant "salt rounds"?
@geisterfurz007 you are getting slow
we need faster bots
11:55
@Wietlol I woke up not even an hour ago.
that is the cost factor because you can configure the cost of doing bcrypt operations. It all depends of your hardware and how much time you want to spend on bcrypting a sentence.
for example, i have "pa$$w0rd" to encrypt with salt "c6ca84d9e858b6"
how do i do it?
it depends of your programming language, but just look for bcrypting on <platform>
since we are in java chat room, I suppose you meant to use it in java
well, how to do it in java?
yes
le google it. Spring has a built in Bcrypt class
12:00
Due to its high value, most gold discovered throughout history is still in circulation. However, it is thought that 80% of the world's gold is still in the ground. (source)
ok thanks!!
Zoe
Zoe
@Wietlol no u
me no
12:16
Another thing @Benjamin2002: I saw you post in SOBotics as well as SO Close Vote Reviewers. Please don't do that. That is essentially the same as tagging a question with 5 big programming languages on the main site only to get maximum attention. This is heavily discouraged.
Zoe
Zoe
^
@OakBot Saying that we've mined 20% of all possible gold in the entire planet is awfully ambitious claim, considering how little of the ground we've actually mined
@Neil Type /help to see all my commands.
12:33
haha
Zoe
Zoe
@Neil Not really
> My commands are also listed here: github.com/JavaChat/OakBot/wiki/Commands
Well clearly the most likely places for gold have been and are actively mined
But this doesn't preclude the possibility that somewhere 5 kilometers under your feet right now is a golden nugget of roughly 5 kilos in weight
it wouldn't be worthwhile to dig it up even if you did know
/8ball Will you mine those remaining 80% and give them to me ?
12:37
@Hans1984 Outlook good
ty
now get to work !
Outlook sucks, Oakbot.. you should try gmail
Zoe
Zoe
Gold isn't a renewable resource though, so there's a limited amount. It's technically possible to calculate how much there's left based on measurements and stuff we already know. 5 kg gold nugget under you doesn't necessarily mean there's more or less, it just means there's a high concentration in a specific place
@Neil Ew, Google.
@Zoe ok, so how could you possibly calculate how much is left? Any calculation of that magnitude is going to be met with some serious inaccuracies
Zoe
Zoe
@Neil I'm not sure about the formulas themselves, but I'm pretty sure they use ground scans along with a general concentration of what's been observed in meteors in the solar system or something like that.
The minerals are a closed system, and there are so few that actually land its relatively easy to monitor any additions
12:48
posted on March 11, 2019

archive - contact - sexy exciting merchandise - search - about ← previousMarch 11th, 2019nextMarch 11th, 2019: DINOSAUR COMICS BOOK ARE ON SUPERSALE! THIS NEVER HAPPENS– Ryan

Zoe
Zoe
@Feeds I. Hate. Dinosaur. Comics. :squint:
I dont like this one
its too specific
@Zoe My idea is that it's fake news :P
A lot of gold hoarders would have you think that gold is about to be all mined
I found this article which would seem to suggest we've only gathered roughtly 0.00047%: westcoastplacer.com/how-much-gold-is-left-on-earth
though a lot of them suggested that we were already about 2/3rds finished mining it all
then, no reason to assume my article is more accurate than other articles
thats a big difference
someones lying big time
yep
though they admit that a lot of it would be hard to impossible to get to
so really in all practical terms, that might be accurate, I don' t know
00:00 - 13:0013:00 - 22:00

« first day (3061 days earlier)      last day (2104 days later) »