maintenance

How do I delete old files from a directory while keeping the most recent ones on Windows [duplicate]

我的未来我决定 提交于 2019-11-27 06:17:21
问题 Possible Duplicate: Batch file to delete files older than N days I want to run a scheduled windows task that deletes all files from a directory that are older than 2 weeks. The reason is that these are IIS and Tomcat logs that fill up my server, but I want to keep the most recent logs in case I need to investigate a problem. Does any one know an easy way to do this? Cheers Nige 回答1: exact syntax: FORFILES /p d:\new /d -30 /m * /c "cmd /c del @file" 回答2: The simplest way would be a .bat run

Listing each branch and its last revision's date in git

陌路散爱 提交于 2019-11-27 05:50:58
I need to delete old and unmaintained branches from our remote repo. I'm trying to find a way with which to list the remote branches by their last modified date, and I can't. Does someone know of an easy way to list remote branches this way? VonC commandlinefu has 2 interesting propositions: for k in `git branch | perl -pe s/^..//`; do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- | head -n 1`\\t$k; done | sort -r or: for k in `git branch | sed s/^..//`; do echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k --`\\t"$k";done | sort That is for local

Visual Studio setup problem - 'A problem has been encountered while loading the setup components. Canceling setup.'

百般思念 提交于 2019-11-27 05:01:59
问题 I've had a serious issue with my Visual Studio 2008 setup. I receive the ever-so-useful error 'A problem has been encountered while loading the setup components. Canceling setup.' whenever I try to uninstall, reinstall or repair Visual Studio 2008 (team system version). If I can't resolve this issue I have no choice but to completely wipe my computer and start again which will take all day long! I've recently received very strange errors when trying to build projects regarding components

ResultSet: Retrieving column values by index versus retrieving by label

一个人想着一个人 提交于 2019-11-27 01:39:28
When using JDBC, I often come across constructs like ResultSet rs = ps.executeQuery(); while (rs.next()) { int id = rs.getInt(1); // Some other actions } I asked myself (and authors of code too) why not to use labels for retrieving column values: int id = rs.getInt("CUSTOMER_ID"); The best explanation I've heard is something concerning performance. But actually, does it make processing extremely fast? I don't believe so, though I have never performed measurements. Even if retrieving by label would be a bit slower, nevertheless, it provide better readability and flexibility, in my opinion. So

Managing highly repetitive code and documentation in Java

。_饼干妹妹 提交于 2019-11-26 12:02:06
问题 Highly repetitive code is generally a bad thing, and there are design patterns that can help minimize this. However, sometimes it\'s simply inevitable due to the constraints of the language itself. Take the following example from java.util.Arrays : /** * Assigns the specified long value to each element of the specified * range of the specified array of longs. The range to be filled * extends from index <tt>fromIndex</tt>, inclusive, to index * <tt>toIndex</tt>, exclusive. (If <tt>fromIndex=

Listing each branch and its last revision&#39;s date in Git

可紊 提交于 2019-11-26 11:45:51
问题 I need to delete old and unmaintained branches from our remote repository. I\'m trying to find a way with which to list the remote branches by their last modified date, and I can\'t. Is there an easy way to list remote branches this way? 回答1: commandlinefu has 2 interesting propositions: for k in `git branch | perl -pe s/^..//`; do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k -- | head -n 1`\\t$k; done | sort -r or: for k in `git branch | sed s/^..//`; do echo -e `git

How does one decompile and recompile a database application?

偶尔善良 提交于 2019-11-25 21:52:57
问题 I have an Access database application and I would like to know the proper way of decompiling and recompiling it. 回答1: The accepted answer is great, but it's a little impractical to create a shortcut for every database. You can save this as a powershell module. #for use with MSAccess 2010 Function Decompile-AccessDB{ param ([string]$dbFileName) [string]$argument = '"' + $dbFileName + '"' + "/Decompile" Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE'