I feel like my implementation is a bit naive. Take notice of the variables min in max which have a rather small precision of +/- 0.0001. If I raise the precision any further the code is just too slow.
Algorithm
Code
private IDynamic ToExponential(Engine engine, Args args)
{
var x = engine.Context.ThisBinding.ToNumberPrimitive()...
I have the following lamda expression:
IEnumerable<Order> query
= _ordersRepository.GetAllByFilter(
o =>
o.OrderStatus.OrderByDescending(os => os.Status.Date).First()
.Status.StatusType.DisplayName != "Completed"
||
o.OrderStatus.OrderByDescending...
hi every1
i want to calculate the process time per thread.
how do i do it.?
suppose my 100 threads are executing the same method work() concurrently, then if i put the following code help me get what i seek
Process thisProc = Process.GetCurrentProcess();
string procName = thisProc.ProcessName;
DateTime started = thisProc.StartTime;
in...
Hi!
I'm working with a new and an old database on an oracle 9.2.0.3.0 server.
Queries against tables in the new database are about 300 times slower than identical queries against tables in the old database.
These databases are quite similar but there are some differences:
The table I'm testing in the old one has one CHAR column (ind...
Hi all,
We are facing a strange performance problem with "SQL Server Express 2005" in a very simple condition.
We have a table with: [timestamp], [id], [value] columns.
and only one primary unique index on [timestamp]+[id].
The table contains around 68.000.000 records.
The request is:
SELECT TOP 1 timestamp FROM table WHERE id=1234 O...
When working within a class on its own fields and properties, I typically only use the property when it performs some function (like limiting a value or validating or whatever). Otherwise I prefer to read/write the backing field directly.
I somehow got it in my head that this would be a more generally performant way to do things, but i...
Hi,
I always thought that to be a "real" software developer or to work for serious companies on serious software projects, C/C++ knowledge is a requirement. A mandatory one.
I also thought that building software with C# is just as building a website with ASP.NET controls: it is still possible to do for some small products, but trying t...
What is the fastest way to convert an object to a double? I'm at a piece of code right now, which reads:
var d = double.TryParse(o.ToString(), out d); // o is the Object...
First thoughts were to rewrite this as
var d = Convert.ToDouble(o);
but would that actually be faster?
EDIT: In addition to running the profile (by the way,...
I am using python to parse the incoming comma separated string. I want to do some calculation afterwards on the data.
The length of the string is: 800 characters with 120 comma separated fields.
There such 1.2 million strings to process.
for v in item.values():
l.extend(get_fields(v.split(',')))
#process l
get_fields use...
I am in search for an efficient method to replace a couple of DOM Elements - if possible in one action only.
It is needed for augmenting TextNodes. If a certain word is present, it shall be wrapped in span-Tags, to which an event handler needs to be assigned later.
so if a text Node contains the word it needs to turn from
-#textNode
...
I need help with making this bit of code faster:
UnitBase* Formation::operator[](ushort offset)
{
UnitBase* unit = 0;
if (offset < itsNumFightingUnits)
{
ushort j = 0;
for (ushort i = 0; i < itsNumUnits; ++i)
{
if (unitSetup[i] == UNIT_ON_FRONT)
{
if (j == offset)
unit = unitFormation[i];
++j;
}
}
}
el...
I am trying to run the jboss server (5.1.0) in clustered mode. I am having two nodes in the same host. When i access the two nodes as separate URLs it works well.
I am using a Apache HTTP server to load balance my requests using the Proxy balancer (with proxy pass, proxy reverse configurations). When I access the Apache server URL, it t...
I've a partially finished interpreter for a lexically scoped 'pure Lisp' (no set!) that uses a call-by-need evaluation model which comes down to call-by-name with simple caching, the interpreter naturally uses an environment-based evaluation model.
The standard way of evaluating lambda abstractions, as in, constructing a new environment...
hi.
Somewhere I have read that modern Intel processors have low-level hardware for implementing exceptions and most compilers take advantage of it, to the effect that exceptions become faster than returning results state using variables.
Is it true? are exceptions faster than variables as far as returning state/responding to state? re...
In the context of improving overall site performance (downloading and rendering speed) there appears to be a contradiction between the following two best practices:
Only bring down the CSS that you need for the page being viewed. (Because too many CSS rules cause slow rendering)
Always minify CSS and combine it into one file. (Because ...
Hi, the code I'm dealing with has loops like the following:
bistar = zeros(numdims,numcases);
parfor hh=1:nt
bistar = bistar + A(:,:,hh)*data(:,:,hh+1)' ;
end
for small nt (10).
After timing it, it is actually 100 times slower than using the regular loop!!! I know that parfor can do parallel sums, so I'm not sure why t...
I am trying to convince management to switch from SQL Server, to MySQL on Linux.
This is very much a windows house, and management seems very wary of using Linux.
Can anyone provide hard facts showing Linux is more stable, higher performance than
windows for running a DB server? And any other advantages?
Also, nobody here knows how to...
I've got a single mousedown event handler on a table with dynamically increasing number of rows (right now over thousand, in perspective should have been unlimited) and I observe a drop down in performance as the number of preloaded rows increases. The purpose of event handler is simple - figure out which row was clicked and highlight it...
I thought the C/C++ vs C#/Java performance question was well trodden, meaning that I'd read enough evidence to suggest that the VM languages are not necessarily any slower than the "close-to-silicon" languages. Mostly because the JIT compiler can do optimizations that the statically compiled languages cannot.
However, I recently receive...
I need to select some records from a table where a column value is equal to any of the values in a list.
This can be done using either IN operator (like WHERE column IN (v1, v2, ...)) or multiple OR operators (like WHERE column = v1 OR column = v2, ...).
When should I use either of these ways?
...