Here's a layout of my data:
Heading 1:
Sub heading
Sub heading
Sub heading
Sub heading
Sub heading
Heading 2:
Sub heading
Sub heading
Sub heading
Sub heading
Sub heading
Heading 3:
Sub heading
Sub heading
Sub heading
Sub heading
Sub heading
Heading 4:
Sub heading
Sub heading
Sub h...
There are key self-contained algorithms - particularly cryptography-related such as AES, RSA, SHA1 etc - which you can find many implementations of for free on the internet.
Some are written to be nice and portable clean C.
Some are written to be fast - often with macros, and explicit unrolling.
As far as I can tell, none are trying t...
Hello everyone:
I'm now trapped by a performance optimization lab in the book "Computer System from a Programmer's Perspective" described as following:
In a N*N matrix M, where N is multiple of 32, the rotate operation can be represented as:
Transpose: interchange elements M(i,j) and M(j,i)
Exchange rows: Row i is exchanged w...
I have a collection of objects, each with an int Frame property. Given an int, I want to find the object in the collection that has the closest Frame.
Here is what I'm doing so far:
public static void Search(int frameNumber)
{
var differences = (from rec in _records
select new { FrameDiff = Math.Abs(rec.Frame...
Hi,
For my studies, we have code for matrix multiplication, for sizes between 1000-10000. It looks pretty fast, and uses GPU for calculations. As homework we need to find number crunching applications, with available source code, whose bottlenecks are in matrix multiplication. We will connect the program with the GPU code for matrix mul...
A quick question:
When i pass a variable to a function, does the program make a copy of that variable to use in the function?
If it does and I knew that the function would only read the variable and never write to it, is it possible to pass a variable to the function without creating a copy of that variable or should I just leave tha...
Let's imagine we should get some data...
var data = [];
//some code omitted that might fill in the data (though might not)
Then we need to do something with the data. And my question is how to do it more effectively. Like so?:
if (data.length) {
for (var i = 0; i < data.length; i++) {
//iterate over the data and do somet...
I'm building a process which extracts data from 6 csv-style files and two poorly laid out .txt reports and builds output CSVs, and I'm fully aware that there's going to be some overhead searching through all that whitespace thousands of times, but I never anticipated converting about 50,000 records would take 12 hours.
Excerpt of my ma...
I saw and done myself a lot of small products where a same piece of software is separated into one executable and several DLLs, and those DLLs are not just shared libraries done by somebody else, but libraries which are done exclusively for this software, by the same developer team. (I'm not talking here about big scale products which ju...
I am putting together a web page which is quite 'expensive' in terms of database hits. I don't want to start optimizing at this stage - though with me trying to hit a deadline, I may end up not optimizing at all.
Currently the page requires 18 (that's right eighteen) hits to the db. I am already using joins, and some of the queries are ...
This is for an upcoming project. I have two tables - first one keeps tracks of photos, and the second one keeps track of the photo's rank
Photos:
+-------+-----------+------------------+
| id | photo | current_rank |
+-------+-----------+------------------+
| 1 | apple | 5 |
| 2 | orange | 9 ...
class A
{
public int a;
public int c;
}
i will create 10 instances from A.Then i will create 15 instances from A again... go on. first 10 instance will have same value for a variable and next 15 instances will have again same value for a.But I don't mean that both group has same values for a .Problem is create same a value 10 times i...
There are two data types: tasks and actions. An action costs a certain time to complete, and a set of tasks this actions consists of. A task has a set of actions, and our job is to choose one of them. So:
class Task { Set<Action> choices; }
class Action { float time; Set<Task> dependencies; }
For example the primary task could be "Get...
I just installed Google's Page Speed plugin to Firebug, and everything looks good except for caching. I have set headers to cache my JS and CSS files, but it says the images aren't being cached. How can I make sure the images get cached for 30 days? These are static images, so I can't just add the headers with PHP like I did with the ...
Hello Everyone,
Basicly, what I need for the program to do is to act a as simple fraction calculator (for addition, subtraction, multiplication and division) for the a single line of input, for example:
-input: 1/7 + 3/5
-output: 26/35
My initial code:
import sys
def euclid(numA, numB):
while numB != 0:
numRem = numA % nu...
I have the following model
class Plugin(models.Model):
name = models.CharField(max_length=50)
# more fields
which represents a plugin that can be downloaded from my site. To track downloads, I have
class Download(models.Model):
plugin = models.ForiegnKey(Plugin)
timestamp = models.DateTimeField(auto_now=True)
So to ...
I am developing a website with huge data which to be stored in SQL Server database. How should I optimize it to make it faster.
1. Using Stored procedures.
2. Functions / Views.
3. Any other methods
...
I have a table with a lot of rows. The structure is something like this:
UserID | ItemID | Item Data...
Would I see any gains in query time if I separated this into a table per user, or per smaller group of users?
Queries are always single user getting/modifying a selection of items.
...
Hello all,
I am trying to make a Java port of a simple feed-forward neural network.
This obviously involves lots of numeric calculations, so I am trying to optimize my central loop as much as possible. The results should be correct within the limits of the float data type.
My current code looks as follows (error handling & initializati...
Let's say I have a list of objects. (All together now: "I have a list of objects.") In the web application I'm writing, each time a request comes in, I pick out up to one of these objects according to unspecified criteria and use it to handle the request. Basically like this:
def handle_request(req):
for h in handlers:
if h....