Hey all,
I built a custom forum for my site using MySQL. The listing page is essentially a table with the following columns: Topic, Last Updated, and # Replies.
The DB table has the following columns:
id
name
body
date
topic_id
email
A topic has the topic_id of "0", and replies have the topic_id of their parent topic.
SELECT SQL_CA...
I've been playing with pyglet. It's very nice. However, if I run my code, which is in an executable file (call it game.py) prefixed with the usual
#!/usr/bin/env python
by doing
./game.py
then it's a bit clunky. But if I run it with
python -O ./game.py
or
PYTHONOPTIMIZE=1 ./game.py
then its super-smooth.
I'm don't care m...
Howdy peeps.
I hope you can help me with this one. I got a twitter service ( http://foller.me ) which is about to be updated to public beta 2, but I don't want to do this until I could give the pages out in at least 2 or 3 seconds. The current version is simple enough, but the dev version I'm working on is quite complex.
It's all about...
Consider the following database tables:
Table "messages" with 13,000,000 rows (one row per message).
Table "users" with 3,000,000 rows (one row per user).
The following query is used to fetch a bunch of messages and the corresponding users:
SELECT messages.id, messages.message, users.id, users.username
FROM messages
INNER JOIN users...
Consider this scenario with the following assumptions:
The database is used for a non-critical webapp.
Query speed is of vital importance.
The read/write patterns are roughly >95 % reads and <5 % writes.
The database is backuped up daily using mysqldump.
The is no need for transactions or advanced crash recovery. If the database crash...
I'm looking for a good easy to use Java based Quadratic Programming (QP) solver.
Googling around I came across ojAlgo (http://ojalgo.org).
However, I was wondering if there are any other/better alternatives.
...
I'm currently trying to optimize a MYSQL statement that is taking quite some time. The table this is running on is 600k+ and the query is taking over 10 seconds.
SELECT DATE_FORMAT( timestamp, '%Y-%m-%d' ) AS date, COUNT( DISTINCT (
email
) ) AS count
FROM log
WHERE timestamp > '2009-02-23'
AND timestamp < '2020-01-01'
AND TYPE = 'play...
I am puzzled. I looked at the trace of a pagecall that was "slow" to load according to my boss, causing the page to partially load, and then "jump" to the memorized scroll-place on a postback.
I found out eventually, using my trace, that my whole loading, from Begin PreInit to End Render, took 1.94 seconds, 1.5 of which are spent betwee...
Hi,
I have a function that detects all files started by a string and it returns an array filled with the correspondent files, but it is starting to get slow, because I have arround 20000 files in a particular directory.
I need to optimize this function, but I just can't see how. This is the function:
function DetectPrefix ($filePath, $...
Hi,
I've been looking through a lot of Javascript Optimizing and most of them talk about string concatenation and a few other big ones found here, but I figured there had to be more details that you can optimize for when speed is critical and the processing of those pieces of code is very high.
Say you run this code for some reason: (u...
Imagine you have a large dataset that may or may not be filtered by a particular condition of the dataset elements that can be intensive to calculate. In the case where it is not filtered, the elements are grouped by the value of that condition - the condition is calculated once.
However, in the case where the filtering has taken place,...
Salesforce’s secret sauce: It queries its databases with “The Multi-Tenant Optimizer" So exactly what could this practice be comprised of?
...
I've been tasked with reconciling two big data sets (two big lists of transactions). Basically i extract the relevant fields from the two data sources into two files of the same format, then compare the files to find any records that are in A but not in B, or vice versa, and report on them. I wrote a blog entry on my best efforts achievi...
I have a table watchlist containing today almost 3Mil records.
mysql> select count(*) from watchlist;
+----------+
| count(*) |
+----------+
| 2957994 |
+----------+
It is used as a log to record product-page-views on a large e-commerce site (50,000+ products). It records the productID of the viewed product, the IP address and USER_...
Here's the query:
SELECT COUNT(*) AS c, MAX(`followers_count`) AS max_fc,
MIN(`followers_count`) AS min_fc, MAX(`following_count`) AS max_fgc,
MIN(`following_count`) AS min_fgc, SUM(`followers_count`) AS fc,
SUM(`following_count`) AS fgc, MAX(`updates_count`) AS max_uc,
MIN(`updates_count`) AS min_uc, SUM(`u...
I am using simulated annealing to solve an NP-complete resource scheduling problem. For each candidate ordering of the tasks I compute several different costs (or energy values). Some examples are (though the specifics are probably irrelevant to the question):
global_finish_time: The total number of days that the schedule spans.
split_...
When I define columns in MySQL I generally use int, varchar(255), text and the occasional enum for boolean. What are the benifits of accurately specifying column types rather than just leaving them at maximum?
For example a password field encoded as MD5 will never exceed 32 characters so is there a tangible performance gain from using ...
I`m having trouble trying to optimize this query with OVER (PARTITION BY ...) because the id field of the table containing the maxDate needs to relate to the other table.
The working query is:
SELECT maxReadDate, Equip.idProtocol
FROM Equip,
(
SELECT idEquip as idEquipTot, MAX(readDate) AS maxReadDate
...
I know- Premature optimization.
But I've got code that's supposed to find out if a position is changed vs a cached position.
Current code is:
if(abs(newpos-oldpos) > 1){
.....
}
Is it more efficient to use the following?
if(abs(newpos-oldpos) != 0){
....
}
Why or why not? I'm currently debating it my head which is more re...
Hello
I am trying to code a custom url_rewriter for squid.
& also with using some other url_rewriter programs like squidGuard
so have to use a wrapper to able use both or any other program.
when i try to loop with php.
(that's the way how squid communicates with external programs.
STDIN/STDOUT. it gives you a url & you have to sen...