Using PHP how can I get week's start date and end date from any given date. For example 2010-05-13 is Thursday so how can I get 2010-05-09 (SUN) and 2010-05-15 (SAT)
Hello, I wonder if anyone can help - I have this error showing recently when debugging in eclipse - what doe it mean by resource, an imported package or the location of some java files ?
Can't find resource for bundle sun.awt.resources.awt, key AWT.EventQueueClass
MissingResourceException (id =45)
Thanks
Given this code:
String test() {
try {
return "1";
} finally {
return "2";
}
}
Do the language specifications define the return value of a call to test()? In other words: Is it always the same in every JVM?
In the Sun JVM the return value is 2, but I want to be sure, that this is not VM-dependant.
I know that this may be absolutely dumb but for the life of me I cannot figure out why I'm getting these errors in my Spring Project, it is basically from the MVC tutorial with a few modifications. This is the error I get when running my tomcat server.
`Caused by: java.lang.NoClassDefFoundError: org/springframework/web/servlet/mvc/SimpleFormController
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1581)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1511)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1271)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1242)
... 54 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.servlet.mvc.SimpleFormController at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) ... 71 more`
I just cannot figure out the issue with my classpath...I would appreciate any help. Here are all the jars in my classpath. I know that the class is inside the web-servlet jar but it's not seeing it. Is there a conflict?
aopalliance.jar
aspectjweaver.jar
commons-codec.jar
commons-dbcp.jar
commons-logging.jar
commons-pool.jar
jstl.jar
org.springframework.aop-3.0.5.RELEASE.jar
org.springframework.asm-3.0.5.RELEASE.jar
org.springframework.aspects-3.0.5.RELEASE.jar
org.springframework.beans-3.0.5.RELEASE.jar
org.springframework.context.support-3.0.5.RELEASE.jar
org.springframework.context-3.0.5.RELEASE.jar
org.springframework.core-3.0.5.RELEASE.jar
org.springframework.expression-3.0.5.RELEASE.jar
org.springframework.instrument.tomcat-3.0.5.RELEASE.jar
org.springframework.instrument-3.0.5.RELEASE.jar
org.springframework.jdbc-3.0.5.RELEASE.jar
org.springframework.jms-3.0.5.RELEASE.jar
org.springframework.orm-3.0.5.RELEASE.jar
org.springframework.oxm-3.0.5.RELEASE.jar
org.springframework.test-3.0.5.RELEASE.jar
org.springframework.transaction-3.0.5.RELEASE.jar
org.springframework.web.portlet-3.0.5.RELEASE.jar
org.springframework.web.servlet-3.0.5.RELEASE.jar
org.springframework.web.struts-3.0.5.RELEASE.jar
org.springframework.web-3.0.5.RELEASE.jar
postgresql-9.0-801.jdbc3.jar
servlet-api.jar
spring-security-config-3.0.5.RELEASE.jar
spring-security-core-3.0.5.RELEASE.jar
spring-security-web-3.0.5.RELEASE.jar
standard.jar
I know very well about the traditional arguments about why Interface Inheritance is prefered to multiple inheritance, there has been already a post here :
http://stackoverflow.com/questions/191691/should-c-include-multiple-inheritance
But according to Stroutroup the real reason why Microsoft and Sun decided to get rid off multiple inheritance is that they have vested interest to do so: instead of putting features in the languages, they put in frameworks so that people then become tied to their platform instead of people having the same capability at a language standard level.
What do you think ?
Hello,
I'm looking for a library that could perform "easy" pattern matching, a kind of pattern that can be exposed via GUI to users.
It should define a simple matching syntax like * matches any char and alike.
In other words, I want to do glob (globbing) like sun's implemented logic http://openjdk.java.net/projects/nio/javadoc/java/nio/file/PathMatcher.html but without relation to the file system.
Ideas?
What tools and standards do you use to describe your project, database, modules, classes,
their interaction for programmers, let's say after the project is finished.
Do you use UML?
Are there enterprise standards for Java developers, how to write such a documentation let's say from SUN?
Are there specific tools that simplify this documentation process & compilation of neccessary docs.
If there are good books on project documenting process,
please give me links to Amazon.
Hi there,
I have a date format like this :
$date1 = "Sun May 09 20:07:50 +0000 2010";
and I have to convert it to: 09-05-2010
I am using date("d-m-Y", $date1));
When I print this individually it gives proper result but I am using it in loop
it gives me results like: 31-12-1969
I don't understand why this is so?
Can you help, please?
Why in this millenium should Python PEP-8 specify a maximum line length of 79 characters?
Pretty much every code editor under the sun can handle longer lines. What to do with wrapping should be the choice of the content consumer, not the responsibility of the content creator.
Are there any (legitimately) good reasons for adhering to 79 characters in this age?
How can I use sed to replace this line
char * path_list_[1] = { "/some/random/path" };
with this line
char * path_list_[2] = { "lib/foo", "lib/bar" };
in a file named source.c
Notes:
* The path is really random.
* Your solution should only change this line in source.c
* I'm only interested in a sed oneliner.
You can use this Python regex as a starting point:
text = re.sub('static const char \* path_list_\[1\] = \{ "[^"]*" \};',
'static const char * path_list_[2] = { "lib/sun", "lib/matlab" };', text)
Just wondering if anybody has run Scala app or web-app on Java Real-Time system?
I assume because scala is bytecode compatible with regular JVM, then it should not take much effort to run it on a Real Time JVM such as Sun Java Real-Time System ?
Hi,
Some time ago, I had created a DLL to be used in another C program. Basically I exposed specific functions by using the following within my dll:
void __declspec(dllexport) MyFunc(myFirstArg, mySecondArg);
Then I added an external file (MyExposedDll.h) with all exposed functions and structures to the new C program and included it:
include MyExposedDll.h
Now how can I use this dll (or mainly a dll) to a Cobol function? I need to expose a function that has two char* arguments and returns a boolean.
Thanks,
Sun
I have created a function that has as input a char szMyChar; (using it in a switch statement).
Now I have a CString havong just a char, lets say CString strString = "A";
An option to call the function could be:
if (strString == "A")
CallMyFunc('A');
though it is clumsy. I tried atoi (returns 0) and casting though neither works.
Any ideas?
Thanks,
Sun
According to,
http://www.freshvanilla.org:8080/display/www/Java+Interview+Questions
Under,
Which class is the superclass of every
class?
null seems to be the answer.
I found that
new Object().getClass().getSuperClass()
verifies the answer as correct.
But can null be considered a class?
I see all primitive data types are represented as Class objects from
java[dot]sun.com/j2se/1.4.2/docs/api/java/lang/Class.html
Does anyone know a Library which provides a Thread.sleep() for Java which has an error not higher than 1-2 Millisecond?
I tried a mixture of Sleep, error measurement and BusyWait but I don't get this reliable on different windows machines.
It can be a native implementation if the implementation is available for Linux and MacOS too.
EDIT
The link Nick provided ( http://blogs.sun.com/dholmes/entry/inside_the_hotspot_vm_clocks ) is a really good resource to understand the issues all kinds of timers/sleeps/clocks java has.
From http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html:
\Z The end of the input but for the final terminator, if any
\z The end of the input
But what does it mean in practice? Can you give me an example when I use either the \Z or \z.
In my test I thought that "StackOverflow\n".matches("StackOverflow\\z") will return true and "StackOverflow\n".matches("StackOverflow\\Z") returns false. But actually both return false. Where is the mistake?
I tried the instructions at this tutorial (http://www.phpied.com/jslint-on-mac-textmate/) to run jslint with textmate but getting stuck at step at the last step of "Step 1"
Here is the error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/mozilla/javascript/tools/shell/Main Caused by: java.lang.ClassNotFoundException: org.mozilla.javascript.tools.shell.Main at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Thanks
I'm writing a Java application that runs on Linux (using Sun's JDK). It keeps creating /tmp/hsperfdata_username directories, which I would like to prevent. Is there any way to stop java from creating these files?
I was reading that JavaDoc for Threadlocal here
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ThreadLocal.html
and it says
"ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread (e.g., a user ID or Transaction ID). "
But my question is why did they choose to make it static (typically) - it makes it a bit confusing to have "per thread" state but its static?
Both lines of code:
KeyPairGenerator.getInstance("RSA")
KeyPairGenerator.getInstance("RSA", "BC")
works well. So, what's the differecente using BC or not? Is BC completely compatible with the default RSA used? (using sun JDK 6)
I need to access the Serial Ports with Java in Windows Vista and FreebSD
is there any third party Solution to do that?
I understand Sun doesn't have a solution for that
Here's an excerpt from Sun's Java tutorials:
A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Classes and Inheritance) and a few special classes that "wrap" certain primitive types: Character, Byte, Short, and Integer (discussed in Simple Data Objects ).
There must be a good reason why the long primitive data type is not allowed. Anyone know what it is?