|
Epoque wrote: Graphics Root = Parent.CreateGraphics();
What the use of that? Normally that method is dodgy in itself, but you call it and then never bother to use it!
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
I am storing employee object inside a List<employee>. I am sorting the list based on employee Age. To do that I implemented a method from IComparable intereface. But when i debug the _list.Sort() i do notice list items are sorted out.
So my question is who's relocating/reindexing elements inside the list and how is doing?
public int CompareTo(object obj)
{
if (obj is Employee)
{
int ans = Age.CompareTo(((Employee)obj).Age);
return ans;
}
return 0;
}
|
|
|
|
|
netJP12L wrote: So my question is who's relocating/reindexing elements inside the list and how is doing?
By looking at the source of List<T> in .NET Reflector[^], internally Array.Sort is called with the comparer, which in turn does some sort of QuickSort algorithm.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi,
I would have to see more of your code to tell for sure what goes wrong, but one way your sorting would fail is if the objects in the collection are not Employee instances; the "is Employee" test would fail resulting in a "return 0" which means all objects have the same order precedence. You might consider adding a log statement, a MessageBox or a breakpoint in front of the "return 0" statement.
|
|
|
|
|
if i need to use variable form other class & other file but same namespace & project
how to use that variable?
example:
--file1--
class A
{ public string a = "aaa"; }
--file2--
class B
{ if(a = "aaa") {}}
please hint to me...
thank so much...
|
|
|
|
|
class B
{
public void SomeMethod()
{
if (A.a = "aaa")
{
DoSomeStuff();
}
}
} The A class needs to be public for this to work if the classes have different namespaces.
The A class can also be internal if the namespace of the two classes is the same.
modified on Thursday, November 27, 2008 1:50 PM
|
|
|
|
|
This is so rudimentary that you really need to buy a book and work through it, before you try to write any code that's not a book example.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi,
You need to create an instance from class A so you can use its public members.
In this case you should write:
public class A
{
public string a = "aaa";
}
public class B
{
A Ainstance = new A();
if(Ainstance.a = "aaa") {}
if (Ainstance.a == "aaa") { ;}
}
If variable a (or any member in your class) is static, you can use it from class B without creating an instance.
Just like:
public class A
{
public static string a = "aaa";
}
class B
{
if(A.a = "aaa") {}
if(A.a == "aaa") { ;}
}
Hope can help
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
modified on Thursday, November 27, 2008 4:22 PM
|
|
|
|
|
your tip can help me
thank so much...
|
|
|
|
|
You're welcome
I died as a mineral and became a plant,
I died as plant and rose to animal,
I died as animal and I was Man.
Why should I fear? When was I less by dying?
-- Rumi[^]
My blog
|
|
|
|
|
use internal variable to access it from same namespace.
|
|
|
|
|
I learned C++ in high school and college. After I got out, I spent a little time working with ASP .NET. Then, for the last two years I have been a PeopleSoft developer.
I've seen a few posts with some generic advice, but I was wondering if anyone had any specific advice for learning C# and the ASP .NET framework. I have a good idea of programming concepts in general, so I'm really looking for something that focuses specifically on getting people with prior development experience into C# and ASP .NET.
Websites would be great, but I don't mind dropping some cash on a book or two.
Any help would be greatly appreciated.
Thanks,
John
|
|
|
|
|
*cough* ebookshare.net *cough*
|
|
|
|
|
Thousands if not billions of programmers have gone this way: Coming from C/C++ and going to C#/.NET.
Just take your Google/Altavista/Yahoo/whatever and search for it. I'm sure you'll find tons of materials/free eBooks...
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Thomas Weller wrote: billions of programmers
O no it's the invasion of the programmers
|
|
|
|
|
Well I think 1,000,000 persons are not that much relative to the whole universe.
So I really think they are amongst us - strange behaving ever-pale people eating/drinking only junk-food/coffee. Better beware, they might be also after you.
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Thomas Weller wrote: Well I think 1,000,000 persons
isn't billion 9 zero's?
Thomas Weller wrote: Better beware, they might be also after you.
*puts on foil hat*
Nooooooooooooo, that's it I'm locking myself in my house never to be seen again.
|
|
|
|
|
Tom Deketelaere wrote: isn't billion 9 zero's?
You're right. I confused something. So it's really an invasion. I will lock myself, too...
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
|
Started skimming this, and so far it seems exactly like what I need.
I've found a few sites just by searching, but nothing as specific as this.
Thanks.
|
|
|
|
|
just.an.imbecile2 wrote: Websites would be great
C# articles on this site are really good, if you know where to look. I came from a C++/Java background, and I owe credit to this site for most of my learning of C#.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I can attest to that also. CP is one of the better sites to begin learning. The articles range on pretty much any topic you are looking for, and if they don't the forums can cover what you are missing.
|
|
|
|
|
EliottA wrote: CP is one of the better sites to begin learning.
Yup. Even for some of us veteran programmers.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I was a VB-based ASP.NET developer using MC Access and MS SQL 2000. I learned C# 2005 and C#-based ASP.NET 2.0 using MS SQL 2005 through two excellent books: Learning C# 2005 2nd Edition from O'Reilly and Beginning ASP.NET 2.0 Databases from Apress (focusing on ASP.NET/C#2005/MSSQL2005). I downloaded the Microsoft Visual C# 2005 Edition for free, until I had the funds to update my copy of Visual Studio to 2005 from an earlier version.
To learn the most recent versions of ASP.NET and C#, in addition to a firmer understanding of OOP, I have been reading Beginning C# 2008 Objects and Pro ASP.NET 3.5 in C# 2008, both by Apress.
I strong recommend the O'Reilly Learning C# 2005 or more recent versions for a basic understanding of C# concepts.
Regards,
Gary A. Stafford
Regards,
Gary
|
|
|
|
|
Hi all,
I have a web service which I want to implement on multiple servers and which can communicate with each other. (Meaning reusing the same web service on the different servers) I am currently using a proxy class which i created with wsdl.exe in order to call the web service from any other component (web page, windows service, etc). That works fine, giving it the Url. Now the problem I have is communicating between one web service and another, as when I add the proxy class to the web service, in order to create an instance of a webservice and give it a URL, the namespaces, functions etc already have definitions for them.
To simplify:
Web page to web service communication
Web page has web service proxy class, an instance of web service is created, a url is given and the web service methods called - works fine
Web Service to Web service communication
I add the proxy class to the web service and it gives me errors, namespace already defined, etc etc, obviously because the proxy class is of the same web service I am trying to add the class to.
So effectively my question is this. In order to reuse my web service over multiple servers and call methods between these web services, what do I have to do?
Thank you very much in advance for any help
|
|
|
|