dynamic

Appending facts into an existing prolog file.

Hi, I'm having trouble inserting facts into an existing prolog file, without overwriting the original contents. Suppose I have a file test.pl: :- dynamic born/2. born(john,london). born(tim,manchester). If I load this in prolog, and I assert more facts: | ?- assert(born(laura,kent)). yes I'm aware I can save this by doing: |?...

Does video tag (HTML 5) injection via JavaScript work in any browsers?

I'm trying to dynamically spawn a video element on a page using JavaScript. JavaScript <script type="text/javascript"> $(document).ready(function() { var video = $(document.createElement('video')) .attr('id', 'VideoElement') .attr('controls', 'controls') .attr('src', 'videopath.mp4') // Changed 'href' attribute to '...

DynamicJasper(on Grails) Purposefully keep column or field blank(empty)

Hi, I want to generate a pdf report, where a column(or cell/field) is left blank(empty) on purpose. This column actually does have a value but, I'm choosing not to display it. The column title still needs to be displayed. Example of where this could be useful: Blank(empty) column: A comments or notes column down one side of a report....

dynamic html table

I've to create a dynamic html table using the values configured in a table. I'm using JSP with MVC architecture. I've a row number, column number and value fields in table. If the values are 1,5 and HELLO correspondingly, then I've to display this HELLO in row 1 and column 5. The table structure is like the following. row column va...

Adding a sortcomparefunction to Dynamic Data Grid in flex

Hi, I am trying to create a dynamic datagrid in Flex 3, I have a list of columns a list of objects which correspond to datapoints for those columns which I fetch from a url. While the grid works perfectly fine the problem is that sorting on the columns is done in lexical order. I am aware that this can be fixed by adding a sortcomparef...

javascript: how to delay submitting data when several checkboxes clicked in short time interval?

I have an array of checkboxes in a complex dynamic-html form. Whenever a user clicks one checkbox, a fairly expensive query is generated and submitted to a remote server. I want to delay this submit action depending on the users next action. If the user clicks several checkboxes quickly, all of the first clicks should be discarded, only ...

c# marshaling dynamic-length string

i have a struct with dynamic length: [StructLayout(LayoutKind.Sequential, Pack = 1)] struct PktAck { public Int32 code; [MarshalAs(UnmanagedType.LPStr)] public string text; } when i'm converting bytes[] to struct by this code: GCHandle handle = GCHandle.Alloc(bytes_array, GCHandleType.Pinned); result_str...

Forcing Wordpress Header to not refresh on page load

Hi- I developed a band website using wordpress, and I placed a flash MP3 player that autoplays in the header. Whenever you click on a link, the entire page refreshes and the mp3 player starts playing the first song all over again. I wish to have the entire header including the mp3 player) stay constant while the content/sidebar/footer re...

Dynamic where clause using Linq to SQL in a join query in a MVC application

Dear .Net Linq experts, I am looking for a way to query for products in a catalog using filters on properties which have been assigned to the product based on the category to which the product belongs. So I have the following entities involved: Products -Id -CategoryId Categories [Id] Properties [Id, CategoryId] PropertyValues ...

dynamic module creation

I'd like to dynamically create a module from a dictionary, and I'm wondering if adding an element to sys.modules is really the best way to do this. EG context = { a: 1, b: 2 } import types test_context_module = types.ModuleType('TestContext', 'Module created to provide a context for tests') test_context_module.__dict__.update(context) ...

how to make array of class objects using dynamic allocation in c#?

hi, i made a class named x; so i want to make array of it using dynamic allocation x [] myobjects = new x(); but it gives me that error Cannot implicitly convert type 'ObjAssig4.x' to 'ObjAssig4.x[]' i know it's dump question but i am a beginner thanks ...

Rails - How do you dynamically call the request methods "get put destroy etc" at runtime in tests

I'm always writing tests to check my controller restricts people from certain actions depending on their status i.e. logged in, admin? etc Regardless of whether its a get to :index or a puts to :create the code is always the same. I'm trying to refactor this so that i have one method such as should_redirect_unauthenticated_to_login_ac...

How can I dynamically call the named route in a :partial in rails?

I have the following partial. It can be called from three different times in a view as follows: <%= render :partial => "contact_event", :collection => @contacts, :locals => {:event => email} %> Second time: <%= render :partial => "contact_event", :collection => @contacts, :locals => {:event => call} %> ...

How to dynamically get the DOM of a web page in Javascript

Hi, I would want to dynamically get the DOM structure (HTML source) of a web page. I want to do some manipulations with it later. Is this possible in javascript at all? Thanks. ...

resizing an array with C

So I need to have an array of structs in a game I'm making - but I don't want to limit the array to a fixed size. I'm told there is a way to use realloc to make the array bigger when it needs to, but can't find any working examples of this. Could someone please show me how to do this? Thanks! ...

C# 4.0 'dynamic' and foreach statement

Not long time before I've discovered, that new dynamic keyword doesn't work well with the C#'s foreach statement: using System; sealed class Foo { public struct FooEnumerator { int value; public bool MoveNext() { return true; } public int Current { get { return value++; } } } public FooEnumerator Ge...

Dynamic controls not creating with RSS reader function

Hello, I am working on a test project for an RSS reader. I am using Chilkat's module for .NET 3.5. What I am trying to do is this: For each item in the RSS feed, I want to dynamically create some controls (labels) that contain stuff like the title, the link and the publication date. The problem is that only the first control comes up ...

EXC_BAD_ACCESS on button press for button dynamically added to UIView within UIScrollView

OK. It's an iPad app. Within the DetailViewController I have added a UIScrollView through IB and within that UIScrollView I have added a UIView (also added through IB) which holds various dynamically added UITableViews, UILabels and UIButtons. My problem is that I'm getting errors on the UIButton clicks. I have defined this method: -...

Adding fields to Django form dynamically (and cleanly)

Hey guys, I know this question has been brought up numerous times, but I'm not quite getting the full implementation. As you can see below, I've got a form that I can dynamically tell how many rows to create. How can I create an "Add Row" link that tells the view how many rows to create? I would really like to do it without augmenting th...

Dynamically select field names in a query with Spring JDBCTemplate

Hi, I have a problem with parameters replacing by Spring JdbcTemplate. I have this query : <bean id="fixQuery" class="java.lang.String"> <constructor-arg type="java.lang.String" value="select fa.id, fi.? from fix_ambulation fa left join fix_i18n fi on fa.translation_id = fi.id order by name...