In our app, we have some scrolling credits in a ChildWindow. When showing this window, our CPU utilization is very high. The text is using a BitmapCache and hardware acceleration is enabled. Even after removing the clipping rectangle and the drop shadow from the child window, the CPU usage climbs to 80-90%. When I enable redraw regio...
Hi,
I started using GraphViz yesterday in order to visualize the relationships between some things—a project I’ve been wanting to tackle for quite a while now.
So far, I’ve gotten it pretty well done, but there’s a few things I’m struggling with, specifically getting the chart to look good and how long it takes to process the DOT file—...
I want to perform an SQL query that is logically equivalent to the following:
DELETE FROM pond_pairs
WHERE
((pond1 = 12) AND (pond2 = 233)) OR
((pond1 = 12) AND (pond2 = 234)) OR
((pond1 = 12) AND (pond2 = 8)) OR
((pond1 = 13) AND (pond2 = 6547)) OR
((pond1 = 13879) AND (pond2 = 6))
I will have hundreds of thousands pond1-po...
Thanks to some very helpful stackOverflow users at Bit twiddling: which bit is set?, I have constructed my function (posted at the end of the question).
Any suggestions -- even small suggestions -- would be appreciated. Hopefully it will make my code better, but at the least it should teach me something. :)
Overview
This function wil...
In binary search algorithm we have two comparisons:
if (key == a[mid]) then found;
else if (key < a[mid]) then binary_search(a[],left,mid-1);
else binary_search(a[],mid+1,right);
Is there a way by which I can have only one comparison instead of the above two.
--
Thanks
Alok.Kr.
...
I am trying to make development easy and have highly optimized output in production.
The goals of what I am trying to do is:
Make production pages fast! I would like that the Google Page Speed and YSlow return the best scores. This means:
Combine and compress JS files and CSS and position the group in the right place (bottom or top o...
Does calling more functions have any kind of noticeable effect of performance, or is trying to cut down on number of function calls a pointless premature optimization?
Simplified Example: Is there any real performance example between this:
function foo($var) {
echo $var;
}
foo();
And This:
function foo($var) {
bar($var);
}
f...
Possible Duplicate:
while (1) Vs. for (;;) Is there a speed difference?
Hi,
Which is better,faster and more optimized way to implement infinite loop - for(;;) or while(1)? and why?
...
I have inherited a very large ASP.NET app that needs to be modified to use a State Server instead of in-proc sessions. I need to track down all classes used in session throughout the app and then determine if they can be serialized. Are there any tools that can be used to analyze the code to determine the classes used in session?
...
So i have a site that I am working on that has been touched by many developers over time and as new features arised the developers at the time felt it necessary to just add another query to get the data that is needed. Which leaves me with a php page that is slow and runs maybe 70 queries. Some of the queries are in the actual PHP file f...
Let's say we have:
@Entity public class Order {
@Id private int id;
@OneToMany(mappedBy="order") private List<Item> items;
...
}
and
@Entity public class Item {
@Id private int id;
@ManyToOne private Order order;
...
}
And let's say there is 10.000 orders with each having 20 items.
We need to iterate thought all order...
I've tried to optimize my website using YSlow for directions. However, even though I have added the DEFLATE code at .htaccess to gzip the files, YSlow still doesn't show the files as gzipped. I tried testing my website using this: http://www.gidnetwork.com/tools/gzip-test.php and it shows that my webpages are not gzipped or compressed. H...
I love to make efficient apps and often look to concurrency and multithreading to improve application responsiveness and such, but lately my attempts always seem to be blocked by WPF's single-threadedness. No matter how efficient and parallel my code is, WPF seems to continually stall my UI and make my app look incredibly unresponsive--s...
I developed a site that uses tags (key words) in order to categorize photographs.
Right now, what I have in my mysql database is a table with the following structure:
image_id (int)
tag (varchar(32))
Every time someone tags an image (if the tag is valid and has enough votes) it's added to the database. I think that this isn't th...
Hi guys!
I'm trying to create a small module for doing decimal-based calculations. A number is stored as an integer mantisse, with a precision value specified by an int:
data APNum =
{ getMantisse :: Integer
, getPrecision :: Int }
For instance:
APNum 123 0 -> 123
APNum 123 1 -> 1.23
APNum 123 2 -> 12.3
...
(negative precision...
Turns out it is perfectly valid for a C++ compiler to emit different machine code when recompiling the same program with exactly the same compiler/environment/whatever settings. Which implies that the compiler optimizer can decide how "deep" to optimize depending on various factors, amount of available memory included.
Does anyone have ...
Hi,
I just encountered the following situation. I have an Android app with a scenario which I guess may happen in multiple apps. It's about tagging/labeling/categorizing, call it as you want. I basically have the following relations in the SQLite DB
-------- -------------- ---------
| Tags | ...
I'm using SQLite to maintain a database which contains, among other things, a table with paths. The CREATE statement for the table looks like this
CREATE TABLE path (id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
UNIQUE(name));
I'm looking for a short way to say 'insert this given path into the ...
Hi there
In mysql I have a table with like 20 rows (example). I want to write sort order (it is in array that carried picID's) to the SORT column from 1 to x (x is the number of items in this example x=20).
My array starts with: [10,15,1...]
I can do:
UPDATE table SET sort=1 WHERE picID=10
UPDATE table SET sort=2 WHERE picID=15
UPDAT...
Dear all,
I have a set of large values that need to be compared in mysql.
May I know which is faster?
For example:
Opt 1:
SELECT * FROM table WHERE v = 1 or v = 2 or v = 3 or v = 4 or... v = 100
Opt 2:
SELECT * FROM table WHERE v IN (1,2,3,4,5,6,7,8,...,100)
May I know which option is faster for large value? Is there any better s...