1.11M Members

Latest Posts in Software Development

Re: in C++

To add on to what Mike said, just remember "only friends can see your private parts".

Re: in C++

Does this mean that ListNode can access Lists's private members

No, it's the other way around. By declaring List as a friend, the ListNode class gives access to its private members to the List class. It's like an invitation, ListNode invites List into its access-space.

Just think about it as a house. ListNode has a house with private things in it. It declares List as its friend, like giving List the keys to its house and thus access to its private things.

If it were to work the other way (as in, "ListNode can access List's private members"), then it would be the equivalent of ListNode declaring itself the friend of List and inviting itself into List's house. You can't do that, just like you cannot walk up to some stranger's front door and declare yourself their friend and invite yourself in. It always works the other way, they invite you in.

Re: in C++

I think you mean passing variables by reference or by value when you call the function. The difference is basically what effect you can have on the variable.

By value means that the variable passed into the function is a copy of the original variable and any changes made to the copy won't affect the original.

By reference means that the address of the original variable is passed to the function, and any changes will be made to the original.

in C++

Hi programmers!

I am trying to grasp the concept of friendship.

Let's say that we have the following:

class List; //forward declaration

class ListNode
    friend class List;  //make List a friend

        rest of code here, blah, blah, blah.

Does this mean that ListNode can access Lists's private members and List cannot access ListNode's private members, or both classes can access each others private members conversely?

Re: in C#

If I understand you correctly, you want to select the xml file path from the listbox. The .SelectedItem.ToString() property should be able to give you the selected file path, instead of looping through all the listbox items.

in C++

Hi Brethrem,
am kind of new in the C++ world, so far am learning about functions but am stuck on the difference between call a function by reference and call it by value.
I will appreciate your help

Re: in Visual Basic 4 / 5 / 6

I finally got it. When loading the grid I used

 Me.grdGrade.Items.CellValue(h, "Actions") = "    Edit    "
Me.grdGrade.Items.CellHasButton(h, "Actions") = True
s = Me.grdGrade.Items.SplitCell(h, "Actions")
Me.grdGrade.Items.CellValue(0, s) = "  Remove  "
Me.grdGrade.Items.CellHasButton(0, s) = True

and it works like a charm.

Re: in Java

warm regards for replying and putting your efforts in my problem.It will be cool if i just write my code lil bit what i was trying..like..-->

Taywin you didn't get my prob..,i am trying to show a picture on a jLabel in my jPanel (netbeans) on the basis of the name of the particular picture.
As we get the name of a picture from any of the resources whether static or userdefined ,putting that name into a condition check and then after displaying it on the jLabel Swing Control Component. Thanks buddie..,but i found another way to taste the HONEY without bees.. thanx ...!!

Slavi i also tried the code you put up in your reply..,but there was no big difference. As we have to pass the value for the icon in your code and i directly put it as using setIcon method, both gave me the same result. then i tried the switch case the basic one hahaha i wish to tell you it really works..,wooohuuu thanks a lot for all my friends for giving me useful advices THANX guys C U soon :)

String rs=jTextField1.getText();
            case "sukhi": jLabel1.setIcon(new ImageIcon("C:/Users/M@NEY/Documents/NetBeansProjects/appextra/src/sukhi.jpg"));
            case "smiley": jLabel1.setIcon(new ImageIcon("C:/Users/M@NEY/Documents/NetBeansProjects/appextra/src/smiley.jpg"));
            default :
                jLabel1.setIcon(new ImageIcon(""));
Re: in VB.NET

You could start with a button and a timer and do

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

    Process.Start(My.Computer.FileSystem.CurrentDirectory & "\first.exe")
    Timer1.Interval = 10 * 1000 'ten seconds

End Sub

Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick

    Process.Start(My.Computer.FileSystem.CurrentDirectory & "\second.exe")

End Sub
Re: in VB.NET

tinstaa frgt messenger , what about Ctrl+alt+n keyboard key press to a window in another program in vb.net.

in Java

Can anyone help me to write java program?
I'm using BlueJ for this assignment.

This assignment is to write a program to calculate loan repayments. Banks and/or finance companies loan customers money (usually called a mortgage) so they can make large purchases (such as a house or a car). Each month a repayment is made that includes interest due on the outstanding amount, plus some of the remaining amount (called principal). Over the life of the loan, the amount of interest payable per month reduces, whilst the amount of principal paid each month increases. You will write a mortgage (loan repayment) calculator in java to run in the terminal window of BlueJ.

The monthly payment for a fixed rate mortgage is the amount paid by the borrower every month that ensures that the loan is paid off in full with interest at the end of its term.

This is calculated by the following formula:

c = (r / (1 − (1 + r) − N))P


r is the interest rate r (expressed as a decimal, not a percentage, i.e., divide the quoted yearly percentage rate by 100 and by 12 to obtain the monthly interest rate);
N is the number of payments usually 12 times the duration of the loan in years;
P is the amount borrowed P known as the loan's principal;

The program will have a 3 option menu as shown below to Exit, calculate a specific mortgage repayment, and to produce a mortgage repayment table;
The program will use the BlueJ terminal window (again as shown below);
The program will have ‘reasonable editing’ – i.e. – one should not be able to enter ‘fred’ as a mortgage amount;
Numbers output should be formatted nicely, in a similar way to the sample run.
You shall test it with at least four test cases and provide screen dumps in the report to evidence your testing;
You should provide a short report and assignment cover sheet; the report must include evidence of testing and also a list of any problems you encountered and how you overcame them.

in C++

heres a nice tutorial about regions: http://www.flipcode.com/archives/Win32_Window_Skinning.shtml
like you see, these tutorial is for forms.. so how we can do with child controls!?!
we can:
add the WS_CLIPCHILDREN or WS_CLIPSIBLINGS style, when we create a button\other control:

hwnd = CreateWindowEx(
                intLeft, intTop, intWidth, intHeight,

now i'm do anotherthing... instead normal shapes i want in image way: testing all pixels and 'avoid' 1 color:

HRGN HideBackcolor(HWND WindowHandle,color BackColor=-1)
    HDC hdc=GetDC(WindowHandle);
    HRGN regionold=NULL,regionnew=NULL;
    int x=0,y=0;
    RECT a;
    int width=a.right - a.left -1;
    int height=a.bottom - a.top -1;
    for (y=0; y<height; y++)
        for(x=0; x<width; x++)
            color b=GetPixel(hdc,x,y);
                CombineRgn(regionold, regionold, regionnew, RGN_OR);
    return regionold;

i belive that i have some problems with these code, maybe i'm confused with CombineRgn() function. because i get bad results(i mean what i see):(
the color isn't hide :(
so what i'm doing wrong?

Software Development Tag Cloud