 |
 |
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-fou
|
|
|
|
 |
is it possible to divide one iframe into different rows and columns in html5 as we use in frameset.
|
|
|
|
 |
Quite possibly, but what does that have to do with Java?
|
|
|
|
 |
I want to load 3 html pages simultaneosly
|
|
|
|
 |
What does that mean? And again, what does it have to do with Java?
|
|
|
|
 |
What is the best way to structure the naming of your (java) packages?
By design paradigm: my.app.dao, my.app.services, my.app.util, my.app.model, etc.
or by function/context name: my.app.clients, my.app.registration, my.app.production, my.app.accountancy?
On a side note:
I think I remember watching a keynote speech on the Spring framework where a developer advocated the structuring of packages according to the application's domain functions. The same would happen for URLs:
/login
/register
/products/sales
/products/production
/accountancy/general-ledger
/accountancy/analysis
The problem of the classic paradigm package structure would be redundancy/visibility problems:
services/userregistration
services/agenda
services/products
model/userregistration
model/agenda
model/products
dao/userregistration
dao/agenda
dao/products
Each function is repeated per layer.
What is the best approach?
modified 8-Aug-14 9:18am.
|
|
|
|
 |
Not exactly sure what you are suggesting but if your 'services/userregistration' is based on authorization/authentication then you have a rest call for that and nothing else. Presuming that the functionality is in fact the same.
That is similar to your other areas in that either something like 'products' is different for 'model' and 'services' or it is the same. If the same then there would be a root 'product' and not the way you broke it out. If they are different then they should have two different rest methods.
|
|
|
|
 |
I keep it classic. That's what I - and more important - other programmers/colleagues are used too.
regards Torsten
I never finish anyth...
|
|
|
|
 |
Hello!
I'm not sure i'm in the right topic for this question. Feel free to redirect me to the appropriate one, if necessary.
I have an ANT related problem. I want to read some values from a file (new.txt), substring the parts i need from each line and then, concatenate all these values with "_" between them. This big concatenated string will be the name of a folder i'll create. Here is the code i wrote:
<target name="create">
<loadfile srcfile="new.txt" property="fisier" />
<scriptdef name="substring" language="javascript">
<attribute name="text" />
<attribute name="start" />
<attribute name="end" />
<attribute name="property" />
<![CDATA[]]>
</scriptdef>
<var name="concat.var" value="" />
<for param="line" list="${fisier}" delimiter="${line.separator}">
<sequential>
<substring text="@{line}" property="subtext" />
<echo>${subtext}</echo>
<var name="concat.var" value="${concat.var}_${subtext}"/>
</sequential>
</for>
<property name="concat" value="${concat.var}"/>
<echo>${concat}</echo>
</target>
Now, the issue. I coded the javascript part to help me with the substring, but i can only use it once. When i build the name of the folder, the loop puts an "_" in front of it, and i want to get rid of that.
I want something like: 1344_dvfgf_sfgg_wfggh
but i have: _1344_dvfgf_sfgg_wfggh
I can't seem to reuse the javascript code i wrote before to solve that problem too. What am i doing wrong?
|
|
|
|
 |
Is this just a javascript problem? If so I suggest you create a mock up of the code that you want in something that you can actually run it (not ant) to test the basic layout and then put it into Ant.
Algorithmically there are two choices: don't put it on in the first place or take it off after the end.
First is done initially by checking if the result is empty just before adding the next step. If not empty then add the underscore.
Second is done after the loop exits, then check to see if the first char is an underscore then remove it.
(And no I have no idea how to do this specifically in java script.)
|
|
|
|
 |
HOW TO convert java application project file into .exe file
|
|
|
|
|
|
 |
Can anyone help me in downloading the jar files of HP Quick Test Profession 11.0?????
|
|
|
|
 |
What help do you expect other people to be able to give in downloading?
|
|
|
|
 |
Hi All,
The Alert Interface in Selenium doesnt have any implementing classes on its own. In such a case, how will the user get to know the exact method or exact class through which the alert interface can be used....
To put it in a simple way, how to use an interface when there are no implementing classes for the interface.
|
|
|
|
|
 |
Hi,all.Could anybody give me a detail describtion of the channel?(that is,something likes file channel,socket channel,etc.) or give me the relative link about it.Also,I want to know:
1.How the os implements the channel,does it need any hardwares to support?
2.What does it differ from the stream,in what situation,I should use it rather then the stream? What's its advantage?
Thanks to all.
|
|
|
|
 |
What 'channel' are you talking about?
|
|
|
|
 |
Please take file channel as an example to explain it,mainly focusing on thease questions:
1.How the os implements the file channel,does it need any hardwares to support? or it just a virtual concept?
2.Why I should use it instead of the file stream?
Thanks!
|
|
|
|
 |
The Channel[^] is a Java concept, implemented on top of the operating system. As the documentation states, this can be a hardware device, a file, a network socket, or a program component that is capable of performing one or more distinct I/O operations, for example reading or writing. The choice of when to use channels over streams is something you need to decide when designing your application, as it will depend on your requirements.
|
|
|
|
 |
