|
troubled one wrote: the latest number of the counter
You ought to persist this value to a permanent data source across application sessions. Did you consider the registry?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Have a question.. I'm currently working on a project that's all about
updating excel documents with a current one through a program. since we're
dealing with spreadsheets that have a huge number of cells (some more than
100 sheets) I have to do everything through the program to make it faster..
I have to name the columns alphabetically just like excel does...
e.g. 1 = A, 702 = ZZ, 27 = AZ, so on and so forth..
now I got up to ZZ with one go.. forgive me if I show my solution that isn't that good...
and if it's not optimized then forgive me as well since I'm still new at it.
string[] alphabet = new string[] { "A", "B", "C", "D", ............ , "Z" };
string[] alphabet2 = new string[] { "Z", "A", "B", "C", "D", ...... , "Y" };
//you'll understand why later...//
int input = 0;
int otherletter = 0;
if (input < 27)
{
output = alphabet[input - 1] //since the index starts at 0//
console.writeline(output);
}
else if (input > 26) //AA - ZZ or 27-702
{
otherletter = input / 26 //just get the whole number no
fraction..left letter//
input = input % 26; //modulus for the letter on the right//
output += alphabet2[input];
output += alphabet[otherletter - 1];
console.writeline(output);
}
so for 702 (which is ZZ)
input = 702
input = 702 % 26 (which is zero...that is why Z is at index zero in alphabet2)
otherletter = 702 / 26 = 26.something (which uses the alphabet string array)
that isn't very nice to look at but it gets the job done.. the problem now
is what to do beyod 702? I already have a tentative solution.. which includes
using the number 702... it's almost the same as this solution just add
another "else if" but the problem is when I get to 18954 which is "ZZZ" and
so on and so forth?
does it really mean I have to make another else if everytime a letter is
added as the number goes higher? or is there a better logic other than my
approach? I'm sure there is... anybody out there? I don't care if the answer
isn't in C#... I'll just have to get the idea then maybe I could use it..
thanks.. sorry for the poor code work
|
|
|
|
|
|
ummm... thank you for the link.. but I don't get it? I was lost with the link that you gave me. I need something that has to do with Excel column name generation... or maybe I just didn't get it.. could you please share a little light on the link you gave me?
|
|
|
|
|
Can you not treat this as a Base26 number, with "digits" "A" to "Z"?
|
|
|
|
|
now that has to be the best reply I've ever had! hehe thanks! base26 definitely was the answer... for people having the same problem.. I've stumbled on a very interesting piece of base26 example.. though it's not exactly like excel.. if you play with it.. you'd still get what you want.
here's the link..
http://en.wikipedia.org/wiki/Hexavigesimal[^]
|
|
|
|
|
Can i get a source code of an RFID Project in c# ?
|
|
|
|
|
|
Yes, may not be over here in this forum
Once you have mastered the ability to turn yourself invisible at will, and to deflect bullets with your hair, you will be ready to come back here to the lounge and post programming questions.Only at this point will you be able to dodge the fireballs that are going to come your way. - Pete O'Hanlon
|
|
|
|
|
There's no standard project with RFID. The RFID readers from different producers may have a different instruction set...so if you create a project based on some reader, on another one it may not work...since it won't recognize the instructions you send to it.
I will use Google before asking dumb questions
|
|
|
|
|
Please do not post multiple times or cross post across forums. I would suggest you give a reading on Forum Posting Guidelines at http://www.codeproject.com/scrapbook/forumguidelines.asp[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Source code of a RFID project in c#
|
|
|
|
|
Right Click > View Source
Once you have mastered the ability to turn yourself invisible at will, and to deflect bullets with your hair, you will be ready to come back here to the lounge and post programming questions.Only at this point will you be able to dodge the fireballs that are going to come your way. - Pete O'Hanlon
|
|
|
|
|
.CS wrote: Right Click > View Source
A sweet answer.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
i face this problem below when i try to open the 'windows form' from someone project downloaded from here.. may i know how to solve this..?
One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. <br />
<br />
The class OutlookBar can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again. <br />
Hide <br />
<br />
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager manager)<br />
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)<br />
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)<br />
at Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
|
|
|
|
|
Read the error. Make sure that in the designer file, the form's class is the first one in the file.
I will use Google before asking dumb questions
|
|
|
|
|
angels777 wrote: The class OutlookBar can be designed, but is not the first class in the file. Visual Studio requires that designers use the first class in the file. Move the class code so that it is the first class in the file and try loading the designer again.
The exception itself seems to have enumerated a solution for you.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
How can I create a socket to a server if the client is behind a proxy server? Is there any built-in proxy server support in C# .net? I want to implement a chat application and is not only a HTTP-based application.
If anybody have some idea about this please help me. Thanks in advance.
(post a code)
|
|
|
|
|
|
Hi,
I have created a apllication in VS 2005 . In that application i have used a dll named ruler.dll , i have downloaded this dll its for a graphical ruler. So when i am running this application its working fine on my pc . whenever i am installing at client side its giving an error . So plz tell me how to deploy dll will it need to be added to gac or any strong name has to be created for that..i dont have any idea abt strong name and GAC plz if any one can give me a step wise details of doing this thing i will be very much thankfull
regards
sindhu tiwari
Allways Innovative
|
|
|
|
|
No need to worry about it. In your setup project add the DLL file and set the folder path = Application folder.
And set the Register property to vsdraCOMRelativePath.
So this file will register on clients machine and your project directory Hope this helps
Regards
Pankaj Joshi
If you want to shape your dreams into reality, please wake-up...
|
|
|
|
|
sindhutiwari wrote: at client side its giving an error .
What is the error?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
hi. how do i create a open &close split container? which mean section A and section B...where i can allow to hide the section A... is that using split container plus with some mouse click event to close the section A ? or using collapse function???
|
|
|
|
|
|
Hi,
Anybody knows how to display english characters to hindi charactres?
If has any source code to do it will be ok.
Suppose the word is "do sal" it should be viewable as दो साल in hindi.
Manish
|
|
|
|