So I was on this mission to create a moderately flexible, but most importantly, re-usable handler PHP script for image uploading projects. As I cruised along I ran into a PHP memory limit question that I posted on stackoverflow (can be found here: http://stackoverflow.com/questions/3792058/php-memory-limit) and the awesome and helpful a...
Assuming I have 2 large tables with well over 10 Million Rows in each table.
Table 1 is a Movie table with a userID stating the user saw this movie, and Table 2 is a table of Music with a userID stating the user herd this song.
What I want to do is be able to run a query whenever the user wants to know if there is a Song with the same ...
I have a few inequalities regarding {x,y}, that satisfies the following equations:
x>=0
y>=0
f(x,y)=x^2+y^2>=100
g(x,y)=x^2+y^2<=200
Note that x and y must be integer.
Graphically it can be represented as follows, the blue region is the region that satisfies the above inequalities:
The question now is, is there any function in Mat...
I have several libraries that I am linking against and using them in a project. I can compile the libraries as well. If I have, in the final project, Code Generation > Floating Point Model = Fast, and Precise in the libraries that I am linking against, does that mean I am not benefiting from the maximum speedup that I will get if the lib...
I currently have a UITableViewController that parses a JSON response (using TouchJSON) fired asynchronously using an ASIHTTPRequest.
I'm very concerned with the performance of my application.. 6 out of 10 API calls on average would lead to request timeouts and the combined time to fire an API call and parse an API call for 20 objects (e...
Hello,
I have a solution to the below problem in PHP.
But it is taking too much time to execute for 10 digit numbers. I want to know where am I going wrong ?
I am new to dynamic programming .Can someone have a look at this ?
Problem
In Byteland they have a very strange monetary system.
Each Bytelandian gold coin has an integer numbe...
I am a complete beginner to Python or any serious programming language for that matter. I finally got a prototype code to work but I think it will be too slow.
My goal is to find and replace some Chinese characters across all files (they are csv) in a directory with integers as per a csv file I have. The files are nicely numbered by yea...
In GCC compiler, whenever -O3 is flagged, the compiler optimizes mainly by Loop Unrolling and Function Inlining.
However, when I compiled an application that has the following function, it didn't do Function Inlining. From gprofing and gconving I could notice that this function (comp_t_delay) was not called from the main function unit o...
Hi everyone.
If I am given a certain set of numbers (which I store in a balanced binary search tree for easiness), then I want to answer a query that requires me to inform what is the ith smallest number between [A,B], what would be a fast algorithm to perform that task?
Technically I could traverse the tree from the root searching for...
I have been trying to organise my views to optimize load times by having css in the head and scripts at the end of the body.
To this end I have created masterpages that have 3 content placeholders: styles, maincontent and scripts.
With the (achieved) aim that when I render a single view with a master this neatly can collate all the share...
I have a function which updates the centroid (mean) in a K-means algoritm.
I ran a profiler and noticed that this function uses a lot of computing time.
It looks like:
def updateCentroid(self, label):
X=[]; Y=[]
for point in self.clusters[label].points:
X.append(point.x)
Y.append(point.y)
self.clusters[label...
I'm trying to tackle a problem by using a SQLite database and Perl modules. In the end, there will be tens of millions of entries I need to log. The only unique identifier for each item is a text string for the URL. I'm thinking of doing this in two ways:
Way #1: Have a good table, bad table, unsorted table. (I need to check the html an...
I tried to search, but so far with no luck. Does anyone know a good resource how one should do cold start optimizations?
The app in question is C++/MFC app, compiled with VS2010, full version, with built in profiler available. I have tried to cut down all the extra weight to get the load times acceptable for warm start, but the cold sta...
What is the fastes way of determening which point q out of n points in 2D space is the closest (smallest euclidian distance) to point p, see attached imgage.
My current method of doing this in Python is storing all the distances in a list and then running
numpy.argmin(list_of_distances)
This is however a bit slow when calculating ...
I run this code every frame, works great in chrome
data[index + 0] = bgData[dis + 0];
data[index + 1] = bgData[dis + 1];
data[index + 2] = bgData[dis + 2];
data[index + 3] = 255;
but firefox gives the error:
An invalid or illegal string was specified" code: "12
unless I add -1 to each line as below:
data[index + 0] = bgData[di...
HI All
I was hoping someone could help me improve a query I have to run periodically. At the moment it takes more than 40 minutes to execute. It uses the full allocated memory during this time, but CPU usage mostly meanders at 2% - 5%, every now and then jumping to 40% for a few seconds.
I have this table (simplified example):
CRE...
I'm on a quest to reduce my very bloated home page application in development. I've optimized the CSS and JS requests using a server size combine/stitcher and minimizer.
I'm now at the point where I have an image carousel rotating 15 images as a magazine style layout. In addition there are non-carousel spots with a total of 8 objects. ...
I've two files of 1 GB each containing only numbers in sorted order. Now I know how to read the contents of the files and sort them using merge sort algorithm and output it into an another file but what I'm interested is to how to do this only using 100MB buffer size (I do not worry about the scratch space). For example one way is to rea...
Hello people!
I want to write code that best uses the cache memory of my system. For example, I have one large array(2kb size) that is frequently used in operations. For better execution speed, I want it to be loaded in chache memory so that It takes less time for processor to fetch it. How can I ensure this thing in C language? Any hel...
I have been trying to learn how to write faster more efficient jQuery and would like to get some insight on how I should write this function so it will work faster. Should i use variables, I am most concerned with speed on a page so what will run more optimal cross browser and why is the answer I would like to see.
$("#div-one, #d...