« first day (835 days earlier)      last day (4113 days later) » 

7:00 AM
Did you ask the question on Forum?
 
Please concentrate on for loop, as you might get confused with the android code which is apart from that for loop.
 
I'm concentrating.
 
Ok Rohit i dont want to take too much time of you last question. suppose i have str ="Hello rais your password is @password@ you can change your @password@"; and i want to replace every char between two @ by *
 
Hmm..
@Real. Ok, so, you can create the regex yourself now.
try it out.
 
As you can see in that code. I am getting response from the server in json format. From that I have extracted data and stored each product data in hashmap and then each hashmap in arraylist.
 
7:01 AM
based on the previous regex.
 
ok i will be bcak soon
 
@Appu.. Ok.
And the problem is?
 
@Roh
 
@RohitJain Please don't keep dots next to name as I am unable to get notified when I am not on current tab.
 
@RohitJain I tried str = str.replaceAll(".(?=[^@]*[@][^@]*$)", "*"); but failed get desired output
 
7:05 AM
@RohitJain But I don't wanna follow that approach now as it is blocking me from updating my UI until I download the entire data.
So, I decided to use this.
// productsListData.add(new DataSource(products.getJSONObject(i)));
Can you see that in my code with the above line?
 
@Appu.. Yeah.
@Appu What is new DataSource()?
@Real Ah! Yeah didn't notice that would fail for multiple patterns.
Will post an edited version in few minutes.
 
ok
 
Humm...
 
So, in this way, rather than getting each data in for loop. I am storing directly the json object to datsource object. @RohitJain
 
7:13 AM
@Appu In that case also, you would have to do the iteration.
To create multiple data sources to add to array list
@Real There is big change in regex bro.
If you want I'll post it here.
 
ok
 
Yeah. But it provides me to update the UI even in the middle of downloading data rather than waiting for it to load entire data. @RohitJain
 
yes please
 
str = str.replaceAll("(?<! ).(?!([^@]*@[^@]*@)*[^@]*$)", "*");
 
@RohitJain Can you please help me in achieving the same thing with DataSource class? I can't move on from here.
 
7:17 AM
@Appu Where and how are you updating the UI?
 
thats fine but it still showing @ from begining and end string. that should also replaced to star
 
The doInBackground() is a thread which is provided by android system. So the result which we get should be updated only in onPostExecute() method which gets executed only after the doInBackground() is finished with its task.
@RohitJain
 
@Real.. You also want to replace @'s?
@Appu Well, then I suspect, there won't be any way, to partially display intermediate result on UI.
 
yes
 
Since, data is being collected in doBackground(),
And you are saying taht, UI will be updated by method that will execute only after doBackgroud() is finished.
@Real Now, this will become hard with replaceAll
You would now need Pattern and Matcher class.
But, now, I would also prefer doing it without regex.
 
7:24 AM
ok
 
@RohitJain But I can do it with that DataSource class rather than depending on doInBackground directly, I would depend on that class to get the first 15 products data and then display it on UI. When user still wants the other data too, then I would load more 15 products from that class and so on.. In this way I am thinking to achieve it.
 
Thanks rohit for all your help
Bye
 
@Real You're welcome :) Bye :)
@Appu What is products?
And even to display 15 products data, you would have to populate the list with new DataSource for those products.
So, you need to put that somewhere.
@Appu Sorry but I can't think I can help you here. This is now becoming Android specific, on which I haven't worked ever.
 
JSONObject c = products.getJSONObject(i); @RohitJain
@RohitJain Yeah. But I will give you other class which is data source. I shouldn't include that line productsListData.add(new DataSource(products.getJSONObject(i))); in doInBackground().
 
@Appu Yeah, but that i you have to get from somewhere right? That is working as index, and that you can only get from some loop.
 
7:32 AM
Please look at this. It's pure java.
As you can see, this line Thread.sleep( 500L ); simulates the data download.
So, I would replace my data downloading code here instead of Thread.sleep(500);
 
@Appu Bro. Trust me. I'm getting nothing out of that. You would be better off with posting that as question. I'm afraid, I can't help. Sorry :(
 
@RohitJain Okay. Never mind. Thanks for your time and nice meeting you.
 
