dynamic

Array Elements Overwritten with Last in C

I'm trying to create a program which takes in a set number of strings (the user is asked to put in the number of strings they will enter), once it has these strings, they are placed in an array, using dynamic memory. The ouput would be something like this: # of Strings: 3 Cat Dog Elephant Cat Dog Elephant Heres a snippet of my code...

Dynamically assign special methods to objects but not classes in Python

I would like to do the following: class A(object): pass a = A() a.__int__ = lambda self: 3 i = int(a) Unfortunately, this throws: Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: int() argument must be a string or a number, not 'A' This only seems to work if I assign the "special" method to the ...

What is the correct way to register javascript for dynamic user controls in AJAX.NET update panel?

Hi all! I've been googling this for days. Found a few threads about similar issues, all without any meaningful answers... Maybe someone here can enlighten me. I'm developing an AJAX.NET application in VS2005 (.NET 2.0 with AJAX extensions). There's just one page that has a navigation panel and a content panel. Basically, both panels ar...

Dynamically update a drop down menu after a user types something that should be added to list

I am creating a website in php with a form that teachers complete to tag each question on a test with a label. The labels are predetermined and listed in a set of drop down menus (one for each question on the test), but there is an option for users to click "add a new label" which pops up a another form in a new, smaller window (while ke...

Dynamic Data: Display edit, delete and Details at the end of the grid

Hi, I implemented Dynamic Data Website and I would like to display edit, delete and Details columns at the end of the Grid. Please let me know how to do this. Thank you for any suggestions. ...

dynamically set named_scope based on current_user

Hey all, I keep getting the following error: You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.size Based on the current user, when they navigate to a page, I want to limit them to what they can see based on their site. Problem is there is no associat...

What technology to use to add dynamic external content to web application

I am searching for a pointer to the right direction for the following requirement. We have a web application running on Tomcat, that contains ad-hoc reports based on BIRT. The main application has a few tabs containing various reports. Each tab contains a form based on JSF to gather user parameters and passes this to a BIRT web service ...

Implementation of a general-purpose object structure (property bag)

We need to implement some general-purpose object structure, much like an object in dynamic languages, that would give us a possibility of creating the whole object graph on-the-fly. This class has to be serializable and somehow user friendly. So far we have made some experiments with class derived from Dictionary<string, object> using t...

Is it possible to declare a dynamic constant in VB .NET?

I'm trying to save a timestamp into a constant at the beginning of a program's execution to be used throughout the program. For example: Const TIME_STAMP = Format(Now(), "hhmm") However, this code generates a compiler error - "Constant expression is required." Does that mean all constants in VB .NET have to contain flat, static, hard-c...

Avoiding Javascript Jumping Elements in Dynamic Forms

I'm trying to use javascript to code up a dynamic form, where elements are shown or hidden based on whether or not checkboxes are selected. For the most part, it works okay. I defined methods that read the value of the checkbox, and rearrange the page accordingly, and then set them to the checkboxes' onclick methods. I then also set t...

jQuery: Problem with submission of dynamic form elements

Hello, I'm trying to submit a form which contains dynamic elements that were added to the DOM by jQ after the page has completed loading. When I run a serialize() on the form, it's grabbing the data for all fields that are hardcoded into the page - but not the dynamic fields. Here are some code snippets of the same.. HTML <form ...

New classes created by users?

Consider this situation: I've got an aquarium simulator where I have 5 different types of fishes. Different types means different attributes (speed, colour, hunger, etc). What if I want the user of my simulator to be able to create a new type of fish and give it its values for its attributes? How is that implemented by the programmer? D...

jQuery: load refuses to get dynamic content in IE6

jQuery refuses to load my dynamic content in IE6. All in FireFox & Safari works fine. Only IE6 is being a pain. When I try the a html with <p>Hello World</p> that works. Properly. But when loading a PHP it doesn't work! As you can see it's doing multiple things. <script type="text/javascript"> // When the document is rea...

Dynamic Data Javascipt Error

When using Dynamic Data and trying to Edit/Update a row, change a filter, etc. I get the below error. This happens on both ListDetails.aspx and List.aspx and I have not modifed these pages in any way. It works fine when running it under the VS 2008 Web Server, but not when I deploy it onto our servers (I have tried three different serve...

How to set a variable attribute of an xml element in actionscript 3?

Something that should be very easy has been the quest of my day. How do you set a variable attribute of a xml element? This is what I expected to work: xmlElement.attribute(variableAttr) = "the variable attribute is set to this string"; However, I'm getting some error that this value can only be retrieved as a reference and not set....

creating dynamic html c#

i wanted to create a web server while on the process..... i am not being able to create a dynamic html which could take link from my c# console application... for example i have a code which shows files from the system.. for example "c:\tike\a.jpeg" now i wanted to make that particular link a a href link in my html page... any help w...

Dynamic array allocation in C++ question

I have a struct of type Duplicate I have a variable of type int called stringSize, it has a value of 5 I am creating a dynamic array: Duplicate *duplicates; duplicates = new Duplicate[stringSize - 1]; Later I delete[] duplicates; I'm getting one member in that array only? I've verified that stringSize - 1 = 4 with a debug walk throug...

Need to generate EDMX files and compile them

Hi All, My question might be little bit different or basic for advanced users here. I have a web application which is customizable by administrators. This means, the admin can add new table schema or edit table columns, add new table columns etc. These changes are mapped to our logical objects (much similar to EDMX) which is publishe...

Can the "dynamic" type vary safely in a generic collection<dynamic>?

Based on my answer to this question, I want to check something on my understanding of the upcoming dynamic type for C# 4. In this case, we have a collection that represents fields in a record pulled from an unknown database table. Older code (pre-.Net 4) requires such a collection hold items of type Object. Merits of a such a collecti...

set a variable in mutliple places in a master page

I am trying to grab a string of text from the .vb file of my master page. I need to render this text out as part of the class definitions. E.g. <div id="######ContentArea"> I need to replace the ###### with a string I have created in the .vb file. How do you do this? Or is there an easier way = NEWBIE here! ...