Menu
  • HOME
  • TAGS

Edit read-only file in java

java,linux,text-files,readonly,writing

My question is how do I give my java program "sudo" privileges to be able to write to this file and save those edits. I think that the simple answer is that you can't. Sudo works by checking a file to see if the user allowed to run a...

Derived query throws error ORA-00604: error occurred at recursive SQL level 1

sql,database,oracle,readonly,temp

Possible issue is with: ORA-16000: database open for read-only access When you are applying the JOIN and GROUP BY, it might need some TEMP space. And you do not have the privilege to access the temp space. Check whether you have a temp tablespace. Also, DM.MAP Can you try the...

jQuery if statement triggered twice

jquery,html,input,readonly

You should use only one event. Either keypress or keydown in following statement: $('#main-field').on('keypress keydown', function(event) { This will fire event twice on a single key press. So, change your statement to: $('#main-field').on('keypress', function(event) { ...

HTML.TextBoxFor is set readonly before value set

model-view-controller,model,html-helper,readonly,html.textboxfor

When you post back a model, its values are added to ModelState. Html helpers bind to the vales in ModelState, not the values of the model properties, so modifying the value of a model property in the POST method will not be reflected in the view unless you first clear...

Can I select all elements with a specific class and set the readonly attribute to true in CSS

css,input,textbox,readonly

CSS cannot set any html attributes. CSS can only style them....

SQL Server/Oracle table writable only by a trigger?

sql,sql-server,oracle,triggers,readonly

Execute As allows you to create a trigger that runs as a user different to the current user. So you can create a separate user who has write access to your TRANSACTIONS table, and execute the trigger as that user. If no other users have write access, only the trigger...

issues with eclipse plugin decorator

xml,eclipse,plugins,decorator,readonly

You will have to write a decorator class (specify the class attribute) rather than using the icon attribute. The ILightweightLabelDecorator public void decorate(Object element, IDecoration decoration) method will be passed the IFile as the element so you can do your filtering on that. To deal with the file read only...

Android: Read-only storage behaves like writable

android,storage,readonly,android-4.4-kitkat

I have found an answer here in this comment: http://www.doubleencore.com/2014/03/android-external-storage/#comment-1294469517 You really have to try to open the file :(...

Read-only after inner join (MySQL)

mysql,join,mysql-workbench,readonly

By hovering above the "Read Only" icon, I got the following message: "Statement must be a SELECT from a single table with a primary key for its results to be editable". After some research based on the advice given by fellow coders, here are some points to note: In MySQL...

Inner class property make read only to all accessing classes except outer class

c#,inner-classes,readonly

There's no way of doing that - other than the visibility of the class itself, outer classes have no extra access to the members within a nested class. Two options: Keep a cachingEnabled private field within DatabaseConnector instead, and give Cache an instance of the DatabaseConnector to fetch it from....

how to set customvalidity on a readonly input field

javascript,html,readonly,customvalidator

You cannot. The HTML5 spec clearly says: “If the readonly attribute is specified on an input element, the element is barred from constraint validation.”

Internet Explorer deletes value of readonly input field on selection

jquery,internet-explorer,input,readonly

The best - and possibly only - way to achieve the result I wanted was to simply hide a read-only version of the totalIncome and totalExpenses fields, which would then be submitted with the form. I was thereafter able to disable the original totalIncome and totalExpenses fields.

“Read-only” public properties without setters/getters

c#,oop,properties,readonly

Yes that is possible, syntax is like this: public int AProperty { get; private set; } ...

How to create a “global” immutable List list that can be binarySearched

c#,list,readonly,binary-search

In this case, depends on personal preference. This is mine, as an example: private List<string> _MyList = new List<string>(); private void InitializeList() { //code here to fill list. //Keep in mind, that binary search works on sorted lists. _MyList.Sort(/* Place your object comparer here. */); } //Make a copy in...

Variable read only [closed]

c#,oop,readonly,access-modifiers

If you're only setting speed once, just use a readonly variable and set it in the constructor: public class Physics { private readonly float speed; public Physics() { this.speed = 5; } } You can set a readonly variable exactly once. If you really do need to change speed within...

Amazon Web Services read-only account?

amazon-web-services,amazon,readonly,account

No. An AWS Account cannot be made "read-only". However, you can create a User in Identity and Access Management (IAM) and assign them "Read Only" permissions, which means they can interact with AWS but cannot change anything. However, this would still require that they login or at least use a...

in jquery can i add a readonly attribute to a input that the only property i can touch is a function?

jquery,function,readonly

Yes, you can, using an attribute equals selector: $('input[onkeydown="return scriptReadonly();"]').prop("readonly", true); Live Example: function scriptReadonly() { } $('input[onkeydown="return scriptReadonly();"]').prop("readonly", true); <INPUT id="ctl00_ContentPlaceHolder_txtSOPurchaserSapID" onkeydown="return scriptReadonly();" style="WIDTH: 150px" name=ctl00$ContentPlaceHolder$txtSOPurchaserSapID> <INPUT id="ctl01_ContentPlaceHolder_txtSOPurchaserSapID" onkeydown="return scriptReadonly();" style="WIDTH: 150px"...

Make a column read only in adempiere

logic,readonly,adempiere

Inner join doesnt work, Lets do one thing add C_BPartner_ID.Name (like hiddenfield) in your table and try to use it

Libre Office Base; Opens reports in read-only

report,readonly,libreoffice,libreoffice-base

Just do a SAVE AS for your read-only report file. And then open the resulting .odt document. It will be editable.

Is there a LINQy way to set all ReadOnly controls' TabStop to false?

c#,linq,controls,readonly,tabstop

To linqify your example: foreach (var control in Controls.OfType<TextBox>().Where(c => c.ReadOnly) { control.TabStop = false; } However, your example does not process all controls because a Control can contain other control. You will need a recursive descent algorithm. IEnumerable<Control> Walk(Control control) { yield return control; foreach (var child in control.Controls.SelectMany(c=>...

Using required and readonly attributes together

html5,button,onclick,readonly,required

could do it with jquery validate plugin.. or easier: must not be keydown just hang it on your event you are calling on click... <input type="text" class="readonly" required /> <script> $(".readonly").keydown(function(e){ e.preventDefault(); }); </script> ...

Caliburn.Micro - pass readonly properties to view model

model-view-controller,windows-phone-8.1,caliburn.micro,readonly

this is example with Loaded event, you can use better event for your use micro:Message.Attach=[Event Loaded] = [Action LoadCanvasProperties($this.ActualWidth, $this.ActualHeight)]" ...

MS CRM 2013 Notes becoming readonly after removing title and Text

microsoft,readonly,dynamics-crm-2013

You can dig up the record and edit it, just not in the parent form: Advanced Find > search "Notes" Filter by Regarding record (i.e. if the note is attached to a Case, pick Regarding(Incident)) You'll see in the results your empty record: open it up and edit it....

div contentEditable but Readonly

html,contenteditable,readonly

You can prevent the user from cutting by handling the "cut" event and calling its preventDefault() method. This will prevent cut with any user input (including the browser's context menu or edit menu), not just via a particular key combination. This example uses jQuery because your jsFiddle uses it: $("#editablediv").on("cut",...

Add readonly to input fields in jQuery

jquery,input,readonly,attr,prop

Your web, console log: Uncaught ReferenceError: $ is not defined You should put the references to the jquery scripts first. Uncaught ReferenceError: $ is not defined?...

jsf get disabled field values in requestscoped bean

jsf,scope,request,field,readonly

Disabling fields using JavaScript didn't work probably because you didn't enable them just before sending a form. Values of disabled fields are not sent (see input documentation). For example the following code works perfectly well: <h:form> <h:inputText id="disabledinput" styleClass="disabled" value="#{someBean.property}"></h:inputText> <h:outputScript> $('.disabled').attr('disabled', 'disabled'); </h:outputScript> <h:commandButton action="#{someBean.action}" onclick="$('.disabled').removeAttr('disabled');...

Connection to a Microsoft SQL Database via VBA (ADODB) with the lowest risk to harm the database

sql-server,vba,excel-vba,readonly

In my opinion there is no reasonable security in Excel. All security should reside on the server. If you want to prevent accidental or malicious changes to the database then the database on the server should be read-only or all users should have read-only access to the SQL server. Furthermore,...

attr_readonly After Update

ruby-on-rails,ruby,database,readonly

You could override readonly? in that model like this: def readonly? super || created_at != updated_at end Rails checks if a record is readonly before it tries to saves an updated record to the database and would raise an ActiveRecord::ReadOnlyRecord exception if the record is marked as readonly. This overridden...

Shouldn't ng-bind work for input as well?

html,angularjs,readonly

ngBind set's the element's text content: element.text(value == undefined ? '' : value); // from the source code of Angular So, it does not work for setting the value of an input (nor shouldn't it). I believe it is better to use <span> in place of readonly inputs....

Assigning value to a property of a readonly object

ios,objective-c,readonly

Is it possible to assign values to a property of a readonly object? Er, sort of. The language you used is slightly confusing. It isn't a readonly object; it's a readonly property. And it is possible to assign values to the object stored in a readonly property. readonly just...

How in vb.net can I insert a value on a read only property?

vb.net,rgb,readonly

You'll have to use the shared method FromArgb. Dim red As Color = Color.FromArgb(255, 0, 0) Or in your case Dim newcolor As Color = Color.FromArgb(vermelho, verde, azul) ...

Form fields after click the save button read only(view)

forms,readonly

Where is the <input type="submit">/ submit button to submit the data? Add this button to your code <input type="submit" id="save" onClick="hide()" value="save"> Then add a javascript function within the <script></script> tags or in a .js page which is included before the button This will be your function according to the...

How to set readonly the CKEditor using Knockout

knockout.js,ckeditor,readonly

I solved the questions by sbscribing to the click event of the checkbox that was supposed to enable.disable the editors: <input type="checkbox" data-bind="checked: isEnabled" /> this.isEnabled = ko.observable(isEnabled); this.isEnabled.subscribe(function(val) { for (var instance in CKEDITOR.instances) { CKEDITOR.instances[instance].setReadOnly(!val); } }); ...

How to manipulate a Word 2013 document opened in read only mode

c#,vba,ms-word,word-vba,readonly

In order to turn off ReadingMode your need to put this at the beginning of your code Globals.ThisAddIn.Application.Options.AllowReadingMode = false; You may get errors because of the direction of your loop. Your first page is page 1 once you delete this then page 2 becomes page 1 etc If you...

Read-only attributes via properties versus via documentation

python,properties,attributes,private,readonly

First note that there's almost no technical way to prevent someone to access your object's implementation and modify it if he really wants to. Now wrt/ your question / example: using an implementation attribute (_x) and readonly property makes the intent quite clear if your list is really supposed to...

How to make NumericUpDown ReadOnly

readonly,mousewheel,numericupdown

Try the following in order to set the numeric up/down as read-only: numericUpDown1.ReadOnly = true; numericUpDown1.Increment = 0; I hope it helps....

How can I implement a read-only table in lua?

lua,readonly,lua-table

You just have to apply your readOnly function recursively to the inner table fields as well. You can do so on-access in the __index metamethod. You should also cache the readonly proxy tables that you create, otherwise any read access to inner tables (e.g. hold.sex) will create a new proxy...

On an asp.net-mvc site, Is there a good pattern for dealing with both editable and read only views?

asp.net-mvc,forms,readonly,entitlements

I would go for creating a separate partial/full views for both. Reasons: easy to change and maintain validation code only in editable part clear separation of concerns cleaner code may be we can reuse some of the code by abstracting/separating similar code to re usable partial views easy control over...

Onedrive in readonly mode

readonly,skydrive,onedrive

Are you writing an app to integrate with OneDrive? If so, you can grant the app the 'onedrive.readonly' scope so that it only has read access. More info here https://github.com/OneDrive/onedrive-api-docs/blob/master/auth/msa_oauth.md#authentication-scopes. If you're not writing your own app, and you're wondering whether the official OneDrive app on your device can be...

How check if a file is in read-only mode in C

c,file,unix,readonly,chmod

You can use fopen, and check for the return value. Check here: http://www.tutorialspoint.com/c_standard_library/c_function_fopen.htm

RSpec attr_readonly

ruby-on-rails,ruby,activerecord,rspec,readonly

Trying to update a read only attribute will raise an ActiveRecord::ActiveRecordError erorr, rather than add a validation error to the model. You can test that the error is raised with: expect { @product.update_attribute(:rfid, 1921) }.to raise_error(ActiveRecord::ActiveRecordError, 'rfid is marked as readonly') ...