|
There is no such code. You need to design some smileys for yourself, and write the code in the server and client that handles them.
|
|
|
|
|
Hello there fellow java users,
I'm dealing with some situations with Java Eclipse, I was writing the codes for a public class related to 'books". basically using instance data for the author, publisher, copy right date, etc. I feel like I've got all the correct codes and everything but I feel as if I've stumbled onto a certain error that I can't fix. Every-time I try to run the program the console output says: <terminated> book[Java Application] C:\Program Files (x86)\Java\jre7\bin\javaw.exe.
I don't know what I did wrong, if anybody can help me that would be great. Here are the codes i wrote:
package book;
public class book {
public static void main(String[] args){
}
private String title;
private String author;
private String publisher;
private int copyRightDate;
public book(String authorName, String publisher, String author, String year22) {
title = getTitle();
author = getAuthor();
publisher = getPublisher();
copyRightDate = year2();
}
private int year2() {
return 0;
}
public book(String authorName, String publisher2, String author2,
int year32) {
}
public book()
{
author = "Ridley Pearson";
title = "Kingdom Keepers";
publisher = "Disney";
}
public void setAuthor(String authorName) {
author = authorName; }
public String getAuthor() {
return author; }
public void setTitle(String bookTitle) {
title = bookTitle; }
public String getTitle() {
return title; }
public void setPublisher(String publisherName) {
publisher = publisherName; }
public String getPublisher() {
return publisher;}
public void setCopyRightDate(int date) {
copyRightDate = date; }
public int getCopyRightDate() {
return copyRightDate; }
public String toString() {
return (title + "\t" + author + "\t" + publisher + "\t" + copyRightDate);}
public class bookshelf{
}
public void main1(String[] args) {
}
final int year2 = 2010;
final int year3 = 2011;
{
}
{
new book ("Kingdom Keepers III\n", "Disney In Shadow\n", "Ridley Pearson\n", year2);
new book("Kingdom Keepers IV\n", "Power Play\n", "Ridley Pearson\n", year3);
System.out.println("Kingdom Keepers III");
System.out.println("Kingdom Keepers IV");
}
}
Andrew Besbekos
Computer Science Student
|
|
|
|
|
Your main method has no body, so it never does anything.
|
|
|
|
|
so what is he supposed to do???
|
|
|
|
|
|
{
new book ("Kingdom Keepers III\n", "Disney In Shadow\n", "Ridley Pearson\n", year2);
new book("Kingdom Keepers IV\n", "Power Play\n", "Ridley Pearson\n", year3);
System.out.println("Kingdom Keepers III");
System.out.println("Kingdom Keepers IV");
}
at first ,static-method can't transfer construct-method;the virtual can't recognize them for transfering each other,and static's prior higher than construct
at second , if u want to test main ,and write printout static and construct ; u main-method should new book,through print result,u can find their prior
|
|
|
|
|
hello, Im having a trouble on how to read the Mifare card using Java smartcardio.
For now, I write a code that can only read the apdu of the card. hope i can help from you guys, thanks
package nfctry;
import javax.swing.*;
import java.util.*;
import javax.smartcardio.*;
import javax.swing.JOptionPane;
public class NFCr {
final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();
public static String bytesToHex(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
int v;
for ( int j = 0; j < bytes.length; j++ ) {
v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
public static void main(String[] args) throws Exception {
TerminalFactory factory = TerminalFactory.getInstance("PC/SC",null);
System.out.println(factory);
List<CardTerminal> terminals = factory.terminals().list();
System.out.println("Terminals: " + terminals);
if (terminals.isEmpty()) {
throw new Exception("No card terminals available");
}
CardTerminal terminal = terminals.get(0);
while( true )
{
terminal.waitForCardPresent( 0 );
try {
Card card = terminal.connect("*");
CardChannel channel = card.getBasicChannel();
CommandAPDU command = new CommandAPDU(new byte[]{(byte)0xFF,(byte)0xCA,(byte)0x00,(byte)0x00,(byte)0x04});
ResponseAPDU response = channel.transmit(command);
byte[] byteArray = response.getBytes();
System.out.println(bytesToHex( byteArray ) );
Thread.sleep(1000);
} catch (CardException e) {
e.printStackTrace();
} finally {
}
}
}
}
|
|
|
|
|
|
the question is,
how can I read the data that contain in the tag (mifare). Since i didn't find any solution regarding my problems. I need to know how to read mifare card.
|
|
|
|
|
I would start by reading the documentation for smartcardio and for the card in question.
|
|
|
|
|
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
|
|
|
|
|
|
Thanks for your response.
User can enter the data once in a day. once user enter the data ex: Sep 21st, he can not enter data for that particular user id in Sep21st. in future also he cannot add the data for Sep21st. that is my requirement. Could you please provide the solution
|
|
|
|
|
The solution is fairly obvious. Keep a record of each user and whether he entered data, and on what date. Then you just need to check that to see whether he/she is allowed to enter any more.
|
|
|
|
|
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 ?
|
|
|
|
|
|
using window.close() is ok:
1.u check button is or isn't response;
2.debug js by firefox or chrome browser ,check console is or isnot error
|
|
|
|
|
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 pavani.asb@gmail.com
|
|
|
|
|
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.
|
|
|
|