Questions tagged [writeonly]
22 questions
26
votes
2 answers
C# compiler bug? Object initializer syntax used for write-only property in Expression makes csc crash
You may consider this a bug report, however I'm curious if I am terribly wrong here, or if there is an explanation from Eric or someone else at Microsoft.
Update
This is now posted as a bug on Microsoft Connect.
Description
Consider the following…

Dan Abramov
- 264,556
- 84
- 409
- 511
9
votes
1 answer
How to get 'ReadOnly' or 'WriteOnly' properties from a class?
I need to get a list of properties from MyClass, excluding 'readonly' ones, can I get 'em?
public class MyClass
{
public string Name { get; set; }
public int Tracks { get; set; }
public int Count { get; }
public DateTime SomeDate { set;…

Shin
- 664
- 2
- 13
- 30
5
votes
2 answers
CouchDB write-only database
I'm trying to setup a CouchDB database that could be publicly writable and only readable by the "admin" role. How can I do this. Is there a similar validate_doc_update function for accessing a document ?

Maxime
- 2,048
- 1
- 27
- 38
4
votes
3 answers
An "append-only" / "write-only" hash in Ruby
I'm looking for a kind of "append-only" hash where keys may only be set once.
For example:
capitals = AppendOnlyHash.new
capitals['france'] = 'paris'
capitals['japan'] = 'tokyo'
capitals['france'] = 'nice' # raises immutable exception
Any library…

mahemoff
- 44,526
- 36
- 160
- 222
4
votes
4 answers
How can I create a custom *write-only* dependency-property?
I need to know what the procedure is for making a write-only dependency-property. I can see that the DependencyProperty class does not have a special "Register" method for write-only properties, but I have no idea whether the RegisterAttached method…

Giffyguy
- 20,378
- 34
- 97
- 168
3
votes
2 answers
Why does hasattr behave differently on classes and instances with @property method?
I implemented a write-only property in my class with @property. The weird thing is that hasattr behaves differently on the class and corresponding instance with this property.
from werkzeug.security import generate_password_hash,…

Simba
- 23,537
- 7
- 64
- 76
3
votes
3 answers
Java thread-safe write-only hashmap
In my Java class I include a Hashmap variable (class property) and run some Threads which write-only into that HashMap using put(): each time the write happens it stores a unique key (which is done by design).
Is the synchronized keyword on a…

Sophie Sperner
- 4,428
- 8
- 35
- 55
2
votes
1 answer
django rest framework write only field usage
I just want to know usage of write_only that is option password1,2 fields below
I checked view returns fileds information without password, so i could understand roughly but cannot find what exactly write_onlyoptions usage is.
please somebody…

zoozooclub
- 27
- 1
- 6
2
votes
1 answer
What does "file.open(QIODevice::ReadOnly)" mean?
I am new to Qt, and I was learning on its Getting Started Page. I want to know what does the following statements mean and why are they required?
In Open function:
if (!file.open(QIODevice::ReadOnly)) {
QMessageBox::critical(this, tr("Error"),…

Vijay
- 77
- 1
- 10
1
vote
1 answer
How do I write a pseudo-write-only dependency property?
Ok, so this is just an idea I have floating in my head regarding a sort of 'pseudo-write--only' dependency property. I say sort of because I actually don't even want the value to be stored, but rather I want the value I pass to the setter to set…

Mark A. Donohoe
- 28,442
- 25
- 137
- 286
1
vote
1 answer
Logback rollover on write-only filesystem
I have a Java application that has to write it's logfiles to a write-only filesystem. The current logging configuration has a TimeBasedRollingPolicy that rolls over every day. Unfortunately, the rollover fails on the write-only filesystem since a…

Gert-Jan
- 752
- 1
- 8
- 21
1
vote
5 answers
Write-Only Reference in C++?
Is there a way to code a write-only reference to an object? For example, suppose there was a mutex class:
template class mutex {
protected:
T _data;
public:
mutex();
void lock(); //locks the mutex
void unlock(); //unlocks the…

Robert Mason
- 3,949
- 3
- 31
- 44
1
vote
1 answer
c# ftp write only
The following code will throw an exception when i try to connect to a "write-only" ftp
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(ftp://...);
request.Credentials = new NetworkCredential("username", "password");
request.Method =…

Matrix 2.0
- 25
- 4
0
votes
3 answers
When designing an OO language, should I avoid write-only properties?
I am designing an object-oriented programming language for the purpose of learning. The language has properties, like this:
Class Fruit:
Property ReadWrite Float weight
Property WriteOnly Integer someWriteOnlyProperty # <-- avoid?
Should I add…
user142019
0
votes
0 answers
openapi-python-client write-only field is required in GET request
i'm using DRF+openapi-python-client for my project.
i have 2 question for now.
openapi-python-client generate does not accept url for generating client
generated client fileas to serialize model having write-only file field
Thanx in…

Nick
- 1