Techniques for writing a scalable website.
I am new in the website scalability realm. Can you suggest to me some the techniques for making a website scalable to a large number of users? ...
I am new in the website scalability realm. Can you suggest to me some the techniques for making a website scalable to a large number of users? ...
I have some simple PHP code that creates a SSL connection $streamContext = stream_context_create(); stream_context_set_option($streamContext, 'ssl', 'local_cert', $this->sslPem); stream_context_set_option($streamContext, 'ssl', 'passphrase', $this->passPhrase); $this->apnsConnection = stream_socket_client('ssl://'.$this->apnsHost.':'.$...
Hello all. I'm returning some XML from PHP to Javascript via ajax and getting some 'invalid xml' errors. The xml I'm returning looks like this: <response> <song>tdb2009-01-29s2s06</song> <song>tdb2009-01-29s1s02</song> </response> And my javascript to parse it looks like: function u_handleServerR...
I'm manipulating few data with PHP, I have the choice between Json and XML. But I don't know what to choose, I never worked with one of them. So I want the easiest one. Also I wonder if there's good classes that can make parsing (XML or Json) easier. I focus mainly on ease of use rather than speed and scale. ...
Say I have data like this: <option value="abc" >Test - 123</option> <option value="def" >Test - 456</option> <option value="ghi" >Test - 789</option> Using PHP, how would I sort through the HTML tags, returning all text from within the option values. For instance, given the code above, I'd like to return 'Test - 123', 'Test - 456', '...
In PHP I have the following code that gets a file submitted through CGI: move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile) The file is being sent as Content-Disposition: form-data; name="userfile"; filename="filename" Content-Type: application/octet-stream The file being upload is of type PNG. How do I access the da...
I've made two versions of a script that submits a (https) web page form and collects the results. One version uses Snoopy.class in php, and the other uses urllib and urllib2 in python. Now I would like to make a java version. Snoopy makes the php version exceedingly easy to write, and it runs fine on my own (OS X) machine. But it alloca...
I have text file that looks like this: 1 1 1 1 1 2 3 5 4 4 5 5 I want to read this text file into array of lines and display it. Can anyone help me do this? ...
Is there a way to prevent the PHP GD image library from running out of memory? If too large an image is uploaded, GD tends to run out of memory, terminating the script. I'd like it to throw a catchable exception or something to that extend, but alas it doesn't. Right now I'm using a cobbled-together script that first issues an ini_set('...
I have an application that has an n+1 query problem, but when I implemented a way to load the data eagerly, I found absolutely no performance gain. I do use an identity map, so objects are only created once. Here's a benchmark of ~3000 objects. first query + first object creation: 0.00636100769043 sec. memory usage: 190008 bytes itera...
I'm writing a PHP script that generates gzipped files. The approach I've been using is to build up a string in PHP and gzcompress() the string before writing it out to a file at the end of the script. Now I'm testing my script with larger files and running into memory allocation errors. It seems that the result string is becoming too la...
Hello, I am posting this question again because I didn't explain clear enough. Here are things that I need to achieve with the .htaccess file: Re-route /public_html/ to /public_html/myfolder/ Make website/index.php?q=param to website/param/ My php files are inside /public_html/myfolder/ and my image files are inside /public_html/myfol...
I am interested in setting up a local php testing / development environment using the lamp stack. I would like to use the php plugin for eclipse (I typically work with java and am very familiar with eclipse). First of all, is it proper practice to develop my site locally directly within the appache /var/www directory? If this is ok, c...
<local:CheckBoxDataGrid id="dg" allowMultipleSelection="true" x="118" y="151" width="557"> <local:columns> <mx:DataGridColumn dataField="firstName" headerText="Select" width="50" sortable="false" itemRenderer="CheckBoxRenderer" > </mx:DataGridColumn> <mx:DataGridColumn id="userID" headerText="User ID" /...
Hello, I am looking to create a site like photofunia.com where basically you can apply a large number of effects to an image. I am wondering if someone can guide me in the right direction as to the technology which must be used to achieve the same? Also, are there any open-source commandline utilities available to create such images? I...
Hello all im looking for embedded web server that can parse php do you have experience with such ? ...
This is more a question of curiosity. So I was reading a chapter from (Sitepoint's latest PHP/MySQL book), in which the author mentioned using the extension ".html.php" to indicate files that has both HTML and PHP. I tried it out, and discovered this: If I have a file "fileA.html.php", and somewhere in "fileB.html" I have a link thusly...
I have a php script that outputs a random image each time it's called. So when I open the script in a web browser, it shows one image and if I refresh, another image shows up. I'm trying to capture the correct image from visiting the web site through a command line (via mechanize). I used urllib2.urlopen(...) to grab the image, but each...
Actually in my website www.musicking.in when the user selects songs one player window will open and that will access the corresponding selected songs xml playlist and the player will play those songs. actually its working fine. but sometimes the problem is when so many users are accesiing the player not playing the songs selected, eithe...
I recently studied some code that I'm supposed to use for different reasons, it's unrelevant. The thing I've noticed is someone using the operator "===" which I can't make sense out of. I've tried it with a function and it corresponds in crazy ways. The language is PHP by the way. Does anyone know what the definition of this operator i...