Questions tagged [field]

In computer science a field is a smaller piece of data from a larger collection.

In computer science, data that has several parts can be divided into fields. Relational databases arrange data as sets of database records, also called rows or tuples. Each record consists of several fields, also called attributes; the fields of all records form the columns.

In object-oriented programming, field (also called data member or member variable) is the data encapsulated within a class or object. In the case of a regular field (also called instance variable), for each instance of the object there is an instance variable: for example, an Employee class has a Name field and there is one distinct name per employee. A static field (also called class variable) is one variable, which is shared by all instances.

Source: Field (Computer Science) - Wikipedia article

Related tags:

5904 questions
26
votes
4 answers

Django: field's default value from self model's instances

How can I make default value for a field to be taken from existing objects of a model? I tried these and it didn't worked: 1) class ModelA(models.Model): fieldA = models.CharField(default=self.get_previous()) def get_previous(self): …
grucha
  • 759
  • 2
  • 8
  • 14
26
votes
4 answers

Informix SQL - List all fields & tables

Informix iSQL has a command "info tables;" that shows all tables. The syntax for viewing the fields and their respective data types is "info columns for table;" Is there a similar command that shows table.field for all tables and all fields?
CheeseConQueso
  • 5,831
  • 29
  • 93
  • 126
25
votes
7 answers

Inaccurate size of a struct with bit fields in my book

I'm studying the basics of the C language. I arrived at the chapter of structures with bit fields. The book shows an example of a struct with two different types of data: various bools and various unsigned ints. The book declares that the structure…
AlexQualcosa
  • 467
  • 6
  • 11
25
votes
3 answers

Kotlin - How to make field read-only for external classes

I have the following Kotlin class on Android: class ThisApplication: Application() { lateinit var network: INetwork override fun onCreate() { super.onCreate() network = Network() } } Now, any external class can get…
25
votes
11 answers

What is the best practice for using public fields?

When I write a class I always expose private fields through a public property like this: private int _MyField; public int MyField { get{return _MyField; } When is it ok to just expose a public field like this: public int MyField; I am creating a…
Micah
  • 111,873
  • 86
  • 233
  • 325
25
votes
8 answers

How to add wysiwyg editor in Wordpress meta box

I'm creating a meta box for my custom post type. There are multiple fields where I would like to use wysiwyg editor rather than