dynamic

Creating an object with dynamic properties in C#

Hi, I'm using linq to load a csv file, but because the csv may have any number of columns, the object that it returns will need dynamic properties, and I can't figure out how to do that. var data = from row in csvData let col = row.Split(',') select new { Field1 = data[0], ...

Is it possible to have the web site supply the WCF config to a silverlight app?

I am developing a silverlight 4.0 application which communicates with a WCF service. The WCF configuration (endpoint, ...) is contained in the ServiceReferences.ClientConfig file. However, I would like the silverlight application to get this config from the web server as I don't want to recompile the application or fiddle with the XAP ...

Java Dynamically Loading a class

I am attempting to load classes dynamically into a component. I am using a file chooser to select the .JAR file that will be loaded and then a option pane to get the name of the class. I have trawled the internet looking for how to convert a java file to a URL in order to load it in URLClassLoader and I have come up with: File myFile =...

Ways to prevent cheating caused by dynamic ip addresses tampering with PHP-driven web contests

Hey all, Let's say you have a website contest programmed in PHP, and the user must click their favorite picture. Now from what I hear, there are ways to dynamically change your ip address, such as with the iphone, so it looks like you are someone else and therefore you can continuously click the same picture over and over in a matter o...

Dynamically Invoke Web Service At Runtime

I am using the sample code to dynamically invoke a web service from this site: http://www.crowsprogramming.com/archives/66 The issue that I am facing is when I use the Class to call a web service from a web application I get the following error: "The remote host cannot be found" and the error happens at the following line of code: if (!...

Create a python function at runtime to match a variable number of dictionary entries

I'm making a program to calculate latency from a tcpdump/pcap file and I want to be able to specify rules on the command line to correlate packets -- i.e. find the time taken between sending a packet matching rule A to receiving a packet matching rule B (concrete example would be a FIX NewOrderSingle being sent and a corresponding FIX Ex...

Importing WAR file in Eclipse. Name's cannot be empty.

I need to create an web app and was following this tutorial at IBM: http://www.ibm.com/developerworks/data/library/techarticle/dm-0509cline/ However, whenever I try to import the LowFareAir.war file in Eclipse I keep getting the message "Name's cannot be empty" and it doesn't let me continue. I'm a complete beginner to this, am I doing...

Coin flipping game: Optimization problem

There is a rectangular grid of coins, with heads being represented by the value 1 and tails being represented by the value 0. You represent this using a 2D integer array table (between 1 to 10 rows/columns, inclusive). In each move, you choose any single cell (R, C) in the grid (R-th row, C-th column) and flip the coins in all cells (r,...

Programmatically Set Asp Menu to Selected

I dynamically populate my Asp.Net Menu based on my Database: public class BasicHyperLink { public string Title { get; set; } public string Url { get; set; } } // For example, for the first menu // This is under mnu_DataBound: MenuItem parentItem = mnu.Items[0]; // Get first menu item foreach (BasicHyperLink link in getLinksLis...

Dynamic UI Generation in C#

I am designing an application for a library. Not a large scale library, but a very small scale library where my primary task is to just keep information about the books. But this library application should be able to adapt to any professional's private library. For an example, for a lawyer, apart from the basic information about the book...

Database "dynamic" types + Serialization

I have a set of classes, where each class represents a diferent type of a database field. For example, a very basic subset of it would be: public abstract class DbObject { internal DbObject() { } } public class DbInteger : DbObject { public int Data { get; set; } public DbInteger(int data) { this.Data = data; } } public class ...

C#: Monitoring non-dynamic method calls when working with child classes inheriting from DynamicObject

Let's say I have a class which inherits from DynamicObject: public class DynamicBase : DynamicObject { public override bool TryGetMember(GetMemberBinder binder, out object result) { //Yadda yadda yadda } //same for TrySetMember } and then I have a child class which inherits from DynamicBase: public class ChildCl...

Why do my dynamic CMS forms not load everytime?

I'm using CKEditor to created the portion of my CMS for the user to input content. My CMS is a bar/menu at the top with the sections of the site for the user to create, update, or delete an entry. When the user selects an option I send the request for the form items to php using jquery AJAX $.post. The function returns the code and I us...

Add dynamic instances of MovieClips to an array.

I'm trying to add an instance of a MovieClip inside an array. Inside the House Class is a property called HouseObjects. Inside that array, I created a Comp and a Light class. MovieClips are dynamically placed on the stage, via linkage. The MovieClips also act as "toggle buttons." If the button state is ON, value is 1. If the button state...

Loading content into a post via AJAX in Wordpress

So I have this website that I run as a hobby and I am using Wordpress as the content management system, and now, I'm trying around different stuff as part of my posts, just to expand my horizons a little. Now I learned some basic AJAX, like having XMLHttpRequest load an entire html page into a given div without reloading all the elemen...

Using dynamic class/properties at runtime to load configuration

I'm having a conundrum here, and I'm not even sure it's possible. I'm developing a pluginbased application, where all the plugins will have access (read/write) to a shared configuration on the host application. There are easier ways of achieving the problem I'm presenting, but since this is a non-work related project, I'm free to play a...

HTML5 video player: dynamically loading videos

So, using a HTML 5 compliant video player, (like Video JS) how would one go about loading a video dynamically, without having to reload the entire page? Imagine, a list of links (something like a playlist), and each link points to a video. When clicking the link, I want to load the selected video into player. Currently, I'm using an Ifr...

Java create dynamic class

I have 2 questions that I was hoping someone could help me with. Is there a way to create a class on the fly with android/java and also add variables to the class? For example I would like to do something like this: Class c = new Class(); c.name = 'testing'; c.count = 0; c.getName = new function(){ return c.name; } Just wondering i...

Dynamically generate XAML objects

I have a Silverlight app that displays a number of "pages". Each page is a different XAML file with different code behind. The pages are numbered sequentially as follows: page_1, page_2, page_3, ..., Page_n. The pages are not static and will be dynamically generated. Since I don't know the total number of pages, I have to load each p...

Adding late-bound information to an object in C#, using dynamic keyword?

I have an object, and before I serialize it to Json, I'd like to add a property to it. So my object will look like this: public class MySpecialObject { public int Id { get; set; } public string OneProperty { get; set; } public string ASecondProperty { get; set; } } However, much later in the program I ofte...