I didn't understand what is 's' refering to in s="1", "s=2" and so on in the SpreadsheetDocument in Openxml - openxml

Please tell me what is 's' referring to in SpreadsheetML

The s attribute in a c (for CELL) element gives the index of the STYLE applied to the cell.
Excel Open XML uses a lot of "shorthand" (very short element and attribute names) in order to keep file size as small as possible. Thus, things aren't terribly descriptive.
See also:
http://officeopenxml.com/SSstyles.php
https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.cell%28v=office.14%29.aspx?f=255&MSPPError=-2147217396

Related

Most efficient way to change the value of a specific tag in a DICOM file using GDCM

I have a need to go through a set of DICOM files and modify certain tags to be current with the data maintained in the database of an external system. I am looking to use GDCM. I am new to GDCM. A search through stack overflow posts demonstrates that the anonymizer class can be used to change tag values.
Generating a simple CT DICOM image using GDCM
My question is if this is the best use of the GDCM API or if there is a better approach for changing the values of individual tags such as patient name or accession number. I am unfamiliar with all of the API options but have a link to the API documentation. It looks like the DataElement SetValue member could be used, but it doesn't appear that there is a valid constructor for doing this in the Value class. Any assistance would appreciated. This is my current approach:
Anonymizer anon = new Anonymizer();
anon.SetFile(myFile);
anon.Replace(new Tag(0x0010, 0x0010), "BUGS^BUNNY");
Quite late, but maybe it would be still useful. You have not mention if you write in C++ or C#, but I assume the latter, as you do not use pointers. Generally, your approach is correct (unless you use System.IO.File instead of gdcm.File). The value (second parameter of Replace function) has to be a plain string so no special constructor is needed. You should probably start with doxygen documentation of gdcm, and there is especially one complete example. It is in C++, but there should be no problems with translation.
There are two different ways to pad dicom tags:
Anonymizer
gdcm::Anonymizer anon;
anon.SetFile(file);
anon.Replace(gdcm::Tag(0x0002, 0x0013), "Implementation Version Name");
//Implementation Version Name
DatsElement
gdcm::Attribute<0x0018, 0x0088> ss;
ss.SetValue(10.0);
ds.Insert(ss.GetAsDataElement());

Setting different Cell-Formats in a Matlab uitable

I am looking for a way to handle different type of data in one column of a Matlab uitable.
Usually uitable is used to set whole columns to the same data type, such as logical (gives a checkboxes), char (gives left-aligned text), numeric (gives right-aligned number) or a 1xn-cell-array (gives pop-up menus with different choices).
It is set using the columnformat property of uitable, e.g.
columnformat = {'numeric', 'logical', {'Fixed' 'Adjustable'}}; % 3 columns
You can find an example at matlab documentation.
I am looking for a way to set the format for single cells to realize something like this:
Matlab's uitable is a crippled version of an underlying JIDE table.
It is possible to get to the underlying java (see findjobj in file exchange), but that requires a lot of work. Yair Altman's undocumented matlab site is a good starting place for understanding the java side of matlab.
It sounds like you want something like a property editor, as opposed to a generic UI table -- i.e. properties listed in first column, property value editable in second column. There are a few "off the shelf" versions in the file exchange, which use JIDE:
See propertiesgui, or property-grid for mostly functional examples. The second example is easier to use -- you simply provide a class or struct, and it creates the proper field entry format. The first one offers more choices -- like color boxes, drop downs, etc, but requires you to be more involved in specifying how things behave.
I had the same problem, but in the end it worked by giving the (numeric) cell an (char) initial value. When changing the char value from the UI the format of the cell remained char, although the rest of the column was numeric.

Similarity Hash function(simhash)

I have a problem with using hash function. I have to assign some number(128 bit or 64 bit) with every word in the document. So, the hash value of "similarity" must be near with "similar". That means, if has value of similarity=>10022(say) then similar=>10025. which should near with similar word. also the hash value of different name should similar. that means, hash value of "john" also should be near about with " michel" or "sita"... so on. If any body have any idea about it.
Thanks in advanced. :)
it's not working in that way , first you have to find the general model for the sample value of available data, and then use it for the streaming log messages.
there is a library called OpenNLP, so by using this library you can know what type of word is it. then as you said that for the similar word like names, there can be write hash function in which name or verbs and so one can get the similar hash value.
thanks.

how to know the PDF file name using a CGPDFDictionaryRef object reference

I have an object of type CGPDFDictionaryRef returned somehow from a method that is considered as a part of a static library (so I do not have access to its code to modify it), however, I want to know the name of the PDF file that this dictionary object holds ? how can I query it to get the name of the file?
There are two functions that take a CGPDFDocumentRef and return a CGPDFDictionaryRef. They are CGPDFDocumentGetInfo and CGPDFDocumentGetCatalog. Neither function returns a dictionary that contains the name of the original file. Neither does the array returned by CGPDFDocumentGetID.
This makes sense, because you can create a CGPDFDocumentRef without a file, from data you get over a socket or by drawing into a CGPDFContext with Quartz 2D.
If you want the name of the file, you'll have to get it some other way.
The CGPDF* functions are a function-based mechanism to get to the series of arrays, dictionaries, integers, string and name elements in PDF documents. PDF documents themselves are really just composed of these "basic" elements. If you'd like some light reading check out the ~1500 page PDF specification sometime. As rob mayoff stated, you are basically pointing to memory once you have a CGPDFDocumentRef.
That being said, there is no value that is guaranteed within a PDF structure that will give you the filename. Download Voyeur and dig around your PDF to look around and prove me wrong (I could be).
Here's the sample of the true contents of a PDF:

Extracting function call list from DOxygen XML Output

I posted a question on the DOxygen forums and also am posting it here for a better response.
I have a moderately sized C project of about 2,900 functions. I am using DOxygen 1.5.9 and it is successfully generating a call graph for the functions. Is there a way to extract this out for further analysis? A simple paired list would be sufficient, e.g.
Caller,Callee
FunctionX, FunctionY
...
I am comfortable with XSLT but I must say that the DOxygen XML output is complex. Has anyone done this before and can provide some guidance on how to parse the XML files?
Thanks in advance!
Based on what I see in the contrived example that I created,
Parse files with a name similar to ^_(.+)\d+(c|cpp|h|hpp)\.xml$, if my regex-foo is right.
Find all <memberdef kind="function">. It has a unique id attribute. I believe the XPath for this is //memberdef[#kind='function'].
Within that element, find all <references>.
For each of those tags, the refid attribute uniquely refers to the id attribute of the corresponding <memberdef> that is being called.
The text node within each <references> corresponds to the <name> of the corresponding <memberdef> that is being called.
This seems like a nice, straightforward way to express call graphs. You should have no trouble using XSLT or any other sane XML-parsing suite to get the desired results.