|
vandel212 wrote: GC.Collect()
Is that really necessary? It usually isn't..
|
|
|
|
|
Sorry, the third option ("clean and easy") wasn't entirely correct, as the stream does not get closed/disposed of. Here is a better way:
Bitmap bm=null;
using (FileStream stream=File.OpenRead("image.jpeg")) {
bm=Image.FromStream(stream);
}
So in the end, there isn't a single-line solution.
|
|
|
|
|
My goal is to preform various image processing tasks on an image taken by a webcam...
After googling, and trying different examples... I failed to find a simple solution. Example code is either overly complicated or it only supports WIA webcams only.
I like how "Motion Detection Algorithms[^]" works (for stills) however the code is overly complicated for the task I want to preform with a mind blowing 48 .cs files...
I tried trimming down but ended up with 26 files of code I have no clue on...
All I want to do is take a still or two every five minutes... Any suggestions on this simple sounding yet strangely complicated task?
|
|
|
|
|
My problem is simply that I am trying to make a simple command line RSA encryption program and was trying out the number 123^17 and don't seem to be able to store the value anywhere because of its size. How can I work with numbers that are bigger than 10^20?
|
|
|
|
|
integers or reals?
search CodeProject (or google) for either BigInt or BigNumber, and you will find several classes that take care of it, not all at the same quality level though.
This[^] one you may like, no guarantees.
C# 4.0 has a BigInt class built-in, I haven't had a look yet.
|
|
|
|
|
Try the System.Decimal type which can hold values from ±1.0 × 10^−28 to ±7.9 × 10^28 with precision of up to 28-29 significant digits.
|
|
|
|
|
I've found that fixed-length number structs are usually better for relatively short numbers. Looks like 128bit should do in your case - and that's easy to make (just put 2 ulongs together in a struct, all operations except division and modulo are easy to extend)
|
|
|
|
|
I did try this ages ago but can't remember much about it. J# has a big integer class - see here[^], you can use this from C#.
There is also IntX[^] which I've never used but seen recommended.
|
|
|
|
|
Hi,
I am using VS 2008 to develop an application. In this application
i have List<> of Contacts. This list may contain thousands of contact's.
I have
class Contact
{
......
.........
};
i want to give a signal to all instances of this class that a changed had happen. How can i do this.
thanks
Nitheesh
Jose Jo Martin
http://www.simpletools.co.in
|
|
|
|
|
|
how can i compile file from DOS and make if an exe file?
|
|
|
|
|
|
|
alternative for this:
MemoryStream ms = new MemoryStream();
ms.Write("one exe file");
Process.Start(ms);
)
i have an encoded exe, i want to decode it on memorystream and then run it, so nobody can see original exe file! so i can not use a temp file on HDD!
other way?
modified on Tuesday, September 8, 2009 10:06 AM
|
|
|
|
|
Write it to a temporary file?
|
|
|
|
|
This may sound like a stupid question, but why would you want to do that? If you have the process name, path and parameters why put it to a stream fisrt? If the stream contains more than the name, path and parameters, then what do you expect to happen with the excess data?
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
There is no other way. You have to write it to a temporary file. Besides, if your app requires that kind of security, you're still not going to stop the right person from grabbing it straight out of memory.
|
|
|
|
|
you might create a (temporary) memory-resident file system, create a file in there, and execute it. Google + some stamina required.
klik[^]
modified on Tuesday, September 8, 2009 1:04 PM
|
|
|
|
|
Luc Pattyn wrote: you might create a (temporary) memory-resident file system, create a file in there, and execute it. Google + some stamina required.
I was going to suggest writing his own Loader in place of Windows version, but I thought it would have been a bit too overboard.
|
|
|
|
|
Dave Kreskowiak wrote: a bit too overboard.
Nah. If and when we go too overboard, we get a "plz send me the code" reply to straighten us out.
|
|
|
|
|
Hi all
I've made a web service client, that I'm going to use to call a public web service.
But I keep getting this error:
Could not find endpoint element with name 'basicHttpEndpoint' and contract 'oes.dk.NavisionStatIntegrationService.INavisionStatIntegrationService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.
I'm rather new at this web service thing, so I'm not sure what to do here.
I've been browsing the net for answers but nothing good has come up.
This is the client part of the app.config:
<client><br />
<endpoint address="https://test3.oes.dk/NavisionStatIntegrationServiceTest/NavisionStatIntegrationService.svc"<br />
binding="basicHttpBinding" bindingConfiguration="basicHttpEndpointBinding"<br />
contract="oes.dk.NavisionStatIntegrationService.INavisionStatIntegrationService"<br />
name="basicHttpEndpoint" /><br />
</client>
The code I call:
proxy = new NavisionStatIntegrationServiceClient("basicHttpEndpoint");<br />
proxy.ClientCredentials.UserName.UserName = this.UserName;<br />
proxy.ClientCredentials.UserName.Password = this.Password;<br />
this.NSResponse = proxy.InvokeNavisionStatIntegration(this.companyIdentifier, this.immediateExecuting, this.NSRequest);<br />
return this.NSResponse;
This is the code for the NavisionStatIntegrationServiceClient:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")]<br />
[System.ServiceModel.ServiceContractAttribute(Namespace = "http://www.oes.dk/NavisionStatIntegrationService/2009/05/25", ConfigurationName = "oes.dk.NavisionStatIntegrationService.INavisionStatIntegrationService")]<br />
public interface INavisionStatIntegrationService<br />
{<br />
[System.ServiceModel.OperationContractAttribute(Action = "http://www.oes.dk/NavisionStatIntegrationService/2009/05/25/INavisionStatIntegrat" +<br />
"ionService/InvokeNavisionStatIntegration", ReplyAction = "http://www.oes.dk/NavisionStatIntegrationService/2009/05/25/INavisionStatIntegrat" +<br />
"ionService/InvokeNavisionStatIntegrationResponse")]<br />
string InvokeNavisionStatIntegration(string companyIdentifier, string immediateExecuting, string NSRequest);<br />
}
|
|
|
|
|
You'll get a much better response if you post this in the WPF/ WCF / WF forum instead.
|
|
|
|
|
|
Please verify that the .config file is copied together with the exe. The config has the same name as the exe, e.g. MyApp.exe.config. Check if this file has the client-element within.
If the file is missing, right-click on App.config in the Project Explorer ro open the properties and select "Copy always".
Regards
Sebastian
|
|
|
|
|
The .config file is copied together with the .dll and has the same name, Application.dll and Application.dll.config.
The config has the client element from my original posting.
Best regards
Soren
|
|
|
|