dynamic

.Net 3.5 DLR DynamicObject Help

I have been struggling to get a simple DynamicObject example working in .NET 3.5. Using the latest build of the DLR off codeplex I haven’t been able to figure out what the .NET 3.5 equivalent to the following is: public class DynamicObjectBag : DynamicObject { private Dictionary<string, object> _properties = new Dictionary<string, ...

Adding User-specific classes dynamically

I noticed that some wordpress themes ('Thematic' for example) adds user specific classes to the body element so you don't have to retort to CSS browser hacks, for example: wordpress y2010 m02 d26 h05 home singular slug-home page pageid-94 page-author-admin page-comments-open page-pings-open page-template page-template-home-php mac firef...

Specific problem developing my jquery menu

Hi guys, I am developing a menu using jquery. The menu grows dynamically, and i need to keep the appearance for each level. And i do, but the problem is now the browsers. IE and Mozilla. I am using jquery to get the width of unordered lists for when i pass with the mouse over the next level opens, in that width shifter to the right ht...

Dynamically creating a new javascript class from an existing object.

Say I have the following code: var album = new MyObject('album'); Assume that when the object is constructed, a bunch of properties relative to only albums are loaded via AJAX. Would it be possible to create an Album class so that at a later point, I may just do this: var anotherAlbum = new Album(); The Album constructor would auto...

How would I have a dynamic Activity based on Web Service input?

I'm looking to have an app that calls a web service, and the return from that WS would specify a specific puzzle to play (sudoku, arithmetic, logic, problem solving, memory, etc). I think that each puzzle should be its own Activity, but I don't know if they should be nested in my main app Activity, separate Activities, or something else...

Error: Missing compiler required member 'Microsoft.CSharp.RuntimeBinder.Binder.Convert'

I'm working on a Silverlight 4 app and I want to test out the new COM Interopability and I am getting this error. I have a reference to Microsoft.CSharp but I still get the error. dynamic excel = ComAutomationFactory.CreateObject("Excel.Application"); Any Ideas? ...

Handling a radio button array in php

Hi all, I have a bit of PHP code that is really taking a toll on me. To simplify, I have a table where three of the columns are forign keys (event_type, accommodation_type and public_user). I am dynamically creating a set of radio buttons and I have set the ID attribute on each imput value correctly. $result2 = m...

Dynamically build list comprehension in Haskell

I am curious if it is possible to dynamically build a list comprehension in Haskell. As an example, if I have the following: all_pows (a,a') (b,b') = [ a^y * b^z | y <- take a' [0..], z <- take b' [0..] ] I get what I am after *Main> List.sort $ all_pows (2,3) (5,3) [1,2,4,5,10,20,25,50,100] However, what I'd really like is to ha...

Problem with dynamically generated JavaScript click events

I am trying to generate several divs which each should have a separate onclick handler. However, when I create multiple items in my application, all of the previous items have the same onclick event as the first one. Below is the code that generates the html based on an array or "Project" objects. How can I change this code to retain all...

center flash element based on the elements actual size 2

I everybody, I have qustioned this question already in that post: http://stackoverflow.com/questions/2355481/center-flash-element-based-on-the-elements-actual-size but I didn't find any usable solution. I guess its quite tricky so I re ask the question here: how can I place a swf file in my webpage when the width of the file changes ...

Dynamically Creating Variables In Actionscript 3.0?

i'm loading several sound files, and want to error check each load. however, instead programming each one with their own complete/error functions, i would like them to all use the same complete/error handler functions. a successfully loaded sound should create a new sound channel variable, while an unsuccessfully loaded sound will prod...

[Android] How to make a dynamic layout with clickable text, checkboxes and buttons?

Give me please an advise, I want to make a dynamic layout which contains mixed elements [text] [checkbox] [button] [text] [checkbox] [button] [text] [checkbox] [button] ...... Can you give me some sample code, please ...

How do I pass an ExpandoObject from C# into IronRuby?

Executing the below code gives me the following exception on the last line: InvalidOperationException: "unbound variable: value" var rubyRuntime = Ruby.CreateRuntime(); rubyRuntime.UseFile("HandleMoveRequested.rb"); var engine = rubyRuntime.GetEngine("rb"); dynamic ruby = engine.Runtime.Globals; var handler = ruby.HandleMoveRequested....

haskell vs python typing

I am looking for example where things in python would be easier to program just because it is dynamically typed? I want to compare it with Haskell type system because its static typing doesn't get in the way like c# or java. Can I program in Haskell as I can in python without static typing being a hindrance? PS: I am a python user an...

JQuery slide animation reveal div height issue

Hi, I have added a JQuery slide reveal effect to a page which partially shows the main content div (with text, flash and or images) for a couple of seconds then it animates to reveal the full content div. The scripted animation is added to the ".slide" class div on the page which can have various amount of height based on how much text ...

StaticResource vs DynamicResource behaviour on Combobox.ItemsSource

I've noticed a behavior difference between static and dynamic resource on ComboBox.ItemsSource, when the ComboBox gets out the visual tree. in the static exemple the selected destination remains in the dynamic exemple, the underlying object gets a null value Binding seems OK, because when the comboboxes gets in focus, and have their ...

One constructor - multiple arguments

I've found a task on some Java programming competition. One must create class Sentence with only one argument 'text' and only one constructor. Here's sample test code : Sentence s1=new Sentence("only","CAT"), s2=new Sentence("and", 2, "mice"), s3=new Sentence(s1,s2,"completely","alone"), s4=new Sentence(s3, "on the ",...

Any tool to find size of memory allocated dynamically using malloc/realloc?

Hi, I have a MS-Visual Studio 2005 workspace having all c code. This application(exe) allocates memory dynamically from heap using malloc and realloc. I want to calculate the maximum size allocated size allocated on heap using malloc/realloc by this application program when i run particular test case. I do not want to change the code b...

Call a COM DLL dynamically

I have an application in VC++ which needs to execute a function provided to it (function name entered in a text box) from a COM DLL (file name provided in another text box). I have seen code for loading a Win32 library using LoadLibrary and GetProcAddress. How can this be done for a COM DLL file (created in Visual Basic 6.0)? Is there...

C# dynamic assignment of properties in a loop

Hi all, I didn't quite get / see what I was hoping for and maybe missed, so I'll ask again anyhow. I have a class with fields on it. I have a data table that I'm querying from with the same columns and corresponding data types. I have a string array of all fields I am concerned about, and their specific order. What I want to do is cy...