Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by BTCMan

  1. BTCMan

    Does initilizing a struct with {0} works?

    I believe the safest way to initialize the whole struct is: memset(&my_var, 0, sizeof(MY_RECORD));
  2. BTCMan

    Does initilizing a struct with {0} works?

    Recently I saw a code that initilizes a struct using {0} .My question is if this works for all elements of the struct or just the 1st one. Example: .H File: typedef struct { UINT32 size; UINT16 num1; UINT8 * p_buffer; } MY_RECORD; -------------- .C File: ... MY_RECORD...
  3. BTCMan

    Strlen and \0 terminator

    Explanation for "> the mem corruption cannot be avoided/detected in this scenario": - There is a 3rd party sw compononent that is sending messages to the code portion which I've mentioned that is doing the strlen. The code for the 3rd party sw compononent cannot be accessed so the assumption is...
  4. BTCMan

    Strlen and \0 terminator

    Hi Salem, the mem corruption cannot be avoided/detected in this scenario and what I want to do is to protect other portion of code with this mechanism. I am trying to use "strstr" command to look for a "\0" so if it does not find any then the strlen should never be executed. BTCMan
  5. BTCMan

    Strlen and \0 terminator

    Hi, I would like your expertise in order to protect my code for strings without the \0 terminator (in case of memory corruption). Currently the code is failing because when it invokes strlen for a string with trash in it it never finds the \0 terminator then returns the size of the datatype...
  6. BTCMan

    Converting DOM tree into String

    Any hint guys? Please help me!
  7. BTCMan

    Converting DOM tree into String

    Hi all, does anybody knows how to convert an org.w3c.dom.Document into a String ?? (basically I want to log the dom tree into a string object not a file). Thanks BTCMan
  8. BTCMan

    Directory Browser Dialog

    Hi, I would like suggestions on how to open a Directory only Browser Dialog (I mean: only folders are listed and one of them can be selected). I was trying to use JFileChooser with setFileSelectionMode set to DIRECTORIES_ONLY, but this was not I was looking for (I want to avoid the window to...
  9. BTCMan

    How to copy a Node into a new Document?

    Hi guys, I would like to read a node with all its contents from a DOM tree and insert it in a new DOM. Any hint? Below is my dom tree format (already in memory as a dom tree) and the expected result: MEMORY DOM: <?xml version="1.0" encoding="UTF-8"?> <Oper>...
  10. BTCMan

    How to merge n DOM trees into a new DOM tree?

    I solved this issue. Code below for reference: Initial state: operDom -> Document object with a DOM tree ------------------------------------------- public Document appendDoms(Document operDom) { Document joinDom = null; // Creates a new DOM tree to hold the join result joinDom =...
  11. BTCMan

    How to merge n DOM trees into a new DOM tree?

    Hi people, I have a List object with "n" different DOM trees (each element of the List object has a Document object). I want to create a new DOM tree object and insert in it each one of the "n" DOM trees I have in the saved List. So the final result will be a single DOM. Any hint of code...
  12. BTCMan

    Retrieving DOM Node with wilcard

    Actually I need Java code. By the way I made some tests using the code below and it works. The negative point is performance since I need to run the whole DOM tree checking each node: private List subTemplatePathList = new ArrayList(); public List getSubTemplatePathFromOperationalTemplate...
  13. BTCMan

    Retrieving DOM Node with wilcard

    Hi, I have the following XML: ... <aaa> <bb> <ccTemplate>../dir1/dir2/file3.xml</ccTemplate> <dd> </dd> </bb> <ee> </ee> <ff> <gg> <hhTemplate>../dir1/dir2/file4.xml</hhTemplate> </gg> </ff> </aaa> This XML file is parsed into a DOM tree Document. How do I...
  14. BTCMan

    parsing (x,y,z)

    thanx! actually I did: String[] parts = myString.replaceAll("\\(\\)", "").split(","); cheers btcman
  15. BTCMan

    parsing (x,y,z)

    Ok with the split method but before call it we need to remove undesired "(" and ")". I would like to see a single regular expression that retrieves the desired data. Thanx

Part and Inventory Search

Back
Top