comments

SQL/Regex Challenge/Puzzle: How to remove comments from SQL code (by using SQL query)?

谁都会走 提交于 2019-12-20 04:22:51
问题 Requirements Single-lines comments (e.g. -- my comment) should be removed. Multi-line comments (e.g. /* my comment */) should be removed. The content of strings literals (e.g. 'this is a multi-line comment: /* my comment */') should be ignored. The content of identifiers (e.g. "-- column 1 --") should be ignored. literals and identifiers Literals and identifiers can span over multiple lines Single-line comments A single-line comment might be the last element of the code and might not end with

double hyphen in script makes firefox render strangely

柔情痞子 提交于 2019-12-20 04:15:12
问题 <!-- <script type="text/javascript">/*<![CDATA[*/ c-- ;//]]></script> --> When I have the above line in the <head> section of a plain html page, Firefox 3.5.5 renders the trailing --> as text. If I change c-- to c- it doesn't. Any ideas what's going on here? I getting an artifact on my pages with this due to a very large script that's been crunched. I can change the statement to c-=1 and avoid the problem for now but.... I'd like to know what bit/byte is biting my a$$. 回答1: This is due to

Disabling comments or likes on a specific post made via the Facebook API

强颜欢笑 提交于 2019-12-20 02:43:15
问题 I have an app that posts a message to a person's Facebook Timeline / wall. Is there a way to disable commenting or likes on that post via the Graph API? 回答1: You can only disable commenting for a post if the end user is a 'page' or public profile, but not if posting to a normal user. 回答2: No that's not possible with graph api! 回答3: No - whether or not a post can be liked or commented on is determined by the privacy settings of the user who posted the content - for example, you may not be able

Can I place a comment inside a tag in ASP.NET?

自作多情 提交于 2019-12-19 19:59:21
问题 I am looking to display this in my .aspx page, without using special character XML tags, can this be achieved? <asp:ServerTag Property1="a" Property2="b" Property3="c" <%-- Comment why this particular property is necessary --%> Property4="d" /> However, I am greeted with the error message Server tags cannot contain <% ... %> constructs. If I use an HTML <!-- --> tag, I'm told the server tag is not well formed. Is there any other syntax to make this possible? 回答1: It's not possible, no. The

Do comments affect Perl performance?

一个人想着一个人 提交于 2019-12-19 17:14:13
问题 I'm optimizing some frequently run Perl code (once per day per file). Do comments slow Perl scripts down? My experiments lean towards no: use Benchmark; timethese(20000000, { 'comments' => '$b=1; # comment ... (100 times) ', 'nocomments' => '$b=1;'}); Gives pretty much identical values (apart from noise). Benchmark: timing 10000000 iterations of comments, nocomments... comments: 1 wallclock secs ( 0.53 usr + 0.00 sys = 0.53 CPU) @ 18832391.71/s (n=10000000) nocomments: 0 wallclock secs ( 0.44

Do comments affect Perl performance?

早过忘川 提交于 2019-12-19 17:13:07
问题 I'm optimizing some frequently run Perl code (once per day per file). Do comments slow Perl scripts down? My experiments lean towards no: use Benchmark; timethese(20000000, { 'comments' => '$b=1; # comment ... (100 times) ', 'nocomments' => '$b=1;'}); Gives pretty much identical values (apart from noise). Benchmark: timing 10000000 iterations of comments, nocomments... comments: 1 wallclock secs ( 0.53 usr + 0.00 sys = 0.53 CPU) @ 18832391.71/s (n=10000000) nocomments: 0 wallclock secs ( 0.44

How to split an “if” condition over multiline lines with comments

£可爱£侵袭症+ 提交于 2019-12-19 16:48:15
问题 I cannot achieve to split an "if" condition over multiple lines in PowerShell WITH comments, see example: If ( # Only do that when... $foo # foo -and $bar # AND bar ) { Write-Host foobar } This generates the following error: Missing closing ')' after expression in 'if' statement. Adding the ` character does not work: If ( ` # Only do that when... $foo ` # foo -and $bar ` # AND bar ) { Write-Host foobar } I get a: Unexpected token '` # foo' in expression or statement. The only way I've found

Lack of block comments in VB .NET?

风流意气都作罢 提交于 2019-12-19 12:52:19
问题 Just a question of interest: Does anyone know why there's no block comment capability in VB .NET? (Unless there really is - but I've never yet come across it.) 回答1: It is a side-effect of the Visual Basic syntax, a new-line terminates a statement. That makes a multi-line comment pretty incompatible with the basic way the compiler parses the language. Not an issue in the curly brace languages, new-lines are just white space. It has never been a real problem, Visual Basic has had strong IDE

Custom JSF component: Using “startElement” with “script” results in a comment

≡放荡痞女 提交于 2019-12-19 10:48:20
问题 I'm rendering a custom JSF component. In the method encodeBegin I want to include some java script. public void encodeBegin(FacesContext context) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("script", this); writer.writeAttribute("type", "text/javascript", null); writer.writeText("var width=400",null); writer.endElement("script"); } When rendering the component the content of the script tag is commented out. <script type="text/javascript"><!--

Code Commenting: Do you put your code comments on Interfaces or on Concrete classes, or both? [duplicate]

你。 提交于 2019-12-19 05:54:38
问题 This question already has answers here : Comment the interface, implementation or both? (8 answers) Closed 4 months ago . What is the best practice in documenting classes and interfaces. Say if you have a concrete class called Foo, that derives from an interface called IFoo. Where do you put your comments for your methods? Do you duplicate your comments on the Interface as well as the concrete class? Here is an example where comments are duplicated: public class Foo : IFoo { /// <summary> ///