maintenance

What to do about a 11000 lines C++ source file?

主宰稳场 提交于 2019-12-29 10:06:01
问题 So we have this huge (is 11000 lines huge?) mainmodule.cpp source file in our project and every time I have to touch it I cringe. As this file is so central and large, it keeps accumulating more and more code and I can't think of a good way to make it actually start to shrink. The file is used and actively changed in several (> 10) maintenance versions of our product and so it is really hard to refactor it. If I were to "simply" split it up, say for a start, into 3 files, then merging back

What to do about a 11000 lines C++ source file?

佐手、 提交于 2019-12-29 10:05:39
问题 So we have this huge (is 11000 lines huge?) mainmodule.cpp source file in our project and every time I have to touch it I cringe. As this file is so central and large, it keeps accumulating more and more code and I can't think of a good way to make it actually start to shrink. The file is used and actively changed in several (> 10) maintenance versions of our product and so it is really hard to refactor it. If I were to "simply" split it up, say for a start, into 3 files, then merging back

ResultSet: Retrieving column values by index versus retrieving by label

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-27 23:39:50
问题 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

ResultSet: Retrieving column values by index versus retrieving by label

我们两清 提交于 2019-12-27 23: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

Using htaccess block access to a range of URLs except for my IP address

旧巷老猫 提交于 2019-12-25 02:55:43
问题 How can I block a range or URL's for all but my IP address. So ... Allow http://mydomain.com/* to all users Block http://mydomain.com/thisdirectoryandallcontents/* to all but my IP I found some code from another site which might work but I don't have the htaccess skills to adapt it Options +FollowSymlinks RewriteEngine on #urls to exclude RewriteCond %{REQUEST_URI} !/url-to-exclude-1$ RewriteCond %{REQUEST_URI} !/url-to-exclude-2$ RewriteCond %{REQUEST_URI} !^/images$ RewriteCond %{REQUEST

Is there a way to visualize an entire SVN repository?

时光怂恿深爱的人放手 提交于 2019-12-23 09:46:27
问题 I have an SVN repository that has multiple projects inside of it, each one of those with a tags/branches/trunk structure under them like this: Project 1 - trunk - tags - branches Project 2 - trunk - tags - branches This goes on for ~40 projects. What I would like to do is clean up any abandoned branches that may exist, however I do not know of a method to visualize the entire repository tree. I would really like to not have to browse through each of the branches manually if I can avoid it.

Sample sql script to zip and transfer database backup file

家住魔仙堡 提交于 2019-12-22 06:06:07
问题 I was looking for a sample sql script to zip my database backup file (.bak) and transfer to a remote location. Please share if you have it with you. 回答1: You can use xp_cmdshell to invoke the commands for zipping and copying. In the sample here, I am using winzip command line (for zipping/unzipping) and xcopy for transferring files. EXEC master..xp_cmdshell 'C:\"Program Files"\WinZip\wzzip C:\Database.bak.zip C:\Database.bak'; EXEC master..xp_cmdshell 'C:\"Program Files"\WinZip\wzunzip -o "C:

Rails: Display Maintenance Page if No Database Connection Available

帅比萌擦擦* 提交于 2019-12-21 22:44:42
问题 I'm looking for a solution that will allow my rails app to render a user-friendly maintenance page when there is no Mysql server available to connect to. Normally a Mysql::Error is thrown from the mysql connection adapter in active_record Something like: /!\ FAILSAFE /!\ Wed May 26 11:40:14 -0700 2010 Status: 500 Internal Server Error Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock Is there a low-overhead way to catch this error and render a maintenance page

Coding Priorities: Performance, Maintainability, Reusability?

自作多情 提交于 2019-12-20 12:39:45
问题 This came about mainly due to answers to SQL questions. UDF's and Sub Queries are intentionally omitted because of performance. I didn't include reliability not that it should be taken for granted, but the code has to work. Does performance always come first? So many answers are provided with performance as the main priority. My users seem to be more concerned with how quickly the code can be modified. So a report takes 15 seconds instead of 12 to run. They can live with that as long as I'm

Is there a way to avoid spaghetti code over the years? [closed]

血红的双手。 提交于 2019-12-20 08:09:51
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I've had several programming jobs. Each one with 20-50 developers, project going on for 3-5 years. Every time it's the same. Some programmers are bright, some are average. Everyone has their CS degree, everyone read design patterns. Intentions are good, people are trying hard