dynamic

HTML5 Speech recognition — is there a way to set what the user is expected to say dynamically? (Using custom Grammars)

断了今生、忘了曾经 提交于 2019-12-30 01:58:10
问题 I am looking for a way to define what you expect the user to say in an <input> tag with the HTML 5 speech attribute set. I know that you can specify a specific grammar to use via the grammar attribute, like this: <input type="text" speech grammar="grammar.grxml" /> ( see http://lists.w3.org/Archives/Public/public-xg-htmlspeech/2011Feb/att-0020/api-draft.html ) but I was hoping for a way to make this dynamic, so that I can specify what I expect the user to say via javascript. For example, if

Android Adverse To Dynamic Languages

不想你离开。 提交于 2019-12-29 18:36:19
问题 I believe I read at some point that due to Android running on the Dalvik VM, that dynamic languages for the JVM (Clojure, Jython, JRuby etc.) would be hard pressed to obtain good performance on Dalvik (and hence on Android). If I recall correctly, the reasoning was that under the hood, in order to achieve the dynamic typing, there was quite a bit of fiddling done with the java bytecode and that the bytecode->dalvik translation wouldn't pick this up easily. So should I avoid a dynamic JVM

How to insert script into HTML head dynamically using Javascript? [duplicate]

耗尽温柔 提交于 2019-12-29 18:33:09
问题 This question already has answers here : How to add DOM element script to head section? (10 answers) Closed 2 years ago . How to insert script into HTML head dynamically using Javascript ? 回答1: var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.onload = function() { callFunctionFromScript(); } script.src = 'path/to/your-script.js'; head.appendChild(script); 回答2: document.head.appendChild(document

R Shiny display full dataframe without filter input until filterinputs are changed

寵の児 提交于 2019-12-29 09:22:29
问题 I am trying to build an app which displays a dataframe as a datatable. I wanted to provide users with ability to subset the datatable with selectinput and daterangeinput filters on the sidebar panel. Heres when I ran into issues, it only subsets the datatable when all the inputs are selected it displays an empty datatable on loading the app when one of the inputs are changed back it doesnot update the datatable. Here is my sample code for shiny app Region <- c("USA","UK","JPN","JPN","UK","USA

dynamic query postgres

筅森魡賤 提交于 2019-12-29 09:21:48
问题 I am new to postgres and running following dynamic query EXECUTE 'Select * from products'; I get following response. ERROR: syntax error at or near "'Select * from products'" LINE 1: EXECUTE 'Select * from products'; I Know this would be something basic I m missing 回答1: There is the EXECUTE statement of plpgsql , which would do what you are trying to do - execute an SQL query string. You tagged dynamic, so this may be what you are looking for. Only works inside plpgsql functions or DO

method_missing-like functionality in objective-c (i.e. dynamic delegation at run time)

≡放荡痞女 提交于 2019-12-29 09:18:09
问题 I'm trying to transform one method call into another dynamically (at runtime). For instance, I'd like the following: [obj foo] to delegate to: [obj getAttribute: @"foo"] (I'd like to do this dynamically as I don't know ahead of time what those method names or attributes are going to be). I see that there's a hook into: - (id) forwardingTargetForSelector: (SEL) aSelector That only seems to work for delegation, though, I want to keep the object as "self" and transform the method arguments.

activate lightbox on dynamically added content

↘锁芯ラ 提交于 2019-12-29 09:16:12
问题 I'm developing a little portfolio where I can choose a category and when I click it, the content (thumbnails) of that category will be shown (this is via an array). e.g. photography[0] = <a href="..." rel="lightbox" /><img ... /></a> photography[1] = <a href="..." rel="lightbox" /><img ... /></a> At first the site shows the content of all categories and when I click a thumbnail it activates lightbox, however if I choose a category and then press one of the remaining thumbnails is simply leads

Accessing properties of anonymous/dynamic types across dll boundaries gives RuntimeBinderException

。_饼干妹妹 提交于 2019-12-29 09:09:48
问题 In the following sample, x.propertyX works fine, whereas y.propertyX gives me a Microsoft.CSharp.RuntimeBinder.RuntimeBinderException , complaining 'propertyX' is not defined in 'object'. The CreateDynamic method in the Program class (shown below) and the one in Class1 (not shown) are exactly the same, but Class1 is in a different project from Program. If I move Class1 into Program's project, everything works fine. class Program { public static object CreateDynamic() { return new { propertyX

Dynamic allocation of 2D array within function (using pointers to return adress of allocated object)

天大地大妈咪最大 提交于 2019-12-29 08:24:38
问题 I'd /ike to know, how to pass pointers to dynamically allocated arrays using function arguments. This function is supposed to allocate array 10x10 (checks skipped for simplicity sake). Is this possible? What am i doing wrong? Thanks in advance. int array_allocate2DArray ( int **array, unsigned int size_x, unsigned int size_y) { array = malloc (size_x * sizeof(int *)); for (int i = 0; i < size_x; i++) array[i] = malloc(size_y * sizeof(int)); return 0; } int main() { int **array; array

Dynamic query with LINQ won't work

断了今生、忘了曾经 提交于 2019-12-29 08:15:08
问题 I've tried a couple of ways to execute a simple query but without success. var result = db.Persons.Where("surname = bob"); The above will give the error: No property or field 'bob' exists in type 'Person' var result = db.Persons.Where("surname = 'bob'"); The above will give the error: Character literal must contain exactly one character Has anyone else had these problems and what did you do? Isn't Dynamic LINQ suppose to work like this or are there older versions or something? I've added the