attributes

sort a struct array by attribute value

Ive got a task in C to sort a struct by using qsort struct user { enum SEX{m, f} sex; char name[32]; char phonenr[32]; }; typedef struct user User; the users will be stored in a array of 25 elements but how do i sort them on something like name ? ...

Are reference attributes destroyed when class is destroyed in C++?

Suppose I have a C++ class with an attribute that is a reference: class ClassB { ClassA &ref; public: ClassB(ClassA &_ref); } Of course, the constructor is defined this way: ClassB::ClassB(ClassA &_ref) : ref(_ref) { /* ... */ } My question is: When an instance of class 'ClassB' is destroyed, is the object referenced by 'Cl...

How I can put " within an HTML attribute value

I wish to have the following: <span title="This is a "good" title.">Catch me in the rice.</span> It is obvious that this is not rendered well by the browsers. Please provide me with information of what escape sequence or encoding like " I must use? ...

[VB.Net] System.IO will copy files, but fails to update destinations file attributes

Hello, I have a little vb.net script that will copy a file, set its attributes to Normal, update the file time, and then set back the attributes to match those of the source file. If IO.File.Exists(Destination) Then IO.File.SetAttributes(Destination, IO.FileAttributes.Normal) IO.File.Copy(Source, Destination, True) IO.File.SetAttribut...

Control Attributes render Encoded on dot net 4 - how to disable the encoding ?

I have an issue in asp.net 4. When I add an attribute on controls, then the render it encoded. For example, when I type this code txtQuestion.Attributes["onfocus"] = "if(this.value == this.title) { this.value = ''; this.style.backgroundColor='#FEFDE0'; this.style.color='#000000'; }"; I get render onfocus="if(this.val...

Finding An image tag using the alt text

I would like to know if it was possible using Javascript to find an image tag by its alt text. For instance I have this tag: <img src="Myimage.jpg" alt="Myimage"> would there be a way to obtain the tag by looking for the "Myimage" alt attribute? ...

DataAnnotation attributes buddy class strangeness - ASP.NET MVC

Given this POCO class that was automatically generated by an EntityFramework T4 template (has not and can not be manually edited in any way): public partial class Customer { [Required] [StringLength(20, ErrorMessage = "Customer Number - Please enter no more than 20 characters.")] [DisplayName("Customer Number")] public v...

python class attribute

Hi, i have a question about class attribute in python. class base : def __init__ (self): pass derived_val = 1 t1 = base() t2 = base () t2.derived_val +=1 t2.__class__.derived_val +=2 print t2.derived_val # its value is 2 print t2.__class__.derived_val # its value is 3 The results are different. I also u...

Get name and value from the input tag

Before you say "oh no, not again" here I'm stating my case. I'm parsing part of HTML output and the only thing I'm interested in is name and value attributes of each <input/> tag. HTML is actually HTML fragment, may not be well-formed. I don't have DOM or HTML parser and I don't try to parse nested elements anyway. The problem is that I ...

Is Obsolete attribute only checked at Compile time?

Hi, I wonder that the obsolete attribute is checked at only runtime? Think that you have two assemblies. Assembly A uses a method from Assembly B. After that we mark the method in Assembly B as obsolete which causes a compile time error when compiling assembly A. No problem so far but the question is whether the older assembly A cont...

BizTalk 2009 XSLT and Attribute Value Templates

I'm trying to make use of attribute value type in a BizTalk XSL transformation to dynamically setting attribute or other element names. Read more here: http://www.w3.org/TR/xslt#dt-attribute-value-template The following code is an example of an XSL template to add an attribute optionally. <xsl:template name="AttributeOptional"> ...

why is the <img> alt attribute not always properly displayed

So I have this php script that output an html table with data about some files (like filename, filesize, etc...) I have this javascript function that displays the picture when you hover a tag belonging to the class "preview". For example, if a filename is: somePic.jpg, when you hover somePic.jpg in the table, the picture will appear nex...

JSP doPost getAtribute null value

I want to pass value to servlet but I keep get null value. <jsp:useBean id="Helper" class="model.Registration" scope="request"/> <form action="/Project/Registration" method="post" enctype="multipart/form-data"> <input type="text" size="20" name="name" value="<%=Helper.getName()%>"> <input type="submit"> </form> protected void d...

.Net SvcUtil: attributes must be optional

Hi, I'm trying to generate C# code classes with SvcUtil.exe instead of Xsd.exe. The latter is giving me some problems. Command line: SvcUtil.exe myschema.xsd /dconly /ser:XmlSerializer Several SvcUtil problems are described and solved here: http://blog.shutupandcode.net/?p=761 One problem I can't solve is this one: Error: Type 'Dat...

Initialize virtual attributes

I have an IncomingEmail model with an attachments virtual attribute: class IncomingEmail < ActiveRecord::Base attr_accessor :attachments end I want the attachments virtual attribute to be initialized to [] rather than nil so that I can do: >> i = IncomingEmail.new => #<IncomingEmail id: nil,...) >> i.attachments << "whatever" W...

How to assign XML attribute values to drop down list using XSL

Hi, I have a sample xml as; <?xml version="1.0" encoding="iso-8859-9"?> <DropDownControl id="dd1" name="ShowValues" choices="choice1,choice2,choice3,choice4"> </DropDownControl > I need to create a UI representation of this XML using XSL. I want to fill the drop down list with values specified in choices attribute. Does anyone ...

"attributeGroup" references ignored by Delphi WSDL Import Tool

I am completely new to web services, but not new to Delphi. I am importing a WSDL file into Delphi 2010 with the "WSDL Importer" wizard. The WSDL file contains some "attributeGroup" tags which Delphi completely ignores, which is presumably a bug, although I haven't yet found an entry on Quality Central for this issue, only mentions in ...

custom attribute changes in .NET 4

I recently upgraded a C# project from .NET 3.5 to .NET 4. I have a method that extracts all MSTest test methods from a given list of MethodBase instances. Its body looks like this: return null == methods || methods.Count() == 0 ? null : from method in methods let testAttribute = Attribute.GetCustomAttribute(method, ...

How to assert that a class has an inherited attribute, but excluding the parent class at the same time?

I have two attributes - MigrationAttribute and TestDataMigrationAttribute : MigrationAttribute. How can I assert that a class has applied TestDataMigrationAttribute but not MigrationAttribute (which is the parent attribute class)? ...

taking text from title attribute and adding it into a div in jquery

Basically i'm trying to grap the text from the title attribute in a link and show it in a paragaph in another div when a user hovers of the item, and then hide it when the user moves away. so far what i've got is (function($) { $.fn.showText = function() { $(this).hover( function() { $(this) ...