dynamic

Url Rewrite with a CMS - Dynamic Rewrite

Hello, I would like to change URL Rewrite working in the CMS of the company I'm working for I have already done a little one: eng/MyFolder/16/MyCategory.aspx MyFolder/index.aspx?FolderId=19&LanguageId=1&SiteItemsCategory=16 with: {R:2}/index.aspx?FolderId={Folder:{R:2}}&LanguageId={Language:{R:1}}&ItemsCategory={R:3} I use rewrite...

.Net 4 Dynamic objects with LinqToSql?

In our Smartclient app we currently use PostSharp to inject get/set code into auto properties to implement Dirty state tracking and INotifyPropertyChanged events. We often use these business objects with LinqToSql. We'd like to remove this dependency on Postsharp, and the .Net 4.0 ExpandoObject looks perfect. We can add dynamic properti...

how to create methods from arrays or hashes in perl6

I am trying to add new methods to an object dynamicaly. Following code works just fine: use SomeClass; my $obj = SomeClass.new; my $blah = 'ping'; my $coderef = method { say 'pong'; } $obj.^add_method($blah, $coderef); $obj.ping; this prints "pong" as expected, whereas the following will not work as expected: use SomeClass; my $...

Dynamic database-driven menu in ASP (C#)

Hi, I'm trying to create a database driven dropdown menu. For now i'm using a EO.WEB third party component for ASP, which is preety good, but it doesen't give me quite what I need (design-wise). I have a SQL procedure written which gives me the child node names for the menu and their links (eg. CAST(('showInfo.aspx?cityId='+''+CAST(dbo...

hide radio button onlick javascript

i am trying to hide radio button values when you click it. i can do this if in a non dynamic way like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> <script language="JavaScript"> <!-- function showDiv( id ) { document.all.textBox01.style.visibility = 'hidden'; d...

C# : dynamic polymorphism with non polymorphic classes

Hello, I have a set of classes which I didn't write, and they're read only. Let's say, for the example, that those classes are the following ones: public class Base { } public class B : Base { } public class C : B { } public class D : Base { } I want to add a method Foo() on all these classes, I am using extension methods: public st...

Dynamic Expression API (Dynamic.cs) Not properly parsing expression in .net 3.5

Hi I'm having trouble getting this API working in .net 3.5 (works fine in 4.0). Basically I have following code List<ParameterExpression> parameters = new List<ParameterExpression>(); parameters.Add(Expression.Parameter(typeof(double), "R0C6")); parameters.Add(Expression.Parameter(typeof(double), "R0C7")); parameters.Add(Expres...

Is there a __get magic method equivalent for instantiating classes?

Looking to see if there is any way to implement the kind of functionality of the __get() magic method, but when trying to instantiate a new class. My goal is to have $foo = new Cat(); Ultimately result in the creation of a generic object, i.e. new Mammal('Cat'); Such that $foo would be an instance of the class Mammal, with the calle...

MySQL dynamic JOIN

Let's say that I have these tables on my db: items categories weapons shields swords And I need to create a join like this: SELECT items.*, {swords}.* FROM items INNER JOIN categories ON categories.id = items.category_id # <-- here I know that the item is a sword INNER JOIN {swords} ON {swords}.item_id = item.id WHERE items.id = ...

Accessing form variables in a dynamic dijit.dialog (content of which is from href)

Hello, I have the following code to create a dijit.diagram which loads a form from an external link: function openDialog(userID) { composeDialog = new dijit.Dialog({ id: 'composeDialog', title: 'Compose a Message', style: 'width: 400px', href: 'myform.php?userID='+userID }); composeDialog.show(); } now inside m...

Howto show ping output dynamically in a web page?

As part of a diagnostics page I would like to have the user be able to run a "ping", ie an ordinary shell command to send ICMP_ECHO_REQUSTs to a certain IP and display the resuls dynamically in a div in the browser. The backend is Ruby/Rails. I'm past running the command on the server side and reading the output from the ping command. ...

How to escape forward slash in T-SQL 2005?

I've got this dynamic t-sql: declare @sql nvarchar(max) set @sql = N' insert into #t SELECT row_number() over(order by getdate()) as RowNum, d.value('''+@baseDateXpath+''', ''datetime'') as basedate, pref.query(''.'') as XmlExtract FROM @content.nodes(''/*/*'') AS extract(pref) CROSS APPLY @content.nodes(''//*'') AS ...

Dynamic column names

Is it possible to create a view (not stored procedure) with dynamic column names based on another table? For example: Code: CodeId|Description ------------------ 1|Title 2|Notes Data: DataId|Content|CodeId|GroupId ----------------------------- 1|Title1 | 1| 1 2|Note1 | 2| 1 3|Title2 | 1|...

Setting dynamic data on dynamic JQuery elements

I'm new to JQuery and don't have a huge background in Javascript, either - so that could be contributing to my problems... I'm trying to dynamically generate a list of items and bind click events to each of the dynamically generated elements. I can create the list and successfully bind the click events, but then I ran into a stumbling ...

Dynamic Object Creation

I have a function that takes a string object name and I need the function to create an new instance of a object that has the same name as the value of the string For example, function Foo(){} function create(name){ return new name(); } create('Foo'); //should be equivalent to new Foo(); While I know this would be possible via eva...

ASP.net MVC2 - Customize Metadata without using Custom Attributes

I'm pretty new to MVC, I'm trying to create a model that can be localized, but it doesn't seem like that would be possible given that I have to use a custom property attribute to define displayname and validation properties. Is there a way to dynamically create the model metadata attributes (DisplayName, UIHint, etc..) as opposed to h...

How to store information about many people in java

Hi, my problem is to store details of people in java. I looked up at the oracle website topic How to Use Tables and found out that one can use object arrays(2 dimensional) to store details. But my interest is to make a dynamic object array so I can store any amount of data and also take input to store those details from the user. For i...

scraping dynamic content

Hi, I am working on a web scraping project. do any body have idea of scraping dynamic content. Dynamic content on base of query string is similar to static content but dynamic content based on some event of a control within same page is the point where i am stuck. because in this case page url remain same. I am using C#. Thanks in ...

Use Dynamic or Reflection.emit

I'm new to C# and would like to ask for some direction on solving the following problem. I've got a xml file used as a template (without knowing its content in advance). something like: <Object> <Property name="ID"> <Value weight="40">10000</Value> <Value weight="60">20000</Value> </Property> <Property name="Name"> <V...

How to create Listbox dynamically wpf

Hi All, I want to create listbox dynamically [codebehind c#]. Its datasource is class object. class sample { string filepath; string id; string trackName; } Needs: Display trackName as listbox item in the listbox [dynamically]. Code: sample samp=GetBL.GetValue(); ListBox lbTrack = new ListBox(); StackPanel sp = new StackPa...