objects

Adding Variables to AR Object

How can I add a variable to a set of objects returned by ActiveRecord? I've looked around and none of the methods I've seen seem to work. Thanks in advance! ...

Object return needs to wait until JSON request is finished

I'm trying to write a somewhat generic method for retrieving data either from the browser cache if it's available, or a JSON request if it's not. Right now, all I want to do is be able to give my data.get method an id, and return the correct results. This works perfectly fine - console logs the new object being retrieved via JSON the fir...

3rd Party Server -> 3rd Party API (unmanaged c++) -> Managed Wrapper -> Database : Can Linq help me simplify my code?

I maintain a fairly complex infrastructure consisting of a number of setups like the following: 3rd party application server with its built-in database 3rd party unmanaged c++ API library which exposes methods to query and/or receive updates from the server; also contains data structure definitions My managed wrapper for the library; e...

Parsing an Object into a String

Hi there I am looking to parse an Object I have into a String so that I can enter it's value into a textfield. Here is a little snippet. TFname is the name of the textfield Object value = list.getSelectedValues(); TFname.setText(parseObject(value)); //-- Here I pick up an error Where I pick up the error, I know it's because this isn'...

Why is this JText panl giving me amemory address?

This is an undo feature button on a calculator that I am writing. undo is the button Status is a class that holds my status. listOfStates is an ArrayList of Status. displayBox is a object of JTextFeild. What I do not under stand is that when I display previousState in the text box I get something like: Status@11dc088. I know I am missin...

Overriding a prototype.js method

I'm attempting to override the Form.Element.disable() method in PrototypeJS so that it adds a custom class to disabled form elements. I've added: Form.Element.disable = function(element) { element = $(element); element.blur(); element.disabled = true; element.addClassName("disabled"); return element;} to the page after loading protot...

How to tell difference between python class and object?

Possible Duplicate: How to identiy whether a variable is a class or an object I have a function which accepts 'things' which it calls. def run_it(thingy): result = thingy(something) However, I'd like run_it() to accept both classes and objects/functions, and if it is a class, instantiate it first: def run_it(thingy): ...

Synchronizing on two or more objects (Java)

I have code similar to following: public class Cache{ private final Object lock = new Object(); private HashMap<Integer, TreeMap<Long, Integer>> cache = new HashMap<Integer, TreeMap<Long, Integer>>(); private AtomicLong FREESPACE = new AtomicLong(102400); private void putInCache(TreeMap<Long, Integer> tempMap, int fileNr){ i...

How to share variables among libraries in Delphi 2009?

Hi dudes, I'm trying to divide my monolithic, Delphi-Win32 app in libraries, so I get some questions around how to share global variables and object among my libraries using Delphi 2009. For example, I have 3 global objects (derived from TObject): for user info, for current session info, and for storing the active database connection and...

How to sort an array of objects in Visual C#?

I have an object that has two members that are both integer values. I made an array of these objects. Each objects values are filled with random integers. I want to sort the array of objects according to the first member value. How would I do this? ...

Generating names iteratively in R for storing plots

I'm using R to loop through a data frame, perform a calculation and to make a plot. for(i in 2 : 15){ # get data dataframe[,i] # do analysis # make plot a <- plot() } Is there a way that I can make the plot object name 'a', using the value of 'i'? For example, a + "i" <- plot(). Then I want to add that to a vector so I have a seri...

Linux & C++: Easy way to exchange objects between two processes

Hello, I would like to know what is the easiest way (amongst various alternatives) to exchange objects (or some data) between two linux-based systems. It appears socket-programming could be a choice, but I have not done it earlier so I am not sure if it is the best way. Could anyone point me to a reference please? TIA, Sviiya ...

Getting Objective-C Objects in PHP

Hi all, I am sending an NSData Object to the server script running PHP.Is it possible to collect that object in PHP ? Is it possible to get NSArray,NSString, NSData or any Custom Objects (Subclass of NSObject) in PHP ? Thanks ...

Objective-C + release Objects

I am using the following function in my application: +(TeamTournamentLookUp *)getOpponentTeamTournamentLookUp:(int)tournamentId:(int)opponentTeamId { TeamTournamentLookUp *objOpponentTTL = nil; const char *sql = "SELECT TeamTournamentLookUpID, TournamentID, TeamID, NumberOfWins, NumberOfLosses, NumberOfDraws, Points, Rank, IsUs...

how to combine two different tables data into a single json object

iam making a json object by the following query $arr = array(); $qs=qq("select main_cat_id,main_cat_name,id,name,cat_id,cat_id_main from main,scheme where main_cat_name='xyz' and cat_id_main=main_cat_id"); while($obj = mysql_fetch_object($qs)) { $arr[] = $obj; } $total=sizeof($arr)...

Transaction on objects in C#

I was wondering if there is a way to have a transaction on object. I'm asking this question for the following situation: We pass our object to our dataaccesslayer. There we use transactionscope to make sure the database doesn't get corrupted. In that process an object can be changed (datechanged, owner, ect ...). But if the transaction...

Java Outputstream behavior when multiple outputstream objects are wrapped

Hi, I have a code that does compression, encryption and checksum on a File Outputstream. Following is the code- private void start() { OutputStream os = null; try { os = new FileOutputStream("/some/file"); os = wrapAllRequiredTransforms(os); //Write to os } finally { os.close(); } } private wrap...

Form to object and loop through objects in c#?

I have a main form (frmMain), with some buttons (button1, button2...). then I do this: object objectsContainer = frmMain; // <--now the object contains form base, button1, button2... how could I loop through all containing items in my object to access butto1, button2...??? I did this, but it's not what I want. foreach (PropertyInf...

How to get instance ID with PHP

I'm looking for a way to get the instance ID of a given object / resource with PHP, the same way var_dump() does: var_dump(curl_init()); // resource #1 of type curl var_dump(curl_init()); // resource #2 of type curl How can I get the instance count without calling var_dump()? Is it possible? ...

foreach through a session variable

I would like iterate on each Object in my session variable. 'items' is of type item which is a class I've created to store book information. I have done a count($_SESSION['items']) which returns a 1 so i thought it should iterate at least once. But no luck. Thanks foreach ($_SESSION['items'] as $item) { echo TEST; $sql = 'SEL...