save

Android - Saving a downloaded image from URL onto SD card

自古美人都是妖i 提交于 2019-12-18 12:37:52
问题 I am loading an image from an URL on button click, and storing it as a Bitmap. Now i want to know how to save that downloaded image into sd card as well as in system. I attempted to do it the following way: package com.v3.thread.fetchImage; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import android.app.Activity; import android

Delphi: Store data in somekind of structure

若如初见. 提交于 2019-12-18 11:13:55
问题 For a simulation program I'm working in Delphi 2010. The simulation isn't a problem but I need to use large collection of data which gives a problem. The data is available in excel sheets, so there is no need to edit this data in Delphi, but collecting this data from the excel sheets takes around 10min. This isn't a problem as long as you don't need to collect the data every time the program runs. So I made a program which collects all the data makes it visible, not problems here,and then

Saving numpy array to txt file row wise

白昼怎懂夜的黑 提交于 2019-12-18 10:48:29
问题 I have an numpy array of form a = [1,2,3] which I want to save to a .txt file such that the file looks like: 1 2 3 If I use numpy.savetxt then I get a file like: 1 2 3 There should be a easy solution to this I suppose, any suggestions? 回答1: If numpy >= 1.5 , you can do: # note that the filename is enclosed with double quotes, # example "filename.txt" numpy.savetxt("filename", a, newline=" ") Edit several 1D arrays with same length a = numpy.array([1,2,3]) b = numpy.array([4,5,6]) numpy

Disable Excel save option but allow macro save

邮差的信 提交于 2019-12-18 09:54:08
问题 I'm creating an excel file and I want to disable the 'save' and 'save as...' option. I found a lot of solutions on the internet, like this one in VBA: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox "You can't save this workbook!" Cancel = True End Sub It prevents user from saving changes, but I can't save my changes and that's the problem because I need to do more changes in the VBA code. Is there a way to save my macro changes ? Like an administrator

Photo does not show up to gallery

我怕爱的太早我们不能终老 提交于 2019-12-18 09:41:38
问题 I'm trying to take a photo using the android camera and telling it to save to the phone's gallery. I think i messed up on the path, but i can't seem to find my error. Could someone help me? I'm very novice at android. Code to call camera Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); String uriToFileInExternalStorage = null; cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriToFileInExternalStorage); startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);

How to convert a Python tkinter canvas postscript file to an image file readable by the PIL?

不想你离开。 提交于 2019-12-18 09:03:42
问题 So I have created a function in my program that allows the user to save whatever he/she draws on the Turtle canvas as a Postscript file with his/her own name. However, there have been issues with some colors not appearing in the output as per the nature of Postscript files, and also, Postscript files just won't open on some other platforms. So I have decided to save the postscript file as a JPEG image since the JPEG file should be able to be opened on many platforms, can hopefully display all

SharedPreferences being reset after force close

☆樱花仙子☆ 提交于 2019-12-18 09:01:11
问题 I have been able to successfully implement Shared Preferences into my application but I have ran into a problem with the data being reset/deleted if I kill the application through a task manager. I am using a static method for saving, that way I only need the method once and can call it everywhere within my app. protected static synchronized void save(Context cntx){ SharedPreferences preferences2 = cntx.getSharedPreferences("BluRealms", 0); SharedPreferences.Editor editor = preferences2.edit(

matlab iterative filenames for saving

南笙酒味 提交于 2019-12-18 08:57:38
问题 this question about matlab: i'm running a loop and each iteration a new set of data is produced, and I want it to be saved in a new file each time. I also overwrite old files by changing the name. Looks like this: name_each_iter = strrep(some_source,'.string.mat','string_new.(j).mat') and what I#m struggling here is the iteration so that I obtain files: ...string_new.1.mat ...string_new.2.mat etc. I was trying with various combination of () [] {} as well as 'string_new.'j'.mat' (which gave

How can I save div as image at client side where div contains one or more than one HTML5 canvas elements?

我是研究僧i 提交于 2019-12-18 07:14:30
问题 Div 'canvasesdiv' element contains three HTML5 canvases. <div style="position: relative; width: 400px; height: 300px;" id="canvasesdiv"> <canvas width="400" height="300px" style="z-index: 1; position: absolute; left: 0px; top: 0px;" id="layer1" /> <canvas width="400" height="300px" style="z-index: 2; position: absolute; left: 0px; top: 0px;" id="layer2"/> <canvas width="400" height="300px" style="z-index: 3; position: absolute; left: 0px; top: 0px;" id="layer3"/> </div> How can I save an

Save the current status when quit, auto-reload when re-open the app

主宰稳场 提交于 2019-12-18 07:09:15
问题 I'm creating a simple app to simply save a person's name and a number associated with this person. I've created a class for person like this: @interface Person : NSObject { NSString *name; NSInteger serialNumber; } In the mainViewController, I've created an input text field to enter the name and then automatically assign a number to the person, also 2 UILabel to show the inputted name and the serialNumber. However, after quitting the app and re-open, all labels cleared. What I'm trying to do