~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yes, it's a scam/spam message. I have banned the member in consideration (even I was one of those members who received the PM) for trying to scam/spam via PM so it should be all good now.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I've just learned that Java's 'protected' access specifier has a different effect than that in C++. So is there a way to make a member of a base class visible to its inheritors but not globally?

Assuming by globally you mean "other classes in the same package", then no, there is no way to get around this behaviour. Is there any specific problem arising from this that you are trying to solve?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

AFAICT, if an explicit charset is not provided, Scanner class uses the default Charset when parsing the input stream. Two things you can try out:

  1. Add a SOP to the start of your program to print the default charset being used by adding the line: ` System.out.println(Charset.defaultCharset().name()) ` at the start of your program
  2. Change Scanner constructor to take in a explicit character set i.e. ` new Scanner(System.in, "UTF-8") `

If it still doesn't work, post a screenshot of how the session looks like (after hiding personal information of course).

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

BTW, just FYI, you can run Java in any compatibility mode. So, if you have JDK 6 and want to run it as 1.4, you can do "java -version:1.4 -version" and it'll print 1.4. Similarly, when starting your server, if you have access to the .bat or .sh file which starts the server, you can add a "-version:1.4" to it and it'll start up in 1.4 compatibility mode. What is the command line you are using to start the server?

serdas commented: you are great thank you for not giving up on me +3
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Is that the same connection variable you are using for all of them? If yes, then you are effectively throwing away the connection retrieved. The way you should test is: retrieve the connection for a given database and fire some query specific to that database which will ensure that you are indeed connecting to the database in consideration.

JeffGrigg commented: Well said. +7
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

On the REPL, when you type a name which exists (can be a variable, class name, function etc.), the output shown is the str() representation of that name. For e.g.

>>> s = "Hello\nWorld"
>>> s
'Hello\nWorld'
>>> s.__str__()
'Hello\nWorld'
>>> str(s)
'Hello\nWorld'

If you want to view the output of the interpolated string (after taking into consideration the escape sequences etc.), use the print construct.

>>> s = "Hello\nWorld"
>>> s
'Hello\nWorld'
>>> print s
Hello
World
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> If I bind the server socket, I would bind it to 127.0.0.1

That anyways wouldn't work because in that case it won't be accessible by external clients (given that this is a loopback address).

Your ServerSocket creation looks OK. The problem might be of unreachable host/port due to blocking of communication by your ISP. Go to http://canyouseeme.org/ which shows your IP address and asks you to input the port number of your running application. If after clicking the "check" button you can see an output of the form: "I can see your service on X.X.X.X on port (XXXX)", it means that your service is visible to others. If the test times out, then it is a problem with your firewall/ISP settings.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> shouldn't i just call in the main method something like this to create 100 thread?

Yes, except that you have a one-off error in your code; you are iterating 101 times, not 100 times. And make sure variables have logical name and not numbers tacked on to the end.

> and about the thread pool thing, she said that is how you create multi-threading....explain that please

Thread pools are the new abstraction offered by the standard library to replace the old Thread() construct for doing background activities and submitting tasks. But if your assignment specifically asks for 100 threads, creating a pool with 100 threads wouldn't be the same, because it is quite possible that when you submit the 50th task, it might be processed by the same thread that processed the first task. i.e. there is no guarantee that a new thread would be used. If this isn't a problem, go ahead and use the pooling approach. Otherwise, stick with the new Thread() stuff.

> so is this the ouput should be like?

That isn't something you should ask us. I would rather want you to test both sync and non-sync runs and draw the conclusion based on what you have learned.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Im not sure wht does the question want by meaning this “Each thread adds 1 to a variable sum that initially zero”…

First off; the question explicitly mentions "launching" threads which is bit different from creating a "pool" of threads. No need to extend the `Thread` class, just make your work class implement Runnable. Your logic is flawed in the sense that you are "not" sharing the MutableInteger between all those "work" instances. Each Runnable has its own "sum" variable and hence you don't see the effect of synchronization/non-synchronization since there is nothing shared.

You would have to:

  • create two "runnable" classes (classes which implement Runnable interface); in one you will call `sum.inc()` and in the other class you will call `sum.syncInc()`. Let's call them Work and WorkSync respectively.
  • These classes should have a constructor which takes a "MutableInteger" parameter.
  • You create a single "Mutable" integer and pass it to all the 100 instances of your Work class instance. After that, create a new Thread for each Runnable and launch that thread (call start on it).
  • Repeat the same for WorkSync class (make sure you start from scratch; i.e. create new Mutable integer, create new 100 threads etc.)
  • Observe the result and draw your conclusion
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> C:\HelloWorld.dll: Can't find dependent libraries

When you load a DLL, the dependent DLL's get loaded as well and if they are not found, this error is raised. The dependent DLL's should be in the PATH env variable or in -Djava.library.path system property. Assuming you are not using -Djava.library.path, do both of you have the same PATH env settings? Do you see any difference in there?

Also, do you have a conflicting version of DLL's in the directories on your PATH (i.e. you have a.dll ver 1 and your partner has got a.dll of ver 2 in system32 folder).

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> This might be a dumb question but would this make a normal C/C++ DLL or a C/C++ .NET DLL?

You would need a normal C/C++ DLL.

> And the C++ team pretty much have no clue how to make a .DLL

That's news. I hope you are not stuck with fresh-out-of-college-self-proclaimed C++ programmers...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Could you be more especific when you say "setup the same thing in Visual studio"?

Simply set up a new DLL C project in Visual studio. Create new blank project. Right click project -> General -> Configuration Type set to Dynamic Library DLL

Right click Header folder -> add item -> add your header

Right click Source folder -> add item -> add your .c file

Right click project -> c/c++ -> Additional include directories -> add paths to java\include and java\include\win32

Right click project -> rebuild -> the output window will show you the location of the newly created dll

For more detailed instructions, you should probably speak with the C++ guys from your team since they should definitely be able to help you out with this one.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

OK, you have to make sure that:

  1. javah is in your path (at least temporary; so that you can directly invoke it without being in java\bin)
  2. You need to be in a directory just outside the "mypkg" directory which contains your HelloWorld.class file before invoking javah. To do this, search for where the HelloWorld.class is generated (should be autogenerated if build-automatically is on in Eclipse)
  3. Open up "CMD" and CD to a directory just one level above the mypkg directory which contains HelloWorld.class.
  4. Assuming your class is generated in the following directory strucure "c:\testproject\target\classes\mypkg\HelloWorld.class"; CD to the directory "c:\testproject\target\classes" and then invoke the javah command as "javah -jni mypkg.HelloWorld". There is another way by which you can set the classpath but I'll not mention it to avoid confusion.
  5. If you have followed till now, you "should" have a .h file generated in the "classes" directory. If it still doesnt' work; show me your entire CMD session.
  6. If it works, continue with the step 3 in my previous post.
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I'm not sure what exactly are you doing there. After reaching home, it took me 30 mins to run the hello world example. Are you sure you are able to properly build the DLL file? The steps in the tutorial might be a bit problematic in case you are using Visual Studio. Did you make sure you add "jvm" headers and "jvm" libraries to the linker when building the project?

You might need to jot down here "what" steps you are taking when using Visual Studio Express Edition to build the DLL down to the minute details.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

OK, you should never have to add any random DLL to your path so for the time being forget about manually adding DLL's. How are you building the wrapper project: using IDE or command line? Using Visual Studio? How is your library distributed, as a DLL or LIB?

This is how our project is structured wrt dependencies (Windows):

  • Additional libraries included on the path:
    • %JAVA_HOME%\lib\jvm.lib
    • path\to\your\graphics\library\something.lib
  • Additional header includes directory:
    • %JAVA_HOME%\include
    • %JAVA_HOME%\include\win32
    • path\your\graphics\project\header\files
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

In case you are not not aware, Stanford has started offering free online courses (as in real courses and not just video lectures) for topics like Database design, analysis of algorithms, CS 101 etc. Classes like database class, AI class and machine learning class are already live and a host of new courses are offered starting Jan 2012.

These classes are a good supplement for experienced developers who could never take a formal CS course as well as for the beginners starting out with computing. The enrollment for the "Design and Analysis of Algorithms I" has started with many other classes (like cryptography, CS 101 etc.)

If interested, you can register for the Algorithm class here along with the other offerings given by Stanford.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

By this I imagine that you mean that nearly all the calculations in classes, functions, procedures, etc must be turned basically into usable functions in a C++ library right?

Basically all classes and functions you create specifically for the purpose of JNI wrapping will go in this project. So you'll have two projects: the first one will be your original C++ library, the second one will be the C++ wrapper project.

The bridge method is this, right:

Yes

The problem is that I see that as C++ read from a Java library. I need Java to read from a C++ library.

Once you are in that function, you are already in C++/native code land. You can freely call any C++ function from your JNI wrapper function and mix-and-match JNI and normal native calls as you please. It is as simple as reading the arguments passed in to the Java method, using them in some way to decide which C++ methods to call. It would be a bit difficult to explain this all here so you might want to read up on some official stuff (i.e. JNI examples by scrouging the internet or get a JNI book).

I simply load the C++ library in my Java project and it should load and I should be able to read the functions as I have implanted the JNI standards. Thats what I understood.

Not really. You load *your* "wrapper library" and the Java runtime will automatically load your C++ library …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> Is it "difficult" to do?

It depends, but yes, in general I wouldn't shy from using the words "laborious" and "verbose" when it comes to wrapping native code. The process goes something along these lines:

  1. Create a new C or C++ project which would act as a "wrapper" for your library
  2. This project would contain the "bridge" methods in the sense that they would use the JNI specification to call Java methods from C++ and passing Java invocations to the corresponding C++ methods.
  3. This project would depend on your libraries and their respective headers along with the JNI specific stuff. The dynamic library created from this project would be placed on the java library path along with the dependent libraries.
  4. In your code, you'll need to load the native library you created before using the functionality provided by your wrapped code.

Apart from this there are a few subtle things which you need to keep in mind like translating from your Java data structures to C++ ones (in the wrapper C++ code), memory management (in case there is a one-to-one mapping between your live instance of your class and a C++ object) and the re-entrant behaviour of your library (can it be safely called from multiple Java threads?).

There are a few helpful libraries out there (both paid and free), which relieve the developer the pain of manual wrapping by providing helper annotations but AFAIK, they are slower than the pure JNI counterpart so …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

That is because you are pretty much ignoring the exception it throws (line 28 and line 39) which is a bad thing. Never catch exceptions only to replace them with "print" statements or worst, with an empty catch block. Till you incorporate a logger in your application (which IMO every non-trivial application should have), your best bet would be to dump the entire stack trace at the time the exception was thrown.

Do a 'e.printStackTrace()' of the exception and post the entire exception text here.

peter_budo commented: Who need to listen for exceptions, their are pointless ;) +16
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

$ is used as a separation marker for denoting inner classes. For e.g. consider the following class:

public class MyWidget {
	
	static class Oh {
	}
	
	public void doIt() {
		final Runnable r1 = new Runnable() {
			@Override
            public void run() {
            }
		};
		final Runnable r2 = new Runnable() {
			@Override
            public void run() {
            }
		};
		r1.run();
		r2.run();
	}
	
}

Here; four class files would be created:

  1. MyWidget
  2. MyWidget$Oh.class
  3. MyWidget$1.class
  4. MyWidget$2.class

Basically, the format is: OuterClassName$(InnerClassName or number in case of anonymous class).class. In the above case, since we have two anonymous Runnables created, we have $1.class and $2.class.

In case you are unaware of nested classes, more details at: http://download.oracle.com/javase/tutorial/java/javaOO/nested.html

iamcreasy commented: Perfect answer! +3
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

cwarn23, please don't sidetrack the topic in consideration but posting off-topic replies. You have officially diverted the "RIP John" thread with comments which would be thought of by some as "borderline online stalking".

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

But /how/ do I encrypt it? In PHP there's a simple md5() function, isn't there some equivalent in Java?

MD5 is not encryption but just a one-way/irreversible hashing algorithm. You have two different issues here: storing password in secure format and sending across password over the network in a secure manner.

For the first one, look into the sample code for encrypting/decrypting the file.

As for the second one, look into this article for the relevant switches of the JDBC URL for MySQL. AFAICT, the approach in the article doesn't use certificates which makes things even messier. Searching around for "MYSQL jdbc ssl" should bring up some links on the MySQL documentation on the steps to set up JDBC over SSL with a certificate.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Your Deck class contains a lot of compile time errors. You can't call "add" on an array in Java. Did you mean to use ArrayList class? Also, there is no reason why enums inside the Card class should be non-static since they anyways are not dependent on the instance of a Card class but are still related to the Card class. Just make them static, import them in the Deck class and you should be good to go.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

My Hibernate is rusty but after a bit of searching, it seems that you have an incorrect value for the "hibernate.hbm2ddl.auto" property in your configuration XML file. Just remove it or change it to 'create-drop' from 'validate' so that your existing table will be dropped and created new everytime. Also, read this for more details.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

First off, there is a equals() and hashCode() contract you must be aware of which states that if two objects are equal, they should have the same hashCode() which implies that if you are overriding equals method, you need to override the hashCode() method. In your case, it would be simply be a matter of returning the hashCode() of the `name' field. Not critical for your application, but something you must be aware of.

public class Application {
    public boolean equals(Object obj) {
        return this.name.equals(((Application)obj).name);
    }

    public int hashCode() {
        return this.name.hashCode();
    }
}

Second; in the flagIt method, it makes sense to first check for the already flagged status rather than checking for equality and classname since the flag check is very trivial as compared to the other two i.e. check for flagged == true first. Also, for booleans, you can leave off the equality check and just write if (flagged[i] && elementList[i].equals(anElement)) .

Also, as previously mentioned, using the getClassName() before equality checks is just wrong. This check needs to ideally go in the equals() method i.e.

public class Application {
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof Application)) {
            return false;
        }
        return this.name.equals(((Application)obj).name);
    }

    public int hashCode() {
        return this.name.hashCode();
    }
}

Also, hashCode() based containers are pretty good with existence checks i.e. if you use a secondary HashSet<Element> in your ElementSet class, you can get wicked fast existence checks since it internally uses …

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You can, though it would require a bit of effort. Look into Webdriver/Selenium libraries for Java.

peter_budo commented: Haha, two admins on two posts with same solution ;) +16
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Nope, if there is anything in a post which is worth a moderator's attention (spam, invalid code tags, flame wars etc.), feel free to use the "flag bad post" link to bring it to our attention.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Also have a look at Envoy by Kenneth. Similar approach with a few more abstractions.

Gribouillis commented: thanks for the link +13
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Right, because Set guarantees unique elements, not necessarily in sorted order. If you need to maintain the order of elements, use `TreeSet<String>`. Just make sure the objects you insert in the TreeSet implement natural ordering (by implementing Comparable) or be ready to provide your own custom ordering (implement Comparator). Anyways, here is the extension snippet:

public static void main(String[] args) throws Exception {
	final List<String> lst = Arrays.asList("a", "b", "c", "a", "c", "b");
	final Set<String> set1 = new HashSet<String>(lst);
	final Set<String> set2 = new TreeSet<String>(lst);
	System.out.printf("Original list: %s%n", lst);
	System.out.printf("Unique values: %s%n", set1);
	System.out.printf("Unique values sorted: %s%n", set2);
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You need to tell us the type of values you have in the `List'. Assuming you have simple strings in the list, you can do:

// untested
final List<String> lst = Arrays.asList("a", "b", "c", "a", "c", "b");
final Set<String> set = new HashSet<String>(lst);
System.out.printf("Original list: %s%n", lst);
System.out.printf("Unique values: %s%n", set);
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> The criteria to seeing it is being a moderator AND a staff writer.

Good luck getting them reviewed. :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Notepad is not a compiler, it's a text editor used for typing in Java code. If you are just starting out, I'd recommend grabbing any text editor which highlights the code for you along with smart indentation. There are a lot of options in there: Notepad++, Gedit, Scite etc. I've also heard good things about "Programmer's Notepad".

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hi folks,

When browsing technical sub-forums, I noticed that there are a few threads which end with the OP replying "Thanks, it's solved/working now!" or something to that effect and are still not marked solved. Similar is the case with one-shot-posters who post a query which is duly answered but never return (or return just to read the answer) to make a reply or mark the thread as solved.

