comments

Vim different textwidth for multiline C comments?

本秂侑毒 提交于 2019-12-03 04:50:24
In our C++ code base we keep 99 column lines but 79-some-odd column multiline comments. Is there a good strategy to do this automagically? I assume the modes are already known because of smart comment line-joining and leading * insertion. Apparently both code and comments use the same textwidth option. As far as I can see, the only trick is to set this option dynamically: :autocmd CursorMoved,CursorMovedI * :if match(getline(.), '^\s*\*') == 0 | :setlocal textwidth=79 | :else | :setlocal textwidth=99 | :endif Here the critical part is detecting when we are in a comment. If you only format

Protect from fake reviews on Google Play [closed]

一曲冷凌霜 提交于 2019-12-03 04:41:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I published my Android app to Google Play and everything was fine. I got about 5000 user reviews with an average 4.6 mark. But at some moment I started getting lowest mark with an insane speed. Several hundred 1 marks during 5 days. So my rating fell to 4.3. There were no complains from users, no comments, just

How to comment multiple lines with space or indent

ぐ巨炮叔叔 提交于 2019-12-03 04:13:43
问题 In Visual Studio 2010, I have multiple lines of text to be commented: A B C Using Ctr+E+C to comment out multiple lines, I get //A //B //C I would like to have a space (or indent) between // and A , hence // A instead of //A . However, after I group tab a block of text and indent it, Ctr+E+C no longer comments out the selected text. How to group comment and get the following: // A // B // C 回答1: One way to do it would be: Select the text, Press Cntl + K, C to comment (Ctr+E+C ) Move the

Is PostgreSQL's Ltree module a good fit for threaded comments?

我与影子孤独终老i 提交于 2019-12-03 03:58:36
问题 I'm considering using PostgreSQL's Ltree module in my application to help with threaded comments. I've been eying it for a while to use for threaded comments. I figure it would help with cases where you need to update a node and its children, like when you want to hide a comment and its replies. I'm thinking ltree (or something like it) it would be useful if it was coupled with a traditional adjacency list ("comment_id"/"parent_comment_id"). Before taking the plunge into using ltree, I'm

Can I use a hash sign (#) for commenting in PHP?

旧街凉风 提交于 2019-12-03 03:21:56
问题 I have never, ever, seen a PHP file using hashes ( # ) for commenting. But today I realized that I actually can! I'm assuming there's a reason why everybody uses // instead though, so here I am. Is there any reason, aside from personal preference, to use // rather than # for comments? 回答1: The answer to the question Is there any difference between using "#" and "//" for single-line comments in PHP? is no . There is no difference. By looking at the parsing part of PHP source code, both "#" and

On GitHub API - what is the best way to get the last commit message associated with each file?

蹲街弑〆低调 提交于 2019-12-03 03:18:00
问题 So far as I understand it, messages are associated with commits. But when you look at a repo on GitHub it helpfully lists the message by each file, for when it was last changed. I'd like to replicate that in a web view of a repo I have. Looking at the GitHub api it looks to me the only way to get that info is to download all the commits (which can be paged), and work from the most recent ones assigning commit messages to the files in your local cache, going further and further back until you

vim syntax highlighting for git commit messages - custom commentchar

房东的猫 提交于 2019-12-03 03:05:22
As mentioned in this answer , since Git 1.8.2 you can use core.commentchar config value to change commit message comments to something else than the default # (hashmark or hashsign). That is a life-saver e.g. if your commit message policy wants you to start commit message with ticket number: #123 Fixed array indices Sad part is that this breaks Vim syntax highlighting. How can you bring the beauty back? You should try to run :verbose syntax . The active syntax file is probably $VIMRUNTIME\syntax\gitcommit.vim ( github version which is likely in your .vim ). It will tell you which syntax line

Block Comments in Clojure

元气小坏坏 提交于 2019-12-03 02:53:42
问题 How do I comment multiple lines in Clojure? 回答1: Actually, there is a way! (comment (defn hey [] ("Hey there!")) Check me out! ) Just wrap your comments in (comment ..) :) Have fun! 回答2: Clojure supports a #_ reader macro which completely skips the next form. This is mentioned on the page about the Clojure Reader. There is also the comment macro which has a similar effect, but is implemented differently. Both the above require that the thing that you're commenting out is otherwise a

How to keep the header comments up to date in Xcode

我是研究僧i 提交于 2019-12-03 02:33:29
Xcode has a habit of putting all kinds of (redundant) information at the top of each code file it creates, containing copyright notices, class names, project names and client names. Like it or not, once you create a new class "A", then refactor it to be called "B", the information is wrong already. The comments will keep saying that this is "A.h" or "A.m". In addition, if you reuse classes from one project in a next, it will also state the wrong project name. // // A.h // ProjectName // // Created by Author on 19-06-11. // Copyright 2011 CompanyName. All rights reserved. // There must be a

Sqlite: adding comments to tables and columns?

此生再无相见时 提交于 2019-12-03 02:22:17
In MySQL Workbench you can add comments to tables and columns in a MySQL database. Does Sqlite support adding comments to tables and columns? I don't think it does. The "SQL As Understood By SQLite" page makes no mention of table or column comments nor does the CREATE TABLE or ALTER TABLE documentation. Also, the Unsupported SQL wiki page has this: 2009-08-04: Table and column comments - I have scoured the doco and can't find anything about applying comments to tables or their columns. Yes, that's a wiki page from 2009 but that note is supported by the rest of the documentation. However,