operation

How to correctly use .NET2.0 serial port .BaseStream for async operation

I am attempting to use the .BaseStream property of the .NET2.0 SerialPort to do asynchronous reads and writes (BeginWrite/EndWrite, BeginRead/EndRead). I am having some success in this, but after a time, I notice (using Process Explorer) a very gradual increase in the Handles the app is using, and occasionally an extra thread, which als...

Consuming a method not mentioned in OperationContract

I have a WCF services. Which has two methods, say Get and Save. I want to expose only the Get method to the third party who will be consuming the service while my application should be able to consume both Get and Save. Is there a way to consume a method not in OperationContract? I am thinking of verifying the host name of the request a...

Difference between operations & threads in Cocoa

Hello everybody, I am learning Objective-C, I will be developing a video processing application. I am reading the developer's guide on apple and I ran into Operation objects. I just need some clarifications what the difference between operations & threads, disadvantages, advantages, use cases. From what I read, operation is higher le...

WCF Operation Logging

Hi, I'd like to log the performance of our WCF operations, in particular if an operation takes longer to execute than a given threshold it creates a warning in a log. We have started by implementing IDispatchMessageInspector which allows us to time each operation and perform the logging. However, I'd like to be able to append the user...

How can I get and put a value into a certain column and row?

I am having difficulties doing this program. It's transportation method using intuitive approach. you will first create two inputs that will describe how many rows and columns will the user wish to have. and then, after clicking a submit button, a desired number of rows and columns will appear. then the user will input the number of valu...

how to display data comming from pipe on GUI form in C #

I have made a small server and client application connected via named pipe. I am able to communicate between them in console application. Now i want that data to be displayed in text box on form. I am not able to display, once i assign the data it gets assigned but text box is not showing the new up dated value. Can any one help me to ...

How do I convert a 2X2 matrix to 4X4 matrix in MATLAB?

I need some help in converting a 2X2 matrix to a 4X4 matrix in the following manner: A = [2 6; 8 4] should become: B = [2 2 6 6; 2 2 6 6; 8 8 4 4; 8 8 4 4] How would I do this? ...

Mapping a WCF request message to the underlying operation

I need to know what operation is being invoked by examining a request Message object in an IDispatchMessageInspector. What is the best way to do this? ...

Atomic bitfield operations on 80x86?

Does 80x86 have instructions for atomically testing and setting individual bits of a word? ...

Prolog: Recursive function redefinition

Is there a way to "recursively redefine" (don't know the technical term) prolog predicates? Consider these predicates: f(X,Y,A):-A is Y xor X. arity(f,2). now i want to automatically create 2 new predicates f1/2 and f2/1 with the following definition: f1(Y,A):-f(1,Y,A). f2(A):-f1(1,A). So the predicate should get a (binary) funct...

WCF Security Exception caused by Directory.Delete()

Hi, I am encountering a strange issue: I call a WCF-Operation from my client. The operation deletes all files in a specified directory and finally deletes their parent directory too. ACtually, this works. No exception is thrown and the files within the folder and the folder itself are deleted successfully. But: the wcf context of my c...

Operator associativity in C specifically prefix and postfix increment and decrement

In C operation associativity is as such for increment, decrement and assignment. 2. postfix ++ and -- 3. prefix ++ and -- 16. Direct assignment = The full list is found here Wikipedia Operators in C My question is when we have int a, b; b = 1; a = b++; printf("%d", a); // a is equal to 1 b = 1; a = ++b; printf("%d", a)...

How do i get the invoked operation name within a WCF Message Inspector

I'm doing a message inspector in WCF: public class LogMessageInspector : IDispatchMessageInspector, IClientMessageInspector which implements the method: public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext) I can get the name of the invoked service with: instanceCo...

Best way of implementing a batch like operation in a RESTful architecture?

Hello, We have a predominantly RESTful architecture for our product. This enables us to nicely implement almost all of the required functionality, except this new requirement thats come in. I need to implement a page which lets the user to large scale DB operations synchronously. They can stop the operation in between, if they realized...

OpenCV multiply scalar and a Matrix

Hi, I am trying to find the easiest way to add, subtract a scalar value with a opencv 2.0 cv::Mat class. Most of the existing function allows only matrix-matrix and matrix-scalar operations. I am looking for a scalar-matrix operations. I am doing it currently by creating a temporary matrix with the same scalar value and doing require...

Solving linear programming problems using the graphical method

Hi. I'm having a problem with graphical method in linear programming problems. Image example I don't know how draw the straight line Z=0, Z=6.... ...

How to create a file using javascript in Mozilla Firefox

Hi, I want to write a function in javascript which creates a file and write some content to it, iam working with firefox, can anybody help me in this case. Thanks... ...

Why can't I use Set:union() instead of Set.union ?

Hello, I am learning Lua and I would rather use the colon (:) for methods. Unfortunately, it's not working everywhere. See my code: Set= {} local mt= {} function Set:new(m) local set= {} setmetatable(set,mt) for a,b in pairs (m) do set[b]=true end return set end function Set.union(a,b) local res=Set:ne...

How to parse arithmetic operators from string?

Is it possible to assign an int variable a value that is a result of expression written in a string? E.g. I have a string "5 - 3" and the expected result is 2. ...

c++ multiply vector elements by a scalar value using STL

Hi I want to (multiply,add,etc) vector by scalar value for example myv1 * 3 , I know I can do a function with a forloop , but is there a way of doing this using STL function ? something like the {Algorithm.h :: transform function } ?? ...