attributes

The type attribute of SCRIPT and STYLE elements in HTML?

I heard (from Crockford) what type attributes on LINK and SCRIPT elements are superfluous when those elements are used to load external resources. (Because the HTTP response determines the content-type of the resource.) <link rel="Stylesheet" href="foo.css"> <script src="foo.js"></script> But what about the case when non-HTML code is...

How to best capture this XML Schema in C# classes

I have a large XML schema that has elements that look like this: <xs:element name="Tmats"> <xs:complexType> <xs:sequence> <xs:element name="ProgramName" type="xs:string" minOccurs="0"> <xs:annotation> <xs:documentation>PN</xs:documentation> </xs:annotation> ...

Can a batch file change the system date; save file with attributes; change date back to current date?

Can a batch file change the system date; save file with attributes; change date back to current date? Goal to save MYFILE.TXT with the date of 01-01-2010 using Batch commands. I have tried to set date=01-01-2010 and then save the file, but it didn't work. Is this impossible? @echo off rem to Run this Batch file as administrator da...

What is the purpose of Attributes in C#?

What is the purpose of Attributes in C#? How do I know which attribute have to use for particular functionality? How can I add them dynamically in c#? What are custom attributes ? ...

xmlbeans and namespaces attributes

Hi, I'm trying to use xmlbeans to parse Google geocoder xml responses. I have an xsd which defines a subset of the KML returned by the geocoder. For reference here is an example geocoder response: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://earth.google.com/kml/2.0"&gt; <Response> <name>520 3rd Street San Francisco CA...

nHibernate trying to update instead of insert a new object

I am using nHibernate attributes which generates this... <class name="xxx.Message.MtMessage, xxx" lazy="false" table="tblCore_MtMessage"> <id name="MtMessageId"> <generator class="identity" /> </id> <property name="MtMessageStatus" /> <property name="ApplicationMessageId" /> <property name="IsPremium" /> ...

XPath selection while excluding elements having certain attribute values

Hello all, My first post here - it's a great site and I will certainly do my best to give back as much as I can. I have seen different manifestations of this following question; however my attempts to resolve don't appear to work. Consider this simple tree: <root> <div> <p>hello</p> <p>hello2</p> <p><span c...

Change Value of the last Attribute in an XML c#

I was working on a bunch of XMLs that all share an attribute that contains the string "name" in them. The following code selects the attribute with string "name" in it and assign a new value to it. public void updateXmlFile(string strFileName) { try { //Load the Document XmlDocument do...

jQuery/Javascript getting all attributes from an element and pass it to another

I have the following code: <div id="elm0" data-color="color" data-size="size" data-more="more">something</div> <div id="elm1">This element must get elem0 attr</div> I know that I can get $("#elm0").attr("color") in a var and pass it to $("#elm1") but in my case I do not know exactly what attributes are there. I am looking for somethin...

How do I insert attributes into an array?

Each element in $(some_selector) has attribute my_attr (which is a number). I would like insert all these attributes to array. What would be the easiest way to do this using jQuery ? ...

Itemplate properties not available as attributes

I've added an ITemplate to Telerik's RadGrid control called SearchMenuTemplate ala: public class AbsRadGrid : RadGrid { private ITemplate _ItemTemplate; [PersistenceMode(PersistenceMode.InnerProperty)] [TemplateContainer(typeof(searchBar))] public ITemplate SearchMenuTemplate { get { return _ItemTemplate...

How do I use javascript to change the font colour on my webpage?

I can't use JQuery sadly I need to use good old Javascript. I have a forum and a black theme and when people use black text on it you can't see it. So I want to use javascript to change all the black text on the page to white when the page loads. ...

Dependent attributes within a java class

I have a java class as follows: public class Query implements Serializable { static Object[] o= new Object[8]; private long oid= (Long) o[0]; private double[] region= { (Double) o[1],(Double) o[2],(Double) o[3] }; private boolean filter= (Boolean) o[4]; private float[] vel= {(Float) o[5], (Float) o[6]}; private...

Python: Should I put my data in lists or object attributes?

I am looking for an appropriate data structure in Python for processing variably structured forms. By variably structured forms I mean that the number of form fields and the types of the form's contents are not known in advance. They are defined by the user who populates the forms with his input. What are the pros and cons of putting da...

Javascript pass array attribute as parameter

var contact = { varWorkExperiences: [{ Experience: "aaa" },Experience: "bbb"}] }; I have a structure like this. I can use push method like this: contact.varWorkExperiences.push({ Experience: "ccc"}); but I want to do this paramaticly I cant do this: var x = "Experience"; contact.varWorkExperiences.push({ x: "ccc"}); How can I ...

C++: Dynamically access class properties

Hi, I'm wondering if it is possible to access a property of a class dynamically without knowing the name of the property accessed at run-time. To give you a better understanding of what I'm aiming at, this php code should demonstrate what I want to do: <?php $object = new object(); $property = get_name_out_of_textfile(); echo $object->...

Django, Python, trying to change field values / attributes in object retrieved from DB objects.all call, not working, advice appreciated

I'm trying to change a specific field from a field in an object that I retrieved from a django db call. class Dbobject () def __init__(self): dbobject = Modelname.objects.all() def test (self): self.dbobject[0].fieldname = 'some new value' then I am able to access a specific attribute like so: objclass = Dbobject(...

Calling a property or method using an attribute name

Let's say I have a class that looks like this: public class CallByAttribute { [CodeName("Foo")] public string MyProperty { get; set; } [CodeName("Bar")] public string MyMethod(int someParameter) { return myDictionary[someParameter]; } } How would I call these two properties or methods, using CodeName ...

Binding XML attribute in Flex

I have this variable in Model class: [Bindable] public var someXml:XML; I've used BindingUtils to get notified when the XML changes: BindingUtils.bindSetter(onChange, Model.getInstance(), "someXml"); private function onChange(value:Object):void { // do something } Function onChange gets triggered when I assign an XML to the va...

jQuery set then read readonly attr on textbox

​<input id="test" type="text" value="text" />​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​ alert(​$(':input:not([readonly])').length);​​​​​​​​​​​​​​​​​ // 1 $('#test').attr('readonly', 'readonly'); alert($(':input:not([readonly])').length); // 1 $('#test').removeAttr('readonly');​​​​​​​​​​ alert($(':inp...