Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm trying to set the PHOTO vCard attribute with an URI provided by our backend, according to the xep-0054,
<!-- Photograph property. Value is either a BASE64 encoded
binary value or a URI to the external content. -->
<!ELEMENT PHOTO ((TYPE, BINVAL) | EXTVAL)>
I'm using ejabberdctl with the mod_admin_extra extension.
ejabberdctl set_vcard foo chat.myjabber.com PHOTO http://link_to_image.jpg
ejabberdctl set_vcard2 foo chat.myjabber.com PHOTO EXTVAL http://link_to_image.jpg
But doesn't seems to work, I see nothing in pidgin & psy (value is correctly saved in database)
I'm running Archlinux, Pidgin 2.10.6 (libpurple 2.10.6) & ejabberd 2.1.11
I asked on https://github.com/processone/ejabberd/issues/47 and most of popular client doesn't support EXTVAL
xep-0054 is in contradiction of the xep-0153 that say
4.5 XML Syntax
The following rules apply to the XML syntax:
The <PHOTO/> element SHOULD contain a <BINVAL/> child whose XML character data is Base64-encoded data for the avatar image.
The <PHOTO/> element SHOULD NOT contain an <EXTVAL/> that points to a URI for the image file.
The <PHOTO/> element MUST NOT contain the avatar image itself.
The <PHOTO/> element SHOULD contain a <TYPE/> child whose XML character data specifies the content-type of the image data. The XML character data SHOULD be "image/gif", "image/jpeg", or "image/png".
The <PHOTO/> element MUST NOT possess a 'mime-type' attribute.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I could not transfer my code to the site as I wrote it, but I placed your photo Please can you help me?
You are getting the error because you are trying to pass an uninitialized String to a Text-Widget (Naber). A Text-Widget can not handle uninitialized Strings which have the value null.
Therefore try initializing the String 'Naber' directly like:
String Naber = 'Some text';
This should work.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
For my project, I am trying to read data from Wikipedia, I am not completely sure, how I can do that.
My main concern is to read, date, location and subject of event.
For a start, I have started reading above mentioned information for 91st academy awards.
I tried using Wikipedia query service, but it didn't helped much.
Then I came across API solution and ran following URL,
https://en.wikipedia.org/w/api.php?action=parse&format=json&prop=sections&page=91st_Academy_Awards
But didn't found the information what I was looking for.
I am trying to read the information marked in red box in below image,
Can somebody help me with this and let me know how can I read the above mentioned section.
PS:I am using Matlab for writing my algorithm
A possible solution is to read the webpage using webread, and process the data using the functions from the Text Analytics Toolbox:
% Read HTML data.
raw = webread('https://en.wikipedia.org/w/api.php?action=parse&format=json&prop=text&page=91st_Academy_Awards');
% Specify sections of interest.
SectionsOfInterest = ["Date","Site","Preshow hosts","Produced by","Directed by"];
% Parse HTML data.
myTree = htmlTree(raw.parse.text.x_);
% Find table element.
tableElements = findElement(myTree,'Table');
tableOfInterest = tableElements(1);
% Find header cell elements.
thElements = findElement(tableOfInterest,"th");
% Find cell elements.
tdElements = findElement(tableOfInterest,"td");
% Extract text.
thHTML = thElements.extractHTMLText;
tdHTML = tdElements.extractHTMLText;
for section = 1:numel(SectionsOfInterest)
sectionName = SectionsOfInterest(section);
sectIndex = strcmp(sectionName,thHTML);
% Remove spaces if present from section name.
sectionName = strrep(sectionName,' ','');
% Clean up data.
sectData = regexprep(tdHTML(sectIndex),'\n+','.');
% Create structure.
s.(sectionName) = sectData;
end
Visualising the output structure:
>> s
s =
struct with fields:
Date: "February 24, 2019"
Site: "Dolby Theatre.Hollywood, Los Angeles, California, U.S."
Preshowhosts: "Ashley Graham.Maria Menounos.Elaine Welteroth.Billy Porter.Ryan Seacrest. "
Producedby: "Donna Gigliotti.Glenn Weiss"
Directedby: "Glenn Weiss"
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
var nsarray:[NSMutableDictionary] = [["object":["uid":["age":"26","gender":"male"]]]]
print(nsarray[0]["object"])
That is how it looks. I want to get the value "uid", so when it prints it is just "uid". Currently it is printing:
"uid":["age":"26","gender":"male"]
I want to get the "uid" value. Meaning when it prints it is just "uid". "uid" is a placeholder for a unique ID so I won't know what the uid is.
It looks like "object" key contains another dictionary, which has exactly one element. To get the first key, call allKeys to get keys, convert them to Array, and pick the the initial element:
let d = nsarray[0]["object"] as! NSDictionary
print(Array(d.allKeys)[0])
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I write a lot of applications in C# and I'm trying to sew up some holes in my standard practices.
Specifically, I'm trying to decide on the best text to use in a message box, and I thought I'd ask the StackOverflow community since I believe that many opinions are always better than one.
What I have currently is:
"Document XXX.docx already exists. Okay to overwrite?"
Buttons for; Yes, No and Cancel
I'm really interested to see which examples turn out to be the most popular.
There are no limits on the style used; formal, casual, humourous, etc. All suggestions are welcome. Aim to err safely within political correctness though.
On a small side note: It would also be great, but by no means essential, to consider that the same text could also be suitable for a command line program.
Please note: English language only please. For other languages, please raise a new question.
Personally, I like to see a bit more context and slightly different wording. Something like:
"<existing document name>" already exists in "<destination path>".
Would you like to replace it (Y/N)?
or perhaps with even more information:
"<existing document name>" (<bytes>) (<date modified>) already exists in
"<destination path>".
Would you like to replace it with file of size <new bytes>, last modified
<new date modified> (Y/N)?
I think "replace" is a bit more clear than "overwrite" - and (speculation) may translate into other languages, and maintain the intended meaning more often.
...and one last option with new file name/location info:
"<existing document name>" (<bytes>) (<date modified>) already exists in
"<destination path>".
Would you like to replace it with file "<new file name>" in "<new path>" of
size <new bytes>, last modified <new date modified> (Y/N)?
This last one would probably just show a temp file / buffer location for an initial file save--but it is reusable, and more meaningful when doing a file copy.
Hope you find one of these useful.
Cheers,
Hans
Title: Overwrite?
"XXX.docx exists.
Would you like to overwrite XXX.docx?"
Buttons: Overwrite, Keep, Panic
Simple solutions are usually best, for example windows user might find it familiar to see a message :
He has 3 options :
Replace
Abort action x3
Create with a new name
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to create pdf document using JRDataSource using jasper report.Actually i m having one bean object that object has List of another bean object and one string value,The inner bean object has two String variables .Now i don't know how to map these all three variable in the jrxml document to populate the values in pdf document .
Can anyone help me how to solve this problem.If u can provide me some code snippet.
Code snippet to create a JasperPrint object from a collection datasource.
JasperPrint jp = new JasperPrint();
String reportPath = "/HD/jasper/mypath/myfile.jasper";
Map paramsMap = new HashMap(); //put whatever parameters you want to pass to report
//JR data source, populate with your collection
JRDataSource reportSource = new JRBeanCollectionDataSource( reportCollection );
jp = JasperFillManager.fillReport( reportPath, paramsMap, reportSource);
//Here you can use the PDF generator to make a PDF file out of the jp object. Then forward it to client