documents

VB Script Documents.Open throwing 424 error

陌路散爱 提交于 2019-12-19 10:19:50
问题 So I have a vbs script: Function test2open( sSourceFile, sPDFFile ) Dim wApp ' As Word.Application Dim wDoc ' As Word.Document logStream.writeline "inside test2open" on error resume next Set wApp = CreateObject("Word.Application") logStream.writeline Err.Number Err.Clear Set wDoc = wApp.Documents.Open("c:\Windows\Temp\test.DOC") logStream.writeline Err.Number logStream.writeline Err.Description logStream.writeline Err.Source wApp.Quit WdDoNotSaveChanges Set wApp = Nothing End Function I'm

Replacing embedded document in array in MongoDB

被刻印的时光 ゝ 提交于 2019-12-18 13:07:52
问题 Is there an easy way to replace an entire embedded document in an array? Say replacing: { "_id" : "2", "name" : "name2", "xyz..." : "xyz2..." } with: { "_id" : "2", "name" : "name6", "xyz..." : "xyz5..." "morefields..." : "fields..." } Searching for _id (embedded). Or do I need to replace each field individually using $set? { "_id" : "2", "users" : [{ "_id" : "1", "name" : "name1", "xyz..." : "xyz1..." }, { "_id" : "2", "name" : "name2", "xyz..." : "xyz2..." }], "name" : "main name" } 回答1:

Getting an iOS application's “~/Library” path reliably

落花浮王杯 提交于 2019-12-17 16:35:22
问题 This Apple tech note: http://developer.apple.com/library/ios/#qa/qa2010/qa1699.html suggests storing "internal" user documents in a subdirectory off of ~/Library . But I can't find one of the pre-created search domains that would get me this. What's the best/most correct/least likely to ever break way of constructing this path? Thanks. 回答1: The correct way is NSString* path; path = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES)[0]; However, [@"~/Library"

Getting an iOS application's “~/Library” path reliably

和自甴很熟 提交于 2019-12-17 16:35:02
问题 This Apple tech note: http://developer.apple.com/library/ios/#qa/qa2010/qa1699.html suggests storing "internal" user documents in a subdirectory off of ~/Library . But I can't find one of the pre-created search domains that would get me this. What's the best/most correct/least likely to ever break way of constructing this path? Thanks. 回答1: The correct way is NSString* path; path = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES)[0]; However, [@"~/Library"

Plist not saving from dictionary (to Documents)

萝らか妹 提交于 2019-12-13 16:25:25
问题 I've been trying to save a plist of a NSDictionary to my app's Documents folder. I haven't tried this on the device yet but I'd like it to work on the simulator for testing purposes. The [self createDictionaryFromChoreList] method just creates a NSDictionary from some data in another class of mine. I've pretty much copied/pasted this code from the web documents and when I go to see if the file was saved or not, I find that it isn't. Here is the method block. NSArray *paths =

'Open In' functionality after downloading document?

Deadly 提交于 2019-12-13 05:37:33
问题 I am developing an iOS app that allows users to download documents off a server. I have gotten this to work fine and they can even view the document. What I want, though, is for the document to have an 'Open In' action so, when a button is pressed, the user is able to select another application that allows you to look at PDF documents -- for example, the Kindle App. Is this possible? 回答1: Darn, I was wishing you were going to say "MacOS" because that would have made the answer a lot more fun

Display Local HTML file from documents directory in a UIWebView on iPhone

别来无恙 提交于 2019-12-12 22:11:18
问题 How can I display a HTML file from the Documents directory in my app? Below is the code that I'm using and nothing is showing up in my UIWebView NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"Notes.html"]; NSURL *url = [NSURL URLWithString:filePath]; NSURLRequest *request = [NSURLRequest requestWithURL:url];

When you update an iOS app, what happens to the Documents folder contents?

岁酱吖の 提交于 2019-12-12 10:44:17
问题 What happens when I update an app that has some files stored in the Documents folder? I need those files to be kept in that folder so the updated app will be able to use them. But it doesn't seem to happen. Is there anyway I can manage to save all my files? 回答1: Your documents will stay where they are - unless the user deletes the app before updating (but that wouldn't be an update..). 来源: https://stackoverflow.com/questions/9311748/when-you-update-an-ios-app-what-happens-to-the-documents

Delete documents of type in Elasticsearch

痴心易碎 提交于 2019-12-12 08:18:36
问题 I want to delete all the documents indexed within a type in Elasticsearch, using the HTTP/REST api, but I don't want to delete the mapping for this type How can I build the query in the URL to do this? 回答1: Before executing command, index/mapping state; (screenshots taken from elasticsearch head plugin web interface) Command; curl -XDELETE 'http://localhost:9200/publishercategoryeu/autocomplete/_query' -d ' { "query": { "bool": { "must": [ { "match_all": {} } ] } } } ' Result; After executing

Documents folder working in Simulator but not iPad - Swift 2.1

我与影子孤独终老i 提交于 2019-12-12 02:45:14
问题 The below code unzips a folder of images into a folder I create. and then loops through it and adds the names to an array, then loops through this array and retrieves those file names into an array of images. It works perfectly on the simulator, but the data is empty when I do it on the iPad, it prints out nothing. I can only assume the folder isn't accessible or is being searched before the unzip has completed, but It shouldnt as I am using NSOperationQueue with a completion block. func