Search Results

Search found 17716 results on 709 pages for 'bad pool header'.

Page 12/709 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Best/Bad practices for code sharing?

    - by sunpech
    The more I explore Github, the more I like it. I really enjoy how coding is becoming more social. I'm curious as to if there are any bad practices that programmers should avoid in sharing their code with each other. And in naming bad practices, what are the best practices for code sharing? For example: Is it a bad practice for a single repo to have multiple scripts/projects named 'MiscProjects'? Where this repo, as the name suggest, is a collection of miscellaneous small scripts and projects. This may resemble how a programmer organizes projects on his/her local storage, but it's possibly not optimal for code sharing? Maybe if a good README/documentation is done, it would be better? Or as long as it's well documented, anything goes?

    Read the article

  • Even EA's Have Bad Days - it's Time to Reset

    - by Pat Shepherd
    I saw this article and thought I'd share it because, even we EA's have bad days and the 7 points listed are a great way for you to hit the "reset" button. From Geoffrey James on INC.COM, here are 7 ways to change your view of things when, say, you are hitting a frustration point coordinating stakeholders to agree on an approach (never happens, right?) Positive Thinking: 7 Easy Ways to Improve a Bad Day http://www.inc.com/geoffrey-james/positive-thinking-7-easy-ways-to-improve-a-bad-day.html To paraphrase:          You can decide (in an instant) to change patterns of the past          Believe in (or even visualize) good things happening, and they will          Keep a healthy perspective on the work-life / life-life continuum (what things REALLY matter in the big scheme of things)                  Focus on the good (the laws of positive-attraction apply)

    Read the article

  • Robots.txt and "Bad" Robots

    - by Lynda
    I understand robots.txt and its purpose. I have read some people saying that using a Robots.txt gives "bad" robots or robots who do not obey a robots.txt a way to access pages on your site that you do not want accessed. While I am not looking to get into a debate about that I do have a question: If I have a structure like this: /Folder/ /Sub-Folder 1/ /Sub-Folder 2/ (Note: There are no pages within /Folder/ only other folders.) If I Disallow: /Folder/ it will prevent "good" robots from accessing the directory and any contents within the sub-folders. While we know that bad robots will see the /Folder/ will they be able to see and acess the sub-folders and the pages within the subfolders if they are not listed in the robots.txt? (Note: I do not fully understand how robots good or bad crawl a site beyond using a robots.txt and links within the site.)

    Read the article

  • how to ask questions about bad practices in stackoverflow ( or other technical forums) [migrated]

    - by Nahum Litvin
    I had a case when I needed to do something in code that I knew is a bad practice. but because of a unique situation and after considering the risks thoroughly decided that is worth it. I cannot start explaining all my considerations that include buisness secrets over the internet but I do need technical assistance. when I tried to ask at SA I got heated responses why it is a bad practice instead of answeres to how to do this. poeple are so conserned about what is the right way to write code that they forget that there are other considerations as well. can anyone provide insight of how to correctly ask such a question in order to avoid "this is a bad practice" answers and get real answers?

    Read the article

  • Bad Bot blocking Revisited

    - by Tom
    I've read a lot about bad bot blocking, php scripts, .htaccess techniques, etc... Is this a valid method? Since .htacces can rewrite and send a bad bot a 403 deny or forward to something like spam poison, is it possible to Disallow a folder, then through .htaccess in that specific folder redirect to spampoison? Since Apache reads each .htaccess independently and follows specific instructions, then a bad bot not following robots.txt would just be redirected. Or anyone trying to access, /badbot/ or whatever I choose to call my trap folder. Thanks Tom

    Read the article

  • Silverlight 4 enables Authorization header modification

    A little bit of hidden gem in the Silverlight 4 release is the ability to modify the Authorization header in network calls. For most, the sheer ability to leverage network credentials in the networking stack will be enough. But there are times when you may be working with an API that requires something other than basic authentication, but uses the Authorization HTTP header. The Details Basically you just set the header value. Hows that for details :-). Seriously though, heres a snippet of code:...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • IIS application pool failed to respond to ping

    - by Zimmy-DUB-Zongy-Zong-DUBBY
    I have been investigating a problem that occurred on a Windows 2003 server a few days ago. there are about 15 app pools, and within a few minutes, they all produced the error below in the system log: A process serving application pool 'Pool 31x' failed to respond to a ping. The process id was '7144'. The pools were then restarted automatically, but timed out during startup, leaving all sites down. My question is: what would cause a "ping timeout" to all of the app pools around the same time, and then why would they start up too slowly? The app in each pool is a WCMS which uses the .NET 1.1 framework. It connects to a remote DB but is otherwise independent of other machines.

    Read the article

  • Configuring jdbc-pool (tomcat 7)

    - by john
    i'm having some problems with tomcat 7 for configuring jdbc-pool : i`ve tried to follow this example: http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency so i have: conf/server.xml <GlobalNamingResources> <Resource type="javax.sql.DataSource" name="jdbc/DB" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/mydb" username="user" password="password" /> </GlobalNamingResources> conf/context.xml <Context> <ResourceLink type="javax.sql.DataSource" name="jdbc/LocalDB" global="jdbc/DB" /> <Context> and when i try to do this: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup("java:/comp/env"); DataSource datasource = (DataSource)envContext.lookup("jdbc/LocalDB"); Connection con = datasource.getConnection(); i keep getting this error: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:803) at org.apache.naming.NamingContext.lookup(NamingContext.java:159) pls help tnx

    Read the article

  • Override Expires header for proxied content in Apache

    - by Jochen
    Hi, I am serving proxied content with Apache that already contains an Expires header. Using mod_expires' ExpireDefault to override the already present Expires header does not work, the old header is left untouched. Is there another way to override the Expires header? I tried using mod_headers, but it seems I cannot do date calculation there. I also must override the Expires header, I cannot use Cache-Control with max-age for this. Regards, Jochen

    Read the article

  • 500 Error when using custom account for application pool in IIS 7

    - by Brownie
    I have a very simple site with only static files in IIS 7 on Windows Server 2008 SP2. When I try to access any static file I get a 500 error. If I rename an html file to have an aspx extension it works fine. The site also works fine when using the built in identity for the application pool. The problem occurs when I switch to using a custom account for the application pool. I have tried using both local and domain accounts to run the application pool under. I have given full control to these accounts on the website directory and files. Turning on tracing reveals this error message: ModuleName: IIS Web Core Notification: 2 HttpStatus: 500 HttpReason: Internal Server Error HttpSubStatus: 0 ErrorCode: 2147943746 ConfigExceptionInfo Notification: AUTHENTICATE_REQUEST ErrorCode: Either a required impersonation level was not provided, or the provided impersonation level is invalid. (0x80070542) I have not had any luck with googling the error code.

    Read the article

  • dhcpd pool exhaustion - What's the result?

    - by jarmund
    I have a DHCP server that serves leases to several houndred, maybe up to a thousand, different clients on an average day. The pool consists of 242 IPs, and due to the highly dynamic nature of the network, it's enough 99% of the time (most devices are gone from the network in a few minutes), despite having a lease time of 3600. Now, imagine if more clients than that connect to the network during an hour. The sollution is obvious: Decrease lease time, or increase the DHCP pool, however, what i would like to know: What happens when dhcpd has exhausted the pool? Are new DHCP requests simply ignored?

    Read the article

  • Running my web site in a 32-bit application pool on a 64-bit OS.

    - by Jeremy H
    Here is my setup: Dev: - Windows Server 2008 64-bit - Visual Studio 2008 - Solution with 3 class libraries, 1 web application Staging Web Server: - Windows Server 2008 R2 64-bit - IIS7.5 Integrated Application Pool with 32-bit Applications Enabled In Visual Studio I have set all 4 of my projects to compile to 'Any CPU' but when I run this web application on the web server with the 32-bit application pool it times out and crashes. When I run the application pool in 64-bit mode it works fine. The production web server requires me to run 32-bit application pool in 64-bit OS which is why I have this configured in this way on the staging web server. (I considered posting on ServerFault but the server part seems to be working fine. It is my code specifically that doesn't seem to want to run in 32-bit application pool which is why I am posting here.)

    Read the article

  • C header file won't compile with C, but will with C++.

    - by Leif Andersen
    I have the following chunk of a header file BKE_mesh.h: /* Connectivity data */ typedef struct IndexNode { struct IndexNode *next, *prev; int index; } IndexNode; void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *mface, const int totvert, const int totface); void create_vert_edge_map(ListBase **map, IndexNode **mem, const struct MEdge *medge, const int totvert, const int totedge); Note that the header file was prepared for the possibility of being used in a C++ file, as it had: #ifdef __cplusplus extern "C" { #endif at the top of the file, and the needed finish at the bottom. But the class implementing it was written in C. Next, whenever I try to #include the header file, I get an odd error. If the file has a .cpp extension, it compiles just fine, no complaints whatsoever. However, if I do: #include "BKE_mesh.h" inside of a file with a .c extension, I get the following errors: expected ')' before '*' token for the two last functions, in specific, the variable: ListBase **map in both classes. (Note that earlier in the header file, it declared, but not defined ListBase). So, my question is: why is this valid C++ code, but not C code? Thank you.

    Read the article

  • Weblogic 10.3.0 : Loosing a stateless session bean in the bean pool

    - by KlasE
    Hi, We have a strange situation where we loose a Stateless SessionBean in a Bean Pool in Weblogic 10.3.0 Since we only have one bean in the pool, this effectively hangs all incoming calls. We do not want more than one instance in the pool because of application restrictions. In the Weblogic admin console, we can see that there are 1 instance in the bean pool, 0 beans in use and 1 waiting incoming request. The question is, what can have caused the system to not send the request to the one obviously free bean instance? This happens after several hours and over 100000 incoming requests, and the same scenario worked fine in the old weblogic 8 environment. We get the following stacktrace: "[ACTIVE] ExecuteThread: '5' for queue: 'weblogic.kernel.Default (self-tuning)'" waiting for lock java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject@b0d484 TIMED_WAITING sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2054) weblogic.ejb.container.pool.StatelessSessionPool.waitForBean(StatelessSessionPool.java:269) weblogic.ejb.container.pool.StatelessSessionPool.getBean(StatelessSessionPool.java:111) weblogic.ejb.container.manager.StatelessManager.preInvoke(StatelessManager.java:148) weblogic.ejb.container.internal.BaseRemoteObject.preInvoke(BaseRemoteObject.java:227) weblogic.ejb.container.internal.StatelessRemoteObject.preInvoke(StatelessRemoteObject.java:52) com.mycompany.beans.MessageLogFacace_n73y0z_EOImpl.isMyStuffValid(MessageLogFacace_n73y0z_EOImpl.java:261) com.mycompany.beans.MessageLogFacace_n73y0z_EOImpl_WLSkel.invoke(Unknown Source) weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589) weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230) weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477) weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363) weblogic.security.service.SecurityManager.runAs(Unknown Source) weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473) weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118) weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) weblogic.work.ExecuteThread.run(ExecuteThread.java:173) Any help would be very welcome. Regards Klas

    Read the article

  • How do I copy the layout from a header of a JTabbedPane onto a JPanel?

    - by Snail
    I have created a "CollapsingPanel"class/sort of a JTabbedPane (code skeleton can be found at http://www.coderanch.com/t/341737/Swing-AWT-SWT-JFace/java/Expand-Collapse-Panels). It is in other words a lot of headers which you click on to show a hidden Panel. At the moment these header-panels are a rectangular box with a LineBorder around them. That is ugly! I'm wondering if there is a way to copy the layout that the JTabbedPane uses for its headers/titles (which is inhierted from Look&Feel I assume) and use it on my JPanel-based headers? So that my headers get a smooth look which is in line with the rest of the program (based on Look&Feel!) instead of looking like alien flat blocks. Illustrated below with the headers nicely circled in green ;) I want to apply the header-look from 2nd picture over the red header JPanel in picture 1: Picture 1: hxxp://img7.imageshack.us/img7/2319/34158982.png - change to http, I got <10 rep :( Pictrue 2: hxxp://img46.imageshack.us/img46/2572/jtabpane.png

    Read the article

  • Haproxy not properly passing on X-Forwarded-For header

    - by JesseP
    I have backend web servers that receive requests by way of haproxy-nginx-fastcgi. The web app used to see multiple ip's coming through in the X-Forwarded-For header, chained together with commas (most original IP on the left). At some point in the recent past (just noticed, so not sure what caused it) something changed, and now I'm only seeing a single IP passed in the header to my web application. I've tried with haproxy 1.4.21 and 1.4.22 (recent upgrade) with the same behavior. Haproxy has the forwardfor header set: option forwardfor Nginx fastcgi_params config defines this header to be passed to the app: fastcgi_param HTTP_X_FORWARDED_FOR $http_x_forwarded_for; Anyone have any ideas on what might be going wrong here? EDIT: I just started logging the $http_x_forwarded_for variable in nginx logs, and nginx is only ever seeing a single IP, which shouldn't ever be the case, as we should always see our haproxy ip added in there, right? So, issue must either be in nginx handling of the variable coming in, or haproxy not building it properly. I'll keep digging... EDIT #2: I enabled request and response header logging in HAProxy, and it is not spitting anything out for X-Forwarded-For, which seems very odd: Oct 10 10:49:01 newark-lb1 haproxy[19989]: 66.87.95.74:47497 [10/Oct/2012:10:49:01.467] http service/newark2 0/0/0/16/40 301 574 - - ---- 4/4/3/0/0 0/0 {} {} "GET /2zi HTTP/1.1" O Here are the options i set for this in my frontend: mode http option httplog capture request header X-Forwarded-For len 25 capture response header X-Forwarded-For len 25 option httpclose option forwardfor EDIT #3: It really seems like haproxy is munging the header and just passing on a single one to the backend. This is fairly impacting to our production service, so if anyone has an ideas it would be greatly appreciated. I'm stumped... :(

    Read the article

  • How to set response header in JAX-RS so that user sees download popup for Excel?

    - by masato-san
    I wrote code that generate Excel file using REST JAX-RS and I confirmed that the generated Excel file is in GlassFish server directory. But my goal is when user click on the button (which generate Excel .xls), I want download popup to show up asking user whether to save or open the .xls file just like any other web services doing for downloading any type of files. According to my search, the step is: generate Excel .xls (DONE) write the excel to stream in JAX-RS file, set response header to something like, String fileName = "Blah_Report.xls"; response.setHeader("Content-Disposition", "attachment; filename=" + fileName); My question is I'm doing all of this in JAX-RS file and I don't have HttpServletResponse object available. According to the answer from Add Response Header to JAX-RS Webservice He says: You can inject a reference to the actual HttpServletResponse via the @Context annotation in your webservice and use addHeader() etc. to add your header. I can't really figure what exactly that means without sample code..

    Read the article

  • Correct use of SMTP "Sender" header?

    - by Eric Rath
    Our web application sends email messages to people when someone posts new content. Both sender and recipient have opted into receiving email messages from our application. When preparing such a message, we set the following SMTP headers: FROM: [email protected] TO: [email protected] SENDER: [email protected] We chose to use the author's email address in the FROM header in an attempt to provide the best experience for the recipient; when they see the message in their mail client, the author is clear. To avoid the appearance of spoofing, we added the SENDER header (with our own company email address) to make it clear that we sent the message on the author's behalf. After reading RFCs 822 and 2822, this seems to be an intended use of the sender header. Most receiving mail servers seem to handle this well; the email message is delivered normally (assuming the recipient mailbox exists, is not over quota, etc). However, when sending a message FROM an address in a domain TO an address in the same domain, some receiving domains reject the messages with a response like: 571 incorrect IP - psmtp (in reply to RCPT TO command) I think this means the receiving server only saw that the FROM header address was in its own domain, and that the message originated from a server it didn't consider authorized to send messages for that domain. In other words, the receiving server ignored the SENDER header. We have a workaround in place: the webapp keeps a list of such domains that seem to ignore the SENDER header, and when the FROM and TO headers are both in such a domain, it sets the FROM header to our own email address instead. But this list requires maintenance. Is there a better way to achieve the desired experience? We'd like to be a "good citizen" of the net, and all parties involved -- senders and recipients -- want to participate and receive these messages. One alternative is to always use our company email address in the FROM header, and prepend the author's name/address to the subject, but this seems a little clumsy.

    Read the article

  • How to make g++ search for header files in a specific directory?

    - by Bane
    I have a project that is subdivided into a few directories with code in them. I'd like to to have g++ search for header files in the project's root directory, so I can avoid different include paths for same header files across multiple source files. Mainly, the root/ directory has sub-directories A/, B/ and C/, all of which have .hpp and .cpp files inside. If some source file in A wanted to include file.hpp, which was in B, it would have to do it like this: #include "../B/file.hpp". Same for another source file that was in C. But, if A itself had sub-directories with files that needed file.hpp, then, it would be inconsistent and would cause errors if I decided to move files (because the include path would be "../../B/file.hpp"). Also, this would need to work from other projects as well, which reside outside of root/. I already know that there is an option to manually copy all my header files into a default-search directory, but I'd like to do this the way I described.

    Read the article

  • Correct use of SMTP "Sender" header?

    - by Eric Rath
    Our web application sends email messages to people when someone posts new content. Both sender and recipient have opted into receiving email messages from our application. When preparing such a message, we set the following SMTP headers: FROM: [email protected] TO: [email protected] SENDER: [email protected] We chose to use the author's email address in the FROM header in an attempt to provide the best experience for the recipient; when they see the message in their mail client, the author is clear. To avoid the appearance of spoofing, we added the SENDER header (with our own company email address) to make it clear that we sent the message on the author's behalf. After reading RFCs 822 and 2822, this seems to be an intended use of the sender header. Most receiving mail servers seem to handle this well; the email message is delivered normally (assuming the recipient mailbox exists, is not over quota, etc). However, when sending a message FROM an address in a domain TO an address in the same domain, some receiving domains reject the messages with a response like: 571 incorrect IP - psmtp (in reply to RCPT TO command) I think this means the receiving server only saw that the FROM header address was in its own domain, and that the message originated from a server it didn't consider authorized to send messages for that domain. In other words, the receiving server ignored the SENDER header. We have a workaround in place: the webapp keeps a list of such domains that seem to ignore the SENDER header, and when the FROM and TO headers are both in such a domain, it sets the FROM header to our own email address instead. But this list requires maintenance. Is there a better way to achieve the desired experience? We'd like to be a "good citizen" of the net, and all parties involved -- senders and recipients -- want to participate and receive these messages. One alternative is to always use our company email address in the FROM header, and prepend the author's name/address to the subject, but this seems a little clumsy.

    Read the article

  • SQL SERVER – Data Pages in Buffer Pool – Data Stored in Memory Cache

    - by pinaldave
    This will drop all the clean buffers so we will be able to start again from there. Now, run the following script and check the execution plan of the query. Have you ever wondered what types of data are there in your cache? During SQL Server Trainings, I am usually asked if there is any way one can know how much data in a table is stored in the memory cache? The more detailed question I usually get is if there are multiple indexes on table (and used in a query), were the data of the single table stored multiple times in the memory cache or only for a single time? Here is a query you can run to figure out what kind of data is stored in the cache. USE AdventureWorks GO SELECT COUNT(*) AS cached_pages_count, name AS BaseTableName, IndexName, IndexTypeDesc FROM sys.dm_os_buffer_descriptors AS bd INNER JOIN ( SELECT s_obj.name, s_obj.index_id, s_obj.allocation_unit_id, s_obj.OBJECT_ID, i.name IndexName, i.type_desc IndexTypeDesc FROM ( SELECT OBJECT_NAME(OBJECT_ID) AS name, index_id ,allocation_unit_id, OBJECT_ID FROM sys.allocation_units AS au INNER JOIN sys.partitions AS p ON au.container_id = p.hobt_id AND (au.type = 1 OR au.type = 3) UNION ALL SELECT OBJECT_NAME(OBJECT_ID) AS name, index_id, allocation_unit_id, OBJECT_ID FROM sys.allocation_units AS au INNER JOIN sys.partitions AS p ON au.container_id = p.partition_id AND au.type = 2 ) AS s_obj LEFT JOIN sys.indexes i ON i.index_id = s_obj.index_id AND i.OBJECT_ID = s_obj.OBJECT_ID ) AS obj ON bd.allocation_unit_id = obj.allocation_unit_id WHERE database_id = DB_ID() GROUP BY name, index_id, IndexName, IndexTypeDesc ORDER BY cached_pages_count DESC; GO Now let us run the query above and observe the output of the same. We can see in the above query that there are four columns. Cached_Pages_Count lists the pages cached in the memory. BaseTableName lists the original base table from which data pages are cached. IndexName lists the name of the index from which pages are cached. IndexTypeDesc lists the type of index. Now, let us do one more experience here. Please note that you should not run this test on a production server as it can extremely reduce the performance of the database. DBCC DROPCLEANBUFFERS This will drop all the clean buffers and we will be able to start again from there. Now run following script and check the execution plan for the same. USE AdventureWorks GO SELECT UnitPrice, ModifiedDate FROM Sales.SalesOrderDetail WHERE SalesOrderDetailID BETWEEN 1 AND 100 GO The execution plans contain the usage of two different indexes. Now, let us run the script that checks the pages cached in SQL Server. It will give us the following output. It is clear from the Resultset that when more than one index is used, datapages related to both or all of the indexes are stored in Memory Cache separately. Let me know what you think of this article. I had a great pleasure while writing this article because I was able to write on this subject, which I like the most. In the next article, we will exactly see what data are cached and those that are not cached, using a few undocumented commands. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: DMV, Pinal Dave, SQL, SQL Authority, SQL Optimization, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: SQL DMV

    Read the article

  • Feature (de)activation error “The web or site was not found” and Application Pool

    - by panjkov
    I am using Microsoft IW Demo VM (2010-10A) for my experiments related to SharePoint, in all cases when I don’t have time (read: when I’m lazy) to create complete SharePoint Dev environment. Problem This particular time I was playing around with site-scoped features and newly created site collection. So here is my workflow: Create feature with feature receiver Deploy to Site Collection from Visual Studio using “No Activation” deployment profile Activate feature from “Site Collection Features” interface...(read more)

    Read the article

  • Is commented out code really always bad?

    - by nikie
    Practically every text on code quality I've read agrees that commented out code is a bad thing. The usual example is that someone changed a line of code and left the old line there as a comment, apparently to confuse people who read the code later on. Of course, that's a bad thing. But I often find myself leaving commented out code in another situation: I write a computational-geometry or image processing algorithm. To understand this kind of code, and to find potential bugs in it, it's often very helpful to display intermediate results (e.g. draw a set of points to the screen or save a bitmap file). Looking at these values in the debugger usually means looking at a wall of numbers (coordinates, raw pixel values). Not very helpful. Writing a debugger visualizer every time would be overkill. I don't want to leave the visualization code in the final product (it hurts performance, and usually just confuses the end user), but I don't want to loose it, either. In C++, I can use #ifdef to conditionally compile that code, but I don't see much differnce between this: /* // Debug Visualization: draw set of found interest points for (int i=0; i<count; i++) DrawBox(pts[i].X, pts[i].Y, 5,5); */ and this: #ifdef DEBUG_VISUALIZATION_DRAW_INTEREST_POINTS for (int i=0; i<count; i++) DrawBox(pts[i].X, pts[i].Y, 5,5); #endif So, most of the time, I just leave the visualization code commented out, with a comment saying what is being visualized. When I read the code a year later, I'm usually happy I can just uncomment the visualization code and literally "see what's going on". Should I feel bad about that? Why? Is there a superior solution? Update: S. Lott asks in a comment Are you somehow "over-generalizing" all commented code to include debugging as well as senseless, obsolete code? Why are you making that overly-generalized conclusion? I recently read Robert Glass' "Clean Code", which says: Few practices are as odious as commenting-out code. Don't do this!. I've looked at the paragraph in the book again (p. 68), there's no qualification, no distinction made between different reasons for commenting out code. So I wondered if this rule is over-generalizing (or if I misunderstood the book) or if what I do is bad practice, for some reason I didn't know.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >