« first day (1368 days earlier)      last day (3587 days later) » 

1:25 AM
Hi-ya
 
@Karl Hello
Trying out coding bat for the first time.
 
Coding bat? .BAT?
 
Interesting..
 
Really interesting. Only on the fourth intro Java test.
Feeling smart so far ;)
@Karl What's going on with you?
 
1:41 AM
Came up with a GREAT idea for a game. Java skills not good enough, found a guy who helped me make it a reality. Now, need to make it as an android app so I can make money from it
 
Excellent. What's the concept?
 
@aliteralmind Thanks for codingbat!
 
@Unihedron You're welcome. Just discovered it. On test six I think.
 
That's also my first animated .GIF
 
@Karl. Looks very cool. Find a word, it disappears, other letters fill in that spot? I'm a sucker for boggle-like games.
I'm a bit of a Boggle-savant. :)
 
1:56 AM
It gets VERY challanging
It's not a CASUAL word search
 
How long until it get hard? The "honeymoon phase"?
 
Define hard
I've found ONE 6 letter word in all of testing
 
I guess it's all just "good hard" then.
 
If I could get it as an Android App, I'd be SOO happy!
 
Good luck!
 
2:05 AM
@Karl Good luck indeed! I only wish I had an android to give it a try!
 
Thank you
It was a LONG time developing...
 
2:20 AM
How long until you think it might actually be up for sale?
 
2:33 AM
No idea. It's stalled right now. I'm not making progress on figuring out Android programming myself, and the person who helped me get as far as I am is unable to help me continue do to hardware limitations
 
Best of luck with it. Exciting times.
 
I was SO happy to get a running copy of the game PERIOD!
 
That moment when you thought by "SO" he meant StackOverflow. >_>
 
There is no happy like Stack Overflow happy.
 
I'm one-lining these codingbat string manipulation problems with regex, I should feel bad lol.
 
2:48 AM
I'm on 19. Haven't used any regexes yet.
Here's my testing framework:
public class Test  {
	public static final void main(String[] ignored)  {
		for(int i = 12; i <= 20; i++)  {
			for(int j = 12; j <= 20; j++)  {
				for(int k = 12; k <= 20; k++)  {
					test(i, j, k);
				}
			}
		}
		test(13, 20, 10);
		test(20, 19, 10);
		test(20, 10, 13);
	}
		private static final void test(int a, int b, int c)  {
			try  {
				System.out.println(a + ", " + b + ", " + c + " --> " + hasTeen(a, b, c));
			}  catch(Exception  x)  {
				System.out.println(x);
			}
		}
public static boolean hasTeen(int a, int b, int c)  {
(with test 19)
 
Berry nice!
 
Damn. I'm reaching the point where I'm going to have create units. Too much data to browse and confirm.
 
Is there a time limit on each?
 
Nope. It's pretty casual.
Imagine if the final levels are like: Implement <requirement>. No googling. You have 10 minutes.
 
21 up, 21 down. No errors yet :)
This is fun.
...until it's not.
 
3:00 AM
When I was working on the first ver of the engine, I went to my Java teacher to ask him a question about the 2 dim array I use. He was a little surprised at the array, took him a second to focus on the problem.
 
I'm getting all these solutions right on first try. (Except the ones which I didn't.)
 
EVERYBODY has their strong point
I win EVERYTHING that I don't lose on!
 
I've never lost things that I've won! Ever!
So what'd the professor think?
 
Was seriously impressed
For the final game, I had to re-write the entire thing! I've been referring to it as "Going digital" to allow for specialties.
That was a GREAT thing. I cut it by close to 10%, and even added a little bit to it
 
"Going digital"?
 
3:06 AM
Although, I will admit, I did something in one of the methods that MOST coders HATE.
I originally stored letters, the rewrite was to just manipulate numbers.
I used a reversible loop
The loop itself only has about 2 lines of code in it, and to write two methods seemed stupid and a waste of memory
 
*sees a problem with ranges and two numbers* "Let's use Regex!" *solves it with regex* I'm too good at this...
 
{ // WARNING: Reversable Loop!
int inc = (start > end) ? -1 : 1;
end += inc; // Setup for direction
for (; start != end; start += inc)
{ // And, we're off!
Is this really that bad?
 
What's 'end' initialized to?
Here's my solution to startOz.
 
Sounds like it can do with while((start += inc) != end), but I don't know.
 
public static String startOz(String str)  {
	if(str == null  ||  str.length() == 0)  {
		return  str;
	}
	char[] ac = new char[2];
	if(str.length() >= 2)  {
		ac[1] = ((str.charAt(1) == 'z') ? 'z' : ' ');
	}
	ac[0] = ((str.charAt(0) == 'o') ? 'o' : ' ');
	return  new String(ac).trim();
}
A bit ridiculous, but gets the job done.
 
3:12 AM
I used regex.
return str.replaceFirst("^(?:(o)|.)(z)?.*", "$1$2");
 
Nice one. Not in a regex frame of mind yet.
I'll likely steal that going forward though.
 
Hehe.
 
@Karl What's end initialized to?
Totally aced the intMax one :)
 
It's hard to solve max1020 with regex. xD
 
36 characters, including the "return", semi-colon, and extra space, because I was feeling saucy.
 
3:19 AM
Start and end is passed to the method
private int cycle(int row, int start, int end, int lowLine)
{ // WARNING: Reversable Loop!
int inc = (start > end) ? -1 : 1;
end += inc; // Setup for direction
for (; start != end; start += inc)
{ // And, we're off!
 
10 mins ago, by Karl
Is this really that bad?
 
Hard to get just by looking at it. I need some explanation and example calls...
 
That's why I added the first line of the header, so you can see what it gets...
 
Ha, nailed lastDigit with regex.
 
That loop has a single IF statement, with a single line if true, and it's the heart of the engine
Good job @Unihedron
 
3:25 AM
@Karl Thanks!
 
NP
 
@Unihedron Damn. You're fast.
But it's 1130 at night here. So you're fresh, and I'm running on fumes.
Therefore: I win ;)
 
Oh, you're a winner regardless. :P
 
You don't even have to come in first to win. Just try
My son bought Forza 5, it got here today... Going to race a bit more...
 
3:31 AM
Have lots of fun!
 
I does!
 
I'm at the last chapter for Warmup-1, and I come to the depressing hit that I can't solve this with pure regex.
 
I'm going too. Goodnight gentlemen.
 
Good night!
 
I have a Jeep Grand Cherokee SRT8 TOTALLY maxed out. That thing is FUN to race!
 
3:33 AM
Enjoy. See you tomorrow.
 
It's about as fast as the high performance sports cars, and I have WEIGHT, so if I tap somebody from behind, they bounce!
 
Lol!
 
Took out a Porsche 911 that way
Let me take the lead
 
 
1 hour later…
5:04 AM
@aliteralmind Mine was: return String.format("%s %s %s", a, b, c).matches(".*1[3-9].*");
 
 
2 hours later…
6:55 AM
I don't understand how people upvote content like this...
 
7:10 AM
Hello alll
 
@Swap-IOS-Android Greetings!
 
@Unihedron hello
can you help me?
 
What is it you need? I don't magically figure out everything, so you'd have to ask first.
 
i have question on using ibatis
i have problem to configure ibatis on my web service of JAVA
ibatis is no longer supported my apache but my project is based on iBatis database framework so i have to use it
 
Ah.
 
7:22 AM
Is there anyone who familiar with J2ME
 
 
1 hour later…
8:51 AM
hey everyone
 
@ItachiUchiha Hi there!
 
@Unihedron ssup ?
 
@ItachiUchiha Everything's well over here, just got home from under the rain.
 
@Unihedron you code minecraft ?
 
@ItachiUchiha A server. The proxy, the plugins, the shell code to keep it running and whatnot.
 
8:57 AM
@Unihedron yeah i know about the server, I had worked on one many years ago ! Good to see, the things still running :)
 
@ItachiUchiha Yep! :D
By the way, I like "The March of Progress". xD Made me laugh. :p
 
you are 16 and you are coding a server :O
 
9:18 AM
And yeah, I'm a living person.
 
@Unihedron lolz, that thut never crossed my mind ! :P
 
I'm just this other person, though. xD
I'm lucky to have learned how to code.
 
9:35 AM
well we all are @!
 
Cheers!
 
10:03 AM
hi all
any body having experience in spring mvc and jdbctemplete
 
@Sandy yes
 
@ItachiUchiha while using jdbc templete for connection in my application i have lots of open session on tomcat that causing speed issue for application can you help me in that so i can automatically close the open connection
 
If you're using the JDBC template you don't have to worry about explicitly closing connections, Spring will take care of it internally !
 
i followed the same concept but once i deployed my application on tomcat on production its showing around 10000 open connection
that causing speed issue
 
10K jdbc connections ?
 
10:09 AM
no open session on tomcat
 
have you assigned the max connection size ?
 
earlier i did not do so but i have applied using dbcp
 
Hi everyone
Anyone doing scala around here?
 
but this cause another issue like when i meet the maximum connection then my application stop responding to new user
 
@Ruraj scala, nope
@Sandy hmm, that happens when you exceed your maximum connection size limit
 
10:15 AM
@ItachiUchiha how can i configure to make close idle connection automatically
 
@Sandy strange, this should not be happening if you are using spring jdbc template
can you show me anyone of you dao methods, where you are trying to use it
 
ya sure give me some time
@ItachiUchiha pastie.org/9411842
look at it
this one is one sample class
@ItachiUchiha did you check that
 
Nice, it's a default license header template.
 
:D
its just sample
 
My default javadoc comments are like this:
 
10:30 AM
i did not customize the templete as per need
that also a good idea
@Unihedron can you help me in my issue
 
@Sandy I'm not certain where the problem may lie though, and I'm not really experienced on jdbctemplate, I'm reading through your code at the moment.
 
Adi
11:23 AM
hiii... Can anyone help me please
 
@Adi Hey there - what is it?
 
Adi
I am trying to call a servlet from my android app
but everytime i pass the params to servlet the servlet is not connecting to myl
mysql
and I am getting Class Not Found error
please help
@Unihedron........ u got my isue?
issue?
 
ClassDefNotFound or ClassNotFoundException ?
 
Adi
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
now i have added the jar too
 
Sounds like the Driver you're requiring isn't there. Are you sure the jars are present?
 
Adi
11:27 AM
yes
i copied the jar in webINF/lib
and then added from build path too
 
So it's present in the execution environment?
 
Adi
explain please
 
Adi
means?
 
Click on the link perhaps?...
 
Adi
11:34 AM
I am simply trying to verify the username and password entered in android and when user clicks on login button it should communicate with servlet which in turn is verfying the credentials from datbase
 
11:47 AM
Is code running on server or in client app
To connect to db?
 
hello every one.. anyone here interested in JDBC?
 
Mmm, Java Database Connectivity which I have yet to learn.
 
Adi
my code is running
i mean servlet
but it is just its not getting values to verify from database
 
??? I thought you had a ClassNotFoundException?
 
Adi
yes
 
 
3 hours later…
2:58 PM
Anybody familiar with JNDI resources?
 
Haven't any experience, sorry.
 
It seems these things are really wonky to configure.
 
Good morning.
 
Morning
 
JNDI troubles still got you down?
 
3:02 PM
Morning!
 
@aliteralmind: It's just not that easy to create a resource and have it configurable the way I want.
I got the resource working. But, if I wanted to make multiple environments and have each server configured to override the default resource settings, well.. that's not going to work nicely
I'm trying to keep the environment-specific settings out of the source.
But it seems I have no choice.
 
Wish there was some automated thing to push updates to each system's configuration.
 
 
1 hour later…
4:34 PM
Good night! (love how these timezones work - laugh out loud zebras)
 
4:57 PM
Eh all
 
5:13 PM
I showed that piece of code from yesterday to a co-worker and he couldn't stop laughing
the Math.abs(rand.nextInt() >>> 1) % 3
 
5:36 PM
whos good with java server faces?
 
No-one really, but post your problem and we'll all take a look
 
I just cant get the index.xhtml file to display any data
it keeps saying "list" is not readable
public void setList(ArrayList<String> list) {
this.list = list;
}

public static ArrayList<String> getList() throws IOException {

String line;
ArrayList<String> list = new ArrayList<String>();



BufferedReader in = new BufferedReader(new FileReader("/Users/simon.bitton/IBM/rationalsdp/workspace/primefaces/src/main/java/com/mkyong/editor/filelist.txt"));
while((line = in.readLine()) != null)
{
for (int i = 0; i < 20; i++) {
list.add(line);
}
}
in.close();

System.out.println(list);
System.out.println("hello");
private ArrayList<String> list;
that is all in my bean file, but i have no idea what i am missing
 
5:57 PM
Do 2 things: 1) put the whole bean in a paste bin (pastebin.com) and show us (or create a small one just to demonstrate the problem), and 2) show us the whole error
 
