Open video file by clicking on cell - openoffice.org

I have a spreadsheet that has a list of video filenames in one column.
I'd like for a video player to open when I click on a filename.
Is there a simple way to do this?
There's a hack that lets you call external applications using the HYPERLINK command:
=HYPERLINK("mplayer", "foo")
This opens up mplayer (or whatever you tell it to). However, if I try to pass a command-line argument to the executable using:
=HYPERLINK("mplayer ~/Desktop/foo.mpeg", "foo")
then I get the error: "OpenOffice could not find a web browser on your system". It's probably attempting to parse the first argument and tripping over a space.
Does anybody know of a way I can achieve what I want? Perhaps there's a way to do this with macros?
The list of filenames is auto-generated (hundreds) so I don't want to do anything manual.

You might try using %20 instead of the space, though I don't expect it to work.
Does your player have anything like a play-list provision? It seems that it would be more direct to compile a play list in whatever format that is, than attempt to force HYPERLINK( ) to work here.
The other possibiity is to see if there is a URL scheme registered on your system that will invoke the player, rather than a command line. Or just use the file: scheme and see if you can launch the mpeg that way. You may have to monkey with the file path to get it right. You may also have to %-escape the '~' if you have any of those.

Related

How to get .mpd file for a youtube video

I am trying to use DASH using ExoPlayer in android,
I need to get url for mpd file.
Can I get URL for .mpd file for any YouTube video?
How to find URL .mpd file for a particular YouTube video ?
As I commented out, you could use the python library extract-youtube-mpd for that. But it requires python and Linux.
Through it's code, I've found these are the steps it follows plus extra ones if you like to create your own automation/extension:
1) Right click in page and select to show page's source code
2) search the HTML file (the one that will be shown) for "dashmpd"
3) extract the text within quotes, as in (e.g.):
"dashmpd":"https://manifest.googlevideo.com/api/manifest/dash/ ... "_
4) replace "/" for "/" if needed (i.e. if not using regex). This will give you a source for a XML file
5) parse the XML, through periods, adaptation sets and representation settings (this is when it gets complicated)
Since I'm also in the need for this, I'll probably release a node module for this.. Will update here

Using signature file in script

I like using .fsi signature files to control visibility. However, if I have both Foo.fsi and Foo.fs files in my solution, and #load "Foo.fs" in a script, it doesn't seem like the corresponding signature file gets used. If I do:
#load "Foo.fsi"
#load "Foo.fs"
... then the desired visibility control happens. Is this the recommended way to achieve this, or is there a better way to do it? In a perfect world, one would like to see the signature file automatically loaded, too.
Not a final answer, but a better way.
From reading Expert F# 4.0 one can do
#load "Foo.fsi" "Foo.fs" "Foo.fsx"
All three loads are on one line.
TL;DR
The link to the book is via WolrdCat just put in a zip code and it will show you locations near there where the book can be found.

how to overwrite, or delete the file, used by writefile() calls?

I use the following to save screen output to a file
writefile("file.txt"),
tex(expression),
closefile()
The above sends the output of the tex() to the file automatically. which is all and well and what I want. (side-point: It also sends an annoying NIL line each time to the file, which I had to parse put later).
Now, when running the above code again, the file is appended to, which is not what I want. I want to either overwrite the file each time, or if there is a way to delete the file, so I can call delete on it before.
I looked at help and not able to find a command to delete a file, and I also see no option to tell writefile() to overwrite the file?
Is there an option or way around this? I am on windows 7, Maxima version: 5.36.1
Lisp: SBCL 1.2.7
I guess you are trying to capture the output of tex into a file. If so, here are a couple of other ways to do it:
tex (expr, destination);
where destination is either a file name (which is appended) or a stream, as created by opena or openw and closed by close. By the way, destination could be false, in which case tex returns a string.
with_stdout (destination, tex (expr));
where again destination is either a file name (which is appended or clobbered, as determined by the global flag file_output_append) or a stream.
with_stdout could be useful if you want to mix in some output not generated by tex, e.g., print("% some commentary");.

Python kivy filechooser reads wrong path

I'm trying to use Kivy as a GUI for my python app, which needs to read a file from the filesystem.
However, in some cases the kivy filechooser read wrong path or nothing causing an IndexError while I'm trying to set the read path for a text of a textfield.
I use the default example for reading files learned from http://kivy.org/docs/api-kivy.uix.filechooser.html
The relevant part of my app is in this function, where an exception handling is added as a not a good approach to handle this :)
def load(self, path, filename):
'''
this will load the file and dismiss the dialog
'''
print "Loading file..."
print "filename:",filename
print "path:",path
try:
self.selected_file = filename[0]
self.file_text_input.text = self.selected_file
self.dismiss_popup()
except IndexError as ie:
print "Something made a boo-boo...try again"+str(ie)
self.dismiss_popup()
self.show_popup("ERROR","Somehow I couldn't load the file:\nCheck the permissions or move it to other place")
self.show_popup() is just a helper function, which shows a popup with the set function params.
The basic error is that filename[0] will throw an IndexError since it does not read the correct path.
I'm using Linux with python2.7, and somethimes when I select a file in my home folder, the filename variable stores nothing, while path variable stores misteriously a random folder, for instance, /media, /opt, etc.
Did anyone meet this issue?
I found out why it was handled uncorrectly.
All the failures are caused by Kivy's
FileChooserListView
, which enables to click on folders and files via a list, but it also makes it possible to have a littel '>' sign at the beginning of every list element, which are directories.
I realized that when I used these '>' signs, then I get wrong path, but if I always clicks on the directories' list elements then everything works fine.
However, that little '>' cannot be disabled (for now), so the best and fastest alternate solution is using
FileChooserIconView
instead!
Now everything is good :)

How Can I Handle Parameters With Spaces in Delphi?

My program accepts input file names either as command line parameters or in a drag and drop operation or in Explorer by clicking on filenames with an extension that is associated with my program.
The command line and drag and drop work fine, but it is clicking on the filenames in Explorer that causes problems when the filepaths of the files clicked on have spaces in them, e.g.:
c:\temp\file one.txt
c:\my directory\filetwo.txt
c:\my directory\file three.txt
then, the ParamStr function gives me back:
ParamStr(1): c:\temp\file
ParamStr(2): one.txt
ParamStr(3): c:\my
ParamStr(4): directory\filetwo.txt
ParamStr(5): c:\my
ParamStr(6): directory\file
ParamStr(7): three.txt
How can I best reconstitute these back into the three filenames that I need?
It might be your shell file association that does not include the pair of "".
Like these ones for opening:
"C:\Program Files\WinRAR\WinRAR.exe" "%1"
or with DDE message:
[open("%1")]
Command-line parameters with spaces in them, such as filenames, should be quoted. This makes the param parser realize that it's supposed to keep them together. If the user's not quoting the filename, it's operator error.
If a drag-and-drop system is doing this, on the other hand, then you've got a bug in your drag-and-drop library and you need to talk to whoever created it. I'm a bit confused, though, as to why drag-and-drop operations are messing with ParamStr. That should only be set by the params passed to your program at the moment it's invoked, not once it's up and running. Maybe I'm missing something?
i use the CmdLineHelper unit, from here.

Resources