« first day (1375 days earlier)      last day (3569 days later) » 

12:42 AM
Anyone can help me out with this question :stackoverflow.com/questions/24998949/… ?
 
1:42 AM
So ... this is going to seem random but has anyone ever heard a Demonym/Nickname for Java programmers? (as in Dr. Who fans are Whovians, Indiana Natives are Hoosiers, et cetera)
 
2:12 AM
@yazjisuhail: Try pasting the url all by itself:
0
Q: Convert a Piecewise Polynomial Function into a Single Expression/Model

yazjisuhailBriefing Suppose we had a continuous piecewise polynomial, how can we express it with a single equation or formula, through any programming language (preferably Java)? In pure mathematics, I've found that it's possible to express the function in terms of an integral or a Heaviside step function...

 
@aliteralmind is that what you meant?
 
 
4 hours later…
6:07 AM
Someone should considering adding owners to the room, who are spending worth while time in the room @TheLittleNaruto
 
Michael does join us sometimes, and it's not like we need to risk getting xkcd what-ifs into our feeds, so choose a person wisely:
 
Sam has been automatically appointed as the owner of the room ?
wtf ?
is he a moderator ?
 

The SO Tavern (Free Snacks)

Room 5 was frozen for inactivity even though it was once an ac...
The room owners were inactive.
 
ahh, i see
 
Lol so many owners of this room.
 
6:11 AM
yeah
 
And even- Jon Skeet?!
 
still no-one really comes to the room
Bozho as well
Seriously all Java people are very professional
java being so popular, was still the 139th room
 
Yeah.
 
where as android was 15th

Android

Sometimes we even talk about Android. Please read the rules (r...
 
Some learners would come to ask questions, but usually not enough people on to give an expansive answer.
 
6:13 AM
Sometimes I feel, all the people like java are fake !
:P :P
 
Sometimes I feel like all users on the internet are fake. :P
 
I don't even understand the Definition of the room
Holy cow! It's Java! --- Our new mascot ;) i.imgur.com/XF6v1Zr.jpg
wtf is it ?>?
 
It used to be "Discussion on the world's best programming language".
The mascot named Java:
 
Is the bird named JAVA ?
 
Yes, so the title of the room actually refers to the bird, not the programming language.
 
6:16 AM
wtf ?
really ?
Seriously people don't love java anymore. I am heart-broken ! </3
 
But you can still discuss about Java, the programming language, since we have the room tags.
Hey I still do, at least I'm safe from BSODs
 
how is java related to BSOD ?
 
The Java VM handles everything so nicely, you will never get BSODs... but in some low level languages bad code style leads to the computer crash.
 
Shouldn't this room be flagged ?

Java Sucks!

JavaScript Sucks!
 
That room has no followers though.
 
6:20 AM
yeah, but still its against SO policies
 
I found a music video related to Java:
 
Anyone here can answer my question?
 
@yazjisuhail I saw your question a while ago, but I'm not that good with maths. Still, +1, hopefully someone capable of solving it will see it.
 
@Unihedron Thank you
 
6:26 AM
The coefficients are constants?
@ItachiUchiha lol too many references, i'm lost
 
@Unihedron if the question is for me, I didn't get it :P You mean the coefficients of each piecewise function?
 
@yazjisuhail Eh, you might want c * x instead of cx in your code block for "value(double)".
 
@Unihedron fixed it. sorry man and thank you for the the smart notice
@Unihedron are you good with math java libraries, or also not that well?
 
I know the basics, like clamp, but I don't work with them a lot. I might not have any useful input on your question though, sorry.
 
@Unihedron no worries at all. Loads of Thanks
 
6:59 AM
Oh nice, in Java there are cross classes in regex, so [a-g&&[^bc]] actually is a special syntax, and works like you'd expect: match from a to g except b or c.
 
7:11 AM
@Kylar What's the 4th lesson? I've been waiting for a year!...
 
7:46 AM
rules!
40 secs ago, by Unihedron
37 secs ago, by Unihedron
34 secs ago, by Unihedron
30 secs ago, by Unihedron
in Java Sucks, 23 secs ago, by Unihedron
rules!
 
woah
 
user1804599
8:26 AM
1 message moved from Java Sucks
 
9:34 AM
Love what he says about Java xD
 
 
3 hours later…
12:05 PM
 
 
1 hour later…
Fev
1:28 PM
helloww
 
@Fev Oh hallo!
 
Fev
oi dude how are yow.., btw where is that sinchan..
@Unihedron, do you find something interesting to read ? :D
i'm hungry for knowledge ..
 
I'm trying to optimize zx81's regexes.
btw I got Cupcake's autograph! :D
 
Fev
nice.
 
Fev
1:41 PM
yahahaha
 
2:06 PM
some guy ask me why the HashMap become slow when too many keys have a same value(one object)? I wonder also.
 
Why would that be, @jesse ?
It would make sense to me that too many keys in a HashMap slows it down anyway...
 
@Unihedron I search that, but I do not find any reference. so I come here
@Unihedron no, the key point is some keys have same value
 
@jesse I'm clueless on that but I'd like to know why as well, I'm not able to find an relevant questions on SO. Maybe you can post a question.
 
OK, I will find first then I will post a question.
 
Thanks. Do remember the pre-question checklist.
247
Q: Stack Overflow question checklist

Jon SkeetMy earlier blog post on how to write a good question is pretty long, and I suspect that even when I refer people to it, often they don't bother reading it. So here's a short list of questions to check after you've written a question (and to think about before you write the question): Have you d...

 
2:12 PM
@Unihedron ok
 
@jesse You live in Shang Hai in China?
 
@Unihedron yes.
 
Good morning.
 
@aliteralmind Good morning!
 
Nice cupcake.
 
2:42 PM
@Unihedron I wasn't saying he was correct at all. I just said I loved what he said. I found it funny.
 
Laugh out loud zebras
 
I think I got the wrong meaning
 
in The SO Tavern (General), 1 hour ago, by Unihedron
I'm still new to Stack Overflow - Only been here for 2 months :o
 
`package test;

import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

class HashTest{

private int haskKey;
public final int getHaskKey() {
return haskKey;
}
public final void setHaskKey(int haskKey) {
this.haskKey = haskKey;
}
public final String getValue() {
return value;
}
public final void setValue(String value) {
this.value = value;
}
private String value;
/* @Override
public int hashCode() {
return new Integer(haskKey).hashCode();
}*/
@Override
 
2:46 PM
@Fev I remember you Fev.
@jesse use pastie or pastebin
 
if remove the hashcode(), the hashmap will become fast
 
@jesse [link]
 
@Unihedron ok
package test;

import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

class HashTest{

	private int haskKey;
	public final int getHaskKey() {
		return haskKey;
	}
	public final void setHaskKey(int haskKey) {
		this.haskKey = haskKey;
	}
	public final String getValue() {
		return value;
	}
	public final void setValue(String value) {
		this.value = value;
	}
	private String value;
/*	@Override
	public int hashCode() {
		return new Integer(haskKey).hashCode();
 
why date and not System.nanoTime()?
 
I was fool this afternoon...
 
2:50 PM
Eh, hold on, I'll play around with your code.
 
@Unihedron it is just a simple test.
just a small knowledge, if using a class as key of hashmap, be careful to override the hashcode() method.
 
I'm not sure what conclusion I can make from this since there's no control set up for this experiment, but here's my stdout
 
@Unihedron You saw the new version?
 
@aliteralmind Nope, it launched? I'll check it out!
 
18 hours ago, by aliteralmind
@Unihedron Codelet 0.1.3 now allows environment variables in {@.file.textlet} tags, and also auto-changes any '/' characters in relative paths to the proper file-separator for the underlying OS. Absolute paths are unchanged. :)
 
2:58 PM
sorry, you may remove`System.out.println(valueString);`
 
I think the '/' solution will be okay. They can still be left as \ or : if they want.
But it's a cool new feature you thought of. :)
 
Whoops. I saw it when I was half awake lol so I didn't pay attention. So $<var> and use / for Codelet to auto-adjust?
 
time to sleep, good night:)
 
@jesse Good night!
 
Fev
good night, eat well ,sleep well
 
3:00 PM
Yes.
@jesse Hello and goodbye :)
 
You say hello! I say goodbye!
I don't know why you say hello! I say goodbye!
-ahem- well done! That's amazing! :D
 
Fev
@Unihedron , it means human is unique
 
Fev
they are different with each other
 
It's a beatles reference- there!
Hi @絶対領域! Ah never mind - sadly he does not have enough reputation to respond. :(
 
3:04 PM
I never typed non english letters before!
 
I tabbed it in. You'd think that me living in Hong Kong means I'd have at least some experience with inputting Chinese characters, but meh.
 
@Unihedron If that's meant for me: Thanks :)
 
 
1 hour later…
4:22 PM
who's with the what now
 
Gah
java.io.StreamCorruptedException: invalid type code: 00... Google is not helping me figure out what this means
 
can you be more specific? What are you reading, what kind of stream, etc
it usually means that you're reading data in a format that is legitimately "corrupt" for the stream you're using
ie: if it's an ObjectStream of some kind, you're sending data that is not properly marshalled
 
I'm sending stuff over an ObjectInput/OutputStream pair...
sockets
 
Well let's see then.. Are you reading from it using multiple threads?
Or are you reading the wrong object
Can you make a short, self contained example that has this issue and post it on pastebin
 
one sec, I'm going to add some breakpoints in and watch where it's sending/reading the packet to see if i can find the issue
 
4:30 PM
Good luck to both of you! I'm going to sleep now. Farewell!
 
Night
 
i think i might know why
I'm hitting it with too many packets at once .--.
1 about every 17ms to be exact
 
@Unihedron Going to bed? This early? What's wrong @Unihedron?!
(Goodnight ;)
 
Fev
@Unihedron, good night !
 
4:53 PM
This just keeps getting more and more fun.. java.io.UTFDataFormatException
 
Fev
is that a new class ??
 
5:09 PM
No but it's rarely seen
it means that he's trying to read something that's supposed to be modified UTF-8 and it's not
or it's corrupt
 
i hate sockets at this point.. lol nothing but 5 days of headaches
 
That's why experienced people try not to ever write socket code. I guarantee there's a library for doing what you're trying to do, and the likelihood is that it was written by Smart People(™)
 
well, considering i need to show off this project in a day and a half, I'll keep that in mind for next time or when i rewrite this. XD
in hindsight netty would've been a good idea
 
Netty is amazing
That's what I used to write my senior project a few years ago
and it helps that I've used it at work in varying degrees
 
Well I think I found my issue..
So the mousemotionlistener and the server loop are writing to a socket at the time
causing it to boom.
Trying to figure out if I should move the code or just add the packets into some kind of queue
 
5:23 PM
You need to co-ordinate the writing to the socket. A synchronized queue would probably be best
you should have one thread that just reads from the blocking queue and writes to the socket
then everyone else just pops stuff on the queue
 
i did just had an idea
since all of the rest of the packets are sent in the thread and thus won't overlap
basically put a simple lock on the sendPacket() method i have
if it's not locked it will send the packet, otherwise it will ignore it
since what is being sent off thread can miss a few packets
 
Which thread are you talking about, the event thread, main thread or a different thread?
 
basically my program has the main thread, the thread that runs the entire game, and a socket thread, and then the events thread
the stuff is being sent from the events thread to something in the socket thread
.-.
Now it locks it when sending packets, so it shouldn't be an issue unless it tries to write it at the same time as something else
 
This is a school project, I'm assuming
 
Not exactly.
I'm working on a game as an example to show at a college interview
:P
 
5:31 PM
Oh, to get into college?
 
Kind of
At this point it's just to impress the college interview people.. as an example of my work
 
Do you have it in GitHub
I can provide you some "professional" code review and suggestions. That'll help :)
 
I'm actually planning on putting up the code into a github after the interview
which is in a day and a half..
that being said, now that I made it send the packet not in the event thread it appears to be fixed
 
Here's a huge tip: Don't do anything in the event thread except UI work
drawing and events. any IO should be offloaded
 
I want to strangle ImageIO right now
 
5:33 PM
there's a bunch of convenience classes for that already
 
half of the time it messes up the transparency on images for no reason
whatsoever
 
5:48 PM
Kylar: I took your advice to an extent, any packets that were being sent from the event thread are now shoved into a list and sent on the next loop of the game thread
anddd now I get concurrent modificationexceptions. Great.
 
No, not a list, a synchronous queue like an ArrayBlockingQueue
 
issue with that is that it's bounded
 
and you don't need to iterate it, you can just pop
LinkedBlockingQueue then
the bounding should be irrelevant
 
well, I just don't want it to crash and burn if the player manages to generate xyz amount of packets in 17 ms
 
if you blow out your queue an exception is expected, you can't hold an infinite number of items
 
5:56 PM
unrealstic but still
 
where are you getting this 17ms thing
if you're using IPC sockets or even on the same LAN you should be sub-1ms to pull stuff off a socket
 
kylar, the game thread is running at 17ms or 58-60 fps
anyways
Would that work without a CME?
It didn't produce any CMEs. thanks @Kylar
 
It's a blocking queue, so you don't need the loop, you can call take() and it'll block if there's nothing on the queue.
and wait until someone queues something
 
Where it's being read from if it blocked it would have a huge problem, so that's fine
 
 
5 hours later…
11:35 PM
hiiiiiii
 

« first day (1375 days earlier)      last day (3569 days later) »