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!

Search results for query: *

  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
  16. BTCMan

    parsing (x,y,z)

    Hi people, I need to extract some data from the pattern pattern: (xxx,yyy,zzzz) The output should be handled like this: var1 = xxx; var2 = yyy; var3 = zzz; Also, the digits may vary like: (xxx) OR (xxx,yyy) I want to avoid using String split method or to remove the "(" and the ")"...
  17. BTCMan

    How to set a max timeout for the script execution?

    Hi people, I wrote a TCL script and now I am facing problems because I did not specify a timeout condition - I don't know how to do that in TCL!Basically I want that my program continues its execution but ensuring that the timeout limit is never crossed. This is what I tried (among other...
  18. BTCMan

    extract filename from full path name

    never mind I discovered using "file tail" Sample: set pathdir "/xxx/yyy/sdfgfdh/zexinhoDSG.xml" set ze [file tail $pathdir] puts $ze <out put is just the filename zexinhoDSG.xml> Thiago
  19. BTCMan

    extract filename from full path name

    Hi people, can somebody tells me how can I extract the file name from a variable full path (path + filename)? Sample: set fullpathinfo "/aaa/.../bbb/ccc/filename1.txt" set filenameresult "" [unknow code here to extract only filename1.txt and put it into variable filenameresult] [...] puts...
  20. BTCMan

    reading csh script return codes

    Hi Bong, the hint worked fine after I defined as "global" the reserved variable "errorCode" inside my procedure. A workaround to capture the cshell script return code at unxi level is: "echo $?" - this will retrieve the script execution's exit code that can be parsed later. See ya! BTCMan

Part and Inventory Search

Back
Top