save

TypeError: Mismatch between array dtype ('object') and format specifier ('%.18e')

我是研究僧i 提交于 2019-12-20 12:06:40
问题 I have the following array: X = np.array([image_array_to_vector1,image_array_to_vector2,image_array_to_vector3,image_array_to_vector4]) A print out of X looks as follows: [array([167, 167, 169, ..., 1, 1, 1], dtype=uint8) array([42, 43, 43, ..., 41, 36, 34], dtype=uint8) array([0, 0, 0, ..., 0, 0, 0], dtype=uint8) array([0, 0, 0, ..., 0, 0, 0], dtype=uint8)] When I try to save the data as txt: X_to_text_file = np.savetxt('x.txt',X) I get the following: File "/Library/Python/2.7/site-packages

UIDocument not saving to file despite indicating success

廉价感情. 提交于 2019-12-20 11:13:08
问题 I'm trying to open, modify, and save a file in iCloud Drive using UIDocument . When I call save(to:for:completionHandler:) with the file location and using .forOverwriting for the UIDocumentSaveOperation , it completes with a status of success = true . However, the iCloud file (as seen in both desktop and iOS file browser) does not update, and when reopening the file, the changes are not shown. I've verified that contents(forType:) returns the correct (modified) file contents when saving.

SharedPreferences replacement of data

旧巷老猫 提交于 2019-12-20 07:56:20
问题 I have application that gives me some string whenever I press the button and then save this value using sharedpreferences. However, I would like to limit this saving function, so it will save only the last three received strings. The structure is of the following: String A String B String C Next time when i click my button it will record the value into String A, while move the old String A to String B and old value of String B to String C, as well as, delete the old value of String C

How would I save a UIButton's properties and load with a button? [duplicate]

て烟熏妆下的殇ゞ 提交于 2019-12-20 07:40:01
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How can I save and load the alpha values of a UIButton in an app? I would like to save the state of the UIButton (e.g. its alpha value and whether it is hidden or not) and this would then load up when the user quits and reloads the app. I've tried some bits of code with NSUserDefaults but with no luck. Could somebody help with some sample code so that I can save and load the button's state? Thanks, James 回答1:

save and load data (iphone sdk)

落花浮王杯 提交于 2019-12-20 07:17:56
问题 i'm wondering what's the best method to save and load data in a iphone application. i'm trying to save strings into a text file or something like that and load them into a table view, so that the first entry in the text file is the first row in the table view and so on... somebody got an idea how I could realize that? thanks in advance. sean 回答1: There are basically three methods for saving data: Use File Manager to save the file to the file system. (But in your case, you should not do that)

How would I save and load a UITextField?

China☆狼群 提交于 2019-12-20 06:55:32
问题 I have searched everywhere and tried lots of code but nothing seems to be working for me. All I need to do is to load (on viewDidLoad) a text field and save it when a button is pressed. What is the easiest method of doing this? I am working with a single window application, I don't have a view controller (this may make a difference?) Thanks, James 回答1: Using an SQLite database: -(IBAction) checkNotes{ sqlite3_stmt *statement; const char *dbpath = [databasePath UTF8String]; if (sqlite3_open

How would I save and load a UITextField?

妖精的绣舞 提交于 2019-12-20 06:55:15
问题 I have searched everywhere and tried lots of code but nothing seems to be working for me. All I need to do is to load (on viewDidLoad) a text field and save it when a button is pressed. What is the easiest method of doing this? I am working with a single window application, I don't have a view controller (this may make a difference?) Thanks, James 回答1: Using an SQLite database: -(IBAction) checkNotes{ sqlite3_stmt *statement; const char *dbpath = [databasePath UTF8String]; if (sqlite3_open

Save changes to database vaadin

我与影子孤独终老i 提交于 2019-12-20 06:32:59
问题 I have an application which has a table and when you click on an item in the table it fills in a group of textfields with its data (FieldGroup), and then you have the option of saving the changes I was wondering how would I save the changes the user makes to my postgres database . I am using vaadin and hibernate for this application. So far I have tried to do editorField.commit() // after the user clicks the save button I have tried editorField.commit() hbsession.persist(editorField) /

File name has two backslashes C#

て烟熏妆下的殇ゞ 提交于 2019-12-20 03:32:22
问题 There is probably an easy answer for this, but when I added DateTime.Now.ToString() to my fileName it adds an extra \ for every \ I have so C:\Temp becomes C:\\Temp which causes the file not to save. This is the code in question String fileName = @"C:\Temp\data_" + DateTime.Now.ToString() + ".txt"; For example the output could be C:\\Temp\\data_12/04/2012 20:08:40.txt It should be C:\Temp\data_12/04/2012 20:08:40.txt 回答1: Nope, that string really has single backslashes in. Print it out to the

Unity. Android. Save files disappears after updating an App

社会主义新天地 提交于 2019-12-20 03:19:27
问题 I'm creating pretty simple game in Unity, and want to save results, time, etc. I use System.IO for it, and everything works fine, but when i update my app from '.apk' all the results disappear. So how can i create file, which won't be deleted after update? public static void Save() { string[] lines = new string[] { Language, First_Test.ToString(), Last_Test.ToString(), MakeLine(ref Attention_Results), MakeLine(ref Memory_Results), MakeLine(ref Reaction_Results), Attention_Best.ToString(),