« first day (1555 days earlier)      last day (3387 days later) » 
00:00 - 16:0016:00 - 00:00

fge
12:20 AM
ponders an answer
Testable code rocks
Now, I wonder about integration tests
 
 
2 hours later…
1:55 AM
Assuming java.util.concurrent.TimeUnit is imported. What is the difference between calling TimeUnit.SECONDS directly vs making a TimeUnit object (e.g. TimeUnit tm = new TimeUnit) and doing tm.SECONDS? Nothing special about the TimeUnit class, just using it as an example.
 
@ita you around?
 
fge
@Richard you can't build a TimeUnit since it's an enum
 
@fge got it. That was just an example, and apparently a poor one. I am actually doing repeated calls from the TrafficStats API in Android. I am wondering if I should instantiate an object (e.g. TrafficStats ts = new TrafficStats), or just do TrafficStats.foo().
 
Fev
2:11 AM
hi guys..
good morning, how are you??
 
fge
@Richard sorry, I don't do Android so I can't help
 
Morning fev
 
Fev
hi gemtastic
 
Fev
2:49 AM
why so quite.... tehehe
helow
 
3:03 AM
I'm busy coding
And I'm reallly going out on a limb here :P
 
Fev
^ first time i saw the picture I LOL
 
Ah, the moment when you're so stressed about what you're working on that you suddenly have all the inspiration and motivation you need, to do something ENTIRELY different XD
 
Fev
do you like watching some cartoons/anime ?, please watch this youtube.com/watch?v=kohraW3rj3M
 
I don't have the time D;
 
3:38 AM
@gem ?
 
Yes :)
I'm getting "HTTP Status 405 - Request method 'POST' not supported" messages D;
 
Lol
The same ajax call?
 
It's jsut a form, how hard can it be? D;
 
Forms are super duper easy
 
Here's the code: pastebin.com/eDfmtWtu
I do realize there's an issue in that the data is form.serialize() and the requestparam is message
I don't know what to put there instead of message D;
 
3:48 AM
Using ajax to submit form?
o_O
:-!
 
I want to use JS
Because I HAVE to use JS >_>
(course requirement)
@ItachiUchiha Why is it bad btw?
 
It is not bad
Are you not navigating when you are submitting the form?
Navigating to a new page*
 
No I'm not. I want there to be a little message in the P tag though saying the message was sent
 
Why have you added a form?
 
Because I need one
    @RequestMapping(value="/contact/sendmessage", method = RequestMethod.POST)
    public ModelAndView recieveMessage(@RequestParam("name") String name,
                                @RequestParam("email") String email,
                                @RequestParam("orderno") String orderno,
                                @RequestParam("message") String message){
        ModelAndView model = new ModelAndView();
//        String model = "Your sent your";
        System.out.println(message);
        return model;
That code also gives me method not allowed :/
 
4:01 AM
Tip1 : when you have multiple RequestParam, create a Model and use @ModelAttribute on it
 
I have a model for the messages
What does it look like when you apply the @ModelAttribute to that?
 
receiveMessage(@ModelAttribute Message message) {}
^^ this is it
 
Wait, I see it now
Why do I still get "Request method 'POST' not supported"? :(
 
what up guys?
does anyone know what a 2 way edge means in terms of a graph?
 
I think I fixed it! :D
@Ita how do I return anything else than a ModelAndView?
 
4:18 AM
What do you want to return?
 
Anything really, but mostly I want to return something that fires the success functions in my code.
"success": function(data){
    $("#msgSendingSuccess").append(data + "sent!");
^ That never prints
 
lolz
 
This will print, but only the "not added to cart" even though the post was a success:
function addedToCart(data){
    if(data.success){
        console.log("Added to cart!");
    } else{
        console.log("Not added to cart.");
    }
 
You don't need a ModelAndView, because you are not propagating to a new page
Let me find you a link where you can find what can be the return types of a controller method
 
Thanks ^^
 
Interesting
I wonder what will be best in my case...
 
You tell me ;)
@Smrita Working on a lazy sunday?
 
Well, I just want something to be returned so that the success functions work
 
@ItachiUchiha At my offoce
hey everyone
anyways isnot @fge online
had to ask him something related to gradle
 
Hello @Smrita
 
4:33 AM
hey @Gemtastic
:)
Happy sunday @ItachiUchiha and @Gemtastic :)
 
@Smrita People working on sunday zzzzzz
 
It will be a happy one once I figured how to get the response to work >_>
Because then i'm done
 
@Gemtastic Now read description and tell me what suits your need
 
A string?
 
yesh i dont have sundyas off
in my offivce
anyways just a quiock question
I am trying to make a multi module gradle projectr
My projects have A,B,C as the modules
 
4:36 AM
@Gemtastic yes yes yes
 
A is dependent on B
 
but, when you send a String Spring thinks it is a view
 
so I tried adding B on A as b\follows in my build.gradle file
compile project(":B")
 
> A String value that is interpreted as the logical view name
 
do you all know gradle?
 
4:37 AM
@Smrita not me
 
@ItachiUchiha So since my view document is called contact_us.html I'll put "contact_us" as the string?
 
I am just a newbie
 
I don't know gradle either I'm afraid :/
 
okay then have a great day
 
@Gemtastic yes, but we don't want to return a view here
@Smrita same to you
 
4:39 AM
@ItachiUchiha But I can't put anything as the string, can I?
 
what's a 2 way edge?
same thing as undirected graph?
?
 
@gem ok let me just answer you, so that you can get over with ir
 
Yes please
 
you can return a String, but just use @ResponseBody on the method
 
Above @RequestMapping?
 
4:45 AM
above-below, it doesn't matter
 
Hm.. It gives me a new page anyway, only the new page ONLY contains the string...
 
what is the url of the new page?
 
the exact same
LillaKammaren/contact
 
show me your ajax request again
 
$(function(){
    $("#contactMessage").on('Submit', function(e){
        alert("You clicked the button");
        var form = $("#contactMessage");
        e.preventDefault();

        $.ajax({
            "type": "POST",
            "url": "/LillaKammaren/contact",
            "data": form.serialize(),
            "success": function(data){
                $("#msgSendingSuccess").append(data + "sent!");
            }
        });
    });
});
 
4:53 AM
can you add this inside success

alert("Data: " + data );
@gem you should use $.post instead of $.ajax, it is shorter and more precise
 
Will it have any difference on my problem?
 
nope
try alert
I want to see what is returned
 
The alert window isn't triggered
 
strange
 
Yeah :/
 
4:58 AM
let me try your project on my machine
 
Wait, I'll update the repository
 
ahh
ok
 
Ok, done :)
 
Eclipse sucks :/
 
YEah
I also noticed that the alert that should appear when you click "submit" isn't firing either
 
5:19 AM
@ita the shop.js code works perfectly
But not the contact.js one :/
 
@gem I am still trying to run the project zz
 
You can't get it to run?
 
fixed, its up :)
 
It's up?
What did you fix?
 
5:38 AM
Not your issue :P
 
What was your issue? Something I need to look into?
 
Nope
 
Good ^^
 
I am not sure what is the problem with Ajax
Will need some time to dig into the issue
My web knowledge is already rusted :P
 
Go ahead, I'll try to finish off other things in the meantime
I'm currently looking into how to remove the content of a div after a few seconds :P
 
5:51 AM
I will get back to you later
cya
 
@ItachiUchiha Ok. Thank you for helping me
 
 
1 hour later…
6:57 AM
Morning!
 
Morning Uni
 
BRS
Good morning All
 
:D
 
BRS
Is connection pooling enabled for one particular schema(collection of tables, views) or on a port, server basis?
Or in other terms can we set up a pool of connections for mysql running at port 3306, which has around 10 schemas?
 
@BRS Not for MySQL I don't think, it's too crappy to support that
 
BRS
7:06 AM
Okay. But is it possible like that?
Whenever I pool, I use jdbc:mysql://localhost:3306/sampledata something like this to pool.
So, I was wondering if it were possible to pool connections for jdbc:mysql://localhost:3306 or something similar
 
