Search Results

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

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

  • How can I embed a conditional comment for IE with innerHTML?

    - by Samuel Charpentier
    Ok so I want to conditionally add this line of code; <!--[if ! IE]> <embed src="logo.svg" type="image/svg+xml" /> <![endif]--> Using: document.getElementById("logo") .innerHTML='...'; In a if()/else() statement and it don't write it! If i get rid of the selective comment ( <!--[if ! IE]><![endif]-->) and only put the SVG ( <embed src="logo.svg" type="image/svg+xml" /> ) it work! what should I do? I found a way around but i think in the Android browser the thing will pop up twice. here's what I've done ( and its Validated stuff!); <!DOCTYPE html> <html> <head> <META CHARSET="UTF-8"> <title>SVG Test</title> <script type="text/javascript"> //<![CDATA[ onload=function() { var ua = navigator.userAgent.toLowerCase(); var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile"); if(isAndroid) { document.getElementById("logo").innerHTML='<img src="fin_palais.png"/>'; } } //]]> </script> </head> <body> <div id="logo"> <!--[if lt IE 9]> <img src="fin_palais.png"/> <![endif]--> <!--[if gte IE 9]><!--> <embed src="fin_palais.svg" type="image/svg+xml" /> <!--<![endif]--> </div> </body>

    Read the article

  • SQL Querying for Threaded Messages

    - by Harper
    My site has a messaging feature where one user may message another. The messages support threading - a parent message may have any number of children but only one level deep. The messages table looks like this: Messages - Id (PK, Auto-increment int) - UserId (FK, Users.Id) - FromUserId (FK, Users.Id) - ParentMessageId (FK to Messages.Id) - MessageText (varchar 200) I'd like to show messages on a page with each 'parent' message followed by a collapsed view of the children messages. Can I use the GROUP BY clause or similar construct to retrieve parent messages and children messages all in one query? Right now I am retrieving parent messages only, then looping through them and performing another query for each to get all related children messages. I'd like to get messages like this: Parent1 Child1 Child2 Child3 Parent2 Child1 Parent3 Child1 Child2

    Read the article

  • Formula for popularity? (based on "like it", "comments", "views")

    - by paullb
    I have some pages on a website and I have to create an ordering based on "popularity"/"activity" The parameters that I have to use are: views to the page comments made on the page (there is a form at the bottom where uses can make comments) clicks made to the "like it" icon Are there any standards for what a formula for popularity would be? (if not opinions are good too) (initially I thought of views + 10*comments + 10*likeit)

    Read the article

  • django threadedcomments

    - by Patrick
    Hi folks, I would like to setup a comment systems on my site, using django threadedcomments, and I follow all the steps in the Tutorial, however, I get the following error: No module named newforms.util I am not sure what causing this issue, here is my configuration: #settings.py INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'myproject.myapp', 'threadedcomments', ) #urls.py from django.conf import settings from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), (r'^threadedcomments/', include('threadedcomments.urls')), ) Please let me know if there is another better choice for commenting, as long as the comment system is flexible and able to do lot of customization, as well as threadedcomment, of coz, integrating with Rating, I am happy to use the other one. Thanks guys.

    Read the article

  • Help to comment a simple statement

    - by Woppie the Russian
    How does you call this statement?: $arr = array(); initialize an array or declare an array? In brief, how would you comment such a statement? (P.S. That array would then hold a bunch of values.) EDIT: I doubt because what I basically do is declare a variable of a particular type, don't I?

    Read the article

  • How do you add < or > to a summary tag in Visual studio?

    - by Tony
    How do you add < (less than) or (greater than) to a summary comment in visual studio? I am in Visual Studio 2008. I have a generic method: public bool IsMemberProtected<T>(Expression<Func<T, object>> expression) Would love to have a summary tag of something like this /// <summary> /// Determines whether a member is protected. /// /// Usage: IsMemberProtected<ExampleType>(x => x.Member) /// </summary> But when I do that, the tooltip for the property no longer works when a developer hovers over the method in code to view the summary tag. Thoughts?

    Read the article

  • Do double forward slashes direct IE to use specific css?

    - by kjh
    I have just found something very weird while developing a website. While trying to get a div element to display across the top of the screen, I noticed that I wasn't achieving a desired result in any browser except for old versions of IE. In order to test some different code, instead of deleting the faulty line, I used '//' to comment it out (I'm not really even sure if that works in css) but what happened was, the compatible browsers used the uncommented code, while IE used the code marked by '//'. here is the code: #ban-menu-div{ position:fixed;top:0; //position:relative; //<-- IE keeps the banner with rel pos while the other display:block; // browsers used fixed margin:auto; padding:0px; width:100%; text-align:center; background:black; } so basically, it seems as though // can be used to instruct newer browsers to ignore specific lines of code, and instruct older versions of IE to use it? If this is common practice someone please let me know. it sure makes developing for older browsers a hell of a lot easier

    Read the article

  • $Id tag in comment headers

    - by Bernhard
    When I read source from open source projects I often find a comment line with "$Id" at the header of the file, f. ex.: // $Id: addappwindowa.c 30792 2009-03-07 22:40:04Z neil $ Is there an "offical" syntax for this lines? (What does "30792" means? ) Are there editors that auto-generate these "$Id"s? Are there any tools that use this information?

    Read the article

  • How do I make TODO comments show up in the task list for C++ projects in Visual Studio 2010?

    - by Chris Simmons
    I'm trying to get my TODO comments to show up in the task list in Visual Studio 2010 for a C++ project, but they don't. I looked at this, but see no caveats other than the TODO comments need to be in the currently-open file. For example, creating a new Win32 console app places this: // TODO: reference additional headers your program requires here in a new file, stdafx.h. However, there's nothing in the task list. I have "Comments" chosen from the drop-down in the task list, but it's always empty. And it's not this problem; I can open the file and be looking at the TODO comment in the code editor and no task is shown. This is not a problem for C# projects as TODO comments show up as designed in those projects; this appears to be an issue specific to C++ projects. What else can I check?

    Read the article

  • Remove specified text from beginning of lines only if present (C#)

    - by Zach
    I have a textbox in which the user can edit text, in a scripting language. I've figured out how to let the user comment out lines in one click, but can't seem to figure out how to uncomment properly. For example, if the box has: Normal Text is here More normal text -- Commented text -- More commented text Normal Text again --Commented Text Again So, when the user selects any amount of text and decides to uncomment, the "--" is removed from the beginning of the lines that have it. The lines without the "--" should be unaffected. In short, I want an uncomment function that performs similar to the one in Visual Studio. Is there any way to accomplish this? Thanks

    Read the article

  • Do you leave historical code commented out in classes that you update?

    - by 18Rabbit
    When you need to obsolete a section of code (say either the business rules changed, or the old system has been reworked to use a new framework or something) do you delete it from the file or do you comment it out and then put in the new functionality? If you comment it out, do you leave a note stating why it was removed and what it was originally intended to do? I ask mainly because I've done a lot of contract work for different places over the years and sometimes it's like excavating a tomb to find the actual code that is still being used. Why comment it out and leave it in the file if source control has a record of what used to be there? If you comment out a method do you also comment out/delete any methods that were exclusively used by that method? What do you think the best practices for this should be?

    Read the article

  • What code commenting style should I use for both C++ and C# ?

    - by ereOn
    Hi, I was recently hired in a company. They have a lot of C++ and C# code source files and almost one different commenting style per file. (Well this is exagerated, but you have the picture) This morning, I show my new collegues how my personnal code was commented and how easy it was to generate a documentation from it (I use Doxygen). I somehow convinced them to use a coherent commenting style. I would suggest using Doxygen for C++ source files and native C# style commenting style for C# files. However, I'm not sure that's the best solution here. Are you aware of a commenting style that would work for both C++ and C# allowing us to generate a documentation from it ? If so, what software/tool should we use ? Having a solution that would work on Linux platforms as well would be even better. Thank you very much.

    Read the article

  • how to model a many to many relationship

    - by Maulin
    Here is the scenario, Articles have many Comments Users can write many Comments for many Articles The comments table contains both user_id article_id as foreign keys My models are set up like so class User < ActiveRecord::Base has_many :comments has_many :articles, :through => :comments class Article < ActiveRecord::Base has_many :comments has_many :users, :through => :comments class Comment < ActiveRecord::Base belongs_to :users belongs_to :articles My routes.rb has the following code map.resources :articles, :has_many => :comments map.resources :users, :has_many => :comments which produces the following routes new_article_comment edit_article_comment new_user_comment edit_user_comment etc... This is not what I want (atleast not what I think I want), since comments must always be related to users and article, how can I get a route like so new_user_article_comment edit_user_article_comment Then I could just do new_user_article_comment_path([@user, @article]) to create a new comment

    Read the article

  • Can I configure Wndows NDES server to use Triple DES (3DES) algorithm for PKCS#7 answer encryption?

    - by O.Shevchenko
    I am running SCEP client to enroll certificates on NDES server. If OpenSSL is not in FIPS mode - everything works fine. In FIPS mode i get the following error: pkcs7_unwrap():pkcs7.c:708] error decrypting inner PKCS#7 139968442623728:error:060A60A3:digital envelope routines:FIPS_CIPHERINIT:disabled for fips:fips_enc.c:142: 139968442623728:error:21072077:PKCS7 routines:PKCS7_decrypt:decrypt error:pk7_smime.c:557: That's because NDES server uses DES algorithm to encrypt returned PKCS#7 packet. I used the following debug code: /* Copy enveloped data from PKCS#7 */ bytes = BIO_read(pkcs7bio, buffer, sizeof(buffer)); BIO_write(outbio, buffer, bytes); p7enc = d2i_PKCS7_bio(outbio, NULL); /* Get encryption PKCS#7 algorithm */ enc_alg=p7enc->d.enveloped->enc_data->algorithm; evp_cipher=EVP_get_cipherbyobj(enc_alg->algorithm); printf("evp_cipher->nid = %d\n", evp_cipher->nid); The last string always prints: evp_cipher-nid = 31 defined in openssl-1.0.1c/include/openssl/objects.h #define SN_des_cbc "DES-CBC" #define LN_des_cbc "des-cbc" #define NID_des_cbc 31 I use 3DES algorithm for PKCS7 requests encryption in my code (pscep.enc_alg = (EVP_CIPHER *)EVP_des_ede3_cbc()) and NDES server accepts these requests, but it always returns answer encrypted with DES. Can I configure Wndows NDES server to use Triple DES (3DES) algorithm for PKCS#7 answer encryption?

    Read the article

  • Emacs hide/show support for C++ triple-slash Doxygen markup?

    - by jsyjr
    I use Doxygen's triple-slash syntax to markup my C++ code. There are two important cases which arise: 1) block markup comments which are the sole element on the line and may or may not begin flush left; e.g. class foo /// A one sentence brief description of foo. The elaboration can /// continue on for many lines. { ... }; void foo::bar /// A one sentence brief description of bar. The elaboration can /// continue on for many lines. () const { ... } 2) trailing markup comments which always follow some number of C++ tokens earlier on the first line but may still spill over onto subsequent lines; e.g. class foo { int _var1; ///< A brief description of _var1. int _var2; ///< A brief description of _var2 ///< requiring additional lines. } void foo::bar ( int arg1 ///< A brief description of arg1. , int arg2 ///< A brief description of arg2 ///< requiring additional lines. ) const { ... } I wonder what hide/show support exists to deal with these conventions. The most important cases are the block markup comments. Ideally I would like to be able to eliminate these altogether, meaning that I would prefer not to waste a line simply to indicate presence of a folded block markup comment. Instead I would like a fringe marker, a la http://www.emacswiki.org/emacs/hideshowvis.el /john

    Read the article

  • Rendering 'belongs_to" in index view question - Ruby on Rails

    - by bgadoci
    I have created a simple blog application with Ruby on Rails. The applications consists of two tables, posts and comments. Comments belongs_to :post and posts has_many :comments. I created posts table with the following columns: title:string, body:text. I created the comments table with the following columns: body:text post_id:integer name:string email:string In the /views/comments/index.html.erb display I would like to show a listing of all comments w/ the post title as well. Currently, the index view only displays post_id, body, name, email. How do I replace the post_id column with the corresponding post title? Here is my code: CommentsController Index action: def index @comments = Comment.all :order => "created_at DESC" respond_to do |format| format.html # index.html.erb format.xml { render :xml => @comments } format.json { render :json => @comments } format.atom end end /views/comments/index.html.erb <h1>Listing comments</h1> <table> <tr> <th>Post</th> <th>Body</th> </tr> <% @comments.each do |comment| %> <tr> <td><%=h comment.post_id %></td> <td><%=h comment.body %></td> <td><%=h comment.name %></td> <td><%=h comment.email %></td> </tr> <% end %> </table> <br />

    Read the article

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