comments

A simple question about facebook comments plugin

♀尐吖头ヾ 提交于 2019-12-04 10:04:55
I'm struggling with a very simple problem. The facebook documentation, as always, didn't give me enough explanation. I attached a facebook comments plugin to my site. And using a callback of "comment.create" event, I can get information of a just-create comment. FB.Event.subscribe('comment.create', function(response) { alert(JSON.stringify(response)); }); The json reponse looks like: {"href":"http://siteaddress.com/page.htm", "commentID":"111122223333" } What I like to do now is to retrieve the data of the single comment with the commentID. Although I expected that the following way should

Regex to strip phpdoc multiline comment

◇◆丶佛笑我妖孽 提交于 2019-12-04 08:37:49
I have this: /** * @file * API for loading and interacting with modules. * More explaination here. * * @author Reveller <me@localhost> * @version 19:05 28-12-2008 */ I'm looking for a regex to strip all but the @token data, so the result would be: @file API for loading and interacting with modules. More explaination here. @author Reveller <me@localhost> @version 19:05 28-12-2008 I now have this: $text = preg_replace('/\r?\n *\* */', ' ', $text); It does the job partially: it only removes the * in front of each line. Who could help me so it also strips /** and the final slash /? Any help would

How to mark logical sections of code in Java comments?

旧街凉风 提交于 2019-12-04 07:25:22
问题 Java classes are generally divided into logical "blocks". Is there a convention to mark these sections? Ideally, it would be supported by the major IDEs. I personally use this method: //// Section name here //// However, some editors seem to have problems with this. As an example, in Objective-C code you can use this method: #pragma mark - #pragma mark Section name here This will result in a menu in XCode that looks like this: 回答1: I personally use 80-chars line separators, like this : public

What does the '@' symbol do in JavaScript multiline comments?

别说谁变了你拦得住时间么 提交于 2019-12-04 06:47:35
问题 Just really curious after I was poking around the Muuri source code and saw this everywhere: var htmlCollectionType = '[object HTMLCollection]'; var nodeListType = '[object NodeList]'; /** * Check if a value is a node list * * @param {*} val * @returns {Boolean} */ export default function isNodeList(val) { var type = Object.prototype.toString.call(val); return type === htmlCollectionType || type === nodeListType; } @param and @returns don't seem to actually do anything (I think), but they ARE

Embed comments within JavaScript regex like in Perl

牧云@^-^@ 提交于 2019-12-04 06:02:12
Is there any way to embed a comment in a JavaScript regex, like you can do in Perl ? I'm guessing there is not, but my searching didn't find anything stating you can or can't. You can't embed a comment in a regex literal. You may insert comments in a string construction that you pass to the RegExp constructor : var r = new RegExp( "\\b" + // word boundary "A=" + // A= "(\\d+)"+ // what is captured : some digits "\\b" // word boundary again , 'i'); // case insensitive But a regex literal is so much more convenient (notice how I had to escape the \ ) I'd rather separate the regex from the

Facebook Social Plugin and jQuery Issue

一个人想着一个人 提交于 2019-12-04 05:42:28
问题 I'm using jQuery to load some content into a lightbox-like div in a web app I'm working on. Using $POST, I'm calling a dynamically populated page that holds a youtube video and a facebook comment plugin. The first video I load comes with the comments, but each video after that comes by itself, sans-comments. Any quick ideas as to what might be happening? This is the page I'm loading. <? $video_id = $_POST['video_id']; ?> <object width="800" height="499"> <param name="movie" value="http://www

How should I order these “helpful” scores?

谁都会走 提交于 2019-12-04 05:24:49
Under the user generated posts on my site, I have an Amazon-like rating system: Was this review helpful to you: Yes | No If there are votes, I display the results above that line like so: 5 of 8 people found this reply helpful. I would like to sort the posts based upon these rankings. If you were ranking from most helpful to least helpful, how would you order the following posts? a) 1/1 = 100% helpful b) 2/2 = 100% helpful c) 999/1000 = 99.9% helpful b) 3/4 = 75% helpful e) 299/400 = 74.8% helpful Clearly, its not right to sort just on the percent helpful, somehow the total votes should be

JSDoc Comment Folding In VSCode

橙三吉。 提交于 2019-12-04 04:54:05
Is there a way to fold JSDoc-style comment blocks in VSCode v1.25 for JavaScript files? I get normal code collapse offered, but comment blocks seem excluded. Is there a keyboard shortcut that would collapse code even without the GUI handlebars showing? locofierro I had the same issue, and fixed it by doing this: Go to File -> Preferences -> Settings and change the following entry from auto to indentation "editor.foldingStrategy": "indentation" Now JSDoc comments are folding as expected, hope this works for you as well! { "key": "ctrl+k ctrl+/", "command": "editor.foldAllBlockComments", "when":

Commenting (out) code in Angular2 TypeScript

余生颓废 提交于 2019-12-04 04:30:20
I have the following Angular2 TypeScript code with a section commented out as per Javascript convention: @Component({ selector: 'my-app', template: `<h1>{{title}}</h1> <h2>{{lene.name}}</h2> <div><label>id: </label>{{lene.id}}</div> /*<div> <label>name: </label> <input [(ngModel)]="lene.name" placeholder="name"> </div>*/` <div><label>description: </label>{{lene.description}}</div> }) However, once the TypeScript compiles to Javascript I get the following output to my web browser: I've searched the API docs and can't find an entry specifying the syntax for this quite basic feature. Anyone know

CSS - smarter code comments

点点圈 提交于 2019-12-04 04:30:00
I read some time ago about a way to comment a css block in a such way that you only need to remove one end of the comment character set in case you want to uncomment the block later. But I can't remember how it was done :( Maybe someone here does know :) /* * / .class { color: #ffa; } /* */ The space between the * and / in the first line causes the comment block to be un-closed until the final, paired, */ on the last line. If you close that space then the .class css is un-commented. For languages such as php and JavaScript the opening /* in the last line can be replaced with a // as a single