save

Writing a new set of data to Plist instead of overwriting it

你。 提交于 2019-11-30 16:33:10
I'm trying to get a plist to store multiple sets of data, but each time I save (using a button from an ActionSheet), it overwrites the previous set. I want to add multiple 'friends' and their data. I'm not too keen on using Core Data, so I'm wondering how you can do it with a Plist. Here is the code for the save button: NSMutableDictionary *friend = [[NSMutableDictionary alloc] init]; NSMutableDictionary *array = [[NSMutableDictionary alloc]init]; [array setObject:friendName.text forKey:@"Name"]; [array setObject:friendPhone.text forKey:@"Phone Number"]; [array setObject:friendEmail.text

Android make .Gif out of Bitmaps

只谈情不闲聊 提交于 2019-11-30 16:32:49
I have an app where the user saves a bunch of bitmaps in a folder on the SD card. I would like to add a feature where the user can export said bitmaps as a .gif file that is viewable say, in a text message. How can I accomplish this? There's a native library that does exactly this. http://jiggawatt.org/badc0de/android/index.html#gifflen 来源: https://stackoverflow.com/questions/4569133/android-make-gif-out-of-bitmaps

jQuery webcam plugin - saving image

China☆狼群 提交于 2019-11-30 16:25:06
im having a hard time saving the image captured from the webcam using the jquery webcam plugin. here's the code.. $(document).ready(function(){ $("#camera").webcam({ width: 320, height: 240, mode: "save", swffile: "jscam.swf", }); }); i am using the 'save' mode. in the body part.. <div id="camera"></div> <a href="javascript:webcam.save('upload.php');void(0);">capture</a> in the upload.php part.. $str = file_get_contents("php://input"); file_put_contents("upload.jpg", pack("H*", $str)); i also tried the callback mode still doesnt work. it seems the blog itself has insufficient examples http:/

jQuery webcam plugin - saving image

自古美人都是妖i 提交于 2019-11-30 16:08:37
问题 im having a hard time saving the image captured from the webcam using the jquery webcam plugin. here's the code.. $(document).ready(function(){ $("#camera").webcam({ width: 320, height: 240, mode: "save", swffile: "jscam.swf", }); }); i am using the 'save' mode. in the body part.. <div id="camera"></div> <a href="javascript:webcam.save('upload.php');void(0);">capture</a> in the upload.php part.. $str = file_get_contents("php://input"); file_put_contents("upload.jpg", pack("H*", $str)); i also

Save an Image to a File in a Applet?

五迷三道 提交于 2019-11-30 15:48:53
So here is te thing, Im trying to do an Applet for a webgame to produces "custom" avatars, this avatar are for a kind off an army of a country, so the avatar cosnsit on the image of the choice of the user, and a frame on the picture thtat represent the quad that the user belongs too. So my plan is to make them choose from a file from their computer, and then they choose the squd that they belong to. After this they will see a preview of the picutre and they can save it to their computer to later use it on the game. I know that you can draw image with a Graphic or Graphic2D on the background of

Creating Background Thread for Core Data writing

情到浓时终转凉″ 提交于 2019-11-30 15:36:45
I'm trying to recreate the three tier core data system that is described in this cocoanetics article ( http://www.cocoanetics.com/2012/07/multi-context-coredata/ ). The problem I'm running into is creating the private MOC on its own background thread. I don't have much experience with multithreading and how it should be done in objective c. I've been reading over articles and trying to grasp how to correctly implement this approach, but I have finally conceded to the fact that I don't know what I'm doing. To create this approach, do I need to create an NSThread and manage it? Or is there a

How to save variables after application shut down?

帅比萌擦擦* 提交于 2019-11-30 15:36:08
I want to save some integers after application shut down and restore them after application opening, what is the easiest way to do this? You should store and load data from NSUserDefaults: http://developer.apple.com/library/IOS/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; // to store [defaults setObject:[NSNumber numberWithInt:12345] forKey:@"myKey"]; [defaults synchronize]; // to load NSNumber *aNumber = [defaults objectForKey:@"myKey"]; NSInteger anInt = [aNumber intValue];

StaleStateException when saving entity with complex relations

谁说胖子不能爱 提交于 2019-11-30 15:01:01
The hibernate entity I am saving in the database (Oracle) has very complex relations, in the sense that it has many related entities. It looks something like this... @Table(name = "t_HOP_CommonContract") public class Contract { @Id private ContractPK id; @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @PrimaryKeyJoinColumn private ContractGroupMember contractGroupMember; @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumns({ @JoinColumn(name = "TransactionId", referencedColumnName = "TransactionId"), @JoinColumn(name = "PrimaryContractId",

Android - How to save the state of a CheckBox

橙三吉。 提交于 2019-11-30 14:25:07
问题 I have an application with checkboxes, How can i save them? My layout is: <?xml version="1.0" encoding="utf-8"?> <LinearLayout android:id="@+id/list_linear" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"> <ScrollView android:id="@+id/ScrollView01" android:layout_width="fill_parent" android:layout_height="match_parent"> <TableLayout android:id="@+id/tableLayout1" android:layout_height="match_parent" android

Take picture with camera intent and save to file [duplicate]

女生的网名这么多〃 提交于 2019-11-30 13:56:10
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Android Camera - Save image into a new folder in SD Card i'm trying to take picture and save it to a file. The problem cames i'm trying to save the bitmap to a file. Here is my code: private void takePic() { Intent cameraIntent = new Intent( android.provider.MediaStore.ACTION_IMAGE_CAPTURE); startActivityForResult(cameraIntent, 2); } public void onActivityResult(int requestCode, int resultCode, Intent data) { if