|
The text file can be huge. It can have around 500000 lines, each line having a minimum character count of around 44.
What can be done in this case?
|
|
|
|
|
That's still not big. We post process text files with 1M+ lines. Granted this is C++ using STL containers, but the principle is the same. Read the whole lot in, process it, dump it all back out.
500000 * 44 - approx 20 Mb? Not a massives burden on desktops these days (unless my maths is as good as my C#!).
Regards
Angel
*********************************************
The sooner you fall behind, the longer you have to catch up.
-- modified at 11:29 Friday 9th June, 2006 - typo
|
|
|
|
|
Good Morning!
Just a fundamental question.
Where constants are created? On heap / stack or does it depend on the type ( int on stack / string on heap)?
Apreciate any link with info.
Thanks,
JG
|
|
|
|
|
Only value types and strings can be const members of a type. Those values are baked into the code which uses them. For example:
// field in MyClass
public const int CI = 2;
// code in method somewhere else
int j = MyClass.CI;
// Compiler emits IL equivalent to this
int j = 2;
Josh
|
|
|
|
|
I couldn't find a link at hand, but I think I can offer some hints. Please do check if there is another source of information.
All constants are allocated on the stack. Actually, .NET only has two types of objects, value type and class type. .NET heap only stores class type objects (including arrays), which are garbage collectable. All value types are allocated on the stack. Even pointers. This might sound strange, but it isn't. Lets see this example:
String^ str = gcnew String(L"ABCD");
What actually happens is that str^ handle is allocated on the stack, but the object is allocated on the .NET heap. A handle is still of a value type. It would be clearer if I rewrite it this way:
String^ str;
str = gcnew String(L"ABCD");
Also, constant string L"ABCD" is allocated on the stack:
String^ str = L"ABCD";
Hope this helps.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Jun Du wrote: All value types are allocated on the stack.
That is not true. If a reference type (class) has a value type field, that value type object will be created on the heap - inside the reference type object. Also, arrays (which are reference types) can contain value types as elements, in which case they will be created on the heap.
Josh
|
|
|
|
|
You're right; I overlooked fields inside a class.
- It's easier to make than to correct a mistake.
|
|
|
|
|
Hello,
I am very new to MessageQueuing. I have 2 computers (XP SP2) using MSMQ. Desktop1 hosts a private queue. Desktop2 has to listen to messages arriving to the queue hosted by Desktop1.
The program running in Desktop2 uses .NET framework 2.0. It creates a System.Messageing.MessageQueue object, sets its path to refer to the queue in Desktop1 and calls BeginReceive method to start listening for messages. When the BeginReceive method is called, it gets a MessageQueueException saying "Remote computer is not available".
Desktop2 has symantec firewall installed. The symantec intrusion detection has stopped a request from going out of desktop2 to desktop1 when it calls BeginReceive method. The symantec log file says "Attempted Intrusion 'MSRPC_MSMQueryProp_BO' from your machine against Desktop1.ad2.prod, Intruder: Desktop2". The symantec intrusion detection software did not let the Desktop2 establish the link to listen for message arriving to the queue in Desktop1.
Is there a way I can fix this issue. If symantec software looks at it as an illegal request, is there a way i can make this request properly so that symantec does not block it?
Please let me know if this is not the appropriate forum for this and direct me to a different one.
Thanks.
Vidhya
|
|
|
|
|
Hi Vidya,
Even i m new to MessageQueuing.I have not even taken a single step towards MessageQueuing...but i m interested and need to do it.Could u suggest me any tutorials or any other good sources for MessageQueuing..
Or else u atleast share ur views about exploring MessageQueuing...
Thanks in advance
Do not wait to strike till the iron is hot; but make it hot by striking.
|
|
|
|
|
Hello,
i need to download, upload, create directory and move files on a FTP server
I'm at work, so i have to use the proxy (USER@HOST mode)
When i get the ftpwebresponse i have the following error :
The server committed a protocol violation. Section=ResponseStatusLine
Can you help me.
This is the code i use :
<br />
FtpWebRequest myFtpRequest = (FtpWebRequest)WebRequest.Create("ftp://ftpUrl");<br />
myFtpRequest.UsePassive = false;<br />
myFtpRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails;<br />
myFtpRequest.Credentials = new NetworkCredential("ftpLogin", "ftpPass");<br />
myFtpRequest.KeepAlive = true;<br />
WebProxy myProxy = new WebProxy("proxyUrl", "proxyPort");<br />
myFtpRequest.Proxy = myProxy ;<br />
<br />
FtpWebResponse ftpResponse = (FtpWebResponse)myFtpRequest.GetResponse();<br />
Thanks a lot
CutKemist
|
|
|
|
|
Hi
I'm trying to create my own ListView Control that looks like this.
I've tried to make the Items as a Panel, but I don't know how to make the container.
Can someone give me an approach?
thanks
|
|
|
|
|
What do you mean by 'container'? If you mean that which holds the items, you could use a Panel. If not, (or if using a Panel doesn't suit your needs) then what do you mean?
Josh
|
|
|
|
|
in VS2003, it was possible to add reference to a windows class library project in a mobile project by adding reference to this DLL, but now, with framework 2.0, i got error when trying to add a reference to windows DLL project. Windows DLL and mobile project are in the same solution. Does any body have an idea about this?
-- modified at 5:16 Wednesday 7th June, 2006
|
|
|
|
|
perhaps the dll you used was compatible with the compact framework, and the one you try to use now is not?
You could try reflector[^] to learn more...
|
|
|
|
|
i can reference this DLL as an externel DLL, but i can't add reference to its project in the same solution. ok, may be i will use it as external. thanks
|
|
|
|
|
i want to get the file size of an NTFS encrypted file. GetFileSize gives non encrypted file size that windows show in file properties. Is there any solution to get the actual encrypted file size ??? SDK facilitate us only in case of compressed files as it can tell bout compressed and uncompressed file sizes us GetCompressedFileSize() ans GetFileSize() but there is no such information about encrypted files. Can anyone help me in this regard?
Regards
-Zeeshan
|
|
|
|
|
Got this question - I am working in a company that has been using VS2003 and the older .NET framework for all its projects; I want to experiment with web-development, ASP 2.0 but I am wary of any compatibility problems. If I install the 2.0 SDK and continue to use VS2003 and projects developed in previous .NET, should everything work fine, or should I expect some issues?
Thanks in advance..
|
|
|
|
|
You can't compile against v2.0 of the .NET framework from within VS2003. You need to use VS2005.
I can't give any advice regarding ASP.NET 1.1 -> 2.0 conversions (I'm a WinForms guy). Moving from .NET 1.1 to 2.0 in general, however, should not pose any problems for you. I do find VS2005 to be rather slow, though. Then again, I pretty much only use it for WinFx dev (which is still beta bits!).
Josh
|
|
|
|
|
You shouldn't have any problems. However, if you try to upgrade a web project from 2003 to 2005 expect lots of problems. Where I work a colleague has been experimenting with that to see what the isues will be when they eventually try and upgrade their projects. It appears to be a hard slog!
Kevin
|
|
|
|
|
It works just fine.
I have both VS 2003 and VS 2005 installed, and never experienced any problems with it. I can have them both running at the same time even.
---
b { font-weight: normal; }
|
|
|
|
|
I need to store some user seetings and wonder how to do that...
Of course I was thinking to mix XML serialization with IsolatedStorage IO.
BUT
I believe it exists an API for that, I even used it (and forget about it).
However in my somewhat hazy memory it was abusively complex to use properly.
Any tips?
|
|
|
|
|
I think you are looking for Application configuration file and API that supports reading/writing to it.
What version of .NET are you using?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I watched a tutorial (and even tried it!) where you could databind the position of your windows to some user settings and the windows position is automatically save and restored any time you leave & start the application!
That's the thing I'm looking for!
I have .NET 2.0.
Anyway I wrote a nice and simple ConfReaderWriter class which take care of all the IO & persistent aspect using Isolated storage and XML serialization.
But that doesn't automatically save ↦ restore my windows position but I manage to make it work
|
|
|
|
|
You reinvented the wheel by that one, becouse it is already implemented in the .NET framework (I can't remember the name right now).
As for that automatic saving I really don't know. Try google.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I might have reinvented the wheel, but it was a small and well hidden wheel
But I would be happy to know about it!
|
|
|
|