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

I'm not sure why you are assuming that there would only be 1000 submissions per day? Any reason for limiting the last part to 3 digits/characters? Any reason to not try out a pattern like "yyyyMMdd-HHmmssS" which automatically handles the resetting for you?

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

Having looked at the URL above, I have a hunch that the database server version should be the same as the client driver version for optimal operation.Could this be the cause?

You can try updating to a new version but I doubt that's the reason why this is happening. If it were, why wasn't it happening previously? Do you run any database heavy jobs around that time or is it that the hits to your database are maximum at that time? I've read about prepared statement failing due to dumps going on at the database level for MySQL.

A temporary solution (if you are in need for one) might be to put a try...catch around the prepare call and try preparing the statement again if it fails for the first time. Other than that, your best bet would be to try to understand *what* special processing happens at around that time or recollect what else was changed during the move.

~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

AFAIK, you can create threads there, which would effectively be news "tips" you want to offer to the Daniweb editorial section. These submitted threads (apart from your own that is) can only be viewed by those who have the "blogger" privilege activated. My guess is that since the last time you marked the forum as read, someone might have submitted a "tip" effectively tripping the flag but since you don't have the rights to view that forum, hence the message.

Or so I think... :-)

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

You need to provide more details. Can you paste your console (cmd window) session here?

~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

As mentioned, for the time being it's just for the home page (www.daniweb.com) and news articles. On the home page, look at the top right corner near the tweet button.

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

The learning never stops. I've been doing it for a long time and still stumble upon new things everyday.

Start from the basics and you'll realize there is no end to this. Also, a must read.

Ezzaral commented: Definitely. +15
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

There can be a few things going wrong here. First, what is the difference between your "localhost" and your "server" in terms of operating system, architecture etc.

Also, the second error suggests that you have a classpath problem haunting you so the question which follows is, how are you setting the classpath for your application?

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

There are a lot of things going wrong here.

First, you should never ever mess around with your Java installation. Never. Setting class-path when compiling your files should be the way to go. Also, don't mess around with the "ROOT" application which comes pre-installed with your Tomcat.

I'll outline the steps in brief as to how you can get your first servlet up and running.

  • First, install Tomcat on your machine
  • Set the environment variable (Right click my computer -> properties -> advanced tab -> environment variables -> New) TOMCAT_HOME to point to your Tomcat installation directory. Click OK.
  • Open up a *new* command prompt and type: echo %TOMCAT_HOME% and it should display the directory of your Tomcat installation. If not, go back to the previous step and try to understand what went wrong.
  • In the "webapps" folder of your tomcat installation, create a new folder called "test". Create a "WEB-INF" directory in the test directory. Navigate to the WEB-INF directory and create two directories inside it; src and classes (normally "src" files are *not* part of WEB-INF but normally are part of your IDE project but we'll keep it simple for now)
  • Create your test servlet Java file and place it into the "test" folder inside the "src" directory. Also, make sure that you have a package declaration at the top of your Java file. In my case, I'll assume the package name of "test".
  • Now, assuming you are in the "src" directory, compile the classes …
kvprajapati commented: thor·ough +15
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I did something similar a long back when I was playing around with Python. You can find my scribblings here; just adjust the method calls and you should be able to understand how it works. The trick here is to think in terms of co-ordinate, try to plot stuff on a piece of paper and then code for it. Also, please make sure you use the code only as a reference and try to come up with your own implementation. ;-)

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

Do you have the appropriate permissions for creating a server socket on your machine? Are you the administrator? Have you made any changes to your default policy file?

Also, it seems you are using a very old tutorial. You don't need a "rmic" compiler these days. Read the official RMI tutorial and post if you are facing any issues.

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

A pity I missed that; you just need to append the database name at the end of your URL. Example here.

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

> Is there a way to make it retry the connection

Automatic retries? Not that I'm aware of. Of course, it's dead simple to just loop over for a given number of times before giving up completely.

> I set the timeout to 500Secs and it still timesout in like 5-7 secs...

The timeout exception need not necessarily be of the client socket (in our case the socket used by the Driver). Server sockets can also have timeouts which might be the reason why you are getting time outs (which again is not surprising given timeouts in your ping). Are you able to connect to the database in consideration using some sort of SQL explorer like workbench?

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

Are those your real login details? If yes, please edit them out.

Regarding timeout, are you able to ping the given host from your machine (ping tribalwars.db.4489877.hostedresource.com)? Also, what happens when you comment out the DriverManager.setLoginTimeout(100) line? I don't see a port number mentioned in there; is the db in consideration running on default MySQL port?

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

Bit late to the party I guess, but welcome aboard Kerry! :)

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

Basically give the members the ability to make their own queries

Or you could just, you know, remember the folks who rub you the wrong way

Or just ban those who rub you the wrong way, if you have banning powers that is. ;-)

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

Vector class *has* become obsolete. If you need a synchronized List, just wrap the plain old ArrayList class inside the Collections.synchronizedList call. In short, don't use Vectors unless you are tied to an API which forces you to use it.

Also, don't rely on synchronized collections when it comes to handling race conditions; they synchronize individual calls and not logical calls which you actually should have synchronized.

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

I swear I have read somewhere that when the manifest is set up properly that you don't even need to set that property (which is what I meant by the Services interface), but I can't, for the life of me, find it now. Maybe it was only in relationtion to JEE 6 capable containers.

You are probably talking about the ServiceLoader class which was introduced in Mustang. Derby uses this for loading and registering its client drivers whenever you have the derby-client.jar in your classpath.

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

I'd like to recommend EQ2 here; I've never seen any bots in-game, friendly players and a nice community. I agree the basic (bronze) subscription is a bit restrictive but you always have an option of buying selective races/classes.

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

I always felt one more in the list is required. Like if user who started thread was last to reply on that thread and that thread is still unsolved. It means that user is expecting someone to answer

...or has already got an answer and is thanking the ones who helped him solve the issue. :-)

But really, IMO for those who help out, monitoring the forum once a while (every 3 hours or so) for new replies is pretty much a trivial.

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

A thread containing a link to the most frequently asked questions might be a good idea but to make individual threads sticky is not really worth it. It would just end up resulting in a proliferation of sticky threads in a given forum and thus reduce the effectiveness of a sticky thread.

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

At the bottom of each forum, the legend/meaning for each icon is given. The only one missing from the list is: http://images.daniweb.com/vbulletin/statusicon/thread.gif which denotes a normal thread: i.e. a thread which you have already read, is not *hot* (err.. I mean popular) and you don't have any posts in it.

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

> I'd like very much to know where it's gone, if anyone has any good information...

Seems like a goof-up by the oracle folks. There are a couple of threads created on teh official Oracle Java forums but no response by the staff till now. A few folks have observed that it's not just the JLS but a couple of other links which either point to completely wrong resources or return a "not found" error.

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

I've updated the code snippet as per the request. Also, it would be nice if you could mention all the references you used when creating this since the linked Wikipedia page isn't very helpful in regards to specification, instruction set etc.

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

You might find it helpful if you think of class loading and initialization as two different things. For e.g. when I write "StatKlass.THE_ONE", the class-loader loads the binary representation of the class StatKlass (i.e. the .class file) but *doesn't* initialize it.

EDIT:
> Lets wait for SoS to comment now..

I already have given my comments. :-)

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

You've got things mixed up; re-read my post and try out the example. Kashyap provided a way for "explicitly" initializing a class whereas I talk about implicit initialization in my first post. The entire process is mentioned in the specification.

A class or interface type T will be initialized immediately before the first occurrence of any one of the following:

T is a class and an instance of T is created.
T is a class and a static method declared by T is invoked.
A static field declared by T is assigned.
A static field declared by T is used and the field is not a constant variable (§4.12.4).
T is a top-level class, and an assert statement (§14.10) lexically nested within T is executed.

So basically, whenever you try accessing a static field (except for constant variables), the class would be initialized.

warlord902 commented: Thanks for directing towards specification +2
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yes, the class initialization has to complete (executing static initialize blocks and initializing static fields) before you can access the 'con' static field which implies initializing the other static fields. But there is an exception to this rule: the class initialization does *not* take place if you access a "constant variable" (final declaration of primitives of string in your class). E.g.

public class Test {

    public static void main(final String[] args) {
        System.out.println(StatKlass.THE_ONE); // will *not* cause initialization of static fields (e.g. conn)
        System.out.println(StatKlass.NOT_THE_ONE); // will cause initialization of static fields (e.g. conn)
    }

}

class StatKlass {

    public static final int THE_ONE = 1;

    public static int NOT_THE_ONE = 0;

    public static ServerConnection conn = new ServerConnection();

}

Many people get confused between class loading and class initialization and assume that all static elements would be initialized when the class is accessed for the first time, which isn't the case as we see above.

Also, if your class implements an interface and it has "fields" (public static final by default), those won't be initialized when the class is initialized. They have to be explicitly referenced for the initialization to take place. Same with super interfaces of an interface.

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

AFAIK, this is expected. The IP address assigned to you by your ISP is the external IP address whereas the unique IP addresses of each of your network machines are "internal" addresses which aren't viewable to the outside world. This is one of the reasons why browsers don't just rely on IP addresses for client identification but use a token mechanism like passing token (session id) using cookies or by appending it to the URL (another one is client using proxy servers).

So to answer your query, this isn't just about "different" computers but about public IP addresses. A solution around this would be to use a token mechanism i.e. generating hashes and assigning them to clients which connect to your server and "destroy" or "invalidate" the hash when the client logs off or a certain period of inactivity is observed.

masterofpuppets commented: thanks for the suggestion :) +5
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Anything included between the [noparse][/noparse] tags won't be parsed by the vBulletin template engine if that's what you are asking.

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

To add to Davey's post, the moderator team normally treats "Keep it legal" cases with highest priority given that having copyrighted content around for a long time without proper attribution might end up putting Daniweb is a big mess. That is one of the reasons why no warning is issued for the "Keep it legal" infraction; two strikes and you are out.

Hope that clears up the reason why you were banned.

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

I think you should first try with NetworkServerControl simply because it seems more logical than setting system properties (at the JVM level) and relying on the derby driver class loading to start the server.

Regarding the properties file, I think you just need to create the properties file with the contents as per your need and make sure it is on the classpath (look into how to set classpath for a given JVM process; tip: java -h). Also, read this.

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

Have you tried using the NetworkServerControl API as mentioned in the second point linked in your post? If yes, what kind of problems are you facing?

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

I'm assuming that the aim here is to make Java developers aware of the JVM port of Python programming language and the goodies which it brings with it. However, those thinking of making a transition from CPython to Jython in hope of a better GC and threading, please make sure you read the "differences between CPython and Jython" page (not sure how updated that page is, but worth a read).

As a side note, "Grinder", the load testing framework uses Jython as its scripting language. :-)

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

Is there a way to do this that I just haven't found?

AFAIK, there is no way of doing this. You can of course use a pen and paper (or a text file in computer savvy terms) to keep track of things but I'm sure you didn't have this in mind when you asked the question. ;-)

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

AFAICT, that isn't blue, it's green and gray. It means that:

  • Either you were awarded reputation in a forum where reputation doesn't count (e.g. Geeks Lounge)
  • You were given reputation by someone who doesn't have enough rep power to influence you. As an example, take a look at this member who awarded you reputation in a technical forum but it still showed up as gray.

There is another color, red, which means that you were given a negative reputation (typically given when someone doesn't agree with your post and wants to negatively influence your reputation).

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

A bit late to the welcoming party but, "welcome back Davey". :-)

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

Given that Davey still has the 'administrator' badge, I'm hopeful that someday he'll start contributing again to the forum; will be waiting for you. :-)

Okaeri nasai Narue. :)

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

I think Kashyap was specifically asking for entire threads in RSS feeds and not just the entire first post of a thread.

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

I'm not sure what exactly you are after here? Featured member/poster isn't about fame or fortune; it's about getting to know a bit more the regulars who lurk on Daniweb.

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

1) Must you be a sponsor to be a feature poster?

No.

2) Do you need a certain amount of post, solved threads or reputation.

No, it's a hybrid algorithm where we take into consideration a lot of things. The primary requirement is that the member should have posted long enough for us to *know* more about that member. We are pretty good at valuating folks (after having spent a lot of time moderating) so you can be rest assured that good folks always get a chance. And as already mentioned, you can always recommend some... :-)

You must first go without sleep for 36 hours before being subjected to numerous hard-hitting questions like 'What you did last Summer' and 'what you had for breakfast'

Can't say I disagree. ;-)

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

> http://translate.google.com/translate_tts?q=Daniweb

This URL gives me a 404 (document not found) hence doesn't yield anything. The actual URL should be: http://translate.google.com/translate_tts?ie=UTF-8&q=hello&tl=en&prev=input .

I'd recommend using a property HTTP library which offers sufficient abstraction, something like HttpClient or Resty. A sample test code using Resty can be found here.

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

Daniweb members who are interviewed for the Daniweb monthly digest/newsletter get the title "featured poster". These members are typically picked up by site administrators based on factors like contributions, frequency of visiting Daniweb etc.

Admins typically have a list of 'to be interviewed' folks but if you feel that someone fits the role for an interview (including yourself :>), you can always PM Davey (aka happygeek) and that name would be added to the 'to be' list.

jonsca commented: They told me it was based all on looks... this changes everything! +0
jingda commented: I thought is has to be the mumber of post you have, this prove me wrong +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The problem with this approach is that the welcome would seem kind of forced. And not to mention the possibility of the answer being forced as well. It might go something like this:

OP: Hello, can anyone help me with xxx? Thanks.

New-Member: You are almost there, just change yyy by zzz and you should be good to go.

I-Just-Saw-Sunshine-Member: Yeah OP, you should totally follow what 'New Member' has written down. That being said, New Member, welcome to Daniweb. Hope you enjoy your stay here. Looking forward to working with you.

Just to be clear here, as long as your posts are 'on-topic' in the forum you post, it isn't against the rules but if your posts start becoming more of a welcoming committee speech and less of a valid answer, it's annoying for everyone.

That being said, you "can" do it without violating the rules but with that long speech, it would be considered annoying. A simple "Oh and BTW, welcome to Daniweb" added at the end of your post or a simple reputation comment "Welcome to Daniweb" would be much more desirable.

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

You need to create task objects when you are iterating over the resultset. These task objects can be then pushed inside a list. You can then use this list as you see fit i.e. to run the tasks etc.

// untested pseudocode
final ResultSet rs = stmt.executeQuery();
while(rs.next()) {
  // create new task object
  taskList.add(task);
}
// close resultset, statement and connection

// somewhere else
for(Task task : tasklist) {
  // execute task
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Why do you have this line in the Order class?

Order order = new Order( 0 );
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

A member gains a 'banned' status if he ends up gathering 10 infraction points. When a member is infracted for breaking the rules (http://www.daniweb.com/forums/faq.php?faq=daniweb_policies), he is "infracted" and "awareded" infraction points based on the severity of the rule broken.

Bans can expire, typically in 6 months or so, unless it's a perma ban, which is normally given to persistent drug/porn spammers and those members who create new accounts for the purpose of avoiding/getting around a ban.

jonsca commented: I thought it was when a group of people gathered and played music together.... +0
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I think you should post your solution or what you did to solve the issue to help out those who stumble upon this thread in the future. :)

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

I have two string which have time in them like

one= 11:54:30.360
two= 11:54:30,427

Wht is the best way to get the difference between them

IMO, the best way would be to convert both of those to proper Date objects using the SimpleDateFormat class and then apply normal Date diff algorithms/methods to the same.

// sample pseudocode; untested
def sdf = new SimpleDateFormat("HH:mm:ss.S")
def dt1 = sdf.parse("11:54:30.360")
def dt2 = sdf.parse("11:54:30,427")
// use dates dt1 and dt2