commenting

What are The Valid & Readable approaches to Commenting in PHP5?

≡放荡痞女 提交于 2019-12-05 23:29:22
问题 In the past 2 months that I have been learning PHP, I have identified more than two styles people use to comment code! I haven't seen much consistency... which I think usually means artists at work . So I wondered: what are the valid ways to comment which are still readable/practical? Seeing all the valid possibilities in 1 place side by side will provide the overview that I am looking for to improve commenting /* | This is what I now use (5chars/3lines) I name it star*wars \* 回答1: Quoting

.NET // vs /// Comments convention

筅森魡賤 提交于 2019-12-05 10:54:24
问题 I am just checking out F#, so apologies if this is a silly question, but in the VS2008 F# CTP 1.9.6.2 'Tutorial' project, both // and /// are used for commenting code. Is there a functional difference between the two slash vs three slash commenting, or is it convention (as it appears in the tutorial code) to comment a function with /// and use // for everything else? 回答1: Using three slashes (///) is a C# convention for XML Documentation Comments that is adopted by F# as well. 回答2: /// is for

Commenting c++ codes in Vim

梦想与她 提交于 2019-12-04 16:48:13
I want to map \c to comment the current line in vim (add '// ' to before the first non-blank to the line) and \d to delete the '// ' at the beginning of line(uncomment). I've added these two lines in my vimrc: imap \c <Esc>:s/^/\/\/ <CR>j$a imap \d <Esc>:s/^\/\/ /<CR>j$a but when I call this in this line: for (int i = 0; i < n; i++) then it is converted to: // for (int i = 0; i < n; i++) but I want to convert it to: // for (int i = 0; i < n; i++) one of the reasons I want this is that when I want vim to indent this line, it will add an extra tab at the beginning of the line and convert it to:

getting notification when someone comments using comments plugin

别等时光非礼了梦想. 提交于 2019-12-04 12:39:25
So I have an iFrame app on a fan page, which includes the comments plugin. Is there a way I/any admin can receive a notification or email every time someone adds a comment? You can subscribe to comment.create event and send the notification to admin in any way you prefer, once comment is created. Facebook itself doesn't provide such functionality. This may looks like this (I assume Facebook JavaScript SDK is already loaded on page before doing this, read about it in documentation on Loading, anyway if you're using Social Comments Plugin it should be loaded already): <script type="text

What are The Valid & Readable approaches to Commenting in PHP5?

时间秒杀一切 提交于 2019-12-04 04:13:05
In the past 2 months that I have been learning PHP, I have identified more than two styles people use to comment code! I haven't seen much consistency... which I think usually means artists at work . So I wondered: what are the valid ways to comment which are still readable/practical? Seeing all the valid possibilities in 1 place side by side will provide the overview that I am looking for to improve commenting /* | This is what I now use (5chars/3lines) I name it star*wars \* Quoting the Manual on Comments: PHP supports 'C', 'C++' and Unix shell-style (Perl style) comments. For example: <?php

Will excessive commenting of code slow execution? [duplicate]

限于喜欢 提交于 2019-12-04 00:30:23
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Do comments slow down an interpreted language? Will there be noticeable performance degradation in the execution of a large .py file if more than 75% of the lines of code are properly commented? 回答1: No When you run python, the first step is to convert to bytecode, which is what those .pyc files are. Comments are removed from these, so it won't matter * . If you run with the -O or -OO option, python will produce

How to use Django template tags and filters with jQuery?

筅森魡賤 提交于 2019-12-03 08:51:39
The problem in general is this: I have a page with content and user can comment it. Inserting comment should happen without reloading the page. Commenting form gets handled in a view which saves the comment to database. After saving the comment I serialize the new comment to json and return to the page. data = serializers.serialize('json', [comment]) return HttpResponse(data, mimetype='application/javascript') This works quite well, comment gets prepended to the top of a div, but how do I apply formatting tags to jQuery? Comment is suppose to be displayed as <div class="comment">{{comment}}<br

What is the algorithm behind nested comments?

*爱你&永不变心* 提交于 2019-12-03 08:29:35
I want to learn the comment displaying algorithm behind Reddit. How is a comment related with its child and so on? How they are stored in the database? Lets say comment1 -comment2 --comment3 -comment4 --comment5 --comment6 ---comment7 ----comment8 comment9 How to display comment5 which is after comment4 which is after comment1? What is the idea behind this sequencing? And how to relate them in the database? AS @Rafe said, the actual storage is pretty easy, it would be something like: | id | name | parent | | 1 | comment1 | 0 | | 2 | comment2 | 1 | | 3 | comment3 | 2 | | 4 | comment4 | 1 | | 5

How do you comment out in Liquid?

北城以北 提交于 2019-12-02 23:19:06
What is the correct way to comment out in the Liquid templating language? In Liquid you comment out using the {% comment %} and {% endcomment %} tags: {% comment %} This is a comment in Liquid {% endcomment %} It doesn't matter if the comment is inline or a block comment. {% comment %} This is a block comment in Liquid {% endcomment %} okconfused Liquid allows you to leave un-rendered code inside a Liquid template by using the {% comment %} and {% endcomment %} tags. Input: Anything you put between {% comment %} and {% endcomment %} tags is turned into a comment. Output: Anything you put

Not all the comments visible when pulling a post using Facebook graph API iphone

a 夏天 提交于 2019-12-02 05:39:43
问题 I searched through all the posts about Facebook graph API and didn't find anything about it. Here's the issue. I'm working on the iPhone app for one company. And for the news section in this app, i'm pulling all the posts and comments from the wall of this company's Facebook page using Facebook graph API. The way i do this is: first i pull all the posts by sending request: [facebook requestWithGraphPath:@"company name/feed" andDelegate:self]; And I receive the NSDictionary with all posts and