Static Indexers?

I believe it was considered not to be terribly useful. I think it’s a shame too – an example I tend to use is Encoding, where Encoding.GetEncoding(“foo”) could be Encoding[“Foo”]. I don’t think it would come up very often, but aside from anything else it just feels a little inconsistent not to be available. I … Read more

Converting escaped UTF8 characters back to their original form

It sounds like the string in the plist contains the characters “\u0161” rather than the Unicode character number 0x161. So you need to decode the \u escapes in the string you’ve extracted from the plist. NSString can do that for you using NSNonLossyASCIIStringEncoding: #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { @autoreleasepool … Read more

Convert an image into binary data in javascript [duplicate]

I think Get image data in JavaScript? answers your question: // Code taken from MatthewCrumley (https://stackoverflow.com/a/934925/298479) function getBase64Image(img) { // Create an empty canvas element var canvas = document.createElement(“canvas”); canvas.width = img.width; canvas.height = img.height; // Copy the image contents to the canvas var ctx = canvas.getContext(“2d”); ctx.drawImage(img, 0, 0); // Get the data-URL formatted … Read more

Excel VBA to Export Selected Sheets to PDF

Once you have Selected a group of sheets, you can use Selection Consider: Sub luxation() ThisWorkbook.Sheets(Array(“Sheet1”, “Sheet2”, “Sheet3″)).Select Selection.ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=”C:\TestFolder\temp.pdf”, _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=True End Sub EDIT#1: Further testing has reveled that this technique depends on the group of cells selected on each worksheet. To get a comprehensive … Read more