dynamic

qt - dynamic forms very slow

qt - This code very slow QWidget *MainWindow::loadUi(QString uiPath) { QWidget *newui; QUiLoader loader; QFile uiFile(uiPath); if(uiFile.open(QIODevice::ReadOnly)) { newui = loader.load(&uiFile); newui->show(); uiFile.close(); } else { QMessageBox::warning(this, "error", "o...

ASP.NET Dynamic page generation

Hi, I'm developing an online survey application for my University project. I managed to save the newly created survey data into the database and now the problem is that i don't know how to populate the saved questions into a page (which sent to the customer to get responses) dynamically. And that response data should also be saved to...

jquery lightbox on dynamic image

I would like to use lightbox (pirobox) for dynamically generated images. I use standard method - load css, js files and add selector on element, but it doesnt work. Have you any experiencies with it? I Also try $('.pirobox').bind('click', function() { $('.pirobox').piroBox({ my_speed: 400, bg_alpha: 0.3, slideSho...

Reduce dynamic SQL using CASE to use "IN" or not

I am converting a stored procedure which I had previously written as a string then, using BIT parameters I decided whether to append certain WHERE/ON clauses This sp is passed a number of comma-separated strings and then some of the dynamic WHERE clauses are like: IF @pUse_Clause_A THEN SET @WhereClause = @WhereClause + ' AND [FIELD_A]...

Dynamically Create Instance Method in PHP

I'd like to be able to dynamically create an instance method within a class' constructor like so: class Foo{ function __construct() { $code = 'print hi;'; $sayHi = create_function( '', $code); print "$sayHi"; //prints lambda_2 print $sayHi(); // prints 'hi' $this->sayHi = $sayHi; } } $f = new Foo; ...

create unique id with javascript

I have a form where a user can add multiple select boxes for multiple cities. The problem is that each newly generated select box needs to have a unique id. Can this be done is JavaScript? UPDATE: here is the part of the form for selecting cities. Also note that i'm using some php to fill in the cities when a specific state is selected....

Is there a C# version of CTypeDynamic?

From the documentation: The CTypeDynamic method applies dynamic conversions in accordance with the conversion semantics defined by the object itself. If a dynamic object inherits from DynamicObject, the CTypeDynamic method first attempts to perform the conversion by using a user-defined, static conversion. If the user-defined, static...

ASP.NET MVC2 - Dynamic list of checkboxes and model binding

I'm trying to create a view that contains a list of checkboxes that is dynamically created from a database, and then retrieve the list of selected ones when the form is posted back. My EF model contains a class: public class ItemIWouldLikeACheckboxFor { public int Id { get; set; } public string Description { get; set; } } I...

Weird scrolling problem with UITableView

I have a sectioned UITableView which loads data from a plist file. The table uses custom cells with dynamic height to fit the content of each cell. The table loads just fine initially, but after scrolling down and back up, the cells seem to be overlaying one another in some sections. I've attached an image illustrating the issue I am h...

How do I allocate memory and determine array sizes dynamically in C?

I am trying to teach myself C from a python background. My current mini-problem is trying to do less hard-coding of things like array lengths and allocate memory dynamically based on input. I've written the following program. I was hoping for suggestions from the community for modifying it in the following ways: 1.) Make first and ...

How to compare 2 lists of objects and remove the items that are not common?

I've got 2 generic lists that do not contain the all fields of the same type IList<Category> and List<CategoriesRow>Categories categoryList = IList<Category> but both have common fields Name and ID. I want to compare list Categories with categoryList and find from categoryList where categoryList[index].ID does not exist in the list ...

CreateObject equivalent for C# 4, dynamic keyword, and late binding?

How do I create a dynamic COM/OLE/ActiveX object in C# 4.0 from a program identifier or ProgID (such as "Word.Application") without referencing a library? In C# 3.5 I'd have to write something like Type comObjectType = Type.GetTypeFromProgID(progId, true); Activator.CreateInstance(comObjectType); Is there an easier way to do it in C#...

Dynamic loading of uncompiled python plugins in py2exe compile code

My Python application is constructed as such that some functionality is available as plugins. The plugin architecture currently is very simple: I have a plugins folder/package which contains some python modules. I load the relevant plugin as follows: plugin_name = blablabla try: module = __import__(plugin_name, fromlist='do_somethi...

How do I use dynamic objects with asp.net?

I have a dynamic object built inside IronPython and I would like to build controls on my asp.net page dynamically based on what types of objects are nested inside my dynamic object: dynamic variousComplexObjects = IronPythonApp.GetControls(); repeater.DataSource = variousComplexObjects; repeater.DataBind(); Can someone write me a quic...

How to load a script into a XUL app after initial loading

Greetings, my xul app needs to load scripts dynamically, for this I derived a function that works in regular html/js apps : function loadScript(url) { var e = document.createElement("script"); e.src = url; e.type="text/javascript"; document.getElementsByTagName("head")[0].appendChild(e); } to something that ought work in XU...

Can PHP __autoload() a class from within another __autoload() of the same class?

OK, this is a tough one... I think, and I have a feeling the answer is simply no, but in that case I would like some answers for alternatives. I have a very complex __autoload() function in a framework which can dynamically create classes. There a three classes required in order for the dynamic creation of a class called AuthActions --...

Serialize a list<string> and use each string as xml Node

I've ran into a problem and wondered if there's simple way of solving it. Here I have a XML template, defining some properties and their values. <Properties> <Property name="ID">10000</Property> <Property name="Name"> <SubProperty name="FirstName">Foo</SubProperty> <SubProperty name="LastName">Bar</SubProperty > </Propert...

compiler design for direct execution

Do you know good compiler designs when the output should be located into the process memory and executed immediately after compiling? I've looked into few SCHEME compilers and read whatever I could about V8. There's interesting JIT techniques like inline caching I would like to try in my own compiler. It's all right to answer with almo...

How to easily log a dictionary of arguments and serialize to JSON using Trace in C#

I need a flexible way to log keyvalue pairs of arguments using System.Diagnostics.Trace. Basically, when I need to log something in code I would like to make a method call which passes a message and a dictionary of values. Its obviously not hard but I want to make it clean and if possible enforce the key names which are allowed. This is...

Possible to manipulate javascript generated elements?

I have a page dynamically generated with javascript and it contains several input fields and a button. When I click the button, nothing happens...Is it because it is a javascript object and not a "real" dom object? If so, is there a way to interact with the object? I just wrote a simple alert to see if the button is even working. jQu...