Search Results

Search found 4716 results on 189 pages for 'comment'.

Page 13/189 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • DNS Zone file and virtual host question (repost because my question got moved and now I can't comment on the original for some reason)

    - by Jake
    Sorry this is a repost, the original question got moved to here form stack overflow and for some reason I can't comment or respond to answers on that one anymore. Hi all, I'm trying to set up a virtual host for redmine.SITENAME.com. I've edited the httpd.conf file and now I'm trying to edit my DNS settings. However, I'm not sure exactly what to do. Here's an snippet of what's already in the named.conf file (the file was made by someone else who is unreachable): zone "SITENAME.com" { type master; file "SITENAME.com"; allow-transfer { ip.address.here.00; common-allow-transfer; }; }; I figure if I want to get redmine.SITENAME.com working, I need to copy that entry and just replace SITENAME.com with redmine.SITENAME.com but will that work? I was under the impression I needed a .db file but I don't see any reference to one in the current named.conf file. I also don't see any .db files or files named SITENAME in named.conf's directory. Any ideas where these illusive pre-existing db files could be?

    Read the article

  • Creating a Blog ruby on Rails - Problem Deleting Comments

    - by bgadoci
    As I always type I am new to rails and programming in general so go easy. Thanks in advance. I have successfully followed the initial tutorial from Ryan Bates on how to build a weblog in 15 minutes. If you don't know this tutorial takes you through creating posts and allowing for comments on those post. It even introduces AJAX through the creating and displaying comments on the posts show.html.erb page. All works great. Here's the hiccup, when Ryan takes you though this tutorial he clears out the comments_controller and only shows the code for creating comments. I am trying to add back the ability to edit and destroy comments. Can't see to get it to work, keeps deleting the actual post not the comment (log shows that I keep sending DELETE request to PostsController). Here is my code: class CommentsController < ApplicationController def create @post = Post.find(params[:post_id]) @comment = @post.comments.create!(params[:comment]) respond_to do |format| format.html { redirect_to @post } format.js end end def destroy @comment = Comment.find(params[:id]) @comment.destroy respond_to do |format| format.html { redirect_to(posts_url) } format.xml { head :ok } end end end /views/posts/show.html.erb <%= render :partial => @post %> <p> <%= link_to 'Edit', edit_post_path (@post) %> | <%= link_to 'Destroy', @post, :method => :delete, :confirm => "Are you sure?" %> | <%= link_to 'See All Posts', posts_path %> </p> <h2>Comments</h2> <div id="comments"> <%= render :partial => @post.comments %> </div> <% remote_form_for [@post, Comment.new] do |f| %> <p> <%= f.label :body, "New Comment" %><br/> <%= f.text_area :body %> </p> <p> <%= f.submit "Add Comment" %></p> <% end %> /views/comments/_comment.html.erb <% div_for comment do %> <p> <strong>Posted <%= time_ago_in_words(comment.created_at) %> ago </strong><br/> <%= h(comment.body) %><br/> <%= link_to 'Destroy', @comments, :method => :delete, :confirm => "Are you sure?" %> </p> <% end %>

    Read the article

  • Rails can't render polymorphic associations to XML?

    - by ambertch
    When I render XML with an :include clause for a polymorphic association I have, it doesn't work. I end up with the XML returning the object pointers instead of the actual objects, like: <posts> #<Comment:0x102ed1540>#<Comment:0x102ecaa38>#<Comment:0x102ec7fe0>#<Comment:0x102ec3cd8> </posts> Yet as_json works! When I render JSON with :include clause, the associations are rendered correctly and I get something like: posts":[ {"type":"Comment","created_at":"2010-04-20T23:02:30-07:00","id":7,"content":"fourth comment"}, {"type":"Comment","created_at":"2010-04-20T23:02:26-07:00","id":6,"content":"third comment"}] My current workaround is using XML builder, but I'm not too comfortable with that in the long run. Does anyone happen to know about this issue? I'm kind of in a catch-22 because while XML doesn't render the associations, as_json doesn't render in a kosher json format (returns an array rather than a list of hashes as proper json should) and the deserializer I'm using on the client side would require modification to parse the json correctly.

    Read the article

  • adding visual effects to RJS before action rendered

    - by Sam
    I just started using RJS which is awesome however I am used to putting visual effects in the link_to_remote and such and I'm not sure how to trigger actions before and after remotes are triggered. Take this link for example: HTML <span id="<%= "edit_comment_link_#{comment.id.to_s}"%>" style="float:left;"> <%= link_to_remote "edit", {:update => "comment_#{comment.id.to_s}", :url => edit_post_comment_path(comment.post, comment), :method => :get}%> | </span> Controller: def edit @comment = Comment.find(params[:id]) respond_to do |format| #format.html render edit_comment_path(@comment) format.js end end RJS: page.replace_html "edit_comment_link_#{@comment.id.to_s}", "currently editing | " So is RJS mainly for after actions are rendered visual effects such as a spinner should be put into the link_to_remote with call_backs? Is this a good way of doing things?

    Read the article

  • jquery buttons icons for dialog

    - by khinester
    I have this code: $(function() { var mainButtons = [ {text: "Invite" , 'class': 'invite-button' , click: function() { // get list of members alert('Invite was clicked...'); } } // end Invite button , {text: "Options" , 'class': 'options-button' , click: function() { alert('Options...'); } } // end Options button ] // end mainButtons , commentButtons = [ {text: "Clear" , 'class': 'clear-button' , click: function() { $('#comment').val('').focus().select(); } } // end Clear button , {text: "Post comment" , 'class': 'post-comment-button' , click: function() { alert('send comment...'); } } // end Post comment ] // end commentButtons $( "#form" ).dialog({ autoOpen: false , height: 465 , width: 700 , modal: true , position: ['center', 35] , buttons: mainButtons }); $( "#user-form" ) .button() .click(function() { $(this).effect("transfer",{ to: $("#form") }, 1500); $( "#form" ).dialog( "open" ); $( ".invite-button" ).button({ icons: {primary:'ui-icon-person',secondary:'ui-icon-triangle-1-s'} }); $( ".options-button" ).button({ icons: {primary:'ui-icon-gear'} }); }); // Add comment... $("#comment, .comment").click(function(){ $('#comment').focus().select(); $("#form").dialog({buttons: commentButtons}); $( ".post-comment-button" ).button({ icons: {primary:'ui-icon-comment'} }); $( ".clear-button" ).button({ icons: {primary:'ui-icon-refresh'} }); }); //Add comment // Bind back the Invite, Options buttons $(".files, .email, .event, .map").click(function(){ $("#form").dialog({buttons: mainButtons}); $( ".invite-button" ).button({ icons: {primary:'ui-icon-person',secondary:'ui-icon-triangle-1-s'} }); $( ".options-button" ).button({ icons: {primary:'ui-icon-gear'} }); }); // Tabs $( "#tabs" ).tabs(); $( ".tabs-bottom .ui-tabs-nav, .ui-tabs-nav > *" ) .removeClass( "ui-widget-header" ) .addClass( "ui-corner-bottom" ); }); ? What is the right way to add the button icons? As in my code I had to add it two times, once: $( "#user-form" ) .button() .click(function() { $(this).effect("transfer",{ to: $("#form") }, 1500); $( "#form" ).dialog( "open" ); ... and $(".files, .email, .event, .map").click(function(){ ... Could this code be improved further? I don't seem to be able to get the "transfer" effect to work correctly in a modal. I added: , close: function() { $(this).effect("transfer",{ to: $("#user-form") }, 1500); } to the $( "#form" ).dialog({ How would you go about in getting the "transfer" to work nicely when you open and close the dialog box?

    Read the article

  • Handling form from different view and passing form validation through session in django

    - by Mo J. Mughrabi
    I have a requirement here to build a comment-like app in my django project, the app has a view to receive a submitted form process it and return the errors to where ever it came from. I finally managed to get it to work, but I have doubt for the way am using it might be wrong since am passing the entire validated form in the session. below is the code comment/templatetags/comment.py @register.inclusion_tag('comment/form.html', takes_context=True) def comment_form(context, model, object_id, next): """ comment_form() is responsible for rendering the comment form """ # clear sessions from variable incase it was found content_type = ContentType.objects.get_for_model(model) try: request = context['request'] if request.session.get('comment_form', False): form = CommentForm(request.session['comment_form']) form.fields['content_type'].initial = 15 form.fields['object_id'].initial = 2 form.fields['next'].initial = next else: form = CommentForm(initial={ 'content_type' : content_type.id, 'object_id' : object_id, 'next' : next }) except Exception as e: logging.error(str(e)) form = None return { 'form' : form } comment/view.py def save_comment(request): """ save_comment: """ if request.method == 'POST': # clear sessions from variable incase it was found if request.session.get('comment_form', False): del request.session['comment_form'] form = CommentForm(request.POST) if form.is_valid(): obj = form.save(commit=False) if request.user.is_authenticated(): obj.created_by = request.user obj.save() messages.info(request, _('Your comment has been posted.')) return redirect(form.data.get('next')) else: request.session['comment_form'] = request.POST return redirect(form.data.get('next')) else: raise Http404 the usage is by loading the template tag and firing {% comment_form article article.id article.get_absolute_url %} my doubt is if am doing the correct approach or not by passing the validated form to the session. Would that be a problem? security risk? performance issues? Please advise Update In response to Pol question. The reason why I went with this approach is because comment form is handled in a separate app. In my scenario, I render objects such as article and all I do is invoke the templatetag to render the form. What would be an alternative approach for my case? You also shared with me the django comment app, which am aware of but the client am working with requires a lot of complex work to be done in the comment app thats why am working on a new one.

    Read the article

  • Having trouble understanding some code (Ruby on Rails)

    - by user284194
    I posted a question awhile ago asking how I could limit the rate at which a form could be submitted from a rails application. I was helped by a very patient user and their solution works great. The code was for my comments controller, and now I find myself wanting to add this functionality to another controller, my Messages controller. I immediately tried reusing the working code from the comments controller but I couldn't get it to work. Instead of asking for the working code, could someone please help me understand my working comment controller code? class CommentsController < ApplicationController #... before_filter :post_check def record_post_time cookies[:last_post_at] = Time.now.to_i end def last_post_time Time.at((cookies[:last_post_at].to_i rescue 0)) end MIN_POST_TIME = 2.minutes def post_check return true if (Time.now - last_post_time) > MIN_POST_TIME flash[:warning] = "You are trying to reply too fast." @message = Message.find(params[:message_id]) redirect_to(@message) return false end #... def create @message = Message.find(params[:message_id]) @comment = @message.comments.build(params[:comment]) if @comment.save record_post_time flash[:notice] = "Replied to \"#{@message.title}\"" redirect_to(@message) else render :action => "new" end end def update @message = Message.find(params[:message_id]) @comment = Comment.find(params[:id]) if @comment.update_attributes(params[:comment]) record_post_time redirect_to post_comment_url(@message, @comment) else render :action => "edit" end end #... end My Messages controller is pretty much a standard rails generated controller with a few before filters and associated private methods for DRYing up the code and a redirect for non existent pages. I'll explain how much of the code I understand. When a comment is created, a cookie is created with a last_post_time value. If they try to post another comment, the cookie is checked if the last one was made in the last two minutes. If it was a flash warning is displayed and no comment is recorded. What I don't really understand is how the post_check method works and how I can adapt it for my simpler posts controller. I thought I could reuse all the code in the message controller with the exception of the line: @message = Message.find(params[:message_id]) # (don't need the redirect code) in the post_check method. But it trips up on the "record_post_time" in the create action/method. I really want to understand this. Can someone explain why this doesn't work? I greatly appreciate you reading my lengthy question.

    Read the article

  • Problems with multi-line comments jquery

    - by c0mrade
    Hello, I'm making a image website with a bunch of images on the website, and below every image there is possibility of commenting the image and after that comments gets displayed without page loading and the comment content, the problem is when I have long comments which break the current line they don't get displayed since my comment box css overflow is hidden. Here is example : This is a comment - This is displayed properly This is a comment This is a comment This is a comment - this is not displayed properly since it break line. Here is the jQuery code for this : $.ajax({ type: "POST", url: "<?=base_url()?>imagesform/post_comment", data: datas, success: function () { $("#image-comments-" + image_id).attr("class", "comments"); $("#image-comments-" + image_id).append("<li id=\"new_append_" + image_id+ "\">" + $("#image").find(".comment").val() + "</li>").children(':last').height($('.comments li:last').height()).hide().slideDown(500, function () { var bodyHeight = $('html').height(); $('.addComment').fadeOut(300, function () { $('html').height(bodyHeight); }); }); alert($("#image").find(".comment").val()); } }); Here the $("#image").find(".comment").val() is the value of the text-area in which comment is inputted, when I alert it the whole multi line input is there put its not being appended to the li properly, that is part when I get confused, any suggestions why only part of the inputted string is appended?

    Read the article

  • Java saying XML Document Not Well Formed

    - by Pyroclastic
    Hey all. Java's XML parser seems to be thinking that my XML document is not well formed following the root element, but I've validated it with several tools and they all disagree. It's probably an error in my code rather than in the document itself, I'd really appreciate any help you all could offer me. Here is my Java method: private void loadFromXMLFile(File f) throws ParserConfigurationException, IOException, SAXException { File file = f; DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db; Document doc = null; db = dbf.newDocumentBuilder(); doc = db.parse(file); doc.getDocumentElement().normalize(); String desc = ""; String due = ""; String comment = ""; NodeList tasksList = doc.getElementsByTagName("task"); for (int i = 0; i < tasksList.getLength(); i++) { NodeList attributes = tasksList.item(i).getChildNodes(); for (int j = 0; i < attributes.getLength(); j++) { Node attribute = attributes.item(i); if (attribute.getNodeName() == "description") { desc = attribute.getTextContent(); } if (attribute.getNodeName() == "due") { due = attribute.getTextContent(); } if (attribute.getNodeName() == "comment") { comment = attribute.getTextContent(); } tasks.add(new Task(desc, due, comment)); } desc = ""; due = ""; comment = ""; } } And here is the XML file I'm trying to load: <?xml version="1.0"?> <tasklist> <task> <description>Task 1</description> <due>Due date 1</due> <comment>Comment 1</comment> <completed>false</completed> </task> <task> <description>Task 2</description> <due>Due date 2</due> <comment>Comment 2</comment> <completed>false</completed> </task> <task> <description>Task 3</description> <due>Due date 3</due> <comment>Comment 3</comment> <completed>true</completed> </task> </tasklist> And here is the error message java is throwing for me: run: [Fatal Error] tasks.xml:28:3: The markup in the document following the root element must be well-formed. May 17, 2010 6:07:02 PM todolist.TodoListGUI SEVERE: null org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed. at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208) at todolist.TodoListGUI.loadFromXMLFile(TodoListGUI.java:199) at todolist.TodoListGUI.(TodoListGUI.java:42) at todolist.Main.main(Main.java:25) BUILD SUCCESSFUL (total time: 19 seconds) For reference TodoListGUI.java:199 is doc = db.parse(file); If context is helpful to anyone here, I'm trying to write a simple GUI application to manage a todo list that can read and write to and from XML files defining the tasks. Any advice is appreciated!

    Read the article

  • Merge two different API calls into One

    - by dhilipsiva
    I have two different apps in my django project. One is "comment" and an other one is "files". A comment might save some file attached to it. The current way of creating a comment with attachments is by making two API calls. First one creates an actual comment and replies with the comment ID which serves as foreign key for the Files. Then for each file, a new request is made with the comment ID. Please note that file is a generic app, that can be used with other apps too. What is the cleanest way of making this into one API call? I want to have this as a single API call because I am in a situation where I need to send user an email with all the files as attachment when a comment is made. I know Queueing is the ideal way to do it. But I don't have the liberty to add queing to our stack now. So this was the only way I could think of.

    Read the article

  • Commenting on Commits

    The source code experience on CodePlex just got more social. Now, you can comment directly on a commit when viewing a project’s source code history. This feature acts as a nice compliment to the existing ability to comment on a pull request's commits. To get started with this feature, navigate to the commit you are interested in from the source tab. As you hover over the line you would like to comment on, an icon to add a comment will appear to the left. Click on the icon, and comment away!     Once you comment on a line, the person who committed the change and anyone involved in the conversation will be notified of the comment by email. Have ideas on how to improve CodePlex? Please visit our suggestions page! Vote for existing ideas or submit a new one. As always you can reach out to the CodePlex team on Twitter @codeplex or reach me directly @Rick_Marron.    

    Read the article

  • How to insert a blank line above my copyright text inside the comment lines in intelliJ IDEA?

    - by tim_wonil
    I'm using intelliJ IDEA 9. It has a function to make a copyright profile and apply to all files I create. What I'm trying to do is to format the copyright comment right. Suppose I have a copyright text as this: Copyright (c) 2010 my.company. All rights reserved. I wish it to be inserted in files automatically as following: //////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2010 my.company. All rights reserved. // //////////////////////////////////////////////////////////////////////////////// But when I enter the line "Copyright (c) 2010 my.company. All rights reserved." in the copyright profile (without quotes) and configure the formatting to use line comment and borders, and so on, I can only make it to display as below: //////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2010 my.company. All rights reserved. //////////////////////////////////////////////////////////////////////////////// Even when I put the copyright text with blank line above and below to the template, as following, it still comes out like above. Copyright (c) 2010 my.company. All rights reserved. It seems to ignore blank lines in the copyright template. Is there any way to configure it so the copyright text will have blank lines above and below within the comments?

    Read the article

  • What information should a SVN/Versioned file commit comment contain?

    - by RenderIn
    I'm curious what kind of content should be in a versioned file commit comment. Should it describe generally what changed (e.g. "The widget screen was changed to display only active widgets") or should it be more specific (e.g. "A new condition was added to the where clause of the fetchWidget query to retrieve only active widgets by default") How atomic should a single commit be? Just the file containing the updated query in a single commit (e.g. "Updated the widget screen to display only active widgets by default"), or should that and several other changes + interface changes to a screen share the same commit with a more general description like ("Updated the widget screen: A) display only active widgets by default B) added button to toggle showing inactive widgets") I see subversion commit comments being used very differently and was wondering what others have had success with. Some comments are as brief as "updated files", while others are many paragraphs long, and others are formatted in a way that they can be queried and associated with some external system such as JIRA. I used to be extremely descriptive of the reason for the change as well as the specific technical changes. Lately I've been scaling back and just giving a general "This is what I changed on this page" kind of comment.

    Read the article

  • In C/C++ mode in Emacs, change face of code in #if 0...#endif block to comment face

    - by pogopop77
    I'm trying to add functionality found in some other code editors to my Emacs configuration, whereby C/C++ code within #if 0...#endif blocks is automatically set to the comment face/font. Based on my testing, cpp-highlight-mode does something like what I want, but requires user action. It seems like tying into the font-lock functionality is the correct option to make the behavior automatic. I have successfully followed examples in the GNU documentation to change the face of single-line regular expressions. For example: (add-hook 'c-mode-common-hook (lambda () (font-lock-add-keywords nil '(("\\<\\(FIXME\\|TODO\\|HACK\\|fixme\\|todo\\|hack\\)" 1 font-lock-warning-face t))))) works fine to highlight debug related keywords anywhere in a file. However, I am having problems matching #if 0...#endif as a multiline regular expression. I found some useful information in this post (How to compose region like ""), that suggested that Emacs must be told specifically to allow for multiline matches. But this code: (add-hook 'c-mode-common-hook (lambda () '(progn (setq font-lock-multiline t) (font-lock-add-keywords nil '(("#if 0\\(.\\|\n\\)*?#endif" 1 font-lock-comment-face t)))))) still does not work for me. Perhaps my regular expression is wrong (though it appears to work using M-x re-builder), I've messed up my syntax, or I'm following the wrong approach entirely. I'm using Aquamacs 2.1 (which is based on GNU Emacs 23.2.50.1) on OS X 10.6.5, if that makes a difference. Any assistance would be appreciated!

    Read the article

  • How to fix an error in a Mercurial changeset comment?

    - by Sly
    Is there a way to rewrite the hg commit message if the wrong information was entered? We always include our Bug ID when we commit a changeset. For instance: hg commit -m "Bug 14585: LastName field should be mandatory" But If I put the wrong bug ID, is there a way (through an extension maybe) to fix the comment once the changeset has been committed and pushed to a central repo?

    Read the article

  • How do I code a comment box on my blog?

    - by Malcolm
    Obviously, I am a novice web designer. I'm using php and sql to do all the under-the-hood stuff, but I want a visually appealing as well as functional comment system. Right now I am just using HTML forms but they don't look very good. Should I be using javascript? Any tips to get me started?

    Read the article

  • What was the most refreshingly honest non-technical comment you saw?

    - by DVK
    OK, so we all saw the lists of "funny" or "bad" comments. However, today, when maintaining an old stored procedure, I stumbled upon a comment which I couldn't classify other than "refreshingly brutally honest", left by a previous maintainer around a really freakish (both performance and readability-wise) page-long query: -- Feel free to optimize this if you can understand what it means So, in the first (and hopefully only) poll type question in my history of Stack Overflow, I'd like to hear some other "refreshingly brutally honest" code comments you encountered or written.

    Read the article

  • How can I create a FreeBSD package using EPM that has the ORIGIN @comment?

    - by Chris R
    I'm building packages of our internal software products using EPM, and over time these packages (of which we have a large number) clutter up the output of pkg_delete and pkg_add with the following general kind of messages: err: pkg_add: package MYPACKAGE has no origin recorded I can see from some old FreeBSD lists that the +CONTENTS file in the package must have a line like this: @comment ORIGIN:some_source_path What I don't see is a way to get this line in place using EPM. Can somebody tell me how to do this?

    Read the article

  • Wordpress: How to display posts that have at least one comment?

    - by Keith Donegan
    I have been pulling my hair out for the past 3 hours!! Does anybody have any idea on how to show posts in wordpress that have at least one comment? The below code uses orderby=comment_count and it does work, but it still display other posts that have no comments too :( <?php $home_loop= new WP_Query("cat=-182,-183&showposts=10&paged=$paged&orderby=comment_count&order=DESC"); ?>

    Read the article

  • How to fix error in a Mercurial changeset comment?

    - by Sly
    Is there a way to rewrite the hg commit message if the wrong information was entered? We always include our Bug ID when we commit a changeset. For instance: hg commit -m "Bug 14585: LastName field should be mandatory" But If I put the wrong bug ID, is there a way (through an extension maybe) to fix the comment once the changeset has been committed (and possibly pushed)?

    Read the article

  • What was the most refreshingly honest non-technical comment you saw in the code?

    - by DVK
    OK, so we all saw the lists of "funny" or "bad" comments. However, today, when maintaining an old stored proc, I stumbled upon a comment which I couldn't classify other than "refreshingly brutally honest", left by a previous maintainer around a really freakish (both performance and readability-wise) page-long query: -- Feel free to optimize this if you can understand what it means So, in the first (and hopefully only) poll type question in my history of Stack Overflow, I'd like to hear some other "refreshingly brutally honest" code comments you encountered or written.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >