Questions tagged [resource-cleanup]
188 questions
9
votes
1 answer
Are deferred functions called when SIGINT is received in Go?
For the snippet below, the deferred call is not made when ^C is received. Is it possible that the cleanup introduces a race condition? If yes, what could be a better pattern of cleanup on receiving an interrupt?
func fn() {
// some code
…

Andrei
- 93
- 1
- 5
9
votes
2 answers
How to clean up unused resource files in Android Studio
I just completed my android app. I want to clean up the unused layout files and other resource files such as images and drawables and strings which are not referenced in the actual code. How do I do that? Is there any option to do this in Android…

Samuel Robert
- 10,106
- 7
- 39
- 60
9
votes
2 answers
Does NUnit support the concept of an Assembly Teardown?
Does NUnit support the concept of an Assembly Teardown similar to the Microsoft.VisualStudio.TestTools.UnitTesting.AssemblyCleanupAttribute that can be applied to a static method?
This would be run after all the tests within the assembly have…

Rodney S. Foley
- 10,190
- 12
- 48
- 66
9
votes
5 answers
Powershell - "Clear-Item variable:" vs "Remove-Variable"
When storing text temporarily in powershell variables at runtime, what is the most efficient way of removing a variables contents from memory when no longer needed?
I've used both Clear-Item variable: and Remove-Variable but how quickly does…

Graham Gold
- 2,435
- 2
- 25
- 34
8
votes
4 answers
Python's Popen cleanup
I wanted to use a python equivalent to piping some shell commands in perl. Something like the python version of open(PIPE, "command |").
I go to the subprocess module and try this:
p = subprocess.Popen("zgrep thingiwant largefile", shell=True,…

pythonic metaphor
- 10,296
- 18
- 68
- 110
7
votes
2 answers
How to clean up an Android project?
I used source code of an android app that we created in the past as a basis for another app (a lot of the functionality is similar, however about 1/3 of the functionality of the original app is removed).
I started by copying the source tree and…

Aleks G
- 56,435
- 29
- 168
- 265
7
votes
2 answers
What's the difference between `tsc --build --clean` vs. `rm -rf *.js`?
I have a quick question on the tsc command being used with the arguments --build --clean, which I understand is used for cleaning /wiping off the .js files generated earlier by the Transpiler (tsc).
What is the speciality or significance of this…

itsraghz
- 857
- 1
- 11
- 25
7
votes
2 answers
Nexus Repository Manager - removing old binary resources
I wonder if there is a way to delete many items from nexus repository. I have some RAW type repositories with some web application releases(simple tar.bz2
binary files):
In some repositories are a lot of them. I want to free up some disk space. I…

Krzysztof Raciniewski
- 4,735
- 3
- 21
- 42
7
votes
2 answers
how to delete load balancer using gcloud command?
Deleting load balancer from console is easy. Just click on delete icon and wait for the load balancer to disappear.
Is there similar gcloud command to delete load balancer (cascade delete all related frontend, backend, url-map, health check etc.…

Prashant Bhate
- 10,907
- 7
- 47
- 82
6
votes
2 answers
Restoring terminal settings on exit
Using the terminal package, my code basically looks like this:
main :: IO ()
main = withTerminal $ runTerminalT $ do
eraseInDisplay EraseAll
hideCursor
setAutoWrap False
forever $ do
calculate
updateScreen
If the…

Cactus
- 27,075
- 9
- 69
- 149
6
votes
1 answer
Knockout.js Binding On Ajax Driven Pages
Really starting to enjoy KnockoutJs (http://knockoutjs.com). Most of my web apps are ajax driven. The entire site is loaded and then from link to link we just change the body content via ajax calls.
When the ajax returns with new body content I can…

spicer
- 905
- 1
- 8
- 9
5
votes
1 answer
Delete old self-hosted VSTS build agent _work folders
We have a self-hosted TFS build agent which has run out of space so I would like to delete as many of the folders under the agent\_work and agent_dply\_work folders as possible, where they are > 1 month old.
Is this safe to do?
I have found this…

Matt W
- 11,753
- 25
- 118
- 215
5
votes
1 answer
Handling atexit for multiple app objects with Flask dev server reloader
This is yet another flask dev server reloader question. There are a million questions asking why it loads everything twice, and this is not one of them. I understand that it loads everything twice, my question involves dealing with this reality and…

Good Eats
- 333
- 3
- 14
5
votes
2 answers
Try-finally decorator to clean up python object
It seems object cleanup is a pretty common problem I've encountered during my programing days. To date I have consistently used the with statement as recommended here
I had another thought today which seems more elegant to me (because it does not…

Paul Seeb
- 6,006
- 3
- 26
- 38
5
votes
1 answer
How to identify when App gets uninstalled
I want to execute a function when my App gets uninstalled by user.
Using Cordova, Is there a way through which we can detect uninstall event and execute something? for example, to clean up resources.
Thanks

AAhad
- 2,805
- 1
- 25
- 42