edit

Rails 3 Devise manually change password

瘦欲@ 提交于 2019-12-03 03:41:40
I try to usung devise in my rails app. But i don't understand how can i give user functionality to change his password. I need a form with fields "old password", "new password" and "new password confirmation". How can i do it? If i use default devise form on "/profile" page <%= render :template => 'devise/passwords/edit', :locals => { :resource => my_user_model_variable, :resource_name => my_user_model_name } %> In user.rb contain line attr_accessible :email, :password, :password_confirmation, :remember_me But there was undefined method 'devise_error_messages!' for #<#<Class:0x59b9200> and

Extract/modify video frames on Android

萝らか妹 提交于 2019-12-03 00:41:22
I have a video file. I want to get each frame of the video and do some modifications to the frame, such as drawing another bitmap in that, putting some text etc. Is there any API/framework available to get frames from video in Android? I've done something similar in iOS using their AVFramework. If it is possible with ffmpeg, I will use some of the opensource NDKs available. Option A: You can create a SurfaceTexture object and attach this to the MediaPlayer as follows myPlayer = new MediaPlayer ... myRedirectionSurface = new Surface(mySurfaceTexture); myPlayer->setSurface(myRedirectionSurface);

Swift / Enable Editing Mode in View Controller

只谈情不闲聊 提交于 2019-12-03 00:17:16
Because of UI elements, I created View Controller with a TableView inside. But I can't enable editing mode. I tried several methods without Solution. But with using TableView Controller there are no problems. What I tried: override func viewDidLoad() { self.navigationItem.rightBarButtonItem = self.editButtonItem() } override func setEditing(editing: Bool, animated: Bool) { super.setEditing(editing, animated: animated) } func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { if (editingStyle ==

In-place editing of a subitem in a TListView

老子叫甜甜 提交于 2019-12-02 21:09:14
I have a ListView with 3 columns and would like to edit the third column, aka Subitem[1]. If I set ListView.ReadOnly to True, it allows me to edit the caption of the selected item. Is there an easy way to do the same thing for the subitem? I would like to stay away from adding a borderless control on top that does the editing. You can Edit a subitem of the listview (in report mode) using a TEdit, a custom message and handling the OnClick event of the ListView. Try this sample Const USER_EDITLISTVIEW = WM_USER + 666; type TForm1 = class(TForm) ListView1: TListView; procedure FormCreate(Sender:

Restful Rails Edit vs Update

前提是你 提交于 2019-12-02 20:16:19
I was trying to redirect to a different page after editing an entry, I assumed that it was using the update code because you are updating the database. It took me some time to realise that I was using the wrong action in the controller. Can someone please explain how edit and update work. Why are there two different actions? what are the differences between them? edit action is responsible for rendering the view update action is responsible for interacting with the model (db updates etc) If you run rake routes you will see the difference between the verb and the action. Typically, the create

jqGrid how to collapse row when clicking on other row

醉酒当歌 提交于 2019-12-02 20:06:40
问题 In a main grid, when I click on one row, it become 'highlighted' and the seven subgrids are showed. Here is an example where first row is selected, and near to be edited (work in progress) : Now, if I click on second row of the main grid, the first is hidden and the second selected. I click after on edit button and a warning appears : no selected row ! If I click again on the second row, it become unselected, and again I click for selecting and editing, that runs fine ! So I presume that my

How to disable Save Handler on Jqgrid while doing editing

穿精又带淫゛_ 提交于 2019-12-02 20:04:44
问题 I am working on an ASP.net MVC 4.0 application with Jqgrid. I am making all rows as editable with some columns being editable and some non editable. The Problem here is , i dont want to use Save and ESC handlers. I am saving row details on the blur event of one of the text boxes. and still i need to stay in EDIT Mode. So, if the user mistakenly presses enter , the row is going out of edit mode. How to disable these Esc and Save Handlers Please help.. Updated: I am not using either cell edit

Github gist editing without changing URL

跟風遠走 提交于 2019-12-02 17:59:31
I have a gist with some javascript code in a script tag, like so: <script src="https://raw.github.com/gist/b25dff23c2c4b4bd425a/f157aa95163311c4b58febb06b49ffd16419f642/images.js"></script> And I will need to keep editing the JS file on github. However, when you edit a gist it changes the URL of the gist. How do I keep the same URL? marclundgren Gist changed the path to this file pattern: https://gist.github.com/<USER_NAME>/<GIST_ID>/raw/<GIST_REVISION_ID>/<GIST_FILE_NAME> You will notice that now the top answers' links are 404'ing. Simply apply this new pattern and voilà! https://gist.github

How to edit 1st instance of text in multiple htm files using batch command?

故事扮演 提交于 2019-12-02 10:34:17
I need to remove the first instance of the <P> and </P> tags in multiple .htm files, all in a single directory, using a batch command. Any suggestions. Edit - I just realized that there may be multiple DIVs in the .htm files, and so I would need to remove only the 1st instance of the <P> and </P> tags in each DIV (if any). And to clarify, I only want the tags removed, but do want the content/text in between the tags to remain. Thanks for the answers/comments thus far!!! As for why, long story, but just know I work for an agency that has a contract with a vendor who did not test the version we

I have a Special Idea about an Edit function

我怕爱的太早我们不能终老 提交于 2019-12-02 10:13:59
All the Functions below are under a $(document).ready(function()) ! First I have an input which you can fade in/out its looks like this: <form> <label for="vorname"> Vorname: </label> <input type="text" id="vorname"/></br> <label for="nachname"> Nachname: </label> <input type="text" id="nachname"/></br> <label for="alter">Alter:</label> <input type="number" Id="alter"/></br> <label for="gender">Geschlecht:</label> <select id="geschlecht"> <option id="Male">männlich</option> <option id="Female">weiblich</option> </select> <input type="button" value="Zurückklappen" id="back"> //fadeOut <input