foreach($scraperSites as $site) {
//$scraperWriter->addSite( new ScraperSite($site) );
print_r($site);
}
scraperSites is the array of all sites from the mySQL database; I'm trying to keep $site as an array, (but only with one row worth of data), add it to an object, then move on to the next row.
...
Here's what I'm doing now:
mysock = urllib.urlopen('http://localhost/image.jpg')
fileToSave = mysock.read()
oFile = open(r"C:\image.jpg",'wb')
oFile.write(fileToSave)
oFile.close
f=file('image.jpg','rb')
ftp.storbinary('STOR '+os.path.basename('image.jpg'),f)
os.remove('image.jpg')
Writing files to disk and then imediately deleting th...
Essentially this is what I want to accomplish, however it doesn't work like this. Is there any solution: - The problem is I can't dynamically name a new object... ??? pulling my hair out.
import views.printingView;
public function initComponent(o:Array):void{
SomeObject::Array = o;
for(i=0; i <=SomeObject.length-1; i++){
'...
updated:
i use this:
$.getimagesarr = function(operation) {
return $.ajax({
type: 'POST',
url: 'operations.php',
data: {'operation':operation},
async: false
}).responseText
}
var jsonstring = $.getimagesarr('getimg');
var data = (new Function("return " + jsonstring))()
if (data){
....
}
old:
i want ...
Hi,
I'm trying to write a simple wrapper for mouse behaviour. This is my current code:
function MouseWrapper() {
this.mouseDown = 0;
this.OnMouseDownEvent = null;
this.OnMouseUpEvent = null;
document.body.onmousedown = this.OnMouseDown;
document.body.onmouseup = this.OnMouseUp;
}
MouseWrapper.prototype.Subscribe = funct...
I'm trying to create an PHP object that can load objects in other files on demand when needed. My problem is that when I reference the files based on file location for the class definition, it can not find the files. So file structure:
/Test.php
/os/os.php (extends kernel)
/os/kernel.php
/os/libraries/lib1.php
/os/libraries/lib2....
When I have a JavaScript array like this:
var member = {
"mother": {
"name" : "Mary",
"age" : "48"
},
"father": {
"name" : "Bill",
"age" : "50"
},
"brother": {
"name" : "Alex",
"age" : "28"
}
}
How to count objects in this array?!I mean how to get a counting resul...
As far as i can see in a situation like this:
var x = [];
var y = {};
y.someProp='asd';
This doesnt work:
x.push(y);
What I want to do is add a reference of y to x so that later if I will "delete y;" I want it also to be removed from the array x.
...
I've been programming a software version of a board game. Thus far I have written the classes which will correspond to physical objects on the game board. I'm well into writing the program logic, however I've found that many of the logic classes require access to the same objects.
At first I was passing the appropriate objects to method...
I have a list of fixtures.Each fixture has a home club and a away club attribute.I want to slice the list in association of its home club and away club.The sliced list should be of homeclub items and awayclub items.
Easier way to implement this is to first slice a list of fixtures.Then make a new list of the corresponding Home Clubs and...
I must be missing something simple here, but I'm having trouble retrieving data from a JSON array response. I can access objects with identifiers that start with letters, but not ones that start with numbers.
For example, I can access
data.item[0].specs.overview.details
But I can't access
data.item[0].specs.9a99.details
If anyone...
I have defined objects in js as following
var newevent = {title: txt, start: new Date(y, m, d, h, mi), end: new Date(y, m, d, h, mi+parseInt(eventtime[itemobj])), allDay: false, editable:eventedit[itemobj], className:eventbg[itemobj]};
My question is, what sense does the following code make?
var evt = [newevent];
...
Hi All,
Figure there is a simple solution to this problem but I have been unable to find it.
I have databinding in an ASP.Net application to a GridView. This gridview is bound to an ObjectDataSource as per standard usage.
The problem I have is that one of my bound fields uses the property DataFormatString="{0:C}" and due to the curren...
Hello,
I have got four classes A, B, C and D.
Class A has a member b of class
B.
Class B has a member c of class C.
A has a member D* dpointer;
This hierarchy has to be preserved (in fact this is a GUI with app, window, panel as A, B and C).
Now B and C must use a method from *dpointer.
Is there something more elegant than givin...
Possible Duplicate:
Why would you ever want to allocate memory on the heap rather than the stack?
Test2 *t2 = new Test2();
t2->test();
Test2 t3;
t3.test();
Why would I want to create a pointer object of type Test2? Why not just do non pointer version of Test2? Why would I want to do pointer objects?
Found answer here:
Wh...
I think i am lost with basics itself. What is the difference between these two. String object is an instance of String Class.
var guru:Object = new Object();
var guru:String = new String();
...
I'm processing 1 million records in my application, which I retrieve from a MySQL database. To do so I'm using Linq to get the records and use .Skip() and .Take() to process 250 records at a time. For each retrieved record I need to create 0 to 4 Items, which I then add to the database. So the average amount of total Items that has to be...
I have (for example) an object of type A that I want to be able to cast to type B (similar to how you can cast an int to a float)
Data types A and B are my own.
Is it possible to define the rules by which this casting occurs?
Example
int a = 1;
float b = (float)a;
int c = (int)b;
...
What's the difference between:
Object o = new Object();
o.foo();
and
new Object().foo();
(assuming I do not need the reference afterwards) ?
Are there any reasons for using one instead of the other one (e.g. memory usage) ?
...
I have a string of kml coming in on a request object. I have used xjc to create the kml java objects. I am looking for an easy way to create the kml nested java objects from this string. I could parse the string and create each object in the tree by hand but wouldn't it be cool if there was a library or something that would create the...