I see this sample:
http://www.aspose.com/docs/display/slidesnet/Creating+a+Table+from+Scratch
...and when I try to use it, I see that the library has changed (I guess) and it needs me to do sth like that:
int lIndex = pSld.Shapes.AddTable(pUppLeftPoint.X, pUppLeftPoint.Y, pColumnWidths, pRowWidths);
TableEx lTable = (TableEx)pSld.Shapes[lIndex];
(I can only cast to TableEx and not to Table)
But I cannot find how to get the cell's TextFrame. The site says :
TextFrame tf = table.GetCell(0, 0).TextFrame;
But I have nothing like this...
Am I missing sth?
Any ideas?
EDIT :
I found out that my code is for PPTX and the site's code for PPT:
http://www.aspose.com/community/forums/thread/453613/facing-performance-issue-due-to-addtable-method-of-pptx.aspx
But, again, how do you get the cell's contents in PPTX?
Ha! I got it!
There's an indexer:
lTable[i,j]
Related
I want to use C++ to load TensorFlow model. And I want to know size of model's input, which is the placeholder in the model.
I google this problem, but I just find this link in stackoverflow :
C++ equivalent of python: tf.Graph.get_tensor_by_name() in Tensorflow?
Although I can get node, but tensorflow document don't tell me how to access the size of the node. So is there anyone know something about this?
Thank you so much!
OK,after many times attempts. I have find a workaround solution, It maybe tricky but works well.
At first, we can get the placeholder node using following code:
GraphDef mygd = graph_def.graph_def();
for (int i = 0; i < mygd.node_size(); i++)
{
if (mygd.node(i).name() == input_name)
{
auto node = mygd.node(i);
}
}
Then through the NodeDef.pd.h(tensorflow/core/framework/node_def.pb.h), we can get AttrValue through code like below:
auto attr = node.attr();
Then through the attr_value.cc(tensorflow/core/framework/attr_value.cc), we can get the shape attr value through code like below:
tensorflow::AttrValue shape = attr["shape"];
and the shape AttrValue is the structure used to store shape information. We can get the detail information through the function SummarizeAttrValue in tensorflow/core/framework/attr_value_util.h
string size_summary = SummarizeAttrValue(shape);
And then we can get the string format of shape like below:
[?,1024]
I want to get the email body from my Gmail account for an email so i use this code i found it in an example for how to read emails using c++ builder pop3
the code to extract body used
TIdText *EText;
int message = SpinEdit1->Value;
MyPoP3->Retrieve(message, MyEmail);
Edit1->Text = MyEmail->Subject + " | " + MyEmail->From->Address;
Memo1->Clear();
for (int i = 0; i < MyEmail->MessageParts->Count; i++) {
Memo1->Lines->Add(MyEmail->MessageParts->Items[i]->ContentType);
EText = dynamic_cast<TIdText*>(MyEmail->MessageParts->Items[i]);
Memo1->Lines->Add(EText->Body);
}
the problem is that i got undefine symbol to TidText and what i tried is to change it from TIdText to TIdMessage, but i got that i can't convert to it.
also i tried to try this without loop or something MyEmail->Body->Text
this return empty string.
the video i got this code from it here i don't know maybe the c++ builder he use is old. now i want to know how to extract the body text from the email address.
Thanks in advance.
the problem is that i got undefine symbol to TidText
Your code is missing an #include <IdText.hpp> statement.
what i tried is to change it from TIdText to TIdMessage, but i got that i can't convert to it.
Because TIdMessage does not contain nested TIdMessage objects.
also i tried to try this without loop or something MyEmail->Body->Text this return empty string.
If your email is MIME encoded, its text is not stored in the TIdMessage::Body property, but in a nested TIdText object within the TIdMessage::MessageParts collection. You have to look at the TIdMessage::ContentType property to know what kind of structure the email contains. For instance, if the CT begins with text/, the text is in the TIdMessage::Body. But if the CT begins with multipart/, the text is somewhere in the TIdMessage::MessageParts instead.
You should read this blog article on Indy's website for an example of how emails might be structured:
HTML Messages
the video i got this code from it here i don't know maybe the c++ builder he use is old.
No, it is not.
I have tried the following with python-docx:
section = self.document.sections[0]
footer = section._sectPr.footer
footer.text = "I am here"
I couldn't find a clear footer/header directions in docx documentations. Is there a work around to cover this gap?
The work around is:
Create a document with python-docx.
Change the name to 'init.docx'
Comment any adding-new-style code
Open 'init.docx'
Delete everything
Save it.
Add footnote/Headers to 'init.docx'
Change self.document = Document('') to self.document = Document('init.docx').
I want to get the row header text, after clicking on any specific row. It could be number/alphabet. Yes, I'm able to get its index. But I want to get its text value, which i'm needed to show elsewhere in my case. I didn't found any idea or solution in its documentation page Get Sheet Header. Hope, there's any way to figure out this problem. Thanks for any solution/advice.
You can get the row header text by using getCell and passing in the SheetArea.rowHeader variable. Here is how to do it on a cell click (or header click):
activeSheet.bind(GcSpread.Sheets.Events.CellClick, function (sender, args) {
if (args.sheetArea === GcSpread.Sheets.SheetArea.rowHeader) {
alert("Row header text: " + activeSheet.getCell(args.row, args.col, GcSpread.Sheets.SheetArea.rowHeader).value());
}
});
Let me know if that helps.
Regards,
Kevin
I need to find out, whether in an array there is a specific HTML code. The array contains HTML codes and I need to get a number, that is included in a link.
This would be what I am searching for (the number 10 ist the number I want):
class = "active" href = "http://www.example.com/something-10
So I tried the following using preg_match:
if(preg_match('/class = "active" href = "http://www.example.com/something-(.*)/',$array["crawler"],$arr)) { print_r($arr,true); }
Unfortunately this will give me nothing as result. So I guess, something is wrong with my preg_match. I allready checked all the manuals, but I still dont get what I am doing wrong.
Could someone help me with this? Thank you!
phpheini
Aside from advising you to not parse HTML using regular expressions, your particular regular expression needs different delimiters:
preg_match('~class = "active" href = "http://www\.example\.com/something-(\d+)~', ...)
Alternatively, you could have escaped the slashes within the regex, but that leads to LSS (leaning slash syndrome):
preg_match('/class = "active" href = "http:\/\/www\.example\.com\/something-(.*)/', ...)
And that's just ugly.
You should have gotten an error, if your error_reporting is turned on.