 |
 |
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
|
|
|
|
 |
How to validate the date in java. conditions are User can enter the data once in a day for perticular username. please provide the solution
|
|
|
|
 |
how to convert ascii characters to septet and then how to pack septet in 8 bit representation ..
Reply quickly
Thanks for reply in advance
|
|
|
|
 |
Ascii characters are already 7 bits wide. If you wish to pack them close together then it is just a matter of repeated shift and add.
|
|
|
|
 |
What am I trying todo: I request the document from a website with jsoup and then I try to get different kind of information from it. So far it worked with like getting the text of a tag but now I have a few H2 tags which contains headlines of different Information structures. I need to check if this H2 tag a specific text and then get the text of the parent html node.
This is the code I try to execute
String expression = "//h2[text()='Synopsis']";
System.out.println(Xsoup.compile(expression).evaluate(doc).get());
and this is the exception I get
org.jsoup.select.Selector$SelectorParseException: Could not parse query 'h2[text()='Synopsis']': unexpected token at 'text()='Synopsis''
at us.codecraft.xsoup.xevaluator.XPathParser.byFunction(XPathParser.java:225)
at us.codecraft.xsoup.xevaluator.XPathParser.consumePredicates(XPathParser.java:202)
at us.codecraft.xsoup.xevaluator.XPathParser.findElements(XPathParser.java:138)
at us.codecraft.xsoup.xevaluator.XPathParser.parse(XPathParser.java:51)
at us.codecraft.xsoup.xevaluator.XPathParser.parse(XPathParser.java:375)
at us.codecraft.xsoup.xevaluator.XPathParser.combinator(XPathParser.java:85)
at us.codecraft.xsoup.xevaluator.XPathParser.parse(XPathParser.java:49)
at us.codecraft.xsoup.xevaluator.XPathParser.parse(XPathParser.java:375)
at us.codecraft.xsoup.Xsoup.compile(Xsoup.java:27)
at de.daraku.coding.daraku_mal_api.Test.TestParseAnimeSearch.TestSynopsis(TestParseAnimeSearch.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
For the last 4 hours and tried like 30 different xpath statements like the one above I'm at a loss here and can't think of anything more I could try. Every selution that goes remotely in this kind of direction I tried returned null, something entirely different as I expected or with the exception you see above.
here is an example that actually works but as I said before its quite easy
Xsoup.compile("//div[@id='contentWrapper']/h1/text()")
and yes the H2 tag with the text Synopsis exists, If I requests a list of all H2 tags like this
String expression = "//h2";
List<String> list = Xsoup.compile(expression).evaluate(doc).list();
there is a list entry with Synopsis as tag at the 5th position. But since I can't really say that every H2 tag will be displayed its hard to say that its always on the 5th position.
I chose XSoup because it is XPath based on JSoup and since I already use Jsoup, why don't combine it and save some time (thats at least what I thought)
Is Anyone here that can help me? Is it only a problem of XSoup, Or is my statement just wrong? Or is there an even better way to do this?
|
|
|
|
 |
how to close the modal dialog so that it return to parent window by using button ?
I am using window.close(); it is not working . What other we can implement ?
|
|
|
|
|
 |
If any one done the task similar to this,If possible share the piece of code
|
|
|
|
 |
please any one can send a crossword solution in java
|
|
|
|
|
 |
1)need to read the data from an input file where input file contains parameters like no:of nodes,no:of subgraphs,random number etc.(idea how to specify all these in input file)
2)create a data structure tree or array to store above
3)create graph in main memory and traverse this graph a node at a time and outputs the data into output files
4)output file must contain node id and ids to which it is connected to
please help.i am starter in coding.please do help and guide me.thanks in advance.
my mail [email protected]
|
|
|
|
 |
0) Please do not use bold characters, it appears as if you are shouting, and that is considered rude.
1-4) First learn Java and its libraries: http://download.oracle.com/javase/tutorial/index.html[^].
5) People here are happy to help you when you get stuck with the code you have written, but no one is going to write it for you.
|
|
|
|
 |
can anybody provide job in java for fresher no salary.if anybody have such company please contact
91-8898744187
[email protected]
|
|
|
|
|
 |
I am reading date time and generating random number using MyClass(Java class) that have Main function.
I need to exposed one class(Exposed_class) for reading random number value from My class, to third party application (that is also written in Java).
in this case there was two main that is running concurrent and want to share data.
|
|
|
|
 |
You should create a library (class or jar file) that the other application calls in order to get its information.
|
|
|
|
 |
yes, I agreed bu problem is that to shared variable of my current running application to other java application and if other application access my class that is OK but how to share value of my current running object.
|
|
|
|
 |
You would need to use shared memory[^] or some sort of message passing protocol.
|
|
|
|
 |
Shivanand Gupta wrote: I need to exposed one class(Exposed_class) for reading random number value from My class, to third party application (that is also written in Java).
No, you are approaching this incorrectly.
What you need is a 'service' that provides a unique (presumably that is what you think you are doing) data to the caller.
That service is an independent app.
Then the two apps that you have use that service. That way either app can be running without the other.
This of course presumes there isn't a different way to solve the problem which wouldn't require any sharing at all.
|
|
|
|
 |
Message Automatically Removed
|
|
|
|
 |
hello, it would be very helpful if you instruct me how to build translator software. [email protected]
|
|
|
|
|
 |
Please do not post email address here: we can send you messages without it, but it can invite a lot of spams...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
 |
I am a beginner for Java programming. I started to self study by referring java documentation. But it is too complicated. But I followed language basics. After that I am in a trouble to select that , which java technologies to study. My dream is to be a java developer. Anyone can guide me?
|
|
|
|
 |
Start with the Java Tutorials[^]. They will guide you from the very beginning in clear and simple terms.
|
|
|
|
 |
Start with the basics, buy a book. If you can't get hold of a good book, then as Richard suggests, The Java Tutorials is also a good place to start.
|
|
|
|
 |
You should start with Java Complete Reference. It's easy to understand and should give you ample understanding of the language and its usage.
|
|
|
|
 |
Thanks for the guidelines. but after I completed the java language basics, which java technologies or frameworks you recommend to follow?
|
|
|
|
 |
mwith wrote: After that I am in a trouble to select that , which java technologies to study
Presumably you have in fact managed to create some simple programs and now you have reached the point where you want to study some part of java without attempting to learn everything at once.
If you like pretty pictures you can learn swing although you probably shouldn't spend too much time on that since most new development won't use that. Despite that learning the basics of graphics can still be helpful. And it is possible that you will encounter this at some point.
Alternatively to that is you could learn how sockets work. Build a chat program (swing could help with that but not necessary.)
|
|
|
|
 |
refer <b>head first java</b>.Good examples and clarity of concepts is good.Grill concepts like interfaces,polymorphism,inheritance by writing codes.Good luck.Aloha!!
|
|
|
|
 |
Hi, you can start with some PDF of java tutorials which is help full for beginner.
modified 9-Sep-14 7:39am.
|
|
|
|
|
 |
Message Automatically Removed
|
|
|
|
 |
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
|
|
|
|
|
|
 |
Message Automatically Removed
|
|
|
|
 |
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.
|
|
|
|
|
 |