|
Thanks zion417,
I think you are also not following the naming convension which Microsoft does (e.g. namespace.dll). Right?
regards,
George
|
|
|
|
|
It depends on my project.Normally we follow the same convension .Root.Child1.. etc. I was just saying the name of the "assembly" done actually matter.
|
|
|
|
|
Thanks zion417!
regards,
George
|
|
|
|
|
how to use contains method
I want to search more than one string like this
line.Contains("AssemblyVersion","AssemblyCompany","AssemblyProduct","AssemblyCopyright","AssemblyTrademark","AssemblyCulture")
how could i search??
plz reply if anybody knows
Thanks
|
|
|
|
|
Hello,
Other then Regex,
what you need is not implemented in the framework string class, AFAIK. (At least not in .Net 1.1)
The string class provides the IndexOfAny method, which only is able the search for chars.
But you could use a self written method!
Like this:
This method returns the startindex of the string which is found first.
public static int IndexOfAnyString(string TextToParse, string[] TextsToSearch)
{
int index=-1;
if(TextsToSearch!=null)
{
foreach(string actSearchText in TextsToSearch)
{
if(actSearchText!=null && !actSearchText.Equals(string.Empty))
{
index = TextToParse.IndexOf(actSearchText);
if(index>=0)
{
break;
}
}
}
}
return index;
}
In .Net > 1.1, you could use the "Contains" method instead of "IndexOf"!
Call it like this:
string mainline = "Hello codeproject world";
int index = IndexOfAnyString(mainline, new string[] {"msdn", "codeproject ", "blablabla"});
This is just a basic implementation of the problem.
You could add some more features like:
case sensitivity (true/false)
out param string, which returns the matching string
returning an array of int index values for all search texts
.
.
.
Hope it helps!
-- modified at 1:43 Friday 31st August, 2007
All the best,
Martin
|
|
|
|
|
Thanks For reply..
I'm using like this
if (line.Contains("AssemblyVersion")||line.Contains("AssemblyCompany")||line.Contains("AssemblyProduct")||line.Contains("AssemblyCopyright")||line.Contains("AssemblyTrademark")||line.Contains("AssemblyCulture"))
{
line = string.Concat("// ", line ," // comment");
}
its working..
But its adding comment withount indenting means..
AssemblyProduct //comment
AssemblyProduct //comment
AssemblyProduct //comment
but i want indentation like this
AssemblyProduct //comment
AssemblyProduct //comment
AssemblyProduct //comment
how i make indentation...
if you know then plz reply..
Thanks in advance
-- modified at 3:16 Friday 31st August, 2007
|
|
|
|
|
you can also use if statement
if (line.Contains("AssemblyVersion") && line.Contains("AssemblyCompany") && line.Contains("AssemblyProduct")........)
Becoming Programmer...
|
|
|
|
|
I want to get the WiFi information (eg. signal strength) from code (eg. C++, C#).
OS may be XP, CE5.0 or above.
I know it can be related to ndisuio.
Where can I get more coding information?
Thanks!
|
|
|
|
|
|
|
Hello folks,
I have a rather large image, whose size is around 6000 x 5000 pixels...
I would like to perfom image normalization and other such operations...which include some mathematical calculation for each pixel..
But when I do this on my image, it take about 20 mins to finish...
How to speed it up...??
Here is the normalization code which I am running..
public void NormalizeImage(ref Bitmap objBitmap, int iMaxColor)
{
DateTime dt = System.DateTime.Now;
System.Diagnostics.Trace.WriteLine(" Normalizing Image: " + dt);
int iX = objBitmap.Size.Width;
int iY = objBitmap.Size.Height;
int iMaxINTColor = 16777215;
try
{
for (int i = 0; i < iX; i++)
{
for (int j = 0; j < iY; j++)
{
int iPrevColorVal = objBitmap.GetPixel(i, j).ToArgb();
//if (iPrevColorVal < 0)
// iPrevColorVal = iPrevColorVal * -1;
int iNormalizedVal = System.Convert.ToInt32(Math.Pow((iPrevColorVal / iMaxColor), 1)) * iMaxINTColor;
objBitmap.SetPixel(i, j, Color.FromArgb(iNormalizedVal));
}
}
}
catch
{
System.Diagnostics.Debug.Assert(false);
}
DateTime dt2 = System.DateTime.Now;
System.Diagnostics.Trace.WriteLine("Done Normalizing Image:" + dt2);
}
|
|
|
|
|
Hi Safee,
The problem is the call to SetPixel. It's horribly slow. You can use the free .NET library FastBitmap[^] to speed up pixel operations, which will result in your algorithm being much faster.
|
|
|
|
|
|
|
Hey all, i need some help..
I'm using C# language for my project.. I'm having problems with my RTC program..
The program cannot make outgoing calls to the SIP server and VoIP phone..
But the SIP server and VoIP phone can call the RTC program..
This is the part of the code which enables the SIP server to connect with the program..
string bstrProfileXML = "<provision key=\"testing\" name=\"testing\">";<br />
bstrProfileXML += "<user uri=\"sip:102@152.226.136.17\" account=\"\" password=\"\" realm=\"\" />";<br />
bstrProfileXML += "<sipsrv addr=\"152.226.136.17:5060\" protocol=\"udp\" role=\"proxy\" />";<br />
bstrProfileXML += "<sipsrv addr=\"152.226.136.17:5060\" protocol=\"udp\" role=\"registrar\" />";<br />
bstrProfileXML += "</provision>";<br />
oProfile = oClient.IRTCClientProvisioning2_CreateProfile(bstrProfileXML);<br />
oClient.IRTCClientProvisioning2_EnableProfile(oProfile, RTCRF_REGISTER_ALL);
Anyone can help me?? 
|
|
|
|
|
Because your question involves intimate knowledge of this 3rd party RTC component, you may not receive a meaningful answer here. Have you tried posting your question in the RTC manufacturer's forums or support desk?
|
|
|
|
|
No i haven't tried posting it sumwhere else.. only cause the codes i'm using are of C# language..
But i'll try anyways.. Thanks..
|
|
|
|
|
I solved the problem below, what I found was that when I built in data relations into the dataset it created the problem described. How do I build a data relation into my tables without getting the error.
I have a DataSet with 5 tables and a Form with tabs and a grid on each tab to view the data in the DataSet. I have used the add datasource to attach the DataSet DataBinder, and DataAdapter to the grids. However when I try call the form I get the following error message concerning my DataSet:
"Object reference not set to an instance of an object."
Yet the following line is in my code.
this.dataSet_I = new AnalysisCSLib.DataSets.DataSet_I();
Furthermore from other classes I have received the same message and also received a message stating Parent and Child Columns not set or something similar.
Any ideas as to what the problem is here, I would greatly appreciate your help.
Thanks in advance.
Michael
-- modified at 21:59 Thursday 30th August, 2007
|
|
|
|
|
Is DataSets null? If not, is there something in the DataSet_I constructor that's null and being dereferenced?
|
|
|
|
|
|
If DataSets is just a collection, can't you write some code to verify it's initialized before use?
|
|
|
|
|
hi friend's
i want to use parallel programming method for write my project.but i don't know how can i do it.
and i have one question about it:
is parallel programming similar to threading or not.
oh my god im confusing... please help me.
thank you
msma
|
|
|
|
|
Parallel programming in .NET is threading; essentially the same thing.
|
|
|
|
|
Parallel programming is not the same as multi-threading. In a parallel processing system you have multiple processors each with their own memory. These processors can run the same computational process, different processes, or parts of a single process independently and simulataneously without requiring context switching.
Multi-threading allows multiple threads of execution to occur on a single processor and requires context switching to move between the threads.
These are really two completely different concepts.
|
|
|
|
|
Hmm, well, I bow to your ultimate coding supremacy, Scott. But I'm not sure about this part:
Scott Dorman wrote: Multi-threading allows multiple threads of execution to occur on a single processor
That's not true, right? I mean, the OS can schedule threads to run on any CPU or CPU core it chooses. Multi-threading enables one to program code that's run in parallel.
On single-CPU machines, the OS simply switches between the different executing threads (context switching), thus simulating real parallel programs.
Wikipedia says,
"Some people consider parallel programming to be synonymous with concurrent programming. Others draw a distinction between parallel programming, which uses well-defined and structured patterns of communications between processes and focuses on parallel execution of processes to enhance throughput, and concurrent programming, which typically involves defining new patterns of communication between processes that may have been made concurrent for reasons other than performance. In either case, communication between processes is performed either via shared memory or with message passing, either of which may be implemented in terms of the other."
I guess I've always considered parallel programming to mean writing software that executes in parallel. You do this using threads, which I think was the question of the post, after all, he said, "is parallel programming similar to threading or not?"
All that said, I admit I'm not an expert at threading. I'm probably wrong and you're probably right.
|
|
|
|
|