Search Results

Search found 5637 results on 226 pages for 'triple slash comments'.

Page 17/226 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • 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

  • Dofollow or Nofollow trackbacks?

    - by Ernesto Marrero
    Trackbacs Dofollow? ¿yes or not? Authoritative sources, Pleasse Thinking about SEO, is it better that they are dofollow trackback or nofollow trackbacks? When I write a post on my blog, I automatically send trackback to my site from http://bitacoras.com. The above link is dofollow. Is it advisable to give relevance to this link in also handling dofollow link? For example any domain. on the homepage has pagerank 3. This site has a pagerank 0 of the internal page that I send trackbacks to. Is it convenient to send dofollow links to that page to increase the pagerank? Will they increase my pagerank if I perform this operation?

    Read the article

  • SEO. dofollow trackback or nofollow trackback?

    - by Ernesto Marrero
    Thinking about SEO. It is better that they are dofollow trackback or nofollow trackback? When I write a post on my blog and automatically sends trackback to my site from http://bitacoras.com. The above link is dofollow. Is it advisable to give relevance to this link I also handing dofollow link? For example any domain. on the homepage has pagerank 3. This site has a pagerank 0 internal page that I send trackbacks. It is convenient to send dofollow link to that page to increase your pagerank. Increase my pagerank if I perform this operation ?works well ? Please appreciated.any reference in writing .

    Read the article

  • Commenting Code AS3 - Not being an API

    - by Marcelo Noronha
    How should I comment a method? What are the best practices on commenting code? Example: /* Checks if a color is allowed in a given point * of the bitmapdata of the current floor * @param value - color to be checked * @return boolean - if color is allowed returns true, else, return false */ private function isAllowed(value:uint):Boolean { //code... } Is that the best way to comment a method? I´ve heard there´s the use of the tag @see. What should be on this tag? I wonder if it could be something that has a relation to the method, is that right? Thanks.

    Read the article

  • Should one comment differently in functional languages

    - by Tom Squires
    I'm just getting started with functional programming and I'm wondering the correct way to comment my code. It seems a little redundant to comment a short function as the names and signature already should tell you everything you need to know. Commenting larger functions also seems a little redundant since they are generally comprised of smaller self-descriptive functions. What is the correct way to comment a functional program? Should I use the same approach as in iterative programming?

    Read the article

  • Static pages for large photo album

    - by Phil P
    I'm looking for advice on software for managing a largish photo album for a website. 2000+ pictures, one-time drop (probably). I normally use MarginalHack's album, which does what I want: pre-generate thumbnails and HTML for the pictures, so I can serve without needing a dynamic run-time, so there's less attack surface to worry about. However, it doesn't handle pagination or the like, so it's unwieldy for this case. This is a one-time drop for pictures from a wedding, with a shared usercode/password for distribution to the guests; I don't wish to put the pictures in a third-party hosting environment. I don't wish to use PHP, simply because that's another run-time to worry about, I might relent and use something dynamic if it's Python or Perl based (as I can maintain things written in those). I currently have: Apache serving static files, Album-generated, some sub-directories to divide up the content to be a little more manageable. Something like Album but with pagination already handled would be great, but I'm willing to have something a little more dynamic, if it lets people comment or caption and store the extra data in something like an sqlite DB. I'd want something light-weight, not a full-blown CMS with security updates every three months. I don't want to upload pictures of other peoples' children into a third-party free service where I don't know what the revenue model is. (For my site: revenue is none, costs out of pocket). Existing server hosting is *nix, Apache, some WSGI. Client-side I have MacOS. Any advice?

    Read the article

  • Commenting/In-Code Documentation Styles

    - by Maxpm
    This might be a stupid question, but it's been in the back of my head for a while and I can't find a decent answer anywhere else. I have a teacher who says we should explicitly list each parameter with a description, even if there's only one. This leads to a lot of repetition: double MyFunction(const int MyParam); // Function: MyFunction // Summary: Does stuff with MyParam. // Input: int MyParam - The number to do stuff with. // Output: MyParam with stuff done to it. When writing in-code documentation, how detailed are you?

    Read the article

  • Is it a good practice by commenting with owner name? [closed]

    - by fifth
    Possible Duplicate: How do you keep track of the authors of code? Here's several scenarios which may comment with owner name: bug fixing, i.e. // fixed bug 123 by xxx, solution is ... ... fixme/todo tags, i.e. // TODO: .... by xxx. hacks, i.e. // HACK! ... by xxx For case #2, please refer to Comment Tags The obvious advantage is that we can ease tracking by names. The downside is the risk of abuse. Actually my previous company allowed this way of commenting style, but current employer completely disallows names appearing in code. In my opinion, I would vote for discreetly commenting with author names. I'm open to hear from you if this commenting style is good or bad. Thanks.

    Read the article

  • Algorithm to calculate a page importance based on its views / comments

    - by stacker
    I need an algorithm that allows me to determine an appropriate <priority> field for my website's sitemap based on the page's views and comments count. For those of you unfamiliar with sitemaps, the priority field is used to signal the importance of a page relative to the others on the same website. It must be a decimal number between 0 and 1. The algorithm will accept two parameters, viewCount and commentCount, and will return the priority value. For example: GetPriority(100000, 100000); // Damn, a lot of views/comments! The returned value will be very close to 1, for example 0.995 GetPriority(3, 2); // Ok not many users are interested in this page, so for example it will return 0.082

    Read the article

  • Facebook API - Get comments

    - by Simon R
    Our business has a Facebook Fan Page. The fan page doesn't seem to generate any emails to us when updates are made to the page, whether someone adds a new status or someone comments on one of the statuses etc. Currently, we are running a very crude script to grab the content of the page and then use regular expressions to get the information we require. Obviously this is not fool proof and I'm looking into alternatives to this method. I've been looking at the facebook API and wonder if the rest server might be an option. I cannot, however, seem to find out how to return information of fan page statuses and their comments. Is anyone able to direct me how to use the API to retrieve this information. I am an admin of the fan page. The programming language I'm using is PHP. Many thanks.

    Read the article

  • All comments get marked as spam regardless (Wordpress MU)

    - by meds
    Everyone (besides me) who comments on another persons blog gets marked as spam when they comment on other peoples blogs. When they comment on their own its fine. Might be related, I've installed reCaptcha and have disabled it for logged in users yet everyone who is logged in still sees it, I don't, and incidentally my comments don't get marked as spam. I don't have akismet or hashcash or any other form of spam filtering turned out (with the exception of super captcha for registration). Any idea what's wrong or where I should look first?

    Read the article

  • Getting a summary of comments in Jira

    - by Ross Alexander
    I currently maintain a Jira system at work and I have been tasked with a rather strange request which is too find a way of 'making a summary of a comment'. In the ideal situation this would allow a user to write a comment and a quick summary however I doubt this is something available in Jira / something that is feasible. Alternatively a summary of all comments would be nice that will allow our technical writers a way to clarify fixes through the information in the comments. If any one out there has ANY suggestions or ideas on this they are most welcome :) Sorry if this question is slightly general but I cannot find any thing that remotely helps on google, wondering if any Jira experts can push me in the right direction. Thanks

    Read the article

  • Read line comments in INI file

    - by Dave Jarvis
    The parse_ini_file function removes comments in configuration files. What would you do to keep the comments that are associated with the next line? For example: [email] ; Verify that the email's domain has a mail exchange (MX) record. validate_domain = true Am thinking of using X(HT)ML and XSLT to transform the content into an INI file (so that the documentation and options can be single sourced). For example: <h1>email</h1> <p>Verify that the email's domain has a mail exchange (MX) record.</p> <dl> <dt>validate_domain</dt> <dd>true</dd> </dl> Any other ideas?

    Read the article

  • Voting UI for showing like/dislike community comments side-by-side

    - by Justin Grant
    We want to add a comments/reviews feature to our website's plugin gallery, so users can vote up/down a particular plugin and leave an optional short comment about what they liked or didn't like about it. I'm looking for inspiration, ideally a good implementation elsewhere on the web which isn't annoying to end users, isn't impossibly complex to develop, and which enables users to see both good and bad comments side-by-side, like this: Like: 57 votes Dislike: 8 votes --------------------------------- -------------------------------- "great plugin, saved me hours..." "hard to install" "works well on MacOS and Ubuntu" "Broken on Windows Vista with UAC enabled" "integrates well with version 3.2" More... More... Anyone know a site which does something like this?

    Read the article

  • FB Connect JavaScript SDK : Comments Not Working

    - by Mayank
    Hi, I am working on the new API that FB has provided. I tried using FB connect's comment system. I did exactly what is specified in the examples(Or at least I tried to do that). In the code i have used <fb:comments></fb:comments> But when the page is rendered, a iframe appears where My FB page is visible. Sometimes there is nothing! My Test Page Can someone please suggest how can I proceed?

    Read the article

  • Web UI for showing like/dislike community comments side-by-side

    - by Justin Grant
    We want to add a comments/reviews feature to our website's plugin gallery, so users can not only vote up or down a particular plugin, but also leave an optional short comment about what they liked or didn't like about it. I'm looking for inspiration, ideally a good implementation elsewhere on the web which isn't annoying to end users, isn't impossibly complex to develop, and which enables users to see both good and bad comments side-by-side, like this: Like: 57 votes Dislike: 8 votes --------------------------------- -------------------------------- "great plugin, saved me hours..." "hard to install" "works well on MacOS and Ubuntu" "Broken on Windows Vista with UAC enabled" "integrates well with version 3.2" More... More... Anyone know a site which does something like this?

    Read the article

  • Facebook API - Get comments

    - by Simon R
    Our business has a Facebook Fan Page. The fan page doesn't seem to generate any emails to us when updates are made to the page, whether someone adds a new status or someone comments on one of the statuses etc. Currently, we are running a very crude script to grab the content of the page and then use regular expressions to get the information we require. Obviously this is not fool proof and I'm looking into alternatives to this method. I've been looking at the facebook API and wonder if the rest server might be an option. I cannot, however, seem to find out how to return information of fan page statuses and their comments. Is anyone able to direct me how to use the API to retrieve this information. I am an admin of the fan page. The programming language I'm using is PHP. Many thanks.

    Read the article

  • facebook api getting full posts with > 2 comments or > 4 likes

    - by ejang
    when I make the user/feed request on the Facebook Open Graph API, I get a feed object where posts with 2 comments or 4 likes don't reveal the detailed information for those specific comments. I am using https://github.com/Thuzi/facebook-node-sdk to make requests but it is very similar to the 'request' NodeJS library. I can get the full posts individually by making a separate request for that post's Open Graph ID, but this doesn't lend itself to fun code because requests are asynchronous and nesting more asynchronous calls within asynchronous calls doesn't lend itself to fun code. Any way I can obtain the full posts?

    Read the article

  • Is it possible to generate end comments for html

    - by Gandalf StormCrow
    Is it possible to generate comments for closing div tags, lets take this ex. into consideration normal HTML: <div id="content"> ... ...buch of html or whateve </div> with comments : <div id="content"> ... ...buch of html or whateve </div><!--End of content--> and so on go trough each div element and comment the end of it ?

    Read the article

  • Regexp in iOS to find comments

    - by SteveDolphin23
    I am trying to find and process 'java-style' comments within a string in objective-C. I have a few regex snippets which almost work but I am stuck on one hurdle: different options seem to make the different styles work. For example, I am using this to match: NSArray* matches = [[NSRegularExpression regularExpressionWithPattern:expression options:NSRegularExpressionAnchorsMatchLines error:nil] matchesInString:string options:0 range:searchRange]; The options here allow me successfully find and process single line comments (//) but not multiline (/* */), if I change the option to NSRegularExpressionDotMatchesLineSeparators then I can make multiline work fine but I can't find the 'end' of a single line comment. I suppose really I need dot-matches-line-separators but I need a better way of finding the end of a single line comment? The regexp I have so far are: @"/\\*.*?\\*/" @"//.*$" it's clear to see if dot matches a line separator then the second one (single line) never 'finishes' but how do I fix this? I found some suggestions for single line that were more like: @"(\/\/[^"\n\r]*(?:"[^"\n\r]*"[^"\n\r]*)*[\r\n])" But that doesn't' seem to work at all! Thanks in advance for any pointers.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >