|
Hi,
I agree with Dave.
bbranded wrote: Does anyone have any tips for memory optimization?
The best optimization tip, assuming the functionality requirements warrant it: add lots of code and functionality, and rejoice when multiplying the source by 1000 makes the memory footprint grow by a much smaller factor.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 9:03 AM
|
|
|
|
|
Thanks for the info guys. I remember reading a blog post about it, but failed to be able to cite it to the senior dev.
I understand what you're laying Luc. Neato.
Thanks,
Matt
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
This isn't a solution as such - but an observation. When an .Net application is minimized, the reported RAM useage in task manager decreases dramtically. I found this with an app that I did that ran in the tray mostly. On launch I forced it to minimize before placing it in the tray and all the clients stopped moaning!
Also, make sure you've compiled it as 'Release', not debug if you're just testing/running the exe rather than an install, that can make a difference too.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
|
Hi everyone,
I use Regex for splitting a string. Now i have 2 Questions:
1. I have e.g the string "something || anything && anotherthing" and I want to split it into string[3] ={ something, anything, anotherthing }; is there an easier way than to use 2 Regex like Regex("||") and Regex("&&") and split it first with one Regex and then each element with the other?
2. I have heard that when you split a string you can leave the splitsequence (like in the example before "||") to one of the stringsresults. How can I do that?
Thanks for your help!
|
|
|
|
|
If you have the same delimiter between strings, then the easiest way is to use Split() method of string class.
string str = "aaa::bbb::ccc";
string[] splittedStrings = str.Split("::");
But, if the explression is more difficult, then Regex is a good solution
|
|
|
|
|
Why not just use the following regex: "( \|\| )|( && )" It finds either and can be used in your split.
Hogan
|
|
|
|
|
Somehow that is not working...
I tried
Regex reg = new Regex("(\\|\\|)(&&)");
on
string input = "something || anything && anotherthing";
but it isnt Spliting it even once
|
|
|
|
|
Try again with the correct string
Regex reg = new Regex("( \|\| )|( && )");
Hogan
|
|
|
|
|
Oh there was an | between the brackets...
Thanks a lot, and this also solves Question 2
|
|
|
|
|
Hello,
I have a little Stored Procedure (SQL Server 2005), which returns some tables. Now, I'm getting those tables in the DataSet in my code. The problem is that I'm not getting TableName of none of the tables. All I get is a default naming convention "Table", Table1", Table2" ....
What is the way to get the TableName from SP? How can I basically know which table represents which select in the SP?
Thanks,
Maxim
|
|
|
|
|
|
What do you mean: "you can't"? There has to be some proper way to get tables named then counting them in the SP and then reading them like myDataSet.Tables[5]. And what if SP has been changed? Will I have to recompile the whole project? BTW, If I can't then why do I need this property "TableName" at all?
modified on Tuesday, March 3, 2009 1:55 AM
|
|
|
|
|
Maxim Langman wrote: There has to be some proper way to get tables named
There isn't. There can't be.
Maxim Langman wrote: then why do I need this property "TableName" at all
You don't.
|
|
|
|
|
Hi evryone
I have some C# question
1. how to make event and use him ?
2. how to transfer file from computer1 to computer2 (in LAN - in share folder)
I try whit File.Copy, but it isent work
thank's for any help
|
|
|
|
|
1. There are many great articles around on CodeProject and elsewhere. A search here and on google should yeild many results. I also have an article here[^] aimed at beginners to events.
2. .NET applications without some work cannot access network shares etc with good reason. You can do it using impersonation (and spplying valid credentials of a user that has permissions to access the share) or physically altering the .NET runtime security policy on each machine that requires it.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
1. In order to create an event in your call you should do declare two things:
a. Declare public delegate
b. Declare public event which is an instance of this delegate
public delegate void ClickHandler(int Param1, int Param2);
public event ClickHandler Click;
Then when you want to fire this event you just call it:
private void foo(){
...
...
Click(argument1, argument2);
...
}
2. File.Copy should work if you map the drive
|
|
|
|
|
|
It's not so useful in VB.NET, but it's used when accessing the bitmap contents in memory using pointers. It's good for C# and managed C++, but VB.NET has no use for it since there is no pointer support in VB.NET.
If you want an example, there is a good series of Image Processing articles by Christian Graus that shows how to use it. Just search the articles for "Image Processing for Dummies".
|
|
|
|
|
Great, thank you very much
|
|
|
|
|
I hate to be a contrarian, but that's not correct. Bob Powell has some really great documentation on GDI+. Just google Bob Powell GDI+. When there, search for LockBits.
Bitmaps are usually displayed on screen. If you're editing a portion of a bitmap that is displayed, it will be really slow because it has to perform safe edits on each pixel. Instead, you can grab the piece (even if that piece is the whole image) you want to work with and copy that piece into an array of memory and pin it there. That's what LockBits does for you. Calling SetPixel on the copied, pinned array will be much, much faster, but you have to remember to call UnlockBits so that it can be unpinned.
Without darkness, there are no dreams.
-Karla Kuban
|
|
|
|
|
Hi,
I am looking for a way to programatically read a Word document and based on the formatting, extract text. Specifically, I am searching each line in a document for a particular heading; then, extracting text if the following lines are bulleted. I would appreciate it if anyone would point me in the right direction.
Thanks in advance,
Ed
|
|
|
|
|
Windows has many services running. How can I call a method from a particular service from my application.
Suppose Service name "ftpsvc" is running. From my aplication I want to call a method of ftpsvc service
to see the return value.
I have some idea about Remoting, WCF. Any example code or pointing to the right direction will be helpful.
thank you.
|
|
|
|
|
I think you may be confusing a Windows service with a web service.
- A Windows service is an app that can be configured to start when the Windows starts and runs in the background as long as Windows is running. IOW, a user isn't required to be logged on in order to run the app.
- A web service is an API that can be accessed over the network. A WCF web service is hosted in a service host, which is usually IIS, a Windows service, or a Windows or console app.
/ravi
|
|
|
|