This has the consequence of valid solved threads not contributing to the total "solved thread count" of the sub-forum and the forum in general and more importantly denying +1 solved count to all the members who contributed to the discussion. The problem is that there is no way a thread contributor, who is pretty sure he has answered the OP's question, can mark the thread as solved.

So here is the deal: in case you encounter a thread which you are pretty sure should be marked solved, you can "report" any post of the thread (preferably the first one) with a comment along the lines of "IMO should be marked as solved". Also, please don't shy from reporting threads for which you are the only contributor. ;-)

I can't guarantee the "resolution" of each and every reported post given that moderators have limited time but this at least seems like a step in the right direction.

Ask away if things are still unclear or in case you disagree with something!

jingda commented: Agreed +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Unfortunately no easy way of doing this. There are two contenders in Java land (assuming you are talking about actually interacting with pages rather than just scraping the web page ignoring the JS part): HtmlUnit and Selenium.

HtmlUnit works pretty good for simple and compliant web pages. I have successfully used it for scraping simple sites like Reddit but failed to find any use when working with JS heavy sites. Plus I've heard bad sort of bug encounters when faced with quirky HTML markup. No generic support when returning collections means lots of casts but I'm sure this is a minor complaint.

Selenium, at least for me, was a pain to set up. Plus AFAIK it is something mainly aimed towards browser driven web application test rather than "scraping" though it can be certainly used as one. I have used it for automating "field" filling and clicks and it has worked out pretty well with code shorter than HTMLUnit. It spawns up a browser instance for simulating your script which I'm not really a fan of but if you can live with it, good for you.

If you are not afraid to ditch Java, I've heard good things about PhantomJS which uses a headless Webkit browser to do its bidding. Plus you get to write scraping scripts in Javascript (not sure if that's a plus for you).

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

It is working perfectly fine when I use:

System.out.print

but when I use

outputStream.print

The function of \r starts behaving like \n.

You have got to understand that "carriage return" is a control character and the behaviour of "returning the carriage" only makes sense for some devices. From the wikipedia entry:

In computing, the carriage return (CR) is one of the control characters in ASCII code, Unicode, EBCDIC, or many other codes. It commands a printer or other sort of output system such as a display to move the position of the cursor to the first position on the same line.

In a text editor, it makes little sense to again "move" to the beginning of the line and hence almost all text editors display it as a new line. Try this program:

public class Test {

	public static void main(String[] args) throws Exception {
		final File f = new File("c:/a.txt");
		final String cr = "\r";

		final PrintWriter pw = new PrintWriter(f);
		pw.print("Hi there, how are you?");
		pw.print(cr);
		pw.print("I'm fine good sir\nThank you");
		pw.close();
		
		final InputStream in = new FileInputStream(f);
		int i = -1;
		while ((i = in.read()) != -1) {
			System.out.print((char)i);
		}
	}

}

View the output file generated by the program in a text editor and compare it with the output printed on the console. What do you see?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

If you want to distribute your application to users, just package your JAR along with shell scripts for specific platforms, just as it is done for applications like Tomcat etc.

If you are using such shell scripts, it would be pretty simple to put in the sudo in the script and all the user will see is a password prompt. Something like:

# runserver.sh
sudo java -jar httpserver.jar

This way, your users won't be aware of "sudo" in the script and would just have to type in the password, as intended.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

AFAIK, you require "superuser" (also called as "root") privileges for binding to ports below 1024 and `sudo` does exactly that, run the program as a "superuser". From the sudo wikipedia entry:

By default, sudo will prompt for a user password but it may be configured to require the root password, and will require it only once every 15 minutes per pseudo terminal, or no password at all.

As you can see, it by default happily accepts the logged in user's password (just to confirm you really are you) before running commands as root. This can of course be configured differently to make sure sudo actually requires 'root' password but that's a different story.

Also, though admin users are almost like "superusers", there are a few areas wherein you actually require a superuser and you have stumbled upon one of them. The solution? When testing use a port which is above 1023, something like 8080. I don't do my development on a *nix box but there is a thread on SO which talks about the same stuff, maybe you can draw some inspiration from there but using a different port would be the easiest.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

A few months back Google had acquired an organization which specialized in created UI builders for Swing / SWT (the toolkit which powers Eclipse) and open sourced it. Not sure how good it is but worth a try if you are into creating drag-n-drop UI's.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

As you both have already observed, there are a few limitations with the current voting system. These are:

  1. You can't add a comment without adding/removing reputation
  2. You can't "undo" a up/down vote or reputation. Once an up/down arrow is clicked, closing the window which pops up just removes the ability to add a reputation comment. The up/down vote remains.

Both these are pretty much implementation details and can be much better explained by Dani but AFAIK these are on the TODO list. :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

If you want to modify a `List` while iterating on it, the simplest solution would be to use a list iterator as opposed to a regular iterator. List iterators allow destructive updates on the list while iterating over it.

public static void main(String[] args) throws Exception {
	List<String> lst = new LinkedList<String>(Arrays.asList("a,b,c,d".split(",")));
	for (ListIterator<String> iter = lst.listIterator(); iter.hasNext(); ) {
		if (iter.next().equals("b")) {
			iter.add("OMG_THE_MIDDLE!!11!");
		}
	}
	System.out.println(lst);
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I have deleted the groups since they didn't have a lot of members to begin with. I'll probably kick off a discussion in the mod forums related to this since this is pretty close to deleting threads on demand, which we don't allow right now. I'm sure you would exercise caution when creating your next group and not assume you would be able to delete them as required.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I think we've got a celebrity with us. :)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Ah, it completely slipped my mind. You need to be a member for at least 5 days and should have a reputation of around 15 to create a social group. This requirement was added to cut down on spammers creating social groups for the sole purpose of spamming.

blackcathacker commented: Thanks. I was looking all over, couldn't find out how. :) +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Looking forward to the new G1 collector which claims to be better than the CMS collector used by JDK 6. Also, it seems that they fixed the `TreeSet' to throw an exception when a non-comparable item is added to it (previously the the exception was thrown when you tried adding a second non-comparable/comparable item to the set). BTW, those who are interested in what *exactly* invokedynamic is, read the blog post by jRuby developer.

Then there is this one interesting addition to the networking stack, called the Socket Direct Protocol. Mmmm, fun stuff! :-)

and another release intent on making Java a clone of C#, Ruby, and C++ all at the same time.

JDK releases aren't just about the language. Sure, Java is trying to play catch with other languages out there but at least I'm more interested in the VM enhancements which would enable other languages built on top of the JVM to perform better.

peter_budo commented: Thanx for sharing +16
kvprajapati commented: :) +15
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The way I see it, the steps are as follows:
In top level directory of your project (the main directory), place the file named COPYING there having the contents as mentioned here.

And now follow the given instructions (taken from the gnu site):

For programs that are more than one file, it is better to replace “this program” with the name of the program, and begin the statement with a line saying “This file is part of NAME”. For instance,

    This file is part of Foobar.

    Foobar is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Foobar is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar.  If not, see <http://www.gnu.org/licenses/>.

This statement should go near the beginning of every source file, close to the copyright notices. When using the Lesser GPL, insert the word “Lesser” before “General” in all three places. When using the GNU AGPL, insert the word “Affero” before “General” in all three places.
sergent commented: Thanks +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

From the Javadocs:

Causes the currently executing thread to sleep (cease execution) for the specified number of milliseconds plus the specified number of nanoseconds. The thread does not lose ownership of any monitors.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Adding on to others, it also pays to know that cloning in Java is pretty much broken and for practical purposes you are better off using other alternatives (hand rolled copy constructor).

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

We need more details; what else was changed during the move? Which MySQL version are you using? Which client driver and what version? How frequently are you getting this error message?

A link you might find helpful: http://stackoverflow.com/questions/4380813/how-to-get-rid-of-mysql-error-prepared-statement-needs-to-be-re-prepared

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Some idiot had cleared all cookies on my machine after using some of his email account, I can only remember my youtube user name but no password, and when i was creating youtube user account i specified a email account which is not really exist, now, i am trying to retrieve my password, but no hope of recovering it....is there anything can be done to get my old youtube account, i just love it, it has all my collections and weird comments

You do realize that if this was possible, it would be a big gaping hole in the system since it would allow hackers to gain access to accounts just by knowing the user name, no? :-)

jingda commented: Sure make sense :) +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster