dynamic

Ruby: How to call a method using the 'send' method, with a hash?

Let say I have class A with some methods in it. Lets say string methodName is one of those methods, and I already know what parameters I want to give it. They are in a hash {'param1' => value1, 'param2' => value2} So I have: params = {'param1' => value1, 'param2' => value2} a = A.new() a.send(methodName, value1, value 2) # call metho...

Should the new C# type 'dynamic' be used?

Possible Duplicate: Why use dynamic typing in c#? Should the new C# type 'dynamic' be used now much in place of Type safe variables that are compile safe? Or should it only be used in to integrate with dynamic languages like JavaScript or in areas where 'magic strings' where used to access data from XML ect.. which aren't typ...

Dynamically place instances of MovieClip on stage (AS3)

I'm trying to dynamically place instances of MovieClip on the stage. Receiving an error: TypeError: Error #2007: Parameter child must be non-null. at flash.display::DisplayObjectContainer/addChild() ActionScript: // properties in class ---------- var circle_ary:Array = new Array; var circ_num:int;//...

Dynamically changing form action URL has no effect

Hi, When a form action URL was changed dynamically, when the form submit, it will still use the default action URL, anybody know why? Please see a simple example below: <form action="test.php" method="get" id="test"> <select name="id" onChange="formSubmit(this)"> <option value="abc">abc</option> <option value="xyz">xyz</opti...

hitTestObject on dynamically placed MovieClip instances

Trying to do hitTestObject on instances that are dynamically placed on the stage. Receiving an error: TypeError: Error #2007: Parameter hitTestObject must be non-null. at flash.display::DisplayObject/_hitTest() at flash.display::DisplayObject/hitTestObject() at eatCircle() ActionScript: var circ; var circle_ary...

3 divs inside parent div w/o auto resize

I new to webdesign and I wonder how I could do something like this: .......................... LEFT --- CENTER ---- RIGHT .......................... Its one parent div in the center of the window, with 3 divs inside like columns. I want them to be dynamic, so they always scale to the browser window. This is how it looks now. My cur...

jquery.Event of dynamic elements.

my code and my problem is: <script type="text/javascript"> $(document).ready(function() { // this variable is used to set the dynamic elements tagFlag = ''; $("#a1").click(function(event) { event.preventDefault(); tagFlag = 'me'; // setting the element which I want to trigger later }); $('#'+tagFlag).click(funct...

Why calling ISet<dynamic>.Contains() compiles, but throws an exception at runtime?

Please, help me to explain the following behavior: dynamic d = 1; ISet<dynamic> s = new HashSet<dynamic>(); s.Contains(d); The code compiles with no errors/warnings, but at the last line I get the following exception: Unhandled Exception: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'System.Collections.Generic.ISet<object>'...

SharePoint - Dynamically Setting a property on a webpart. Possible with inline C# code block ? or Javascript?

I want to dynamically set the FilterValue1 property of a Content by Query to the querystring IDs value. I tried to do it with an inline embed FilterValue1="<%= Reponse.Write .. but no luck Without having to code my own webpart, any way to change the property value with a small C# code block on the aspx page? How about with javascript?...

DynamicObject and Jint

I want to use DynamicObject class under Jint and I have built a sample to do it. First assert is correctly passes but fails at second assert. Is there any way to do it or do you know any other javascript engine that makes it possible ? public void Jtest() { Jint.JintEngine engine = new JintEngine(); dynamic subject = new MyDyn...

parts of HTML static, others dynamic - PHP or HTML - best way to lookup database

I am creating a website for products. I am wondering: is it better to use a single dynamic page using PHP, or generate an HTML page for every product, updating the pages from a php template file in a cron job? Most of the material on the page (eg. basic product information) will not change over time , but other parts of the page will be ...

return TCollection or array of objects from Dll

I tried to return from dll function my own object (derived from TCollection). I used FastMemoryManager, but without success... So I tried to return dynamic array of some objects. Length of the array of set of course in dll function. It works realtive good, but allocated memory is not freed. (I measure with Windows tarsk manager). Is th...

Dynamic Where in Linq to SQL

How would I get something like this to work so that I can dynamically alter the where-clause in this linq to sql query? Dim AccountID = 1234 Dim AccountList Select Case Types Case 1 AccountList = (from a in dc.Accounts where a.ID = AccountID) Case 2 AccountList = (from a in dc.Accounts where a.ID = AccountID An...

Creation of dynamic model fields in django

This is a problem concerning django. I have a model say "Automobiles". This will have some basic fields like "Color","Vehicle Owner Name", "Vehicle Cost". I want to provide a form where the user can add extra fields depending on the automobile that he is adding. For example, if the user is adding a "Car", he will extra fields in the fo...

How to create a generic List with a dynamic object type

I want to create a generic list of the Type object. I have ... Type type = typeof(Foo); object model = GetModel(); Now I want to create a new List<Foo>((Foo)model) Is this possible in C#? ...

Promote field's IBindingList to class's

I'm creating a table from a dynamically created IBindingList using class TableBuilder { private Type m_TableType; // ... create and define m_TableType here public IBindingList CreateTable() { return Activator.CreateInstance(m_TableType) as IBindingList; } } class DynamicTable : IBindingList { private IBi...

Python, trying to instantiate class imported using __import__, getting ''module' object is not callable'

I've been researching how to do this and I can't figure out what I am doing wrong, I want to use import to import a class and then instantiate it and am doing it as so: the class, from a file called "action_1", I have already imported / appended the path to this) class Action_1 (): def __init__ (self): pass how I am tryin...

SugarCRM 6 - Create an email address-like field to a module

I need to create an email-like field in SugarCRM i.e. one primary value and the ability to add more values dynamically. Anyone who has worked with SugarCRM will know what I'm talking about. Has anyone done anything similar to this? Any help would be appreciated. ...

C - How can I save structs to a malloc'd section of memory?

My question's pretty basic, but it's been a while. I'm reading in a text file and saving numbers in the text to a struct 'Record'. After I read text to my Record buffer, I want to place it in an area of memory. typedef struct { int line_status[64]; float line_data[64], relativetime; unsigned long blkhdr_ticks; } Record; Record *sto...

Getting a relative positioned DIV to take up the remainder of it's parent's vertical space

I'm working on a web application that has a couple widgets positioned all the way on the right using a container DIV with absolute positioning. The first (top) widget is small but with a dynamic/undefined height. The second (bottom) widget contains scrollable content and must stretch to fill the remaining space of its parent DIV. I'm ...