void function() {
while (true) {
System.out.println("I was too lazy to do my own homework so I got this piece of code off the web!");
}
}
void function() {
while (true) {
System.out.println("I was too lazy to do my own homework so I got this piece of code off the web!");
}
}
A file doesn't have "a copy option", so there's nothing to disable.
And if there was it'd be at operating system level, so best left to assembler or C.
heck. Most people probably never get to the point of wanting a battery replacement.
By the time the battery runs out they've long since replaced their iPod with the next model ('cause you can't be seen with last year's model...).
tan(1) = 1.5574077246549022305069748074584
"Anyone can think of another song by Led Zeppelin."
I can't ;)
Townes Van Zandt - Waiting Around to Die
you could just use a search engine... There is tons of documentation about Struts, and even more about Oracle and JDBC.
I can't believe you read through all of that and still couldn't figure it out.
You too are too lazy to look back a few messages?
And do NOT ask for personal help, it's extremely RUDE.
In my experience teachers are usually very nice to pupils who show an interest, and not just sit there being disinterested during classes and then get barely passing grades at best because they didn't put any effort into their coursework.
They like being appreciated as much as the next guy.
yes, either use Log4J or JDK logging.
I don't know how to translate these deployment descriptors.
You'll need to take the documentation for both servers and compare the respective vendor specific deployment descriptors to see what goes where.
It does seem though that a lot of that code isn't really needed, was automatically generated by WebSphere.
You can check the JNDI names in the JBoss JMX console.
Find the JNDIView MBean and the List operation in that, it will give you every JNDI entry the server responds to.
Most likely you need to call your EJBs as "java:XXXXX".
jars can certainly work on mobile devices, but they must be created for them as mobile devices have JREs that provide only a subset of the functionality of the full API.
ur has nothing to do with it. Java didn't exist when people were living there.
to make an executable jar, you need to provide the Main-Class attribute in the manifest file inside the jar.
apart from the fact that hardly anyone uses it?
I've heard good things about it, but only from a very small group who seem to be hardcore Jini fanatics.
Noone else I've spoken to over the last decade has used it at all, and nobody knows what it even is (and the fanatics aren't telling, only telling that it's marvelous without saying why or what it does).
yup, that's a good way to do it. Do take into account the cost of running a stack of SOAP servers though in your price when you sell your service :)
At 17 I was cleaning toilets in a large London hospital, because it was better than being on the dole (unemployed.) Within 6 months I had moved to the warehouse at the hospital, and within another 3 months I was the surgical supplies buyer.
Which just goes to show that if you have the enthusiasm and work ethic, you can start at the bottom and progress upwards pretty quickly.
Sounds like my father, except he worked at a steel plant as an assistant clerk in the filing department (basically dusting filing cabinets all day long) and ended up running the place within a few months.
A few years later he was office manager of a medium size company, with several dozen people under him and a budget of (in today's currency) millions.
But that was over 50 years ago, today such a rise is impossible.
You now need a degree to even be considered for even menial labour...
uh, you're accessing 2 different servers there...
no, "this" in the actionlistener points to the actionlistener...
this in any class instance points to that instance.
And don't put comments on every closing brace, it's not needed and makes your code that much harder to read.
And don't use C++ style comments for blocks.
if he knew that he might know what he wanted to know so he'd no longer need to try and ask it ;)
If your application gets less CPU cycles it might become more sluggish.
The sleep time is defined as the minimum time the thread will sleep, not an exact time.
If another application eats most of your CPU, the one you're monitoring may not get enough of a timeslice to hit that sleeping thread just after a second, causing it to lag behind.
no, he's looking for something like the functionality Photoshop has to turn a sequence of images into a movie.
Of course Photoshop doesn't use anything like that framerate, as it's purely meant for presentation purposes so it will take a number of seconds per frame rather than frames per second.
A series of 100 images will run for about 15 minutes using the default settings.
I got the bigger one because I want to be able to carry all of my music with me, not just a few songs from various CDs. I also need the extra space because I rip all of my CDs at 320Kbps. That's about 120 - 160MB per CD.
only necessary if you use mp3 rather than aac (which has far better audio quality at lower bitrates than does mp3).
but only if you don't count the millions Indians working in body shops hacking together software for offshoring companies.
if you don't know the mailserver you're talking to, you can't talk to it so you can't send mail.
It would be like wanting to make a phonecall without knowing the name of the person you're calling nor his number.
I don't know how "u" does it. I do know how I'd do it.
WHAT can't you do?
Either you don't know what you're trying to do or you can't explain it to someone else.
follow some English language classes so you can understand the information you are able to find after the second stage.
That is: Follow an introductory course on the use of internet search engines.
JBoss has LoginModules.
Those are in turn controlled by login-module.xml in the server/conf directory.
In there you define your realms, what login module (class) to use, and parameters for that class.
The JBoss documentation explains how all that works in quite some detail, including how to create your own login module if the standard ones don't work for you (it's quite easy, I wrote one for the company I work for in under an hour).
I feared as much. That is NOT the way to go about it.
NEVER do that, classes specified there are ONLY for use by JBoss itself, NOT intended for use by applications running inside JBoss.
Those should have their own jars inside their ear files.
"this" IS recognised inside the actionlistener, it's just not what you think it is.
Learn a bit more about Java and you will see why, and what "this" is out there.
At the moment you're expecting quick hacks for everything without really understanding what you're doing.
That's the wrong way to go about programming.
Do simple things first until you thoroughly understand those, and only then try something more complicated (and adding an actionListener is NOT complicated, so if you have problems with that you need to really step back a lot).
You'd put the data in your web.xml or a properties file.
The username/password Tomcat stores is just for login to Tomcat itself (for sites that have authentication enabled) and then only if that authentication uses the default system (you can tell it to use different authentication systems like LDAP as well).
dump the .newInstance(), it's superfluous.
Without knowing the actual error the cause of the problem will always remain guesswork.
But most likely you either don't have the correct driver or the database doesn't allow you to connect.
That's illegal SQL if you want to set only a subset of the fields (which you want, as you aren't setting the PK field).
You have to supply the actual fields you're setting as well, and in the correct order.
Why is it that you want to write your own when Java has a rather good random number generator built in?
It seems he downloaded something that he wants to turn in as his homework but he doesn't know what that homework actually is and on top of that all interpunction on his keyboard somehow failed at the same time just as he was typing that message
no, we're not going to do your homework for you.
You should have ascertained the requirements before you started hacking. As you didn't, you now have to face the consequences.
There are programs that can translate from one language to another, but they're imperfect.
They also cannot translate from programming paradigms in one language to those in another, which leaves you with very weird looking code that's a dead giveaway as having been generated by such a tool.
Almost always it's better to start from scratch.
Another reason I don't care about those limitations is that I only (so far) play music on my iPod that I imported from my own CDs.
So there's no DRM involved at all :)
And as I only have 4 computers, plus 2 at work, and have iTunes installed on only 2 of them, it doesn't matter anyway ;)
In most environments username, password, and database url (as well as the actual driver) are stored separately in a configuration file that's not maintained (exclusively) by the people building the application.
It's far easier for a DBA or systems administrator to change a properties file that has a username, password, URL, and driverclass entry than a single very large string.
Most ORM frameworks and other abstraction layers (which you really should use when doing for real database access) also expect them to be separate for that reason.
For example, JBoss expects the following configuration file for a Firebird database (the username and password are the defaults Firebird gets installed with, so everyone who knows Firebird should know about them, thus I'm not divulging secrets here ;)):
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>TitanDS</jndi-name>
<connection-url>jdbc:firebirdsql:localhost/3050:titan</connection-url>
<driver-class>org.firebirdsql.jdbc.FBDriver</driver-class>
<user-name>SYSDBA</user-name>
<password>masterkey</password>
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
<track-statements/>
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<metadata>
<type-mapping>Firebird</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
Technically you'd need to have something else do that.
You can't loop the entire program from within the program, for what would loop the loop?
So you'd need either some sort of wrapper around it that's not part of the program, or put the entire thing into a task scheduler (like cron on Unix machines).
hmm, the blatantly obvious: check whether the method actually exists in the same class you're calling it from.
And of course rename RenameImage to renameImage.
<c:out value="${reminder}"/>
The string you get back from the session is null, so your attempt to call toString() on it results in an NPE.
You should really use JSTL as well.
Something like
<c:choose>
<c:when test="not empty session.loggedUser">
...
</c:when>
<c:otherwise>
...
</c:otherwise>
</c:choose>
Makes it immediately apparent what you're trying to do, and will not result in an NPE.
also, ALWAYS close database resources after use.
And your connect string looks really weird.
Normally you'd pass username and password separately.
and don't use the bridgedriver.
I'm not talking open source here, just common sense.
The best protection for your intellectual property is not letting it out the door.
If that's not possible, make sure your customers know what they're licensed to do and what the penalties are for doing things they shouldn't (like decompilation and illicit redistribution).
Easiest (and fastest) is to use regular expressions to replace all uppercase letters with an asterisk, then call toUppercase() on the resulting string.
Far more elegant (and possibly faster, especially with long strings) than looping through every character.
same here. 2GB is 24 hours (roughly), more than enough.
the page loaded into the iframe is a completely separate entity, and has nothing to do with the page in the main frame.
While they can communicate using cookies and Javascript, that's not recommended (just as the use of iframes is not recommended, and in fact in the latest html standard they've been removed).
Do NOT do that in a JSP, use a servlet...
How hard can it get.
JSP are for PRESENTATION only, NEVER for application flow control or business logic.
No, exes too can be easily decompiled and the source analysed (by someone who knows how).
ALL programs can be decompiled by someone who is determined enough.
The only reason some people ship what looks like executables when they ship Java programs is to enable them to be run on systems that have no JVM installed.
If you were to analyse those exes, you'd find that they're typically a JVM with all the classes added to the end as a jar file that's just copied into the exe and deflated at runtime.
Simple fact of life: The vast majority of peope couldn't care less about decompiling your program.
The vast majority of people (usually kids, almost never professionals) who think they need to "secure" their classes write code that's completely uninteresting to anyone who would look at it. There's nothing very clever or groundbreaking there that would give someone a business advantage for example.
The rest won't be stopped by anything.
If you don't want people to ever have the ability do decompile and read your sources, don't ship them.
Deliver your product/service through a web interface for example, or as a SOAP service.