This is getting pretty frustrating >_>
 
7:23 AM
@Ita I solved it! DANG that feels good!
 
gZ
 
Fev
hi everyone
@Unihedro@Gemtastic
 
Hello again Fev :)
 
@Fev ?
hello
 
Fev
oh hi unihedro
is my picture shown ??
I can't any pictures in this site, including the ones on my answers
my ISP is blocking i.stack.imgur.com
it's been about 3 months
 
7:36 AM
Why is your ISP blocking imgur?
 
Fev
don't know for sure, but i can see pictures that are not linked to the site
but it's not a big problem I think, I just have to change my provider
@Unihedro, youtube.com/watch?v=kohraW3rj3M , watch it , it's funny
 
Can't, I'm busy :P
sorry
 
Fev
ha? are working in sunday?
you can watch it later
 
8:35 AM
What's an efficient way to convert an integer array into a String format of a b c... without the brackets and commas from Arrays.toString()?
 
Is there a room for apache kafka on SO?
 
fge
9:05 AM
Moo
@Unihedro integer to letters? Are those code points?
 
@fge no, just {1, 2, 3} -> "1 2 3"
I could use a foreach loop and write it to a stringbuffer, but I get an extra space in the end
 
fge
Well, use String.join()
 
And String.format does not have a parameter flag for varargs
Oh!
 
fge
=javadoc String#join(*)
 
Which one do you mean? (type the number)
1. java.lang.String#join(CharSequence, CharSequence[])
2. java.lang.String#join(CharSequence, Iterable)
 
fge
9:07 AM
1
 
@fge String join(CharSequence delimiter, CharSequence[] elements): Returns a new String composed of copies of the CharSequence elements joined together with a copy of the specified delimiter. For example, (1/3)
 
> Cannot resolve method 'join(java.lang.String, int[])'
String.join(" ", Arrays.stream(val).mapToObj(Integer::toString).collect(Collectors.toList()));
 
fge
There's much more simple
=javadoc Collectors#joining(CharSequence)
 
@fge Collector joining(CharSequence delimiter): Returns a Collector that concatenates the input elements, separated by the specified delimiter, in encounter order.
 
fge
Heh, I just discovered that
So, Arrays.stream(yourArray).mapToObj(String::valueOf).collect(Collectors.joining(", ))
(minus the compile error)
 
9:13 AM
String::valueOf? Not Integer::toString?
 
fge
Uh, they're equivalent, I guess
Question of choice ;);
 
:P
Yeah, String.valueOf(int) calls Integer.toString(int).
Thanks so much!
 
fge
np :)
I thought you knew about those already, to be honest -- at least about String.join()
If not Java 8, then Guava and Joiner
 
@fge Well, I thought about it, saw the method signature, quietly sighed and looked at other utility methods.
@fge I really need to read all of guava manual sometime. :P
 
fge
Why? Just have a tab with their javadoc
Their class names make sense, so a quick text search is very often enough
They also have Splitter
Which is MUCH faster than Pattern's .split()
(when you don't split against a regex)
 
9:24 AM
Does .split() still come with a fastpath?
 
fge
Well, not really, Splitter uses static factory methods
Therefore the implementation differs whether you split on a char, a CharSequence...
See here
 
 
3 hours later…
12:51 PM
class Wrapper
{
    private Object obj;

    public void set(Object obj)
    {
        this.obj = obj;
    }

    // Is toString a recursive method?
    public String toString()
    {
        return obj.toString();
    }
}
It's impossible to tell at compile-time whether this will cause a stack overflow.
Is it still fair to say that it's a recursive method, no matter what?
 
user1804599
@FredOverflow TCO! Oh wait JVM lol.
 
@FredOverflow It may be a recursive call, but the method isn't recursive.
 
fge
@FredOverflow it will be recursive if you delegate to self, sure
 
There's even an XKCD comic like this.
 
@fge What if I delegate to a second Wrapper?
 
fge
1:01 PM
Well, you can procrastinate infinitely like this :p
Anyway, in this case...
=javadoc MoreObjects#toStringHelper(Class)
 
@fge ToStringHelper toStringHelper(Class clazz): Creates an instance of ToStringHelper in the same manner as #toStringHelper(Object), but using the simple name of clazz instead of using an instance's Object#getClass(). (1/2)
 
fge
^^^^
Use that and don't ask yourself useless questions :p
 
ArrayList<Object> stuff = new ArrayList<>();
stuff.add(stuff);
System.out.println(stuff.contains(stuff));
System.out.println(stuff);
System.out.println(stuff.toString().hashCode());
System.out.println(stuff.hashCode());
This is hilarious.
true
[(this Collection)]
-1880645817
Exception in thread "main" java.lang.StackOverflowError
 
ArrayList holding itself? Mad.
 
1:08 PM
this is.... MADNESS!
@Unihedro did you already see the PR I opened?
 
Yeah, I got an email for it.
 
fge
@FredOverflow this is not hilarious; this is a plain stupid thing to do, full stop
 
@Unihedro I have some more commits in stash... but I'd prefer to have them run as a separate PR...
so I suggest we handle Michael's PR quickly
then go Over yours
and I'll just adapt my stuff to properly merge
holy shit I am a jerk!
I just reset my branch tag to a earlier commit manually...
 
@Vog: I like that idea.
Also, are we close to deploying? I might actually have some time on wednesday to put the bot onto the cloud.
 
Actually we should be ready to deploy anytime
updating it might be a hassle, though
or maybe not. depending on how you want to go about the configuration
 
1:14 PM
@fge Are you saying fun is stupid? :(
 
in theory it should be possible to deploy anytime
2
 
k
 
emphasis on "in theory"
 
fge
@FredOverflow well, I guess we don't have the same vision of what is "fun" :p I'm the serious type when it comes to code
@Vogel612 git reflog
 
ya kinda
just with manually messing with the branch head
or is there a cool command to set a branch to a commit earlier in that very same branch?
 
1:20 PM
rebase to throw away a segment?
 
how would you do that @Unihedro?
I know rebase only as a tool to create a singular history
 
fge
@Vogel612 git reset --hard <refspec>
 
facedesk
 
fge
Remove the --hard if you don't want to scrap your working tree (so that you can stash your changes or whatever)
Note that the refspec can also be one taken from the reflog, too
 
I keep my changes in a newly created local-only branch
source-tree is cool enough to show me the full hash when I want it ;)
 
Good morning, Java!
 
Good Morning Michael
 
Morning @Vogel
 
Morning, @Michael!
 
Morning @Uni
 
1:46 PM
You still want to do some changes in your PR?
 
Yeah, let me give it one more look.
How does it look to you?
 
Well as mentioned the methods in JavaDocAccessor could use some extractions for better abstraction
other than that. recommending merge
 
@Vogel612 Hmm yeah.
 
fge
<-- wonders why JavaFX hasn't defined ObservableValue<T> utility methods taking a Function<? super S, ? extends T> as an argument
 
2:06 PM
@Vogel612 Ok, take a look at it now.
I'm ready to merge when you are.
 
any last words @Uni ?
 
@Vogel612 Man bitcoins are amazing
 
I guess that's a yes then
 
Wait, what do you mean?
 
Michael's PR
 
2:17 PM
Oh, let's merge it!
 
done
 
\o/
 
your PR can still be automatically merged
but there's some open comments
 
@Vogel612 Open comments?
 
@Michael your stuff is merged.. Uni's isn't
 
2:22 PM
Ah, ok.
@Vogel Oh, btw, the new Javadoc ZIP files can get downloaded from here: dropbox.com/sh/xkf7kua3hzd8xvo/AAC1sOkVTNUE2MKPAXTm28bna?dl=0
 
"new"?
did you change something again?
 
I completely changed the way that the Javadoc information is encoded (part of the merge).
Previously, it was just a ZIP of the Javadoc HTML files.
Now, it is a ZIP of a collection of XML files that are generated by a custom doclet.
Much less error-prone.
The ZIP file size is also significantly smaller.
 
Morning!
 
fge
Hehe
All of this without even building a parse tree
All from parsing events
 
Morning @Gem
Looks really good, @fge
 
2:28 PM
I'm a bad programmer. I couldn't stay awake until I've fixed the problem D;
 
fge
@Michael and that's only the parse tree :p
 
@fge Does it make coffee too? xD
 
fge
It could
Heh
 
@Gemtastic Whats your problem?
 
fge
Just plug the appropriate listeners into the parser, listeners which drive a coffee machine :p
 
2:29 PM
xD
 
fge
@Michael your grammar still lies in a corner of my mind and I'll write it, I swear
 
@Michael When I went to bed I was so tired I couldn't even identify it, but the problem is that a request method never is launched. I'm guessing it's because the method is named the same as a method inside of a bean, but I'm not sure
 
fge
@Gemtastic then have you tried and changed the name of the method?
 
@fge It won't be easy.
 
fge
@Michael I know it ;)
But that's the advantage: it's Java code
 
2:32 PM
@fge That's what I just did :P
 
fge
Therefore anything you can do in Java you can do in a parser
 
@Gemtastic Maybe it's been overridden by another method with the same name?
 
I haven't run it yet
 
fge
2:47 PM
All of this with Thread.setUncaughtExceptionHandler() :p
==javadoc Thread#setUncaughtExceptionHandler(*)
 
@fge I don't know that command. o_O
 
fge
=javadoc Thread#setUncaughtExceptionHandler(*)
 
@fge void setUncaughtExceptionHandler(UncaughtExceptionHandler eh): Set the handler invoked when this thread abruptly terminates due to an uncaught exception. (1/2)
 
@fge Hmm might want to implement that.
 
fge
@Michael I did it with JavaFX, not sure it works with Swing if that's what you mean
With JavaFX I can point you to the code
 
2:52 PM
No, I mean typing a number to see the next paragraph.
Right now, you have to do this:
=javadoc Thread#setUncaughtExceptionHandler(*) 2
 
@Michael A thread can take full control of how it responds to uncaught exceptions by having its uncaught exception handler explicitly set. If no such handler is set then the thread's ThreadGroup object acts as its handler. (2/2)
 
fge
@Michael that would make your javadoc command stateful
 
Well, it's stateful already when a list of choices are presented. For example:
=javadoc list
 
Which one do you mean? (type the number)
1. java.awt.List
2. java.util.List
 
1
 
fge
2:53 PM
Ah, yes
 
@Michael java.awt.List: The List component presents the user with a scrolling list of text items. The list can be set up so that the user can choose either one item or multiple items. (1/10)
 
Or maybe say "next" to see the next paragraph.
And "all" to see all of them.
 
Hmm
 
3:11 PM
Woow... I'm so glad I went to bed instead of keeping on grinding this; I never would have found the problem; a typo in the success method :')
 
o_o
 
3:22 PM
Indeed
You'd think that method just wouldn't run... but nope.
Now I know what the highlight will be when it's misspelled though
Wow, I was really stupid last night >_>
 
3:51 PM
Bye all :)
 
fge
In JavaFX, in a combo box, is it possible to preselect an item?
=javadoc BaseEncoding
 
@fge com.google.common.io.BaseEncoding: A binary encoding scheme for reversibly translating between byte sequences and printable ASCII strings. This class includes several constants for encoding schemes specified by RFC 4648. For example, the expression: (1/12)
 
fge
^^^ use this for all of your Base* needs
 
All your base r belong to us
 
@gem what was the issue?
 
3:59 PM
@ItachiUchiha The server method wouldn't run
 
@fge combo.getSelectedItem().select(item):
 
Now I have the issue of that the alert in the JS file isn't displaying åäö :(
 
@gem server method wouldn't run?
 
Anyone knows how to fix that?
 
00:00 - 16:0016:00 - 00:00

« first day (1555 days earlier)      last day (3387 days later) »