« first day (1637 days earlier)      last day (3302 days later) » 
00:00 - 11:0011:00 - 00:00

12:54 AM
lol
 
1:06 AM
\o/
 
2:05 AM
Hi, need help.
I initialized a Boolean variable to false in a singleton classAnd when I run sequential txns whenever the variable is set to true For all the next txns as well it is set to true
The boolean value is not changing it returns same everytime
 
2:32 AM
@Kylar, i know programs can be run independently of an IDE, I have no idea why i specifcied that...it seems kinda obvious in retrospect
@Kylar our school computer network has a certain capacity of users that can use the internet at any point in time, and when the programming club and programming classes try to run Hour Of Code (you can google if you dont know what it is) the internet bugs out and people cant get on, it gets messy and frustrating, so I have approached my teacher who pretty much has point on this hour of code thing and asked her if i could create a program that takes the function of
the hour of code website and puts it into a program that all the computers can use, thereby making internet issues irrelevant
My guess is it would be installed onto all the computers via the network or something, the same way they install stuff on all machines at once. I know nothing about networks, so the actual install is not my business (unless it is my business) , I just need to write good code. @Kylar
 
2:56 AM
morning java :)
 
Morning :))
 
hello
 
3:17 AM
Morning!
 
hey
 
@JohnnyCoder That's impossible.
The throttling is caused by limitations in the bandwidth within the internal network. Developed software won't change anything.
46 mins ago, by Johnny Coder
My guess is it would be installed onto all the computers via the network or something, the same way they install stuff on all machines at once. I know nothing about networks, so the actual install is not my business (unless it is my business) , I just need to write good code. @Kylar
"I know nothing about networks" -> Then you shouldn't approach this problem at all.
 
yeah
 
Morning
 
Good morning.
 
3:31 AM
@Uni you know about policytool packaged with jdk?
 
?
 
Here is this code:
public static void main (String... args) {
        try {
            Socket s = new Socket("173.194.78.99", 80);
            System.out.println("Connected!");
        }
        catch (SecurityException e) {
            System.out.println("SecurityException: could not connect.");
        } catch (UnknownHostException e) {
            System.out.println("UnknownHost: could not connect.");
        } catch (IOException e) {
            System.out.println("Exception: could not connect.");
        }
    }
I have a policy file and that is:
grant codeBase "file:/home/shakeel/git/Exercises/" {
  permission java.net.SocketPermission "173.194.78.99", "connect";
};
 
file:// ??
 
java -Djava.security.manager -Djava.security.policy=PolicyTool.policy
            PolicyToolDemo
Yeah, it still throws Security Exception, couldn't connect
 
3:47 AM
??
 
Check Firewall config , Permission etc
 
@deadlydragon00 It can connect if I run without -Djava.security.manager flag
Not sure, if security manager has anything to do with firewall?
 
why not used permission java.security.AllPermission;
 
@deadlydragon00 Why do I need AllPermissions?
I am just pushing Socket so I need only SocketPermission, no?
 
Basically why do you want to create a socket connection if you don't allow any connection..
 
3:53 AM
@deadlydragon00 Eh?
You see, I am just practicing policytool :D
 
[Windows] Basically before you can run a socket , it will ask you to grant a permission to overide firewall settings.
 
And the first thing is not even working
@deadlydragon00 Now, I have even tried disabling firewall, still same
 
how about anti virus - it has a firewall also
 
No antivirus, I hate antiviruses
 
so you are a mac user?
 
3:58 AM
No, I am a ubuntu user
 
an* and me too!
 
@Unihedro Yeah an* :D
 
ok , sorry Im not an ubuntu user... I can't tell
 
@Uni can you see the problem with the policytool? I mean do you know what might be wrong?
 
I don't know sorry :(
 
3:59 AM
Aaah, even you dont know :(
Neither do @fge
Only one person on earth is left now :P
@Kylar
 
@Mr.777 I'm not from Earth.
 
@Unihedro Yes, I know
 
^^
Have you tried looking at the docs?
 
Is there docs for policytool?
 
4:10 AM
@Mr.777 yes
 
@Unihedro Reading this
 
@Mr.777 k
:D
 
5:13 AM
Hello i miss the wise pips @fge @Unihedro @Gemtastic @ItachiUchiha
 
wise pips?
 
5:47 AM
@Unihedro :P
☺
 
gud day
cant able to read my cookies in another page it returns something like session id in my JSP
page 1:
<form action="cookie2.jsp" method="post">


<% Cookie ck=new Cookie("user","sonoo jaiswal");//creating cookie object
response.addCookie(ck);//adding cookie in the response %>

<input type="submit" value="go"/>
</form>
page 2:
<body>
<%

Cookie ck[]=request.getCookies();
out.print("Hello "+ck[0].getValue());
%>
</body>
this is the o/p in page 2:
Hello 901E5790A2EBCA2F291657E4EB82E761
 
Cookie???
Your import?
 
no import i used
 
Print ck[0].getName()
And see what does it print
 
6:02 AM
JSESSIONID
getName() prints the above value
 
So, it's not getting the "user" key at all.
That's why it's printing the sessino id
 
i know that but where the problem occurs with?
 
When you press Go button on page1 it goes to on page2?
 
yeah
 
Because your cookie is being written to the response when page1 is caled not for page 2
You need to submit the form-> write cookie in response, push the response and get the cookie
You know everytime a new request is generated by tomcat container, right? (I assume you are using tomcat)
 
6:13 AM
If my class extends Object, is there any reason to make a call to super in the default constructor?
 
Every class in java extends Object if it doesn't extend anyother class
 
that is true, but does Object's compiler created default constructor do anything?
 
If Object class has parametrized consturctor (which it doesn't) then you can call super(a,b,c) otherwise, compiler implicity places super()
as first statement of the constructor
 
so it would be pointless for me to put a call to super() in my class' default constructor?
 
@JonnyHenly Indeed!
 
6:17 AM
@Mr.777 Ahh thank you : )
 
np
 
@Mr.777 response.addCoookie() this adds the cookie in response right?
 
@greenhorn Yes but to the response of page1
So, when you hit page1.jsp from browser, it's not sending it's response to page2 or is it?
 
how can i detect whether a JSP is sending response or not?
 
@greenhorn Let me explain.
In page2 you are trying this:
Cookie ck[]=request.getCookies();
which expects that the request contains cookies.
You expect that it should have cookie "user" but you are never sending this cookie from page1
On page1, even before your press Go button, your response has been written and the cookie is sent back to the response.
So, in order to prevent that, you can have a middle page or a servlet which acts as a communication between page1 and page2
From page1, you submit the form to Middle Page OR Servlet, which accepts the form data, write cookie(s) to the response and responds to page2
From page2, you can then get your cookies which you have set in the response because that response is now page2's request.
Hope that makes sense :D
 
6:30 AM
@Mr.777 i first did using servlets only since it didn't worked i tested it with JSP's alone
 
@greenhorn Then you might have done wrong :)
 
i am using struts
 
@greenhorn Where do you get servlet in struts?
 
i mean action class only
 
9
Q: Using cookies with Struts 2 and Struts

ChrisI've got the following (shortened) struts2 action: public class MyAction extends BaseAction implements CookiesAware { public String execute() { if (cookiesMap.containsKey("BLAH")) blah=Integer.parseInt(cookiesMap.get("BLAH")); return "success"; } // For handling cookies...

 
6:37 AM
@Mr.777 ] i thought we can access cookies like sessions from anywhere directly by using something like getCookies()
 
@JonnyHenly no - Object does not have an explicit constructor that demands invocation
@JonnyHenly no
Oh @Mr.777 already answered :p
Well done!
 
@greenhorn session is stored on server while cookies on client
 
Good morning, Java
 
Morning!
 
6:52 AM
@greenhorn Yes that's true but you are trying to get cookie from request where as you don't send cookie to request anywhere at all
You can try this to get all of the cookies though:
0
A: Can it possible to get the cookie value over the application?

Mr.777You can try using CookieManager and set it's Cookie Policy to ACCEPT_ALL and then using CookieHandler, get the Cookie store. CookieManager cookieManager = new CookieManager(); cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL); CookieHandler.setDefault(cookieManager); //creates url for the g...

 
@Mr.777 oh is it, thanks for ur effort of helping me, appreciate you
 
