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

Is GCC correct to ignore the nodiscard attribute on overridden member functions?

Due to this question and the answers, it's not 100% clear whether attributes are inherited or not, but probably they're not since it's not stated in the standard. That's why if we have only the declaration marked as nodiscard in the base class, and…
Tortellini Teusday
  • 1,335
  • 1
  • 12
  • 21
4
votes
1 answer

WCF service: app.config versus attributes or a mixture of both

In a WCF application we have a servicecontract with attributes: namespace We.Work { [ServiceContract(Namespace = "We", Name = "IWork", SessionMode = SessionMode.NotAllowed)] public interface IWork an implementation of the…
Gerard
  • 13,023
  • 14
  • 72
  • 125
4
votes
2 answers

MVC3 Remote Validation and AntiForgeryToken

After reading about XSS attacks I have applied the AntiForgeryToken to my website using the ValidateAntiForgeryTokenWrapperAttribute described in this…
JayneT
  • 765
  • 6
  • 14
4
votes
3 answers

How can I get arrays to have a name other than "Items" when generating C# code from an XSD schema?

I'm working on a project that has to connect to some ancient webservices that pack some hierarchical data for requests and responses into single strings of hierarchical XML. I've been using xsd.exe to generate XSDs from sample request and response…
Grank
  • 5,242
  • 7
  • 33
  • 36
4
votes
3 answers

XSLT: attribute sorting

I need help with a small example, so that I can understand xsl:sort better. My XML data looks like: Zebra Horse Cat
Jasmin
  • 75
  • 1
  • 4
4
votes
4 answers

Is it possible to write these pure_assert and const_assert macros?

The GCC __attribute__((pure)) and __attribute__((const)) allow functions to be declared as non–side-effecting and referentially transparent, respectively; let's say I want to write pure_assert and const_assert macros, whose argument must be an…
Jon Purdy
  • 53,300
  • 8
  • 96
  • 166
4
votes
1 answer

with spring 3 annotations, jsr303 getting Neither BindingResult nor plain target object for bean name 'dataForm'

Implementing a simple jsr303 validation using spring 3 with annotations and I am getting the following result when the post finds missing elements: java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name…
sldahlin
  • 685
  • 1
  • 8
  • 19
4
votes
2 answers

How to change class attribute values permanently with a function in c++?

I wrote a program in c++ with 2 classes. Basically "HeroList" just is a vector of "Hero" elements. Now I want to change the values each hero has given (in function "change"). But it doesn't work. It only works if I call the function with the "Hero"…
M4GI3R
  • 85
  • 1
  • 5
4
votes
4 answers

AttributeError: 'numpy.int64' object has no attribute 'to_pydatetime'

I am new to Python. I have started to use pyfolio library and when I typed the following code pf.create_returns_tear_sheet(data['New_Adjusted_Returns'],benchmark_rets=None) An error named occurred as follow: AttributeError: 'numpy.int64' object has…
Jacky Law
  • 53
  • 1
  • 1
  • 6
4
votes
1 answer

How to access React Components for Cypress

I'm currently working on a large project that uses many custom React components that I do not control. So it's not an option for me to modify them, and it's infeasible for me to make a pull request for every single custom component that doesn't have…
4
votes
1 answer

How to get the name of attribute in python object?

For example I have next python class class Myclass(): a = int b = int Imagine that I don't know the name this class, so I need to get the names of attributes? ("a" and "b")
megido
  • 4,135
  • 6
  • 29
  • 33
4
votes
2 answers

Getting invalid attributes error when playing sound with MediaPlayer

suddenly my app doesnt play a sound when I call mediaPlayer.start(). I get following error in log: 2020-05-29 20:43:57.165 4719-1953/? E/AudioSystem: invalid attributes { Content type: AUDIO_CONTENT_TYPE_UNKNOWN Usage: AUDIO_USAGE_UNKNOWN Source: -1…
skm
  • 559
  • 1
  • 6
  • 22
4
votes
1 answer

Is there a DI framework for Delphi which uses attributes like [Dependency]?

Is it possible and if yes are there implementations of Dependency Injection containers in Delphi (Win32) which support "custom attribute" - based injection, something looking like TDiExample = class(TObject) private [Dependency] AOther:…
mjn
  • 36,362
  • 28
  • 176
  • 378
4
votes
3 answers

C#: How to use CategoryAttribute.Appearance Property

I have read a bit about Design-Time Attributes for Components. There I found an attribute called CategoryAttribute. On that page it says that The CategoryAttribute class defines the following common categories: And then lists up a number of…
Svish
  • 152,914
  • 173
  • 462
  • 620
4
votes
1 answer

AttributeError: 'str' object has no attribute 'seek' with python

Getting "AttributeError: 'str' object has no attribute 'seek' " while running the below code. Can someone point where the issue is? import re import os import time regex = ' \[GC \((?.*?)\).+?(?\d+\.\d+)…
Rakesh
  • 41
  • 1
  • 1
  • 2
1 2 3
99
100