Export to Java application deletes files - anylogic

When I wanted to export the model I was working on as a Java application, I encountered an error regarding the databases I loaded into the model. When I said OK to the error, I realized that all the files in the folder I wanted to create the Java application were deleted. That folder was desktop by the way.
Right now all the files (i mean all of them!) on my desktop are deleted and they don't even show up in the recycle bin. How are we going to solve this situation? How can AnyLogic have the authority to delete all files in that folder? How is this authority not shared with me and not warned beforehand?

When you work with software in general, you need to have a version control in place that will allow you to recover your information. These problems occur, and if AnyLogic has access to your computer it's because you grant the permission and it needs the permission. If you make your desktop your project folder, then i would say you are to blame.. why would you do that...
Using GIT as Ben commented, is always a good idea... but it requires you to be conscious about when you commit a version.
What I do, is I use dropbox and all my projects are done in a dropbox folder... the good thing is that dropbox always saves automatically all the files on the folder... this has saved my life multiple times and I suggest you to do something like that in the future. So on one hand you have the autosaving features, which is useful, but sometimes you erase everything by mistake, and the autosave is not useful, but dropbox saves no matter what.

Related

Where are the information about each workspace stored?

I know that some settings such as imported folders are store on the workspace file such as my-worskapce.code-workspace and some others such as python interpreter are stored in the root folder(s?) such as .vscode/settings.json but these do not include information about opened editors or which extensions are disabled for each workspace etc. Where can I find those information?
I need that information because I started storing all my *.code-workspace files in ~/ and now it's getting cluttered and I want to move them to a different folder, when I do, and reopen my workspace, I see that all open editors are gone! This hurts my productivity as I will have to reopen them and recall which files were being worked on. And another issue is that previously added folders are gone too! I have to re-add them which is merely a redo of work that already has been done, since imported folders are imported as relative paths. If I move the *.code-workspace file to it's original location with the same name however, everything is back to normal, so this tells me VSCode is storing information about each workspace somewhere and it's bound to each *.code-workspace absolute path. I have checked ~/.config/Code/User but couldn't find anything. I've googled a lot using different keywords but seems it's nowhere documented or asked about. I usually make backups of my workspace files and I'd like to make back up of these information as well.
In windows you can find them in
C:\Users\<username>\AppData\Roaming\Code\User\workspaceStorage
VS Code 1.75 introduced a new Profiles feature, summarised here.
Profiles store information such as user settings, installed extensions and the current layout of panels etc.
You can export/import profiles to/from a Github gist or a local file. Different profiles are associated with each workspace.
Profiles won't resolve all your immediate issues, but may give you more flexibility in the future.

Risk of adding "sensitive" files to Chrome Devtools workspace

When adding a folder from your local filesystem to the Chrome DevTools workspace, you'll receive a dialog banner which warns you to "not expose any sensitive information" before you grant access.
What are the specific risks associated with doing this? Is the workspace vulnerable to access by extensions? Script injection?
Official response -
"We use the same api as a regular website/chrome app, so it’s not something specific to devtools. I guess in theory if you map you workspace maps to a malicious site and then you live edit your site with devtools open the site might be able to detect your edits? That’s pretty convoluted though.
We assume that information in the workspace is data for your project. I wouldn’t add /etc/passwd to a devtools workspace."
From the review -
"How does one revoke access? If I make a mistake, I can remove the .allow-devtools-edit file. I don't see a way to do this with the new approach.
I'm not sure an infobar is strong enough. There's a class of users that will click this but would never be willing or savvy enough to put the .allow file onto their machines."
As well as -
"The message ought to be scarier, talking about ensuring that there isn't sensitive information in that directory."
Not much, but the original issue for the previous method (adding a file to the folder for allowing it to be mapped also says -
"DevTools needs file system access to allow developers edit/add sources (even those that are not loaded from server, e.g. deployment descriptors, server scripts).
We plan to use File System API (isolated file system).
To add a folder to DevTools users will need to
1. Add an empty .allow-devtools-edit file to the folder (for security purposes)"
I guess because Developer Tools extensions might then be able to read the files you mapped, it can expose highly sensitive information, like unencrypted user names and passwords that might be found in configuration files.

prevent eclipse from cleaning up generated files

so I've seen this
How to prevent Eclipse from cleaning the bin folder for every build?
but I have a different problem. (i.e. if it was just resources, I could use that ability to copy them into place each time).
I'm generating files (ala sqlite databases) and they are getting cleaned up. I could move them around (and probably will eventually), but for now I want them within this structure for developing purposes.
is there no way to prevent eclipse from deleting these files (it doesn't seem to happen all the time, perhaps just on build error?), as I really need them to persist.
This is a solution for a different problem, but I think it would help here ;)
When generating resource files, (including DB files) do not put them into the /bin folder, especially if they are not going to change with every build, put them in a subfolder of your /src folder.
I have done so for webservice stubs, version numbers and other resources and regard it as the best practice.
If, however, you should decide to stick to your practice, take a look at the eclipse-generated build.xml file and modify it, making ant remove only the files you don't want.
I think the answer is in preferences
Java->Compiler-Building->Scrub output folders when cleaning project (i.e. not set, will hopefully find out soon).

Best practices for deploying data to a custom folder

Sometimes when we issue an upgrade to our application we need to install some files to the application's Data folder. We want to make it possible for the users to move this folder to a place of their liking. But how to deal with this at install time?
I was thinking of deploying to the user's AppData folder and have the application somehow check there for new files at startup.
Any advice or references would be very welcome!
We use InnoSetup for a VB6 application if that matters for your answer.
Generally the best solution I've found is to allow the user to move the folder from within the application.
This allows the application to keep track of where its data is being kept (by adding a reference to it in a file or registry entry which it accesses at load time) and to access it seamlessly in the future.
Your update routines can then also access this information to determine where to place the update files.
Alternatively, make sure the folder name is as distinctive as possible and add a search routine to look for the directory in a number of sensible places at load time. Then write your manual specifying that the data folder can be moved to one of those locations ONLY.
Wouldn't the users just run an update or patch package? I'm not sure why they'd want or need to see such files. It's pretty rare for commercial software to offer users the options of where to store program settings and other internal-use files.
Give some thought to this before putting a lot of stuff into users' roaming profiles. You might want LocalAppData instead.

In Source Safe is there a way to protect crucial files being modified by some developers

I'd sooner not just permanently have a bunch of files checked out to me, but I'd like a way to prevent some really critical files being changed without my being aware of it.
PS Yes I know SourceSafe is terrible.
You can only set access rights on a project by project basis.
This is done by running the the Source Safe Administration application and then go to Tools > Rights By Project. Select the required project and then give a users the required priveledges.
In order to protect a subset of files place them in a seperate project and hence protect the subset.
When you go into Source Safe if you set the working folder of the sub folder to be the same as the parent then when you do a get latest etc. all the files will be in the same folder. If you want the protected files to be in a seperate folder then set the working folder accordingly.
It's been a while since I've had to use Source Safe but I don't think it has this kind of functionality built it.
Can you set up a separate repository/instance that excludes the users who shouldn't be allowed to modify them?
Or failing that, just keep the files always checked out on your machine :P
check them out locked exclusive