I need to use a few of the VideoCapture::set() options for openCV. They are here;
http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html#videocapture-set
But I cannot find anywhere something that specifies the range of values that can be used to give each parameter a value.
Can someone help?
That information is really missing, and with some of them you really need to take a hit & miss approach.
For the time being, you can check the return of VideoCapture::set() to see if the method succeeded in setting that parameter.
Related
I'd like to a construct which is going to kick in by default and therefore I'll be able to extract some metadata and remove it from the parsed YAML.
For instance I could have a construct to do that but in SnakeYAML to register a construct one has to specify a String for it meaning that it has to have a name. However, I don't want that but instead I want my tag to be a root one, a default one which always will kick in so to say.
Is there a possibility to do something like that?
Cheers,
I actually found the answer myself, there is a property
at org.yaml.snakeyaml.constructor.BaseConstructor#rootTag which one can set a tag like:
super.rootTag = new Tag("!root");
The rest is simple because one has to only register that construct to org.yaml.snakeyaml.constructor.BaseConstructor#yamlConstructors and you are done. Your construct will be triggered in all read attempts.
Hope that helps to someone,
Cheers,
To get the duration of an AVPlayerItem I could do: player.currentItem.duration.
Instead of this, I could also get the duration from my backend as an Int. Then I can convert this to a Float to be used anywhere I need the duration for. I think this might be better in terms of performance and less work on my end to get the duration.
For example Apple says this about getting duration:
“A vital concept in AV Foundation is that initializing an asset or a
track does not necessarily mean that it is ready for use. It may
require some time to calculate even the duration of an item (an MP3
file, for example, may not contain summary information). Rather than
blocking the current thread while a value is being calculated, you ask
for values and get an answer back asynchronously through a callback
that you define using a block.”
Any thoughts on things that could go wrong if I decide to hardcode the duration by getting it from the server? Is this good practice?
If you already know the value on your backend, and you're already making call to say get the video URL, retrieving the duration seems a reasonable idea.
Although - is there any chance of a mismatch? If you do it client side it's "guaranteed" to be correct.
If you have to make a special call to get it, I wouldn't as it's likely to take much longer than determining it during asset initialisation.
I have a table called settings, when I would change or enter data into the form it did not change the data in the table. In addition on form an image upload file is not running, There may be the wrong code below.
(Solved by me)
Maybe someone can help me Related to this.
What you are doing here is tottaly in secure and your data can be hacked / manipulate really fast.
Why dont you use a framework like codeignighter there are about 100 easy frameworks that will help you manage database a lot easyer.
Are you sure that you are updating the wrond ID? where id = 1, seems to be not dynamic.
Please post your error http://www.w3schools.com/php/func_mysql_error.asp
I know it is not so related to your question, but you should see these light frameworks:
http://kohanaframework.org/
https://github.com/ElbertF/Swiftlet
http://ellislab.com/codeigniter
You're not checking the return status of of your query, so if it's not working you wouldn't know. Do this:
mysql_query("UPDATE settings SET site='$name',keywords='$keys',descrp='$desc',email='$email',fbpage='$fbpage',twitter='$twitter',gplus='$gplus',disclaimer='$disclaimer',template='$template' WHERE id=1")
or die(mysql_error());
Note: mysql_*() is deprecated: you shouldn't use it. Use mysqli_*() or PDO instead.
Also: You are susceptible to an SQL Injection attack. You should escape your input variables with mysql_real_escape_string() (or the equivalent if you switch to mysqli), or consider moving to prepared statements.
Is there anything called ExecuteNonScalar ? in any of the programming language.
No. But there is ExecuteNonQuery, and ExecuteScalar.
Well there is a method called "ExecuteScalar" in .NET. It basically returns the first column of first resultant row.
For more info and example you may check this: link
The docs for ICLRRuntimeHost::SetHostControl claim that it can return E_CLR_ALREADY_STARTED. I have been unable to find a definition for this value. Ideally, I'd like to know what the appropriate header to include is (it does not appear to be in corerror.h) but if someone can provide me with the canonical value too I can live with that.
Thanks
I can't seem to find it either and I'm usually pretty good at finding missing or misspelled constants. You could try calling the method after initializing the CLR and if it does in fact return the HRESULT that it's documented to return, you could just trace it. But it definitely seems like a documentation bug.