I am developing a java application which after developing i want to sell off to some organisation, but i dont know how to package all my project files into one file for commercial because i dont think they need to be viewing my source code.
How can i pack them all in one setup file? :(
|
|
|
|
 |
The simplest way is to put all your classes into a java archive via the jar command. You then need to send only the jar file(s) to your customers; see http://docs.oracle.com/javase/tutorial/deployment/index.html[^]. You could also try a Google search to see if there are any other setup applications applicable to Java apps.
|
|
|
|
 |
Do NOT include your source files. Only compiled files should be in the setup.
Make sure resources and config files are in and accessible.
Use Launch4j[^]. It's common used for creating a setup.
If you want to protect your code further on, use an obfuscation tool like ProGuard[^]. It will make the compiled code unreadable.
regards Torsten
I never finish anyth...
|
|
|
|
 |
In terms of thread safety:
How can it be determined an object escapes a method call, without using JVM escape analysis?
('Escaping' means that an object can be accessed after the method completes)
A couple of examples on how an object can escape a method call:
1) The method returns the object that was locally created:
public MyObject someMethod(){
MyObject localObject = new MyObject();
return localObject();
}
someMethod.changeSomething();
2) One of the methods called with the LocalObject as parameter, stores the LocalObject instance in a way that allows access to it from other threads.
MyMember member;
public void someMethod(){
LocalObject localObject = new LocalObject();
localObject.callMethod();
method2(localObject);
}
public void method2(LocalObject localObject){
localObject.setValue("value");
member = localObject;
}
Does anyone know any more practical examples on how an object can escape a method call?
|
|
|
|
 |
Neo10101 wrote:
No it can't. Not from that method.
Thread 1 calls that method. That method create a brand spanking new object and returns it to the caller.
Thread 2 calls that method. That method create a brand spanking new object and returns it to the caller.
Neither object is the same. The calling sequence of the threads 1 and 2 are irrelevant (again in the context of this method only) each will still get a new object which is untouchable by the other thread.
Neo10101 wrote: Does anyone know any more practical examples on how an object can escape a method call?
The method returns a data member of the class which is an object. So
public MyObject getMyObject() { return myObject; }
|
|
|
|
 |
Hi,
I just want to check that the given PDF file is 3D PDF or normal PDF file. Can some one know how can I do this in JAVA?
Regards,
Ravi
|
|
|
|
 |
You would need to check the PDF specification to see how to tell the difference. Although I am not sure there is such a thing as a "3D PDF file".
|
|
|
|
|
 |
I'm fairly new to programming especially ones that use database. I can make software that use database but only with .NET and using MySql with XAMPP. However I'm still trying to figure out how to do that in Java because I'm currently learning the language.
However I saw this application which is an application for saving solve times for rubik's cube speedsolves. The software is called Prisma Puzzle Timer. [Download]
The software generates a file with the .db extension on first run in the same directory of the .jar file. I assume this is the database.
My question is how can this be done? And what type of database is it? (the .db file extension)
Although the said software is open source, I don't have enough knowledge to understand the source to even find where the database creation is implemented (though I'm still trying to read through the source and I'm still in my learning phase in Java programming).
|
|
|
|
 |
The .db extension on the file tells us nothing, because it depends on the program that is generating it as to what format it takes. If you are interested in using databases from Java, and Java itself, then your time would be better spent studying the Java Tutorials[^].
|
|
|
|
 |
Ah, yes. I just got familiar with that file extension meaning nothing. I actually tried The Java Tutorials but I had a hard time understanding everything there. Perhaps I didn't had enough programming experience yet because I think they assume you've had C++ knowledge already. So I'm currently learning Java with other tutorials.
Anyway I'm familiar with MySql.
|
|
|
|
 |
extranghero wrote: I had a hard time understanding everything there. Perhaps I didn't had enough programming experience yet because I think they assume you've had C++ knowledge already. No, you should be able to work through those tutorials without any previous programming experience. The introduction starts from the very basic concepts.
|
|
|
|
 |
I think what you mean is to have an embedded database in your application. Well in that case, you have a number of choices. I would suggest you look at [Hypersonic SQL^]. It is lightweight and quite mature.
Another option is to look at [Sqlite^]. I have not used it in a Java project before, but it is quite a nice and fast little database.
|
|
|
|
 |
Derby is another choice. Might be better for someone learning java.
|
|
|
|
|
 |
Alright I'll also read about this. Thanks.
|
|
|
|
 |
Thanks! I will try to have a look at HyperSonic SQL. Hope this will work for me.
|
|
|
|
 |
Hello Dear Friend, I'm also having the same question. When you got to know the answer or code for this please do share it with me.
Gokul Gawande
|
|
|
|
 |
I have created some java codings but i want to convert to a exe file.
|
|
|
|
|
 |
i want ask java programing can do what effect in software?
|
|
|
|
 |
One thing it can't do is parse garbled english.
|
|
|
|
|
 |
i dont know any programming language but im intrested so help me i like java . java basics and programing how to no help me
kickan
|
|
|
|
 |
i dont know any programming language but im intrested so help me i like java . java basics and programing how to no help me
|
|
|
|
 |
The first thing you need to do is to learn how to use Google to help you in your research. A quick search for "Java tutorials" would have found you The Java Tutorials[^]; clear, concise and useful for anyone new to programming.
|
|
|
|
 |
JAVA is Free: Unlike programming languages like Dot Net where you need to pay Microsoft to get license copy software for application development, JAVA is FREE to download. Due to this JAVA is very popular over other paid programming languages.
Java easy to learn: JAVA programming is easy to learn was compared to C or C++. JAVA has a similar syntax like C++.
JAVA is Platform independent: JAVA stands true to its tagline “Write once and run anywhere”. You create JAVA applications in Windows and run it in Linux or other operating systems and vice versa.
JAVA Open source Libraries: JAVA has a rich set of API and Documentation, which helps in developing your applications faster. Java has global talent pool to help.
Garbage Collection: JAVA has a powerful memory management technique i.e. called garbage collector, so Programmers do not have to worry about memory issues in application.
|
|
|
|
 |
let,
upper bound = 100
lower bound = 60
starting seed = 62
program prints random number starting from 62 at regular time intervals within this limit.
How can i implement this program in java?
|
|
|
|
|
 |