|
Thanks!
Nick Seng (the programmer formerly known as Notorious SMC)
God, I pity me! - Phoncible P. Bone
|
|
|
|
|
Hello friends,
I am trying to add a copyright symbol to a Label or TextBox within my About dialog. What I did was copying it from MS Word doc and paste it into Label or TextBox controls. It gave me this wierd char "ã", instead of the Copyright symbol.
Thanks so much
Khang Nguyen
|
|
|
|
|
private void button1_Click(object sender, System.EventArgs e)
{
string str="i'm some text " + Convert.ToChar(169);///169 is copyright symbol
MessageBox.Show(str);
string strString="now i'm text with registered " + Convert.ToChar(174);///174 is registered symbol
MessageBox.Show(strString);
}
just convert to char with the numbers and you will get the symbols , or paste them from character map .
switch(twinsOnWay)
{
case ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
break;
|
|
|
|
|
Thank you so much for the tip, Dynamic! Have a great day.
Khang
|
|
|
|
|
Hi!
I created an excel C# COM Add-in with Visual Studio (Other Projets\Extensibility Projets\Shared Add-in).
So, I would like to know how to add programmatically my add-in to COM Add-Ins dialog box (Tools\Add-In) of excel.
I thought that the automatic registration, after building my add-in, adds it automatically to COM Add-ins dialog box but it doesn't seem.
|
|
|
|
|
|
Jan Gray of the Microsoft CLR Performance Team wrote an excellent article
titled "Writing Faster Managed Code: Know What Things Cost"
(http://msdn.microsoft.com/library/?url=/library/en-us/dndotnet/html/fastmanagedcode.asp).
This article has motivated me to seek answers to the following questions.
Any replies from the group are appreciated. The questions probably
(hopefully) have very simple answers.
Between these two foreach loops, is there any difference in performance,
safety or correctness? (All examples are in C#)
1. declare and initialize new type in body of loop:
foreach (T t in tList)
{
A a = new A(t.ID);
//do more work
myCollection.Add(a);
}
2. declare new type outside loop, and 'new' it inside loop:
A a = null;
foreach (T t in tList)
{
a = new A(t.ID);
//do more work
myCollection.Add(a);
}
I would think #2 is preferrable, but I see that most C# examples use the
style of #1. In fact, I often see the following in C# examples:
T MyMethod()
{
T t = new T();
return t;
}
This would be a big problem in C++, but in C# the garbage collector makes it
OK. But does that mean it's a good practice? Why is it so common in
examples?
Finally, I'm curious if there are any performance differences between the
following two loops. The reason I ask is that I'm one of those people who
(prior to reading the above mentioned article) pulled the array.Length
property out of the loop header in the interest of avoiding extra calls to
get the length value. I now understand why that is not optimal. I'm curious
if any processor optimizations or compiler optimizations make choice 1 equal
to or better than choice 2 below:
1. repeat same property calls inside a loop:
for (int i = 0; i < 10; ++i)
{
DoAlgorithm1(i, T.x);
DoAlgorithm2(i, T.x + y);
DoAlgorithm3(i, T.x + y);
}
2. pull property calls outside the loop:
double x = T.x;
double w = x + y;
for (int i = 0; i < 10; ++i)
{
DoAlgorithm1(i, x);
DoAlgorithm2(i, w);
DoAlgorithm3(i, w);
}
All input is appreciated!
|
|
|
|
|
Optimization is fun, but not easy... Not a single concept is always true. Combine this with multi-threading (think about the SMP machines and the newer hyperthreading processors) and optimization is almost a try and guess game, although some basic techniques do help a bit.
MtnBiknGuy wrote:
I would think #2 is preferrable, but I see that most C# examples use the
style of #1. In fact, I often see the following in C# examples:
#2 does one inutile assignment, #1 don't. But to solve this doubt, remove the "= null" (BTW, this isn't a good practice, as it defeats some useful compiler warnings) and just look and the generated code with ILDASM. I bet they generate exactly the same IL, as the maximum stack space is allocated on the method's entry.
MtnBiknGuy wrote:
Finally, I'm curious if there are any performance differences between the
following two loops.
If the JIT is as good as MS sells it, #1 could even be slightly faster than #2. MS says JIT does common subexpression elimination and code motion of loop invariants, which is exactly what you did, but sometimes the JIT could even do it without the need for another local variable (imagine that you have several loops).
Notice that the JIT sometimes will do a better job than you. If T.x is a virtual property, and not a field, you can't safely do what you showed (T.x could have a side effect, e.g. incrementing a counter to keep usage count). Although sometimes the JIT hasn't all the info or time it needs to make all the possible optimizations, it has all the info it needs to always act safely.
On a side note, you should make all of your timings on Release builds, because the optimizer is disabled on the Debug builds.
Kant wrote:
Actually she replied back to me "You shouldn't fix the bug. You should kill it"
|
|
|
|
|
New Release
***********
XMLBooster has been released for C#. It includes numerous features
for more efficient integration of XML in C# applications.
By using native code generation rather than a generic approach,
XMLBooster guarantees top notch performance for demanding
transaction-based applications:
- 5 to 50 times faster than generic parsers
- Reduced memory footprint, can deal with even the largest inputs
- Improved schema support
- Support for mixed content and permutations
- Numerous options to tune the code generation process to your own needs
- Generates static parsers in C#, C, C++, Java, COBOL, Delphi, Ada
- Applications can be deployed royalty-free
- Licences start as low as $675
- Freely available XMLBooster Lite version
http://www.xmlbooster.com
|
|
|
|
|
<a TITLE="See my user info" href=http:
|
|
|
|
|
Parse this[^]!
Kant wrote:
Actually she replied back to me "You shouldn't fix the bug. You should kill it"
|
|
|
|
|
Daniel Turini wrote:
Parse this[^]!
Good one
-Nick Parker
|
|
|
|
|
I have a remote object which is returning an oledbDatareader from a method.
But the client application can’t read the data.
1. Is it possible to do this?
2. Is it possible to get an oledbConnection out from a remote object?
3. Any other way to do this?
Gaurika Wijeratne. // www.gaurika.com
|
|
|
|
|
1. No, a reader should never be returned from any method.
2. No, same principle as above. If it aint yours, you cant have it.
3. Yes, datasets and webservices.
<a TITLE="See my user info" href=http:
|
|
|
|
|
Hello,
It's me again......HELP
I am using the .NET IDE.
I am wanting to get a little information and insight about the best approach to accomplish something. I am wanting to integrate an MP3 recorder into an application. It needs to work simply. I want to pass a filename for the mp3 file, click the record button, when done click the stop button, then click the save button. No option to rename it. The program will handle the naming of the file. This will be used by a doctor and needs to be as simple as possible. The only user interface that will need to be implemented in the mp3 player/recorder should be only what a tape recorder is capable of. What is the best route to use? Are there some components in .NET that will enable any of this? Is there any API function call that can be used? A utility to integrate? The reason it needs to be MP3 is because of filesize. We will be dealing with up to 15 minute voice recordings. Any starting suggestions would be greatly appreciated.
Thanks,
Kendal
|
|
|
|
|
You can embed the WindowsMedia player control into your application and customise it however you like...
Windows Media Player SDK[^]
HTH
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
The windows media player will not record MP3. Unless there is something I don't know, which is very possible
|
|
|
|
|
I could be wrong but I'm sure I've seen something about the Media Player SDK having an Encoder API which allows you to use digital capture devices to create media files. It's not exactly my field of expertise so apologies if I have it all wrong.
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
shaunAustin wrote:
I could be wrong but I'm sure I've seen something about the Media Player SDK having an Encoder API which allows you to use digital capture devices to create media files.
Take a look at the Windows Media[^] section of MS.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
I'm pretty sure I have seen an article on CP about how to build these nifty toolbars that you can add to your Start Taskbar. You know the bar with the big green Start button on it? Well, if you right-click, you can add toolbars such as the Address, Links, Media Player, etc. Well I want to create such a toolbar.
I found this url[^] that closely looks like what I want to do, but I'm pretty sure I saw a different article about it.
Can anyone else dig it up?
Thanks.
R#
|
|
|
|
|
Is this[^] the one
- Kannan
|
|
|
|
|
:-DWhoow, finally got back to this (its a pet project)
And YES, YES, YES... thats the one;
again CPians deliver, I thanks you so very much. For some reason, I did not find it using the search, and I did look in that section, but probably I was already looking cross-eyed... this site just has too much good info.
thanks again,
R#
R# (well maybe not as # anymore as I used to be)
|
|
|
|
|
Hi. I really need some help on this.
I need to serialize objets into one of the following formats
<myclass>
<member1>somevalue
<member2>option1
<member3>someothervalue
or
<myclass>
<member1>somevalue
<member2a>option2a
<member2b>option2b
<member3>someothervalue
I have been trying many things, yet I have not found something that works.
I really need some insights. If anyone knows how to do this, please tell me. I don't even know what is the best way of designing myClass so as to achieve this.
|
|
|
|
|
Rocardo..
Do you think you could either replace your angle brackets with the code or re-post as plain text so that we can all see what it is you're trying to do...
Cheers
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
Sorry. Here it goes again
Hi. I really need some help on this.
I need to serialize objets into one of the following formats (it may be one or the other for two different objects of type myClass)
<myClass>
<member1>somevalue</member1>
<member2>option1</member2>
<member3>someothervalue</member3>
</myClass>
or
<myClass>
<member1>somevalue</member1>
<member2a>option2a</member2a>
<member2b>option2b</member2b>
<member3>someothervalue</member3>
</myClass>
I have been trying many things, yet I have not found something that works.
I really need some insights. If anyone knows how to do this, please tell me. I don't even know what is the best way of designing myClass so as to achieve this.
|
|
|
|