when using kendo.drawing.exportPDF , text pasted from Word shows wrong - kendo-ui

All punctuations in the HTML that was brought over by pasting from MS word, show as a little square instead of " or ' The characters show as "FS" and "GS" in notepad++ and in plain HTML.
I tried to use the "DejaVu Sans" font but it did not help at all.
Any advice?

Ended replacing all offending characters.
String.prototype.replaceAll = function(str1, str2, ignore)
{
return this.replace(new RegExp(str1.replace(/([\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g, function(c){return "\\" + c;}), "g"+(ignore?"i":"")), str2);
};
Then for each cell of text:
function cleanHTML(input) {
var output = input.replaceAll('“','"');
output = output.replaceAll('”', '"');
output = output.replaceAll("’", "'");
output = output.replaceAll("‘", "'");
output = output.replaceAll("", "'");
output = output.replaceAll("", "-");
output = output.replaceAll("", "'");
return output;
}
Whatever other charter will show as square later, I will add a replace for it.
Hope someone will benefit from that.

Related

JACoP Colocalization Macro Errors Galore

I've tried countless combinations of paths to try and get my macro working to analyze a very large set of images using JACoP. Any suggestions on what might be the issue?
this iteration got me closest (I think) to getting it to work. It even loads images, as shown in attached photos, but won't actually analyze the images themselves. Im thinking it might have something to do with me improperly setting up the loop to repeat itself? also maybe I'm designating channels incorrectly? pretty lost on what to do next, and there aren't any answers I've found on the web.
## File (label = "Input directory", style = "directory") input
## File (label = "Output directory", style = "directory") output
## String (label = "File suffix", value = ".nd2") suffix
// See also Process_Folder.py for a version of this code
// in the Python scripting language.
input = "/Users/alexandrapowell/Desktop/221223B31A3/"
output = "/Users/alexandrapowell/Desktop/221223B31A3batchh/"
processFolder(input);
// function to scan folders/subfolders/files to find files with correct suffix
function processFolder(input) {
list = getFileList(input);
fileList = Array.sort(list);
for (i = 0; i < list.length; i++) {
if(File.isDirectory(input + File.separator + list[i]))
processFolder(input + File.separator + list[i]);
if(endsWith(list[i], suffix))
processFile(input, output, list[i]);
}
}
function processFile(input, output, file) {
open(list[i])
run("JACoP ", "imga=0 imgb=1 thra=15000 thrb=3000 get_pearsons get_manders get_overlap");
// Do the processing here by adding your own code.
// Leave the print statements until things work, then remove them.
print("Processing: " + input + File.separator + file);
saveAs("Text", output + File.separator + "_coloc.txt")
print("Saving to: " + output);
run("Close");
run("Close All");
}

cypress use value outside .then() block

i have a case where i enter a searchTerm to a search field. Then I want to count the results shown to randomly select one of the entries. But I cannot realize it with cypress
let countOfElements = "";
cy.get(this.SEARCH_RESULT + ' > a').then($elements => {
countOfElements = $elements.length;
cy.log(countOfElements)
cy.log("Found " + countOfElements + " results for search term + " + searchTerm)
});
cy.get(this.SEARCH_RESULT + ' > a').invoke('val').as('searchEntries')
//This is obviosly not working, but I don't get how to fix this.
let randomNumber = this.getRandomNumberBetweenTwoValues(0, cy.get('#searchEntries')));
cy.get(this.SEARCH_RESULT + ' > a').eq(randomNumber).click()
I tried different things, like storing the value with .as() but I never seem to have access to the value outside a .then() block. So how I can use the value in my "getRandomNumber..." function to decide with entry in the result list shall be selected?
Pls help. thx
let countOfElements = "";
cy.get(this.SEARCH_RESULT + ' > a').then($elements => {
countOfElements = $elements.length;
cy.log(countOfElements)
cy.log("Found " + countOfElements + " results for search term + " + searchTerm)
});
cy.get(this.SEARCH_RESULT + ' > a').invoke('val').as('searchEntries')
//This is obviosly not working, but I don't get how to fix this.
let randomNumber = getRandomNumberBetweenTwoValues(0, this.searchEntries);
cy.get(this.SEARCH_RESULT + ' > a').eq(randomNumber).click()
Something like this could work. If this.searchEntries give undefined error then make the block function(){} instead of ()=>{}

Using Find to find a user property in Outlook/Redemption

I'm trying to return a single calendaritem from Outlook from our C# windows desktop application. It keeps returning this error:
Redemption.RDOItems
Assertion failed: Number of fields == 1.
I use similar code in an Outlook addin I created and it works fine. The main difference is the filterprefix.
In the AddIn I use:
string filterprefix = "[" + OurCustomProperty.OurItemId + "] = '";
var filter1 = filterprefix + parentItem.NeedlesId + "'";
var findItem = folder.Items.Find(filter1);
but this code does not work from our desktop app.
Here is the code from the desktop App which is returning the error:
The appointment.Id contains a valid value which we set when we create the item.
string Filterprefix = "#SQL="+"http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/OurCustomProperty.OurItemId/0x0000001f = '";
RDOSession rdoSession = new RDOSession();
rdoSession.Logon("", "", false, false, null, false);
RDOFolder folderRDO = rdoSession.GetDefaultFolder(rdoDefaultFolders.olFolderCalendar);
var filter1 = filterprefix + appointment.Id + "'";
string ls_find = Filterprefix + appointment.Id + "'" ;
var findItem = folderRDO.Items.Find(ls_find);
I've tried several variations of the syntax but can't seem to get it right.
I also tried using Sort then Restrict but no luck with that either.
Thanks, Rick
RDOItems.Find takes a SQL statement, please do not use the #SQL= prefix - it is OOM specific. Also do not forget to doublequote the DASL property name:
"http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/OurCustomProperty.OurItemId/0x0000001f" = '<some value>'

How to insert line break in a return statement for D3

I have the following code d3 code:
tooltip.select("#popupCount").text(function(){
if (varToGraph == "rough_top_cost"){
return " " + textValue + ": $" + addCommas(allCountyData[countyName][varToGraph]) + "\n" +
"Count:"
}})
I want the word count to appear on a new line. However, the above code results in everything being on one line. How can I get the output to be on two lines?
Thanks,
AH
Untested answer, but FWIW this may get close;
tooltip.select("#popupCount").html(function(){
if (varToGraph == "rough_top_cost"){
return " " + textValue + ": <br/>$" + addCommas(allCountyData[countyName][varToGraph]) + "\n" +
"Count:"
}})
Working from the example provided on page 80 of D3 Tips and Tricks which includes tooltips with line breaks.
Uses html element instead of text which allows line breaks. Check out the document for more detail.

Is there a SnakeYaml DumperOptions setting to avoid double-spacing output?

I seem to see double-spaced output when parsing/dumping a simple YAML file with a pipe-text field.
The test is:
public void yamlTest()
{
DumperOptions printOptions = new DumperOptions();
printOptions.setLineBreak(DumperOptions.LineBreak.UNIX);
Yaml y = new Yaml(printOptions);
String input = "foo: |\n" +
" line 1\n" +
" line 2\n";
Object parsedObject = y.load(new StringReader(input));
String output = y.dump(parsedObject);
System.out.println(output);
}
and the output is:
{foo: 'line 1
line 2
'}
Note the extra space between line 1 and line 2, and after line 2 before the end of the string.
This test was run on Mac OS X 10.6, java version "1.6.0_29".
Thanks!
Mark
In the original string you use literal style - it is indicating by the '|' character. When you dump your text, you use single-quoted style which ignores the '\n' characters at the end. That is why they are repeated with the empty lines.
Try to set different styles in DumperOptions:
// and others - FOLDED, DOUBLE_QUOTED
DumperOptions.setDefaultScalarStyle(ScalarStyle.LITERAL)

Resources