I recently found a interesting behaviour of g++ when compared with MSVC++ 2008. Consider this tiny program:
#include <cstdlib>
const int ARR_LENGTH = 512;
void doSomething( int iLen );
int main( int argc, char** argv )
{
doSomething( ARR_LENGTH );
return 0;
}
void doSomething( int iLen )
{
int iTest[iLen];
return;
}
...
I need to fit some points from different datasets with straight lines. From every dataset I want to fit a line. So I got the parameters ai and bi that describe the i-line: ai + bi*x. The problem is that I want to impose that every ai are equal because I want the same intercepta. I found a tutorial here: http://www.scipy.org/Cookbook/Fitt...
I have a MyISAM table with ~50'000'000 records (tasks for web crawler):
CREATE TABLE `tasks2` (
`id` int(11) NOT NULL auto_increment,
`url` varchar(760) character set latin1 NOT NULL,
`state` varchar(10) collate utf8_bin default NULL,
`links_depth` int(11) NOT NULL,
`sites_depth` int(11) NOT NULL,
`error_text` te...
I'm using gzip to compress my html/php files along with js/css/etc. This reduces the payload quite nicely but I also want to 'minify' my markup of both .html and .php pages. Ideally I'd like to control this from a .htaccess file (where I also do the gzipping) rather than the having to include php to each file.
I'd like the output to be ...
Documentation for __assume says "The most common use of __assume is with the default case of a switch statement, as shown in the following example.".
Is there any other case where __assume can lead to a more efficient (or even a different) code?
When inside of if / else , is compiler automatically "assuming" what is already know becau...
For the current app I am writing I have elected to place all database functionality into a single class, as it allows me to keep the database code away from the business logic and easily replace the database code if we ever have need to switch to another DBMS. However, recently my database class has become rather large (EDIT for info: a...
I have this query:-
SELECT SUM(DISTINCT( ttagrels.id_tag IN ( 1816, 2642, 1906, 1398,
2436, 2940, 1973, 2791, 1389 ) )) AS
key_1_total_matches,
IF(( od.id_od > 0 ), COUNT(DISTINCT( od.id_od )), 0) AS
tutor_popularity,
td.*,
u.*
FROM tutor_deta...
I have a pretty large table (20 mln records) which has a 3 column index and an array column. The array column is updated daily (by appending new values). There is also inserts, but not as much as updates.
The data in the array represents daily measurements corresponding to the three keys, something like this: [[date_id_1, my_value_for_d...
I'm thinking of optimizing a program via taking a linear array and writing each element to a arbitrary location (random-like from the perspective of the CPU) in another array. I am only doing simple writes and not reading the elements back.
I understand that a scatted read for a classical CPU can be quite slow as each access will cause...
As from title, I have some data that is roughly binormally distributed and I would like to find its two underlying components.
I am fitting to the data distribution the sum of two normal with means m1 and m2 and standard deviations s1 and s2. The two gaussians are scaled by a weight factor such that w1+w2 = 1
I can succeed to do this u...
I have two tables: one has a datetime column, the other has a date column.
I want to join the two tables like this:
SELECT
t1.dt,
t2.d
FROM
table1 t1,
JOIN
table2 t2
ON
DATE(t1.dt) = t2.date
But obviously, this kills the index on t1.dt.
What's the best strategy to get around this? The simplest approach would be to add a ne...
given a list of purchase events (customer_id,item)
1-hammer
1-screwdriver
1-nails
2-hammer
2-nails
3-screws
3-screwdriver
4-nails
4-screws
i'm trying to build a data structure that tells how many times an item was bought with another item. Not bought at the same time, but bought since I started saving data. the result would look like
...
At the Velocity 2010 conference, Google said that header compression can yield big gains:
Hölzle noted a glaring inefficiency in the handling of web page headers, which provide information about a user’s IP address, browser and other session data. The average web page makes 44 calls to different resources, with many of those requests...
I've been doing a lot of reading on how to optimize website performance. Both Google and Yahoo advocate using cookie-less domains; I've also read about setting up subdomains to achieve the same effect.
My question is: is there a way to determine if cookies are being set at the *.example.com level versus the www.example.com level? I have...
Hi,
I'm writing a silverlight app which does some real-time charting. Basically, I just have some polylines overlaid on a canvas. The user can record data for arbitrary amounts of time, and so the width of the canvas is increasing as necessary. Since the canvas is wrapped inside a scrollviewer, it can get quite large. Haven't seen a...
Looking for a really simple form optimization service/software something like crazyegg.com for my forms or google optimizer. I want to test removing fields and compare conversions, see where I lose most people filling out a form etc
Thanks
...
Suppose you have a set of nodes connected into a tree structure with one root node and any node may have any number of child nodes.
You can only traverse the tree starting at the root node or from your current position along direct connections. I.e., no random access to a specific node, but the structure of the graph is already known an...
I had a pretty big equation that I needed to use to solve for a given variable. So I used an online tool that was capable of rewriting an equation in terms of a given variable. It gave me some huge 700 character equation. I tested it, and it does work.
I can see some pretty obvious redundancies in the equation where it's recomputing a v...
I'm trying to push my FPS up on iPhone 3Gs from 30 as high as possible... and I'm running into a couple of issues and thought it would be better to ask for advice.
1) What exactly do the Renderer Utilization and Tiler Utilization columns on the OpenGL ES Instrument signify? My Tiler Utiliation percentage is extremely low, and my Rendere...
Application Specific Information:
com.oneorangetree.iphoneexample failed to launch in time
elapsed total CPU time (seconds): 3.500 (user 1.680, system 1.820), 17% CPU
elapsed application CPU time (seconds): 0.920, 5% CPU
When the app loads, it does ALOT of stuff in viewDidLoad
It takes about 30 seconds to complete. How can I put thi...