Saturday, February 18, 2012

Delete mkv file from windows

I had a mkv file that I wanted to delete. So I opened the explorater, go to the folder, right click on the file and Delete. But then I have the error (something like that) : you can't delete this file because another process is using it.

Well, but I'm sure no other process is using it !

Problem 
How to delete mkv files ?

Solution
Well, I found this solution on Internet and it's easy. In fact, "explorer.exe" is using the mkv file.

Open a command prompt window (click here for more info).
Go to the folder where the mkv file is (keep the prompt open, we will use it later!). You can use the command "cd myVideos" for example. (click here for more info).

Open the Task Manager by pressing : ctrl + alt +  suppr. (other possibilities)
Choose "start task manager"
Open the "processes" tab
Select "explorer.exe" (be sure sure to select "explorer.exe" !!)
Click on "end process". Your icons and task bar will disapear, but that's ok. (don't close the task manager we will need it later).

Go to the prompt again and delete the file (del video.mkv).

Go to the task manager
Open the "application" tab
Click on "New Task...".
Enter "explorer.exe" (without double quotes!) and click "OK". Then your icons and task bar will appear !

And that's it

Wednesday, February 1, 2012

web2py plugin_wiki tag

In my website, I want the user to be able to add tags to a picture. I'm happy because I can see that there is a plugin in web2py to do that.
Have look here: web2py Plugin but, it said that the plugin tag is kind of deprecated and we have to use the plugin_wiki.
Attention: some of the plugins listed here are old (in particular jqgrid, comments, tagging, modal, dropdow, attachments, latex, flash video and deprecated). Newer versions have been incorporated into plugin_wiki.
So I watched the video explaining how to use the plugin_wiki. But I don't want to create pages using the plugin_wiki, I just want to add tags!

Problem 
How to just add tags to my view file without using the wiki interface ?

Solution 
In fact it's really easy. In the view file just add this : {{=plugin_wiki.widget('tags',table='thumbnail',record_id=thumbnail.id)}}

thumbnail is the name of my table.
thumbnail.id is the id column (as you can guess)

Then, if you want to modify the behaviors you can modify the plugin_wiki controller : controllers/plugin_wiki.py, there is an action for each plugin, so you'll find an action called "tags".
And you can modify the "view" of a tag : view/plugin_wiki/tags.html

That's it !