object

Custom SiteMapProvider derived from XMLSiteMapProvider : How to load an xml document directly in BuildSiteMap()

We have a requirement to load a different XML sitemap for each user that logs in. This sitemap can come from a variety of sources (webservice, database, file) and has to be loaded at runtime. I have designed it thus: When a user logs in, the custom XML for that user is fetched and put into Session. In the BuildSiteMap() method of my cus...

Article/book: from source code to executable program?

I'm looking for a "human readable" article which describes, with examples, if possible, the transition from source code, say C, to an executable program. Ideally, the article shall contain descriptions about the object file format, how different sections of the code maps to to that of object files et.al. That hypothetical article would a...

create a javascript document Object

Is there any way to create or recreate a javascript document Object by calling a function. Something like <script type="javascript/text"> var document = createDocument("some html"); </script> I want to do this so I can solve the issue in this question client side xslt with javascript in firefox ...

PHP Object Extension Question

So I have an item class as follows: class Item { private $db; private $data = array( 'AltItem1' => null, 'AltItem2' => null, 'BaseUOM' => null, 'Category1' => null, 'Category2' => null, 'Category3' => null, 'Category4' => null, 'Iden' => null, 'IsHCS' => null, 'ItemDesc' => nul...

Storing objects in an array with php

Hi, I have a function that pulls rows from a database, the content->id and content->type are them used to dynamically call amethod in an already loaded model to get and format the objects details. Once the object is returned it is added to array. All is well except that when i come to use the array although it has the correct number of ...

Object comparison in JavaScript

What is the best way to compare Objects in JavaScript? Example: var user1 = {name : "nerd", org: "dev"}; var user2 = {name : "nerd", org: "dev"}; var eq = user1 == user2; alert(eq); // gives false I know that "Two objects are equal if they refer to the exact same Object", but is there a way to check it another way?? Using this way w...

Extracting relevant info. from Date / timestamp in adobe flex with row object

I have this code : var dp:Array = new Array(); for ( var i:int = 0; i < e.result.length; i++ ) { var row:Object = e.result[i]; dp.push( row ); } The row object consists data for different columns of a datagrid. dp.push(row) pushes the data onto the datagrid. Columns with index 3 and 4 have type of "DATE" with whole...

Python Language Question: attributes of object() vs Function

In python, it is illegal to create new attribute for an object instance like this >>> a = object() >>> a.hhh = 1 throws Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'object' object has no attribute 'hhh' However, for a function object, it is OK. >>> def f(): ... return 1 ... >>> f.hhh...

video streaming loading time

I have made a kind of Video Slider, where thumbnail of videos are displaying in horizontal view , and when clicking on that video image, that video stats need to play. I am making an AJAX call to retrieve the URL and data related to selected video, and putting the URL inside the <object> </object> code. It's actually working, but th...

C# Encrypt an object?

Requirement: I want to encrypt an object and store the encrypted object in the database.Later I will take the encrypted data and convert it into a real object. Does it sound stupid? Can it be done ? UPDATE: OK if this can be done how do I say encrypt an object? Can it be done without serialization? In memory or something? Any walkthrou...

Java ScriptEngine: using value on Java side ?

In a Java program I'm invoking a user-defined JavaScript program: File userJSFile=...; javax.script.ScriptEngineManager mgr=new ScriptEngineManager(); javax.script.ScriptEngine scripEngine= mgr.getEngineByExtension("js"); Object result=scripEngine.eval(new java.io.FileReader(userJSFile)); Now I would like to use 'result': how can I h...

When are objects/instances created in JavaScript?

Hello all, I have a JS script, in this JS script I have 1 functions which creates an Object or an instance. Is the object/instance created when the page loads or is it created when I call the function? If the latter, how can I make it so that it creates the instance when I want it to? Apologies for a nooby question. Thanks all Upda...

String to object in JS

I have a string as string = "firstName:name1, lastName:last1"; now I need one object obj such that obj = {firstName:name1, lastName:last1} How can I do this in JS? ...

Initializing a GUID variable

I am using VC++ 6.0 on Windows XP SP2 platform. I am using GUID structure in my code. typedef struct _GUID { // size is 16 DWORD Data1; WORD Data2; WORD Data3; BYTE Data4[8]; } GUID; How to initialize this structure to zeros while creating an object? Or when I create an object, what is the default value f...

How to convert delegate to object in C#?

Hello, I am using reflection class to invoke some methods which are on the some other dll. And one of the methods' parameters are type of delegate. And I want to invoke this methods by using reflection. So I need to pass function parameters as object array, but I could not find anything about how to convert delegate to object. Thanks ...

How to "clone" an object into a subclass object?

Hi, I have a class 'A' and a class 'B' that inherits class 'A' and extends it with some more fields. Having an object 'a' of type 'A', how can I create an object 'b' of type 'B' that contains all data that object 'a' contained? I have tried a.MemberwiseClone() but that only gives me another type 'A' object. And I cannot cast 'A' into '...

Is there a C equivalent to Perls' Dumper() method in Data::Dumper?

Essentially, what I'm looking for is a function that would allow me to do something like this: Dumper(some_obj); /* outputs some_objs' data structure */ Thanks. ...

C# object initialization options

Doesn't object initialization outside of a constructor break encapsulation ? Given: class MyClass { public string _aString; } Shouldn't the _aString member be private and instantiated via a call to the constructor (constructor omitted here): MyClass test = new MyClass("test"); Instead of the alternate method of object in...

applying methods to object and private variables in javascript

hello, I am trying to apply a method to an existing object which involves using its private variables. The object is setup like so: function a(given_id) { var id= given_id; } now I want to apply some new method to it like so my_obj = new a('some_id'); my_obj.myMethod = function(){ alert(id); } now if I go my_obj.myMethod() ...

hash vs specific parameters

I am in the process of writing a small javascript library to make form creation/validation easier. This is mostly an excuse to get better with javascript. I am debating about how to take in user input for form element creation. I am looking at two approaches. One is to take in a few pre-determined parameters such as id, label, value Th...