save

Alternative to locking file type on FileReference.save() AS3

痴心易碎 提交于 2019-12-04 04:13:04
Update: As discussed in Jacob's reply below, limiting or correcting the behaviour of FileReference.save isn't possible. Can anyone suggest an alternative (server is Apache/PHP) that matches all of my criteria from this post and avoids the pitfalls I discussed with Jacob? End edit I'm saving an image from my AS3 app using FileReference.save(). This is the code, which works fine: var encoder:JPGEncoder = new JPGEncoder(80); var byteData = encoder.encode(myBMD); //bitmap data object created earlier var file:FileReference = new FileReference(); file.save(byteData, "myImage.jpg"); This opens up the

Save generated code in a special folder in “rtwbuild”

我的未来我决定 提交于 2019-12-04 04:03:31
问题 I am using rtwbuild to generated C++ code from a Simulation diagrams and would like to save generated code to an arbitrary directory. Is there any way to do so? 回答1: You can control the folder for generated files in 3 different ways. You can set the "Code generation folder" option in Simulink Preferences. You can reach to Simulink preferences from any model using File menu and then choosing Simulink Preferences. This will change the code generation location for all models and will persist

JFileChooser - multiple file filters?

烂漫一生 提交于 2019-12-04 03:57:26
I have a question about the JFileChooser in Swing. I'm trying to get multiple file extensions in the drop-down box, but have no idea how to do it. There is the method extFilter = FileNameExtensionFilter(description, extensions); that I can then use by writing fileChooser.setFileFilter(extFilter); however, as you can see, this only supports one option in the drop-down list. How do I add more? I think you want the addChoosableFileFilter method. Read the tutorial . You can simply create a filter that subclasses FileFilter and call the method I outlined above with that filter as an argument. I'm

UIDocument & NSFileWrapper - large files taking a long time to save, despite incremental changes

╄→гoц情女王★ 提交于 2019-12-04 03:39:39
I have a UIDocument based app that uses NSFileWrapper s to store data. The 'master' file wrapper contains many additional directory file wrappers, each of which represents a different page of the document. When saving a large document for which only a small proportion of one page has been modified, UIDocument spends a LONG time in the background writing the changes (in writeContents:andAttributes:safelyToURL:forSaveOperation:error: ). Surely it should only be writing out this one small change to the file wrapper... what's taking so long? My contentsForType:error: override returns a new

How to run annotation processor in eclipse on save

吃可爱长大的小学妹 提交于 2019-12-04 03:27:48
Currently I generate files with an annotation processor in eclipse for a project by Right click on project > Run As > Maven Clean Right click on project > Run As > Maven install This is quite time consuming. How do I set up eclipse to make it run the annotation processor on save? I have the "Build Automatically" feature set but it seems to ignore the annotation processors. BTW I am using m2e apt plugin with "Automatically configure JDT APT activated". I have annotation processing working in Eclipse for some of my projects; for me, it IS working on save, and I don't have to mvn install (and it

C# - Saving a '.txt' File to the Project Root

泪湿孤枕 提交于 2019-12-04 02:47:39
I have written some code which requires me to save a text file. However, I need to get it to save to my project root so anyone can access it, not just me. Here's the method in question: private void saveFileToolStripMenuItem_Click(object sender, EventArgs e) { try { string fileName = Microsoft.VisualBasic.Interaction.InputBox("Please enter a save file name.", "Save Game"); if (fileName.Equals("")) { MessageBox.Show("Please enter a valid save file name."); } else { fileName = String.Concat(fileName, ".gls"); MessageBox.Show("Saving to " + fileName); System.IO.File.WriteAllText(saveScene

Add curly braces to ggplot2 and then use ggsave

血红的双手。 提交于 2019-12-04 02:33:22
So this is very relevant to this question and this answer is an excellent solution. The problem is that when I try to export the plot using ggsave the curly braces aren't present. example: library(ggplot2) library(grid) library(pBrackets) x <- c(runif(10),runif(10)+2) y <- c(runif(10),runif(10)+2) the_plot <- qplot(x=x,y=y) + scale_x_continuous("",breaks=c(.5,2.5),labels=c("Low types","High types") ) + theme(axis.ticks = element_blank(), axis.ticks.length = unit(.85, "cm")) the_plot grid.locator(unit="native") bottom_y <- 284 grid.brackets(220, bottom_y, 80, bottom_y, lwd=2, col="red") grid

Best Method to Save and Read Data in Android

社会主义新天地 提交于 2019-12-04 02:27:46
问题 I have an apps that using proxy to browse the url connection. But proxy host, port, username and password that i used are using hardcode. I already achieved that. But now i want to replace that hardcode with just an object that refer to the data. so the user can input the proxy that they want and can use their username and password. here is what my flow look like. So first user can enter the name of the connection, host, port, etc that they want. And after that "save" it. And then in next

Windows Form Save to XML

夙愿已清 提交于 2019-12-04 02:21:43
问题 I have a form with information in it that the user enters, i want to save this to XML... i'm fairly new to programming but have read XML is the best thing to use. How would i go about it? If it helps im using Sharp Develop as an IDE. Current it has 10 text boxes and 10 datetimepickers. 回答1: The easiest thing would be to create a class that stores those 10 values as properties and use xml serialization to convert it to XML, then store it to the file system. Here's a tutorial: http://www

QFileDialog: adding extension automatically when saving file?

爱⌒轻易说出口 提交于 2019-12-04 01:47:18
When using a QFileDialog to save a file and to specify the extension (like *.pdf) and the user types in a name without this extension, also the saved file hasn't this extension. Example-Code: QFileDialog fileDialog(this, "Choose file to save"); fileDialog.setNameFilter("PDF-Files (*.pdf)"); fileDialog.exec(); QFile pdfFile(fileDialog.selectedFiles().first()); now when the user enters "foo" as the name, the file will be saved as "foo", not as "foo.pdf". So the QFileDialog doesn't add the extension automatically. My question: How can I change this? Caleb Huitt - cjhuitt You could use QFileDialog