« first day (1417 days earlier)      last day (3534 days later) » 
00:00 - 20:0020:00 - 00:00

12:00 AM
Oh, figured it out. bigint.and(otherbigint);
off to doing complex bit shifting!
 
@baseman101 Yes. It has methods for operators like | and &. Check out its Javadoc page: docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html
Beat me to it. xD
 
12:45 AM
;=;\
Can anyone explain how to set my bounds for a 2D grid of JButtons so I don't get out of bounds error?
basically when I click a button it highlights it
then it scans the surrounding diagonals up to i+/-2
then if I wanna move to a diagonal I move, but then the problem is at the edges, I get the out of bound error and I'm not sure how to fix it. I don't want to use try/catch since I've read it's not recommended. But I can't figure out how they set the grid bounds so that I never get the error
 
I'm back again...
Anybody alive?
 
 
1 hour later…
2:02 AM
hola
 
2:46 AM
heya
@Hamza in what context are you talking ?
 
 
4 hours later…
6:51 AM
@ItachiUchiha In a general sense
 
@HamZa I still don't get ya ! Why have you tagged me ?
 
@ItachiUchiha because you pinged me?
Please click on the "arrow"
and please use it
it's hard to track the conversation if you don't
 
got it
:D
 
I swear, if I ever ask another question on SO, it will include Maven rant.
 
rant ?
 
7:01 AM
Yes.
Were it within my power I would gather every surefire copy and scrap it with a supercomputer.
Ugh, I'll build the project without Maven. What could possibly make it so hard without it?
 
@Unihedron you can try !
If your pom is simple, you can !
 
My pom.xml is broken. That's the problem.
 
so fix it
 
8:04 AM
HI all!
Oh my goodness noone here :'(
 
hia @sab
 
Hia @Unihedron
xD
i'm in the library and that chat sound
everyone looked at me wtf
 
turn it off :P
 
just did xD
dude
 
I don't have sounds on most of the time, so.
 
8:06 AM
lol
 
let's say I wanna make my array not get errors
I don't want to try catch
I need an efficient way
 
Then... do it properly
2 days ago, by Unihedron
It gives an error because you're not doing it properly.
 
how?
it works in the middle bro :S
here's the funky part
 
Have you ran debuggers? When it throws an exception in array read, it means you have an invalid index. Don't query with invalid indexes.
 
if(grids[targetX][targetY] == grids[highlightedX-2][highlightedY-2]){
	if(grids[highlightedX-2][highlightedY-2].getIcon() != grids[highlightedX-1][highlightedY-1].getIcon()){
		int highlighitedX1 = highlightedX-1;
		int highlightedY1 = highlightedY-1;
		doJump(targetX, targetY, highlightedX, highlightedY, highlighitedX1, highlightedY1);
	}
 
8:09 AM
Without declaration of the variables and the scopes (and helpful comments), I can't conclude anything, really.
 
this is self commenting
 
Yeah, but what's grids[highlightedX-2][highlightedY-2]? Those are magic numbers here..
 
second
highlightedX and Y is the button I clicked on
let's say I wanna move a pwn I click on it, that's the highlighted
now i turn it's color blue as a check
 
most likely you go below 0 with those -2 things
 
I get the error at the right/left edges
i noticed that
let's say I check grids[highlightedX-2][highlightedY-2]. If grids[highlightedX-2][highlightedY+2] is not on the grid I get the out of bound error
 
8:14 AM
ok, so check the indices before you try to read from them. if it's outside the grid you can be certain the move is invalid anyway
 
that's the problem @Kiheru
check the code I made
 
what's problematic about it? if i is the index, if it's out of bounds if i < 0 || i>= theArray.length
 
I find the highlighted pawn(blue bg) and scan it's region
then I do the move accordingly
but I get some errors near the edges :(
 
simply skip scanning the invalid areas
 
how?
 
8:19 AM
by checking the indices before you try to read from them
 
that's the problem :(
I've been telling you
I don't know how to check it
 
see above: i < 0 || i>= theArray.length; that's outside. If that check is true, you can skip to the next loop iteration with continue
 
@kiheru @Unihedron
0
Q: Set Stage of ContextMenu and ColorPicker

user3738627I have had a problem opening a ContextMenu or ColorPicker in some linux distributions without xcompmgr. Have you managed to solve most problems using Stage.initStyle(StageStyle.UNDECORATED); But these two elements continue to present problems and the message below: Can't create transparent st...

 
STOP ONEBOXING THEM
Although it is a good way to enrage us and flame the question better, don't do it
 
@ItachiUchiha @Unihedron can i ask about threads and synchronization
 
8:28 AM
Go ahead?
 
if there is a synchronized(){} block it is locking the block right? it means when thread1 is using it thread2 will not be able to use it right?
 
@Unihedron aye aye captain
@Unihedron you don't need to downvote it !
the question is fine !
 
No, synchronized locks the method so if one thread acquires the lock, the other will have to wait until the lock is put back until he can take it to use the other thread.
 
its just already asked previously
 
just the answer i needed! thanks!
 
8:30 AM
it blocks other threads using the same monitor object from entering the block
 
BTW, the official terms are "monitor object", "releasing and acquiring the lock", and "using method as a monitor".
 
it is for method right? what about just blocks?
i often see
they are just using objects to make a synchronized block
Object obj = new Object();

synchronized(obj){

}
 
see above. Synchronized methods use the object itself as the monitor object. For blocks you specify the object explicitly
 
Here obj is the monitor object. If synchronized is used on a method:
synchronized boolean doesItHalt(Program pro) {

}
Then the monitor object is the method.
 
so it is ok or ideal to just make an Object obj = new Object(); just to create synchronized block?
 
8:33 AM
It is. It's a recommended practice. For example when you have a class dealing with writing and reading from files async.
Then you will have:
private static final Object WRITE_LOCK = new Object();

synchronized (WRITE_LOCK) {

}
 
Object obj = new Object();
 
strictly speaking, that's equivalent to:

boolean doesItHalt(Program pro) {
    synchronized (this) {
        ...
    }
}
 
right right! and if thread1 is acquiring the lock in the block/method thread2 WILL have to wait until thread1 is finish right? or thread2 will pass by?
 
@ItachiUchiha then specify that. [cv-pls] is best used for questions in dire need of the close - mostly when a close vote is about to expire or it needs just 1-2 more to be closed. questions get downvoted so they can be automatically deleted. (negative score questions which are closed gets automatically deleted after a period of time, if OP doesn't edit to get it reopened.)
@Kerppag It will wait.
 
@Unihedron @kiheru thanks!
 
8:41 AM
@Kiheru doesn't work
 
@Sabಠ_ಠ What does not work?
 
the checking
 
Transcript cleanup complete.
 
you're probably not checking everything you should (or are using the indices accidentally before the check)
 
but
I have a for loop which runs row column
if it finds the blue highlight then it does the if
what happens in the if is when I click a blank button not the actualy blue button
I use the blue as a tag to scan the region
 
8:45 AM
I don't understand the question at all
 
Me neither.
 
did you look at the code?
here
@kiheru @Unihedron
if I click on the red X I get an out of bound error
it doesn't work
 
and what about the array? which direction X-Y represents from the original to the other edge of the board?
 
because you trying to read at x - 2
 
where?
 
8:51 AM
why are you readin x -2 btw? do you need information about other locations than the blue, and the one marked with cross?
you have things like: if(grids[targetX][targetY] == grids[highlightedX-2][highlightedY-2]){, that's where the indices underflow
 
for this
for the jump I read x-2
but here as well i get the out of bound error
but all work in the middle
 
that specific you you did earlier was just one long though. no need to read all possible locations. At most you need the clicked, and the position between the clicked and the moving piece
Seems to me that you don't need any scanning at all. Just check at most 2 locations
both of which are guarantedd to be on grid
 
I don't get it :S
but I checked all the 8 parts
 
1. you have a selected piece at position x1, y1. that's on the grid
 
yep
it turns blue
now that part is done
 
8:56 AM
2. you click a position x2, y2. That too is guaranteed to be on the grid
 
every button does exactly the same thing
yep
 
3. a valid move is at most 2 long, and alway on diagonal, am I right?
 
yep
 
3a, then for a valid move abs(x1 - x2) == abs(y1 - y2)
 
okay
 
8:58 AM
@Unihedron Gotcha !
 
and if that is 2, the middle point is at (x1 + x2)/2, (y1 + y2)/2
and that too is guaranteed to be on the grid
no scanning at all
 
hmm
now I have no idea how to fix it
 
@ItachiUchiha The point is, if a question deserves to live, don't use [cv-pls]. Use [dupe].
 
[dupe] ? Hearing about it for the first time :)
 
in Tavern on the Meta on Meta Stack Exchange Chat, Feb 25 at 15:53, by Benjamin Gruenbaum
@Bart actually the syntax is [tag:cv-pls] or better [tag:cv-pls] [tag:dupe]
 
9:19 AM
A quick question, this is very basic, but I am kinda confused
which OOPs concept does Java Beans show us ?
 
What's Java Bean?
 
hehe, yes. sounds like a very specific answer is expected, but I'm not quite sure either what that is
 
Java Bean is private class variable with setters and getters
Ok, its called as Encapsulation !
 
gr8!
 
9:35 AM
I need help
I can't fix it :(
@Itachi can you help?
 
@Sabಠ_ಠ ?
 
abs() is giving me a syntax error
why is that?
 
how are you using it ?
 
@Sabಠ_ಠ because I wrote more pseudocode than real code. It's Math.abs() (unless you do a static import)
 
aha!
thanks :)
OMG that work :D
if(Math.abs(targetX - highlightedX) == 1 && Math.abs(targetY - highlightedY) == 1){
							doMove(targetX, targetY, highlightedX, highlightedY);
						}
lol so easy to move
 
9:43 AM
grats
 
but jump :O
but it moves backwards
:S
 
ok, then assuming y change must be positive, don't compare the absolute value there, but the actual change (either 1 or -1 depending which way your coordinates run)
 
okayy
 
I used abs() because I don't know the rules of the game :-D
for the other player the y change must have the opposing sign, obviously
 
it's a problem though
if I use 1 it move right diagonal an nowhere else
-1 left diagonal nowhere else :S
it's the x that should change :D cuz we are dealing with rows :D
 
9:49 AM
hmm? one of the abs() calls must remain
 
works fine now :D
yep the abs for y is unchanged but x is removed
we are going up the rows
:)
 
ah, ok. I assumed x was horizontal
 
now for the jump?
 
don't miss that the necessary x change sign then depends on the player.
 
yep :)
okay I got it to work :) just need to edit my doJump function to make it reflec the change :D
thanks a lot @kiheru <3
 
9:53 AM
the sign is luckily the same for both simple moves and jumps
 
yep
:)
the only problem is how do I check the color of the previous one?
 
I don't know how you store the piece. Anyway: you must somehow keep track whose turn it is. Only those pieces can be moved, so that must always be the color of the selected piece then too
 
10:32 AM
I cloned a git repository into my computer, but it's blank with a submod setup. Now Eclipse Java won't let me create the project at the file destination of it, and I cannot import the repo as a project either. What can I do?
 
What does the repo has ?
 
Forget it, I could use Import.. Git project.. Local repository.
 
But you said that there the repository has not been cloned. How will you use the Local Repo ?
 
... I said I:
- cloned the git repository
- - blank, with .submodules setup only
- Eclipse Java doesn't let me Import as Java project from folder
- Eclipse Java won't let me create a new project at the location
 
How to run a method for a minute
 
10:36 AM
@PunithK What?
 
want to run a method for a minute and then stop it and then restart whenever need arises. May be using timer or so
 
Threading?
 
@PunithK use Timer
 
Can I wake the thread when an user enters a room. It's a OpenCV kind of detection project, Show that I can minimize memory usage
 
is it a loop that runs for a minute, or repeated calls to the method, up to a minute?
 
10:40 AM
kind of repeated calls to the method ( I think I can make my method run in run() method of Threading)
@Kiher
 
I like the new name for @kiheru --> Kiher !!
 
@kiheru I know how to run a loop for a minute using Timer.
@ItachiUchiha that was a small mistake man :(
 
Timer seems like a sane choise
 
@PunithK But I like the name !
 
Just like that @ItachiUchiha
Do you have any code snippet that may help me.
 
10:44 AM
didn't you just say you know how to do it?
 
@PunithK here is a small sample that might help
 
What I meant was, Can I get snippet to execute the method when something happens ( It's an Image Processing project where I have to process lot of frames, so I can minimize the processing power)
@ItachiUchiha thanks man
 
KVK
hai friends. i need help from you. i am hosting my web application in tomcat server but i need to make that application only accessed by limited number of users how can i do that
 
Anyway, to make it run for a minute, store a time stamp when you start, and compare time difference between executions to that. cancel() once the difference reaches a minute
@PunithK how is "something happens" detected?
 
@kiheru When someone enters room, that time camera should have to process the frames and detect actions they are doing.
 
10:54 AM
Don't duplicate messages. Ping independantly.
 
@KVK sorry I didn't use Tomcat for hosting yet. Try in web development chat room or directly ask question in Stack Overflow
 
@PunithK That still must amount to something detectable at code level. On the detected change, call the processing thingy - how exactly to do that depends entirely on the design of the system, so it's not really possible to to say anything more specific. It could be a simple Observer pattern, or maybe a producer-consumer using queue, or something entirely different.
 
KVK
@PunithK thank you punith
 
@kiheru I've already coded the part that can detect face or body of the person when he enters the room but my concern is to activate the processing when detected. I tried so many ways to find the answer.
 
@KVK where is your tomcat ?
 
KVK
11:00 AM
@ItachiUchiha it is in my local system
 
@PunithK I really don't know what are the specifics of the problem? It's basically if (changeDetected()) { startProcessing() }, but what startProcessing() does really depends on your design. Shorter version: I don't know what you're actually asking
 
How are users accessing it ?
 
KVK
@itachiUchiha using ip address of my system user's are using . but i need to restrict limited number of users only access the application.
 
Do you know the user's IP ?
 
KVK
@itachiUchiha yes
 
11:11 AM
Add a Valve to the Context in context.xml
 
KVK
@itachiUchiha but systems are connected in LAN so we can change ip address. so i need to restrict user using session count
 
why don't you create a login in your application ?
 
KVK
@ItachiUchiha understand i have login page. but i need to make my application runs only 4 users at a time not more than that
@itachiUchiha so ineed to restrict using maxconnection or sessioncount so please help me
 
Use sessions
and you can count the number of active sessions
 
KVK
@itachiUchiha can send any example or reference
 
11:25 AM
Greetings
 
This one is for PHP, but you can implement this
@Karl Greetings
 
How you?
 
hia @karl
 
@ItachiUchiha!
 
M good ! Uni n I missed ya :P
 
11:27 AM
@Unihedron!
 
I'm still coding :P
 
@Unihedron How you?
I KILLED that chat!!!!! …….
 
I'm fine
Working on a project, when I finish my ongoing project I can work on smokey
 
KVK
@ItachiUchiha i didnt get any idea from which u send the link
 
hey guys anyone faced this error b4? : Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/Validate
 
11:30 AM
@compski add the jars in your env
you compiled with dependency of org.apache.commons.lang package but it's not loaded at runtime
 
@Unihedron i did add the 2.6.lang.jar but weird its not getting the hint
 
What "hint"?
 
@Unihedron sorry not hint .. i meant keeps giving me error can u explaing the "it's not loaded at runtime"? how do i get it to load at runtime?
 
include the jars in the execution directory
Should I sketch for you?
 
@Unihedron nono i get it .. its just so weird... i cud run my code b4 .. but i think the developers change the git/maven code and screwed things up .. now i get that error
 
11:35 AM
Maybe you have to submod it? Can you outline what the differences are?
 
hold on eclipse is running super slowly lol .. i feel like deleteing everything n compiling it again
 
I know right? Eclipse just crashed earlier.
 
haha yea it feels like a bloat IDE nowadays
 
12:39 PM
@Unihedron Do you think this should be rejected ?
 
radical change
 
I selected Invalid Edit as the Editor can't be sure of the version !
 
in Tavern on the Meta on Meta Stack Exchange Chat, 1 hour ago, by Stijn
@Unihedron the latter. Some explanation: if it's a good edit => approve; if it's too minor => "improve edit" to build upon it or "reject and edit" to restart; if it's an incorrect edit => reject; if you're not sure => skip
 
I skip far more reviews than I act on
 
1:05 PM
@Unihedron im really lost now
 
@compski ?
 
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/Validate ... i added both the common-lang-2.6 and 3.3.2 into my classpath n still this error
 
1:49 PM
@Unihedron ssry forgot to elaborate but they have an issue
with this Validate.notNull(data); and
public static final DoubleMatrix2D EMPTY_MATRIX = new DoubleMatrix2D(new double[0][0]);
 
2:20 PM
Room is dead again
Oh my gawd!
 
Rooms are undead.
 
Would anyone here be able to help with an Json Date parsing question?
 
Ask away, I'm no expert but I'm not answering when there's no question. :P
 
I want to parse a date from a string eg: 2014-09-10T16:24:33.9956275+02:00. I have tried:SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSZ");
GregorianCalendar cal = new GregorianCalendar();
cal.setTime(f.parse(input));
 
You don;t answer even when there are question :P
 
2:26 PM
But the time that comes out differs on an hour or so seemingly randomly. I think it has something to do with the millis in the parsing but am not sure
 
Sorry, wasn't watching.
I'm not sure, what's the problem? As in, what's the expected behaviour and the actual behaviour, and what's wrong with that?
 
@kiheru my man where are you?
 
@Sabಠ_ಠ lurking
 
:D
Dude I can't get my jump working
I used the same principle as the move but I think I got a logic problem
 
@Unihedron I'm expecting the get the correct date and time into "cal" but the time is incorrect when cal is set
 
2:33 PM
So click on button >Highlight it>click on empty space > Jump
I used the same principle as the move but I think I got a logic problem
 
what kind of problem?
 
The same problem as befoe
if checks the move and the jump at the same time
i used if else if else if
if 1 do this else if 2 do that
 
Hey all
 
@PaperThick Can't reproduce...
 
Anyone here is experienced with the P2P protocol?
 
2:37 PM
@Unihedron Do your "cal" get the correct time?
 
@Sabಠ_ಠ something like:
    int diff = abs(oldX - oldY);
    if (diff == 1) {
        move1(...);
    } else if (diff == 2) {
         jump(...)
    } else {
         invalidMove();
    }
?
 
yep
that's what i did
doesn't work
 
No @PaperThick, it crashes
 
so, what there does not work?
 
it does a double move
and then the error appears
or out of bound error
 
2:40 PM
java.text.ParseException: Unparseable date: "2014-09-10T16:24:33.9956275+02:00"
	at java.text.DateFormat.parse(DateFormat.java:357)
	at com.gmail.inverseconduit.test.O.main(O.java:16)
 
The stack trace should show the exact line where you have the out of bounds error. What do you do there?
 
@kiheru I removed the code for jump
here's what it looks like without the jump
maybe we can work from there
private void scanRegion(int targetX, int targetY){
	for(int highlightedX = 0; highlightedX < 8; highlightedX++){
		for(int highlightedY = 0; highlightedY < 8; highlightedY++){
			if(grids[highlightedX][highlightedY].getBackground() == Color.BLUE){
				if(grids[highlightedX][highlightedY].getIcon() == redPawn){
					if((targetX - highlightedX) == -1 && Math.abs(targetY - highlightedY) == 1){
						doMove(targetX, targetY, highlightedX, highlightedY);
					}else{
						spitWrongMove();
					}
				}else{
 
@Unihedron hehe, ok thats not what I'm getting but thats for trying to help:)
 
@Sabಠ_ಠ by the way, you would not need to scan the whole grid if you just stored the location of the last click
 
i wasn't sure how to store it
i was trying to make private variable to store but I coulnd't get around it :S
 
2:46 PM
personally I'd do an immutable Location class for positions (then null becomes conveniently "no previous location"), but you can just have int fields where you store the previous values too
 
@kiheru by can you mean no need to do the for loop right?
 
yes
I need to go now though. Away for some hours
 
aye
okay ty I'll try to do this
c y
a
 
 
3 hours later…
5:27 PM
hello
can anyone provide links on how to install oracle 11g on linux ubuntu 14
 
5:41 PM
any ideas about this
2
Q: A driver operation has been interrupted (mongodb exception)

user3419766I am using mongo database for my application for connection spooling in configured the below mongoOption while creating connection MongoOptions options = new MongoOptions(); options.autoConnectRetry = true; options.connectionsPerHost = 40; options.threadsAllowedToBlockForConnectionMult...

 
 
1 hour later…
6:55 PM
Seems like this chatroom is abandoned or everybody is asleep.
I have a swing question:
Is there a way to delegate an event in swing? I have several pieces of text inside `JPanel`s and have attached a `MouseWheelListener` to each of them. Now when I hold down the `Ctrl` key and scroll up/down with the wheel I zoom the text inside the `JPanel`. All the text panels are inside a `JScrollPane`. Now after adding this listener, I can't scroll the text panels. I know this is because I am catching and handling the wheel event. What I don't know is whether there is a way to `delegate` the wheel event if the `Ctrl` key is not pressed. In short, I want to zoom th
 
7:18 PM
Normally you can use dispatchEvent(), if you want to pass it to another component
 
7:31 PM
Hello
You here @kiheru ?
 
Somewhat. Not all the time at the kb
 
Do you know if Android will run Swing?
If we can make it do that, my game would be EASY to port!
 
it does not
 
RATS
 
00:00 - 20:0020:00 - 00:00

« first day (1417 days earlier)      last day (3534 days later) »