@Appu Same here :)
 
8:06 AM
@RohitJain BTW where are you from?
 
8:36 AM
@Appu India
Bangalore
 
9:02 AM
@RohitJain So am I. Haven't seen you in this room before. So, are you new to this room?
 
yes
 
@sagar What?
 
9:28 AM
@Appu No, I come here, but not so frequently.
Last time I came here like 25-30 days ago.
 
@RohitJain Oh! Okay.
So what have you been up to lately?
 
@Appu I'm working in Infosys Bangalore.
 
Okay good. As a? @RohitJain
 
Systems Engineer. I'm a fresher only. Just joined last year on 6 Feb.
Well, About to complete an year. :)
 
@RohitJain Great. Being a fresher you are able to answer many questions. :)
 
9:36 AM
@Appu What do you do in Bangalore?
 
What Systems Engineer does generally? I have no idea on that role?
 
I've the work of a Developer.
 
@RohitJain Sorry, I meant I am from same country India, but not from Banglore.
I am from Hyderabad.
 
In a project. So, we have to do some coding.
Ok.
 
Then what's the difference between a developer and SystemsEngineer? Is that project based on Java?
@RohitJain What?
 
9:39 AM
@Appu That's the chat room for casual chat.
We can move there probably.
 
@RohitJain Well, you know what we always chat in this room either casual or subject wise. ;) if you could see some transcripts, you can even see how silly things we kept on discussing here.
 
@Appu And which we shouldn't do right? We already have a chat room devoted for silly chats. Why clutter the Java chatroom?
@Appu Ok Appu. I've to go now. It was nice talking to you.
 
Anu
@Rohit: u r Ryt
 
Will see you later. Bbye :)
 
@RohitJain Lolzz... Because this room is always inactive most times.
Okay. Bye. Take care.
 
9:44 AM
@Appu you too
@Appu Seems like I've some more time before I leave ;)
 
@RohitJain Okay :) Where was I?
Hmm... Here.
12 mins ago, by Appu
Then what's the difference between a developer and SystemsEngineer? Is that project based on Java?
 
@Appu Here only.
@Appu Yeah I'm working on a project based on Java
 
@RohitJain Chat only if you don't have any issues talking these things over here.
Because I don't wanna move to that room as it's completely new to me and moreover we always try to keep this room active in either way.
 
@Appu Well till you are talking Java, it's appropriate here. ;)
 
What about my first question, Difference?
 
9:52 AM
And no one is stopping you anyway.
 
Yeah. But can you see the description of the room? Gangnam Style. ;)
 
Developer and Systems Engineer are different things.
Systems Engineer is a role of an individual in some company. It varies with companies to companies
Developer is the role in a Software Developement Life Cycle.
 
How it differs from company to company?
 
Like, In Accenture it's Software Enginner, what we call Systems Engineer in Infosys.
 
If it is so, wouldn't be difficult for the people who work as SystemsEnginner to shift to another company based on experience?
 
9:55 AM
No.
The role is same as per experence level is concerned. They just differ in names.
 
Okay. I just got confused as you said the role differs from company to company. So, finally the thing that changes is only name. Right?
 
yup.
 
Anu
10:17 AM
hi, Anyone know Doing XML transformation in Eclipse enV?
 
@Anu please , can you clearly ? i m new in eclipse
 
10:57 AM
any one working on java with flex in Linux environment using eclipse ide?
 
11:39 AM
@rajeswari You have my sympathies
@Appu Heya
 
@Neil Yo! How are you doing?
 
@Appu Same same I suppose
Studying for my driver's license in my free time
And no, before you ask, I'm not 15
I'm trying to drive in Italy, and they don't take American driver's licenses :P
 
:P Oh okay. You are giving answers before I even ask questions on your replies. Smart future predictor.
 
@Appu Nah, just an engineer
You would too :P
 
But then again I have to ask one.
Guess what?
 
11:43 AM
@Appu Sorry?
 
Are you going to Italy? ;)
@Neil Seems you are gonna increase the latency.
 
@Appu Sorry
I'm in Italy
 
Oh! great. So you have been there on project work?
@Neil
@Neil Are you able to get this what I am doing here? pastie.org/6036396
 
