attributes

jQuery change input type

Trying to change input type attribute from password to text. $('.form').find('input:password').attr({type:"text"}); Why this doesn't work? ...

C# attribute: how to know class name which has field marked with attribute

particularly when overriding Asp.net MVC ValidationAttribute, is it possible to know class name which has field marked with attribute ? (AttributeUsage is AttributeTargets.Property) public class UniqueAttribute: ValidationAttribute public override bool IsValid(object value) { // how to know which class has t...

Sort of Insert/Update statement in LINQ to XML for XElement

I have this xml structure: <Departments> <Department Id="a Guid" IsVisible="True" /> </Departments> I have created the xml file with: <Departments /> Now I want to add a bool value to IsVisible for a certain Id If that Id does not exist in the xml file I want to make an insert creating a new Department with Id + IsVisible. My...

CSS in ID colon means

Hi, I have seen an HTML code like this for the ID tag, id="t1:c3" Can someone explain this to me? What is the purpose of the said colon(:) ? Thank you. ...

'optimize' attribute directive ignored

I have a project for which optimization has been set to "-Os" for all files via gcc command line flags. However, I want to disable optimization for some methods in one of the source files. To accomplish that, I am trying to specify the optimization attribute for those methods. However, gcc says that it is ignoring optimize attribute duri...

Adding Attributes to XML file Linq C#

Hello I wanna add a Test (common) attribute to all my XML files. So that I could use it as a common attribute when I wanna test them. I tried CreateAttribute but Linq dosen't recognize it I tried "xElement.Add(new XAttribute("Test", value));" but it also didn't work Any Suggestions? Thanks Here for example is a code public void...

Using TestCategory attribute in Silverlight unit tests

I'm trying to write some unit tests in a Silverlight project and I wanted to tag them with attributes like we do in a regular test project (VS2010). For example, something like this: [TestMethod] [TestCategory("BVT")] public void TestMethod1() { } I added a reference to Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll w...

ideas to modify attributes of different XML files c#

Hello, here is my scenario, I copy XML Files from the Original Directory to the Target Directory I modify the file's attributes in the Original Directory I compare the modified file's attribute(from the Original Directory) with the copied file's attribute (in the Target Directory) They shouldn't be the same of course My problem is t...

jQuery XML parser not getting attribute 'dir'

I'm using jQuery to parse XML which is retrieved via ajax, however I have found a problem/bug with using the actual XML input. Consider the following example: var $line = $('<example dir="value">Example Text</example>'), dir = $line.attr("dir"); console.info("dir: ", dir); This example should return 'value' instead it returns an em...

Rails find conditions... where attribute is not a database column

I think it's safe to say everyone loves doing something like this in Rails: Product.find(:all, :conditions => {:featured => true}) This will return all products where the attribute "featured" (which is a database column) is true. But let's say I have a method on Product like this: def display_ready? (self.photos.length > 0) && (...

Is there a .NET attribute for specifying the "display name" of a property?

Is there a property that allows you to specify a user friendly name for a property in a class? For example, say I have the following class: public class Position { public string EmployeeName { get; set; } public ContactInfo EmployeeContactInfo { get; set; } } I'd like to specify that the display name for the EmployeeName pr...

Windows file attributes / version of file

I know for dll files you can read an Assembly version, but I was wondering if there's some way to mark or read versions from ANY filetype (jpg for example). I'm making an update program that only updates what's necessary and it'd be better if all files were versioned instead of keeping track of versions in a separate file. Oh and this i...

Custom CodeAccessSecurityAttribute

I've created the following attribute: [Serializable] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] public class OperationPermissionAttribute : CodeAccessSecurityAttribute { private static PrincipalPermission _revoke = new PrincipalPermission(PermissionState.None); priv...

What does "href" stand for in HTML?

I understand what the "href" attribute in the anchor tag (<a />) is for, but what does the "h" stand for? ...

Active Directory LDAP query result always missing attributes that are known to exist

Hello, This is a problem Im currently stumped on, a user profile has an attribute 'EmployeeID' that appears when viewing that user with AD Explorer, so data exists, eg value of 12345. Now when I pull that user profile via LDAP, using a tool like Apache Studio, most attributes are returned, but not all, eg EmployeeID. I've experienced t...

Jquery - How to set an attribute with index starting at 1 instead of 0?

$('ul li a').each(function(index, element){$(element).attr("href", "#img"+index);}); I'd like my list item links to start with the href as "#img1" and count up from there for each item. The code I have will start at "#img0" which doesn't work for what I'm trying to accomplish. Thanks for any help. ...

how to remove all attributes from <body> with js or jquery

how to remove all attributes from with js or jquery. (I don't know what is the attributes in the body, i want remove all them) ...

jstree links in multilangual json with cookie plugin

Hello community, First I wanted to say that jstree is a great and powerful utility. My first problem is that I have created a multilingual tree with a json and I don't quite know how to set links there, so when the user clicks on a node (for parents and children) he can get to a page like www.yahoo.com or any link I set as an attribut...

__attribute__((aligned)) - gcc

Hello How will gcc set the alignment for variable/field with __attribute__((aligned)) What about different gcc versions/ different platforms? Testing code: int main() { printf("%d\n", (__alignof__(char __attribute__ ((aligned)) )) ); } For x86, gcc 3.4, 4.1, 4.3 I got 16. ...

Attributes in elements closing tag?

Is it considered valid to do the following: <li>stuff</li class="randomlengthclassname"> <li>stuff</li class="shortclassname"> <li>stuff</li class="reallyreallylongarseclassname"> or do the attribute have to be in the opening tag? ...