Skip to main content

Questions tagged [properties]

A property, in some object-oriented programming languages, is a special sort of class member, intermediate between a field (or data member) and a method. Properties are read and written like fields, but property reads and writes are (usually) translated to get and set method calls.

2 votes
0 answers
299 views

Simulating Objects with Collections in VBA

Update I have released a prototype (v0.1.0) of my SOb project, which is a generalized framework for easily simulating objects. Background I am writing a VBA module ...
Greg's user avatar
  • 559
0 votes
1 answer
427 views

Sanitize object to only include specific properties

Object Property Sanitization I'm learning to code servers using JavaScript, Node, and Express. While writing controllers that create new entries in the database, the need to sanitize the user input ...
NPN328's user avatar
  • 791
2 votes
1 answer
45 views

Pandas-style "indexer proxy" descriptor

The goal is to write a decorator that allows you to define "indexer proxies", which define properties with __getindex__ instead of normal method calls, ...
phipsgabler's user avatar
5 votes
3 answers
2k views

A method for managing enumerations in VBA

I have for some time been frustrated by the limitations around enumerations in VBA. Googling didn't find anything really simple and comprehensive. So after a bit of head scratching I came up with the ...
Freeflow's user avatar
  • 655
3 votes
1 answer
86 views

Coroutine-based two-in-one properties

Over the holidays I played around with coroutines and their use as two-in-one getter and setter methods: ...
Richard Neumann's user avatar
5 votes
2 answers
280 views

(de)serializing c++ object almost automagically

Here's one way to solve the serialization problem in c++20, using a json library: ...
user1095108's user avatar
  • 1,454
6 votes
4 answers
2k views

Section 2: Classes - Design a StackOverflow Post

Design a class called Post. This class models a StackOverflow post. It should have properties for title, description and the date/time it was created. We should be able to up-vote or down-vote a ...
Milliorn's user avatar
  • 610
1 vote
1 answer
350 views

Minimal Property system in c++17

So I needed to represent by objects in terms in ini format and change their values from the ini as well, so I thought why don't implement a property system for this. I want it to be bit fast so I ...
bluedragon's user avatar
8 votes
1 answer
394 views

WPF BindableProperty<TValue> to Reduce Boiler Plate

I'm sure anyone who has used WPF is familiar with the irritating boilerplate code surrounding properties, usually of this form. ...
HarrisW's user avatar
  • 83
0 votes
2 answers
114 views

Descriptor to restrict input [closed]

We start off we the following Person class: ...
Sebastian Nielsen's user avatar
6 votes
1 answer
2k views

Change tracking POCO entities

Description In a time where thin clients, web browsers, web services and micro services are prevalent, we tend to forget we still have to deal with thick and smart clients. Many applications in B2B ...
dfhwze's user avatar
  • 14.2k
5 votes
1 answer
648 views

C++ bare getter setter with dispatch

I am trying to achieve a getter/setter behaviour that will reduce code in C++. The interface I would like to achieve is for example: ...
Steve Rodeen's user avatar
2 votes
1 answer
1k views

Create a csv of file attributes recursively from a directory parameter in PowerShell

I'm a bit new to PowerShell (version 5) and was wondering if there are any improvements I could make to the following script. Any suggestions for style, code, etc. are all welcome. The script creates ...
aduguid's user avatar
  • 478
2 votes
1 answer
435 views

Is this a proper way to cancel an onMouseOver which uses setTimeout? (Vanilla JS)

I've got a working solution for an onMouseOver event which rolls over a set of images and replaces them in the element. Due to my lack of knowledge in JS I would ...
rapstacke's user avatar
  • 123
4 votes
1 answer
14k views

Python decorator to support static properties

Classes in Python do not have native support for static properties. A meta-class can rather easily add this support as shown below. Are there any problems programmers might experience if they use this ...
Noctis Skytower's user avatar

15 30 50 per page
1
2 3 4 5 6