save

How to efficiently manage files on a filesystem in Java?

柔情痞子 提交于 2019-12-03 08:46:12
I am creating a few JAX-WS endpoints, for which I want to save the received and sent messages for later inspection. To do this, I am planning to save the messages (XML files) into filesystem, in some sensible hierarchy. There will be hundreds, even thousands of files per day. I also need to store metadata for each file. I am considering to put the metadata (just a couple of fields) into database table, but the XML file content itself into files in a filesystem in order not to bloat the database with content data (that is seldomly read). Is there some simple library that helps me in saving,

IOS Saving State For Complex Apps

半城伤御伤魂 提交于 2019-12-03 07:50:29
问题 I'm building a fairly complex business application on the iPad IOS 4.2: 4 tabs, with potentially deep navigational paths on each tab. In the opinion of some of your more experienced IOS developers, what would the general expectation of a user be with respect to saving application state between launches (i.e. after an app's been fully terminated and subsequently restarted)? I'm using Core Data and have all the data issues covered, but I'm concerned about the application's navigational tree. If

Saving Excel workbook to constant path with filename from 2 fields

﹥>﹥吖頭↗ 提交于 2019-12-03 07:37:18
I am absolutely new to Excel macros, I tried to search and put together a code to fit my purpose, but with no luck. I hope someone is generous enough to help me out. Sub save() ActiveWorkbook.SaveAS Filename:="C:\-docs\cmat\Desktop\New folder\ck.xls", FileFormat:= _ xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _ , CreateBackup:=False End Sub How to edit this to: Instead of naming the saved file ck.xls, generate the filename from the worksheet cells C5 and C8, with a space in the middle. try Sub save() ActiveWorkbook.SaveAS Filename:="C:\-docs\cmat\Desktop\New folder

Is it possible to save a google chart as an image?

女生的网名这么多〃 提交于 2019-12-03 07:24:46
问题 I am making an application in which I would need to save the google chart as an image . All I am using is tomcat, servlets and javascript. Is there a way to save the following generated chart as an image? (refer to code at the end of post). The idea is that user would see this chart and then would have the option of uploading it to his facebook profile. I am not sure if this will be uploadable to facebook in its native format or will be needed to be saved as a jpg. <html> <head> <script type=

saveRDS inflating size of object

倖福魔咒の 提交于 2019-12-03 06:53:56
This is a tricky one as I can't provide a reproducible example, but I'm hoping that others may have had experience dealing with this. Essentially I have a function that pulls a large quantity of data from a DB, cleans and reduces the size and loops through some parameters to produce a series of lm model objects, parameter values and other reference values. This is compiled into a complex list structure that totals about 10mb. It's then supposed to saved as an RDS file on AWS s3 where it's retrieved in a production environment to build predictions. e.g. db.connection <- db.connection.object

Image saved in JavaFX as jpg is pink toned

自古美人都是妖i 提交于 2019-12-03 06:45:27
I want to save an Image from my ImageView to files with different resolutions. Doing it as .png results as expected. As for .jpg - I get all files pink toned. Where is the trick? Here is the code: Object[] imagesFromFotoListView = ta.myFotoListView.getItems().toArray(); new File(localDir).mkdirs(); for (int i = 0; i < imagesFromFotoListView.length; i++) { new File(localDir + "/" + i).mkdirs(); final ImageView iv = new ImageView((Image) imagesFromFotoListView[i]); ImageIO.write(SwingFXUtils.fromFXImage(iv.snapshot(null, null), null), "jpg", new File(localModelFotoDir + "/" + i + "/large.jpg"));

How to create screenshot of QWidget?

允我心安 提交于 2019-12-03 06:33:26
I work at my homework in Qt Creator, where I paint to QWidget and I need to save some part of this QWdiget. I tried to solve this problem: QPixmap pixmap; pixmap.copy(rectangle); // rectangle is part of QWidget, which I need to save pixmap.save("example.png"); Thank you for help. You can use QWidget::render for this. Assuming rectangle is a QRect: QPixmap pixmap(rectangle->size()); widget->render(&pixmap, QPoint(), QRegion(rectangle)); Very easy: QPixmap QWidget::grab(const QRect &rectangle = QRect(QPoint(0, 0), QSize(-1, -1))) s.a.: http://doc.qt.io/qt-5/qwidget.html#grab 来源: https:/

How do I tell Play Framework 2 and Ebean to save null fields?

[亡魂溺海] 提交于 2019-12-03 05:54:58
I'm using Play Framework 2 and Ebean. When a user submits a form to edit an existing object in the database, it doesn't save null values. I guess this is to prevent overwriting fields that aren't in the form with null. But how can I let them set fields in the form to null if they need to? For example, the user edits an Event object. Event.date is 1/1/13. The user sets the Event.date field in the form to empty and submits the form. Inspecting Event.date in the debugger shows its value is null. I save the Event . If I look at the Event in the database, its value is still 1/1/13. Edit: It seems

Saving Many to Many relationship to database in Symfony2

只愿长相守 提交于 2019-12-03 05:54:02
In my Symfony2 project I have two related entities: Users and Favorites. They have a many-to-many relationship. My application works as follows: In my Twig-page I have an few items with a button 'Add to Favorites'. When you click the button my controller saves the item_id in the Favorites column. But then I want to save the user who added the item to his favorites and here my application fails. The User and the favorite exist but the joincolumn between Users and Favorites remains empty. I also don't receive any kind of errors. Here is my code: Entity Users class Users implements

How to save files in External Storage Public Directory DOCUMENTS on Android 4.1.2

大兔子大兔子 提交于 2019-12-03 05:12:31
i want to save a file on my Android 4.1.2 smartphone in the documents directory. This code snippet: File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS),"test.txt"); throws this exception: E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.NoSuchFieldError: android.os.Environment.DIRECTORY_DOCUMENTS While this one is working: File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS),"test.txt"); But i want to save my file in my documents directory, not in downloads. Ive read DIRECTORY_DOCUMENTS is only