Search Results

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

Page 9/226 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • How to ignore comments when reading a XML file into a XmlDocument?

    - by tunnuz
    Possible duplicate: How to remove all comment tags from XmlDocument Hello, I am trying to read a XML document with C#, I am doing it this way: XmlDocument myData = new XmlDocument(); myData.Load("datafile.xml"); anyway, I sometimes get comments when reading XmlNode.ChildNodes. For the benefit of who's experiencing the same requirement, here's how I did it at the end: /** Validate a file, return a XmlDocument, exclude comments */ private XmlDocument LoadAndValidate( String fileName ) { // Create XML reader settings XmlReaderSettings settings = new XmlReaderSettings(); settings.IgnoreComments = true; // Exclude comments settings.ProhibitDtd = false; settings.ValidationType = ValidationType.DTD; // Validation // Create reader based on settings XmlReader reader = XmlReader.Create(fileName, settings); try { // Will throw exception if document is invalid XmlDocument document = new XmlDocument(); document.Load(reader); return document; } catch (XmlSchemaException) { return null; } } Thank you Tommaso

    Read the article

  • How to extend the comments framework (django) by removing unnecesary fields?

    - by Ignacio
    Hi, I've been reading on the django docs about the comments framework and how to customize it (http://docs.djangoproject.com/en/1.1/ref/contrib/comments/custom/) In that page, it shows how to add new fields to a form. But what I want to do is to remove unnecesary fields, like URL, email (amongst other minor mods.) On that same doc page it says the way to go is to extend my custom comments class from BaseCommentAbstractModel, but that's pretty much it, I've come so far and now I'm at a loss. I couldn't find anything on this specific aspect.

    Read the article

  • What are the virtues of using XML comments in .NET?

    - by Michal Czardybon
    I can't understand the virtues of using XML comments. I know they can be converted into nice documentation external to the code, but the same can be achieved with the much more concise DOxygen syntax. In my opinion the XML comments are wrong, because: They obfuscate the comments and the code in general. (They are more difficult to read by humans). Less code can be viewed on a single screen, because "summary" and "/summary" take additional lines. They suggest that all method parameters have to be commented, whereas 90% of them are obvious and SHOULD be left not commented. The only problem I have with this is that my point of view seems to be in minority. Why?

    Read the article

  • Help with an SQL query on a single (comments) table (screenshot included)

    - by citrus
    Please see screenshot Goal: id like to have comments nested 1 level deep The comments would be arranged so that rating of the parent is in descending order the rating of the children comments is irrelevant The left hand side of the screenshot shows the output that Id like. The RHS shows the table data. All of the comments are held in 1 table. Im a beginner with SQL queries, the best I can do is: SELECT * FROM [Comments] WHERE ([ArticleId] = @ArticleId) ORDER BY [ThreadId] DESC, [DateMade] This somewhat does the job, but it obviously neglects the rating. So the above statement would show output where Bobs Comment and all of the children comments are before Amy's and her childrens comments. How can I run this query correctly?

    Read the article

  • How to create a JAX-RS service where the sub-resource @Path doesn't have a leading slash

    - by Matt
    I've created a JAX-RS service (MyService) that has a number of sub resources, each of which is a subclass of MySubResource. The sub resource class being chosen is picked based on the parameters given in the MyService path, for example: @Path("/") @Provides({"text/html", "text/xml"}) public class MyResource { @Path("people/{id}") public MySubResource getPeople(@PathParam("id") String id) { return new MyPeopleSubResource(id); } @Path("places/{id}") public MySubResource getPlaces(@PathParam("id") String id) { return new MyPlacesSubResource(id); } } where MyPlacesSubResource and MyPeopleSubResource are both sub-classes of MySubResource. MySubResource is defined as: public abstract class MySubResource { protected abstract Results getResults(); @GET public Results get() { return getResults(); } @GET @Path("xml") public Response getXml() { return Response.ok(getResults(), MediaType.TEXT_XML_TYPE).build(); } @GET @Path("html") public Response getHtml() { return Response.ok(getResults(), MediaType.TEXT_HTML_TYPE).build(); } } Results is processed by corresponding MessageBodyWriters depending on the mimetype of the response. While this works it results in paths like /people/Bob/html or /people/Bob/xml where what I really want is /people/Bob.html or /people/Bob.xml Does anybody know how to accomplish what I want to do?

    Read the article

  • Database model for keeping track of likes/shares/comments on blog posts over time

    - by gage
    My goal is to keep track of the popular posts on different blog sites based on social network activity at any given time. The goal is not to simply get the most popular now, but instead find posts that are popular compared to other posts on the same blog. For example, I follow a tech blog, a sports blog, and a gossip blog. The tech blog gets waaay more readership than the other two blogs, so in raw numbers every post on the tech blog will always out number views on the other two. So lets say the average tech blog post gets 500 facebook likes and the other two get an average of 50 likes per post. Then when there is a sports blog post that has 200 fb likes and a gossip blog post with 300 while the tech blog posts today have 500 likes I want to highlight the sports and gossip blog posts (more likes than average vs tech blog with more # of likes but just average for the blog) The approach I am thinking of taking is to make an entry in a database for each blog post. Every x minutes (say every 15 minutes) I will check how many likes/shares/comments an entry has received on all the social networks (facebook, twitter, google+, linkeIn). So over time there will be a history of likes for each blog post, i.e post 1234 after 15 min: 10 fb likes, 4 tweets, 6 g+ after 30 min: 15 fb likes, 15 tweets, 10 g+ ... ... after 48 hours: 200 fb likes, 25 tweets, 15 g+ By keeping a history like this for each blog post I can know the average number of likes/shares/tweets at any give time interval. So for example the average number of fb likes for all blog posts 48hrs after posting is 50, and a particular post has 200 I can mark that as a popular post and feature/highlight it. A consideration in the design is to be able to easily query the values (likes/shares) for a specific time-frame, i.e. fb likes after 30min or tweets after 24 hrs in-order to compute averages with which to compare against (or should averages be stored in it's own table?) If this approach is flawed or could use improvement please let me know, but it is not my main question. My main question is what should a database scheme for storing this info look like? Assuming that the above approach is taken I am trying to figure out what a database schema for storing the likes over time would look like. I am brand new to databases, in doing some basic reading I see that it is advisable to make a 3NF database. I have come up with the following possible schema. Schema 1 DB Popular Posts Table: Post post_id ( primary key(pk) ) url title Table: Social Activity activity_id (pk) url (fk) type (i.e. facebook,twitter,g+) value timestamp This was my initial instinct (base on my very limited db knowledge). As far as I under stand this schema would be 3NF? I searched for designs of similar database model, and found this question on stackoverflow, http://stackoverflow.com/questions/11216080/data-structure-for-storing-height-and-weight-etc-over-time-for-multiple-users . The scenario in that question is similar (recording weight/height of users overtime). Taking the accepted answer for that question and applying it to my model results in something like: Schema 2 (same as above, but break down the social activity into 2 tables) DB Popular Posts Table: Post post_id (pk) url title Table: Social Measurement measurement_id (pk) post_id (fk) timestamp Table: Social stat stat_id (pk) measurement_id (fk) type (i.e. facebook,twitter,g+) value The advantage I see in schema 2 is that I will likely want to access all the values for a given time, i.e. when making a measurement at 30min after a post is published I will simultaneous check number of fb likes, fb shares, fb comments, tweets, g+, linkedIn. So with this schema it may be easier get get all stats for a measurement_id corresponding to a certain time, i.e. all social stats for post 1234 at time x. Another thought I had is since it doesn't make sense to compare number of fb likes with number of tweets or g+ shares, maybe it makes sense to separate each social measurement into it's own table? Schema 3 DB Popular Posts Table: Post post_id (pk) url title Table: fb_likes fb_like_id (pk) post_id (fk) timestamp value Table: fb_shares fb_shares_id (pk) post_id (fk) timestamp value Table: tweets tweets__id (pk) post_id (fk) timestamp value Table: google_plus google_plus_id (pk) post_id (fk) timestamp value As you can see I am generally lost/unsure of what approach to take. I'm sure this typical type of database problem (storing measurements overtime, i.e temperature statistic) that must have a common solution. Is there a design pattern/model for this, does it have a name? I tried searching for "database periodic data collection" or "database measurements over time" but didn't find anything specific. What would be an appropriate model to solve the needs of this problem?

    Read the article

  • Reporter seeking comments on computer science education [closed]

    - by user63982
    I'm a reporter doing a story for a tech website on computer science education, the need for software engineers, and the proficiency of new engineer hires. I would love to chat or exchange emails with anyone on this site who has an opinion on cs education and whether it did or did not prepare them for a job, and the pluses and minuses of the theoretical vs. the practical. I saw 1051's post and its comments and would love to connect with the poster and any of the commenters. Or anyone else with an opinion. I look forward to hearing from you. Thank you.

    Read the article

  • nginx proxypath https redirect fails without trailing slash

    - by Thermionix
    I'm trying to setup Nginx to forward requests to several backend services using proxy_pass. The links on the pages that lack trailing slashes do have https:// in front, but get redirected to a http request with a trailing slash - which ends in connection refused - I only want these services to be available through https. So if a link is too https://example.com/internal/errorlogs in a browser when loaded https://example.com/internal/errorlogs gives Error Code 10061: Connection refused (it redirects to http://example.com/internal/errorlogs/) If I manually append the trialing slash https://example.com/internal/errorlogs/ it loads I've tried with varied trailing forward slashes appended to the proxypath and location in proxy.conf to no effect, have also added server_name_in_redirect off; This happens on more than one app under nginx, and works in apache reverse proxy Config files; proxy.conf location /internal { proxy_pass http://localhost:8081/internal; include proxy.inc; } .... more entries .... sites-enabled/main server { listen 443; server_name example.com; server_name_in_redirect off; include proxy.conf; ssl on; } proxy.inc proxy_connect_timeout 59s; proxy_send_timeout 600; proxy_read_timeout 600; proxy_buffer_size 64k; proxy_buffers 16 32k; proxy_pass_header Set-Cookie; proxy_redirect off; proxy_hide_header Vary; proxy_busy_buffers_size 64k; proxy_temp_file_write_size 64k; proxy_set_header Accept-Encoding ''; proxy_ignore_headers Cache-Control Expires; proxy_set_header Referer $http_referer; proxy_set_header Host $host; proxy_set_header Cookie $http_cookie; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Ssl on; proxy_set_header X-Forwarded-Proto https; curl output -$ curl -I -k https://example.com/internal/errorlogs/ HTTP/1.1 200 OK Server: nginx/1.0.5 Date: Thu, 24 Nov 2011 23:32:07 GMT Content-Type: text/html;charset=utf-8 Connection: keep-alive Content-Length: 14327 -$ curl -I -k https://example.com/internal/errorlogs HTTP/1.1 301 Moved Permanently Server: nginx/1.0.5 Date: Thu, 24 Nov 2011 23:32:11 GMT Content-Type: text/html;charset=utf-8 Connection: keep-alive Content-Length: 127 Location: http://example.com/internal/errorlogs/

    Read the article

  • Hide .php add a slash

    - by Matthew
    This script works perfect it forces the trailing slash and hides the .php extension BUT! it does not redirect people going directly to the .php extension. How can I also force people going directly to the file.php to /file/ RewriteEngine On RewriteRule ^(.*)/$ /$1.php [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://www.mysite.com/$1/ [R=301,L]

    Read the article

  • triple duplicate acknowledgement in TCP congestion control

    - by Salvador Dali
    If this doesn't belong here, please tell me where is an appropriate place for such question. I am trying to understand ideas behind tcp congestion control mechanisms, and I am failing to understand why we need triple duplicate acknowledgement to trigger window change. In my opinion, double duplicate acknowledgement will be enough to get that the previous package is lost. So why we need the third ack?

    Read the article

  • Adding SSI support causes mod_dir "trailing slash" redirect to stop working

    - by freethinker
    I have enabled SSI using the following directives in .htaccess AddHandler server-parsed .html AddOutputFilter INCLUDES html However when I add these, the trailing slash redirects stop working. For eg. http://testwp.humbug.in/test/index.html works fine but http://testwp.humbug.in/test/ doesn't work. In chrome it gives a "Error 324 (net::ERR_EMPTY_RESPONSE)" error while in firefox it shows a blank page. What additional configuration do I need for both mod_dir and mod_include to work properly?

    Read the article

  • Add a trailing slash mod_rewrite

    - by Conner Stephen McCabe
    just wondering how I add a trailing slash at the end of my URL's using Mod_Rewrite? This is my .htaccess file currently: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]*)$ index.php?pageName=$1 My URL show like so: wwww.**.com/pageName I want it to show like so: wwww.**.com/pageName/ The URL is holding a GET request internally, but I want it to look like a genuine directory.

    Read the article

  • Slash after domain in URL missing for Rails site

    - by joshee
    After redirecting users in a Rails app, for some reason the slash after the domain is missing. Generated URLs are invalid and I'm forced to manually correct them. The problem only occurs on a subdomain. On a different primary domain (same server), everything works ok. For example, after logging out, the site is directing to https://www.sub.domain.comlogin/ rather than https://www.sub.domain.com/login I suspect the issue has something to do with the vhost setup, but I'm not sure. Here are the broken and working vhosts: BROKEN SUBDOMAIN <VirtualHost *:80> ServerName www.sub.domain.com ServerAlias sub.domain.com Redirect permanent / https://www.sub.domain.com </VirtualHost> <VirtualHost *:443> ServerAdmin [email protected] ServerName www.sub.domain.com ServerAlias sub.domain.com RailsEnv production # SSL Engine Switch SSLEngine on # SSL Cipher Suite: SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL # Server Certificate SSLCertificateFile /path/to/server.crt # Server Private Key SSLCertificateKeyFile /path/to/server.key # Set header to indentify https requests for Mongrel RequestHeader set X_FORWARDED_PROTO "https" BrowserMatch ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 DocumentRoot /home/usr/www/www.sub.domain.com/current/public/ <Directory "/home/usr/www/www.sub.domain.com/current/public"> AllowOverride all Allow from all Options -MultiViews </Directory> WORKING PRIMARY DOMAIN <VirtualHost *:80> ServerName www.diffdomain.com ServerAlias diffdomain.com Redirect permanent / https://www.diffdomain.com </VirtualHost> <VirtualHost *:443> ServerAdmin [email protected] ServerName www.diffdomain.com ServerAlias diffdomain.com ServerAlias *.diffdomain.com RailsEnv production # SSL Engine Switch SSLEngine on # SSL Cipher Suite: SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL # Server Certificate SSLCertificateFile /path/to/server.crt # Server Private Key SSLCertificateKeyFile /path/to/server.key # Set header to indentify https requests for Mongrel RequestHeader set X_FORWARDED_PROTO "https" BrowserMatch ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 DocumentRoot /home/usr/www/www.diffdomain.com/current/public/ <Directory "/home/usr/www/www.diffdomain.com/current/public"> AllowOverride all Allow from all Options -MultiViews </Directory> </VirtualHost> Please let me know if there's anything else I could provide that would help determine what's wrong here. UPDATE tried adding a trailing slash to the redirect command, but still no luck.

    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

  • Any way to automatically wrap comments at column 80 in Visual Studio 2008? ..or display where column

    - by Jon Cage
    Is there any way to automatically wrap comments at the 80-column boundary as you type them? ..or failing that, any way to display a faint line at the coulmn 80 boundary to make wrapping them manually a little easier? Several other IDEs I use have one or other of those functions and it makes writing comments that wrap in sensible places much easier/quicker. [Edit] If (like me) you're using Visual C++ Express, you need to change the VisualStudio part of the key into VCExpress - had me confused for a while there!

    Read the article

  • .NET: How to ignore comments when reading a XML file into a XmlDocument?

    - by tunnuz
    Hello, I am trying to read a XML document with C#, I am doing it this way: XmlDocument myData = new XmlDocument(); myData.Load("datafile.xml"); anyway, I sometimes get comments when reading XmlNode.ChildNodes. Is there a way to avoid that? I know that you can avoid reading comments if you use XmlReader, but then, how to get the XmlDocument out of a XmlReader? Thank you Tommaso

    Read the article

  • Using the slash character in Git branch name

    - by faB
    I'm pretty sure I saw somewhere in a popular Git project the branches had a pattern like "feature/xyz". However when I try to create a branch with the slash character, I get an error: $ git branch foo/bar error: unable to resolve reference refs/heads/labs/feature: Not a directory fatal: Failed to lock ref for update: Not a directory Same problem for (my initial attempt): $ git checkout -b foo/bar How does one create a branch in Git with the slash character?

    Read the article

  • Using disqus for a website (question on SERP and backlink)

    - by Homunculus Reticulli
    I am building a website and am trying to decide between writing my own commenting system and using disquss. One of the main deciding factors is that (obviously), I want comments left on my page to be show on SERPS. However, I remeber reading somewhere that disqus loads comments into a page using AJAX - and therefore the comments are "invisible" as far as Googlebot and other SE crawlers are concerned. Could someone confirm or refute this? The other question I have is about whether (as a commenter), When I place a comment on another website using disqus (including any links I may add to my comment), do the lionks in my comment count as a backlink (in other words are they "dofollow" or "nofollow" links)?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >