« first day (1524 days earlier)      last day (3431 days later) » 

1:37 AM
Ohh
@Michael Der?
 
 
4 hours later…
5:23 AM
Thinks he is the only one who is not enjoying christmas
 
 
2 hours later…
7:00 AM
Good morning, Java!
 
7:27 AM
Merry Christmas, Java!
 
7:45 AM
Oh, right! "Hauskaa joulua!" ;)
 
8:30 AM
Morning
Hyvää joulua!
 
Morning!
 
 
1 hour later…
9:33 AM
10
Q: Does Java reordering affect System.currentTimeMillis()?

Kurtt.LinAccording to Java Memory Model, instructions can be reordered as long as the execution is well-formed. So I wonder, is it possible that the following codes produces the following output? [codes][in a same thread] long a = System.currentTimeMillis(); long b = System.currentTimeMillis(); long c ...

This is pretty interesting
 
That would be an unsafe optimization to do. The jvm is allowed to reorder instructions only as long as the apparent results do not change (within a thread)
 
9:50 AM
Yay 26 hats!! :D
 
10:13 AM
 
10:30 AM
posted on December 25, 2014 by CommitStrip

Enjoy it with this great Christmas music (“O Holy Night”) : Votre navigateur ne supporte pas lélément audio element. CommitStrip wishes you a M3RR1 CHR15TM45

 
10:54 AM
hey hi can any one help me with my client server chat application
hi Jay are you online
 
11:10 AM
@user3194262 No, they're not.
 
11:46 AM
Nooo I lost my consecutive days logged in again Q_Q
 
sigh
Can any non-Eclipse user try out this code for me?
 
I can in a bit
 
Thanks! :)
 
I have developed a LAN client server chat application in java .Now my server also establishes a connection with mysql database which i use to store files of any type.Now my problem is i want to retrieve file from database and be able to transfer that file to the client.Can anyone tell me how can this be done.I know how to retrieve the file from database and i am not understanding how to send it to the client.
 
@user3194262 build and use a protocol
for example, a simple way is to serialize the file into bytes and send the bytes thru streaming
 
12:00 PM
My problem is that i am using sockets in which i have created a class named Message.Now my ObjectOutputStream sends this message to client.
Now when i retrieve the file as a blob i am trying to send it through ObjectOutputStream but it does not work
i hope you have uderstood what i am saying
 
The client side should have an ObjectInputStream to wait for this Message, and then deserialize it when it arrives.
 
which it does
public Message(String type, String sender, String content, String recipient){
this.type = type; this.sender = sender; this.content = content; this.recipient = recipient;
}
 
fge
Moo
 
now when i try to send the file contents it cannot be read
i did try many things
In = new FileInputStream(filepath);
byte[] buffer = new byte[10*1024];
int count;

while((count = In.read(buffer)) >= 0){
Out.write(buffer, 0, count);
}
Out.flush();
 
That's a File. It's definitely not a Socket.
 
12:03 PM
Out stands for
Out = socket.getOutputStream();
 
Eh.
Hiya @Gem and @fge! What do you have in prepared for Christmas!
 
fge
@Unihedro nothing
 
Do you think creating two different streams in the same server will help me
 
@fge Oh.
@user3194262 atob and btoa, why not?
That would contradict with the entire socket usage though.
 
that is what is my main problem
 
12:06 PM
@Unihedro In sweden, christmas is celebrated on christmas eve, so we're done :P
 
@Gemtastic Oh :(
 
Can you suggest something
?
 
11 mins ago, by Unihedro
@user3194262 build and use a protocol
 
@Unihedro Which is also why I lost my login consecutive streak; I forgot to log in yesterday D;
 
like how i dont have alot of experience
 
12:08 PM
@Gemtastic :(
 
hahah lmao
 
@Gemtastic :O
I think you ought to wrap it in an initializer?
 
I copied your text right off
 
12:11 PM
Oh I see...
 
@Gemtastic wow you are quite good a drawing things
 
@Alagaros Thanks
?
 
Why does it work on javap but not in Eclipse' compiler or NetBeans' syntax checker?
 
No clue :S
I don't even know exactly what it's supposed to do...
People, take your pick: 1 or 0?
 
12:15 PM
/tmp/java_xRVYTJ/Foo.java:15: warning: [unchecked] Possible heap pollution from parameterized vararg type T
  void accept(T... T);
                   ^
  where T is a type-variable:
    T extends Object declared in interface MultiConsumer
/tmp/java_xRVYTJ/Foo.java:21: error: incompatible types: incompatible parameter types in lambda expression
        c = (a, b, d)->{
            ^
1 error
1 warning
Oh...
@Gemtastic 1!
 
In other words, it compiles but wont run
 
fge
@Unihedro varargs in a @FunctionalInterface? You like playing risky games
 
@Unihedro then two it is!
 
@fge :D
@fge I need a FunctionalInterface that takes either four, or five, or six arguments. Should I overload instead?
 
fge
Yeah, that'd be better
 
12:16 PM
 
fge
Argh
nulls
slap
 
if(christmas){
    holidayGreering = "Merry Christmas!";
}else if(hannuka || kwanza){
    holidayGreeting = "Happy Holidays";
}else{
    holidayGreeting = "Hope you're having as great a day as I am!";
}
 
Maybe I should have made a switch for that...
 
12:25 PM
@Gemtastic I'm also having a great day [at work] :P
 
@OlegKuznetsov Well, that could be fun too :P
 
@Gemtastic ...And [almost] everyone are gone for corporate celebration. So, I'm alone in the room (and there is only one other co-worker on the floor) :P
 
fge
@Gemtastic locale dependent?
Heh, 3rd gold medal
 
Lonely christmas over here as well, no one is at the Tavern, just reports of spam posts
 
@fge More like depending on a) if you like christmas at all; if you don't it might be nice to hide at work, but I was mostly thinking about b) The occupation itself. If you love your job it can be fun to be at work :P
 
12:32 PM
 
@OlegKuznetsov in other words; SO time!
 
@fge pls suggest
17 mins ago, by Unihedro
@fge I need a FunctionalInterface that takes either four, or five, or six arguments. Should I overload instead?
better?
 
fge
@Unihedro I feel the problem is elsewhere in the design
 
@fge Hmm.
 
fge
12:38 PM
Not sure what you are trying to do but given the names of your variables it looks like some sort of game or something
Anyway
<-- finishing first version of throwing-lambdas
 
:D
 
fge
@Unihedro thanks for the idea of extending the interfaces, it is an excellent one
 
@fge You're welcome, I'm glad to have helped!
 
fge
In the end, because of potential signature conflicts, I have to create classes Functions, Operators and others
Bah
Counting the interfaces, there are more than 50 in total
Weee
 
@fge :O
 
fge
12:55 PM
Well, someone has to do it, right?
 
May I ask, @fge?
For example, given a method signature:
public ThrowingSupplier<ChatMessage> createUnsafeChatMessageFactory(Supplier<ChatMessage> factory, ThrowingConsumer<Factory> acceptor);
How should I document "The supplier will throw a ThrownByLambdaException when ThrowingConsumer throws a ThrownByLambdaException"?
Eh.
It's hard to document this thing. xD
 
fge
Why not just @see ThrowingSupplier?
 
:O
This idea is A++.
 
fge
1:11 PM
Using throwing-lambdas?
Or rolling up your own? :p
 
@fge Using throwing-lambdas :)
It works perfectly for the internal data exchange of https://github.com/Vincentyification/JChatExchange, so I guess I'm going to use it a lot, it's very handy; Thanks again! :)
 
fge
@Unihedro beware that it is changing right now though
 
:O implementation-wise or API-wise?
 
fge
I mean, I have redistributed
Well, I implement your idea, API-wise it won't change
But the Rethrow class has been replaced
Most of it
 
1:26 PM
Oh! Gotcha :)
 
fge
You're cited ;)
Also, I've added a note about Serializable
 
LOL, it sucks
Serialization: The worst of every language feature ever implemented to every single language out there
 
fge
I'm not making this up
 
@fge Thanks for the credit, though you did most of the work to get all this wired together, you're still the best :)
 
fge
Just listen to the video :p
 
1:32 PM
Is it true that a method with no arguments are called "arity method"?
 
fge
Well, "arity" is the vocable used to tell the number of arguments
So, with no arguments, that would be a "zero-arity" method
 
:D
 
I get all giggly when I think about all the things I could learn to do now. :3
 
fge
@Gemtastic warning, you're slowly turning into a nerd
 
LOL
 
1:49 PM
Zero-arity???
 
@Bohemian Zero-arity!!!
 
what the???
 
Suppliers are zero-arity: () -> {
// returns stuff
}
 
Never seen/heard that term
 
It stands for a function / method / procedure with no arguments. (I think.)
 
fge
1:55 PM
Hello @Bohemian
 
I'm going away for a few mins, cos chat on mobile device is basically impossible. The full site version is unusable and the mobile version lacks many features
 
fge
@Unihedro mind giving me a hand to convert the existing stuff? I'm into Consumers
 
@Bohemian Ah, no worries, see ya around!
@fge Ok! :)
 
fge
After all is converted, there will be To*Functions to do
shiver
@Unihedro you could do Predicates for instance
Well, that is, if you are ready to help
 
I can fork the repo and then re-clone it, I suppose? Is the version I have outdated?
Yeah, it is.
AAAQAaaaarrRGGGHHHH eclipse why
brrr
I'm going to stab myself before this works, so I'm just going to switch to Ace until Eclipse wants to behave.
 
2:12 PM
Do I destroy the *Predicate<T> from Rethrow and move them into a utility Predicates class? // cc @fge
 
fge
@Unihedro yup
Do this after you have done the tests though
 
com.github.fge.lambdas.Predicates or com.github.fge.lambdas.predicates.Predicates?
 
fge
Yessir
 
But... which?
 
fge
I'm done with Consumers, doing Suppliers now
 
2:15 PM
@fge ok
 
fge
Oh, the file exists already
I mean, the Predicates class
 
I can't find it:
 
fge
Yup, you should pull --rebase
(from my remote)
 
oic
Cool!
Git stash rules!
No coding standards? Wrap like you are wrapping at 80 characters I suppose?
 
fge
Yes, 80
No tabs
 
2:28 PM
Tabs suck, all linux users are using spaces to indent
 
fge
Well, not the Linux Kernel coders ;)
OK, done with Supplier
Weee
Now, To*Functions, since you're doing Predicates ;)
 
Um... I suppose I just have to change the left to look like the right, right?
 
fge
When all interfaces are done I'll look into getting rid of mockito... After all it does not really help
Yes -- also, of course, watch that you change the import static
(of rethrow)
 
Aha!
 
fge
pull --rebase!
After you're done with that, the Rethrow class can go
(I think)
 
2:37 PM
@fge I love every second of my transformation ;)
 
Eh, merge conflict.
Stash FTW
 
fge
Hmmm
I wonder about defining other exceptions, like ThrownByLambdaFunctionException etc extending ThrownByLambdaException... But that's for later
The thing is, if you do that you may be able to capture exceptions thrown by specific lambdas, which could be nice
Meh, later
 
Hmm, would it be overkill to specify a specific exception to catch?
SpecificThrowableThrowingFunction<T, U, EX extends Throwable>
 
fge
Uh
I was sort of thinking about something along those lines, but using something like rethrow(f).as(SomeException.class)
 
Hey, that's an incredible idea!
 
fge
2:46 PM
But that would be another set of rethrow methods
 
... Uh, yeah. xD
 
fge
Right now though, we need to finish all interfaces and there's still work to do!
;)
I do want to implement that, mind
Along with tryAnd(f).orReturn(defaultValue)
Meh, plenty of ideas, too little time
 
I have a problem - how to sync your repo with my fork?
 
In this code, how it ensures thread safety?
as mentioned Since the line private static final Foo INSTANCE = new Foo(); is only executed when the class FooLoader is actually used, this takes care of the lazy instantiation, and is it guaranteed to be thread safe.
 
fge
@Unihedro first things first -- do you work on a branch?
 
2:49 PM
@fge It's brand new
My IDE project is cloned from your repository, but I need to update my repository so I can push to mine, then I can PR
Actually, YOLO, deleted it and re-forked.
 
fge
Well, in these situations, what I do is work on a branch, git fetch --all, git rebase upstream/master, and when I'm done with the branch I checkout master and merge --ff-only upstream/master
Then I push --all
 
Gotcha!
I should had done that.
I'll bear in mind next time.
 

« first day (1524 days earlier)      last day (3431 days later) »