object

Do all objects have a default value?

Do all objects have a default value? Example; Guid guid = default(Guid); Gives; 00000000-0000-0000-0000-000000000000 DateTime dt = default(DateTime); Gives; 01/01/0001 00:00:00 Is this true for all objects, do all objects give some value as a default? I'm right in assuming yes...? ...

What's the difference between JavaScript Array and Object except .length property?

As I think, JS array is just a hash-map which accepts only integral value as a key. And the .length property just return largest index + 1. Is this right? Is there any other differences? ...

Red5 - Keeping transient shared objects alive on server

I create a transient (non-persistent) remote shared object using ApplicationAdapter.createSharedObject(). Then a client connects to the application. The client then connects to the shared object. But when the client leaves the application and connects again, the shared object is no more there. The properties set by the client in their pr...

cin object in cpp

Hi everyone, I started to learn cpp and encountered cin as a way to receive input from the keyboard. If I understood, cin is an object and >> is an operator defined for it. In the way it is defined, how does it "knows" to separate words from each other? and another thing, what is the meaning of: while(cin) is cin a bool type? what does ...

Sending objects of information between classes to add to List<T>. Please help!

Hello! I am working with two classes. MainForm and EmployeeRegistry. In EmployeeRegistry I got a method that adds to a List (addToList). public void AddToList(...) { employeeList.Add(...); } In MainForm I created an object of EmployeeRegistry and I want to send another object (with information) into the EmployeeRegistry.AddToList ...

is there a difference between class(): and class(object): in python 2.6-3.x?

Before py2.6 it's been answered here. http://stackoverflow.com/questions/332255/difference-between-class-foo-and-class-fooobject-in-python But for python2.6+ and python3.x, is the first one wrong? class Foo(): pass vs class Foo(object): pass ...

Casting Object as Hash in Prototype

I'm at a loss here. I have this class I've created that takes arguments in object form: new Widget('id_of_element', { option1: 'foo', option2: 'bar' }); However, the second argument isn't being seen as a hash, but as an object, so I can't apply default settings to if one is not set: initialize: function (element, options) { this....

Convert { Key : Value } Object Into Standard Variables with jQuery

I give you what I want in PHP : foreach($myarray as $key=>$value) { ${$key} = $value; } Now, can we do it with JS/jQuery ? This is the jQuery input, I want the classTD value as key, in other words the equivalent of the famous PHP statement ${$key} in the example above: data = {}; $('#resul_rech_doc_fact tr.document-2 td').each(func...

What is a good practice with a Repository and Business objects?

I have several business classes, like Address, Product, Order, OrderLine. In this case, I have a question concerning my Order class and how it should be updated in the repository. The Order class can have more than 1 OrderLine. The class looks something like the following: class Order { private List<OrderLine> orderLines; public A...

Difference between creating new object and dependency injection

What is the difference between creating a new object and dependency injection? Please explain in detail. ...

PHP: Get method's arguments?

In php I can check all available methods for an object like so: $methods = get_class_methods($object); But how can I see wich arguments have to be sent to these methods? Is there a function for this? ...

Foreach loop which results in object instantiation....

Hi, I have a requirement to accept an array of checked items from a table and update a field based on which items have been selected. Initially my thoughts where to simply loop over each of these items in the array and access a function in the specific class to update the status. I'm slightly concerned about this approach as it would m...

php - adding elements to other elements

Hey, I have been using .net for the past couple of years, and I like the way you can add controls at any point in the page from anywhere. For example, you can say Head.Controls.add(new LiteralControl("")) even if there is already a body. Is it possible to do this kind of thing in php? My site is set up so that we have agents, customers...

Long tag support in Tags

Tags field not displaying as expected when using long tags.. did anyone try that out ...

Referencing other properties in {} object creation

How do I do the following: var object = { alpha: 'one', beta: **alpha's value** } without splitting the object creation into two parts? ...

Casting entire array of objects to string

I have an array of type object which are strings. I would like to convert them to strings what would be the quickest way of doing so. Eg. I have this "object[]" and want to convert it so it is this "string[]" UPDATE - i think the problem is that some of the objects on the object[] are actually other objects like integers. I would ...

How do I remove an object from an array with JavaScript?

I have an JavaScript object like this: id="1"; name = "serdar"; and I have an Array which contains many objects of above. How can I remove an object from that array such as like that: obj[1].remove(); ...

How to pass Object context to jQuery.ajax JSONP callback?

I run into problems to pass a javascript object context into the callback handler of a JSONP ajax request, when the ajax provider predefines its callback. (Flickr is the service provider). I'll give a simplified example: function Person(anId) { this.name; this.id = anId; var self = this; this.loadName = function() { $.ajax({ ...

How can I check if an object is of a certain type at runtime in C#?

How can I check the type of an object at runtime in C#? Thanks in advance. ...

PHP: Trim every element in an object and if empty, set to N/A

I have an object: stdClass Object ( [Color] => Red [Shape] => Round [Taste] => Sweet ) I want to trim each of the elements in the object and if that element is empty, set it to 'N/A' So this object: stdClass Object ( [Color] => Red [Shape] => [Taste] => Sweet ) Would become this: stdClass Object ( [Co...