12:02 PM
@Appu hi buddy, i am developing an android app and i need your help, still i am getting value in form of : 32.567890 but i just want to show : 32.56 in short, just want to show 2digits after decimal...please check my code here: pastebin.com/LEKU7NXP
@Neil
 
@AmitSuri Your code is illegible. Can you repost it?
 
@Appu sure friend..
@Appu now check here: pastebin.com/MyiKwZDY
 
pKs
0
Q: Add specific number of days to current date conditionally?

pKsSo the problem is I have got a date from server and I want to add specific days based on the difference between the current date and the date that I have got from the server. serverDate - currentDate Working: This is how I calculate the difference between days, String s=formater.format(cu...

 
12:24 PM
@AmitSuri Sorry, afk.
You can use round or
10
Q: Round a double to 2 significant figures after decimal point

Rajeshsuppose if the value is 200.3456 it should be formatted to 200.34 or if it is 200 then it should be 200.00

 
12:41 PM
hi any one know about load balance in clod computing what ejectly we can do Using this
@Appu
 
@Joan i am developing an android app and i need your help, still i am getting value in form of : 32.567890 but i just want to show : 32.56 in short, just want to show 2digits after decimal...please check my code here: pastebin.com/MyiKwZDY
 
hello every body?
i want to learn how to make a progress bar in java?
 
1:01 PM
@Appu My apologies, lunch time happened
What are you trying to accomplish with that code?
 
1:14 PM
@Neil NP :) I am just giving you basic idea on what I am thinking to do while retrieving data from the server and displaying it on UI.
As you can see here on this line.
items.add( "item"+Integer.toString( i ) );
 
@Appu Strange that you would do something when interrupted
 
It simulates that I get data from the server.
@Neil Didn't get you.
 
InterruptionException is triggered when a thread is interrupted
you normally don't catch these, but if you do, you should rethrow it
 
Okay. Leave it. It's just the design point.
Will improve it later.
 
what did you want me to notice?
 
1:19 PM
@Neil By the time you responded, I have been changing my code again :( I thought to ask you some points on that code. Will show the fresh one instead of explaining the old one. But it may take some time.
 
@Appu ok
 
@Neil BTW what does this mean?
4 mins ago, by Neil
you normally don't catch these, but if you do, you should rethrow it
I have just kept it(sleep) to have a feeling like some data is getting from the server which takes some time.
Instead of that line I use the code to get data in the for loop in constructor.
 
@Appu But you mean to perform the action in any case, not in the case of an error, right?
 
Yes. @Neil
BRB.
But I didn't know this. Seems new point as I am not perfect in java.
you normally don't catch these, but if you do, you should rethrow it
Will be in moment.
 
1:39 PM
InterruptionException may get thrown when you call sleep because Tomcat or whatever web hosting program you're using can interrupt it
It isn't meant to be an error, it's a way to communicate to the thread as if to say, "Listen you have something you need to wrap up, do it now..."
If you catch it, I don't know if that implies that it doesn't interrupt or what
but it's better you don't mess around with that logic
So if you catch it, then you should rethrow it so that it would be as if you never caught it
You normally don't even bother catching an InterruptionException except that Sleep puts the thread in idle mode and can therefore be forcibly woken up
 
2:37 PM
@Neil get
 
@Washu hi
@Washu I have a question for you if you don't mind
 
Hi @KareemMesbah
Ok
 
what's the meaning of calling a method implicitly of explicitly and what's the difference between them
 
you mean implicitly or explicitly?
 
yea
or* , sorry it was my mistake
 
2:50 PM
hm
I dont know :(
@Appu help
 
well, thank you
guys, anybody knows ?
 
@Neil what is the difference between implicit and explicit method?
 
@Neil Sorry was away on some work. Thanks ya. But we should surround with try whenever sleep is used.
@Washu Heya!
 
@Appu hey!
 
@Appu do you know the difference between implicit and explicit method?
 
2:58 PM
@Washu Nope. But who asked this?
 
it's me :D is it illegal ? :D
 
@Appu @KareemMesbah
xD
 
I haven't heard such words on methods till now.
@KareemMesbah Okay. Tell me what do you mean by those two?
 
well @Appu please hold on for a while I will tell you exactly where I got those from
 
15 mins ago, by Kareem Mesbah
what's the meaning of calling a method implicitly of explicitly and what's the difference between them
 
3:00 PM
or not of *
 
If you call a method explicitly it doesn't mean that it should be named as explicit method.
 
That was my bad :(
 
Suppose In a framework some predefined methods such as life cycle methods would be called implicitly by system.
 
I didn't talk about the name of the method and I might be get it
the topic was about the keyword this
it's saying that this.someMethod() is an explicit call of the method
 
then why that above one which I pasted your permalink?
 
3:03 PM
someMethod() is an implicit one
am I get it the right way ?
 
@Washu Hey, you have manipulated them with such names? ;)
 
@Appu Spanish is a crazy language man...
@sara925 hey, you need 20 reputation to be able to speak in chat, i recommend you ask questions in SO.
 
@KareemMesbah Nope. It should be called as a Callback method if it is called implicitly AFAIK.
 
well any answers ?
 
@Washu But not answers? :P
 
3:05 PM
@Appu sorry but I don't understand this
 
@Appu hehe ;)
 
what do you mean by a "Callback" and AFAIK
 
@KareemMesbah Tell me what do you know? I mean which languages? Servlets?
 
no one, Java is my first
 
Okay. Do you know thread lifecycle?
 
3:07 PM
actually no :(
didn't reach this yet
 
Oh! Then it's difficult to explain on chat. First learn some basics and then you can get these topics very easily later.
 
so it's not important for me right now. but does it have a relation to the uses of the keyword this ?
 
No, not much.
Suppose you defined a method , you call that method by an object or classname if it is static. Something like -- myclassobj.mymethod();
 
aha, I know about calling the static and non-static methods
 
So, you defined a method with name mymethod() {} and calling this method explicitly.
 
3:11 PM
so when I call this method using an object of the class this means that I am calling it explicitly
 
this is used to refer current class object.
 
I see, but what about calling it implicitly ?
 
@KareemMesbah Yes, you remember this for now.
Again you are getting into details and making me explain huge thing.
 
:), I am sorry pretty curious is it more complex than the way you explained the explicit calling of the method ?
 
Whenever you complete lifecycle methods which are called by system, then you would come to know.
@KareemMesbah No, not much complex.
Okay. here you go.
See who calls main() method?
 
3:13 PM
the Class name
because it's a static method
 
Do you specifically mention in your code like YourClassName.main(); ?
No, right?
 
no
yes, right
 
So, it is called by System which means it's called implicitly without user mentioning to call it.
 
ah, now I got it :)
@Appu thank you very much for your help
 
You are welcome.
:)
 
3:16 PM
sorry for making you tired :D I guess you know about the beginners :D
 
<<<<<<<<<<<<
 
@Washu I hope it a good piece of information for you :)
 
@KareemMesbah actually i was pointing me as a beginner too xD
Yeah
 
@Washu actually I feel that I will be referring to myself as a beginner for the rest of my life :D
this is pretty frustrating :D
 
@KareemMesbah NP. :) Actually it's enough for u now for the time being.
Gonna have dinner . BRB. @Washu @KareemMesbah
 
3:20 PM
@Appu i approved all my courses :)
Ok have a nice meal
 
@Appu Have a nice dinner :)
@Washu well, I've to leave now. thank you for trying to help me.
 
@KareemMesbah always trying :P
 
:) at least it's better than doing nothing at all.
and I am sure you're able and will be able to help me and other people
thank you again and see you later :)
 
@TuxZuSe that penguin
 
3:35 PM
hi
 
@Michael hey
 
sup folks
 
@ShotgunNinja hey how are you
 
hi @ninja
 
I'm good.
 
3:52 PM
ninja how are you
 
6 mins ago, by Shotgun Ninja
I'm good.
 
@ShotgunNinja ok
 
hah
 
;P
gotta dig through a bunch of JSP and replace all scriptlets which access cookies to instead AJAX-call a page on a separate website.
I understand why they need to do this; cookies are dumb, and we have all of our authentication funneled through one server to avoid overusing our database connections... but I don't get why they even used cookies for a wish list in the first place.
 