@Mr.777 why not multicatch?
} catch (MalformedURLException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
} catch (IOException e) {
	e.printStackTrace();
}
} catch (MalformedURLException | IOException e) {
	e.printStackTrace();
}
 
@Unihedro Edited, thanks :)
 
Ugh clash
 
LOL
You already did
 
6:56 AM
no panic I'll fix
 
Okay
@Uni I have seen that you replaced it's with its, shouldn't it be it's?
 
Where?
 
In my answer
 
it's its.
 
Confused :D
it's and its are different?
semantically
 
7:00 AM
it's = it is
its = the following clause describes something that belongs to the prior object
 
Oh perfect
 
Much like he's (he is) and his (belongs to him)
It's a cookie.
The cookie jar has its cookies.
 
Okay
 
He's a cookie jar.
His cookies are stolen from it.
 
Funny :P
 
7:03 AM
meh silly :p
 
java -jar cookie.jar
 
7:15 AM
Hello Java!
 
Hi
 
Hiya!
 
Sup!
 
fge
7:26 AM
Meh, I have more test code lines than "real" code lines
 
@fge Morning
 
fge
Good morning too!
 
Morning
 
8:23 AM
yawns
 
~dead room
 
they are coding
 
meh...
I am mostly waiting for my application server to restart whenever I make a one-letter change to a certain constant in my code
 
@Vogel612 Which server you are deploying to?
 
8:32 AM
tomcat
and no I can't use nice things, because redefnition of constants and changes in class / method-signatures aren't supported
 
tomcat is a container. Plus, I think hot deploy is available for tomcat 8 now
 
JUnit will save you
 
... did you read what I wrote?
@JudeNiroshan I seriously doubt I can JUnit test the proper display of percentage format in exported excels
 
serilization ? why dn't you try it out...
 
@JudeNiroshan it's not even getting better...
serialization is seriously broken in java
just as cloning, generics and arrays are
 
8:40 AM
Minus generics and arrays.
 
meh..
maybe not seriously, but at least broken.
 
Java doesn't even have generics or proper array structures.
Fake != broken
 
accepted
 
agreement reached, terminating
 
meanwhile JasonC and Ed Cottrel beef it out in the Elections
 
8:42 AM
Good luck to both of them :p
Though tbh I don't see either of them winning even if they make it into secondaries :S
 
consider that session management using cookies and while using the web app if user deletes the cookies what will happen at that instance?
 
hmm...
@greenhorn you don't manage sessions with cookies
@Unihedro dafuq??
 
@Vogel612 i mean user tracking cookies not HttpSessions
 
"user-tracking cookies" -> never trust the client
 
Trusting clients = opening up vulerabilities
 
8:45 AM
i am using cookies to store the user type and wanna access them in all my JSP's
 
@greenhorn iow: you don't track users in cookies
 
@greenhorn don't
doing it wrong
 
^ that
 
then what purpose the cookies are meant for?
 
@Uni please have a look at this
-3
Q: Two Dimensional Matrix operations in java

anilkumar manjulurihow to shift the rows of a 3x3 matrix.what is the basic code for this type of operations like shifting rows(up,down,right,left) or shifting columns(up,down,right,left).please provide the java code

 
8:48 AM
mostly stuff that is not actually important
 
@greenhorn user agent preferences and tokens that doesn't make it into important bars
 
user settings
@Mr.777 what about it?
 
@Mr.777 plz gimmeh teh codez
 
oh!!
 
@Unihedro LOLz
 
8:49 AM
Write code. I accept Paypal. — Unihedro just now
 
junk question that should be deleted
 
That's what I meant
I have even flagged that
 
y u onebox this then? ლ(ಠ益ಠლ)
 
i want to store the user type and wanna access them in all my JSP's so how do i do that without cookies
 
no emoji plz
not that its annoying
@greenhorn user management system?
 
8:50 AM
@greenhorn did you hear about databases?
 
@Vogel612 I would like a magenta colored one please.
 
@Vogel612 please tell it clearly i couldn't catch your point
 
storing things for a webapp: use a database
 
@Vogel612 i am using MySql to store the things i had to display different 3 menu sets for 3 types of users so i retrieved the user type value from DB and stored it in cookies and accessed that value in all JSP to display the menu which matches the user type
 
8:57 AM
Woot MySQL
 
