User Profile

Collapse

Profile Sidebar

Collapse
vipin sharma
vipin sharma
Last Activity: Nov 30 '09, 04:16 PM
Joined: Jul 21 '09
Location: delhi, india
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • hi john

    Thanks for reply. New method of derived class works only when they are accessed with derived class object, however if we use base class object to store derived class object then we wont be able to use new methods.

    My problem got solved. I was not taking into account that netbeans by default uses free design as layout manager. So i derived a class using JPanel, override its paintcomponent method. I changed layout...
    See more | Go to post

    Leave a comment:


  • how to draw graph in netbeans JFrame using data from program.

    hello all,
    i am using netbeans ide for development. I want to display a graph on screen. After some search on google i found that we can create a graph by following steps:
    1. extending a class with JPanel and overriding its paintcomponent( ) method.
    2. now create a panel using palette and open its properties.
    3. in property window go to code section and write new derivedclassnam e() in Custom creation code.

    ...
    See more | Go to post

  • vipin sharma
    replied to how to restart by using terminal?
    To reboot:
    1) reboot
    2) reboot -f

    Second command will immediately restart your system.
    See more | Go to post

    Leave a comment:


  • Problem in mouselistener and windowllistener event handling

    hello all,

    Just for learning purpose I am making a gui in which wherever a user click on window a text " mouse clicked" will appear at current position of mouse pointer.

    I have used listener interfaces.

    Code:
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    
    public class MouseEvents extends Frame implements MouseListener,WindowListener{
    ...
    See more | Go to post

  • vipin sharma
    replied to 2D arrays in pointer fashion issues
    in C
    hello,

    I have slightly modified given code. When I am using T[i] +j to display address, i am getting correct addresses of array T in output.

    But when I am using T + i*MAXCOL +j (mathematically this is correct), I am getting incorrect answer. In the output instead of getting 4 bytes increment one by one to base address I am seeing 8 bytes increment.

    Can anyone explain why it is acting differently?
    ...
    See more | Go to post

    Leave a comment:


  • vipin sharma
    replied to Rounding form a float to an int in C++
    in C
    hi,

    Yes Donbock is right, this algorithm might not be useful in case of negative numbers. As long as we are dealing with speed and time algorithm works fine.

    Vipin Sharma
    See more | Go to post

    Leave a comment:


  • vipin sharma
    replied to Rounding form a float to an int in C++
    in C
    hi

    You can user floor and ceil funtion in c++.
    If decimal part of your number is greater than or equal to 0.5 you can use ceil function and if decimal part is lesser than 0.5 you can use floor function.

    To know the decimal part pass the double value to an integer variable and then subtract that integer value from double value. After that use if else statements to choose floor or ceil function.

    You...
    See more | Go to post

    Leave a comment:


  • sunanda chowdhary
    sunanda chowdhary posted a Visitor Message for vipin sharma
    Hello,
    please explain parameter passin- call by name- with the help of an example,
    See more | Go to post

  • vipin sharma
    replied to Suppose this might be a noob question:
    in C
    Hi markus

    The loop will run three times only when proper looping condtion is given. e.g.
    Code:
    amount =0;
    while(amount<3)
    {
    amount +=1;
    }
    But the coding done by Halp will execute while loop unless and untill user doesn't enter value greater than or equal to 3 in amount (remember he is taking input from user in variable amount). Any one can make this loop run any num of...
    See more | Go to post

    Leave a comment:


  • vipin sharma
    replied to Suppose this might be a noob question:
    in C
    hi

    you have to make your while loop run three times. but here you are checking amount less than 3 which should be changed.

    vipin sharma
    See more | Go to post

    Leave a comment:


  • vipin sharma
    replied to Suppose this might be a noob question:
    in C
    hi

    Code:
    ****spoonfeeding removed******
    Describe your solution but just don't code it up.
         ---weaknessforcats
    regards
    Vipin Sharma
    See more | Go to post

    Leave a comment:


  • vipin sharma
    replied to cout & cin problem
    in C
    hi,

    the line <std::getline(s td::cin, message);> doesnt wait for user input because you might have used both formatted and unformatted input in your program.

    for e.g
    Code:
    int a;
    std::string message = "";
    std::cout<<"enter value of a";
    std::cin>>a;       // newline character remains in input stream
     while(message.empty())
     {
       std::cout
    ...
    See more | Go to post

    Leave a comment:


  • vipin sharma
    replied to Array starts at 1 and not 0
    in C
    Two corrections u need to do :

    1. char index = 0; // you have to initialise index to 0;

    2. getchar(); // Put this line anywhere in your isr function before "if(RI==1)" .

    Reason for correction 2 is given by zeeshan708. You might be entering some data in your function before calling isr function, therefore you need to nullify effect of last pressed enter key.
    See more | Go to post

    Leave a comment:


  • vipin sharma
    replied to which increment is usefull
    in C
    After studying little bit of assembly programming in microprocessor I feel that i++ and i+1 differs in the way they are computed at register level.

    i++ requires just one register of cpu which stores value of i, and it increments that register.
    its assembly code: INC I;

    but in case of i+1 it requires two registers one to store i and other to store 1.
    its assembly code: ADD I,1;

    As far as speed...
    See more | Go to post

    Leave a comment:


  • vipin sharma
    replied to New to windows app in C#
    write txtfirst.Text, txtsecond.Text in string.Format() ;

    Reason for you error is that txtfirst is a text box not the text in that textbox....
    See more | Go to post

    Leave a comment:


  • To convert a string to any number format you have to use Parse() function.
    Following lines will make use of parse clear:

    string[] str = { "1.23", "0.45", "123.4322" };
    float[] flt = new float[str.Length];

    for (int i = 0; i < str.Length; i++)
    flt[i] = float.Parse(str[i]);


    str[] is string array which contains your data. Now,...
    See more | Go to post

    Leave a comment:


  • Dell partners with ubuntu for its linux distribution. You try to install ubuntu linux on your inspiron 6000. You can request Ubunutu installation cd (free of charge) or download ubuntu from url : https://shipit.ubuntu.com/

    It would be better if can elaborate your problem in intalling linux.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...