Questions tagged [operations]
298 questions
4
votes
2 answers
Is there a way to display a image in WPF stored in memory?
What I got is something like a screenshot making application. (managed to serialize, thank god!!!) When a button is clicked a screenshot is taken by accessing a handling classe's method. now the tricky part is that the class has another method for…

lorddarq
- 685
- 1
- 10
- 17
4
votes
3 answers
Convert bit vector to one bit
Is there an efficient way to get 0x00000001 or 0xFFFFFFFF for a non-zero unsigned integer values, and 0 for zero without branching?
I want to test several masks and create another mask based on that. Basically, I want to optimize the following…

bkxp
- 1,115
- 1
- 12
- 20
4
votes
1 answer
Set operators not provided by Data.Vector of Haskell, what is the reason
My application involves heavy array operations (e.g. log(1) indexing), thus Data.Vector and Data.Vector.Unboxed are preferred to Data.List.
It also involves many set operations (e.g. intersectBy), which however, are not provided by the Data.Vector.…

Causality
- 1,123
- 1
- 16
- 28
4
votes
4 answers
StopWatch (System.Diagnostics) and System.Timers
I am new to handling threads.
What is the role of System.Diagnostics and System.Timers in the context of Threading ?
Both are alternative to each other or they implemented for doing some unique tasks?

user186973
- 569
- 3
- 6
- 13
4
votes
3 answers
Bitwise overflow checking in c
I am trying to write two functions that will check/prevent overflow in c (using only ! ~ | & ^ +) but cant get it. The first is will a certain twos compliment/signed int will fit in a certatin amount of bits: fitsB(int x, int n) where is the int…

Gekctek
- 1,161
- 2
- 12
- 23
3
votes
1 answer
Keep dependency injected objects for async handler in MVC3 application
I am working on a MVC3 application in which I would like to handle some code blocks asynchronously. These code blocks need to perform some db operations and they need access to my DAL repositories which are initiated trough my dependency injection…

jhoefnagels
- 359
- 1
- 7
- 21
3
votes
1 answer
Tool/script to find and modify numerical values in CSS file?
I simply want to go through and find every numerical value in a single, or batch of, CSS files and multiple times two, then save.
Any suggestions for the easiest way to do this?

Someone
- 85
- 1
- 7
3
votes
2 answers
Performing matrix operations with complex numbers in C
I'm trying to perform computations involving matrix operations and complex math - sometimes together, in C. I'm very familiar with Matlab and I know these types of computations could be performed simply and efficiently. For example, two matrices of…

Shaddy
- 155
- 1
- 3
- 6
3
votes
1 answer
how many times will a function print to the console?
I have the following snipet :
public class A
public A(int n)
{
for (int i=0; i

Elad Benda
- 35,076
- 87
- 265
- 471
3
votes
4 answers
Java has operator >>> and <<< which are a bit different - please help
Possible Duplicate:
Equivalent of Java triple shift operators (>>> and <<<) in C#?
Java has operator >>> and <<< which are a bit different then >> and << - can anyone give me its equivalent in C# ?

Mark Segal
- 5,427
- 4
- 31
- 69
3
votes
2 answers
LINQ to SQL: orderby a sum operation
I have a table where I need order a result set by sum a numeric column according to a group by clause.
For example, the table has a salesperson ID, order number, and order value. I want a top 10 list of my top salespeople by accumulated order…

Sarn
- 31
- 3
3
votes
3 answers
Basic Python Question on String operations: example: string.lowercase
So I'm trying to run this, but it errors out and I need help understanding what's wrong. I really appreciate any help, I'm taking the MIT opencourseware intro to programming:
words="GreatTimes"
words.lowercase
And I get this error:
AttributeError:…

Shinjitsu
- 639
- 3
- 10
- 23
3
votes
2 answers
Jenkins: Copy to a dynamic target location using the current branch in the file operations plugin
What is the correct formatting used to access the BRANCH_NAME variable in the file operations plugin-> file copy? The target location to be exact.
I have tried %BRANCH_NAME%, ${env.BRANCH_NAME} but jenkins keeps taking them literally and creating…

scranley
- 188
- 1
- 4
- 20
3
votes
1 answer
Fastest ways to set and get a bit
I'm just trying to develop ultra-fast functions for setting and getting bits in uint32 arrays. For example, you can say "set bit 1035 to 1". Then, the uint32 indexed with 1035 / 32 is used with the bitposition 1035 % 32. I especially don't like the…

vls
- 243
- 1
- 3
- 11
3
votes
0 answers
How to work with complex numbers in Prolog?
I have an assignment to write a prolog code to add, multiply, subtract and divide complex numbers. However, I'm not sure how to portray imaginary numbers in prolog!
kompl_mul(komplex(A1,B1),komplex(A2,B2),komplex(A,B)) :-
A is A1*A2 - B1*B2,
B…

CoderCat
- 101
- 1
- 2
- 9