I'm generating PDF files using an old library of iText on Unix.
Everything is going fine, but my exploitation team has just contacted me telling they are having storage troubles with some temp files.
After a discussion, they indicate me a lot of "Acroaxxxxx" files are created under /tmp folder. I'm checking it and the files are the same I generate with my application, but my code is not handling this.
My question is quite simple: can I modify or add something to my code to indicate to iText to delete the tmp file created during the process?
Thnks!
Related
Where does VSCode store its Most Recently Used (MRU) list of .NET projects and solutions on Windows?
And also is there some open source code to fetch VSCode's MRUs?
I scanned all files in this dir (recursive) C:\Users\pat\AppData\Roaming\Code with no luck
For you it should be in C:\Users\pat\AppData\Roaming\Code\User\globalStorage\state.vscdb; this file is an SQLite database and you can look around for tools that open this kind of file (because it won't be readable as plain text) to see what's inside and decide whether you can sync it across machines (if that's what you're after).
Also reference this answer, there's very useful stuff over there.
Edit: Thanks this is indeed the file I was looking for.
It can be read with the tool SQLitebrowser.
I didn't easily found a .NET library to read the state.vscdb file + we are very reluctant in embedding a whole library in our product for a small feature.
Hopefully state.vscdb contains the MRU file list in clear textual JSON.
So what I did is just open this file as text, and locate the JSON and read it. Clearly it is ugly but JSON shouldn't be crypted anytime soon in such file and if it fails one day, this feature is not critical for us, just a convenient helper for the user.
The JSON to locate looks like:
{"entries":[
{"fileUri":"file:///c%3A/Dir/treeItem.ts"},
{"fileUri":"file:///c%3A/Dir/YourSolution.sln"},
...
I am trying to identify the root cause of a corrupted Microsoft Word docx, the file being the result of a PDF conversion using commercial software. When trying to open this doc in MS Word, I get an error message saying nothing specific, only that the file is corrupted and cannot be opened.
Now, the same file opens fine in Libreoffice. When saving the file as docx from within Libreoffice, I am also able open it in Word again. There are quite a few differences in the contents of the XML files in the unzipped docx file (checked with a diff tool) compared to the one created by Libreoffice. However, I am not sure which ones exactly would cause the file create by Libreoffice to be uncorrupted.
Also, if I unzip the docx and rezip it again, it also opens fine in Word afterwards. I checked the two files on the binary level using a Hexeditor and there were quite a few differences, but it is rather hard or even impossible to understand what these differences mean.
Has anyone has a similar situation and might be able to shed some light on this? I am not sure where to start. Tks.
Problem was solved by doing a roundtrip conversion using the Apache POI library (poi.apache.org)
My nine year old son is applying to participate in a programming contest. Any language is allowed, and he wants to use Scratch. But the application requires an ascii text listing of a program to solve a specified preliminary problem. They will not accept a PNG screenshot, or Scratch's binary format. So how does he get an ascii listing of his program? If it is impossible (as I suspect) then I will just read his program and retype it into an ascii editor.
You have a few options here.
If you're using Scratch 1.4, you can save a text-only project summary. Shift-click the File menu, then Write project Summary.
This functionality is coming soon (hopefully) to Scratch 2.0. UPDATE: It has been added.
You can also get a text-based representation of all the blocks using the Scratchblocks generator.
Or, you can save the 2.0 project as myproject.sb2, rename to myproject.zip, unpack the ZIP, and take the project.json file.
Unfortunately, none of these methods can easily be imported back into Scratch.
http://scratchblocks.github.io will convert your project into scratchblocks format. It is exactly what you are looking for.
You can download and edit the json script for the Scratch project. It can then be uploaded to replace the existing project. (This is also a great way to back-up and deploy projects)
From the "See Inside" screen, File->Download to your computer.
Rename the file to have a ".zip" extension instead of just ".sb2".
Unzip the file to edit the "project.json" file.
Edit the json code as desired.
Reassemble the zip file
Remove the ".zip" extension. (Back to ".sb2")
Update the Scratch project by going to the original project and selecting File->Upload from your computer.
In one of the previous versions of one of my file in a Netbeans project I wrote code that I later removed, and now I want to retrieve it. However now I can't find it when I manually go to previous versions, as I have many versions in the local history of this file, and I don;t remember when exactly I wrote this code.
Is there a way to run a search on the local history of this file?
I saw in this answer that the local history is kept in this path
<HOME>/.netbeans/<NB_VERSION>/var/filehistory where HOME is my user home and NB_VERSION is the version of NetBeans (e.g. 7.0).
I tried running AgentRansack on that directory, but to no avail.
I recently had to solve this problem and figured it out. Netbeans stores local history files in your user directory as mentioned above. Inside that folder are numbered directories. It's pretty easy to guess which one you need based on the modification date of the folder (if you know when you last looked at it, so that doesn't help you much). In side the numbered folders is another folder with a hashed name, and inside of that folder is a set of files: a data file, and numbered files. The data file can be read with a binary file reader, and if viewed in ascii mode will show the filename that this history belongs to. The numbered files are actually zip files and they have full versions of the file in them. Just unzip those and open with a text editor if they are plain text files.
Hope this helps you out, but I realize its probably too late now. I had to figure this out because I had opened a remote file with netbeans (a file that was not associated with a project), and couldn't get back into the Local History because the file didn't have a project. However I could see it in the Local history by reading the data file, and I just guessed that the other files were zipped by the fact that they started with "PK" in the binary viewer. Once I put it all together I was home free.
I am making an application that persists several different user settings. The way I have done it is just to serialize my collections (with the settings in them) to XML files.
As they are changed I update the saved file so that when the user runs again, the settings are saved.
As I get going with this style of persistence, I am finding that I have a lot of XML files.
Is this normal? Is it ok to litter my installed directory with configuration xmls files?
Is there a way to hide these files? Maybe a trick to save them as a resource under one file name?
This is not a really urgent issue. It does not really bug me to have the XML files there, but I thought I would ask.
I am using C# and VS 2008.
Can you not at least put them in their own folder? "/App_Data" for example? Beyond that... If you are getting a lot of files, what are the chances of being able to switch to a database? (SQLLite or something along those lines)