comments

Starting of bash script

﹥>﹥吖頭↗ 提交于 2019-12-11 09:44:25
问题 What is reason behind writing #! /bin/bash at the very starting of every bash script ? I means, I know that it is kind of hack but I want to know how it exactly works ? 回答1: If you call the script with an explicit interpreter, like bash foo.sh /bin/bash foo.sh dash foo.sh sh foo.sh your choosen interpreter is used, no matter what the shebang says, which is just a comment. If you make the script executable, and start it: chmod a+x foo.sh ./foo.sh the kernel looks for the shebang and starts the

How to comment a line in a Makefile?

谁说胖子不能爱 提交于 2019-12-11 08:43:57
问题 Within a makefile I have a some variables. For a better understanding I added some comments: variable1 = value1 #A comment variable2 = true #can be set true or false variable3 = foo #can be foo or bar The problem is now, that the variables contain the given text and all spaces between the text and the # . The output of a simple echo shows the problem: echo "$(variable1) $(variable2) endOfEcho" value1 true endOfEcho How to avoid the spaces to be interpreted as variable's text? 回答1: With GNU

PHP preg_replace to remove MS Office style html comments

♀尐吖头ヾ 提交于 2019-12-11 08:19:15
问题 Im looking for a way to remove MS Office style html comments, and everything in between. These are of the form: <!--[if gte mso 10]> blablabla blablabla <![endif]--> or <!--[if gte mso 9]> blablabla blablabla <![endif]--> The problem i'm encountering is that I do not want to remove ALL comments from the html. Only these MSO style comments. Any ideas? 回答1: try this preg_replace('/<!--\s*\[if[^\]]*]>.*?<!\[endif\]-->/i', '', $string); it will remove all <!--[if ...]>....<![endif]--> comments 来源

preserve MySQL comment in PHP script

前提是你 提交于 2019-12-11 07:42:25
问题 I have been working on a project where I've been developing the MySQL commands interactively. I now want to run the MySQL commands using a PHP script. I do this by simply pasting in the MySQL commands and making them into a PHP string. Like this... $queryStg = " update table1 set col1 = 1; drop table table2; "; $sqlQuery = mysqli_multi_query($mysqliLink, $queryStg); However I've always had to strip out the MySQL comments to get it to work. I'd prefer to retain these comments. Is there a way

Most recent post does not come above post if there was already made an comment

大憨熊 提交于 2019-12-11 07:13:33
问题 @Dianuj solved my issue a week ago, when I asked how I can get a recent comment above a post . That all worked very well, but yesterday, when I tested it, I saw a little issue, which I not want on my Wordpress site. Let me explain it to you... If someone makes a comment on a post that has none comments before you comment, then the function on this page How to get most recent commented post above new submitted post in Wordpress? will work flawlessly. I thank Dianuj for making my life easier.

Customizing children comments in wp_list_comments in wordpress

左心房为你撑大大i 提交于 2019-12-11 06:41:18
问题 What I want is like this: Click to see the picture But,at last It came up with like this: Click to see the picture (I can't put images, so I put the picture url here!) Here Is Code In My comment.php Where Show The Comments: `<?php wp_list_comments('type=comment&callback=comment_activity_list');?>` and this is the code of function "comment_activity_list" in my function.php: <?php if (!function_exists("comment_activity_list")){ function comment_activity_list($comment, $args, $depth){ $GLOBALS[

Visual Studio 2015 - How to Preserve Indentation of Comments?

血红的双手。 提交于 2019-12-11 06:27:39
问题 Simple question. No answer given anywhere on the internet? I program in C++ / C# in VS2015 community. When i comment out code and then close the ide and reopen it, this commented code loses indentation. How do i force VS to preserve indentation? It shouldn't be doing anything to the code / text that is commented. Thanks in advance. 回答1: In VS 2017 (C++) there is a checkbox for this. Tools | Options | Text Editor | C/C++ | Formatting | Indentation | Preserve indentation of comments Unchecking

VS Code: How to make all text bold, except the comments? [closed]

跟風遠走 提交于 2019-12-11 06:17:51
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 11 months ago . Can we make all text except for comments appear bold in VS Code? I've tried using "editor.fontWeight": "bold" but this makes everything, including comments, bold. Example: in the screenshot below, all text except for the comments (grey) would be bold. 回答1: Setting different

How to get most recent commented post above new submitted post in Wordpress?

爱⌒轻易说出口 提交于 2019-12-11 06:15:59
问题 I have this function: $ids = $wpdb->get_col("SELECT DISTINCT comment_post_ID FROM $wpdb->comments ORDER BY comment_date DESC LIMIT 0 , 30"); foreach ($ids as $id) { $post = &get_post( $id ); setup_postdata($post); ?> <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p> <?php } ?> Which shows the latest commented posts in a list, which is fine. What I want to do is give a priority to this one and combine it

How can I get Visual Studio 2010 to show Chinese comments properly

▼魔方 西西 提交于 2019-12-11 06:00:07
问题 I have some code from a Chinese business partner, and all of the comments in the code are in Chinese. However, Visual Studio displays them as gibberish. How can I get them to display properly. Here is a code example with some comments converted to gibberish: //Á¬½Óµ½·þÎñÆ÷ void CTestAPIDlg::OnBnClickedButton2() { UpdateData(TRUE); //ÉèÖÃÊÇ·ñ¼Ç¼ÈÕÖ¾ m_ObjRSI->EnableLog(m_bIsOnLogReg,m_bIsOnLogComm); //ÅжÏÊÇ·ñÆôÓôúÀí if (m_bIsOnProxy) { //´úÀí²ÎÊý char proxyIP[64]; ZeroMemory(proxyUserPwd