Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~18.4K People Reached
Favorite Tags

22 Posted Topics

Member Avatar for shockwave_05

Your goal is to define a datatype Shape that can answer the question "Get Area?". You need to define the method getArea in each of the subclasses and declare the abstract method in the base class Shape. By declaring the abstract method in Shape, you're saying to the rest of …

Member Avatar for wiggles29
0
5K
Member Avatar for ddanbe

Why are you passing the DateTimes by reference to DaysAliveCalculation? I can't see any reason for this. Also, DaysAliveCalculation would be much more reusable if it returned an int. By returning a string, you're suggesting that the function is returning something sneaky.

Member Avatar for ddanbe
0
763
Member Avatar for sahasrara

Thanks for making this posting. In mytan and mycot, not all paths return a value. What do you expect the function's behavior to be then? I would return NaN. Also those functions unnecessarily recalculate mycos and mysin once. Your lines [code] if(y<0) z = myfabs(y); else z = y;[/code] are …

Member Avatar for subtercosm
0
547
Member Avatar for subtercosm

C# delegates make it really easy to implement the visitor pattern. Instead of making an abstract class and Visit methods that accept a single argument of that class's type, let your Visit methods accept multiple arguments. So instead of a visitor class with N abstract methods, your Visit methods take …

0
149
Member Avatar for subtercosm

You could implement recursive algorithms in ways that avoid risking stack overflow, i.e. by manually implementing a stack of variables or a stack of states. It is better to implement combinators that take pieces of recursive definitions and do this work for you. It is particularly easy to do in …

0
116
Member Avatar for sciwizeh

There's no need to write [icode](int)(Math.random()*100)%3[/icode]. Just write [icode](int)(Math.random() * 3)[/icode].

Member Avatar for sciwizeh
0
567
Member Avatar for ddanbe

It is much better to use using blocks for your Bitmap and Graphics objects. [code] using (Bitmap bmap = new Bitmap(ImageBounds.Width, ImageBounds.Height)) using (Graphics G = Graphics.FromImage(bmap)) { G.CopyFromScreen(_TopLeftPt, Point.Empty, ImageBounds.Size); bmap.Save(Fname, ImageFormat.Bmp); }[/code] That way, if an exception occurs, the objects will be properly disposed of.

Member Avatar for ddanbe
0
3K
Member Avatar for ddanbe
Member Avatar for ddanbe
Member Avatar for vckicks
Member Avatar for subtercosm
0
3K
Member Avatar for JMChurch25

I have not experienced what you described, but I have several friends who had some sort of problem or another of that kind. I had one who was really struggling, when he asked me about some problem he was trying to solve. I asked him why he didn't just figure …

Member Avatar for Rashakil Fol
0
158
Member Avatar for jcasti1226
Member Avatar for fomagnoma

I'm not sure what your problem is. You described the algorithm you want. What is stopping you from implementing it?

Member Avatar for subtercosm
0
148
Member Avatar for nuninio

If you're that worried about StringBuilder reallocating its buffer, just use something to build your strings that doesn't require any reallocation at all.

Member Avatar for subtercosm
0
367
Member Avatar for msalman

Your function is creating a polynomial and modifying that. It is not modifying the object on which it was called. Your latter example, [icode]polynomial p = polynomials[j];[/icode], actually calls the copy constructor to initialize p. The other plausible alternative would for a zero-argument constructor to be called to initialize p, …

Member Avatar for StuXYZ
0
446
Member Avatar for Mike Savino
Member Avatar for kbshibukumar
0
84
Member Avatar for delerium12345
Member Avatar for zaraeleus

[QUOTE=stephen84s;797998]Now I would like you to also go through the [URL="http://java.sun.com/docs/codeconv/"]Sun Coding Conventions[/URL] for Java so that you can name your classes and methods appropriately.[/QUOTE] You should skip this. You already have enough to worry about, and spending mental energy worrying about 11 chapters of arbitrary rules at this stage …

Member Avatar for stephen84s
0
182
Member Avatar for C# beginner

[QUOTE=Diamonddrake;798465] <rant> it can't be stressed enough people. I think it should be a rule. Google before thread! I say all forums should set up to check for a google cookie, if it isn't there, then the submit button on the new thread page automatically opens a new browser window …

Member Avatar for Diamonddrake
0
161
Member Avatar for NexusX

You have two problems. First, the first character of a string is a char, not a string, so your variable first_letter should be of type char, not string. Your code is not compiling because the string type's indexer returns a char. Second, your code won't work at runtime, and I'll …

Member Avatar for WaltP
0
2K
Member Avatar for seanl1

[QUOTE=seanl1;797902]I suppose it's a right of passage to earn the degree.[/QUOTE] You mean a rite of passage. Also, it's the most important or second-most important class you'll take. What version of C# are you familiar with? If you answer in the next few minutes, I'll tailor my answer to [icode]Math.Max(2.0, …

Member Avatar for seanl1
0
303
Member Avatar for lovely_aly

You can't just put variables and strings next to one another. You need to concatenate them with the + operator: [icode]newValue + " + " + i[/icode]

Member Avatar for lovely_aly
0
100

The End.