comments

Regex to match specific comments in code

点点圈 提交于 2019-12-11 14:09:05
问题 Are there any regex experts who can help me clean up the following source code? I'm going through some existing code and I see several instances similar to the following: public enum Numbers { /// <summary> /// One = 1, /// </summary> One = 1, /// <summary> /// Two = 2, /// </summary> Two = 2, /// <summary> /// Three = 3, /// </summary> Three = 3, /// <summary> /// Four = 4 but don't use this because it will break everything, /// </summary> Four = 4, } Unless someone can tell me that the

I really need help, this is my code below and i want to give a random comment for each correct answer

怎甘沉沦 提交于 2019-12-11 13:44:17
问题 import random score = int(0) q1 = ("Work out the answer. 45 + 46 = ") q2 = ("Kai buys a pair of shoes for £31 and a shirt for £67. Altogether, he spends £") q3 = ("Work out the answer. 68 - 29 = ") q4 = ("A bike normally costs £260. Its price is reduced in a sale by £90. The sale price of the bike is ") q5 = ("Work out the answer. 32 x 30 = ") q6 = ("A box holds 22 apples. The total number of apples in 20 boxes are ") q7 = ("Work out the answer. 70 x 7 = ") q8 = ("For a school show, 22 chairs

Why do comments affect the logic of my file?

自作多情 提交于 2019-12-11 13:18:24
问题 EDIT: In here, it shows this as being a comment. In my IDE, it shows this as being code. So weird (Code set #2): <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="bootstrap-3.3.2-dist/js/bootstrap.min.js"></script> I have two files. One has comments and one does not. The first set of code

Regex to find comment in c# source file

此生再无相见时 提交于 2019-12-11 12:45:15
问题 I can't get my regex to match the header of a c# code file. I basically want need to return the header if it exists. Example: #define debug //**************************************************************************************************** // <copyright file="" company=""> // Copyright (c) . All rights reserved. // </copyright> // <project>Engine</project> //**************************************************************************************************** code here //some other comment

Removing Keyword Substitution comments from source files?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 12:30:49
问题 Note: For wont of a better word I call the fluff at the start of source files -- /* @(#) $Id: file.c,v 1.9 2011/01/05 11:55:00 user Exp $ ************************************************************************** * COPYRIGHT, 2005-2011 * ... */ -- Keyword Substitution comments, although I do not know if this is just a subversion term. Anyway, now to the question : We have a 3rd party supplier that we get source code from. These c source all have these keyword subst comments, and every time we

How to list comments of google drive files using google app script?

一个人想着一个人 提交于 2019-12-11 11:54:18
问题 I need to write a very simple script for retrieving the comments added to a file using the file ID, and store the comments to the activesheet I have found this page but I don't really know how to get the code running with an app script. function retrieveComments(fileId, callback) { var request = gapi.client.drive.comments.list({ 'fileId': fileId }); request.execute(callback); } Every time I run the code I just get this error: ReferenceError: "gapi" is not defined. (line 2, file "Comment").

Clean Code in Excel?

两盒软妹~` 提交于 2019-12-11 11:47:46
问题 As a former programmer I like clean, maintainable and documented code. As a project manager I have to do complex excels from time to time and want to write "clean" formulas in the same way I wrote programs. (How) Can I add "comments" into a (multiline) formula? (How) Can I "name" a (cell-relative) formula and reuse it? (e.g. write it as a vb (or even f#) function with parameters) Example1: Instead of =IF(AND(L$11+(L$13-1)*7>=$C15;L$11+(L$13-1)*7<$D15);VLOOKUP($A15;RessourcePlan;12+$E15;WRONG)

Single line comment continuation

六眼飞鱼酱① 提交于 2019-12-11 11:19:40
问题 From the C++ standard (going back to at least C++98) § 2.2, note 2 states: Each instance of a backslash character (\) immediately followed by a new-line character is deleted, splicing physical source lines to form logical source lines. Only the last backslash on any physical source line shall be eligible for being part of such a splice. Except for splices reverted in a raw string literal, if a splice results in a character sequence that matches the syntax of a universal-character-name, the

Comments within style= attributes - safe?

别来无恙 提交于 2019-12-11 10:21:39
问题 I am working on a CMS that generates CSS "style='xyz'" statements from user input. The user input will be validated but as an additional safeguard, I want to check the validity of the values on generation of the CSS code. If an invalid value is encountered - e.g. a relative width ("50%") where only absolute values are allowed due to layout restrictions - I would like to return a comment INSIDE the style attribute to help debugging: <div class="content" style="background-color: lightblue; /*

How to hide JavaScript comments in the resulting HTML page? [closed]

我与影子孤独终老i 提交于 2019-12-11 09:49:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . Is there a way to hide the JS comments on the resulting page source? The JS is generic... Thanks! 回答1: Sure. Just minify your javascript with a tool like JSMin: http://www.crockford.com/javascript/jsmin.html Or