I am trying to find out if there is a more optimal way for creating a list of an object's sub object's properties. (Apologies for the crude wording, I am not really much of an OO expert)
I have an object "event" that has a collection of "artists", each artist having an "artist_name". On my HTML output, I want a plain list of artist name...
Hello all! I'm trying to take a URL's hash value, send it through a function, turn that value into an object, but ultimately send the value to JSON. I have the following setup:
function content(cur){
var mycur = $H(cur);
var pars = "p="+mycur.toJSON();
new Ajax.Updater('my_box', 'test.php', {
parameters: pars
});
}...
Hi,
I have a byte array of around 10,000 bytes which is basically a blob from delphi that contains char, string, double and arrays of various types. This need to be read in and updated via C#.
I've created a very basic reader that gets the byte array from the db and converts the bytes to the relevant object type when accessing the pro...
In PHP why can't I do:
class C
{
function foo() {}
}
new C()->foo();
but I must do:
$v = new C();
$v->foo();
In all languages I can do that...
...
hi
simple question -
How do I access an attribute of an object by name, if i compute the name at runtime?
Ie. i loop over keys and want to get each value of the attributes "field_".$key
In python there is getattribute(myobject, attrname)
It works, of course, with eval("$val=$myobject->".$myattr.";");
but IMO this is ugly!!
TIA
fl...
Hello
i've following JS function.
responseData:function(resp){
this.jsondata = eval('(' + resp + ')');
this.propList = [];
for (var i = 0;i<this.jsondata.length;i++) {
for (obj in this.jsondata[i]) {
alert(obj); //shows the property name of obj
this.propList.push({
obj : this....
Hello, I have serialized a C++ object and I wish to allocate space for it, although I can't use the "new" operator, because I do not know the object's class. I tried using malloc(sizeof(object)), although trying to typecast the pointer to the type the serialized object is of, the program shut down. Where is the information about the obje...
I've been trying to debug this the whole day but can't seem to find why it's not working on IE7+. It's working fine on other browsers except IE7+
Here's the JS code:
$(document).ready(function(){
$('#bigbox_carousel').rotator({
width: 490,
height: 210,
duration: 'slow',
rotate: 5000,
selected: 0
});
$('#bigbo...
I have link that calls a function when clicked:
<a href="javascript:spawnMenu(this);" id="link1">Test1</a>
To make my function work, I need access to the object so that I can perform jQuery operations like this:
alert($(objCaller).offset().left);
Since objCaller points to the object and not the object ID, this won't work. I need so...
What does 'this' keyword refer to when used in gloabl object?
Let's say for instance we have:
var SomeGlobalObject =
{
rendered: true,
show: function()
{
/*
I should use 'SomeGlobalObject.rendered' below, otherwise it
won't work when called from event scope.
But it works when called f...
How can i make a cached object re-cache it self with updated info when the cache has expired? I'm trying to prevent the next user who request the cache to have to deal with getting the data setting the cache then using it is there any background method/event i can tie the object to so that when it expires it just calls the method it self...
I have the following classes:
public class MyEventArgs : EventArgs
{
public object State;
public MyEventArgs (object state)
{
this.State = state;
}
}
public class MyClass
{
// ...
public List<string> ErrorMessages
{
get
{
return errorMessages;
}
...
$_SESSION['user']->getURL()
Is it to call the method of getURL() of object $_SESSION['user']?
...
hello,
current code
I've built function to do something over collection of jQuery elements:
var collection = $([]); //empty collection
I add them with:
collection = collection.add(e);
and remove with:
collection = collection.not(e);
It's pretty straightforward solution, works nicely.
problem
Now, I would like to have an obje...
Hello, say I have this control:
public partial class bloc999 : UserControl
{
bloc999Data mainBlock = new bloc999Data();
public bloc999()
{
InitializeComponent();
mainBlock.txtContents = "100";
base.DataContext = mainBlock;
}
}
in the xaml:
<TextBox Margin="74,116,106,0" Name="txtContents"
Text="{Binding Path=txtConte...
I'm trying to port some of my c++ code into c. I have the following construct
class reader{
private:
FILE *fp;
alot_of_data data;//updated by read_until() method
public:
reader(const char*filename)
read_until(some conditional dependent on the contents of the file, and the arg supplied)
}
Im then instantiating hundreds of these obj...
I wold like the unity framework to resolve a static class "MyStaticObject" specified in my config file. As my class is static, I am getting an error "The type StaticObject does not have an accessible constructor."
My config file looks as below:
<unity>
<typeAliases>
<typeAlias alias="singleton" type="Microsoft.Practices.Uni...
I'm having trouble with refreshing objects in my database. I have an two PC's and two applications.
On the first PC, there's an application which communicates with my database and adds some data to Measurements table.
On my other PC, there's an application which retrives the latest Measurement under a timer, so it should retrive measure...
Is there a way to make jQuery use objects in a conditional statement as an object in a hierarchy. For Example, I want to validate that something exist then tell it to do something just using the this selector.
Like this
if ($(".tnImg").length) {
//i have to declare what object I am targeting here to get this to work
$(th...
Is this the right way to return an object from a function?
Car getCar(string model, int year) {
Car c(model, year);
return c;
}
void displayCar(Car &car) {
cout << car.getModel() << ", " << car.getYear() << endl;
}
displayCar(getCar("Honda", 1999));
I'm getting an error, "taking address of temporary". Should I use this way:...