Yeah that "wish list" example is dated.
In tutorials and textbooks, you always see that example being used.
Or, rather, the shopping cart example
If you use cookies, then your wish list will change depending on what computer you're on.
 
3:57 PM
This isn't an example.
This is actual code in the field.
 
orly?
 
yarly
 
booooo I wouldn't do that
 
We've already got a design in place for redoing it, and of course the sick task of doing all that work falls to the intern.
 
You should store that in a database
 
3:58 PM
The database structure is already built.
 
ah ok
 
We already have Java code in place for accessing it (thanks to me).
 
Cool man!
 
And now all we need is to take all the JSP scriptlets that access cookies directly, on EVERY SITE, and replace them with AJAX calls.
PITA, imho.
 
sounds like fun
You should only use cookies for session tokens
Everything else should be stored server-side
imo
 
4:03 PM
Oh yeah, no doubt. When I first realized we were still using cookies, my jaw dropped.
 
@ShotgunNinja are aggregate functions slower than subqueries?
 
@Washu I would think subqueries are slower, since certain specs for aggregate functions can be gathered while fetching each entry.
Like, if you have COUNT(), then the database just adds one for each entry, instead of gathering all entries, then iterating across them and adding 1 to a counter.
 
I GUESS I should get started on this java project due on Sunday >.>
 
But still, I don't think you can really compare them, since they do different things.
 
nexion you have to get on the ball
 
4:10 PM
It won't take long. It just a Decimal -> binary converter
I just have to display four different outputs >.>
 
@ShotgunNinja thanks for the awesome answer
 
@Michael @ShotgunNinja Hey!
 
hi @appu
 
How are you doing?
 
good how are you?
 
4:14 PM
I am good. :)
 
k
 
@Michael I have one doubt on database part.
 
Does Java have the Ternary operator? Cant remember
 
Woops, was writing it wrong, that's why it was screwing up
Had the operators backwards
(blah < test) : true ? false;
Derp.
Okay, is there a more efficient way to reverse a String then this? This was the best I could come up with String finalResult = new StringBuffer(result).reverse().toString();
 
4:26 PM
result is a string?
 
Yes
 
@Appu what
 
@Nexion I don't think so, it would be possible in less code than that.
 
It just seems messy to create a new object just for that.
 
@Nexion You should use StringBuilder because it's faster
 
4:28 PM
But shrugs whatever, it works.
 
StringBuilder is not synchronized unlike StringBuffer which is.
 
Doesn't have to be, really. Its just a simple console app.
 
@Michael Suppose In a table I have a two columns which are like primary key and cityname. So, I get city name from the client side and with this cityname I get primary key from the first table. So, in the second table I have to insert this pk in fk column along with other data.
 
I'd say, in like 95% of situations, you dont need synchronization when building strings, so you can use StringBuilder.
 
I am using first query to get pk, but then again I am using another query to insert this pk into another table. Like this I have lots of things to get and finally which need to be inserted to one or more tables in a single program. It was really messy when I coded in this way.
While at the time of retrieving we can use JOINS, but now I can't because it includes insertions.
 
4:40 PM
@Appu You can make the "cityname" column an index to increase performance.
 
Is there any number format for integers that doesn't automatically truncate leading 0's?
I could just return a String, which would solve the issue but I want to keep my functions as integers if I can help it, saves from converting all over the place
 
@Michael I can't make. Because it's already designed and running one. So I have no rights to change that.
 
oh
 
Can you suggest me some other ways?
 
@Appu appu if all you have is the city name, then that's the only way to get the id
 
5:14 PM
I think what he means is to create an index on the cityname field.
Essentially, an index is a separate file or substructure that can be generated for a field of a table, and which serves as a lookup device for that field. It's easy to set up, and it makes lookups on that field much more efficient.
 
Slight change of avatar there @ShotgunNinja
 
@Adude11 Yeah, just a bit.
 
Anyone know anything which would cause JList.getSelectionModel().getLeadSelectionIndex() to return a value bigger than the actual list?
 
5:55 PM
Anyone here?
 
Maybe
 
I have a question
 

« first day (835 days earlier)      last day (4113 days later) »