save

How to save raster data in R object format?

99封情书 提交于 2019-12-24 00:41:55
问题 I don't know how to deal with save.image() and saveRDS() with raster data in R. I have understood that raster package open a connexion with the image file using raster() function, so it doesn't really open the file into R workspace. I want to save my workspace (data.frame, list, raster, etc) with save.image() function (or similar) and open it in a different computer. If I try to plot or process a raster object saved in a different computer, always have the same issue: Error in .local(.Object,

Share a file without saving it on the external storage

人走茶凉 提交于 2019-12-24 00:22:46
问题 I am using the following code to allow the user to share a bitmap, try { File save_dir = Environment.getExternalStorageDirectory(); FileOutputStream out = new FileOutputStream(save_dir + "/test.jpg"); final_bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out); Intent share = new Intent(Intent.ACTION_SEND); share.setType("image/jpeg"); share.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///" + save_dir + "/test.jpg")); startActivity(Intent.createChooser(share, getString(R.string.share_dialog

ios 13.1 Cannot save file to App Directory

不问归期 提交于 2019-12-23 22:18:05
问题 I was writing an app in ios 13 and saving my own filetype to the apps own directory folder. I could see this in the Files app, with my apps name and icon. I have updated my ipad to ios 13.1 and cannot save or open any files. If I open the Files app, my apps directory doesn't even exist. Why would this have changed? I have tried uninstalling the app, and reinstalling it. I have checked my permissions were as before. It is like the main app directory is not being created, therefore any attempts

Download file from web and then save with a save file dialog box?

六眼飞鱼酱① 提交于 2019-12-23 20:33:16
问题 How can I download a file, then save it to wherever I want? I am using Windows Form, Web Application. I know I can download it with this code: WebClient wClient = new WebClient(); wClient.DownloadFile("WebLinkHere", @"C:\File.txt"); But I want a save box like when you press CTRL+S. 回答1: You can use SaveFileDialog class. Example: var dialog = new SaveFileDialog(); dialog.Filter = "Archive (*.rar)|*.rar"; var result = dialog.ShowDialog(); //shows save file dialog if(result == DialogResult.OK) {

Django form not saving with ModelChoiceField - ForeignKey

 ̄綄美尐妖づ 提交于 2019-12-23 19:38:34
问题 I have multiple forms on my site that work and save info to my PostgreSQL database. I am trying to create a form to save information for my Set Model: class Set(models.Model): settitle = models.CharField("Title", max_length=50) setdescrip = models.CharField("Description", max_length=50) action = models.ForeignKey(Action) actorder = models.IntegerField("Order number") The Set Form looks like this. I am using ModelChoiceField to pull a list of Action name fields from the Action model, this

django ModelForm save() method issue

徘徊边缘 提交于 2019-12-23 19:28:06
问题 I have a model form: class SnippetForm(ModelForm): class Meta: model = Snippet exclude = ['author', 'slug'] and I want to be able to edit a particular instance by using this: def edit_snippet(request, snippet_id): #look up for that snippet snippet = get_object_or_404(Snippet, pk=snippet_id) if request.user.id != snippet.author.id: return HttpResponseForbidden() if request.method == 'POST': form = SnippetForm(data=request.POST, instance=snippet) if form.is_valid(): form.save() return

Ghostscript error with print function in Matlab

雨燕双飞 提交于 2019-12-23 18:00:04
问题 I am trying to save images in Matlab by using the print function: myImage = magic(500); myFigure = figure('visible','off'); r = 1; set(myFigure, 'PaperUnits', 'inches', 'PaperPosition', [0 0 1920 1080]/r); % the program works fine on both computers without the line above % however, the program runs fine on one computer only with this line imagesc(myImage); axis image; print(myFigure, '-dpng', sprintf('-r%d',r), 'myOutput.png'); When I run this program locally with Matlab R2012b, it works as

Resolving Dirty Flag in Ext.grid.Panel cell

丶灬走出姿态 提交于 2019-12-23 15:07:17
问题 In an Ext JS grid, I'm editing individual cells. In one of the columns I have a Save button which fires the Save event. How can I remove the dirty flag (in red box in my image below) in the edited cell? I don't know how to perform the create, update and destroy options with the proxy because the documentation have a good example, so I'm planning on doing an AJAX request for these steps until I can take actual Sencha training. However, if the dirty flag resolves itself if I work the store and

vba check if a read-only workbook is opened

耗尽温柔 提交于 2019-12-23 13:16:09
问题 I cannot seem to get a definite feedback on whether or not a read-only workbook is opened or not. In my code I have it copy after closing/saving the workbook. I would like to be able to overwrite the read-only workbook if it's opened as read-only by another user. I tried this something like this bit of code, but had no luck, it just kept saying "File not open!" even when I had it opened. How can I check whether or not a "read-only .xlsx" file is opened or not in vba? Sub Test_If_File_Is_Open

MatPlotLib plot_surface: hidden lines appearing in PDF

爱⌒轻易说出口 提交于 2019-12-23 12:58:14
问题 I'm generating a 3D surface using MatPlotLib's plot_surface method, then saving it to a PDF file. I am able to hide the surface lines via "linewidth=0", but the lines appear again after a savefig to PDF. Edit: When doing the savefig() to .png and .svg, the hidden lines stay hidden. The first image below is a screenshot of the plt.show() result, and the second is a screenshot of the PDF result. Any ideas of what I can do to keep the hidden lines out of sight in the PDF? I'll post code at the