Ok, this is not causing your issue, but I'll give you a quick tip: Use something to differentiate your instance variables (that belong to the class) from the method scope variables.
in the getList() method, you create an ArrayList called list and manipulate it, and that's the same name as the ArrayList that belongs to the class.
so call the class variable _list or something
Ok and what is the exact error stack you're getting
The code looks relatively fine, except that you're taking an ArrayList in setList() and setting it, but never using that list again
 
what do you mean never using it again?
i got it to work before, but i am missing something very small
thanks for your help btw
 
np
So you have a setList(ArrayList<String> list)
where you take in an ArrayList and store the reference
 
yes
 
6:08 PM
but then you don't do anything else with it
It just sits there
 
what is the difference between that and the "value" example? the value will show, but not this one, i tried to make it the same as that
i also have the getList, I thought that was doing something with it
 
So the problem is that you didn't write an actual bean
your getList() method should just return this.list;
the fact that you want to do that other stuff to create the list is seperate
and it can't be static
so do this:
(1 sec, paste bin coming.)
 
ok thanks
i have honestly been looking at this for like 4 hours straight, i couldnt find other examples, looked everywhere, not even sure what the problem was to begin with...
 
OK so I moved out all the create stuff to a separate method
then inside the getList() I just check if it's null and if so, I create the new list
In addition, that will now fulfill the bean contract since I removed the static
bean accessors and setters can't be static.
 
why did you make it private instead of public?
 
6:15 PM
the create() method?
because the only place it gets called is from inside the class
How long have you been doing Java?
 
i see...
 
a few weeks/months?
 
yeah, i went through a lot of coding bat so i know a lot of that kind of stuff, but this stuff is a little reaching for me
 
Ok, you should read this:
If you only ever read 1 book about java
this is is
this is it, rather
 
man ive tried reading the books, i cant learn anything from them
 
6:16 PM
This one is way different than all the other ones
each bit is only 1-2 pages and is right to the point
 
ok i will check it out
dude awesome this worked
why did you change the name to createList? does the bean file have preset values to read if it says get<variable name> ?
and the getList you used again
 
a bean means that for any property that you want to expose, you need to have a getter and setter method
so if you have a variable like this:
private String name;
you need to have these two methods:
public void setName(String newName) { this.name = newName;}
public String getName() { return this.name; }
if you had:
int myAge = Integer.MAX_VALUE;
you'd need:
public void setMyAge(int newAge) { this.myAge = newAge;}
public int getMyAge() { return this.myAge;}
and so on
that's one of the things that makes a bean bean
339
Q: What is a JavaBean exactly?

Amir RachumI understood, I think, that a "Bean" is a Java class with properties and getters/setters. As much as I understand, it is the equivalent of a C struct. Is that true? Also, is there a real syntactic difference between a bean and a regular class? Is there any special definition or an interface? Ba...

 
makes sense.. is the setName and getName actually literally read and the program sees the "set" and "get" or can those be called anything if the methods inside do the this.whatever and the return etc..
ok i will look at that, i thought this was specific only to java server faces
so youve done setter, getter, and bean outside of java server faces?
 
Yes, it's a pretty standard java paradigm
 
i seel ots of libraries depend on it
 
6:23 PM
JSF makes use of it
 
right yeah... cool
how come u dont just put return.list for the getter? instead there is a loop?
i mean logic
it does not work without it.. interesting
 
Normally a bean would just hold that data, but you need to initialize the list from somewhere
you should be doing it in a different way, but then we're getting into some more advanced design questionx
question
s
 
really i should? i did it before and it worked.. im not sure what i did differently tho, i got lucky, i thought i copied the way value was, but i did not do it the way you did
yeah this is not so complicated
 
The problem is you're just copying stuff and you don't really understand how it works. There are good tutorials that will teach you if you take the time
 
yeah true
 
6:29 PM
Ok I need to go drop the kids off at the pool
 
im going to read up setters and getters now
 
And by pool, I mean the toilet
 
ok cool thanks for the help
lmao..
see ya!!!
 
6:50 PM
\o
 
7:17 PM
if I have two classes how do I include a method from one into another? Do I need to extend another method?
 
 
2 hours later…
9:19 PM
Anyone here?
 
9:34 PM
I am...now
 
10:22 PM
Does "util" in java.util.* stand for "Utility" or "Utilities"?
 
10:51 PM
any one worked on Weblogic workshop?
 
user2932587
11:20 PM
Anybody willing to take a look at my code and see if you can spot why I'm getting a "cannot find symbol" error? I've been going through it for a while and can't see what I've done wrong.
 
11:57 PM
anybody familiar with jsr-330 / plexus / spring?
(hi)
 

« first day (1368 days earlier)      last day (3587 days later) »