Search Results

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

Page 26/226 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • How do I add a trailing slash for Django MPTT-based categorization app?

    - by Patrick Beeson
    I'm using Django-MPTT to develop a categorization app for my Django project. But I can't seem to get the regex pattern for adding a trailing slash that doesn't also break on child categories. Here's an example URL: http://mydjangoapp.com/categories/parentcat/childcat/ I'd like to be able to use http://mydjangoapp.com/categories/parentcat and have it redirect to the trailing slash version. The same should apply to http://mydjangoapp.com/categories/parentcat/childcat (it should redirect to http://mydjangoapp.com/categories/parentcat/childcat/). Here's my urls.py: from django.conf.urls.defaults import patterns, include, url from django.views.decorators.cache import cache_page from storefront.categories.models import Category from storefront.categories.views import SimpleCategoryView urlpatterns = patterns('', url(r'^(?P<full_slug>[-\w/]+)', cache_page(SimpleCategoryView.as_view(), 60 * 15), name='category_view'), ) And here is my view: from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import reverse from django.views.generic import TemplateView, DetailView from django.views.generic.detail import SingleObjectTemplateResponseMixin, SingleObjectMixin from django.utils.translation import ugettext as _ from django.contrib.syndication.views import Feed from storefront.categories.models import Category class SimpleCategoryView(TemplateView): def get_category(self): return Category.objects.get(full_slug=self.kwargs['full_slug']) def get_context_data(self, **kwargs): context = super(SimpleCategoryView, self).get_context_data(**kwargs) context["category"] = self.get_category() return context def get_template_names(self): if self.get_category().template_name: return [self.get_category().template_name] else: return ['categories/category_detail.html'] And finally, my model: from django.db import models from mptt.models import MPTTModel from mptt.fields import TreeForeignKey class CategoryManager(models.Manager): def get(self, **kwargs): defaults = {} defaults.update(kwargs) if 'full_slug' in defaults: if defaults['full_slug'] and defaults['full_slug'][-1] != "/": defaults['full_slug'] += "/" return super(CategoryManager, self).get(**defaults) class Category(MPTTModel): title = models.CharField(max_length=255) description = models.TextField(blank=True, help_text='Please use <a href="http://daringfireball.net/projects/markdown/syntax">Markdown syntax</a> for all text-formatting and links. No HTML is allowed.') slug = models.SlugField(help_text='Prepopulates from title field.') full_slug = models.CharField(max_length=255, blank=True) template_name = models.CharField(max_length=70, blank=True, help_text="Example: 'categories/category_parent.html'. If this isn't provided, the system will use 'categories/category_detail.html'. Use 'categories/category_parent.html' for all parent categories and 'categories/category_child.html' for all child categories.") parent = TreeForeignKey('self', null=True, blank=True, related_name='children') objects = CategoryManager() class Meta: verbose_name = 'category' verbose_name_plural = 'categories' def save(self, *args, **kwargs): orig_full_slug = self.full_slug if self.parent: self.full_slug = "%s%s/" % (self.parent.full_slug, self.slug) else: self.full_slug = "%s/" % self.slug obj = super(Category, self).save(*args, **kwargs) if orig_full_slug != self.full_slug: for child in self.get_children(): child.save() return obj def available_product_set(self): """ Returns available, prioritized products for a category """ from storefront.apparel.models import Product return self.product_set.filter(is_available=True).order_by('-priority') def __unicode__(self): return "%s (%s)" % (self.title, self.full_slug) def get_absolute_url(self): return '/categories/%s' % (self.full_slug)

    Read the article

  • What does a forward slash before a pipe in cmd do to remove the line ending of an echo?

    - by user66001
    This code: @echo off echo/|set /p ="Executing backup...." echo/|set /p =" backup procedure" ... came from Echoing in the same line and produces the below output in a cmd window: Executing backup....backup procedure However, I cant seem to find an explanation through google on what the forward slash does to the ¿pipe? to cause set's output to be echoed to the console / stdout If anyone could also suggest a good website for learning more about cmd / cmd programs' features like this, it would be appreciated.

    Read the article

  • Is there a browser independet bookmarktool supporting tags, date and free comments?

    - by bernd_k
    I am looking for a tool, which helps me to organize my personal bookmarks. I want to be able to assign tags and free comments to a bookmark. I want to search my bookmarks by tags date of bookmarking pattern in title pattern in url It would be nice to be web based to enable sharing my bookmarks between different machines. But for it would be OK, if it works on a single machine as long as it has some import/export way to transfer the links to a new machine replacing the old. As browsers I'm using Firefox and ChromePlus. It would be nice, if the solution works with both browsers. With free comments, I mean additional remarks stored for a bookmark, which is not essential for searching.

    Read the article

  • MySQL Subquery LIMIT

    - by atif089
    As the title says, I wanted a workaround for this... SELECT comments.comment_id, comments.content_id, comments.user_id, comments.`comment`, comments.comment_time, NULL FROM comments WHERE (comments.content_id IN (SELECT content.content_id FROM content WHERE content.user_id = 1 LIMIT 0, 10)) Cheers

    Read the article

  • https://www.googleapis.com/drive/v2/files/<fileid>/comments?alt=json returned "Not Found" on a file that can't be opened

    - by Kartik Ayyar
    More details as below: https://www.googleapis.com/drive/v2/files/1iNMGIAFXuhS_CO_hnEO0_EJ9PAgT-hXYqWYv0MPGUTI/comments?alt=json returned "Not Found The file is present in drive and shows in drive.changes.list, but can't be opened in Google Drive either. There are two problems here a) the file is somehow corrupt ( it was a document imported into drive, so that failed, but that isn't something I care about for the purposes of this question ) b) The file shows up as existing in some API calls, but calls to read comments with the Drive SDK comments API fail. Here are results from an API call showing how the file does indeed exist: "file": { "kind": "drive#file", "id": "1iNMGIAFXuhS_CO_hnEO0_EJ9PAgT-hXYqWYv0MPGUTI", "etag": "\"o35FABD0TC3H-Up3OL3UA9kEB2w/MTM3MTc2NzU5NzEyNA\"", .... .... "iconLink": "https://ssl.gstatic.com/docs/doclist/images/icon_11_document_list.png", "title": "<removed>", "mimeType": "application/vnd.google-apps.document", "labels": { "starred": false, "hidden": false, "trashed": true, "restricted": false, "viewed": true },

    Read the article

  • Why it is necessary to put comments on check-ins? [closed]

    - by Mik Kardash
    In fact, I always have something to put in when I perform a check-in of my code. However, the question I have is - Is it really so necessary? Does it help so much? How? From one point of view, comments can help you to keep track of changes performed with every check-in. Thus, I will be able to analyze the changes and identify a hypothetic problem a little bit quicker. On the other hand, it takes some time to write useful information into check-in. Is it worth it? What are the pros and cons of writing comments to every check-in? Is there any way to write "efficient" check-in comments?

    Read the article

  • How to implement partial refresh like facebook like/comments?

    - by shillong
    We have java web application. Summary page will display list of rows. For each row, user can vote and add comments. Vote or add comments will commit immediately and refresh total vote number and comments count. We want to refresh current row instead of whole table just like Facebook does. If need, we can show the list of data with form format (iterator List of data) instead of table format. How to implement this feature base on JSF?

    Read the article

  • Documentation for Qt documentation comments? Qt + Doxygen?

    - by Jake Petroules
    Where can I find documentation for Qt documentation comments? I'm referring to how Qt uses a specific style for documentation comments, like so: /*! \class MyClassName \brief The MyClassName class is used as an example on Stack Overflow. This class serves a few functions, the most important being: \list \i So people can understand my question. \i So people can have a few laughs at the comedy in my example. \endlist */ ...you get the picture. So where can I find information about all the switches, like \class, \list, \brief, etc. Also, what tool(s) do I use to generate documentation files from these comments in my source files? Does Doxygen support this syntax?

    Read the article

  • Why we used double and triple pointer in objective-C or C language?

    - by Rajendra Bhole
    Hi, I confused when i want to take single pointer and when should i take double pointer? In following structure what exactly did? struct objc_class { Class isa; Class super_class; const char *name; long version; long info; long instance_size; struct objc_ivar_list *ivars; struct objc_method_list **methodLists; struct objc_cache *cache; struct objc_protocol_list *protocols; }; Why we use the "**methodLists" double pointer. Edited int sqlite3_get_table( sqlite3 *db, const char zSql, char **pazResult, int *pnRow, int *pnColumn, char *pzErrmsg ); In above scenario what will be meaning of triple pointer char **pazResult?

    Read the article

  • Need help with a sub query/group/order (get latest comment for each ordered topic)

    - by Scarface
    Hey guys I have a query that currently finds the latest comment for each of a user's topics and then orders topics by that comment's timestamp. What I want to do is expand on this query's use and print the latest comment for each topic. The problem with this query is that while it orders the topics correctly, it prints seemingly random comments for each topic. I am trying to implement a sub query but I am not quite sure how to approach it. I was thinking that I just had to somehow use this query to get the comments. If anyone has any ideas I would really appreciate it. Here is what I think I need to add SELECT * FROM comments where topic_id='$topic_id' ORDER BY timestamp DESC LIMIT 1 Here is the query I need to modify SELECT topic.topic_title, topic.content_type, topic.subject_id, topic.creator, topic.description, topic.topic_id,comments.message,comments.user FROM comments JOIN topic ON topic.topic_id = comments.topic_id WHERE topic.creator = '$user' AND comments.timestamp > $week GROUP BY topic_id ORDER BY MAX(comments.timestamp) DESC

    Read the article

  • Now Customers Can Actually Locate Your Resources with URL Rewriter 2.0 RTW

    - by The Official Microsoft IIS Site
    Today, Microsoft announced the final release of IIS URL Rewriter 2.0 RTW . Now the first reason might be obvious why you would want to rewrite a URL – when you are at a cocktail party with loud music and tasty appetizers and a potential customer asks you where they can get more info on your snazzy new idea. And you proudly blurt out next to their ear over the roar of the bass, “Just go to h-t-t-p colon slash slash w-w-w dot my new idea dot com slash items dot a-s-p-x question mark cat ID equals new...(read more)

    Read the article

  • Will adsense 'use' comments between the adsense opening and closing tags for ad targeting?

    - by SuperSpy
    I've got a simple website on which students of my school can see their timetable. I setup adsense three weeks ago and everything is working fine. But I would like to help adsense. Since only a timetable and a few instructions are shown, there is scarcely content to which ads can relate. Idea: <!- google_ad_section_start –> <!-- Students like clothing ... and bargains, etc.--> <!– google_ad_section_end –> Will this work? Or are there other ways to help adsense?

    Read the article

  • Triple Boot?? Windows 7, Windows 7 and Ubuntu??

    - by BillJeansk
    Hello, currently I have dual boot with 2 windows 7. (dont ask why, long story, I need them for each with different settings involving Audio Recording) I am very keen to install the new Ubuntu and get into a new OS, out of interest but I don't want to mess with my current 2 windows installations? If I install Ubuntu, will this simply add to my list of OS boot options when you set it, like I did when I install my 2nd Windows 7 Any comments or help would be great? Thanks Bill

    Read the article

  • How to wrtie a XML License Line(ended with a forward slash '/') in C#?

    - by Nano HE
    I want to write a XML file as below: <?xml version="1.0" encoding="UTF-8"?> <books xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <License licenseId="" licensePath="" /> Some piece of my code attached here // Create a new file in D:\\ and set the encoding to UTF-8 XmlTextWriter textWriter = new XmlTextWriter("D:\\books.xml", System.Text.Encoding.UTF8); // Format automatically textWriter.Formatting = Formatting.Indented; // Opens the document textWriter.WriteStartDocument(); // Write the namespace declaration. textWriter.WriteStartElement("books", null); // Write the genre attribute. textWriter.WriteAttributeString("xmlns", "xsd", null, "http://www.w3.org/2001/XMLSchema"); textWriter.WriteAttributeString("xmlns", "xsi", null, "http://www.w3.org/2001/XMLSchema-instance"); And now I need to write the License Line below in C# <License licenseId="" licensePath="" /> But I don't know how to move on for I found the Line ended with the forward slash / .Thank you.

    Read the article

  • Triple Quotes? How do I delimit a databound Javascript string parameter in ASP.NET?

    - by David HAust
    How do I delimit a Javascript databound string parameter in an anchor OnClick event? I have an anchor tag in an ASP.NET Repeater control. The OnClick event of the anchor contains a call to a Javascript function. The Javascript funciton takes a string for it's input parameter. The string parameter is populated with a databound value from the Repeater. I need the 'double quotes' for the Container.DataItem. I need the 'single quotes' for the OnClick. And I still need one more delimiter (triple quotes?) for the input string parameter of the Javascript function call. Since I can't use 'single quotes' again, how do I ensure the Javascript function knows the input parameter is a string and not an integer? Without the extra quotes around the input string parameter, the Javascript function thinks I'm passing in an integer. Cheers in advance for any knowledge you can drop. The anchor: <a id="aShowHide" onclick='ToggleDisplay(<%# DataBinder.Eval(Container.DataItem, "JobCode") %>);' >Show/Hide</a> and here is the Javascript: <script language="JavaScript" type="text/javascript">/* Shows/Hides the Jobs Div */ function ToggleDisplay(jobCode) { /* Each div has it's ID set dynamically ('d' plus the JobCode) */ var elem = document.getElementById('d' + jobCode); if (elem) { if (elem.style.display != 'block') { elem.style.display = 'block'; elem.style.visibility = 'visible'; } else { elem.style.display = 'none'; elem.style.visibility = 'hidden'; } } }</script>

    Read the article

  • Visual Studio: Collapse Methods, but not Comments (Summary etc.)

    - by Alex
    Hello, is there a way (settings? "macro"? extension?) that I can simply toggle outlining so that only the using section and my methods collapse to their signature line, but my comments (summary and double slash comments) and classes stay expanded? Examples: 1) Uncollapsed using System; using MachineGun; namespace Animals { /// <summary> /// Angry animal /// Pretty Fast, too /// </summary> public partial class Lion { // // Dead or Alive public Boolean Alive; /// <summary> /// Bad bite /// </summary> public PieceOfAnimal Bite(Animal animalToBite) { return animalToBite.Shoulder; } /// <summary> /// Fatal bite /// </summary> public PieceOfAnimal Kill(Animal animalToKill) { return animalToKill.Head; } } } 2) Collapsed (the following is my desired result): using[...] namespace Animals { /// <summary> /// Angry animal /// Pretty Fast, too /// </summary> public partial class Lion { // // Dead or Alive public Boolean Alive; /// <summary> /// Bad bite /// </summary> public PieceOfAnimal Bite(Animal animalToBite)[...] /// <summary> /// Fatal bite /// </summary> public PieceOfAnimal Kill(Animal animalToKill)[...] } } This is how I prefer seeing my class files (the collapsed form). I've been doing the collapsing by hand a million times by now and I think there should be a way to automate/customize/extend VS to do it the way I want? Every time I debug/hit a breakpoint, it uncollapses and messes up things. If I collapse via the context menu's collapse to outline etc. it also collapses my comments which isn't desired. Appreciate your help!

    Read the article

  • Get your content off Blogger.com

    - by Daniel Moth
    Due to blogger.com deprecating FTP users I've decided to move my blog. When I think of the content of a blog, 4 items come to mind: blog posts, comments, binary files that the blog posts linked to (e.g. images, ZIP files) and the CSS+structure of the blog. 1. Binaries The binary files you used in your blog posts are sitting on your own web space, so really blogger.com is not involved with that. Nothing for you to do at this stage, I'll come back to these in another post. 2. CSS and structure In the best case this exists as a separate CSS file on your web space (so no action for now) or in a worst case, like me, your CSS is embedded with the HTML. In the latter case, simply navigate from you dashboard to "Template" then "Edit HTML" and copy paste the contents of the box. Save that locally in a txt file and we'll come back to that in another post. 3. Blog posts and Comments The blog posts and comments exist in all the HTML files on your own web space. Parsing HTML files to extract that can be painful, so it is easier to download the XML files from blogger's servers that contain all your blog posts and comments. 3.1 Single XML file, but incomplete The obvious thing to do is go into your dashboard "Settings" and under the "Basic" tab look at the top next to "Blog Tools". There is a link there to "Export blog" which downloads an XML file with both comments and posts. The problem with that is that it only contains 200 comments - if you have more than that, you will lose the surplus. Also, this XML file has a lot of noise, compared to the better solution described next. (note that a tool I will refer to in a future post deals with either kind of XML file) 3.2 Multiple XML files First you need to find your blog ID. In case you don't know what that is, navigate to the "Template" as described in section 2 above. You will find references to the blog id in the HTML there, but you can also see it as part of the URL in your browser: blogger.com/template-edit.g?blogID=YOUR_NUMERIC_ID. Mine is 7 digits. You can now navigate to these URLs to download the XML for your posts and comments respectively: blogger.com/feeds/YOUR_NUMERIC_ID/posts/default?max-results=500&start-index=1 blogger.com/feeds/YOUR_NUMERIC_ID/comments/default?max-results=200&start-index=1 Note that you can only get 500 posts at a time and only 200 comments at a time. To get more than that you have to change the URL and download the next batch. To get you started, to get the XML for the next 500 posts and next 200 comments respectively you’d have to use these URLs: blogger.com/feeds/YOUR_NUMERIC_ID/posts/default?max-results=500&start-index=501 blogger.com/feeds/YOUR_NUMERIC_ID/comments/default?max-results=200&start-index=201 ...and so on and so forth. Keep all the XML files in the same folder on your local machine (with nothing else in there). 4. Validating the XML aka editing older blog posts The XML files you just downloaded really contain HTML fragments inside for all your blog posts. If you are like me, your blog posts did not conform to XHTML so passing them to an XML parser (which is what we will want to do) will result in the XML parser choking. So the next step is to fix that. This can be no work at all for you, or a huge time sink or just a couple hours of pain (which was my case). The process I followed was to attempt to load the XML files using XmlDocument.Load and wait for the exception to be thrown from my code. The exception would point to the exact offending line and column which would help me fix the issue. Rather than fix it in the XML itself, I would go back and edit the offending blog post and fix it there - recommended! Then I'd repeat the cycle until the XML could be loaded in the XmlDocument. To give you an idea, some of the issues I encountered are: extra or missing quotes in img and href elements, direct usage of chevrons instead of encoding them as &lt;, missing closing tags, mismatched nested pairs of elements and capitalization of html elements. For a full list of things that may go wrong see this. 5. Opportunity for other changes I also found a few posts that did not have a category assigned so I fixed those too. I took the further opportunity to create new categories and tag some of my blog posts with that. Note that I did not remove/change categories of existing posts, but only added.   In an another post we'll see how to use the XML files you stored in the local folder… Comments about this post welcome at the original blog.

    Read the article

  • Blog comment spammers &hellip; help!

    - by Steve Clements
    Hey, I need some advice/help, now I’ve been writing on this blog for a few years, I don’t blog a great deal in comparison to many of my peers and my blog doesn’t get a massive number of hits, BUT I seem to get a fair share of comments spammers!! I have an image verification on the comments and I have put an Akismet API key into the Geekswithblogs settings, but I still get a bunch of spam comments. They could almost be real, until you see the link going off to some dating site or casino crap. What does everyone do?? Delete them every time?? Moderate comments?? I would rather not moderate comments if possible, but is that the only way to stop the crap?? Thx Technorati Tags: spammers,comments,help

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >