Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
S

Sundeepan Sen

@Sundeepan Sen
About
Posts
20
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • I need to create 150 variable names....need an efficient way of doing it
    S Sundeepan Sen

    Well...yes..but I at the end I figured out that I did not need to create 150 variable names. An array worked fine. Sorry for the newbie question, I am a newbie and basically I've learned not to be afraid of asking "newbie" or stupid questions. That's the way I learn.... once again I apologize f :) r my idiocy.

    C# question

  • I need to create 150 variable names....need an efficient way of doing it
    S Sundeepan Sen

    Hey thanks! I think I fixed it. Sorry for the stupid question...

    C# question

  • I need to create 150 variable names....need an efficient way of doing it
    S Sundeepan Sen

    I am trying to return an array...but I cant do return objectArray; the compiler error: Error 1 Cannot implicitly convert type 'Interactive.Geo.WellLog.Track.cgStackedTrack[]' to 'Interactive.Geo.WellLog.Track.cgStackedTrack' C:\Program Files\INT\Net\3.0.3693.0\Tutorials\WellLog.NET\StackedTrackTutorial\StackedTrackTutorial.cs 177 20 StackedTrackTutorial

    C# question

  • I need to create 150 variable names....need an efficient way of doing it
    S Sundeepan Sen

    heh, cool..so now i'm stuck at how to return all the elements of an array at the end of a method I cant do

    for(int i = 0; i < 20; i++)
    {
    return arrayOfObjects[i];
    }

    I will have unreachable code.

    C# question

  • I need to create 150 variable names....need an efficient way of doing it
    S Sundeepan Sen

    What if its an array of objects? class[] object = new class();?

    C# question

  • I need to create 150 variable names....need an efficient way of doing it
    S Sundeepan Sen

    I need to create 150 variable names. They must be like "varName01" , "varName01" all the way to 150. How do I do this using a for or while loop? thanks! Sundeep

    C# question

  • I need critique on this code
    S Sundeepan Sen

    Thank you for your reply and the link! :-O

    C# data-structures regex

  • I need critique on this code
    S Sundeepan Sen

    Sounds like candy...haha

    C# data-structures regex

  • I need critique on this code
    S Sundeepan Sen

    Oh c'mon my friend...your statement helped me more than any other reading I did today :-D

    C# data-structures regex

  • I need critique on this code
    S Sundeepan Sen

    LOL-i.pop();

    C# data-structures regex

  • I need critique on this code
    S Sundeepan Sen

    Ahh...I understand. Thanks!

    C# data-structures regex

  • I need critique on this code
    S Sundeepan Sen

    It only handles inputs in a*b-c/d format. The code is very basic, written in an non elegant way. I will look at your code, it might give me some insights.

    C# data-structures regex

  • I need critique on this code
    S Sundeepan Sen

    Why are regions in a method a bad idea? I ask this risking sounding like a fool.

    C# data-structures regex

  • I need critique on this code
    S Sundeepan Sen

    lol...I know exactly which variable name you are referring to.

    C# data-structures regex

  • I need critique on this code
    S Sundeepan Sen

    Just got back into writing code after 10 years. This is a infix to postfix converter. Can someone please critique this... thanks

    using System;
    using System.Collections;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Collections.Generic;

    namespace Infix2Postfix
    {
    public class Program
    {
    static void Main(string[] args)
    {
    #region variable declarations
    //declare and initialize the string to accept an expression in infix notation
    String stringInfix = "a+b/c-d";

            StringBuilder SbPostfix = new StringBuilder();
            Stack<char> stackGeneral = new Stack<char>();
            Stack<char> stackOperator = new Stack<char>();
            char\[\] tempArray = stringInfix.ToCharArray();
    
            Array.Reverse(tempArray);
            Regex regexAlphaNum = new Regex("\[a-zA-Z0-9\]");
            char temp;
    
            #endregion
    
            #region logic
    
            foreach (char ch in tempArray)
                stackGeneral.Push(ch);
    
            foreach (char ch in stackGeneral)
            {
                if (regexAlphaNum.IsMatch(Convert.ToString(ch)))
                    SbPostfix.Append(ch);
                else if (stackOperator.Count == 0)
                    stackOperator.Push(ch);
                else if (stackOperator.Count != 0)
                    switch (ch)
                    {
                        case '+':
                            temp = stackOperator.Peek();
                            if (temp == '\*' || temp == '/')
                            {
                                while (stackOperator.Count > 0)
                                    SbPostfix.Append(stackOperator.Pop());
                                stackOperator.Push(ch);
                            }
                            else
                                stackOperator.Push(ch);
                            break;
                        case '-':
                            temp = stackOperator.Peek();
                            if (temp == '\*' || temp == '/')
                            {
                                while (stackOperator.Count > 0)
                                    SbPostfix.Append(stackOperator.Pop());
                                stackOperator.Push(ch);
                            }
                            else
                                stackOperator.Push(ch);
    
    C# data-structures regex

  • Inheritance/Polymorphism [modified]
    S Sundeepan Sen

    This is great, I like the humor involved too. I am saving this reply as a PDF on my computer. Thanks again!

    C# csharp oop question learning dotnet

  • Inheritance/Polymorphism [modified]
    S Sundeepan Sen

    Its a "Microsoft Press" book for the 70-536 cert exam...this guy better be a good technical writer lol!

    C# csharp oop question learning dotnet

  • Inheritance/Polymorphism [modified]
    S Sundeepan Sen

    This is the paragraph that threw me off: "Another benefit of inheritance is the ability to use derived classes interchangeably, a concept called polymorphism. For example, there are five classes that inherit from the System.Drawing.Brush base class: HatchBrush, LinearGradientBrush, PathGradientBrush, SolidBrush, and TextureBrush. The Graphics.DrawRectangle method requires a Brush object as one of its parameters however, you never pass an object of the base Brush class to Graphics.DrawRectangle. Instead you pass an object of one of the derived classes. Because they are each derived from the Brush class, the graphics.DrawRectangle method can accept any of them. Similarly if you were to create a custom class derived from the Brush class, you could also pass an object of that class to Graphics.DrawRectangle. "

    C# csharp oop question learning dotnet

  • Inheritance/Polymorphism [modified]
    S Sundeepan Sen

    So if I wrote

    class Farm
    {
    public void Pet(Cow chicken){}
    }

    I can access both Foo and Moo? But if I wrote

    class Farm
    {
    public void Pet(Animal man){}
    }

    then I can only access the Foo method? Lol..nice example though....clarification is needed if you don't mind :-D

    C# csharp oop question learning dotnet

  • Inheritance/Polymorphism [modified]
    S Sundeepan Sen

    Hello all, my name is Sundeepan and I am new to this board and to coding as well. To train myself and get familiar with OOP concepts using the C# language I am reading, "Microsoft .NET Framework - Application Development Foundation" book by Tony Northrup. I am finding this book very informative. I do have a question that I was not able to find an answer to by querying Google. The question is as follows: If a method requires an object as one of its parameters why should one not pass an object of a base class, instead one must pass an object of the derived class? I understand that this might be a foolish question, but I am at a very early stage of my learning, any help would be appreciated. Metaphors are equally as helpful as a technical answer. Regards Sundeepan http://sundeepinthought.blogspot.com

    modified on Friday, February 5, 2010 12:32 AM

    C# csharp oop question learning dotnet
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups