« first day (1628 days earlier)      last day (3306 days later) » 

12:50 AM
where are all the java peoples
 
1:10 AM
@Joe'sMorgue In cave
 
1:25 AM
well thanks for coming out. would you be able to help me with an assignment?
 
@Joe'sMorgue Depends, how do you need help and with what
 
ill just post my script
import java.awt.Color;
import java.awt.Point;
import java.lang.reflect.Array;

public class GameBoard {


	GameSquare[][] squares = null;
	boolean isHere;
	int size;


	public GameBoard (Color darkColor, Color lightColor, int size){
		Color[] colors = {darkColor, lightColor};
		for (int row = 0; row <= size; size++){
			for (int col = 0; col <= size; col++){
				squares[row][col] = new GameSquare(colors[(row+col)%2],row,col);
			}
		}

	}


	public int boardSize(){
		return squares.length;
	}

	public Color color(Color lightColor, Color darkColor){
public class GameBoardTest {

	GameBoard board = null;

	@Before
	public void setUp() throws Exception {
		board = new GameBoard(Color.black, Color.red, 2);
	}

	@After
	public void tearDown() throws Exception {
		board = null;
	}

	@Test
	public void testBoardCreation() {
	assertTrue(board.isHere = true);
	}

	@Test
	public void testBoardSize(){
	assertTrue(board.boardSize() == 4);

	}

	@Test
	public void testColorAlternation(){
		assertTrue(board.altColor(0,0) == Color.black);
		assertTrue(board.altColor(0,1) == Color.red);
i gotta get these tests to pass
 
Can you use hastebin.com for pasting?
 
And what's the problem?
@Test
public void testBoardCreation() {
assertTrue(board.isHere = true);
}
This test will definitely fail
Second one will fail too
board.altColor(0,0) Can not find altColor anywhere
First you need to see, what's wrong with first test?
 
1:43 AM
oh wait shit i sent you the wrong files
one moment
 
Doesn't assertTrue requires two paramters?
assertTrue(String message, boolean condition)
@fge ^^^
First test case should be passing, is it?
 
the test board size?
 
Yes
 
no its not passing
 
What's the failure error?
Aaah, I see
By the way, are you able to compile your code?
Hold on, let me launch my IDE
 
1:50 AM
im running it in eclipse theres no errors its just not passing so im thinking im missing something
 
Okay, can you also paste the error message of individual test failure?
 
where would i see that?
 
In JUnit runner console.
 
hastebin.com/ziyowikomo.avrasm are we talkin this stuff?
 
`at chess.GameBoard.<init>(GameBoard.java:16)

at chess.GameBoardTest.setUp(GameBoardTest.java:18)`
These two lines will tell you the exact cause
`double [][] array = null;
array[row][column] = new double[2][4];`

What do you expect?
You need to define rows first for your two (multi) dimesnional array
 
2:01 AM
im just trying to get the tests to green light
so if i exchange line 16 with that it should work?
 
No
You want to learn or just pass the tests?
 
That's not the answer to my question
 
i wanna know how to do this
 
Okay, so first question, what does NullPointerException means?
Hint: Normal Arrays are fixed size in java
 
2:12 AM
it points to an object
 
@Joe have a look at this and try to understand: hastebin.com/soyaqocenu.cpp
This is the exact solution: hastebin.com/akatoxiyed.mel
 
why are you establishing a new gamesquare in the first for loop?
 
@Joe'sMorgue that's defining the number of rows that will be used
the other one will define number of columns against each row
As your rows and columns will always remain of same size
You can write something like this as well: hastebin.com/ibitiniral.mel
 
2:29 AM
its still failure tracing in the same place i kindof understand why we have to establish rows in the first for loop
 
what are the exceptions now?
 
squares[row][col] = new GameSquare(colors[(row+col)%2],row,col); its saying this line and this line
board = new GameBoard(Color.BLACK, Color.RED, 4);
 
What's the error?
 
java.lang.ArrayIndexOutOfBoundsException: 4
at chess.GameBoard.<init>(GameBoard.java:17)
at chess.GameBoardTest.setUp(GameBoardTest.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 
Yes, please read what does ArrayIndexOutOfBoundException means
Also paste your GameBoard.java file in hastebin again
 
2:39 AM
so the index is greater than the size of the array
 
size = 4 which means that your array has 4 rows and 4 columns, okay?
 
which means
that rows indices are 0,1,2,3 and column indices are 0,1,2,3
Now in your both for loops, you are trying: row=0;row<=size where size = 4
which means the outer loop is running like, 0,1,2,3,4 and same as inner loop, 0,1,2,3,4
where as, you array only has 0,1,2,3 indices for both rows and columns
Did you understand that?
 
so would i put size = 3 so it would be 4 arrays since it starts at 0?
 
No
If you put size = 3, it will still throw exception becuase what you have written
So, now two possible solutions:
1. Iterate your loops like: row=0;row<size instead of row<=size and same as col=0;col<size
2. Create your array like: squares = new GameSquare[size+1][size+1]
 
2:44 AM
public GameBoard (Color darkColor, Color lightColor, int size){
squares = new GameSquare[size + 1][size + 1];
Color[] colors = {darkColor,lightColor};
for (int row = 0; row < size; size++){
for (int col = 0; col < size; col++){
squares[row][col] = new GameSquare(colors[(row+col)%2],row,col);

}
so like this?
 
No
Do one of the 2
Not both
 
so it cant equal the limit of size
 
So, let's see, what your current program is doing.
'squares = new GameSquare[size + 1][size + 1];'
This creates rows and columns with indices, 0,1,2,3,4 if size = 4
where as
In your loops you are doing: row=0;row<size which means it's iterating for 0,1,2,3 for both rows and columns
Which MEANS
that your 4th row and 4th column of each row is empty (by empty I mean the default value of datatype you are using)
 
so do i just get rid of the +1 to get rid of the empty row/column?
 
yes
that is one possible solution
 
2:54 AM
ok im still getting errors on the same line
 
What's the error now?
 
Can you paste GameBoard.java too?
 
That's not possible
It should not be throwing this arrayindexoutofbound exception at all
Can you compile again and run?
OPs ops
First loop
Mistake
for (int row = 0; row < size; size++){
should be for (int row = 0; row < size; row++){
 
3:01 AM
ok now its saying the testSquarePosition fails
 
paste that test as well as exception trace
 
Your function getSquare() returns GameBoard object but you expect a Point object in your test case
 
would it be easier to change the test or function?
 
I am not sure. That depends on your requirements
Do you need to fix functions as per test cases or you need to fix test cases as per functions?
Can you paste GameSquare.java?
 
3:09 AM
i had to create both so changing either would be fine
 
Okay, so let's fix test case
Paste GameSquare.java file
 
Try this test file:
http://hastebin.com/agarusekac.avrasm
Hold on
 
Can you try this?
@Test
public void testSquarePosition(){
GameSquare square = new GameSquare(1,1,2);
assertTrue(board.getSquare(new Point( 1, 2)).getPosition() == square.getPosition());

}
 
3:17 AM
it say gamesquare is undefined
 
You need to import GameSquare :)
 
is it java.awt.GameSquare?
 
No
Your own class GameSquare
something like: import chess.GameSquare;
 
i tried that
oh wait capitilization was wrong im all good
still says its undefined
 
Also paste GamePiece.java
 
3:24 AM
public class GamePiece {

public static GamePiece newKnight(){
return new GamePiece();
}
}
Ok well thank you for your help with this so far it has been greatly appreciated but i have to go.
 
4:00 AM
o /
 
good morning to all
 
Dev
@ItachiUchiha Hello
 
tys
4:57 AM
Hullo World!
 
hi guys
can anyone tell me why this throws an index out of bounds exception?
http://gyazo.com/5d4dabfbb0bd3ab9afee476dfc1b00d4
oh shit never mind i figured it out
was invoking the method on the wrong arraylist
 
5:13 AM
@Dev heya
 
5:24 AM
Good Morning @ItachiUchiha
 
mrng
 
good morning everyone ^^
 
5:43 AM
@Juce morning
 
Good morning
 
5:58 AM
Morning all.
 
@Juce Did you check my advice?
 
Have I got this correct?

Using the keyword .values calles the enum constants that have been automatically placed in an array (because that's what java does to a list of enum constants).
 
@ItachiUchiha just red it a few seconds ago. Got a task at work atm but after that i'll try what i can achieve with your tip. ty^^
 
Hi, guys! Does anyone here know how to query using SparQL? Thanks! :)
 
Can anyone see the issue with my code? error The Method values() is underfined for the type...

http://pastebin.com/VY2wN2mz


Thank you
 
6:32 AM
Hi
 
 
Good morning, Java!
 
hello, check this code, it is throwing an error called
"Unrecognized SSL message"
 
6:50 AM
Morning @Oleg, @JavaF
 
@Bijoy are you sure you are working against HTTPS and not HTTP? ^^
 
yes, 443
 
What do you mean 443?
 
port,
 
he means the port -> but is it correctly configured on the server side? ^^
 
6:53 AM
it jabber.at
*it is
 
Eh.
 
yes, i can login with the same settings in pidgin
 
@Juce - thanks
 
i am issuing a starttls comand, and then i should wrap the existing socket to a secure socket, right ?
 
I'm afraid that this means nothing to me,

"...therefore, if you use Enum as a bound on your generic parameter, it won't be specific enough for you to call the values() method."
If anyone else can help me, why am I getting the error "the method values() is undefined for the type..."

The code smippet is

for (enumeration_enum people: enumeration_enum.values())

The full code is http://pastebin.com/VY2wN2mz

Thank you
 
6:59 AM
@mikeeustace that's because java generics are largely fake. The type information is not available at runtime, so you can't call a static method of the type (or create new objects, or arrays of the type, or do anything interesting in general)
@mikeeustace your values() call fails because compiling the enum itself fails
and that fails because the constructor calls are borken
btw, following the usual naming conventions would make the code easier to read
 
Thank @kiheru

"and that fails because the constructor calls are borken".

How are they borked? :)

I've been looking and looking and can't see where I'm going wrong!
 
@mikeeustace look closely at the compiler error when compiling the enum. That should have the needed information
(you should get errors for Mairead and Patrick)
 
yep. I do.
 
@mikeeustace
 
@edge
 
7:11 AM
ArrayList<String> ar = new ArrayList<String>();
for (int j = 1; j <= sheet2.getRows(); j++) {
String colArow333 = sheet2.getCell(1, j).getContents();
ar.add(colArow333);
}
System.out.println(ar);
i am getting java.lang.ArrayIndexOutOfBoundsException:
how to fix it
while am able to get value in colArow333
 
@Edge usually arrays etc are 0 based in java
 
ok
so what i have to change
we have to start for loop from 0?
 
j < sheet2.getRows()
 
Thanx i got Solution
 
Assumung that's the issue, then at least: for (int j = 0; j < sheet2.getRows(); j++) {
 
7:13 AM
@JudeNiroshan thanx
 
(two changes there). And possibly also getCell(0, ... but that depends on what that does
 
@Edge if you come across situation like this, just put some sysouts and see what are the values coming for those... cos debuging such thing would be a pain
unless you have few values in your excel
 
Jeez! 30 mins and it was those missing quotations. Grrrrr!

Thanks for the replies @kiheru :)
 
yes @JudeNiroshan i am reading that excel
 
@mikeeustace you're welcome :-) Learning to read compiler errors is useful (it can be a bit confusing sometimes when the error is not in the part of the code you're looking at, like it was now)
 
7:20 AM
But, when you can spot errors, it shows you really understand what you're trying to learn. As with everything in life, when it's going well, it's easy!
 
Yeah. Stupid mistakes are expected when learning. Nothing to worry about
 
7:41 AM
Hey everyone!
 
hi
 
Sup!
 
fge
8:00 AM
Moo
 
8:22 AM
morning
 
Morning
 
Morning!
 
morning
 
That was long. Like really long.
 
Morning? O.O
 
8:27 AM

Deal with it

Mar 17 at 10:46, 7 seconds total – 2 messages, 1 user, 3 stars

Bookmarked Mar 17 at 10:46 by Unihedro

 
@Unihedro Cc-c-c-c-c-c-cc-c-c-c-c-cc-c-combo breaker
 
rofl
 
> 2 messages, 1 user, 3 stars
 
morning
 
Good morning!
 
8:30 AM
MORNING!
 
by the way ^^ did anyone of try to bring a javafx application on android?
you* (lol cant edit my own message)
 
@JudeNiroshan paste.ofcode.org/XTixfhibXuQ98fs7HiKxvL look this data
i have to filter name adress
can u please suggest me how i should apply logic in this
coz data is bit complicated?
 
@Unihedro if you find more good questions, feel free to ping me...
I want another gold badge and just need 7 votes for that
 
:)
 
8:41 AM
@Vogel612 if u free please check my query
 
@Edge this looks like you have a malformed and underspecified CSV there.
get your data-representation in order and make people give you proper data
 
yes ejctly
 
@Edge Nirmal ray ,vill ,naruwaphari ,po,bagnal,pin,cod,814144
name = Nirmal ray
address = ?
 
Additionally be aware that dumping huge blocks of text on random people on the internet (especially when that text contains sensitive information like (email) addresses) is almost always a bad idea
 
,vill ,naruwaphari ,po,bagnal,pin,cod,814144
this adess
actully
 
8:43 AM
@Vogel612 (y)
 
see these data we got from sms and we have to filter as much data Possible
u getting
we have plnty of data but we have filter on the base of Pin code
i got that much of data
now i have to split name and adress
 
well... it seems like the stuff up to the first comma in a line is the name
and the rest is the address....
soo......
 
some place there is written name and adress and someplace it written by dafaut name and add or at or vill
 
@Vogel612 i don't think it is always the same scenarios like below

aghni devi husband chnku rikhyasan vill baratalbana po karanpura p.s taljhari dst sahibganj pin 816129
 
that seems to be the SMS text...
@Edge get people to give you proper data, and then get to wrapping your head around processing it....
 
8:47 AM
if the order of information isnt static then itll be difficult to split it
 
not the other way round...
@Juce if the order of information isn't static the data format is malformed
and malformed data should be rejected.
 
one question why would someone learn objective C or swift if we can develop IOS, android, Mac, Windows, Windows phone applications in C#
using xmarine?
 
sure normally that is what you should do. but sometimes you have no other choice instead of using this data ... even if its crap >_<
but you are right ^^
 
@androidplusios.design Umm... What do you mean?
 
@Vogel612 see we have 20 lakh data i h ave filter on the base of Pin code i got 16 lak data now i have to get name and adress as much as i can get
 
8:49 AM
Just because you can use C# doesn't mean native ways are neglible.
 
we have to giv maximum filtering data
 
@Edge aaand no...
just stop.
 
HAMMERTIME!
 
@CapricaSix that was fast xD
 
I told you to get proper data. and if you can't get proper data from your employer, MAKE THEM give you proper data..
 
8:50 AM
Yeah, it never stops. xD
 
reminds me of RHCP....
~listening-recommendation: Can't Stop - Red Hot Chili Peppers
 
Vog is our new music bot now?
 
maybe...
maybe better not...
but GnomeSlice doesn't drop in here, sooo...
 
@Edge seems like data has separated by comma
So, how about considering the commas, divide the whole set of this data into portions. then you will be able to get some portions of data that are more similar
 
in Off the record on The Stack Exchange Network Chat, yesterday, by Unihedro
#progressive #house http://soundcloud.com/aleppandro/limitless-black-sheep
 
8:53 AM
@Unihedro so, you listen to music :D lol
 
@JudeNiroshan -_-
 
yes @JudeNiroshan u telling right
 
in Teenage Programmers Chatroom, Oct 28 '14 at 14:53, by Unihedron
Dear music, thank you for being there when no one else was. :D
 
@Edge but i don't think that is the only way... what is your suggestion for this?@Vogel612
 
7 mins ago, by Vogel612
I told you to get proper data. and if you can't get proper data from your employer, MAKE THEM give you proper data..
@Unihedro next time you want tags??
 
9:02 AM
@Vogel612 ?
 
for the music-recommendation
 
It helps knowing what I'm going to hear, so that'd be nice :p
 
~amendment:
also... we could make Junior recommend music later...
but for that you have to get him to log in properly
and then we have to feed him with data...
maybe a database would help, too ;))))
 
Hi there. I've created three objects which have two variables and one shared static variable which print out using

public staticVariables(String ln, String fn) { // build constructor
first = fn;
last = ln;
members++;
System.out.printf("%s, %s : My girlfriend #%d\n", first, last, members);
But, in the main class, it says, the value of the local variable isn't used, eg

staticVariables member5 = new staticVariables("Emma", "Stone");
 
@Vogel612 Must they be the same project? ;)
 
9:13 AM
ehh?? no why?
just refer to it and bind a simple command "!!recommend" ...
 
@mikeeustace cos, according to what you have shown us here, that warning message is valid one.
 
in The SO Tavern (Free Snacks), 21 hours ago, by Unihedro
I suddenly want to build a bot that learns from behavioral analysis.
 
agreed...
 
@mikeeustace it says, you haven't done anything using the reference('member5') in your main()
 
and yet another project on my ever growing list of projects I want to do
What Jude says, btw.
 
9:15 AM
Balancing is important :)
 
@Unihedro sure it is, but I just started another one 3 days ago and JavaBot isn't anywhere near stable...
that being said: I'm back to work
 
:o
 
thanks @JudeNiroshan - but without that, the code won't compile
 
@mikeeustace huh? unless you get errors in your code, you are fine to go ahead. warnings doesn't stop you compiling
 
!!/listcommands
 
9:23 AM
@Juce 666, help, listen, eval, coffee, refresh, forget, info, listcommands, tell, afk, ban, unban, convert, define, doge, google, hang, jquery, learn, put..it..back...ლ(ಠ益ಠ)ლ, phucket, gtfo, lol, moneycantbuylove, catmode, coffeetime, lifeban, stopmyself, instagram, kendallfrey, excited, manigga, meinneger, dgaf, infiniteriot, okay, feelsgoodman, fabulous, sausage, playerpimp, installjavascript, moarkittens, kendall, banana, kfc, uwot, nsfw, facepalm, abhishekhingnikar, somekittens, erase, fry
dudeism, hahastillhere, onebox, morecoffee, steve, whoosh, burn, woosh, roomowner, phony, really,
 
You're right. It runs okay with the warnings. But as I'm trying to learn, I don't like to see warnings :)
 
@mikeeustace your classes can be compiled and run smoothly. One thing, when you give a name for class, "Start it with a Capital letter"!!!! ~ Java convention- follow it, otherwise you will get hurt more
 
PascalCasing for ClassNames, camelCasing for fieldsAndMethods.
And when denoting generic type parameters or constants, just use FULL_CAPS in snake_case
 
Thanks @JudeNiroshan.
re. naming - I will.
 
@mikeeustace half of your thanx transfered to @Unihedro for his clear explaination for naming conventions
 
9:31 AM
It's only partial, but there you go.
 
Thanks @Unihedro
- classnames: each word has first letter caps
- fileds and methods: each but first word has first letter cap

what is snake_case?
I was busy typing. Yes thanks too, @Unihedro
is snake case each word has an underscore between?
and all lower case?
 
actual snake case, yes, but uni is talking about the SHOUT_CASE_VARIANT
so ... all uppercase
 
9:47 AM
snake_case_is_words_with_underscores
SHOUT_CASE_IS_THE_VERSION_WITH_CAPS
PascalCasingUsesCapsTolerantly
camelCasingIsPrettySelfExplanatory
That was a weird poem.
 
Great. Thanks all three of you.
 

« first day (1628 days earlier)      last day (3306 days later) »