Questions tagged [attributes]

The attributes tag should be used for any issues relating to a property of an object, element, or file, etc.

In computing, an attribute is a specification that defines a property of an object, element, or file. It may also refer to or set the specific value for a given instance of such.

For clarity, attributes should more correctly be considered metadata. An attribute is frequently and generally a property of a property.

However, in actual usage, the term attribute can and is often treated as equivalent to a property, depending on the technology being discussed.

An attribute of an object usually consists of a name and a value; of an element, a type or class name; of a file, a name and extension.

  • Each named attribute has an associated set of rules called operations: one doesn't sum characters or manipulate and process an integer array as an image object — one doesn't process text as type floating point (decimal numbers).
  • It follows that an object definition can be extended by imposing data typing: a representation format, a default value, and legal operations (rules) and restrictions ("Division by zero is not to be tolerated!") are all potentially involved in defining an attribute, or conversely, may be spoken of as attributes of that object's type. A JPEG file is not decoded by the same operations (however similar they may be—these are all graphics data formats) as a PNG or BMP file, nor is a floating point typed number operated upon by the rules applied to typed long integers.

See also:

13044 questions
82
votes
24 answers

InternalsVisibleTo attribute isn't working

I am trying to use the InternalsVisibleTo assembly attribute to make my internal classes in a .NET class library visible to my unit test project. For some reason, I keep getting an error message that says: 'MyClassName' is inaccessible due to its…
skb
  • 30,624
  • 33
  • 94
  • 146
81
votes
6 answers

Read the value of an attribute of a method

I need to be able to read the value of my attribute from within my Method, how can I do that? [MyAttribute("Hello World")] public void MyMethod() { // Need to read the MyAttribute attribute and get its value }
Coppermill
  • 6,676
  • 14
  • 67
  • 92
78
votes
5 answers

What's the difference between using the Serializable attribute & implementing ISerializable?

What's the difference between using the Serializable attribute and implementing the ISerializable interface?
SoftwareGeek
  • 15,234
  • 19
  • 61
  • 78
77
votes
5 answers

How to determine if user account is enabled or disabled

I am throwing together a quick C# win forms app to help resolve a repetitive clerical job. I have performed a search in AD for all user accounts and am adding them to a list view with check boxes. I would like to default the listviewitems' default…
Bryan
  • 3,224
  • 9
  • 41
  • 58
77
votes
2 answers

Safari ignores mp4 files

I am using an HTML file input like this: to allow my users to upload videos to my site. This works as expected in all modern browsers (only permitting the user to select video files) except Safari. From what I…
cdanzig
  • 887
  • 1
  • 7
  • 8
77
votes
1 answer

How to remove an attribute in D3.js?

Can I in D3.JS remove an attribute? I've added it using .attr("disabled", "disabled") and now I am looking for something similar to jQuery's .removeAttr("disabled", "disabled"); to remove it again. Useful for
bonna
  • 1,575
  • 2
  • 17
  • 31
76
votes
4 answers

How to get a Token from a Lucene TokenStream?

I'm trying to use Apache Lucene for tokenizing, and I am baffled at the process to obtain Tokens from a TokenStream. The worst part is that I'm looking at the comments in the JavaDocs that address my…
Eric Wilson
  • 57,719
  • 77
  • 200
  • 270
75
votes
10 answers

HTML5 iFrame Seamless Attribute

in HTML5 the iframe has new attributes like 'seamless' that should remove borders and scrollbars. I've tried it but doesn't seem to work, I still can see scrollbars and borders (I'm using Google Chrome as browser), Here's my code:
Mauro74
  • 4,686
  • 15
  • 58
  • 80
75
votes
3 answers

@noescape attribute in Swift 1.2

There is a new attribute in Swift 1.2 with closure parameters in functions, and as the documentation says: This indicates that the parameter is only ever called (or passed as an @ noescape parameter in a call), which means that it cannot …
Dániel Nagy
  • 11,815
  • 9
  • 50
  • 58
75
votes
9 answers

Why is adding attributes to an already instantiated object allowed?

I am studying python, and although I think I get the whole concept and notion of Python, today I stumbled upon a piece of code that I did not fully understand: Say I have a class that is supposed to define Circles but lacks a body: class Circle(): …
NlightNFotis
  • 9,559
  • 5
  • 43
  • 66
74
votes
19 answers

set option "selected" attribute from dynamic created option

I have a dynamically created select option using a javascript function. the select object is when the js function is executed, the "country" object is