|
Yes, because you are still not connecting the new nodes to the head pointer. Try drawing a picture of a correctly linked list to see what head needs to point to.
|
|
|
|
|
If you can't see the problem, use the debugger to step through your code.
NODE temp = null; if (isEmpty()) { <-- false, execute "else" block else { temp.SetNext(... <-- BOOM! temp is still null here.
You need to decide whether the new node belongs at the start of the list, or at the end of the list.
If it belongs at the start, you set its next node to be the head, and set the head to be the new node.
public void AddNODE(NODE newNode)
{
newNode.SetNext(head);
head = newNode;
}
If it belongs at the end, you need to find the last node in the list, and set that node's next node to be the new node. If the list is empty, then set the head to be the new node.
public void AddNODE(NODE newNode)
{
if (isEmpty())
{
head = newNode;
}
else
{
Node last = head;
Node temp = last.GetNext();
while (temp != null)
{
last = temp;
temp = last.GetNext();
}
last.SetNext(newNode);
}
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
how to connect the finger print scanner in java and how to store the database in sql server 2008 R2
|
|
|
|
|
1. Research the scanner. Learn about the APIs that exist to interface to it.
2. Create Java code to use the API in 1 which is appropriate to the app that needs to use it.
3. Create Java code for the database that is appropriate to the app that needs to use it.
4. Wire 2 and 3 into the app.
Could be other steps as well, such as if you have no idea how to do 3 then there would be another step to investigate various methodologies to use a database via Java.
Forgot to mention that what you store in the database actually depends on the data that the scanner returns. But regardless of the form it will be likely be 'binary' so the database will need a column that specifically stored binary data. So if you do not know the difference there you will need to investigate.
|
|
|
|
|
Member 13140443 wrote: how to connect the finger print scanner in java
Ask the manufacturer abd/or users forum.
Member 13140443 wrote: how to store the database in sql server 2008 R2
Learn SQL
Both parts are completely unrelated, there is nothing in SQL related to finger print scanners. It Java job to glue things together.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
how the static keyword is used in real time project?
|
|
|
|
|
|
Member 13364717 wrote: how the static keyword is used in real time project?
Exactly the same way as with any other kind of project. Because the usage of static keyword do not depend in the kind of project.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
I have created a program by using Java. And there is Login with MySql Database. In this Admin can log into the system by using Username and Password which is in the database. But , I want to use admin's Fingerprint instead of username and password. But, I have no idea how to do this. Then I have searched everywhere to find the useful sources and I didn't find anything useful.
So , Can I know how to do this ??
Is there any kind of Documentation or video tutorial ??
|
|
|
|
|
|
|
No..
BTW , ThnQ Very Much For your links !!
|
|
|
|
|
I am working on dotx file template to generate word documents using docx4j in java. I will be replacing some placeholders in dotx file with text which comes from database columns. But problem is one of my database field contains HTML code(rich text editor value), when I place this text in placeholder in template, generated document display as-is content of html. I want that HTML code to be rendered to be proper text with styles.
Cold you please let me know how can I achieve this?
Sample Code which I have written to replace placeholders:
ByteArrayOutputStream baos = null;
DataRequestVO dataRequest = null;
WordprocessingMLPackage wordMLPackageMain = null;
try {
dataRequest = reportDAO.fetchDocketData(dataRequestNO);
String templateFile = dataRequest.getReportType().getTemplatePath();
String fileName = dataRequest.getDocketNo() + " - " + dataRequest.getDataRequestNo() + "-" + dataRequest.getReportType().getReportName();
URL url = this.getClass().getClassLoader().getResource(templateFile);
String templateFilePath = url.toURI().getPath();
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new File(url.toURI().getPath()));
ContentTypeManager ctm = wordMLPackage.getContentTypeManager();
CTOverride override = ctm.getOverrideContentType().get(new URI("/word/document.xml"));
if (templateFilePath.endsWith("dotm")) {
override.setContentType(
org.docx4j.openpackaging.contenttype.ContentTypes.WORDPROCESSINGML_DOCUMENT_MACROENABLED);
} else {
override.setContentType(org.docx4j.openpackaging.contenttype.ContentTypes.WORDPROCESSINGML_DOCUMENT);
}
DocketReportHelper.prepare(wordMLPackage);
List<Object> texts = DocketReportHelper.getAllElementFromObject(wordMLPackage.getMainDocumentPart(),
Text.class);
DocketReportHelper.replacePlaceholder(texts, dataRequest.getDocketNo(), PLACEHOLDER_DOCKET_NO);
DocketReportHelper.replacePlaceholder(texts, dataRequest.getQuestion(), PLACEHOLDER_QUESTION);
DocketReportHelper.replacePlaceholder(texts, dataRequest.getResponse(), PLACEHOLDER_RESPONSE);
if ("yes".equalsIgnoreCase(dataRequest.getConfidential())) {
wordMLPackageMain = createConfHeaderFooter();
List<Object> listParamMain = wordMLPackage.getMainDocumentPart().getContent();
for (Object param : listParamMain) {
if (param instanceof P) {
wordMLPackageMain.getMainDocumentPart().addObject((P) param);
} else if(param instanceof JAXBElement) {
wordMLPackageMain.getMainDocumentPart().addObject((JAXBElement) param);
}
}
} else {
wordMLPackageMain = wordMLPackage;
}
baos = new ByteArrayOutputStream();
SaveToZipFile saver = new SaveToZipFile(wordMLPackageMain);
saver.save(baos);
replacePlaceholder method:
static void replacePlaceholder(List<Object> texts, String name, String placeholder) {
log.debug("placeholder : " + placeholder);
for (Object text : texts) {
Text textElement = (Text) text;
if (textElement != null && placeholder.equals(textElement.getValue())) {
textElement.setValue(name);
break;
}
}
}
Prepare method:
public static void prepare(WordprocessingMLPackage wmlPackage) throws Exception {
WordprocessingMLPackage.FilterSettings filterSettings = new WordprocessingMLPackage.FilterSettings();
filterSettings.setRemoveProofErrors(true);
filterSettings.setRemoveContentControls(true);
filterSettings.setRemoveRsids(true);
wmlPackage.filter(filterSettings);
log.debug(XmlUtils.marshaltoString(wmlPackage.getMainDocumentPart().getJaxbElement(), true, true));
org.docx4j.wml.Document wmlDocumentEl = wmlPackage.getMainDocumentPart().getJaxbElement();
Body body = wmlDocumentEl.getBody();
SingleTraversalUtilVisitorCallback paragraphVisitor = new SingleTraversalUtilVisitorCallback(
new TraversalUtilParagraphVisitor());
paragraphVisitor.walkJAXBElements(body);
log.debug(XmlUtils.marshaltoString(wmlPackage.getMainDocumentPart().getJaxbElement(), true, true));
}
|
|
|
|
|
Since no one else replied.
1. I would parse the html and handle a LIMITED set of attributes.
2. I would limit the size and refuse to handle anything over a certain limit. I would log an error to indicate it
3. For unknown attributes I would strip them and log a warning.
4. I would document (not code) what was allowed for html in that data slot.
|
|
|
|
|
I want to find a way to convert Microsoft's word to PDF on linux. My idea is to read each word, picture, or table first, and then write their structure into the PDF document. But when I read the format of the document and write it to PDF, only the pictures can be written and the styles are completely different from those in the document. I would like to ask a kind person if you have any experience in this field. Please give me some advice or guidance. Thank you!
|
|
|
|
|
The issue is not too complicated. Firstly you need to understand the structure of Word documents, and how different parts are formatted, and which fonts are used to render the text. You then need to learn how to reformat that information into the structures that a PDF document uses. There are various libraries around to do both parts, and Google will find you the details.
|
|
|
|
|
ok,thank you man,i'll try it
|
|
|
|
|
For me what worked easiest on Linux:
- install OpenOffice or LibreOffice (whatever your Linux distro has as the default)
- then use the PDF converter tool that comes with LibreOffice (or Open...)
It is a simple command line tool that has tons of options. For Word it should provide really decent output as long as you have no real complex stuff in it.
|
|
|
|
|
write a program for a bank employee .
so that when he enters his/her ID the system can tell him to which bank he belongs and what is his designation.Is he a manager , normal employee, sales person, cashier .
manager can perform all the tasks but cashier ca deposit/withdraw cash, sales person can only upload documents etc.
|
|
|
|
|
|
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.
As programmer, your job is to create algorithms that solve specific problems and you can't rely on someone else to eternally do it for you, so there is a time where you will have to learn how to. And the sooner, the better.
When you just ask for the solution, it is like trying to learn to drive a car by having someone else training.
Creating an algorithm is basically finding the maths and make necessary adaptation to fit your actual problem.
The idea of "development" is as the word suggests: "The systematic use of scientific and technical knowledge to meet specific objectives or requirements." BusinessDictionary.com[^]
That's not the same thing as "have a quick google and give up if I can't find exactly the right code".
An interesting link to get you started on a new project: Systems development life cycle - Wikipedia[^]
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
how to connect ble sensor in swing-java using netsbeans
or
how to create window application using bluetooth low-energy in java language not android
|
|
|
|
|
|
i want to know what causes serialization to do ?what is the loss if we dont use serialization in java?
|
|
|
|
|