« first day (1636 days earlier)      last day (3290 days later) » 

12:00 AM

Help & Improvement & Triage School

Everyone is invited to gather together and learn the dark arts...
^ best topic ever
 
user201891
"Everyone is invited to gather together and learn the dark arts of reviewing the new queues."
The ellipses made is sound cooler.
 
I KNOW RIGHT
It took a while to get the line cutting off appropriately.
A while is an understatement.
 
fge
wonders whether anyone will be curious enough to seek the answer to my question
 
user201891
>Did I already tell you that you had a tendency to promote your own opinions as truths?
 
user201891
Didn't seem important enough
 
user201891
12:10 AM
I'm more concerned about what pizza I'm going to order for dinner
 
fge
Why not cook it yourself?
A Marinara is pretty easy (the crust is the hard part, really)
 
user201891
Well, first it's the gym. Then my wife would make the pizza, and I'd wash the dishes. Or we could just buy the pizza and go for a walk instead. I choose B.
 
user201891
Or 2. Whatever.
 
user201891
Though home-cooked pizza is great, yes. No arguments here.
 
fge
Or you could just go to a good Italian restaurant (or a trattoria, if you have those around where you are)
 
user201891
12:15 AM
Hmm, they do, apparently. Little pricey for a wednesday-night post-gym dinner.
 
user201891
I will try this "trattoria" though.
 
user201891
just not tonight
 
fge
Basically, a "trattoria" is a "poor man's restaurant" for some definition of "poor man" -- some trattorie (which is the Italian plural of it) are actually much better than most restaurants. Think of them as canteens, or laid-back restaurants or something along those lines
In South Italy you have a lot of them
 
user201891
ha, I bet outside of Italy "trattoria" means "fancy expensive Italian restaurant" :(
 
fge
And if you ever go to Sorrento one day --> Pizza Da Franco; that's a must-go
@DavidS were that so that wouldn't be a trattoria
 
user201891
12:20 AM
I'll be sure to debate that point with my waiter over the bill
 
user201891
"Look, you call yourself a trattoria! $23 for pasta? What is this!?"
 
fge
You're in the US?
 
user201891
Canada
 
user201891
America's hat
 
fge
Well, that's not really like Italy now, is it? ;)
 
user201891
12:22 AM
orsoa biancoa
 
user201891
castoro
 
user201891
i don't know why there are italian words for these things
 
user201891
alce
 
user201891
oh, moose aren't just here. my mistake
 
user201891
and Eurasian beavers? everything I know about my country is a lie
 
12:32 AM
@fge i wouldn't have expected to read that in a SO chat. i know franco :D
 
fge
@Worf oh, really?
 
yeah :D
i was born near naples
 
fge
Lucky you
 
:P
 
fge
I haven't been to Naples for more than three years now :(
I miss it
 
12:36 AM
trattorie are extinct nowadays tho. restaurants that identify themselves as trattorie not necessarily are cheap. in fact often it's the opposite
 
fge
has a sudden urge to listen to Pino Daniele's "Napul'è"
 
did you hear that pino daniele died recently
 
fge
Uh, no I didn't
Now, that's sad news to me
 
in a mysterious way also
 
fge
Meh, mi parla di una sola cosa napoletana che sia chiara
 
12:38 AM
even if you are not "napoletano" that's a huge loss for italy
very sad
i have a question about collections design. not necessarily java. why does List can be sorted only upon request while SortedSet/SortedMap are sorted automatically upon modifications?
 
fge
It's by design
In that sense, SortedSet kind of violates the Set contract in that its uniqueness criterion is not .equals()/.hashCode() but the result of .compareTo() (that is, Comparable)
And a SortedMap's keys are in fact a SortedSet
When you try and add a new value to a SortedSet, what happens is that the result of .compareTo() of the new entry is done against existing elements to determine where it fits
And if your elements don't implement Comparable you have to supply a Comparator
This is all because of a fundamental difference between Set and List as well
A Set does not allow duplicates; a List does
What is more, a List guarantees iteration order (the order in which you added elements into it) but a Set does not
 
12:55 AM
I am trying to understand :P wait lemme read one more time
but what about the natural ordering - insert order? it doesn't seem the comparator/comparable is actually required
 
fge
No, wait
What is called "natural ordering" is defined by Comparable
=javadoc Comparable
 
@fge java.lang.Comparable: This interface imposes a total ordering on the objects of each class that implements it. This ordering is referred to as the class's natural ordering, and the class's compareTo method is referred to as its natural comparison method. (1/13)
 
fge
Natural ordering and insertion order are two different matters
 
i meant the insert order
 
fge
Insertion order is meaningless for a Set
But it is crucial for a List
 
1:03 AM
so wait. how SortedSet are implemented internally? using a List?
 
fge
No
=javadoc List
 
Which one do you mean? (type the number)
1. java.awt.List
2. java.util.List
3. javax.validation.OverridesAttribute.List
4. javax.validation.constraints.AssertFalse.List
5. javax.validation.constraints.AssertTrue.List
6. javax.validation.constraints.DecimalMax.List
7. javax.validation.constraints.DecimalMin.List
8. javax.validation.constraints.Digits.List
9. javax.validation.constraints.Future.List
10. javax.validation.constraints.Max.List
11. javax.validation.constraints.Min.List
12. javax.validation.constraints.NotNull.List
13. javax.validation.constraints.Null.List
14. javax.validation.constraints.Past.List
15. javax.validation.constraints.Pattern.List
16. javax.validation.constraints.Size.List
17. javax.validation.groups.ConvertGroup.List
 
fge
2
 
@fge java.util.List: An ordered collection (also known as a sequence). The user of this interface has precise control over where in the list each element is inserted. The user can access elements by their integer index (position in the list), and search for elements in the list. (1/10)
 
fge
Note in the above: "The user of this interface has precise control over where in the list each element is inserted"
 
1:04 AM
yes i know what a list is :P i meant, how is stored data in a sorted set? as in a regular set?
 
fge
No, and that's the point
Back to the basics: 1. A Set does not allow duplicates, 2. it offers no guarantees as to iteration order
That's the basic contract
 
yes
 
fge
Now, a SortedSet is a "subcontract" of Set
 
sorted set doesn't allow duplicates but guarantees iteration order
 
fge
Well, it guarantees that if you have two elements e1 and e2 such that e1.compareTo(e2) < 0, then when iterating, e1 will appear before e2
 
1:06 AM
question was. how is it guaranteed the iteration order?
 
fge
See right above
This is how it is done
Note also that if you attempt and insert an element e into a SortedSet but it happens that there exists an element e1 in the set so that e.compareTo(e1) == 0, then e won't be inserted
This is easily verifyable
 
yes. i got that :D but the sorting is performed on the fly while iterating, or the order defined by comparable is internally represented by some other data structure
like doubly linked list or something
 
fge
Try and create a SortedSet<BigDecimal> and insert into it BigDecimal.ZERO and new BigDecimal("0.00"); they are not .equals(), but they .compareTo() the same thing
No idea, that is implementation dependent
I just trust the JDK to do the right thing :p
 
well that was my question basically
 
fge
Then I don't have an answer, sorry :p
For this kind of stuff I trust the JDK to do the right thing
 
1:10 AM
:P no prob :D
 
fge
But then this has nothing to do with Collections.sort() -- this method can only sort Lists anyway
 
dunno if i already said that but i'm creating a collections library for php. and trying to get inspiration from java and C#
 
fge
Hmm, ambitious project
I do hope you have a well defined API to start with
 
at the moment my preferred design is sorting sets and maps only upon request
basically i want to create SequentialSet and SequentialMap
 
fge
Well, Java has separate contracts for natural ordering and equality; now is this, or not, what you want
 
1:13 AM
in my php equivalent all classes (Object) both implement .equals() and Comparable by default
 
fge
Hmm, that's a strange design decision
 
why that?
 
fge
This basically assumes that the domain of values is linear
Now, let's take the example of simple entitites, numbers
 
nope. it is linear if compareTo returns values different from 0
 
fge
1. consider double: in Java, NaN == NaN is false
 
1:15 AM
but i can have everything comparable and return always 0
 
fge
However, Double.compare(Double.NaN, Double.NaN) is 0
2. consider complex numbers
You cannot define a natural ordering for those
But you can define equality
 
i don't actually know what complex numbers are xD
my point was. if i can implement equals() i can implement compareTo() always returning 0
 
fge
Well, take real numbers, imagine that they are on a single axis, let's say x
THat's pretty much a one-dimensional, contiguous set
For complex numbers, there's also a y axis :p
 
i vaguely remember from school days
 
fge
And then how would you compare 1+i t o -2i for instance?
(which, in a cartesian coordinate system, could be represented as (1, 1) and (0, -2))
 
1:20 AM
well, in that case i could just have compareTo returning 0 or an exception
but i see the point
the point is avoiding the exception
correct?
 
fge
The point is rather to clearly separate equality and comparison; that's what Java does, and for good reason ;)
And this is also why you have both Set and SortedSet
 
good suggestion tho. i'm going to create Comparable
 
fge
Their contract are fundamentally different for that reason
 
@fge got it now. took me a while xD
 
enter("woodrow"); for(String names : present) { if(names.equals("woodrow")) startParty; }
 
1:32 AM
if(!users[woodrow].brought("beer")) endParty();
 
if(!isParty()) dropTheBass();
else dropTheBass();
 
:D
 
Hey guys, there may be someone coming in in the few mintues or possibly more with Scanner related questions
I thought I might be able to give him a hand, but I have to eat dinner with the fam, so if someone or multiple people could give him a hand, please do
 
hide yo kids!?
 
fge
1:48 AM
Scanner is a curse
 
<3 scanner
 
hi
any1 there
i need a help in android maps v2
@Worf hey
 
fge
Sorry, I don't do Android so I cannot answer
 
2:07 AM
@SunishthaSingh android?
 
hi
@deadlydragon00 hmmm
can yu help me
 
as long as I can
 
public class MapDetail extends FragmentActivity implements
GooglePlayServicesClient.ConnectionCallbacks,

GooglePlayServicesClient.OnConnectionFailedListener, LocationListener,
OnMapLongClickListener {
private static final int GPS_ERRORDIALOG_REQUEST = 9001;
GoogleMap mMap;
LocationClient mLocationClient;
Marker marker;
LatLng ll;
LatLng point1;
List<LatLng> routePoints;
private List<MarkerOptions> markerOptions = new ArrayList<MarkerOptions>();

@Override
protected void onCreate(Bundle savedInstanceState) {
here is my code
i am showing latlng in postexcute method os asynctask
 
what was the problem?
 
how to post them to url by parsing in soinbackgroung
 
2:11 AM
Pls rephrase the question, or give a scenario
 
i have to store the latlng on longclick and on locationchanged
so i called asynctask in longclick method
now i am facing problem how to store latlng from method onLocationchanged
@Override
public void onLocationChanged(Location location) {
String msg = "Location:" + location.getLatitude() + ","
+ location.getLongitude();
Toast.makeText(this, msg, Toast.LENGTH_LONG).show();

drawCircle(location);
for (int i = 0; i < this.markerOptions.size(); i++) {
mMap.addMarker(markerOptions.get(i));
}
LatLng ll1 = new LatLng(location.getLatitude(), location.getLongitude());
routePoints.add(ll1);

for (int i = 0; i < routePoints.size(); i++) {
Polyline route = mMap.addPolyline(new PolylineOptions().width(5)
in this
i am using postexecute method to show latlng while moving...but i also want to post these latlng values using josn
can yu help me
@deadlydragon00
 
Thats an expensive task, I mean it will cause your app to slowdown
 
ohh
but my tl asked me to do so
i am trainee
can yu help me with this
 
basically where do you want to store it?
 
to the url
all updated latlng values while moving
 
2:17 AM
oh so you are sending realtime coordinates?
 
Warning : url is not the best way to do this
however it is still possible
 
but he mentioned to do so
 
Ok I understand
on your onchange create HttpUrl Conn...
 
but i have do this again
i did this for longclick
in doInBackground
 
2:20 AM
nope onlocationChange is working on background thread
 
@Override
protected String doInBackground(String... arg0) {
String res = sendJSON();

Log.d("InputStream", res);
return res;
}

private String sendJSON() {
InputStream inputStream = null;
String result = "";

try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(
"my_url");
String json = "";
json = this.getJSONObject().toString();
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("data", json));
httpPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
this is what i did
and executing this asynctask from longclick
 
do this new UrlEncodedFormEntity(nameValuePairs, "utf-8")
 
ohk
i have to do this ni sendJSON method
 
did your code above did not work ? I thinks its almost right
 
its working
but only storing value at longclick
i also wanted to store current latlng values
 
2:26 AM
Make a global varible LatLng
for current and prev
 
ohk
then?
i did that
now
 
in your onlongclik assign the value from the onchange
 
how that
 
Im having problem placing code here in chat
 
long click is for placing marker and storing values of latlng of the point where marker is placed
can yu mail
@deadlydragon00
 
2:30 AM
 
2:45 AM
> There are a handful of you who need to stop getting all pedantic with things like, "Well, the write-up doesn't explicity forbid this library". Yes, well, the write-up also does not explicity forbid you performing seppuku in the process of completing HW7,
 
3:00 AM
Morning
 
morning
 
good morning~
 
3:40 AM
o/
 
@ItachiUchiha What's this?
 
lol
 
\o
\o/
 
So, what does this smiley mean?
 
3:45 AM
Hi
 
Really?
 
^^ that is what it means
It is a person waving.
His head and hand
 
Aaah... I can see this now
His head and hands*
 
The last one is smiley of excitment
 
You are genious xD
 
3:46 AM
Actually it is not a smiley
 
Then?
 
It can called as a form of non-verbal communication.
 
And smileys too
 
Yeah true, but these are not smileys
Maybe emoji's but definitely not smiley
 
Because they do not involve face?
 
3:50 AM
Thats my gut feeling :-P
 
4:17 AM
I have a question about StackOverflow
 
Shoot
 
I found an answer to a question that was bad. The code was bad, the answer structure was bad, just everything was bad, so I downvoted the answer
I look at the reputation tab, and I lost 2 reputation because I downvoted a crap answer
can someone explain this?
I also downvoted the question because it was a bad question in regard to content, simple logic error, so simple that it seemed the OP had not actually checked his code
and i lost reputation for downvoting the question as well
any ideas anyone?
 
AFAIK you are not supposed to downvote continuously and I think your current reputation also matters while downvoting a question or an answer
However you should have left a comment and then downvote
 
I did, the answer that i downvoted and question had already been downvoted at least once by the time I arrived. Well, i guess I just have to wait and see if it reverts with time
thanks @appu
 
NP
 
4:56 AM
@JohnnyCoder Do let us know if that reverts :P
 
5:47 AM
@JohnnyCoder You will loose 1 reputation for each downvote that you make. But you retrieve the dv's made on question, if those questions are later removed by the community.
Not sure how it works with answers
 
5:57 AM
Can anyone tell me if i can find an exercise book for java
 
@DavidS why not ask for suggestions? Of course its a Q/A site, but i love to hear words from the experts. :) @ItachiUchiha Thanks a lot for your suggestion.
 
Well suggestions dont actually work, its more confusing.
 
@Dhananjay Not sure about the book. Although, you can try official tutorials as well as: programmingbydoing.com
 
Some times they do work when you're all stuck :)
 
I only need to know if anybody knows a website or a particular book that has exercises based on topics in java, like 20 or more questions to classes where i have to program and get the output myself
Right now i use other books like C primer to solve the programming exercises at the end using java
 
6:03 AM
@Ita Do you have experience with policytool utility?
 
Its working till i use c++ primer exercises for classes, but after that i have no way to explore whats there in swings, exceptions, applets excetra
@Mr.777nop gonna have to search about it
 
@Dhananjay Search about?
 
@Mr.777 oh nothing my mistake, i took policytool utility comment for myself
 
@Mr.777 ???
 
@ItachiUchiha policytool that comes packed with jdk
 
6:08 AM
Nope
 
6:52 AM
Good morning, Java
 
Good morning ..
 
Morning
 
morning
 
Hey anybody know below exception
java.security.NoSuchAlgorithmException: SunTlsRsaPremasterSecret KeyGenerator not available
 
@Ranjeet As far as exception is concerned, this tells that SunTIsRsaPremasterSecret is not available
7
Q: SunTlsRsaPremasterSecret KeyGenerator not available

JillI encountered an error when my application tries to load a RSA Algorithm provider class from JAVA. The exception stack is as follow: javax.jms.JMSException: RSA premaster secret error at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:49) at org.apache.activemq.Activ...

Did you try reading this? ^^^
 
7:00 AM
Yes @Mr.777
 
7:32 AM
Morning
 
hi java
 
Hii
 
in my j2ee project the session gets destroyed before its specified timefor example out of 10 session gets destroyed for 7 times
 
OMG, what's wrong with this code.
package hello;
import com.sun.java_cup.internal.runtime.Scanner;
import java.util.*;
import java.util.Scanner;

public class StringRecursiveReversal  // class declaration
{


	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);

	}
}
I'm getting
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
	Cannot instantiate the type Scanner

	at hello.StringRecursiveReversal.main(StringRecursiveReversal.java:12)
error
 
@Avinash
 
7:40 AM
hmm
 
You are importing wring scanner class
import java.util.Scanner
 
what do you mean by wring? is this writing?
 
Sry for typo...you are importing wrong scanner class
 
like you said, S in caps.
 
yes
 
7:44 AM
my code also has the uppercase S
 
But you imported one unnecessary class import com.sun.java_cup.internal.runtime.Scanner;
delete that line
 
yep, now it works.
eclipse automatically add that particular line.
 
Congratss..!!!
:)
 
8:11 AM
o/
 
in my j2ee project the session gets destroyed before its specified timefor example out of 10 session gets destroyed for 7 times
 
java morning
 
mrng
 
8:31 AM
Play framework copy/past of symfony2 lol
 
yes
you learn one of them you will win the second :D
 
glad I never want to use either..
 
^^
 
hehehe
yes you shouldn't use any framework
 
8:37 AM
@fahdijbeli That's totally irrelevant. Listing crappy frameworks and then asserting not to have a need with any framework is ridiculous.
 
yes
for example I don't use any framework, I use design pattern concept,thought.
when I use framework just requirement of the client
that so
 
Need your help JAVA i was cornered in this situation
 
So, what is the problem?
 
you looking for JAVA help?? sorry we only do Java...
;)))
 
8:44 AM
@Vogel612 however I do JAVA :p
 
JAVA != Java
 
in my j2ee project the session gets destroyed before its specified time for example out of 10, session gets destroyed for 7 times
 
@greenhorn Why are you using J2EE then?
 
Hmmm you asked the same thing half an hour ago
...
 
@Vogel612 yes
i am facing that problem in my web application in Netbeans IDE
 
8:46 AM
Seems to me then, that the people don't have an answer. I for one don't have any idea, having never used j2ee
 
1 min ago, by Unihedro
@greenhorn Why are you using J2EE then?
 
@Unihedro i can't get you @Unihedro, i am trying to say that i am facing a problem in my web application
 
@greenhorn Thanks for letting us know.
 
@greenhorn did you posted on SO ?
 
yeah i posted already before few months but i didn't got any answers
0
Q: Session variable gets destroyed before its session timeout n jsp

greenhorn <session-timeout>60</session-timeout> This above web.xml config code should kill the session variables when the Web Application is idle for exactly 60 minutes. But in my project the session variables are destroyed before 60 minutes. For example I stored one session variable in one jsp and it ...

yeah i posted already before few months but i didn't got any answers
 
8:55 AM
and you answered by yourself
for me any idea but did you tried with other navigator ?
 
@fahdijbeli i thought it worked but later i found the same problem again
@fahdijbeli Navigator?
 
@greenhorn I even edited that question..
 
@Vogel612 yes @Vogel612
 

« first day (1636 days earlier)      last day (3290 days later) »