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
4
votes
1 answer

.idmin() and .idmax() in a Series not working

I am learning about python/pandas attributes in a Series. I can get it to display the min and max values, but I want to display the min and max index values and I get an error…
Brian Bergstrom
  • 173
  • 1
  • 8
4
votes
2 answers

Is it possible to use Java Reflection to print out attributes of the parent class?

is it possible to use Java Reflection to print out the attributes of a parent class.
Oh Chin Boon
  • 23,028
  • 51
  • 143
  • 215
4
votes
2 answers

C# [Required()] annotation doesn't throw exception when it should

I'm using [Required()] above a property in a simple class: public class A { [Required()] public string Str { get; set; } public int Salary { get; set; } } In Main(), I create an instance of the class, WITHOUT setting the…
S Itzik
  • 494
  • 3
  • 12
4
votes
4 answers

What are the attributes which allow you to restrict access to your DLLs?

I remember reading briefly that you can add assembly attributes so that you can only allow specific assemblies to call into an assembly. But I can't remember where I saw that or how to do it - can someone point me in the right direction? Just to be…
Josh M.
  • 26,437
  • 24
  • 119
  • 200
4
votes
1 answer

How do you get AttributedCharacterIterator to return a run for a given Attribute?

Suppose you assign a custom CharacterIterator.Attribute to the first five characters of a ten-character string. Suppose further you assign a different CharacterIterator.Attribute to the remaining characters. Why then, when I call…
Laird Nelson
  • 15,321
  • 19
  • 73
  • 127
4
votes
1 answer

Python OOP instances & classes mutability

I have been doing some readings and thought about this code: def change(c, n: int) -> None: c.x = n class Value: x = 5 m = Value() change(Value, 3) print(m.x) change(m, 1) change(Value, 2) print(m.x) The output of this code…
4
votes
3 answers

How to forbid creation of new class attributes in Python?

This may appear as a very basic question, but I couldn't find anything helpful on SO or elsewhere... If you take built-in classes, such as int or list, there is no way to create additional class attributes for them (which is obviously a desirable…
sciroccorics
  • 2,357
  • 1
  • 8
  • 21
4
votes
1 answer

Azure AD B2C : Not able to expose companyName as token

I am using Azure AD B2C and custom policies to manage users and give sign in experience. I noticed that there is an inbuilt(not a custom extension) attribute name companyName which i am updating with user's company information. I am able to update…
4
votes
0 answers

Running into Attribute Errors while trying to configure PyWikiBot

I am currently following the Python 3 Tutorial for Pywikibot and continue to experience attribute errors while running the included code from the tutorial as seen below. import pywikibot site = pywikibot.Site("en", "wikipedia") page =…
KullideDev
  • 41
  • 1
4
votes
3 answers

What's the use of attributes on an interface?

Using Resharper, I extracted an interface of an existing class. This class has some attributes set on a few members, and Resharper also put these on the interface members. Can I delete these attributes from the interface? Attributes on an interface…
Gerrie Schenck
  • 22,148
  • 20
  • 68
  • 95
4
votes
4 answers

How can I mark generated methods obsolete?

I'm using a strongly typed DataSet for which manually adding rows will be error prone. I'm providing factory methods to create rows properly. I'd like to guide consumers of my class away from the generated Add*Row methods on the *Table classes.…
Garth Kidd
  • 7,264
  • 5
  • 35
  • 36
4
votes
2 answers

Retrieving value from json array where attribute equals variable with Ansible

I'm trying to get the value of an attribute in a json array with Ansible. Example data: "domains.json.data": [ { "axfr_ips": [], "description": "", "domain": "mydomain.net", "expire_sec": 0, …
willemdh
  • 796
  • 2
  • 13
  • 34
4
votes
6 answers

How to get attributes for HashMap value?

"my" code: public void iterateHashmap2() { HashMap hashmap = this.media; Iterator it = hashmap.keySet().iterator(); while (it.hasNext()) { Object key = it.next(); Object val = hashmap.get(key); // doesn't…
OP2011
  • 41
  • 1
  • 1
  • 2
4
votes
1 answer

Assign note to R dataframe variables

Is it possible to assign notes to a variable in an R dataframe? This is possible in Stata and SPSS.
Masood Sadat
  • 1,247
  • 11
  • 18
4
votes
1 answer

Should I apply service attributes to the interface, to the concrete class, or to both?

I am implementing a .Net WCF service and I want to apply a namespace for future versioning. A coworker mentioned that I ought to apply several attributes to both the interface and the concrete implementation class for that interface, but it is not…
Shawn
  • 8,374
  • 5
  • 37
  • 60
1 2 3
99
100