<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Sharing Community</title>
        <description>Note: For all the program outputs please visit www.cppjj.com</description>
        <link>http://www.cppjj.com/forum/index.php</link>
        <lastBuildDate>Thu, 09 Sep 2010 07:06:33 -0600</lastBuildDate>
        <generator>Phorum 5.2.9a</generator>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?3,77,77#msg-77</guid>
            <title>LABC Tournament</title>
            <link>http://www.cppjj.com/forum/read.php?3,77,77#msg-77</link>
            <description><![CDATA[ LABC tournament in July 30 to Aug 1st 2010<br />
<br />
<a href="http://www.facebook.com/labadmintonclub" rel="nofollow" >LABC</a>]]></description>
            <dc:creator>admin</dc:creator>
            <category>Badminton</category>
            <pubDate>Wed, 21 Jul 2010 10:14:10 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?3,76,76#msg-76</guid>
            <title>New Badminton club in south cali</title>
            <link>http://www.cppjj.com/forum/read.php?3,76,76#msg-76</link>
            <description><![CDATA[ This is a new badminton club that just open in South California. Check it out..<br />
<br />
<br />
<a href="http://www.labadmintonclub.com/location.html" rel="nofollow" >Los Angelese Badminton Club</a>]]></description>
            <dc:creator>admin</dc:creator>
            <category>Badminton</category>
            <pubDate>Tue, 08 Jun 2010 02:09:25 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?6,75,75#msg-75</guid>
            <title>JavaOne + Develope</title>
            <link>http://www.cppjj.com/forum/read.php?6,75,75#msg-75</link>
            <description><![CDATA[ JavaOne + Develope (September 19 - 23, 2010 San Francisco)<br />
<br />
<a href="http://www.oracle.com/us/javaonedevelop/063292.html" rel="nofollow" >Java Developer Conference</a>]]></description>
            <dc:creator>admin</dc:creator>
            <category>Java</category>
            <pubDate>Tue, 08 Jun 2010 02:07:45 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?10,74,74#msg-74</guid>
            <title>Get Your netBeans 6.9 BETA with javaFX 1.3</title>
            <link>http://www.cppjj.com/forum/read.php?10,74,74#msg-74</link>
            <description><![CDATA[ :)<br />
<br />
[<a href="http://netbeans.org/community/releases/69/" rel="nofollow" >netbeans.org</a>]]]></description>
            <dc:creator>jj</dc:creator>
            <category>JavaFX</category>
            <pubDate>Fri, 04 Jun 2010 09:41:01 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?6,28,73#msg-73</guid>
            <title>Re: generates Random name</title>
            <link>http://www.cppjj.com/forum/read.php?6,28,73#msg-73</link>
            <description><![CDATA[ indeed]]></description>
            <dc:creator>jj</dc:creator>
            <category>Java</category>
            <pubDate>Sun, 21 Mar 2010 00:45:40 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?6,28,72#msg-72</guid>
            <title>Re: generates Random name</title>
            <link>http://www.cppjj.com/forum/read.php?6,28,72#msg-72</link>
            <description><![CDATA[ This is Really Good Site. !]]></description>
            <dc:creator>Sudoman</dc:creator>
            <category>Java</category>
            <pubDate>Sun, 14 Mar 2010 13:24:15 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?3,71,71#msg-71</guid>
            <title>Cal Poly Badminton Club winter hours</title>
            <link>http://www.cppjj.com/forum/read.php?3,71,71#msg-71</link>
            <description><![CDATA[ The hour for winter 2010 is as follow<br />
<br />
Hours<br />
Tuesday and Thursday<br />
10am to 12pm<br />
<br />
Friday<br />
9am to 12pm<br />
	<br />
Where<br />
Kellog Gym<br />
<br />
<br />
See you there..]]></description>
            <dc:creator>jj</dc:creator>
            <category>Badminton</category>
            <pubDate>Thu, 28 Jan 2010 00:51:13 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?10,70,70#msg-70</guid>
            <title>JavaFx</title>
            <link>http://www.cppjj.com/forum/read.php?10,70,70#msg-70</link>
            <description><![CDATA[ Check my site for tutorial<br />
<br />
www.cppjj.com]]></description>
            <dc:creator>admin</dc:creator>
            <category>JavaFX</category>
            <pubDate>Sun, 22 Nov 2009 19:02:26 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?5,62,69#msg-69</guid>
            <title>Re: VB6</title>
            <link>http://www.cppjj.com/forum/read.php?5,62,69#msg-69</link>
            <description><![CDATA[ yes thats true............]]></description>
            <dc:creator>never</dc:creator>
            <category>General</category>
            <pubDate>Fri, 20 Nov 2009 09:31:46 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?5,62,68#msg-68</guid>
            <title>Re: VB6</title>
            <link>http://www.cppjj.com/forum/read.php?5,62,68#msg-68</link>
            <description><![CDATA[ certainly, is easier to do so with programming than other subjects such as mathematics...]]></description>
            <dc:creator>jj</dc:creator>
            <category>General</category>
            <pubDate>Mon, 26 Oct 2009 00:53:40 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?5,66,67#msg-67</guid>
            <title>Re: Why do we Suffer?</title>
            <link>http://www.cppjj.com/forum/read.php?5,66,67#msg-67</link>
            <description><![CDATA[ If we don't suffer, we wouldn't know wut happiness is....]]></description>
            <dc:creator>jj</dc:creator>
            <category>General</category>
            <pubDate>Mon, 26 Oct 2009 00:52:30 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?5,66,66#msg-66</guid>
            <title>Why do we Suffer?</title>
            <link>http://www.cppjj.com/forum/read.php?5,66,66#msg-66</link>
            <description><![CDATA[ Is anyone can ans.the question.]]></description>
            <dc:creator>never</dc:creator>
            <category>General</category>
            <pubDate>Thu, 22 Oct 2009 02:38:46 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?5,62,65#msg-65</guid>
            <title>Re: VB6</title>
            <link>http://www.cppjj.com/forum/read.php?5,62,65#msg-65</link>
            <description><![CDATA[ Nice to have forum,to Share knowledge about programming]]></description>
            <dc:creator>never</dc:creator>
            <category>General</category>
            <pubDate>Thu, 22 Oct 2009 02:32:56 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?5,62,64#msg-64</guid>
            <title>Re: VB6</title>
            <link>http://www.cppjj.com/forum/read.php?5,62,64#msg-64</link>
            <description><![CDATA[ Maybe some basic before the complicated one hehe...im more of c++, java and python]]></description>
            <dc:creator>jj</dc:creator>
            <category>General</category>
            <pubDate>Fri, 16 Oct 2009 22:07:43 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?5,62,63#msg-63</guid>
            <title>Re: VB6</title>
            <link>http://www.cppjj.com/forum/read.php?5,62,63#msg-63</link>
            <description><![CDATA[ saving and searching image to/from database<br />
<br />
saving.....<br />
<br />
Private Sub cmdSave_Click()<br />
Dim byteData() As Byte<br />
On Error GoTo suspect<br />
Open CommonDialog1.FileName For Binary As #1<br />
ReDim byteData(FileLen(CommonDialog1.FileName))<br />
Get #1, , byteData<br />
Close #1<br />
Set rs = New ADODB.Recordset<br />
rs.Open "Select * from tbl_Info", cn, 1, 2<br />
With rs<br />
.AddNew<br />
!Idno = txtIdNo.Text<br />
!Name = txtName.Text<br />
!Picture.AppendChunk byteData<br />
.Update<br />
End With<br />
MsgBox "Record save!"<br />
txtName.Text = ""<br />
txtIdNo.Text = ""<br />
Image1.Picture = LoadPicture("")<br />
Exit Sub<br />
suspect:<br />
MsgBox Err.Description & " Please add picture!"<br />
End Sub<br />
<br />
Searching........<br />
<br />
Private Sub cmdSearch_Click()<br />
Dim search As String<br />
search = InputBox("enter id to search")<br />
Set rs = New ADODB.Recordset<br />
rs.Open "Select * from tbl_Info where idno like '" & search & "'", cn, 1, 2<br />
Set Image1.DataSource = rs<br />
Image1.DataField = "Picture"<br />
txtIdNo.Text = rs!Idno<br />
txtName.Text = rs!Name<br />
End Sub<br />
<br />
for ms access set picture property data type to OLE<br />
for SQL Server set picture property data type to image]]></description>
            <dc:creator>never</dc:creator>
            <category>General</category>
            <pubDate>Fri, 16 Oct 2009 21:45:42 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?5,62,62#msg-62</guid>
            <title>VB6</title>
            <link>http://www.cppjj.com/forum/read.php?5,62,62#msg-62</link>
            <description><![CDATA[ Using ADODC connection,its a simple phonebook application<br />
ADD,DEL,UPDATE,and dynamic search in datagrid]]></description>
            <dc:creator>never</dc:creator>
            <category>General</category>
            <pubDate>Fri, 16 Oct 2009 21:40:37 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?3,30,61#msg-61</guid>
            <title>Re: cal poly badminton club</title>
            <link>http://www.cppjj.com/forum/read.php?3,30,61#msg-61</link>
            <description><![CDATA[ our club started 2 years ago..but tournament sounds good]]></description>
            <dc:creator>jj</dc:creator>
            <category>Badminton</category>
            <pubDate>Wed, 14 Oct 2009 14:32:55 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?3,30,60#msg-60</guid>
            <title>Re: cal poly badminton club</title>
            <link>http://www.cppjj.com/forum/read.php?3,30,60#msg-60</link>
            <description><![CDATA[ Hello, <br />
<br />
Oh Dang! Cal Poly Pomona has a badminton club. What's up guys. UCI is going to have a the Anteater Collegiate Championship (ACC) on January 16th 2010. Many schools are attending like UCR, UCLA, UCB, UCSD, UCSB and Cal Poly SLO. We hope to hear from you. ucibadminton.com or call me 626-272-9318.]]></description>
            <dc:creator>Alexander</dc:creator>
            <category>Badminton</category>
            <pubDate>Tue, 06 Oct 2009 09:14:59 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?9,59,59#msg-59</guid>
            <title>testing</title>
            <link>http://www.cppjj.com/forum/read.php?9,59,59#msg-59</link>
            <description><![CDATA[ test]]></description>
            <dc:creator>admin</dc:creator>
            <category>C++</category>
            <pubDate>Thu, 24 Sep 2009 21:59:34 -0600</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?6,48,48#msg-48</guid>
            <title>Java Applet</title>
            <link>http://www.cppjj.com/forum/read.php?6,48,48#msg-48</link>
            <description><![CDATA[ <pre class="bbcode">
<pre class="bbcode"></pre>
/* This program is to determine if a given 3 lengths can form a triangle or not<br />
	It's a Java Applet program where you can put it on a web simply by applying<br />
	the class in the same directory as your index.html and put this code on it<br />
	<APPLET CODE = "Your-.class file" WIDTH=300 HEIGHT=200></APPLET><br />
	<br />
	JApplet is very similar to GUI<br />
	<br />
*/	<br />
<br />
import java.awt.*;<br />
import java.awt.event.*;<br />
import javax.swing.*;<br />
<br />
/* Here instead of extends JFrame we would extends JApplet<br />
	Notice when we decleare in JApplet we don't put the " J "<br />
	Like we did in JFrame. Also we don't need the setSize,<br />
	setVisible, and setDefaultCloseOperation.<br />
	<br />
*/<br />
<br />
public class Triangle extends JApplet implements ActionListener<br />
{<br />
	private Panel panel;<br />
	private Panel panel2;<br />
	private Panel panel3;<br />
	private Label messageLabel;<br />
	private Label messageLabel2;<br />
	private Label messageLabel3;<br />
	private TextField text1;<br />
	private TextField text2;<br />
	private TextField text3;<br />
	private Button button;<br />
	private Button button1;<br />
	public static int SCROLLBARS_BOTH;<br />
<br />
	public void init()<br />
	{<br />
<br />
		setLayout(new GridLayout(2,3));<br />
		<br />
		messageLabel = new Label("a");<br />
		text1 = new TextField(10);<br />
		<br />
		messageLabel2 = new Label("b");<br />
		text2 = new TextField(10);<br />
		<br />
		messageLabel3 = new Label("c");<br />
		text3 = new TextField(10);<br />
		<br />
		messageLabel.setBackground(Color.yellow);<br />
		messageLabel.setForeground(Color.blue);<br />
		button = new Button("Clear");<br />
		button.addActionListener(this);<br />
		button.setActionCommand("Clear");<br />
		button1 = new Button("Finish");<br />
		button1.addActionListener(this);<br />
		button1.setActionCommand("Finish");<br />
		<br />
		panel = new Panel();<br />
		panel2 = new Panel();<br />
		panel3 = new Panel();<br />
		<br />
		panel.add(messageLabel);<br />
		panel2.add(messageLabel2);<br />
		panel3.add(messageLabel3);<br />
		<br />
		panel.add(text1);<br />
		panel2.add(text2);<br />
		panel3.add(text3);<br />
		<br />
		/* This sets a textarea, it will appear on the bottom right<br />
			We set the textarea editable to be false so user can not change the text area<br />
			<br />
		*/<br />
		<br />
		TextArea textarea = new TextArea("This program is to determine \nif the given 3 lengths\n" +<br />
													"can form a triangle or not" ,20, 30, SCROLLBARS_BOTH);<br />
		textarea.setEditable(false);<br />
		<br />
		add(panel);<br />
		add(panel2);<br />
		add(panel3);<br />
		add(button);<br />
		add(button1);<br />
		add(textarea);<br />
		<br />
	}<br />
	/* This creates two events for the buttons<br />
		One is for clear and the other even is for enter<br />
		When the user clicks on clear it will reset the text area<br />
		When the user clicks on enter it will tell them the answer<br />
		<br />
	*/<br />
	<br />
		public void actionPerformed(ActionEvent e)<br />
		{<br />
			String s = e.getActionCommand();<br />
			if(s.equals("Clear"))<br />
			{<br />
				text1.setText("");<br />
				text2.setText("");<br />
				text3.setText("");<br />
			}<br />
			if(s.equals("Finish"))<br />
			{<br />
<br />
					String L1, L2, L3;<br />
					double length1, length2, length3,sum,sum1;<br />
					double sum2;<br />
			/* We have a handling exception if the user enters nothing<br />
				it will catches the exception and does nothing<br />
				<br />
			*/<br />
					<br />
				try{<br />
						String title = "Triangle";<br />
						L1 = text1.getText();<br />
						L2 = text2.getText();<br />
						L3 = text3.getText();<br />
						length1 = Double.parseDouble(L1);<br />
						length2 = Double.parseDouble(L2);<br />
						length3 = Double.parseDouble(L3);<br />
						sum = length1 + length2;<br />
						sum1 = length1 + length3;<br />
						sum2 = length2 + length3;<br />
					 <br />
						if(sum&gt;length3)<br />
						{<br />
							if((sum1 &gt; length2) && (sum2 &gt; length1))<br />
							{<br />
							<br />
								JOptionPane.showMessageDialog(null,"yes those length can create a triangle");<br />
							}<br />
						}<br />
						else<br />
				<br />
						JOptionPane.showMessageDialog(null,"no, it is not possible to create a triangle with the given length");<br />
					}<br />
					catch(NumberFormatException ae)<br />
					{<br />
					}<br />
			}<br />
		<br />
	}<br />
}<br />
</pre>]]></description>
            <dc:creator>admin</dc:creator>
            <category>Java</category>
            <pubDate>Tue, 24 Feb 2009 14:25:12 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?4,45,47#msg-47</guid>
            <title>Re: Math help</title>
            <link>http://www.cppjj.com/forum/read.php?4,45,47#msg-47</link>
            <description><![CDATA[ substition, your goal is to make one equation to have y by itself then substitute it into another equation...]]></description>
            <dc:creator>jj</dc:creator>
            <category>Math</category>
            <pubDate>Fri, 20 Feb 2009 01:05:20 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?4,45,46#msg-46</guid>
            <title>Re: Math help</title>
            <link>http://www.cppjj.com/forum/read.php?4,45,46#msg-46</link>
            <description><![CDATA[ 1. just put y= (2x-9) into the "y" in 1st equation<br />
ie. 3x-(2x-9) = 2 then solve<br />
<br />
2. solve for y from 1st equation, like: y = 4-3x<br />
then substitute this y into 2nd one]]></description>
            <dc:creator>Weirds</dc:creator>
            <category>Math</category>
            <pubDate>Wed, 18 Feb 2009 22:22:43 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?4,45,45#msg-45</guid>
            <title>Math help</title>
            <link>http://www.cppjj.com/forum/read.php?4,45,45#msg-45</link>
            <description><![CDATA[ Solve by substitution:<br />
1.<br />
3x-y=2<br />
y=2x-9<br />
<br />
2.<br />
3x+y=4<br />
4x-3y=1]]></description>
            <dc:creator>icyxmage1</dc:creator>
            <category>Math</category>
            <pubDate>Tue, 17 Feb 2009 23:26:14 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?9,44,44#msg-44</guid>
            <title>C++, array, sorting, and functions</title>
            <link>http://www.cppjj.com/forum/read.php?9,44,44#msg-44</link>
            <description><![CDATA[ //<br />
//             This project asks the user for a series of grade.<br />
//             Then, it will caculate the grade average, standard Deviation<br />
//             Then it prints out how many grades the user entered,<br />
//             The average, standard deviation, max, and the min of the grades.<br />
//             The program will exit if the user enters -1, numbers that are not<pre class="bbcode"></pre>
<br />
//             Between 0 and 100 or the user entered more than 100 numbers<br />
//<br />
<br />
#include&lt; iostream &gt;<br />
#include&lt; cassert &gt;<br />
#include&lt; math.h &gt;<br />
using namespace std;<br />
<br />
void get_grades(double a[], int size, int& numnberUsed);<br />
void sort_grades(double a[], int& numberUsed);<br />
void comp_stats(double a[], int& numberUsed);<br />
<br />
//This is the main method<br />
// It prints out the grade in a sorting oder<br />
// The grades will be print 10 per row<br />
<br />
int main()<br />
{<br />
    <br />
    <br />
    double sampleArray[100]; // set the array with size 100<br />
    int numberUsed;<br />
    get_grades(sampleArray, 100, numberUsed); // passing the sampleArray, size, and number used into the function get_grade<br />
    sort_grades(sampleArray, numberUsed);//passing sampleArray, and numberUsed into the function sort_grade<br />
   <br />
    cout&lt;&lt;"\n";<br />
    <br />
    //Using a loop to print out the array <br />
    //Check the condition, if the reminder of the index equals to 0 go to the next line<br />
    <br />
    for(int index = 0; index &lt; numberUsed; index++)<br />
    {<br />
           if(((index)%10)==0 && index !=0)<br />
           cout&lt;&lt;"\n";       <br />
           cout&lt;<sampleArray[index]&lt;&lt;" ";     }     cout&lt;&lt;"\n"&lt;&lt;"\n";          comp_stats(sampleArray,  numberUsed);          system("PAUSE"); // uses to pause the command window when the program is executed          return 0; }  //A void fuction that asks the user for a series of grade //The parameters are sampleArray, 100, and numberUsed // We are using the int& instead of int because it's a void function and not a returning function // void get_grades(double a[], int size, int& numberUsed) {                 cout&lt;&lt;"\nEnter grade(-1 to end ):"           &lt;&lt;"\n?";           double next;           int index = 0;           cin>&gt;next;<br />
          <br />
          // If user enters something more than 100 or less than 0<br />
          // The program will terminate<br />
          //<br />
          if((next&gt;=100) || (next &lt; -1 ))<br />
          {<br />
           cout&lt;&lt;"Error: number must be between 0 and 100\n "<br />
               &lt;&lt;"Program will exit\n";<br />
                         system("PAUSE");<br />
                         exit(1);<br />
          }<br />
          // The program will continue to loop until the user enters -1<br />
          // Two condition inside the loop<br />
          //<br />
          else<br />
          while(next != -1)<br />
          {<br />
                 a[index]= next;<br />
                 index++;<br />
                 cout&lt;&lt;"?";<br />
                 cin&gt;&gt;next;<br />
                 <br />
                 // If the user enters something that is below 0 or above 100<br />
                 // The program terminates<br />
                 //<br />
                 if((next&gt;=100) || (next &lt; -1 ))<br />
                 {<br />
                   cout&lt;&lt;"Error: number must be between 0 and 100\n"<br />
                       &lt;&lt;"Program will exit\n";<br />
                         system("PAUSE");<br />
                         exit(1);<br />
                         <br />
                 }<br />
                 // If the user enters more than 100 grades <br />
                 // The program terminates<br />
                 //<br />
                 if(index &gt; size)<br />
                 {<br />
                          cout&lt;&lt; " Warning: maximum number of grades reached\n"<br />
                              &lt;&lt;"Program will exit now\n";<br />
                              exit(1);<br />
                              }                         <br />
                 <br />
                 <br />
          }<br />
          //Determines how many numbers the use entered<br />
          //<br />
                 numberUsed = index;<br />
}<br />
// A void function that sorts the grade<br />
// int& numberUsed holds the size that the user entered<br />
//<br />
void sort_grades(double a[], int& numberUsed)<br />
{<br />
     double temp;<br />
     for(int index = 0; index &lt; numberUsed-1; index++)<br />
     {<br />
             for(int j = (index + 1); j &lt; numberUsed; j ++)<br />
             {<br />
                     if(a[index] &gt; a[j])<br />
                     {<br />
                             temp = a[index];<br />
                             a[index] = a[j];<br />
                             a[j] = temp;<br />
                     }<br />
             }<br />
           <br />
     }<br />
}<br />
// This is a void function that computes  the mean, max, min, and standard deviation<br />
//<br />
void comp_stats(double a[], int& numberUsed)<br />
{<br />
   double sum = 0, total = 0;<br />
   int index=0;<br />
   double max, ave, std, sqstd;<br />
   int startIndex = 0;<br />
   max = a[startIndex];<br />
   int indexOfMax = startIndex;<br />
   double dev[numberUsed];<br />
    <br />
   for (index = 0; index &lt; numberUsed; index++)<br />
    {<br />
        if(a[index] &gt; max)<br />
        {<br />
           max = a[index];<br />
          indexOfMax = index;<br />
     }        <br />
        <br />
        sum = sum + a[index];<br />
        <br />
    }<br />
<br />
   ave = static_cast<double>(sum)/numberUsed;<br />
   <br />
   for (index =0; index &lt; numberUsed; index++)<br />
   {<br />
       dev[index] = ave - a[index];<br />
       <br />
   }<br />
   for(index = 0; index &lt; numberUsed; index++)<br />
   {<br />
             total = total + pow(dev[index], 2);<br />
             <br />
   }<br />
   <br />
   std = total / (numberUsed - 1);<br />
   sqstd = sqrt(std);<br />
   <br />
   cout&lt;&lt;"Count = " &lt;&lt; numberUsed  &lt;&lt; " Mean = " &lt;&lt; ave<br />
       &lt;&lt;" Std. Dev.= "&lt;&lt; sqstd&lt;&lt;" Max.= " &lt;&lt;a[indexOfMax] &lt;&lt;" Min.= " &lt;&lt; a[startIndex]<br />
       &lt;&lt;"\n";<br />
}]]></description>
            <dc:creator>jj</dc:creator>
            <category>C++</category>
            <pubDate>Wed, 11 Feb 2009 15:26:35 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?6,43,43#msg-43</guid>
            <title>Simple Recursion Program</title>
            <link>http://www.cppjj.com/forum/read.php?6,43,43#msg-43</link>
            <description><![CDATA[ import java.util.*;<br />
<br />
public class RecurivePower<br />
{<br />
	public static void main(String[] args)<br />
	{<br />
		int x, n;<br />
		<br />
		Scanner key = new Scanner(System.in);<br />
		<br />
		System.out.println("Enter a number: ");<br />
		x = key.nextInt();<br />
		<br />
		System.out.println("Entere the power: ");<br />
		n = key.nextInt();<br />
		<br />
		System.out.println("The square root of " + x + " is " + rpower(x, n));// passing x and n <br />
		<br />
	}<br />
	<br />
	static int rpower(int y, int m)<br />
	{<br />
		if (m==0) return 1; // base case<br />
		else return y*rpower(y, m-1);//recursive case<br />
	}<br />
}<br />
<br />
<br />
output:<br />
<br />
Enter a number: <br />
2<br />
Entere the power: <br />
2<br />
The square root of 2 is 4]]></description>
            <dc:creator>jj</dc:creator>
            <category>Java</category>
            <pubDate>Fri, 06 Feb 2009 13:56:24 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?6,42,42#msg-42</guid>
            <title>GUI Draw Program</title>
            <link>http://www.cppjj.com/forum/read.php?6,42,42#msg-42</link>
            <description><![CDATA[ <pre class="bbcode">
// version 1 = version 0 + some drawing

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.JColorChooser;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.border.BevelBorder;
/**
  *  The draw application.
  */
public class Draw extends JFrame {
   /**
     * The easel for this application.
     */
	  
	  public static void main(String[] args) { 
      Draw draw = new Draw() ; 
      draw.setSize(300,375) ; 
      draw.setLocation(500,500) ; 
      draw.setVisible(true) ;
		 
   }
   DrawPanel2 drawPanel ;
	
	
   public Draw() { 
      super("Draw") ; 
      // create menubar
		
		this.addWindowListener(new WindowAdapter()
		{
			public void windowclosing(WindowEvent e) 
			{
				System.exit(0);
			}
		});
		
		Container contentPane = this.getContentPane();
		
		contentPane.setLayout(new BorderLayout());
		
		drawPanel = new DrawPanel2();
		drawPanel.setBorder(new BevelBorder(BevelBorder.LOWERED));
		drawPanel.setBackground(Color.white);
		contentPane.add(drawPanel, BorderLayout.CENTER);
		
		JMenuBar menubar = new JMenuBar();
		this.setJMenuBar(menubar);
	
		JMenu filemenu = new JMenu("File");
		JMenu colormenu = new JMenu("Color");
		menubar.add(filemenu);
		menubar.add(colormenu);
		
		Action clear = new ClearAction();
		Action quit = new QuitAction();
		Action select = new SelectColorAction();

		
		filemenu.add(clear);
		filemenu.add(quit);
		colormenu.add(select);

		
      // create toolbar 
		JToolBar toolbar = new JToolBar();
		toolbar.add(clear);
		toolbar.add(select);
		toolbar.add(quit);
		contentPane.add(toolbar, BorderLayout.NORTH);
		
		JToolBar colors = new JToolBar();
		colors.setOrientation(SwingConstants.VERTICAL);
		contentPane.add(colors, BorderLayout.WEST);   

   }
    

	class ClearAction extends AbstractAction
	{
		public ClearAction()
	{
		super("Clear");
		}
		public void actionPerformed(ActionEvent e)
		{
			drawPanel.clear();
		}
	}

class QuitAction extends AbstractAction
{
	public QuitAction()
	{
		super("Quit");
	}
	public void actionPerformed(ActionEvent e)
	{
		int response = JOptionPane.showConfirmDialog(Draw.this, "Do you Really want to Quit?");
		
		if(response == JOptionPane.YES_OPTION)
			System.exit(0);
	}
}

	class ColorAction extends AbstractAction
	{
		Color color;
		
		public ColorAction(Color color)
		{
			this.color = color;
			putValue(Action.SMALL_ICON, new ColorIcon(color));

		}
		
		public void actionPerformed(ActionEvent e)
		{
			drawPanel.setColor(color);
		}
	}
	
	static class ColorIcon implements Icon {
    Color color;

    public ColorIcon(Color color) {
      this.color = color;
    }

    // These two methods specify the size of the icon
    public int getIconHeight() {
      return 16;
    }

    public int getIconWidth() {
      return 16;
    }

    // This method draws the icon
    public void paintIcon(Component c, Graphics g, int x, int y) {
      g.setColor(color);
      g.fillRect(x, y, 16, 16);
    }
  }
	class SelectColorAction extends AbstractAction
	{
		public SelectColorAction(){
		super("Select Color");
		}
		
		public void actionPerformed(ActionEvent e)
		{
			Color color = JColorChooser.showDialog(Draw.this, 
			"Select Drawing Color", drawPanel.getColor());
			if(color!=null)
			drawPanel.setColor(color);
		}
	}
}


//////////////////////////////////////////////////
/**
  *  The  drawing panel.
  */
class DrawPanel2 extends JPanel {
  public DrawPanel2() {
 
    setPreferredSize(new Dimension(450, 200));

   
    addMouseListener(new MouseAdapter() {
      public void mousePressed(MouseEvent e) {
        moveto(e.getX(), e.getY()); // Move to click position
        requestFocus(); // Take keyboard focus
      }
    });


    addMouseMotionListener(new MouseMotionAdapter() {
      public void mouseDragged(MouseEvent e) {
        lineto(e.getX(), e.getY()); 
      }
    });


  }
  protected int last_x, last_y;

  
  public void moveto(int x, int y) {
    last_x = x;
    last_y = y;
  }

  
  public void lineto(int x, int y) {
    Graphics g = getGraphics();
    g.setColor(color); 
    g.drawLine(last_x, last_y, x, y); 
    moveto(x, y);
  }

  
  public void clear() {
    repaint();
  }

  Color color = Color.black;

  public void setColor(Color color) {
    this.color = color;
  }

  public Color getColor() {
    return color;
  }

}
</pre>]]></description>
            <dc:creator>admin</dc:creator>
            <category>Java</category>
            <pubDate>Wed, 04 Feb 2009 13:50:04 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?6,41,41#msg-41</guid>
            <title>simple program how to append files:)-D:)-D</title>
            <link>http://www.cppjj.com/forum/read.php?6,41,41#msg-41</link>
            <description><![CDATA[ <pre class="bbcode">
//needed to create an empty text called bday.txt
//


import javax.swing.*;
import java.io.*;

public class Bday
{
	public static void main(String[] args)throws IOException
	{
		
		try
		{
				FileWriter fw = new FileWriter("bday.txt", true);
				PrintWriter pw = new PrintWriter(fw);
				
				String name = JOptionPane.showInputDialog("Enter the person's name");
				name = name.toLowerCase();
				
				pw.println(name);
				
				String bday = JOptionPane.showInputDialog("Enter the person's bday as 1311986");
				
				pw.println(bday);
				
				pw.close();
				
				
			
		}
		catch (NullPointerException e)
		{
		}
			
	}
}
</pre>]]></description>
            <dc:creator>admin</dc:creator>
            <category>Java</category>
            <pubDate>Wed, 04 Feb 2009 00:15:29 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?6,39,40#msg-40</guid>
            <title>Re: GUI simple color push buttons</title>
            <link>http://www.cppjj.com/forum/read.php?6,39,40#msg-40</link>
            <description><![CDATA[ thanx...for this post...it is really helpful<br />
appreciated]]></description>
            <dc:creator>nuts_fever_007</dc:creator>
            <category>Java</category>
            <pubDate>Sat, 31 Jan 2009 00:12:01 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?6,39,39#msg-39</guid>
            <title>GUI simple color push buttons</title>
            <link>http://www.cppjj.com/forum/read.php?6,39,39#msg-39</link>
            <description><![CDATA[ <pre class="bbcode">
import javax.swing.* ; 
import java.awt.* ;
import java.awt.event.* ;

/**
 	A simple push button GUI
  */
public class PushButton 
          extends JComponent {

   /**
     *  The state of this PushButton.
     */ 
   private boolean state ; 

   /**
     *  The text associated with this PushButton.
     */
   private String text ; 

   /**
     *  Command string associated with this?
     */
   private String actionCommand ; 

   /**
     *  The ActionListeners associated with this PushButton
     */
   protected ActionListener listeners  ;

   /**
     *  Construct from text.
     */
   public PushButton(String txt) {
      this.text = txt ; 
      this.state = false ; 
      this.addMouseListener(new MouseAdapter() {
         public void mousePressed(MouseEvent e) {
            if (state) state = false ;
            else state = true ;
            repaint() ;
            /////////////////////// generate ActionEvent
            if (listeners != null)
               listeners.actionPerformed(
                  new ActionEvent(PushButton.this,
                                  e.getID() ,
                                  PushButton.this.getActionCommand())) ;
         }
      }) ;
   }

   /*** Set the action command. */
   public void setActionCommand(String ac) { 
      this.actionCommand = ac ; 
   }

   /*** Get the action command. */
   public String getActionCommand() { 
      return actionCommand ; 
   }

   /*** Add an action listener to this PushButton. */
   public void addActionListener(ActionListener l) {
      listeners = AWTEventMulticaster.add(listeners,l) ;
   }

   /*** Remove an action listener from this PushButton. */
   public void removeActionListener(ActionListener l) {
      listeners = AWTEventMulticaster.remove(listeners,l) ;
   }

   /*** Return the text on this PushButton. */
   public String getText() { 
      return this.text ; 
   }

   /*** Set the text on this PushButton. */
   public void setText(String txt) { 
      this.text = txt ; 
   }

   /**
     *  Inquire about the state of this PushButton.
     */
   public boolean getSelected() { 
      return this.state ; 
   }

   /** 
     * What dimension does the text have?
     */
   protected Dimension getTextBounds(Graphics g) { 
      g.setFont(this.getFont()) ; 
      FontMetrics fm = g.getFontMetrics(this.getFont()) ;
      int w = fm.stringWidth(this.text), 
          h = fm.getHeight() ;   
      return new Dimension(w,h) ; 
   }



   public Dimension getPreferredSize() {  // ?
      FontMetrics fm = getFontMetrics(getFont());
		return new Dimension(fm.stringWidth(text)+30, fm.getAscent() + fm.getDescent() + 30);
		   
   }

   public Dimension getMinimumSize() { // ?
      return this.getPreferredSize() ; 
   }

   public Dimension getMaximumSize() { // ?
      return this.getPreferredSize() ; 
   }



   /**
     *  Paint the PushButton, depending upon state.
     */
   public void paintComponent(Graphics g) {
      if (!state) paintUp(g) ; 
      else paintDown(g) ;
   }

   public void paintUp(Graphics g) {
      Dimension d = this.getSize() ;
		int width, height;
		int x,y;
      int w = d.width - 1 ;
      int h = d.height - 1 ;
		Font F = g.getFont();
		FontMetrics fm = g.getFontMetrics(F);
		width = fm.stringWidth("Color");
		height = fm.getAscent();
		
		x= getSize().width/2 - width/2;
		
		y = getSize().height / 2 + height / 2;
      g.setColor(Color.blue) ;
      g.drawLine(0,0,w-1,0) ;
      g.drawLine(0,1,0,h-1) ;
      g.setColor(Color.blue) ;
      g.drawLine(1,h-1,w-1,h-1) ;
      g.drawLine(w-1,1,w-1,h-2) ;
      g.setColor(Color.blue) ;
      g.drawLine(1,h,w,h) ;
      g.drawLine(w,1,w,h-1) ;  
      g.setColor(this.getForeground()) ;
		g.drawString(this.getText(), x, y);  
      g.dispose() ;
   }

   public void paintDown(Graphics g) {
      Dimension d = this.getSize() ;
      int w = d.width - 1 ;
      int h = d.height - 1 ;
		int width, height;
		int x,y;
		Font F = g.getFont();
		FontMetrics fm = g.getFontMetrics(F);
		width = fm.stringWidth("Red");
		height = fm.getAscent();
		
		x= getSize().width/2 - width/2;
		
		y = getSize().height / 2 + height / 2;
      g.setColor(this.getBackground()) ;  /// background color
      g.fillRect(0,0,w,h) ; 
      g.setColor(Color.white) ;
      g.drawLine(0,0,0,h-1) ;
      g.drawLine(1,0,w-1,0) ;
      g.setColor(Color.blue);
      g.drawLine(1,1,1,h-2) ;
      g.drawLine(1,1,w-2,1) ;
      g.setColor(Color.lightGray) ;
      g.drawLine(2,h-1,2,h-1) ;  // just one square
      g.drawLine(w-1,1,w-1,1) ;
      g.setColor(Color.white) ;
      g.drawLine(0,h,w,h) ;
      g.drawLine(w,0,w,h-1) ;
		g.drawString(this.getText(), x, y);
      g.dispose() ;
   }

   /**
     * Test stub, from command line. 
     */
   public static void main(String[] args) { 
      PBtest pbt = new PBtest() ; 
      pbt.setSize(300,375) ; 
      pbt.setLocation(500,500) ; 
      pbt.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE) ; 
      pbt.setVisible(true) ; 
   }


}  // end of PushButton class

/////////////////////////////////// test user 

/**
  *    Set up three PushButtons to control color of a panel.
  */
class PBtest extends JFrame 
            implements ActionListener {
      
   JPanel midpane ; 
   PushButton pb1, pb2, pb3 ; 

   public PBtest() { 
      super.setTitle("PushButton Test (R/G/B)") ; 
      midpane = new JPanel() ; 
      JToolBar toolbar = new JToolBar() ;
      pb1 = 
         new PushButton("Red") ; 
      ///// REMOVE later
      pb1.setPreferredSize(new Dimension(30,30)) ; 
      /////
      pb1.setActionCommand("red") ; 
      pb1.addActionListener(this) ; 
		pb1.setBackground(Color.red);
      pb1.setForeground(Color.red) ;
		pb1.setFont(new Font("Serif", Font.ITALIC, 40)); 
      pb2 = 
         new PushButton("Green") ;
      pb2.addActionListener(this) ; 
      pb2.setActionCommand("green") ;
		pb2.setBackground(Color.green);
      pb2.setForeground(Color.green) ;
		pb2.setFont(new Font("MONOSPACED", Font.PLAIN, 20)); 
      pb3 = 
         new PushButton("Blue") ;
      pb3.addActionListener(this) ; 
      pb3.setActionCommand("blue") ; 
      pb3.setBackground(Color.blue) ;
		pb3.setForeground(Color.blue);
		pb3.setFont(new Font("Serif", Font.BOLD, 10)); 
      toolbar.add(pb1) ; 
      toolbar.add(new JToolBar.Separator()) ;   
      toolbar.add(pb2) ; 
      toolbar.add(new JToolBar.Separator()) ;   
      toolbar.add(pb3) ; 
      this.getContentPane().setLayout(new BorderLayout()) ; 
      this.getContentPane().add(toolbar, BorderLayout.NORTH) ; 
      this.getContentPane().add(midpane, BorderLayout.CENTER) ; 
      this.setVisible(true) ; 
      this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE) ;
   }
   public void actionPerformed(ActionEvent a) {  
      int r = (pb1.getSelected() ? 255 : 0), 
          g = (pb2.getSelected() ? 255 : 0),
          b = (pb3.getSelected() ? 255 : 0) ;
      midpane.setBackground(new Color(r,g,b)) ; 
      midpane.repaint() ; 
   }

}
</pre>]]></description>
            <dc:creator>admin</dc:creator>
            <category>Java</category>
            <pubDate>Fri, 30 Jan 2009 13:21:30 -0700</pubDate>
        </item>
        <item>
            <guid>http://www.cppjj.com/forum/read.php?5,38,38#msg-38</guid>
            <title>economy links</title>
            <link>http://www.cppjj.com/forum/read.php?5,38,38#msg-38</link>
            <description><![CDATA[ [<a href="http://www.newsrightnow.org/articles/2856/1/2986/Macyas-closing-down-9-stores/Page1.html" rel="nofollow" >www.newsrightnow.org</a>]<br />
<br />
<br />
[<a href="http://www.nydailynews.com/money/2008/07/01/2008-07-01_starbucks_closing_600_stores_in_the_us.html" rel="nofollow" >www.nydailynews.com</a>]<br />
<br />
[<a href="http://arstechnica.com/old/content/2007/02/8940.ars" rel="nofollow" >arstechnica.com</a>]<br />
<br />
<br />
[<a href="http://www.newsweek.com/id/161415" rel="nofollow" >www.newsweek.com</a>]<br />
<br />
[<a href="http://www.naturalnews.com/News_000380_Medicaid_health_care_costs_bankruptcy.html" rel="nofollow" >www.naturalnews.com</a>]]]></description>
            <dc:creator>jj</dc:creator>
            <category>General</category>
            <pubDate>Wed, 28 Jan 2009 20:34:20 -0700</pubDate>
        </item>
    </channel>
</rss>
