clean-up

Groovy - Cleaning up functions

Hi guys, I have a gross looking function and am wanting to clean it up. All it contains is some maps, a for loop, and if statements. Basically I have a map that I would like to grab only certain information from but one of the keys that I need from it changes by one number in each map. I was thinking maybe a simple switch statement or...

Theory on C++ convention regarding cleanup of the heap, a suggested build, is it good practice?

Hi everyone! <-- Rookie C++ here again ^^ I have another theory question , as the title suggested it's to evaluate a build of code. Basically I'm considering using this template everywhere. I am using VC++ VS2008 (all included) Stapel.h class Stapel { public: //local vars int x; private: public: Stapel(); Stapel(...

Use Dispose() or finalizer to clean up managed threads?

Suppose I have a message pump class in C++0x like the following (note, SynchronizedQueue is a queue of function<void()> and when you call receive() on the queue and it is empty, it blocks the calling thread until there is an item to return): class MessagePump { private: bool done_; Thread* thread_; SynchronizedQueue queue_;...

How do I clean Windows 7 from duplicate (Tomcat 6) services which seem to strangely shadow each other irregularly?

I'm experiencing something rather strange: I had to reinstall Tomcat 6 on my local Windows 7 machine. In sys control, there was no entry to uninstall, so I seem to have installed it by ZIP only. I just deleted all files. I then downloaded the installer for Tomcat 6 and installed into the same directory as before, WITH service. The inst...

Is there a visual studio add-in that can check if CSS classes/id's are not in use across the solution?

Just as the title states. If not, any good web services you've used to cleanup bloated stylesheets? ...

"Cosmetic" clean-up of old, unknown code. Which steps, which order? How invasive?

When I receive code I have not seen before to refactor it into some sane state, I normally fix "cosmetic" things (like converting StringTokenizers to String#split(), replacing pre-1.2 collections by newer collections, making fields final, converting C-style arrays to Java-style arrays, ...) while reading the source code I have to get fa...

C# Console application - How to tell when an application is closing?

Hi, So i have a program that needs to do some cleanup before it exits, even if it is a forced exit. I know, hitting the power button is a forced exit where no cleanup can happen, but that would cause other, bigger issues too. The Program hooks into a number of events to take care of the cleanup. My issue is that this does not work prop...

parse text with Matlab

I have a text file (output from an old program) that I'd like to clean. Here's an example of the file contents. *|V|0|0|0|t|0|1|1|4|11|T4|H01|||||||||||||||||||||| P|40|0.01|10|1|1|0|40|1|1|1||1|*||0|0|0|||||||||||||||| *|A1|A1|A7|A16|F|F|F|F|F|F|F||||||||||||||||||||||| *|||||kV|kV|kV|MW|MVAR|S|S|||||||||||||||||||||||| N|I|01|H0...

Do native method reference have to be disposed - and if so are there any recommended practices to do so

I have a class which uses a method in user32.dll: [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern bool SetForegroundWindow(IntPtr windowHandlerPtr); According to Effective C#, should all classes which uses unmanaged code implement both IDisposable and a finalizer. Without going into the details in that d...

PHP - Cleanup the Junk

I have inherited a very messy project. There are at least 3 versions that I can tell in it. Is there a utility that can trace the PHP code from the main index.php so that I can figure out what isn't being used and what is, or am I stuck doing a manual cleanup? Thanks *Update* I don't think I've been clear about what I'm looking fo...

How to detect useless Delphi units in the interface and implementation uses clauses?

Possible Duplicate: How can I identify and get rid of unused units in the uses clause in Delphi 7 ? Is there a wizard/tool to automatically detect all useless units? If in the current unit I "use classes" but in practice I don't need it I can of course manually remove Classes. But how can I do this automatically for all units...

Clean up .net project folders before performing backup

I want to do a backup of my Projects folder. It mostly contains sub-folders for .NET projects (VS2005, VS08, and VS10). What should I delete before doing a backup (e.g. TestResults, bin, obj); if there is something I shouldn't delete but should ignore, what might that be; and, most importantly, how best to automate the whole process (I...

Are the texture buffers flushed when an OpenGL ES (iPhone) context gets deallocated?

Or I have to glDeleteTextures, glDeleteTextures one by one them? Or is there some kind of glDeleteAllTextures like function? ...