saving-data

Handling one-time immutable data created by app

吃可爱长大的小学妹 提交于 2019-12-12 02:43:30
问题 I'm rewriting my app to incorporate SceneKit to display molecules. About 60% of my code is dedicated to creating these molecules as SCNNode arrays stored in a dictionary. Another 20% creates a String dictionary for text display. Ideally, these dictionaries need only be created once. Currently I'm creating these dictionaries by calls from viewDidLoad in my main (and initial) VC. I then archive the dictionaries: NSKeyedArchiver.archiveRootObject(moleculeDictionary, toFile: filePath) I then read

Qualtrics: Javascript to prevent saving entry from Text Box

*爱你&永不变心* 提交于 2019-12-11 23:28:02
问题 I have one Text Box (also called "Text Entry") in my qualtrics survey in which I want participants to write something but I do not want to have the result saved in my data. I do not want to use the password function, therefore I have used JavaScript at the Text Box level. The code below works to the extent that whatever participants put in the Text Box it will be set to an empty string the moment they hit the Next-Button. Qualtrics.SurveyEngine.addOnload(function() { /*Place Your Javascript

Is it good to save database connections in xml file

烂漫一生 提交于 2019-12-11 03:08:27
问题 I am on a general scenario of deploying my vb.net database application on my client's computer. Thinking of future problem of changing the database connection setting, i am planning to store it in a normal xml file in the app directory so that where ever it is installed, in order to make database configuration i only need to make change to that file and my program runs smoothly. So is this idea of storing database connection setting to xml config file in app directory or is there any other

Strategies for preserving form data ( on tab/browser close )

血红的双手。 提交于 2019-12-10 15:56:37
问题 I have an issue with a task management application where occasionally users close their browsers/tabs and the information which they type goes away because they accidentally close a browser/tab, resulting in the loss of the text which they've entered ( and some can spend half an hour entering in text ). So I have to provide a solution, I have a couple ideas but wanted input on the best to go with, or if you have a better solution let me hear ya. Option 1: On the window.onunload or possibly

How to encode and decode a custom class with NSKeyedArchiver

丶灬走出姿态 提交于 2019-12-06 01:06:01
问题 I have a custom class that I wish to save and load. The class contains an NSDate, an NSString, and an NSNumber. I have implemented the NSCoding protocol in the .h file. Here is the code I have so far. theDate is an NSDate. theName is the NSString. homeAway is the NSNumber. -(void)encodeWithCoder:(NSCoder *)aCoder { [aCoder encodeObject:theDate forKey:@"theDate"]; [aCoder encodeObject:theName forKey:@"theName"]; [aCoder encodeObject:homeAway forKey:@"homeAway"]; } -(id)initWithCoder:(NSCoder *

NHibernate update reference

十年热恋 提交于 2019-12-04 17:24:32
Entities We have an entity called Product which is loaded using NHibernate. Product has a category which NHibernate happily populates for me. Database In the database, Product has a foreign key for category. Scenario User edits this Product (via a web interface) and chooses a different category (say instead of "Fish" we select "Veg"). This is probably a dropdown list, with each category shown. When they choose a different category we get an int key. Problem Obviously we now want to save the changes to Product but in effect the only change is to save a new int (say 2, instead of 1). So we

Saving array using NSUserDefaults crashes app

喜夏-厌秋 提交于 2019-12-04 02:50:39
问题 I feel as if I am doing things correctly, but I am getting an error at the end of my data conversion and retrieval. Please see the code below: class Task:NSObject, NSCoding { var name:String var notes:String var date:NSDate var taskCompleted:Bool init(name:String, notes:String,date:NSDate, taskCompleted:Bool){ self.name = name self.notes = notes self.date = date self.taskCompleted = taskCompleted } required init(coder decoder: NSCoder){ self.name = (decoder.decodeObjectForKey("name") as!

Saving VBA Dictionary object in Excel

旧城冷巷雨未停 提交于 2019-12-03 21:32:24
As part of an Excel Workbook Template a Dictionary object (from the Scripting Runtime Library) is created and added to. Is it possible to save this in some way along with the Workbook such that it is available on starting up the Workbook, or should I just export the data to a worksheet and save it, then reload it in the next time? I reckon a worksheet is the best bet. You might like to use the very hidden option, which means the sheet can only be made visible by code. For example: Worksheets("System").Visible = xlVeryHidden Why not save it to a file? Sub Save_Dict(aDict As Scripting.Dictionary

Saving data on Android : File Storage vs SQLite Database vs Shared Preferences

大憨熊 提交于 2019-12-03 16:49:50
问题 This title makes me wonder on what is most suited feature in saving medium to large data on a specific application. I know there is a recent questions that i have seen on Stackoverflow regarding on saving data with these feature but I want to know, as what i have said, what suited most. Do you have any suggestion regarding to this? 回答1: Shared Preferences Store private primitive data in key-value pairs. Internal Storage Store private data on the device memory. External Storage Store public

Saving data on Android : File Storage vs SQLite Database vs Shared Preferences

守給你的承諾、 提交于 2019-12-03 06:05:40
This title makes me wonder on what is most suited feature in saving medium to large data on a specific application. I know there is a recent questions that i have seen on Stackoverflow regarding on saving data with these feature but I want to know, as what i have said, what suited most. Do you have any suggestion regarding to this? Tarsem Singh Shared Preferences Store private primitive data in key-value pairs. Internal Storage Store private data on the device memory. External Storage Store public data on the shared external storage. SQLite Databases Store structured data in a private database