fge
Ick, MySQL
 
aside from that... WHAT??
 
fge
Use PostrgeSQL
 
you use cookies to transfer data from your backend to your jsp's?????
 
JSP + cookie misuse + MySQL, fun
 
8:58 AM
Really, really, the client can not be trusted
 
@Unihedro :P
 
@Vogel612 yes
 
not judging
 
@greenhorn Why not store in session?
 
nuclear weapons grade facepalm
 
9:00 AM
@green What is the purpose of storing the user data in cookies? Is it required by your application or you yourself is planning to solve this way? What are the things in your mind that wants you to use cookies?
 
okay that's it
I hate apache POI
 
@Mr.777 do you remember that yesterday we discussed about the session destroying before its timeout that's the cause that pushed me to cookies
 
@greenhorn So instead of solving that problem you pushed yourself to implement one more wrong solution?
2
 
The solution is not working around the session crashing, but fixing the crashes
 
And yes, I do remember we discussed that yesterday.
 
9:02 AM
Did you try profiling the memory use?
 
What are you putting in sessions? Which information?
@Khieru I don't think PermGen error will be solved by profiling, correct me if I am wrong
 
@Mr.777 i am storing user type i.e 3 character in session
 
@Mr.777 but it should lead to the place where memory leaks, and in return usually allows fixing the problem
 
@greenhorn Okay and you are using tomcat, right?
 
was it really established it was a permgen problem? iirc it was not something that occurs consistently, which would seem more of an ordinary memory leak
 
9:05 AM
@kiheru Yes
 
@Mr.777 yeah
 
@greenhorn And IDE?
 
Netbeans 7.4
 
Alright, so, can you see setenv.bat or sh file in your tomcat/bin directory?
 
eeek dos...
 
9:12 AM
@Mr.777 startup.sh i see
 
@greenhorn Alright, then create a new file setenv.sh
Paste these lines in the file:
export JAVA_OPTS="-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m"
 
@Mr.777 how to create that file
 
> vi setenv.sh
Paste that in file
> Esc and then :wq Enter
 
@greenhorn "touch startup.sh" ?
 
@OlegKuznetsov startup.sh?
 
9:16 AM
whoops
My bad: I've misread
 
touch filename
 
@Mr.777 can't get you man, how to create that file
 
Linux 101
 
@greenhorn what @Unihedro said
 
@greenhorn I have told the whole set of instructions to create the file
@Unihedro touch only updates the timestamp to the file, no?
 
9:18 AM
@Mr.777 it creates it if it doesn't exist.
You can then vi filename
 
@Unihedro Okay but vi filename also creates if it doesn't exist
 
^^that
@Mr.777 actually not until you save...
 
^
 
alternatively just cat stuff into the file
 
@Vogel612 Oh yes, that's true
@green You created the file yet?
 
9:20 AM
@Mr.777 no man i don't know to create that and i can't understand wat u r trying to say for creating
 
@greenhorn Open Terminal
change directory to tomcat bin directory
touch setenv.sh (write this in terminal)
If it says, Permission denied
try with sudo touch setenv.sh
Once file is created
open it up with sudo nano setenv.sh
Paste the contents I have pasted in the chat (scroll up)
Then Ctrl + O
Then Ctrl + X
 
Suggesting vi to someone that does not know how to create a file sounds rather wrong to me
 
@kiheru I didn't know he knows so I changed it to nano now
 
'touch' is not recognized it says
 
Once file is created and contents are updated, restart tomcat
@greenhorn Then do sudo nano setenv.sh
 
9:24 AM
@greenhorn soo... you're using windows??
 
yes
 
@Mr.777 Seems a good choice, assuming nano is installed
 
Ops Ops Ops
Windowsssssss
 
aaaargh :-D
 
@green right click in bin directory and create new file setenv.sh
 
9:25 AM
AFAIK touch is installed on any *NIX system
 
But I think it should be setenv.bat
@green can you paste a screenshot of your bin directory?
I will be back in 10 minutes
Meanwhile others can help you @green
 
Missing startup.bat is not necessarily missing either. It can be just the idiotic default settings that hide the extensions
 
how to paste my screenshot in this room
 
there should be a small "upload" button next to send
or you don't have enough rep...
 
external services such as imagebin.ca are fine too
(does not require an account - that's always a bonus)
 
9:32 AM
here is my screen shot
 
There's the missing startup.bat too. It's windows hiding important information as I guessed
 
and kiheru was right yet again ;)
dammit I really want to rm -f *.bat
 
Hi, I have 2 jar file residing on two different server. I want to execute Jar2(located on different server) once Jar1 completes it execution. I guess i can use jar1 to execute Jar 2 but dont know how. Could someone tell me how could this be done in Java
 
I swear that feature was invented to cause confusion in users and loss of hair for anyone who needs to support others. I don't remember seeing any other feature cause as many problems as that
 
@kiheru no clue
 
fge
9:35 AM
What feature?
 
@Tarun why would you ever need to do that?
 
@fge Hiding file extensions
 
fge
Ah, yeah
And an extension is nothing else but part of a file name, really
 
The Jar1 would run daily and get data from some xyz resource. Jar2 would get data from jar1 only after it has obtained all data from xyz. The reason why we want to trigger Jar2 only after jar1 completes it execution is because we dont want Jar2 to get data from Jar1 data while Jar1 is in execution state.
 
@Tarun then check how long it takes for Jar 1 to complete, add some additional buffer and have both run on separate cronjobs
or make jar1 provide a completion flag and have jar2 check for it and await it
 
9:47 AM
Jar1 could run once/twice/thrice in a day. The frequency of cron job executing Jar1 could change in future. I dont want Jar2 to keep pooling to see if Jar1 has completed its execution. Plus there is one more problem with flag ..
Say jar1 has scheduled to run at 10.31 and jar2 found out at 10.30 that Jar1 has completed its execution and it starts fetching data from Jar1. If jar2 could not fetch all the data in between that duration(1 min), Jar2 would be fetching data while jar1 is in execution state.
What i am looking for : Jar1 to start execution of Jar2 as soon as it completes its execution
 
@Tarun and I'm telling you to not do that, but okay ;)
 
@Vogel612 could you please tell me why should i avoid doing that
 
Does not leave much choice except listening to some sort of notifications
 
@Tarun because one server should be separate from the other
it's as simple as that
but if you can't help making dependencies, a "pull" workflow is easier and cleaner (as well as less error prone) than a "push" workflow
 
Do you mean pooling by "pull" workflow?
 
9:54 AM
not necessarily, but sometimes that's included, yes
 
pooling or polling?
 
@Tarun Aaah thanks for that by the way
 
@Tarun inappropriate and narrowly scrapping offensive IMO...
 
10:29 AM
@Tarun How is this different from english.stackexchange.com?
 
@ItachiUchiha one is for learners, one for "enthousiasts" and professionals
the linguists were fed up with easy questions and decided to branch out
 
Hello everybody :P
 
Hello
 
Hello
 
10:41 AM
Adios :P
 
ASR
hi all ! how are you?
 
Hello
The Punisher :D
@Vogel ^^^
 
@ASR Staring at exchange rates. No idea why.
 
Hi all
 
Hiya @AniketDeshmukh
 
ASR
10:46 AM
I did not get ur question, I just voted u in moderator election. that is you are asking?
 
Well, you asked how we all were :p
Also, thanks!
 
can you tell me in xml file can i write url like that
<connection-url>jdbc:sqlserver://localhost:1433</connection-url>
or need to add database name in url
 
> Sorry, i can't accept the answer, because i have as beginner of StackExchange not enough Points ;-) I have 5 Points, need 15
^^ What is he talking about? Is this for real?
 
ASR
@Unihedro :)
 
@ItachiUchiha no
they tried upvoting instead of accepting
Hint: Link them to the help center article.
 
10:48 AM
Cool :)
 
Java Devs: We code hard in this cubicles ...
:D
 
@Adio "trying"
Well, my code is compiling.
 
why ?
 
=about
 
OakBot v0.0.2 by Michael | source code | built: About 5 days ago. | started up: About 5 days ago.
 
10:56 AM
@Unihedro I am struggling with Spring Integration here :"D
 
Which language is when we do javap -c SomeClass
 
@Adio Spring is... hell
 
00:00 - 11:0011:00 - 00:00

« first day (1637 days earlier)      last day (3302 days later) »