commenting

“Undefined local variable or method” error when using commontator gem for comments

社会主义新天地 提交于 2019-12-01 21:25:01
I made a website in which people can share photo's (they are called pins in my code). I wanted to add a system in which, when someone clicks on the picture, they can comment on it. I decided to use the commontator gem and I installed it. My problem is that the commenting system does not show up below posts like it's supposed to and I get an undefined local variable or method error for my pins controller. routes.rb Photo::Application.routes.draw do resources :pins devise_for :users root "pins#index" get "about" => "pages#about" mount Commontator::Engine => '/commontator' show.html.erb <%= link

How to write an an inline-comment in python

半世苍凉 提交于 2019-11-30 16:49:46
Is there a method of ending single line comments in python? Something like /*This is my comment*/ some more code here... No, there are no inline comments in Python. From the documentation : A comment starts with a hash character ( # ) that is not part of a string literal, and ends at the end of the physical line . A comment signifies the end of the logical line unless the implicit line joining rules are invoked. Comments are ignored by the syntax; they are not tokens. Whitespace in Python is too important to allow any other kind of comment besides the # comment that goes to the end of the line

Keyboard shortcut to Un/Comment out code in Mathematica 7?

雨燕双飞 提交于 2019-11-30 12:13:03
问题 A keyboard shortcut to comment/uncomment out a piece of code is common in other programming IDE's for languages like Java, .Net. I find it a very useful technique when experimenting through trial and error to temporarily comment out and uncomment lines, words and parts of the code to find out what is and isn't working. I cannot find any such keyboard shortcut on the Mathematica front end in version 7. I know that it is possible to comment out code by selecting the code, right mouse click and

Keyboard shortcut to Un/Comment out code in Mathematica 7?

走远了吗. 提交于 2019-11-30 02:11:28
A keyboard shortcut to comment/uncomment out a piece of code is common in other programming IDE's for languages like Java, .Net. I find it a very useful technique when experimenting through trial and error to temporarily comment out and uncomment lines, words and parts of the code to find out what is and isn't working. I cannot find any such keyboard shortcut on the Mathematica front end in version 7. I know that it is possible to comment out code by selecting the code, right mouse click and select Un/Comment from the menu that appears but this is too slow while coding. I tried to access this

How do I comment in CoffeeScript? “/* this */” doesn't work

杀马特。学长 韩版系。学妹 提交于 2019-11-29 22:43:41
In what ways can you comment in CoffeeScript? The documentation say you can use three hash symbols to start and close a comment block: ### Comments go here ### I've found that I can sometimes use the following two formats `// backticks allow for straight-JavaScript, // but the closing backtick can't be on a comment line (I think?) ` Are there a simpler way to insert short comments in CoffeeScript? Do NOT use this style** Since this is getting a lot of views, I want to emphasize that /* Comment goes here */ produces a MATH error when the /* is on its own line. As Trevor pointed out in a comment

PHP read file comments NOT file content - forgotten

风格不统一 提交于 2019-11-29 15:19:54
问题 Sorry folks forgotten this one, I need to read the first "batch" of comment in a php file example would be: <?php /** This is some basic file info **/ ?> <?php This is the "file" proper" ?> I need to read the first comment inside another file but I have totally forgotten how to get the /** This is some basic file info **/ as a string Sorry but thanks in adavance 回答1: There's a token_get_all($code) function which can be used for this and it's more reliable than you first might think. Here's

Function commenting conventions in R

回眸只為那壹抹淺笑 提交于 2019-11-28 21:18:27
I'm fairly new to R, and I have been defining some of my own functions in script files. I'm intending for others to re-use them later, and I can't find any guides on R function commenting conventions. Is there any way for me to make help("my_function_name") show some help? If not, do I just document the function in the script file, so that someone has to print out (or open the source of) a script to see the comments? Thanks, Hamy The canonical way to document your functions and make them accessible to others is to make a package. In order for your package to pass the build checks, you have to

How do I comment in CoffeeScript? “/* this */” doesn't work

人盡茶涼 提交于 2019-11-28 19:24:16
问题 In what ways can you comment in CoffeeScript? The documentation say you can use three hash symbols to start and close a comment block: ### Comments go here ### I've found that I can sometimes use the following two formats `// backticks allow for straight-JavaScript, // but the closing backtick can't be on a comment line (I think?) ` Are there a simpler way to insert short comments in CoffeeScript? Do NOT use this style** Since this is getting a lot of views, I want to emphasize that /*

Javascript/Jquery commenting causing errors in IE

一笑奈何 提交于 2019-11-28 14:00:51
So this post is not so much of a "please help me fix it" post as much as it is a "why would changing that make it work?". So I had some javascript/jquery written that was working in firefox and chrome, but IE threw errors. I could not figure it out even with the helpful posts from users here at stackoverflow. I eventually stumbled upon the answer (as I seem to find myself doing a lot with coding). I was doing a somewhat rigorous style of commenting taught to me by one of my computer science professors where a function would have commenting such as this: //@ describe function //@ params: param1

How to “comment-out” (add comment) in a batch/cmd?

北城以北 提交于 2019-11-28 02:31:17
I have a batch file that runs several python scripts that do table modifications. I want to have users comment out the 1-2 python scripts that they don't want to run, rather than removing them from the batch file (so the next user knows these scripts exist as options!) I also want to add comments to bring to their attention specifically the variables they need to update in the Batch file before they run it. I see that I can use REM . But it looks like that's more for updating the user with progress after they've run it. Is there a syntax for more appropriately adding a comment? The rem command