readonly

How to "lock" radio buttons, checkboxes, and <select> menus without graying them out?

I have a form that I want to present in two states: 1) Normal form 2) Person can look at the form as filled out by a user but can't change anything It's easy to handle text inputs with the readonly property, but radio buttons, checkboxes, and dropdown menus don't use it. I can set the "disabled" property for those, but in most browse...

How to pass a byte array readonly?

Think of the following code: static int Main() { byte[] data = File.ReadAllBytes("anyfile"); SomeMethod(data); ... } static void SomeMethod(byte[] data) { data[0] = anybytevalue; // this line should not be possible!!! byte b = data[0]; // only reading should be allowed ... } Is there a way of readon...

NSUserDefaults and read-only value

Is there a way to make some value of my preferences stored in the iPhone Application Settings to be read-only. Let say that for some reasons I do not want the user to be able to modify some values. Is possibile? Thanks ...

SQLCommand.ExecuteReader() does not restrict to read only statements

So apparently, ExecuteReader is used for read only and ExecuteNonQuery is used for transactions. But for some reason even when I used ExecuteReader I am still able to run write (Insert, Update, Delete) commands (typed in textbox1). Is there something wrong with my code or am I misunderstanding the way ExecuteReader is supposed to work? ...

lock down view to be uneditable

I am building a database that contains public, private(limited to internal) and confidential data (limited to very few). It has very specific requirements that the security of the the data is managed on the database side, but I am working in an environment where I do not have direct control of the permissions, and requests to change the...

Pattern for forcing adding to collection through method in C#

I have a class with a collection member. I would like to prevent external code from modifying this collection directly, instead using methods (which can perform the appropriate validation etc). This is harder than I thought. Here is the solution I am using. Can you please tell me if there are better ways to do this common thing? It all ...

Why use readonly in C#

Possible Duplicate: What are the benefits to marking a field as readonly in C#? I've always used the readonly keyword in C# in situations where I know I'll only need to set the reference of an object once (e.g. a WCF service connection on an ASP.NET page). Other than simply ensuring objects cannot be set more than once, what ...

Set VIM to open files in "read-only" mode by default?

Hi folks, Straightforward question here and I can't make it any simpler than the title: How do I set VIM to open files in "read-only" mode by default? Thanks! ...

how can I disable everything inside a form using javascript/jquery?

I have a form that pop up inside a layer, and I need to make everything inside that form read only regarding what type of input it is. Anyway to do so? ...

mysql ReplicationDriver, slow and timeout when using roundrobin mode.

I'm using replicationdriver according to this article for DB reading round robin though several databases. http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-replication-connection.html Whenever I enabled this, I had slow db response and sometime it resulted in timeout. The DB servers are fine. I wonder whether there are imp...

Is there any benefit to making a C# field read-only if its appropriate?

I am working on a project using ReSharper. On occasion it prompts me that a field can be made readonly. Is there any performance or other benefit to this? I am presuming the benefits would be quite low-level, or would any benefits be purely semantic? Thanks With example below the field was initially just private, but resharper prompted...

SharePoint 2007 Designer: Read-only Date/Time disappears with Update Item

I have a simple workflow that creates a User and Date/Time stamp when the user checks complete = Yes. Everything works fine when the columns are unprotected, but when the columns are Hidden or Read-only, the Date/Time from the previous step disappears. I've tried Hiding the fields by managing site content, and by using SharePoint Boost...

java ORM for a read only DB

Hi all, I know hibernate but I wonder if there would be a lighter ORM engine for a read only database. I mean, I don't need some transactional queries or to update some records. On the other side, I need to handle some large list of records: List<MyRecord> list= object.getMyRecords(); // list.size() > 1E7 Does such engine exist ? Man...

Create Protected Nodes when using webbrowser / IHTMLDocument2 in c#

Hey all, I am working a project in C# that allows the user to edit a webpage. It is using mshtml for the editor. I'm looking for a way to protect a couple of table cells. Basically they can edit everything except what is in the specified table cell. The user does not have access to the source code of the webBrowser. Thanks for any ins...

Access Chrome History through JDBC

Hi all, I'm trying to connect to the chrome history database (sqlite) via a java application and run some queries in read only mode. I'm using sqlite.jar but when I connect, I get the following error: org.tmatesoft.sqljet.core.SqlJetException: BUSY: error code is BUSY I know some applications can access the file without copying it first ...

c# readonly object

Is there any way to return a readonly instance of an object? public class Person { public String FirstName { get; set; } public String LastName { get; set; } } public class SomeClass { public SomeClass(Person manager) { if (manager == null) throw new ArgumentNullException("manager"); _manage...

Partially editable PyQt4 TextEdit

I'm currently making a frontend for my favorite expression-oriented arbitrary-precision calculator using PyQt4. The problem with it is that there doesn't seem to be any way to make part of a TextEdit widget read-only (specifically, the text that has already been sent and the results thereof) but the rest of it fully editable. Do I need t...

Creating read-only versions of classes in a complex object structure

In my current project I need to be able to have both editable and read-only versions of classes. So that when the classes are displayed in a List or PropertGrid the user is not able to edit objects they should not be allowed to. To do this I'm following the design pattern shown in the diagram below. I start with a read-only interface (I...

GUI Best Practice: When designing a webbased management interface, it is best to use a detail view or to use forms with values as primary view?

To clarify the question, imagine having a paginated list with clients. When clicked on a specific client the system will open the 'view client x' view in order to show the client details. Now, will this view be a 'simple' list which displays client details? Or will this view be a form with input fields showing the client details and a...

read-only properties in PHP?

Is there a way to make a read-only property of an object in PHP? I have an object with a couple arrays in it. I want to access them as I normally would an array echo $objObject->arrArray[0]; But I don't want to be able to write to those arrays after they're constructed. It feels like a PITA to construct a local variable: $arrArray =...