object

SimpleXML get next/prev node

I'm building a photo gallery, building an object based on an xml file. How can I grab the next and previous nodes? Here's what my base code looks like: $xmlData = new SimpleXMLElement(file_get_contents("data.xml")); foreach($xmlData->row as $item) { if ($item->url == $_GET['id']) { // show photo $title = $item->titl...

How to share data globally among multiple view controllers

Hi all.... can anybody help me out please... i have a huge object in a model. i made it as a single ton class and returning the object wn other calls.but the object is very big thats y the app is crasing. with out returning how to share the data globally and when to alloc the object and where to dealloc the object. i dont need all the...

WebOperationContext Object reference not set to an instance of an object

When I try to use WebOperationContext.Current in a WCF project, the Current is null. Below is the example. Could anyone please shed a light on it? WebForm - default.aspx: ServiceClient sc = new ServiceClient(); Response.Write(sc.DoWork(1) + "<br />"); WebOperationContext c = WebOperationContext.Current; --Current is null...

c# creating a database query METHOD

I'm not sure if im delluded but what I would like to do is create a method that will return the results of a query, so that i can reuse the connection code. As i understand it, a query returns an object but how do i pass that object back? I want to send the query into the method as a string argument, and have it return the results so tha...

How to turn jQuery/Javascript functions into methods

Could anyone explain how to turn functions into methods and the variables into parameters of an object in jQuery/Javascript? And even more interesting Why i should do that? ...

MongoDB and Java Objects

Hi, I have the following MongoDB object stored in my Mongo database: array ( '_id' => new MongoId("4cc183de48aa4c7708000000"), 'vehicleMake' => 'Volkswagen', 'vehicleModel' => 'Carrier', 'vehicleNumPassengers' => '7', 'vehicleReg' => '07-D-748393', 'coords' => array ( 0 => array ( 'lat' => '53.2594946', ...

How are static data and method details stored in C++

Hi, I have a very basic doubt, In C++ does there exist a data structure for each Type which stores static data and methods defined by that type, similar to the data structure that exists in .NET for every Type. Regards, Jeez ...

Communicate with Flash object from WebBrowser with C# .Net

Hello, I am trying to make myself a simple metacafe uploader, and I am using the webbrowser to do that. Everything was working great with loggin in, navigating to upload page etc... I used the HtmlElement and setAttribute/Invoke to click and set the text fields: HtmlElement password = wb.Document.All["sPass"]; assword.SetAttribute("valu...

Is pointer better than instance when declaring members in class?

Option 1: class B{//}; class A { public: void Funcs(); private: std::vector<A> vecA; }; Option2: class B{//}; class A { public: void Funcs(); private: std::vector<A*> vecpA; }; Which one is better, is there any guidelines? ...

LINQ Join on top 1

I've got three objects (splistitemcollection) that im joining together which is working great but the problem im having is that there are a one to many relationship between the a contract object and a customers object. I need to grab just just the first customers object for each contract object during the join. Here is what I am getting...

python class inherits object

Is there any reason for a class declaration to inherit object? I just found some code that does this and I can't find a good reason why. class MyClass(object): # class code follows... The code is using swig for binding some C code to Python, if that's relevant. ...

PHP: DATETIME in array as object. How to echo

Hope that title isn't too cryptic. I have an array with a DATETIME object in it and I'm just trying to figure out how to echo this to a page. ["created"]=> object(DateTime)#3 (3) { ["date"]=> string(19) "2010-10-22 00:00:00" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/London" Can someone help me out? tried date() bu...

Java Object Class

consider the statement : Every class has a super class [ True/ False ] I feel it should be false as Object is the base for all which do not have super class. What should be the proper reply. ...

Entity Objects Validation and Business Rules Validation

Hi, I am developing application having business objects created from EF 4.0. The application is layered with Data Layer having repository of classes. Above that is a business layer where business processes are mapped as per the requirements. Business layer is calling data layer. Business objects have complex associations. One scenario:...

Problem creating a Directory object in Oracle

The code is this: Originally:(http://www.oracle-base.com/articles/misc/FTPFromPLSQL.php) The approach uses a combination of the UTL_TCP and UTL_FILE packages to create a simple FTP API (ftp.pks, ftp.pkb). Once the API is loaded into the appropriate schema simple FTP commands can be initiated as follows: CREATE OR REPLACE DIRECTORY my_...

New object with HQL

Trying to create an object from an HQL query, but just can't figure out what i'm doing wrong. Query: String query = "SELECT product.code, SUM(product.price), COUNT(product.code) from Product AS product GROUP BY product.code" (or should I use new MyCustomList(product.code, SUM(... , even though it's not mapped?) Now I want to cast thi...

Convert from Object to Original Class

I'm storing a instance of Entry class in an Object. Entry newentry = new Entry(j, 0.0); Object test = newentry; How can I convert the test Object back into an Entry class to access the Entry class method getValue()? ...

Custom Linked List - Cannot cast object class to object

For this project I'm not allowed to use generic classes keep in mind. I have tried copying all my classes into another friends computer and he gets the same error. I cannot make calls like.. int counter = ((Movie) movieList.get(movListIndex)).getShowList().size(); Where getShowList() is a method in my Movie class that returns a Linke...

How to Create an XML object in Visual Studio C#

I want to pass an XML object from code behind file of an aspx to an class library.for that how can i create a XML Object. please its urgent. ...

Accessing a class object in PHP

Does anyone has idea how to access HREF from the below object: SimpleXMLElement Object (    [@attributes] => Array        (            [title] => Preview            [rel] => enclosure            [type] => image/jpeg            [href] => http://a1.phobos.apple.com/us/r1000/008/Purple/94/ee/38/mzl.fupornmt.320x480-75.jpg        ) ...