Delete invalid excel file resource in Anylogic - anylogic

I tried reloading the model and exporting a fresh copy but cant delete this old referenced excel file. How can I delete it?

When the little circle there is red, it means that this file is referenced somewhere in your model but the file doesn't exist. If you erase this reference, wherever it is, it will disappear from there.
But sometimes, AnyLogic gets dumb and keeps the reference (somewhere internally i guess) and then there's nothing you can do about it... I would say it's a bug.
So that's the thing... If you find the reference, erase it (some excel object somewhere in your model)... but if it doesn't work, then you have to live with it.

Related

Unity erased all my progress on my project back to original state

I started a new project and after closing and reopening it the next day, all progress was gone. It didn't crash and there weren't any abnormalities. I didn't touch any files in file explorer so it's not like I could've reverted the project or something. And yes I saved, I always save. Recycling bin is empty so it wasn't deleted. So I haven't much idea what the cause could've been, or what else to put really.
But is there any explanation for what could have caused this so next time in the future I can prepare for all my progress being erased out of the blue. And is there any way I can retrieve the files back somehow too?
Using version 2020.3.2f1
Have you tried looking through temp files? Because I had this problem too a while ago and was able to retrieve the data which was hidden in the files somewhere. I had a backup and it didn't help because it didn't save to the backup obviously. I don't know why Unity still has this problem and there's not a lot of help on the internet regarding it either

Visual Studio 2019 continues to look for the previous DbContext even after replacing it with a new one

Disclaimer: I am posting a self-answer to this. Even though it's something that's rather unusual to do, hopefully someone will benefit from reading this.
I recently replaced my original Entity Framework Core DbContext with a new one because I renamed the database (among other things). Let's call the original one OriginalDbContext and NewDbContext for convenience.
The table structure itself remained unchanged.
Naturally, I had to replace all instances of OriginalDbContext with NewDbContext. I was expecting that, once I did that, it would simply compile (since I didn't make any database changes other than replace OriginalDbContext with NewDbContext). However, even after I did that, I got numerous error messages stating to the effect that OldDbContext did not have a definition for my table clases.
I searched all files in my solution for any reference to OriginalDbContext and found none. I even deleted OriginalDbContext.cs entirely (including in version control).
Why would it continue to "look for" OriginalDbContext even though I verified that it was removed from all of my .cs files?
I finally did a "Find All" on the entire directory. It turns out that the only place that referred to OriginalDbContext was one of my publish profiles (which did not appear when I searched only in the solution). I deleted the profile and was able to compile again.
I guess the broader lesson here is that there could be references to your DbContext class that do not appear in your code base and may not even show up if you do a "Find All" on the entire solution.
Worse yet, when I double-clicked the original error messages, it made it appear like the errors were coming from my code base.

Null reference exception in Unity after renaming folder

After foolishly renaming a folder containing a bunch of assets, my textures started rendering pink and I got a bunch of null reference exception errors. I renamed the folder back to it's original name so that everything should now be in the right place, however I am still getting the null reference errors. Does anyone know how to fix this?
I'm assuming the renaming of the folder happened when Unity was closed, correct? If you don't use version control (Git, Perforce, etc.) you are pretty much in a bad spot. You will have to setup your references again.
The problem is the following:
Unity gives every asset and every folder a specific ID. All references in your assets, use those IDs to find out what is what. That is, which material was assigned to your objects, which textures were on those materials, which components were on an object, and so on.
Now you close Unity, change you folder name, and Unity goes "oooh, new folder, let's give that an ID, and all the assets in it as well. Oh, and I know about one folder which seems to have been deleted, so let's get rid of all my knowledge about it".
Panic ensues, and you give your folder the old name again. But given that stuff was referenced by ID and not name ... well, you end up in your current state.
In conclusion:
Make sure to always rename and reorganize inside Unity if you wish to do so.
If you can't revert to old commits, or if you don't use version control at all, you're going to have to set up the assets again.

Can't edit a file in Eclipse after clicking "No" in a popup warning about it being derived

I created, as I was instructed by a more senior developer, a new .sql file in Eclipse in a project folder buried somewhere in the entire application's overall project structure. When I tried to edit the file, Eclipse asked me whether I'm sure if I want to edit a derived file. I clicked "No" arbitrarily to make the popup go away and to be able to check the file's and project's properties just to be sure, because as far as I knew, the files in the project were not actually derived from anything.
Problem is, the file is now apparently locked for editing, and I don't see any way of unlocking it. In the properties, it is not marked as Read-only, nor is it in fact marked as Derived.
How do enable editing on this file again?
In the end, I deleted the file and created a new one with the same name, which is tedious, but it fixed the problem. I did not try closing and opening it again as howlger suggested, though that might have worked as well.

Guide won't automatically generate an m file

I am working in matlab gui GUIDE and I am trying to rename a file. I open the fig file in GUIDE and save it as the new file name but a new .m file is NOT created. Consequently I cannot run the gui or edit the file. I have seen a lot of posts about this and many people say "Save As" should just work which is strange because it was working for me yesterday too. Does anyone know the reason why sometimes GUIDE does not automatically generate an m file?
The two files MUST have the same name. See the documentation here: http://www.mathworks.com/help/matlab/creating_guis/files-generated-by-guide.html
Further more, I can't find specific examples in the documentation, but there seems to be a common issue with Callbacks and UI property names getting a little messed up. The best bet is of course is to not touch the file names (or create the GUI programmatically) but now that the damage is done, I would reccommend:
Making sure both files have the same name
Checking all button callbacks to make sure they point to the right file
Checking the tag of all your graphics objects to make sure they are the sames
Double check in your GUIDE options that it is still set to generate an mfile ( Tools > Gui options > Create m file )
Best of luck, GUIDE can be good, but is very far from perfect. (especially in times like now)