Search Results

Search found 5637 results on 226 pages for 'triple slash comments'.

Page 32/226 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Tool to aid Code Review

    - by Prakash
    For our small team of 20 developers, we used do code review like: Make a label in svn and publish the label to the reviewers Reviewers checkout the code and add comments in line (with marker like: // REVIEWER_NAME::REVIEW COMMENT:) After all comments are in, reviewer checks in the code, preferably with new label. Developer checks the comments and makes changes (if appropriate) Developer keeps an excel sheet report for considered changes and reasons for ignored comments Problem: Developer needs to keep track of multiple labels which might have same comments Sometimes we even do One on One review and if we really have time, even do Table review (team of reviewers looks at the code on projector, on the fly, and pass comment) I was wondering: Are you guys using any specific tool which helps to do code reviews smoother? I have heard of Code Collaborator. But have anyone used that? Is it worth the money?

    Read the article

  • Elegant way to take basename of directory in Python?

    - by user248237
    I have several scripts that take as input a directory name, and my program creates files in those directories. Sometimes I want to take the basename of a directory given to the program and use it to make various files in the directory. For example, # directory name given by user via command-line output_dir = "..." # obtained by OptParser, for example my_filename = output_dir + '/' + os.path.basename(output_dir) + '.my_program_output' # write stuff to my_filename The problem is that if the user gives a directory name with a trailing slash, then os.path.basename will return the empty string, which is not what I want. What is the most elegant way to deal with these slash/trailing slash issues in python? I know I can manually check for the slash at the end of output_dir and remove it if it's there, but there seems like there should be a better way. Is there? Also, is it OK to manually add '/' characters? E.g. output_dir + '/' os.path.basename() or is there a more generic way to build up paths? Thanks.

    Read the article

  • What's the best way to normalize scores for ranking things?

    - by beagleguy
    hi all, I'm curious how to do normalizing of numbers for a ranking algorithm let's say I want to rank a link based on importance and I have two columns to work with so a table would look like url | comments | views now I want to rank comments higher than views so I would first think to do comments*3 or something to weight it, however if there is a large view number like 40,000 and only 4 comments then the comments weight gets dropped out. So I'm thinking I have to normalize those scores down to a more equal playing field before I can weight them. Any ideas or pointers to how that's usually done? thanks

    Read the article

  • Best solution for a comment table for multiple content types

    - by KRTac
    I'm currently designing a comments table for a site I'm building. Users will be able to upload images, link videos and add audio files to the profile. Each of these types of content must be commentable. Now I'm wondering what's the best approach to this. My current options are: 1. to have one big comments table and a link tables for every content type (comments_videos, ...) with comment_id and _id. 2. to have comments separated by the type of content their for. So each type of content would have his own comments table with the comments for that type.

    Read the article

  • ASP .net MVC Jqgrid data binding

    - by SARAVAN
    Hi, I am using a jqgrid with a column named 'Comments'. My controller code returns data as follows: var jsonData = new { rows= .... .... select new { col1.... col2.... Comments = _Model.GetComments(id), }) ....... ..... return Json(jsonData, JsonRequestBehavior.AllowGet); } _Model.GetComments(id) will return a ClientComments Object which has a few properties say CommentID, FirstName, MiddleName etc., which will be bound to each row in the grid Now in my jqgrid I need to build a tool tip based on Comments column properties and for that I need to use the properties of my Comments in JQGrid for each row. May I know How I can manipulate Comment's properties for each row? Any help would be appreciated. I tried in my javascript that for each row rowObject.Comments.FirstName and it did not work.

    Read the article

  • Check for a unique value within a count, but get all results

    - by pedalpete
    I'm trying to create a single query which, similar to stack overflow, will give me the number of votes, but also make sure that the currently viewing user can't upvote again if they've already upvoted. my query currently looks like SELECT cid, text, COUNT(votes.parentid) FROM comments LEFT JOIN votes ON comments.cid=votes.parentid AND votes.type=3 WHERE comments.type=0 AND comments.parentid='$commentParentid' GROUP BY comments.cid But I'm completely stumpted on how to add the check to see if the userid is in the votes table. The other option is to add a seperate query where SELECT COUNT(*) FROM votes WHERE userid='$userid' AND parentid='$commentParentid' AND type=3 I'm just realizing I'm so lost with this that I don't even really know what tags to provide.

    Read the article

  • Rails: unexpected behavior updating a shared instance

    - by Pascal Lindelauf
    I have a User object, that is related to a Post object via two different association paths: Post --(has_many)-- comments --(belongs to)-- writer (of type User) Post --(belongs to)-- writer (of type User) Say the following hold: user1.name == "Bill" post1.comments[1].writer == user1 post1.writer == user1 Now when I retrieve the post1 and its comments from the database and I update post1.comments[1].writer like so: post1.comments[1].writer.name = "John" I would expect post1.writer to equal "John" too. But it doesn't! It still equals "Bill". So there seems to be some caching going on, but the kind I would not expect. I would expect Rails to be clever enough to load exactly one instance of the user with name "Bill"; instead is appears to load two individual ones: one for each association path. Can someone explain how this works exactly and how I am to handle these types of situations the "Rails way"?

    Read the article

  • group by, order by, with join

    - by Scarface
    Hey guys, quick question, I have this query, and I am trying to get the latest comment for each topic and then sort those results in descending order (therefore one comment per topic). I have what I think should work, but my join always messes my results up. Somehow, it seems to have sorted the end results properly, but has not taken the latest comment from each topic instead it seems to have just taken a random comment. If anyone has any ideas, would really appreciate any advice SELECT * FROM comments JOIN topic ON topic.topic_id=comments.topic_id WHERE topic.creator='admin' GROUP BY comments.topic_id ORDER BY comments.time DESC table comments is structured like id time user message topic_id table topic is structured like topic_id subject_id topic_title creator timestamp description

    Read the article

  • Where to put a piece of code in Ruby on Rails?

    - by yuval
    I have a post controller that has many comments. The post model has a field called has_comments which is a boolean (so I can quickly select from the database only posts that have comments). To create a new comment for a post, I use the create action of my comments controller. After I create the comment I need to update my post's has_comments field and set it to true. I can update this field from the create action of my comments controller, but that doesn't seem right - I feel that I should really be using the post's update action, but I'm not sure if it's right to call it (via send?) from the create action of the comments controller. Where should the code for updating the post be? Thank you!

    Read the article

  • I want to create a simple function to reset all input values without target input. (Javascript, Jque

    - by question_about_the_problem
    Hi, I want to create a simple function to reset all input values without target input. I don't know how i can do it. Thanks. Here is my sample codes: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script> function reset_other_inputs(room) { $("input[name^='check_in_date_']").each(function () { if ( $("input[name!='check_in_date_'+room]") ) { this.val(""); } }); $("input[name^='check_out_date_']").each(function () { if ( $("input[name!='check_out_date_'+room]") ) { this.val(""); } }); } </script> <input type="text" name="check_in_date_single" value="single" onClick="reset_other_inputs('single');"> <input type="text" name="check_out_date_single" value="single" onClick="reset_other_inputs('single');"> <input type="text" name="check_in_date_double" value="double" onClick="reset_other_inputs('double');"> <input type="text" name="check_out_date_double" value="double" onClick="reset_other_inputs('double');"> <input type="text" name="check_in_date_triple" value="triple" onClick="reset_other_inputs('triple');"> <input type="text" name="check_out_date_triple" value="triple" onClick="reset_other_inputs('triple');"> <input type="text" name="check_in_date_suite" value="suite" onClick="reset_other_inputs('suite');"> <input type="text" name="check_out_date_suite" value="suite" onClick="reset_other_inputs('suite');">

    Read the article

  • MySQL GROUP BY with three tables

    - by Psaniko
    I have the following tables: posts (post_id, content, etc) comments (comment_id, post_id, content, etc) posts_categories (post_category_id, post_id, category_id) and this query: SELECT `p`.*, COUNT(comments.comment_id) AS cmts, posts_categories.*,comments.* FROM `posts` AS `p` LEFT JOIN `posts_categories` ON `p`.post_id = `posts_categories`.post_id LEFT JOIN `comments` ON `p`.post_id = `comments`.post_id GROUP BY `p`.`post_id` There are three comments on post_id=1 and four in total. In posts_categories there are two rows, both assigned to post_id=1. I have four rows in posts. But if I query the statement above I get a result of 6 for COUNT(comments.comment_id) at post_id=1. How is this possible? I guess the mistake is somewhere in the GROUP BY clause but I can't figure out where. Any suggestions?

    Read the article

  • Rails 2.3: using another models named_scope inside another named_scope

    - by mustafi
    Hi Let's say I have two models like so: class Comment < ActiveRecord::Base belongs_to :user named_scope :about_x :conditions => "comments.text like '%x%')" end class User < ActiveRecord::Base has_many :comments end How can I add a named_scope to the user model like so class User < ActiveRecord::Base has_many :comments named_scope :comments_about_x, :includes => :comments, :comments_named_scope => :about_x end Which allows me to do all_user_comments_about_x = User.comments_about_x The reasoning is I often need to use the comment models about_x named scope logic but I don't want to have "comments.text like '%x%')" scattered around my code. I hope this make sense :) Thank you

    Read the article

  • ASP.NET web form Routing issue via UNC Path

    - by Slash
    I create a IIS 7.0 website via UNC path to load .aspx to dynamic compile files and runs. however, it's running perfect. I always use IIS URL Rewrite module 2 to rewrite my site URL n' its perfect, too. Today, I wanna use System.Web.Routing to implement url rewrite but I encountered difficulties... When I wrote code in Global.asax: System.Web.Routing.RouteTable.Routes.MapPageRoute("TEST", "AAA/{prop}", "~/BBB/CCC.aspx"); And it just CANNOT reDirect to /BBB/CCC.aspx When I type the URL(like: xx.xx.xx.xx/BBB/CCC.aspx) in browser directly, it runs normally that I want. (so it proof CCC.aspx is in right path.) thus, I copy all of the code and open VS2010 running with IIS 7.5 Express locally, it works perfect! e.g: in browser URL I type xx.xx.xx.xx/AAA/1234, it will turn to page xx.xx.xx.xx/BBB/CCC.aspx (Works perfect!) Why??? help me plz. thanks. Update: I think I should consider not UNC path to make it error! when I move all code to physical disk and setup IIS 7.0 to monitor this Folder, it still not works! But the same code run in VS2010 + IIS 7.5 Express it works!? so strange!

    Read the article

  • Clear listview content?

    - by Slash
    I have a little problem with listview. How do i clear a listview content, knowing that it has a custom adapter? edit : the custom adapter class extends BaseAdapter, it looks like this : import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; public class MyAdapter extends BaseAdapter { private Activity activity; private String[] data; private static LayoutInflater inflater=null; public MyAdapter(Activity _a, String[] _str) { activity = _a; data = _str; inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); } public static class ViewHolder{ public TextView text; } @Override public int getCount() { return data.length; } @Override public Object getItem(int position) { return position; } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View view, ViewGroup parent) { View v = view; ViewHolder holder; if(v == null) { v = inflater.inflate(R.layout.rowa, null); holder=new ViewHolder(); holder.text=(TextView)v.findViewById(R.id.dexter); v.setTag(holder); }else{ holder=(ViewHolder)v.getTag(); } holder.text.setText(data[position]); return v; } }

    Read the article

  • Unassigned value error asp.net C#

    - by slash shogdhe
    if variable is not assigned,then it takes the default value at run time. for example int A1; if i will check the value of A1 at runtime it will be 0; then why at compile time it throws a error of unassigned value; why clr dont use to alot the default value at runtime; int A1; int B1 = A1+10; it shud be 11 as the default value of A1 is 0; there project property where i can check for "assignn defalut values for unassigned variable"; can any one tell me where i can find it;

    Read the article

  • Rails Associations - Callback Sequence/Magic

    - by satynos
    Taking following association declaration as an example: class Post has_many :comments end Just by declaring the has_many :comments, ActiveRecord adds several methods of which I am particularly interested in comments which returns array of comments. I browsed through the code and following seems to be the callback sequence: def has_many(association_id, options = {}, &extension) reflection = create_has_many_reflection(association_id, options, &extension) configure_dependency_for_has_many(reflection) add_association_callbacks(reflection.name, reflection.options) if options[:through] collection_accessor_methods(reflection, HasManyThroughAssociation) else collection_accessor_methods(reflection, HasManyAssociation) end end def collection_accessor_methods(reflection, association_proxy_class, writer = true) collection_reader_method(reflection, association_proxy_class) if writer define_method("#{reflection.name}=") do |new_value| # Loads proxy class instance (defined in collection_reader_method) if not already loaded association = send(reflection.name) association.replace(new_value) association end define_method("#{reflection.name.to_s.singularize}_ids=") do |new_value| ids = (new_value || []).reject { |nid| nid.blank? } send("#{reflection.name}=", reflection.class_name.constantize.find(ids)) end end end def collection_reader_method(reflection, association_proxy_class) define_method(reflection.name) do |*params| force_reload = params.first unless params.empty? association = association_instance_get(reflection.name) unless association association = association_proxy_class.new(self, reflection) association_instance_set(reflection.name, association) end association.reload if force_reload association end define_method("#{reflection.name.to_s.singularize}_ids") do if send(reflection.name).loaded? || reflection.options[:finder_sql] send(reflection.name).map(&:id) else send(reflection.name).all(:select => "#{reflection.quoted_table_name}.#{reflection.klass.primary_key}").map(&:id) end end end In this sequence of callbacks, where exactly is the actual SQL being executed for retrieving the comments when I do @post.comments ?

    Read the article

  • Binding DataGridComboBoxColumn to a one to many entity framework relation

    - by Cristian
    I have two tables in the model, one table contains entries related to the other table in a one to many relations, for example: Table User ID Name Table Comments ID UserID Title Text I want to show a datagrid in a WPF window with two columns, one text column with the User name and another column with a combobox showing all the comments made by the user. The datagrid definition is like this: <DataGrid AutoGenerateColumns="False" [layout options...] Name="dataGrid1" ItemsSource="{Binding}"> <DataGrid.Columns> <DataGridTextColumn Header="Name" Binding="{Binding Path=Name}"/> <DataGridComboBoxColumn Header="Comments" SelectedValueBinding="{Binding Path=UserID}" SelectedValuePath="ID" DisplayMemberPath="Title" ItemsSource="{Binding Path=Comments}" /> </DataGrid.Columns> </DataGrid> in the code I assign the DataContext like this: dataGrid1.DataContext = entities.Users; The entity User has a property named Comments that leads to all the comments made by the user. The queries are returning data and the user names are shown but the combobox is not being filled. May be the approach is totally wrong or I'm just missing a very simple point here, I'm opened to learn better methods to do this. Thanks

    Read the article

  • Rails 3 - Category Filter Using Select - Load Partial Via Ajax

    - by fourfour
    Hey. I am trying to filter Client Comments by using a select and rendering it in a partial. Right now the partial loads @client.comments. I have a Category model with a Categorizations join. This all works, just need to know how to get the select to call the filter action and load the partial with ajax. Thanks for you help. Categories controller: def filter_category @categories = Category.all respond_to do |format| format.js # filter.rjs end end filter.js.erb: page.replace_html 'client-not-inner', :partial => 'comments', :locals => { :com => Category.first.comments } show.html.erb (clients) <% form_tag(filter_category_path(:id), :method => :put, :class => 'categories', :remote => true, :controller => 'categoires', :action => 'filter') do %> <label>Categories</label> <%= select_tag(:category, options_for_select(Category.all.map {|category| [category.name, category.id]}, @category_id)) %> <% end %> <div class="client-note-inner"> <%= render :partial => 'comments', :locals => { :com => @comments } %> </div><!--end client-note-inner--> Hope that makes sense. Cheers.

    Read the article

  • Sending mail php

    - by user195257
    Hey, no idea why this sint working, but the message is being sent as "0". I think the e-mail form is what is causing it <?php if ($_POST['check'] == 'checked'){ header("location: /nospamplease.html"); exit(); } $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $date = $_POST['date']; $children = $_POST['children']; $hot = $_POST['hot']; $comments = $_POST['comments']; /*echo $name; echo $email; echo $phone; echo $date; echo $children; echo $hot; echo $comments;*/ if($name == "" || $email == "" || $phone == "" || $date == "" || $children == "" || $hot == "" || $comments == ""){ echo "Please ensure all fields were filled out!"; exit(); }else{ $to = "######"; $subject = "Birthday enquiry"; $message = $message + "Name: "+$name; $message = $message + "Email: "+$email; $message = $message + "Phone: "+$phone; $message = $message + "Date: "+$date; $message = $message + "Children: "+$children; $message = $message + "Hot or cold: "+$hot; $message = $message + "Comments: "+$comments; //echo $message; if(mail($to, $subject, $message)){ echo "Thank you for your enquiry, we will contact you within the next 24 hours! <br /> Click <a href='###'> here</a> to go back to the website!"; }else{ echo "There was an error, contact us directly: <a href='mailto:##'>email</a>"; } } ?> I echoed out the variables, they all are getting posted fine Thanks guys

    Read the article

  • Algorithm to find the percentage of how much two texts are identical

    - by qster
    What algorithm would you suggest to identify how much from 0 to 1 (float) two texts are identical? Note that I don't mean similar (ie, they say the same thing but in a different way), I mean exact same words, but one of the two texts could have extra words or words slightly different or extra new lines and stuff like that. A good example of the algorithm I want is the one google uses to identify duplicate content in websites (X search results very similar to the ones shown have been omitted, click here to see them). The reason I need it is because my website has the ability for users to post comments; similar but different pages currently have their own comments, so many users ended up copy&pasting their comments on all the similar pages. Now I want to merge them (all similar pages will "share" the comments, and if you post it on page A it will appear on similar page B), and I would like to programatically erase all those copy&pasted comments from the same user. I have quite a few million comments but speed shouldn't be an issue since this is a one time thing that will run in the background. The programming language doesn't really matter (as long as it can interface to a MySQL database), but I was thinking of doing it in C++.

    Read the article

  • Architecture with NHibernate and Repositories

    - by Matthew
    I've been reading up on MVC 2 and the recommended patterns, so far I've come to the conclusion (amongst much hair pulling and total confusion) that: Model - Is just a basic data container Repository - Provides data access Service - Provides business logic and acts as an API to the Controller The Controller talks to the Service, the Service talks to the Repository and Model. So for example, if I wanted to display a blog post page with its comments, I might do: post = PostService.Get(id); comments = PostService.GetComments(post); Or, would I do: post = PostService.Get(id); comments = post.Comments; If so, where is this being set, from the repository? the problem there being its not lazy loaded.. that's not a huge problem but then say I wanted to list 10 posts with the first 2 comments for each, id have to load the posts then loop and load the comments which becomes messy. All of the example's use "InMemory" repository's for testing and say that including db stuff would be out of scope. But this leaves me with many blanks, so for a start can anyone comment on the above?

    Read the article

  • Multi-accordion help (CSS issue maybe?)

    - by Josh
    So, I've been trying to develop this multi-accordion news section for this site. It's actually all working, thanks to an insightful plugin. I've modified it a little bit so it works as I want it to, but I've run into two issues, one which is possibly CSS. Issue #1: The idea for the user is that when they view this page, they see all the recent headlines. They can also see who it has been posted by and how many comments have been made to this article. If they wish, they can then click on the headline and the field will expand into the article. They can then either make a comment or view the comments via clicking the View Comments link or clicking the "number of comments" link in the "Posted by..." area (a shortcut to the comments basically). The problem I'm having is if I make the AUTHOR or the "0" comments a link, it breaks the accordion because the accordion uses an A CLASS to open it up. I'm looking for a fix, I've tried making it a H1 or a DIV but that also breaks it. Issue #2: This is a pretty picky one, but when you click the headline it expands, but at least in Firefox (haven't tested it in Chrome yet) the text jumps from the right and to the left, locking in place from which the CSS tells it to (padding-left). I don't know why it's exactly doing that, if anyone has any insight on that, it'd be appreciated. A two-parter to this issue is when you open the Headline to the article and then decide to close the article by clicking on the Headline, parts of the accordion jumps from the darker purple to the light purple before the task is finished. I'm also interested fixing this, but this issue in its entirety are all pretty nit picky things. You can view the demo of the site here: http://www.notedls.com/demo Please if anyone has any advice or fixes, I'd appreciate it, I've been trying to get this all to work to the best of my ability, but I'm clearly no guru or expert. Thanks!

    Read the article

  • Is there an easier way with jQuery accordions?

    - by Josh
    I've been struggling with a feature I've been trying to create for sometime. The idea here is that the user sees the little thumbnail + headline, as well as the Posted By information. They can then click on the headline to expand to the article or click on the "Comments" link to expand directly to the comments made on the article. Or, if they want they can view comments by clicking on the headline(to expand to the article), then click on View Comments (to expand to the comments). In the end, a modular yet flexible and functional open/close system to view latest news. Here is what I've been working on: (I put all my code in one place so its easier on whomever may look at this to view) http://notedls.com/pointtest.html This is what I'm shooting for, but it's far from what I want ;( It's using the jQuery 1.6 plugin, which 1.8 is out but I'm far from being a master or expert at this and I don't think I could build from the ground up. I've already edited this plugin to get it to work like this, but as you can see, the AUTHOR and Comments start making shit hit the fan ;; It's because the code is calling the "A TAG" for the header; which is the headline. Does anyone know any easier way to achieve what I'm envisioning or possible a way to fix this current code? I'm pretty desperate at this point ;;

    Read the article

  • how do I insert an hidden token in my form to prevent double posts? (PHP)

    - by jpjp
    I want to prevent users from accidentally posting a comment twice. I use the PRG (post redirect get) method, so that I insert the data on another page then redirect the user back to the page which shows the comment. This allows users to refresh as many times as they want. However this doesn't work when the user goes back and clicks submit again or when they click submit 100 times really fast. I don't want 100 of the same comments. I looked at related questions on SO and found that a token is best. But I am having trouble using it. //makerandomtoken(20) returns a random 20 length char. <form method="post" ... > <input type="text" id="comments" name="comments" class="commentbox" /><br/> <input type="hidden" name="_token" value="<?php echo $token=makerandomtoken(20); ?>" /> <input type="submit" value="submit" name="submit" /> </form> if (isset($_POST['submit']) && !empty($comments)) { $comments= mysqli_real_escape_string($dbc,trim($_POST['comments'])); //how do I make the if-statment to check if the token has been already set once? if ( ____________){ //don't insert comment because already clicked submit } else{ //insert the comment into the database } } So I have the token as a hidden value, but how do I use that to prevent multiple clicking of submit.

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >