|
because it is wrong. consider the following set of string pairs:
a,bd
ab,c
and try sorting them the right way and the concatenated way.
It would be right if you were to use string1 + charMax + string2 where charMax is a character that sorts last in the character collection.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Suppose name1 is the empty string..?
edit: ok you changed it
modified on Thursday, May 27, 2010 9:47 AM
|
|
|
|
|
Thank you all for the reply.
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
This article[^] covers the regular ways of sorting; it should be easy to understand and offer good performance at the same time; it does not offer the latest LINQ fancy things.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
How can I get event action (especially mouse events) on windows form use another program?
For example; User darw rectangle on form use with "Program1". Another program (may be windows service) detect user action in "Program1".
Main problem is "Program1" and other program (windows service) in different application domain.
How can I get event from another program?
Thanks...
|
|
|
|
|
One would need to tell the other.
|
|
|
|
|
There is no communication between the two processes. Your service code will never know the user did anything in the other application. Hooking the message pump of another application and interpreting what the user sees and is doing with the mouse is VERY complicated and is, depending on your skill level, going to be prone to failures.
I know, you asked about events. "Events", in the method that you're probably thinking of using, do not cross process boundries. There is no way for a message pump in one application to raise an event in another app.
The application that the user is clicking around in would have to handle it's own, for example, Click event, then setup and make an interprocess call to your service, or, just send the service process a message over some communication line you've setup in both applications.
The best option would be, if you wrote both applications, to setup a communication system between the two apps so the application the user is using can tell the service what's going on and what the user is doing.
It is always far easier, and more reliable, for an application to tell another one what it is doing than it is for an application to try and figure out what is going on in another application by "watching" it.
|
|
|
|
|
Yeah, that's what I said.
|
|
|
|
|
Hello,
I am using that code snippet to print a word document out of my application.
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @"c:\test.doc";
startInfo.Verb = "printto";
startInfo.Arguments = strPrinterName;
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.UseShellExecute = true;
startInfo.ErrorDialog = true;
System.Diagnostics.Process.Start(startInfo);
It works fine but:
The Problem is, that word pops up, print and quit.
Is there an additional parameter to set, to tell word to do it in hidden mode like requested
startInfo.CreateNoWindow = true;
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
to print silently in the backgound ?
Thanks Frank
|
|
|
|
|
Hi Experts
i am working in Winform using VS 2005 and SQL Server 2005 in C#.NET.
i have a project which have import data from Excel Sheet.
but the data in Excel sheet is very Large Scale like 350000 Record.
Then it take time to import the data from excel sheet.
then can you suggest me how to Imports Such type of Bulk data .
Thank u
Dinesh
|
|
|
|
|
Did you search on the internet for a solution?
I did and found this.
My signature "sucks" today
|
|
|
|
|
But i want to import Bulk data in Lacks and if i want to paging
apply on importing data then have you any idea how i apply paging in
import data in select Query.
Thank u
|
|
|
|
|
Use DTS or SSIS transformation. It generally finishes the work in seconds. Build is easy too.
Jack Sparrow
--------------------------------------
Defeat is not the worst of failures. Not to have tried is the true failure.
|
|
|
|
|
How can i compare two strings using Soundex in c#.
Thanks,
Krishna
|
|
|
|
|
A quick search of Code Project would have found you this[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
hello,
I have developed an desktop app and i am printing barcodes at some stages. I am having issue printing the & sign. As the barcode font does'nt read this character. On furthur search i come to know there are 43 characters that the barcode font accepts and the & sign in not included in this list of 43 characters. Any ideas how can i make use of & sign and print its barcode..?
Thanks in Advance,
Asfand
|
|
|
|
|
Asfand wrote: On furthur search i come to know there are 43 characters that the barcode font accepts and the & sign in not included in this list of 43 characters. Any ideas how can i make use of & sign and print its barcode..?
If it's not there, then you can't use it. Adding it would be impossible, as all other barcode-scanners wouldn't know about the new character.
What type of barcode[^] are you using to encode your information?
I are Troll
|
|
|
|
|
You can only print symbols which are within the character set for any particular barcode. The simpler codes support only numerics, and so forth, in order to compact the physical size of the printed code. Try switching to EAN128 (or code128) which supports a better range of characters: See Here[^] That site also gives some detail on other barcode formats.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
maybe replace & by and then?
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
modified on Thursday, May 27, 2010 9:45 AM
|
|
|
|
|
|
|
i am not able to achieve this task in C#, i m new to this , please help
|
|
|
|
|
Use a Singleton-like approach. Make the constructor private and add a static method. In this method return a new instance of the class when a static counter is less than 3 (starting with 0). Then increment the counter.
If the counter is >2 do what ever you like to do if the third instance is delivered.
Small example:
<br />
public class MyRestrictedClass<br />
{<br />
private static int instanceCounter = 0;<br />
private MyRestrictedClass()<br />
{<br />
}<br />
<br />
public MyRestrictedClass GetNextInstance()<br />
{<br />
if(instanceCounter<=2)<br />
{<br />
instanceCounter++;<br />
return new MyRestrictedClass();<br />
}<br />
throw new Exception("Maximum number of instances exceeded.");<br />
}<br />
}<br />
Best regards
Jens
When in trouble,
when in doubt,
run in circles,
scream and shout
modified on Thursday, May 27, 2010 3:18 AM
|
|
|
|
|
thank u Jens,, i m facing another problem in Socket programing in Vb.Net, i had developed a Server which recieve data from clients and forward to others, it was a multi threading application but now it stuck up , it was developed using a VB Winsock wrapper, now i want to develop it using .Net sockets, can u help me in this
|
|
|
|
|
Hi all,
In my application I am creating a word document using a default template doc and later adding dynamic content, this is working fine. My problem is now i am askd to create multiple copies of the same document as single document, for example in my word document i have one page with some content, based on the number of copies, the same page should be repeated in the same document and as single document (strictly as single document only, i tried by creating multiple documents and finally merging all the doc as single, this solution was rejected). To say when we take print out, we specify number of copies, so that we get that number of hard copies, i want the same logic. Binarywriter/streamwriter is not helping me, because my document contains images, please help me to solve this. Give me some URL or samples.
Kindly execuse if i am not clear in my point.
Thanks in advance.
Know is Drop, Unknown is Ocean
|
|
|
|