object

Swapping Objects in an Array - C#

In C#, I have an Array of MenuItem. I'm trying to swap the two Objects in index 2 and index 3 of the array without success using the code below: MenuItem Temp = Items[2]; Items[2] = Items[3]; Items[3] = Temp; There must be a reason why the second and third lines aren't working in C# which I may not understand yet. Is anyone able...

Prototype cannot read its own Objects?

I need to parse a URL and be sure there are no duplicate keys in the query string. I've converted the query string to an object using String#toQueryParams() var queryString = this.parseUri(uri).query.toQueryParams(); On an alert, this comes up as [Object object], but... queryString.each(function(e) {... }); I get the error that que...

problem accessing to a variable in object

Edit: this is part of main function to call the grab function: $video['type'] = $videoProvider; $video['id'] = $videoIds; $video['title'] = $this->grab_title_from_curl($data); I have this little function to parse title from html via curl, it works. private function grab_title_from_curl ($pull){ ...

android how to save an object to file ?

Does someone know how to save and restore an object to a file on android ? ...

getting Fatal error: Using $this when not in object context in Stemmer.php on line 317

I am getting a Fatal error: Using $this when not in object context in Stemmer.php on line 317. At the moment I am using the Stemmer class which I found on the internet to change words to their stemmed version before searching the database for matches. I have read all the related posts where people are having a similar problem. The dif...

how to launch my COM out of proc server from a managed com interop dll

I have written a c# com out of proc automation server which references my managed COM Interop dll which holds the application object model, it all works fine. When importing my dll from say unmanaged C++ it works fine it launches the out of proc server and everything works by using COM to access it, but when i do the same from managed...

Can a DateTime be null?

Possible Duplicate: DateTime null value is it possible to set datetime object to null? ...

JavaScript: get object instances to contain extended variables

So, say I had the following script: var hey = { foo: 1, bar: 2, baz: 3, init: function(newFoo){ this.foo = newFoo; return this; } } hey.check = function(){ alert('yeah, new function'); } Basically, I can call new hey.init(999) and get a new hey variable with hey.foo set to 999. But when I do tha...

In VBScript, how to convert a string value into an object like ADODB.Recordset as objects variable name?

As i mentioned in the title, i have a function that retrieves some string parameters. In the function i need a convertion a string to an object like ADODB.Recordset. I am using VBScript in ASP. Thank you My code looks like: Function calc(someString,anotherString) Set someString = Server.CreateObject("ADODB.recordset") 'Opening db ...

How to cast an object to a HashMap?

HashMap myMap = (HashMap) getLastNonConfigurationInstance(); myMap is always null. getLastNonConfigurationInstance() returns an object. My map has two keys "symbol" and "name". public Object onRetainNonConfigurationInstance() { HashMap myMap = new HashMap(); myMap.put("symbol", this.symbol); final Object da...

Javascript: Get a reference from JSON object with traverse.

I need to get a reference from JSON object, the code just following: var Tree = { data: { 0: { pk: 1, }, 1: { pk: 2, }, 2: { pk: 3, children: { 0: { pk: 11, }, 1: { ...

Extend google.maps.Map.Class

Hi, I would like to extend google.maps.Map (v3). I have read that the Map-Class implements the MVCObject(). So what i have already done is the following code: function MyMap(id) { google.maps.Map.call(this, document.getElementById(id)); } MyMap.prototype = new google.maps.MVCObject(); Is this the correct way? thx ...

problem in adding second UIbutton in cameraOverlayView

problem in adding second UIbutton in cameraOverlayView ,here i am able to add the first button but not able to add second button with following code - (void)pickAndDecodeFromSource:(UIImagePickerControllerSourceType) sourceType { [self reset]; // Create the Image Picker if ([UIImagePickerController isSourceTypeAvailable:source...

What does the new keyword do under the hood?

I am curious as what else the new keyword does in the background apart from changing what the this scope refers too. For example if we compare using the new keyword to make a function set properties and methods on an object to just making a function return a new object is there anything extra that the new object does? And which is pref...

object factory that generates an object or list of objects

I have the following code: def f(cls, value): # cls is a class # value is a string value if cls == str: pass # value is already the right type elif cls == int: value = int(value) elif cls == C1: value = C1(value) elif cls == C2: value = C2(value) elif cls == C3 # in this case, we convert the string into...

How to upcast an Object to a java.util.Map ?

I have an object in my code of the type Object: Object o The class of the instance is Object: o.getClass() gives Object. Now, it should be a Map! How can I upcast this to a Map? I tried: Map<String, Object> map = (HashMap<String,Object>)o But this returns: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to java.u...

weighted RDF predicate (owl:ObjectProperty)

in RDF a statement is represented with S,P and O; In OWL the owl:ObjectProperty represents the predicate logic. (S) (P) (O) I like dog <owl:Class rdf:about="Person" /> <owl:NamedIndividual rdf:about="I"> <rdf:type rdf:resource="Person"/> <like rdf:resource="Dog"/> </owl:NamedIndividual> <owl:Class rdf:about="Pet" /> <ow...

C# accessing method redirection

Guys i'm really embaraced to ask for this, but i got stuck and i can't think for solution: I found an IniParser library that i use for parsing settings from file. However the default approach is this: FileIniDataParser parser = new FileIniDataParser(); //Parse the ini file IniData parsedData = parser.LoadFile("TestIniFile.ini"); pa...

How to cast an Object to an int in java?

How can I cast an Object to an int in java? ...

Best way to create javascript classes with object literals and defaults

What is the best way to go about creating javascript classes so that objects can be created by passing in object literals, and at the same time maintaining defaults set in the class. var brett = new Person({ name: 'Brett' ,age: 21 //gender: 'male' //The default is female, so brett.gender will be female }); ...