<?xml version="1.0" encoding="utf-8" ?><?xml-stylesheet type="text/xsl" href="http://www.daniweb.com/js/rss.xsl"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>DaniWeb IT Discussion Community
			 - Software Development					</title>
		<link>http://www.daniweb.com/software-development/2</link>
		<description>Our Software Development forum category encompasses topics related to application programming and software design. When posting programming code, please make sure it is formatted appropriately. Also, to keep DaniWeb a student-friendly place to learn, don't expect quick solutions to your homework. We'll help you get started and exchange algorithm ideas, but only if you show that you're willing to put in effort as well.</description>
		<language>en-US</language>
		<ttl>60</ttl>
		<!-- PubSubHubbub Discovery -->
		<link rel="hub" href="http://daniweb.superfeedr.com/" xmlns="http://www.w3.org/2005/Atom" />
		<link rel="hub" href="http://pubsubhubbub.superfeedr.com/" xmlns="http://www.w3.org/2005/Atom" />
		<link rel="hub" href="http://pubsubhubbub.appspot.com/" xmlns="http://www.w3.org/2005/Atom" />
		<link rel="self" href="http://www.daniweb.com/rss/pull/2" xmlns="http://www.w3.org/2005/Atom" />
		<!-- End Of PubSubHubbub Discovery -->
				<item>
			<title>Handles</title>
			<link>http://www.daniweb.com/software-development/csharp/threads/456967/handles</link>
			<pubDate>Wed, 19 Jun 2013 03:39:34 +0000</pubDate>
			<description>IntPtr objects can also be used to hold handles. For example, instances of IntPtr are used extensively in the System.IO.FileStream class to hold file handles. What is handles mean?</description>
			<content:encoded><![CDATA[ <p>IntPtr objects can also be used to hold handles. For example, instances of IntPtr are used extensively in the System.IO.FileStream class to hold file handles.</p>

<p>What is handles mean?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/csharp/61">C#</category>
			<dc:creator>AmrMohammed</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/csharp/threads/456967/handles</guid>
		</item>
				<item>
			<title>2D vector</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456966/2d-vector</link>
			<pubDate>Wed, 19 Jun 2013 02:23:29 +0000</pubDate>
			<description>I want to write a class that do operation on two matrices by 2D vector but i have some problems with the 2D vector , any one can help me?</description>
			<content:encoded><![CDATA[ <p>I want to write a class that do operation on two matrices by 2D vector but i have some problems with the 2D vector , any one can help me?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>islam.fci.3</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456966/2d-vector</guid>
		</item>
				<item>
			<title>Want to insert name of employee from database to combobox</title>
			<link>http://www.daniweb.com/software-development/java/threads/456965/want-to-insert-name-of-employee-from-database-to-combobox</link>
			<pubDate>Wed, 19 Jun 2013 01:58:33 +0000</pubDate>
			<description>I want to add employee name from database to combobox and i am using the coding while(rs.next()) combobox.addItem(rs.getString(&quot;Emp_name&quot;)); but the combobox appears consisting elements as Item1,Item2,Item3...and so on how I can add employees names in combobox</description>
			<content:encoded><![CDATA[ <p>I want to add employee name from database to combobox<br />
and i am using the coding</p>

<p>while(rs.next())<br />
combobox.addItem(rs.getString("Emp_name"));</p>

<p>but the combobox appears consisting elements as Item1,Item2,Item3...and so on<br />
how I can add employees names in combobox</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>Sweksha</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456965/want-to-insert-name-of-employee-from-database-to-combobox</guid>
		</item>
				<item>
			<title>read from file into an array</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456964/read-from-file-into-an-array</link>
			<pubDate>Wed, 19 Jun 2013 01:10:09 +0000</pubDate>
			<description> How do you read data from a file and fill an array?</description>
			<content:encoded><![CDATA[ <p>How do you read data from a file and fill an array?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>anf39</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456964/read-from-file-into-an-array</guid>
		</item>
				<item>
			<title>std::copy and operator&lt;&lt; overload for ostream</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456963/stdcopy-and-operator-overload-for-ostream</link>
			<pubDate>Wed, 19 Jun 2013 01:04:35 +0000</pubDate>
			<description>Hi, I've been learning about the std::copy function in the &lt;algorithm&gt; header and I'm stuck on this exercise that I gave my self. Let's see the code snippet first: #include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;algorithm&gt; #include &lt;iterator&gt; using namespace std; ostream&amp; operator&lt;&lt;(ostream&amp; os, const int p_val) { os.put( p_val*2); return ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I've been learning about the std::copy function in the &lt;algorithm&gt; header and I'm stuck on this exercise that I gave my self.</p>

<p>Let's see the code snippet first:</p>

<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
#include &lt;iterator&gt;
using namespace std;

ostream&amp; operator&lt;&lt;(ostream&amp; os, const int p_val)
{
    os.put( p_val*2);
    return os;
}

int main(/*const int argc,const char* const argv[]*/)
{
    std::vector&lt;int&gt; myVector = {34,54,43,2,7,87};

    std::copy(myVector.begin(), myVector.end(), ostream_iterator&lt;int&gt;(std::cout, " "));

    cin.get();
    return 0;
}
</code></pre>

<p>Basically what I'm trying to achieve is: I have a vector full of integers. I want to print the mutiply of 2 of these integers to std::cout using std::copy(). I learnt that I would have to overload operator&lt;&lt;(). But as you can see from my failed attempt above, I'm at a complete lost as to what I need to do insife operator&lt;&lt;().</p>

<p>Any help's much appreciated.</p>

<p>Cheers,<br />
Ben</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>yxBen</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456963/stdcopy-and-operator-overload-for-ostream</guid>
		</item>
				<item>
			<title>Tales from the interview: malloc(0)</title>
			<link>http://www.daniweb.com/software-development/c/threads/456962/tales-from-the-interview-malloc0</link>
			<pubDate>Tue, 18 Jun 2013 22:33:49 +0000</pubDate>
			<description>I was asked this in an interview today: Q: `malloc(0); /* What does it do? */` It's a great question because it covers a subtlety in the standard and a condition that not many people will consider. Unfortunately, I wasn't 100% confident that I remembered what the standard said about ...</description>
			<content:encoded><![CDATA[ <p>I was asked this in an interview today:</p>

<p>Q: <code>malloc(0); /* What does it do? */</code></p>

<p>It's a great question because it covers a subtlety in the standard and a condition that not many people will consider. Unfortunately, I wasn't 100% confident that I remembered what the standard said about it. With full understanding that I brought the question on myself by arrogantly describing myself as an expert in C, I gave my answer as follows: "<em>A valid pointer will be returned, but that pointer cannot be dereferenced.</em>"</p>

<p>My answer was <strong>wrong</strong>. The interviewer said that the result was undefined behavior, which seemed slightly off to me at the time though I didn't challenge him on a nuance I wasn't assured of. As it turns out, my answer was partially correct, though in being partially correct it was still wrong. However, the interviewer wasn't correct either. The standard states the condition of a zero size request as follows:</p>

<p>"<em>If the size of the space requested is zero, the behavior is implementation-deﬁned: either a null pointer is returned, or the behavior is as if the size were some nonzero value, except that the returned pointer shall not be used to access an object.</em>"</p>

<p>Note that implementation-defined is very different from undefined. Undefined means that the very act of calling <code>malloc(0)</code> invokes undefined behavior and as a result makes the entire program henceforth undefined as well. Implementation-defined means that <code>malloc(0)</code> is legal and doesn't affect the legality of the rest of the program, but you must take all possible results into account when making the call if you want your code to be portable. As such, the following is portable and legal, but completely useless because the pointer cannot be dereferenced:</p>

<pre><code class="language-c">p = malloc(0);

if (!p)
{
    /* Don't dereference p */
}
else
{
    /* Still don't dereference p */
}
</code></pre>

<p>If <code>malloc(0)</code> were undefined, the above code would be horribly broken...and still completely useless. ;) The reason my partially correct answer was wholely wrong is I neglected to account for one of two possible outcomes. And while the interviewer was technically incorrect in saying that <code>malloc(0)</code> is undefined, he was <strong>practically</strong> correct because thinking of a useless situation as being undefined keeps you from creating that situation. In practice, he'd potentially write better code by avoiding sending in a zero size than by accounting for the implementation-defined behavior of sending in a zero size.</p>

<p>Robust code is the goal. I'm not sure there's a lesson to be learned from this interview, but it is what it is. Discuss. :)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>deceptikon</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456962/tales-from-the-interview-malloc0</guid>
		</item>
				<item>
			<title>Bind unknown number of buttons to Click event</title>
			<link>http://www.daniweb.com/software-development/python/threads/456960/bind-unknown-number-of-buttons-to-click-event</link>
			<pubDate>Tue, 18 Jun 2013 21:29:42 +0000</pubDate>
			<description>hi, I want to load an unknown number of buttons (20 max) into a panel. When clicking a button, some other code should be executed. Below code shows my attempt at solving the problem. Unfortunately execution results in an assertion error. Any help in pointing me in the right direction ...</description>
			<content:encoded><![CDATA[ <p>hi,</p>

<p>I want to load an unknown number of buttons (20 max) into a panel.<br />
When clicking a button, some other code should be executed.<br />
Below code shows my attempt at solving the problem. Unfortunately execution results in an assertion error. Any help in pointing me in the right direction is much appreciated:</p>

<pre><code class="language-py">import wx

"""trying to bind an unknown number of images to click event"""

class MyApp(wx.App):

    def OnInit(self):
        frame = MyFrame(None, -1)
        frame.Show()
        self.SetTopWindow(frame)
        return True

class MyFrame(wx.Frame):

    def __init__(self, parent, id):
        wx.Frame.__init__(self, parent, id, 'Bind unknown number of images', size=(1000, 500))
        panel = wx.Panel(self)

        mainSizer = wx.GridBagSizer(hgap=5, vgap=5)
        testSizer = wx.GridSizer(cols = 4, rows =0 )

        images = "g1 g2 g3 g4 g5 ".split()
        n=0

        for image in images:
            n=n+1
            path = 'O:\Python Programming Bits\bind test\%s.gif' % image
            image= wx.Image(path, wx.BITMAP_TYPE_ANY).Scale(80, 80).ConvertToBitmap()
            button = wx.BitmapButton(panel,  -1, bitmap=image, name=image)
            button.Bind(wx.BitmapButton, self.OnButton)
            testSizer.Add(button, flag=wx.EXPAND)

        mainSizer.Add(testSizer, pos=(2, 2), span=(2, 5 ), flag=wx.EXPAND)
        panel.SetSizer(mainSizer)
        mainSizer.Fit(self)
        mainSizer.SetSizeHints(self)

    def OnButton(self, event):
        print "you clicked on ... " + button_by_id.GetName()

    def OnQuit(self, event):
        self.Close()

if __name__ == '__main__':
    app = MyApp(False)
    app.MainLoop()    


app.MainLoop()    
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>No_idea</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/threads/456960/bind-unknown-number-of-buttons-to-click-event</guid>
		</item>
				<item>
			<title>QT5 and Encoding Again</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456959/qt5-and-encoding-again</link>
			<pubDate>Tue, 18 Jun 2013 21:25:44 +0000</pubDate>
			<description>Hey! When i compile my code in Qt5, i get an weird symbol of triangle with an &quot;?&quot; at place of an french À. I try to chaqnge encoding to Latin1: no changes. UTF-8 it's same and i can't edit it. I tried many encoding but no changes. Weirdly months ...</description>
			<content:encoded><![CDATA[ <p>Hey!</p>

<p>When i compile my code in Qt5, i get an weird symbol of triangle with an "?" at place of an french À. I try to chaqnge encoding to Latin1: no changes. UTF-8 it's same and i can't edit it. I tried many encoding but no changes. Weirdly months ago all worked and after i come back to the project it's dosen't work anymore and i changed nothing. Maybe an glitch/bug of Qt? Theres goes an picture of what i mean</p>

<p>Thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>J-P1988</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456959/qt5-and-encoding-again</guid>
		</item>
				<item>
			<title>Advice on returning an array needed</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456950/advice-on-returning-an-array-needed</link>
			<pubDate>Tue, 18 Jun 2013 18:58:25 +0000</pubDate>
			<description>Hello programmers! I am trying to return an array, made up of 7 members, all type ints via a pointer from a function. Here is a prototype of a function that does this: `int[7] colCountArray={0,0,0,0,0,0,0} //array saved in Board obj.` int* Board::accessColCount() { return &amp;colCountArray; } However, my compiler dosnt ...</description>
			<content:encoded><![CDATA[ <p>Hello programmers! I am trying to return an array, made up of 7 members, all type ints  via a pointer from a function. Here is a prototype of a function that does this:</p>

<p><code>int[7] colCountArray={0,0,0,0,0,0,0}  //array saved in Board obj.</code></p>

<pre><code class="language-cpp">int* Board::accessColCount()
{
    return &amp;colCountArray;
}
</code></pre>

<p>However, my compiler dosnt like this. How can I fix this problem?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>nathan.pavlovsky</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456950/advice-on-returning-an-array-needed</guid>
		</item>
				<item>
			<title>Error 91</title>
			<link>http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/456947/error-91</link>
			<pubDate>Tue, 18 Jun 2013 18:14:39 +0000</pubDate>
			<description>I've fought the Error 91 problem for years programing (self taught) in VB 6. Below is a simple example of a program getting data from a database and putting it into a grid. I know I'm supposed to use Dim and Set statements, but I've never figured it out. Can ...</description>
			<content:encoded><![CDATA[ <p>I've fought the Error 91 problem for years programing (self taught) in VB 6. Below is a simple example of a program getting data from a database and putting it into a grid. I know I'm supposed to use Dim and Set statements, but I've never figured it out. Can you help me??</p>

<p>Private Sub FormLoad()<br />
Data1.Recordset.MoveFirst<br />
R = 1: grdData.Col = 0<br />
Do Until Data1.Recordset.EOF = True<br />
   grdData.Row = R<br />
   grdData.Text = Data1.Recordset.Fields("Name")<br />
   R = R + 1<br />
   Data1.Recordset.MoveNext<br />
Loop<br />
End Sub</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/visual-basic-4-5-6/4">Visual Basic 4 / 5 / 6</category>
			<dc:creator>DickEM</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/456947/error-91</guid>
		</item>
				<item>
			<title>EXE Problem</title>
			<link>http://www.daniweb.com/software-development/python/threads/456946/exe-problem</link>
			<pubDate>Tue, 18 Jun 2013 17:51:29 +0000</pubDate>
			<description>I compiled a program in python, but the second I open it, there is a flash of the error, but then the cmd window closes.</description>
			<content:encoded><![CDATA[ <p>I compiled a program in python, but the second I open it, there is a flash of the error, but then the cmd window closes.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>Jacklittle01</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/threads/456946/exe-problem</guid>
		</item>
				<item>
			<title>Porter Stemming algorithm</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456945/porter-stemming-algorithm</link>
			<pubDate>Tue, 18 Jun 2013 17:33:59 +0000</pubDate>
			<description>I have successfully implemented Porter Stemming Algorithm. I wanted to project ideas, as to where I could apply it, a more practical application?</description>
			<content:encoded><![CDATA[ <p>I have successfully implemented Porter Stemming Algorithm. I wanted to project ideas, as to where I could apply it, a more practical application?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>rash_13</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456945/porter-stemming-algorithm</guid>
		</item>
				<item>
			<title>JDBC - See changes on data while the application is running</title>
			<link>http://www.daniweb.com/software-development/java/threads/456943/jdbc-see-changes-on-data-while-the-application-is-running</link>
			<pubDate>Tue, 18 Jun 2013 16:44:14 +0000</pubDate>
			<description>Hi, I was wondering why my application doesn't list the changes while the application is running. For e.g I create a new job and then my application should show the new job in the list that is provided. I used **ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE** this but doesn't seem to work. Thanks Kru</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I was wondering why my application doesn't list the changes while the application is running. For e.g I create a new job and then my application should show the new job in the list that is provided. I used <strong>ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE</strong> this but doesn't seem to work.</p>

<p>Thanks</p>

<p>Kru</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>KRUX17</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456943/jdbc-see-changes-on-data-while-the-application-is-running</guid>
		</item>
				<item>
			<title>search listview with textbox text on windows form</title>
			<link>http://www.daniweb.com/software-development/csharp/threads/456942/search-listview-with-textbox-text-on-windows-form</link>
			<pubDate>Tue, 18 Jun 2013 16:03:33 +0000</pubDate>
			<description>Hello After two days of struggling I have come for some help. I have a listview of contact names that I want to search with text added into a textbox. It can either filter these as the text is entered or by a button search ... I haven't got anywhere ...</description>
			<content:encoded><![CDATA[ <p>Hello</p>

<p>After two days of struggling I have come for some help. I have a listview of contact names that I want to search with text added into a textbox. It can either filter these as the text is entered or by a button search ... I haven't got anywhere with either so far.</p>

<pre><code class="language-cs">  private void btnSearch_Click_1(object sender, EventArgs e)
        {

            for (int i = 0; i &lt; lvContacts.Items.Count; i++)

                if (lvContacts.Items[i].ToString().Contains(txtSearch.Text.ToLower()))
                {
                    //lvContacts.Items[i].Selected; // THIS DOESNT WORK ... as I'm sure you know
                    lvContacts.Items[i].BackColor = Color.CornflowerBlue;
                }    

        }

        private void txtSearch_TextChanged(object sender, EventArgs e)
        {
            lvContacts.SelectedItems.Clear();

            for (int i = 0; i &lt; lvContacts.Items.Count; i++)

                if (lvContacts.Items[i].ToString().Contains(txtSearch.Text.ToLower()))
                {
                    lvContacts.Items[i].BackColor = Color.CornflowerBlue;
                }
        }
</code></pre>

<p>Help thank fully received   ... John.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/csharp/61">C#</category>
			<dc:creator>johnt68</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/csharp/threads/456942/search-listview-with-textbox-text-on-windows-form</guid>
		</item>
				<item>
			<title>put python variable into sqlite3</title>
			<link>http://www.daniweb.com/software-development/python/threads/456939/put-python-variable-into-sqlite3</link>
			<pubDate>Tue, 18 Jun 2013 14:50:01 +0000</pubDate>
			<description>I have 2 functions, one of which works and one of which doesn't. I do not understand this, because the only difference is that the second function puts in just the name of the variable, where the 1st function puts in the value. There is only one line to build ...</description>
			<content:encoded><![CDATA[ <p>I have 2 functions, one of which works and one of which doesn't.  I do not understand this, because the only difference is that the second function puts in just the name of the variable, where the 1st function puts in the value.</p>

<p>There is only one line to build for the test from a given dataset, but the content function has several lines.  I am using a for loop to handle the iteration through the csv to get content, but it fails to get anything but the first line.  There is no error traceback from this code, unless I take the quotes from around the vuln_0 variable name <code>cur.execute("INSERT INTO vulnerabilities(IP) VALUES ('vuln_0');")</code><br />
With no quotes, it errors out in sqlite3, saying "there is no column vuln_0."</p>

<pre><code class="language-py">def load_titles(f, d):
    print("This is da 'd,' y\'all! ", d )
    filename = f
    titles=[]
    with open(filename, 'rb') as mycsv:
            reader = csv.reader(mycsv)
            counter = 0
            for counter,row in enumerate(reader):
                if counter &lt; 1: continue
                if counter &gt; 6: break
                titles.append(row)

            tests = (1, titles[0][0], titles[0][1], titles[0][2], titles[0][3], titles[0][4], titles[0][5], titles[0][6], titles[1][0], titles[1][1], titles[1][2], titles[4][0], titles[4][1], titles[4][2], titles[4][3], titles[4][4], titles[4][5], titles[4][6]),

    try:
        con = lite.connect(d)
        with con:
            cur = con.cursor()    
            cur.execute("DROP TABLE IF EXISTS tests")
            cur.execute("CREATE TABLE tests(Id INTEGER PRIMARY KEY, Corp TEXT, Address_1 TEXT, Address_2 TEXT, City TEXT, State TEXT, Country TEXT, Postal_Code TEXT, Requester TEXT, Code_1 TEXT, Role TEXT, Asset_Groups TEXT, IPs TEXT, Active_Hosts INT, Hosts_Matching_Filters INT, Trend_Analysis TEXT, Date_Range TEXT, Asset_Tags TEXT)")
            cur.executemany("INSERT INTO tests VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", tests)

    except lite.Error, e:
        if con:
            con.rollback()
        print "Error %s:" % e.args[0]
        sys.exit(1)

    finally:
        if con:
            con.close() 

def load_content(f, d):
    filename = f

    with open(filename, 'rb') as mycsv:
        print(filename)
        id = 1
        reader = csv.reader(mycsv)
        counter = 0
        for counter,row in enumerate(reader):
#           con = lite.connect(d)
            if counter &gt; 8: 
                continue
            print(row)
#           chine = (test.tests.id, row[0],row[2], row[4])
#           vuln = (id, row[0],row[1], row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13], row[14], row[15], row[16], row[17])

            vuln_0 = str(row[0])
            vuln_1 = str(row[1])
            vuln_2 = str(row[2])
            vuln_3 = str(row[3])
            vuln_4 = str(row[4])
            vuln_5 = str(row[5])
            vuln_6 = str(row[6])
            vuln_7 = str(row[7])
            vuln_8 = str(row[8])
            vuln_9 = str(row[9])
            vuln_A = str(row[10])
            vuln_B = str(row[11])
            vuln_C = str(row[12])
            vuln_D = str(row[13])
            vuln_E = str(row[14])
            vuln_F = str(row[15])
            vuln10 = str(row[16])
            vuln11 = str(row[17])

            try:
                con = lite.connect(d)

                with con:
                    cur = con.cursor()    

                    cur.execute("DROP TABLE IF EXISTS vulnerabilities")
                    cur.execute("CREATE TABLE vulnerabilities(Id INTEGER PRIMARY KEY, IP TEXT, CVSS_Base TEXT, NetBIOS TEXT, OS TEXT,  QID TEXT, First_Detected TEXT, Last_Detected TEXT, Port TEXT, CVE_ID TEXT, Vendor_Reference TEXT, Bug_traq_ID TEXT, Threat TEXT, Impacts TEXT, Solution TEXT, Exploitability TEXT, Associated_Malware TEXT, Results TEXT, PCI_Vuln TEXT)")

                    cur.execute("INSERT INTO vulnerabilities(IP) VALUES ('vuln_0');")
                    con.commit()

            except lite.Error, e:
                if con:
                    con.rollback()
                    print "Error %s:" % e.args[0]
                    sys.exit(1)

            finally:
                if con:
                    con.close() 

#
</code></pre>

<p>There are 19 values I want to enter, but for now, only 0th value is being entered into the db.<br />
The first iteration of the for loop runs, but nothing else.</p>

<p>A data file you could use: <a href="https://github.com/wolf29/csv-edit/blob/master/mouse.csv" rel="nofollow">https://github.com/wolf29/csv-edit/blob/master/mouse.csv</a><br />
The source: <a href="https://github.com/wolf29/csv-edit/blob/master/test0813.py" rel="nofollow">https://github.com/wolf29/csv-edit/blob/master/test0813.py</a></p>

<p>This is python 2.7.3.  It has occurred to me that I might be mixing ver 2.x and 3.x in my code.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>wolf29</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/threads/456939/put-python-variable-into-sqlite3</guid>
		</item>
				<item>
			<title>how to convert hex to arabic string ?</title>
			<link>http://www.daniweb.com/software-development/c/threads/456938/how-to-convert-hex-to-arabic-string-</link>
			<pubDate>Tue, 18 Jun 2013 14:46:02 +0000</pubDate>
			<description>I need help writing a function to convert hex to arabic string to Example get string this : &quot;D8B1D8B5D98AD8AFD8A7D984D8B1D982D985&quot; and return this : رصيد الرقم in english-(Balance figure). **only c code** TNX</description>
			<content:encoded><![CDATA[ <p>I need help writing a function to convert hex to arabic string</p>

<p>to Example get string this : "D8B1D8B5D98AD8AFD8A7D984D8B1D982D985" and return this : رصيد الرقم in english-(Balance figure).<br /><strong>only c code</strong><br />
TNX</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>eladt</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456938/how-to-convert-hex-to-arabic-string-</guid>
		</item>
				<item>
			<title>Difference between instance and object in .NET</title>
			<link>http://www.daniweb.com/software-development/threads/456932/difference-between-instance-and-object-in-.net</link>
			<pubDate>Tue, 18 Jun 2013 12:38:16 +0000</pubDate>
			<description>Hi, Plz explain the difference between instance and object in .NET, if possible explain with example. Thanks in Advance</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>Plz explain the difference between instance and object in .NET, if possible explain with example.</p>

<p>Thanks in Advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/2">Software Development</category>
			<dc:creator>virendra_sharma</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/threads/456932/difference-between-instance-and-object-in-.net</guid>
		</item>
				<item>
			<title>Random Images from shake Detector</title>
			<link>http://www.daniweb.com/software-development/mobile-development/threads/456931/random-images-from-shake-detector</link>
			<pubDate>Tue, 18 Jun 2013 12:09:08 +0000</pubDate>
			<description>This is the code I have built so far. The shake detector is complete and works, I just don't know what to write for the execution code at line 26. I have 10 images stored in my res/drawable-hdpi folder, entitle 1-10 and I want to change between them randomly when ...</description>
			<content:encoded><![CDATA[ <p>This is the code I have built so far. The shake detector is complete and works, I just don't know what to write for the execution code at line 26. I have 10 images stored in my res/drawable-hdpi folder, entitle 1-10 and I want to change between them randomly when I shake it. I will eventually try and implement some transistions betwen images, so any advice on that would be amazing!</p>

<pre><code>import java.util.Random;

import android.os.Bundle;

import android.app.Activity;

import android.view.Menu;


public class MainActivity extends Activity {

    private ShakeDetector mShaker;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        //Shake Detection
         mShaker = new ShakeDetector(this);
            mShaker.setOnShakeListener(new ShakeDetector.OnShakeListener () {
              public void onShake()
              {
                //Code here is processed after shake.  

              }
            });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/mobile-development/181">Mobile Development</category>
			<dc:creator>snapper1</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/mobile-development/threads/456931/random-images-from-shake-detector</guid>
		</item>
				<item>
			<title>Application Exit</title>
			<link>http://www.daniweb.com/software-development/csharp/threads/456929/application-exit</link>
			<pubDate>Tue, 18 Jun 2013 11:36:19 +0000</pubDate>
			<description>Greetings I have a MDI application that when run for the first time it asks for the activation code by showing the main Windows Form (MDI parent) and another activation acquire code Windows Form showed above the main Windows Form using the ShowDialog() method. The main Windows Form including a ...</description>
			<content:encoded><![CDATA[ <p>Greetings</p>

<p>I have a MDI application that when run for the first time it asks for the activation code by showing the main Windows Form (MDI parent) and another activation acquire code Windows Form showed above the main Windows Form using the ShowDialog() method. The main Windows Form including a tool strip button when I exit the activation Windows Form by clicking the X upper right corner button, that tool strip is disabled and I cannot use it to exit the application and when I click the X upper right corner button of the main Windows Form to exit the application it gives me an error Windows report message informing that "vshost-clr2.exe has stopped working" when I looked for the main Windows form FormClosed event I found that line of code</p>

<pre><code class="language-cs">System.Environment.Exit(0)
</code></pre>

<p>What is the problem the causing such error "vshost-clr2.exe has stopped working" when clicking the X upper right corner of the main Windows Form (the MDI parent)</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/csharp/61">C#</category>
			<dc:creator>AmrMohammed</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/csharp/threads/456929/application-exit</guid>
		</item>
				<item>
			<title>Java source code for school project</title>
			<link>http://www.daniweb.com/software-development/game-development/threads/456928/java-source-code-for-school-project</link>
			<pubDate>Tue, 18 Jun 2013 11:31:12 +0000</pubDate>
			<description>Hello, I am a 3rd year Computer Science major and taking a introduction to game design course. The project from this week is defined as follows: 1. Java game 2. Use the jMonkey SDK 3. &quot;use an existing game engine and map to modify and create your own level&quot; 4. ...</description>
			<content:encoded><![CDATA[ <p>Hello, I am a 3rd year Computer Science major and taking a introduction to game design course. The project from this week is defined as follows:</p>

<ol><li>Java game</li>
<li>Use the jMonkey SDK</li>
<li>"use an existing game engine and map to modify and create your own level"</li>
<li>"The level you create must be unique, realistic and playable by multiple players"</li>
</ol>

<p>My problem: I have spent 2 days looking for source code for java games and have not found any that fit the criteria, or are on sites that require a monthly subscription. I found some games, but they are JAR files and I don't know a way to change the files from that format. I HAVE looked at the jMonkey help files and didn't find anything.</p>

<p>A website, thread or instructions on how to modify a JAR file would be appreciated.</p>

<p>Thank you</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/game-development/71">Game Development</category>
			<dc:creator>Stachys</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/game-development/threads/456928/java-source-code-for-school-project</guid>
		</item>
				<item>
			<title>Deduct food recipes from the main inventroy?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456925/deduct-food-recipes-from-the-main-inventroy</link>
			<pubDate>Tue, 18 Jun 2013 11:12:25 +0000</pubDate>
			<description>Hi all! I'm stuck somewhere. I have a table for Inventory (which contains the available amount of each food component) What I want to do: If I select a certain food (say salad) I want to be able to deduct the components (amount) of 'salad' from the inventory table. Consider ...</description>
			<content:encoded><![CDATA[ <p>Hi all!</p>

<p>I'm stuck somewhere. I have a table for Inventory (which contains the available amount of each food component)<br />
What I want to do: If I select a certain food (say salad) I want to be able to deduct the components (amount) of 'salad' from the inventory table.</p>

<p>Consider this:<br />
Salad is made up of 20mil of water, 50 of oil and 100gm of onion (just an example)<br />
When I give someone a Salad, I want to be able to deduct 20mil of water, 50 of oil and 100gm of onion from the inventory table. (So that I know how much of each item in my inventory is left)</p>

<p>The code is to allow these recipes of Salad to be changed/deleted/some others added into it. (Flexibility). I've found this difficult since in order to allow this flexibility, I can't just write that deduction in code as something that won't change forever.(More recipes can be added in the future)</p>

<p>Does anyone has an idea on how to do this?</p>

<p>I use MySQL with VB.NET</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>savedlema</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456925/deduct-food-recipes-from-the-main-inventroy</guid>
		</item>
				<item>
			<title>Allocate handle</title>
			<link>http://www.daniweb.com/software-development/csharp/threads/456923/allocate-handle</link>
			<pubDate>Tue, 18 Jun 2013 11:08:17 +0000</pubDate>
			<description>What are the function of SQLAllocHandle() SQLSetEnvAttr() SQLFreeHandle() SQLBrowseConnect() Can any onw help me understand them in detail I searched and understood them slightly. However, I'm reading a project without a documentation in which they are used and I'm confused too.... much. Thanks in advance</description>
			<content:encoded><![CDATA[ <p>What are the function of</p>

<p>SQLAllocHandle()<br />
SQLSetEnvAttr()<br />
SQLFreeHandle()<br />
SQLBrowseConnect()</p>

<p>Can any onw help me understand them in detail I searched and understood them slightly. However, I'm reading a project without a documentation in which they are used and I'm confused too.... much.</p>

<p>Thanks in advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/csharp/61">C#</category>
			<dc:creator>AmrMohammed</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/csharp/threads/456923/allocate-handle</guid>
		</item>
				<item>
			<title>how get values for table from text files?</title>
			<link>http://www.daniweb.com/software-development/java/threads/456921/how-get-values-for-table-from-text-files</link>
			<pubDate>Tue, 18 Jun 2013 10:53:26 +0000</pubDate>
			<description>Hi, i making a program where I would read data from text files and store them in tables in myslq. In my program I would create the table with the fields and in these fields I would insert the values from the text file. My issue is that i don't ...</description>
			<content:encoded><![CDATA[ <p>Hi,<br />
i making a program where I would read data from text files and store them in tables in myslq.<br />
In my program I would create the table with the fields and in these fields I would insert the values from the text file.<br />
My issue is that i don't know how! I would explain you why! In my program I would create table with fields (ID, Name). The values of these fields must be taken from the text file. The form of the text file is the below:<br /><img src="/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy80Lzc3NjZiODYyMmQ2YWYzYjQ0NTAxYzc5YWNhNWZjNTI5LnBuZw%3D%3D/109" alt="7766b8622d6af3b44501c79aca5fc529" title="align-right" /></p>

<p>As you can see the ID is in the third row of the file and the Name is in the fifth. Could anyone help me how can I import the values for ID and Name in the table?How can i get these values?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>ef_mag</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456921/how-get-values-for-table-from-text-files</guid>
		</item>
				<item>
			<title>print text to form</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456919/print-text-to-form</link>
			<pubDate>Tue, 18 Jun 2013 10:50:56 +0000</pubDate>
			<description>we use `Print` to print text to form in vb6 and dont know how to print text to window form in vb.net please explain how to achieve it . . .</description>
			<content:encoded><![CDATA[ <p>we use <code>Print</code> to print text to form in vb6<br />
and dont know how to print text to window form in vb.net<br />
please explain how to achieve it . . .</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Learner010</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456919/print-text-to-form</guid>
		</item>
				<item>
			<title>How Convert Dynamic Asp into HTML?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456918/how-convert-dynamic-asp-into-html</link>
			<pubDate>Tue, 18 Jun 2013 10:48:49 +0000</pubDate>
			<description>Hello All, My friend just made one dynamic website in Asp.net but after the complete development he want to change complete website in HTML. So please suggest me any tools in a market that can replace to complete dynamic website into HTML. Please suggest me how we can do that? ...</description>
			<content:encoded><![CDATA[ <p>Hello All,</p>

<p>My friend just made one dynamic website in Asp.net but after the complete development he want to change complete website in HTML. So please suggest me any tools in a market that can replace to complete dynamic website into HTML. Please suggest me how we can do that?</p>

<p>Regards,<br />
David Kroj</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>davidkroj</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456918/how-convert-dynamic-asp-into-html</guid>
		</item>
				<item>
			<title>worm duplicating a file</title>
			<link>http://www.daniweb.com/software-development/c/threads/456913/worm-duplicating-a-file</link>
			<pubDate>Tue, 18 Jun 2013 10:00:22 +0000</pubDate>
			<description>Hi all, I wanted to create a computer warm which create a file all over a network for learning purpose. But have no idea where to start. Can anyone guide me through how to create a simple one?. Any examples would be great.. thanks..</description>
			<content:encoded><![CDATA[ <p>Hi all,</p>

<p>I wanted to create a computer warm which create a file all over a network for learning purpose. But have no idea where to start. Can anyone guide me through how to create a simple one?. Any examples would be great.. thanks..</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>baby_c</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456913/worm-duplicating-a-file</guid>
		</item>
				<item>
			<title>my project on visual basic</title>
			<link>http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/456911/my-project-on-visual-basic</link>
			<pubDate>Tue, 18 Jun 2013 09:49:27 +0000</pubDate>
			<description>I have a problem during making my project . the problem is I programmed it like if we press 123 a message box pops saying something when I type 456 I programmed it like a msgbox pops up and says something but when I run it the first time I ...</description>
			<content:encoded><![CDATA[ <p>I have a problem during making my project . the problem is I programmed it like if we press 123 a message box pops saying something when I type 456 I programmed it like a msgbox pops up and says something but when I run it the first time I press 123 the thing pops up but when I type 456 the 123 msgbox pops up and then 456 msgbox pops up HELP!!!!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/visual-basic-4-5-6/4">Visual Basic 4 / 5 / 6</category>
			<dc:creator>rushimaadhav</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/456911/my-project-on-visual-basic</guid>
		</item>
				<item>
			<title>Making a dvd management using C++</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456898/making-a-dvd-management-using-c</link>
			<pubDate>Tue, 18 Jun 2013 07:30:05 +0000</pubDate>
			<description>friends please do me a help, please solve this: All class must have encapsulation, constructor, destructor and in any one solution you must have to use operator overloading 1) Define a class name DVD_DB. Include the following members. `DATA MEMBERS:` Name of DVD – private character array, size 10 Price ...</description>
			<content:encoded><![CDATA[ <p>friends please do me a help, please solve this:<br />
All class must have encapsulation, constructor, destructor and in any one solution you must have to use operator overloading</p>

<p>1) Define a class name DVD_DB. Include the following members.<br /><code>DATA MEMBERS:</code><br />
Name of DVD – private character array, size 10<br />
Price – private double variable<br />
Quantity – private int variable<br />
A private static int variable to keep track of how many DVD have been created so far.<br /><code>MEMBER FUNCTIONS:</code><br />
To assign initial values<br />
To set price and quantity<br />
To get price and quantity<br />
To Print DVD<br />
To display how many DVD has been created so far.</p>

<p>In main function use a DVD array and demonstrate a DVD shop. i.e. User can choose a DVD &amp; buy it, when a DVD is sold the Quantity goes down.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>rakibtg</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456898/making-a-dvd-management-using-c</guid>
		</item>
				<item>
			<title>Extract Image and text from xml files</title>
			<link>http://www.daniweb.com/software-development/python/threads/456897/extract-image-and-text-from-xml-files</link>
			<pubDate>Tue, 18 Jun 2013 07:26:31 +0000</pubDate>
			<description>Hello guys, Please how can I read xml files and extract image store in it and save it as .jpeg in a specified folder. Also how to export all the other fields to .csv or .txt file. Thank you.</description>
			<content:encoded><![CDATA[ <p>Hello guys,</p>

<p>Please how can I read xml files and extract image store in it and save it as .jpeg in a specified folder. Also how to export all the other fields to .csv or .txt file.</p>

<p>Thank you.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>ibpet11</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/threads/456897/extract-image-and-text-from-xml-files</guid>
		</item>
				<item>
			<title>Problems using JAX-WS 2.1 and JAXB 2.1 with JDK 6</title>
			<link>http://www.daniweb.com/software-development/java/threads/456896/problems-using-jax-ws-2.1-and-jaxb-2.1-with-jdk-6</link>
			<pubDate>Tue, 18 Jun 2013 06:34:23 +0000</pubDate>
			<description>When using JAX-WS 2.1 and JAXB 2.1 with JDK 6, im faced with lot of issues. To use JAX-WS 2.1 with JDK 6, newer versions of API jars (JAX-WS 2.1 and JAXB 2.1 API jars) need to be in bootclasspath before rt.jar.The only way to achieve this would be by ...</description>
			<content:encoded><![CDATA[ <p>When using JAX-WS 2.1 and JAXB 2.1 with JDK 6, im faced with lot of issues.<br />
To use JAX-WS 2.1 with JDK 6, newer versions of API jars (JAX-WS 2.1 and JAXB 2.1 API jars) need to be in bootclasspath before rt.jar.The only way to achieve this would be by endorsing<br />
To do this you can use Java endorsed mechanism to override whats in Java platform. See <a href="http://java.sun.com/j2se/1.5.0/docs/guide/standards/." rel="nofollow">http://java.sun.com/j2se/1.5.0/docs/guide/standards/.</a></p>

<p>As in my case doing so can have unintended consequences on other applications or other areas of the server, so it bares some risk.<br />
Hence could please advice if there is an alternative to the above query without having to add an endorsed folder in my tomcat directory.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>screenedcreamy</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456896/problems-using-jax-ws-2.1-and-jaxb-2.1-with-jdk-6</guid>
		</item>
				<item>
			<title>Pwning DaniWeb: the search is on for the God of Code</title>
			<link>http://www.daniweb.com/software-development/news/456894/pwning-daniweb-the-search-is-on-for-the-god-of-code</link>
			<pubDate>Tue, 18 Jun 2013 06:24:44 +0000</pubDate>
			<description>DaniWeb, the 10 year old IT discussion community with more than a million members, is always looking forward and never stops introducing new features and functions for users. When spammers managed to get the better of the (highly customised) vBulletin forum platform which had been driving DaniWeb since the get ...</description>
			<content:encoded><![CDATA[ <p>DaniWeb, the 10 year old IT discussion community with more than a million members, is always looking forward and never stops introducing new features and functions for users. When spammers managed to get the better of the (highly customised) vBulletin forum platform which had been driving DaniWeb since the get go, founder and CEO Dani Horowitz got the better of the spammers by re-coding the entire forum platform from the ground up. As a result, DaniWeb users not only got the benefit of a much slicker interface designed specifically for their needs, but the team of volunteer moderators got to go back to spending their time helping the community instead of fighting spam fires.</p>

<p>Being primarily a community of developers and programmers, DaniWeb was historically missing one rather obvious feature: an Application Programming Interface. That glaring gap was plugged recently when Dani announced the arrival of an official DaniWeb API that enables members to put their coding skills to good use and build the DaniWeb app that they have always wanted, access DaniWeb the way they want and manipulate DaniWeb data in new and creative ways. Creativity that quickly became apparent when, within days of the API being made public, a DaniWeb moderator known as <a href="http://www.daniweb.com/members/120589/diafol" rel="nofollow">diafol</a> (which means Devil in Welsh, and this guy is certainly a coding devil that's for sure) <a href="http://dw.diafol.org/en/home/" rel="nofollow">showcased a number of applications</a> including a badge builder for example.</p>

<p><img src="/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy8wLzNiOTA0OTM2ZWNjODk2YTljMzJiYjYxYzcxZTlkYTQwLmpwZw%3D%3D/500" alt="3b904936ecc896a9c32bb61c71e9da40" title="3b904936ecc896a9c32bb61c71e9da40" /></p>

<p>The API is very robust and capable of duplicating most read capabilities of the website itself. Additionally, there is some limited write functionality. API requests return either JSON or JSONP (for Javascript compatibility), and there is also support for OAuth 2.0 (both serverside and clientside implementations).</p>

<p>So what is all that stuff about 'Pwning DaniWeb' and being the 'God of Code' about then? Well, in order to help get the creative coding juices flowing, DaniWeb has launched a competition to find the best use of that newly launched API.  As well as the kudos of exposing those programming skills to your peers in the DaniWeb community, the winners will also share in a $500 prize fund. The winner gets a $300 Amazon gift certificate, with a second place prize of a $125 Amazon gift certificate and third place gets a $75 Amazon gift certificate.</p>

<p>"There's a lot that you can do with our API. Essentially it allows your application (web, desktop, mobile, etc) to tap into DaniWeb's back end" says DaniWeb Founder and CEO, Dani Horowitz "Your own application can use DaniWeb's login mechanism, you can write a native mobile app for DaniWeb, you can create your own completely unique front-end for the site, there really are limitless possibilities". Limitless indeed. The only boundary to what can be done is your own creative flair. So whether you fancy developing an Android or iOS mobile app for DaniWeb, turning the award winning DaniWeb IT news editorial into a standalone digital newspaper, or something altogether more surprising, now is the opportunity to put your programming skills to the test.</p>

<p>Entry is open to all members of DaniWeb, old and new, with entries accepted until the end of August 31st, 2013 and voting taking place in September. Code submissions should be posted within the relevant code snippet library for their language whereas downloadable apps, websites, etc. should be posted within the Show Off Your Projects forum in the Business Exchange section. All submissions must be tagged with both 'daniweb-api' and 'daniweb-api-contest-submission' in order to be eligible.</p>

<p>More information, including usage examples, about the API is <a href="http://www.daniweb.com/api/home" rel="nofollow">available here</a>, and full documentation <a href="http://www.daniweb.com/api/documentation" rel="nofollow">can be found here</a>. There's also a busy thread <a href="http://www.daniweb.com/community-center/geeks-lounge/threads/451027/daniweb-api-developer-competition/" rel="nofollow">about the competition</a> itself in case you have any technical questions.</p>

<p>Remember though, the competition is only open to DaniWeb members, but as registration is free that really shouldn't be a problem for anyone who wants to get involved. So, will you pwn DaniWeb and be crowned the God of Code?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/2">Software Development</category>
			<dc:creator>happygeek</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/news/456894/pwning-daniweb-the-search-is-on-for-the-god-of-code</guid>
		</item>
				<item>
			<title>ExecuteNonQuery() error in vb</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456887/executenonquery-error-in-vb</link>
			<pubDate>Tue, 18 Jun 2013 05:00:43 +0000</pubDate>
			<description>Need some help with the code below. Getting and error at ExecuteNonQuery() Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnRoomSave.Click Dim con As New OleDbConnection Dim cmd As New OleDb.OleDbCommand cmd = New OleDbCommand(Command, con) con.ConnectionString = &quot;Provider=Microsoft.ACE.OLEDB.12.0;Data Source='C:\PATIENT_O\PATIENT_O\Patient-O.accdb'&quot; cmd.CommandType = System.Data.CommandType.Text cmd.Connection = con con.Open() cmd.CommandText = ...</description>
			<content:encoded><![CDATA[ <p>Need some help with the code below. Getting and error at ExecuteNonQuery()</p>

<p>Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnRoomSave.Click</p>

<pre><code class="language-vb">    Dim con As New OleDbConnection
    Dim cmd As New OleDb.OleDbCommand
    cmd = New OleDbCommand(Command, con)
    con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source='C:\PATIENT_O\PATIENT_O\Patient-O.accdb'"

    cmd.CommandType = System.Data.CommandType.Text
    cmd.Connection = con
    con.Open()

    cmd.CommandText = "INSERT INTO Rooms (RoomID, First Name, Middle Name, Last Name, Room Type, Amt/Day, Comments) VALUES ('@RoomID, @FirstName, @Middle Name, @Last Name, @Room Type, @Amt/Day, @Comments')"
    'cmd.CommandText = "INSERT INTO [Rooms] (]RoomID], [First Name], [Middle Name], [Last Name], [Room Type], [Amt/Day], [Comments]) VALUES (" &amp; txtRoomID.Text &amp; ", '" &amp; txtroomFName.Text &amp; "', '" &amp; txtroomMName.Text &amp; "', '" &amp; txtroomLName.Text &amp; "','" &amp; txtRoomtype.Text &amp; "', '" &amp; txtroomAmount.Text &amp; "', '" &amp; txtroomComment.Text &amp; "')"
    cmd.Parameters.AddWithValue("@RoomID", Val(txtRoomID.Text))
    cmd.Parameters.AddWithValue("@FirstName", txtroomFName.Text)
    cmd.Parameters.AddWithValue("@Middle Name", txtroomMName.Text)
    cmd.Parameters.AddWithValue("@Last Name", txtroomLName.Text)
    cmd.Parameters.AddWithValue("@Room Type", txtRoomtype.Text)
    cmd.Parameters.AddWithValue("@Amt/Day", txtroomAmount.Text)
    cmd.Parameters.AddWithValue("@Comments", txtroomComment.Text)


    cmd.ExecuteNonQuery()
    Try

        MsgBox("Record Added")
    Catch exceptionObject As Exception
        MessageBox.Show(exceptionObject.Message)
    Finally
        con.Close()
    End Try
End Sub
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ZIPB</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456887/executenonquery-error-in-vb</guid>
		</item>
				<item>
			<title>case sensitive comparisions</title>
			<link>http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/456886/case-sensitive-comparisions</link>
			<pubDate>Tue, 18 Jun 2013 04:42:30 +0000</pubDate>
			<description>hi when i'm giving some string to search in the data base, ms access, that search is going to be ignoring case. i want case sensitivity. how..? ex: if i would like to search for the word &quot;Done&quot;, if there is no that word, and &quot;DONE&quot; is available in the ...</description>
			<content:encoded><![CDATA[ <p>hi<br />
when i'm giving some string to search in the data base, ms access, that search is going to be ignoring case. i want case sensitivity. how..?<br />
ex: if i would like to search for the word "Done", if there is no that word, and "DONE" is available in the database, then it is treating both as same. how to avoid this.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/visual-basic-4-5-6/4">Visual Basic 4 / 5 / 6</category>
			<dc:creator>baabjitvk</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/456886/case-sensitive-comparisions</guid>
		</item>
				<item>
			<title>CHANGE THE INDEX OF THE COLUMN IN DATATABLE</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456884/change-the-index-of-the-column-in-datatable</link>
			<pubDate>Tue, 18 Jun 2013 03:41:05 +0000</pubDate>
			<description>I have a datatable with nth column. Now, I want to change the index of some columns. Need help</description>
			<content:encoded><![CDATA[ <p>I have a datatable with nth column. Now, I want to change the index of some columns. Need help</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>GeekPlease</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456884/change-the-index-of-the-column-in-datatable</guid>
		</item>
				<item>
			<title>Output in polymorphism</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456883/output-in-polymorphism</link>
			<pubDate>Tue, 18 Jun 2013 03:36:41 +0000</pubDate>
			<description>How come foo(3,3.14); Doesn't work but Goo(3,3.14); works? Please reply. #include &lt;iostream&gt; using namespace std; double foo(double a, double b) { cout&lt;&lt;&quot;foo(double a, double b)&quot;&lt;&lt;endl; } int foo(int a, int b){ cout&lt;&lt;&quot;foo(int a, int b)&quot;&lt;&lt;endl; } double Goo(float a, float b){ cout&lt;&lt;&quot;Goo(float a, float b)&quot;&lt;&lt;endl; } int Goo(int a, int ...</description>
			<content:encoded><![CDATA[ <p>How come    foo(3,3.14); Doesn't work<br />
but Goo(3,3.14); works?<br />
Please reply.</p>

<pre><code class="language-cpp">#include &lt;iostream&gt;
using namespace std;
double foo(double a, double b) {
    cout&lt;&lt;"foo(double a, double b)"&lt;&lt;endl;
}
 int foo(int a, int b){
    cout&lt;&lt;"foo(int a, int b)"&lt;&lt;endl;
 }
double Goo(float a, float b){
    cout&lt;&lt;"Goo(float a, float b)"&lt;&lt;endl;
}
  int Goo(int a, int b){    
    cout&lt;&lt;"Goo(int a, int b)"&lt;&lt;endl; //this one
  }

int main()
{
    foo(3,3.14); // Doesn't work
    Goo(3,3.14); //Works
}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>mahesh113</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456883/output-in-polymorphism</guid>
		</item>
				<item>
			<title>Reading hexadecimal numbers into shell</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456871/reading-hexadecimal-numbers-into-shell</link>
			<pubDate>Mon, 17 Jun 2013 23:20:50 +0000</pubDate>
			<description>Sorry for the confusing title, as I am new to C++ Basically, what I am trying to do is, to read a simple **test.txt** file's content, which are just two words actually: &quot;Hello World&quot; and desplay thier hexadecimal content in a shell, CMD or command line.(Whatever it is called), if ...</description>
			<content:encoded><![CDATA[ <p>Sorry for the confusing title, as I am new to C++</p>

<p>Basically, what I am trying to do is, to read a simple <strong>test.txt</strong> file's content, which are just two words actually: "Hello World" and desplay thier hexadecimal content in a shell, CMD or command line.(Whatever it is called), if the text thing is confusing you here, just think of it, as if I am trying to open a simple .wav file and read it's data and display it on CMD, like you would using</p>

<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;fstream&gt;

using namespace std;

int main(){

  fstream myFile;

  myFile.open("test.txt");

  //reading goes here, the problem is displaying the hex data on the editor (CMD    )

  return 0;
}
</code></pre>

<p>I am new to this, and downloaded codeblocks, so I can only work with the CMD as of now. I can open files with the <strong>fstream</strong> class, and write in it, but sadly I can not read it's hexa content.</p>

<p>Is there anyway to do this by simple means in C++?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>Vribium</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456871/reading-hexadecimal-numbers-into-shell</guid>
		</item>
				<item>
			<title>Create Excel file with multiple worksheets from delimited file</title>
			<link>http://www.daniweb.com/software-development/csharp/threads/456868/create-excel-file-with-multiple-worksheets-from-delimited-file</link>
			<pubDate>Mon, 17 Jun 2013 21:22:02 +0000</pubDate>
			<description>Is it possible to create a delimited file and structure the delimited file in some way so that opening that file in Excel creates an Excel file with multiple worksheets with data on each worksheet?</description>
			<content:encoded><![CDATA[ <p>Is it possible to create a delimited file and structure the delimited file in some way so that opening that file in Excel creates an Excel file with multiple worksheets with data on each worksheet?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/csharp/61">C#</category>
			<dc:creator>spowel4</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/csharp/threads/456868/create-excel-file-with-multiple-worksheets-from-delimited-file</guid>
		</item>
				<item>
			<title>compiler construction</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456867/compiler-construction</link>
			<pubDate>Mon, 17 Jun 2013 20:59:52 +0000</pubDate>
			<description>what are the rules of graph construction and using the example: S::= A/B A::=XA/Y B::=XB/Z</description>
			<content:encoded><![CDATA[ <p>what are the rules of graph construction and using the example:<br />
S::= A/B<br />
A::=XA/Y<br />
B::=XB/Z</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>Nonye</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456867/compiler-construction</guid>
		</item>
				<item>
			<title>Pointers related ~_~</title>
			<link>http://www.daniweb.com/software-development/c/threads/456863/pointers-related-_</link>
			<pubDate>Mon, 17 Jun 2013 20:22:53 +0000</pubDate>
			<description>Hello, I'm a newbie in C/C++ programming and I wonder if you can make me understand the following, I have a small c++ statement, and the result is somehow weird for me: `char[10] arr=&quot;torino&quot;, *ptr; `ptr = arr;` `cout&lt;&lt;*&amp;*&amp;ptr;` and the result gives me the entire string.... PS: This is ...</description>
			<content:encoded><![CDATA[ <p>Hello, I'm a newbie in C/C++ programming and I wonder if you can make me understand the following, I have a small c++ statement, and the result is somehow weird for me:</p>

<p><code>char[10] arr="torino", *ptr;</code>ptr = arr;cout&lt;&lt;<em>&amp;</em>&amp;ptr;`<br />
and the result gives me the entire string....<br />
PS: This is not related to an assignment.<br />
Thanks in advance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>costy.bogdan</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456863/pointers-related-_</guid>
		</item>
				<item>
			<title>Please resolve this bug!</title>
			<link>http://www.daniweb.com/software-development/c/threads/456860/please-resolve-this-bug</link>
			<pubDate>Mon, 17 Jun 2013 19:04:58 +0000</pubDate>
			<description>I have an array of elements. Think each of the element as competitors, and a tournament is going to rank them. The output of the program is showing elements at each level. Here's the code: #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; bool isPowerOfTwo (int x) { /* First x in the below ...</description>
			<content:encoded><![CDATA[ <p>I have an array of elements.<br />
Think each of the element as competitors, and a tournament is going to rank them.<br />
The output of the program is showing elements at each level.<br />
Here's the code:</p>

<pre><code class="language-c">#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

bool isPowerOfTwo (int x)
{
  /* First x in the below expression is for the case when x is 0 */
  return x &amp;&amp; (!(x&amp;(x-1)));
}
// modified
int log_2(unsigned int n) {
    int bits = 0;
    if (!isPowerOfTwo(n))
        bits++;
    if (n &gt; 32767) {
        n &gt;&gt;= 16;
        bits += 16;
    }
    if (n &gt; 127) {
        n &gt;&gt;= 8;
        bits += 8;
    }
    if (n &gt; 7) {
        n &gt;&gt;= 4;
        bits += 4;
    }
    if (n &gt; 1) {
        n &gt;&gt;= 2;
        bits += 2;
    }
    if (n &gt; 0) {
        bits++;
    }
    return bits;
}

int second_minima(int a[],unsigned int n) {
    int log_2n = log_2(n);
    int **p = (int **) (malloc(log_2n * sizeof(int *)));
    int i, j, k;
    for (i = 0, j = n; i &lt; log_2n; i++) {
        j = j&amp;1 ? j/2+1 : j/2;
        p[i] = (int *)(malloc(j * sizeof(int)));
    }
    for (i = 0; i &lt; n; i++)
        p[0][i] = a[i];
    for (i = 1, j = n; i &lt; log_2n; i++) {
        for (k = 0; k+1 &lt; j; k += 2) {
            if (p[i-1][k] &gt; p[i-1][k+1]) {
                p[i][k/2] = p[i-1][k];
                //printf("%d\n", p[0][n-1]);
            }
            else {
                p[i][k/2] = p[i-1][k+1];
            }
        }
        if (j&amp;1)
            p[i][j/2] = p[i-1][j-1];
        j = j&amp;1 ? j/2+1 : j/2;
    }
    for (i = 0, j = n; i &lt; log_2n; i++) {
        for (k = 0; k &lt; j; k++)
            printf("%d ",p[i][k]);
        printf("\n");
        j = j&amp;1 ? j/2+1 : j/2;
    }
    return 0;
}

main()
{
    int n;
    scanf("%d", &amp;n);
    int a[n];
    int i;
    for (i = 0; i &lt; n; i++)
        scanf("%d", &amp;a[i]);
    second_minima(a,n);
    return 0;
}
</code></pre>

<p>The problem is with this input instance:<br />
Input :<br />
13<br />
12 7 3 18 4 2 16 5 6 17 1 8 9<br />
Output :<br />
12 7 3 18 4 2 16 5 6 17 1 8 12<br />
12 18 4 16 17 8 12<br />
18 16 17 12<br />
18 17<br />
18<br />
Correct Output :<br />
12 7 3 18 4 2 16 5 6 17 1 8 <strong>9</strong><br />
12 18 4 16 17 8 <strong>9</strong><br />
18 16 17 <strong>9</strong><br />
18 17<br />
18</p>

<p>The problem is it is turning the last element of level 0 to first element.<br />
This is occuring at line 49. I dont know why it is changing p[0][n-1] to p[1][0].<br />
Can any one explain the fault.<br />
I have tested it with other inputs, its giving right answer.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>prakhs</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456860/please-resolve-this-bug</guid>
		</item>
				<item>
			<title>create a sqlite3 database from within a python script</title>
			<link>http://www.daniweb.com/software-development/python/threads/456859/create-a-sqlite3-database-from-within-a-python-script</link>
			<pubDate>Mon, 17 Jun 2013 18:32:58 +0000</pubDate>
			<description>I want to create sqlite3 databases from within a python script. I am currently running this code which does not pass the right variable content to the sqlite3 command prompt, so I have one issue there. I also do not want to have the user have an sqlite3 command shell ...</description>
			<content:encoded><![CDATA[ <p>I want to create sqlite3 databases from within a python script.<br />
I am currently running this code which does not pass the right variable content to the sqlite3 command prompt, so I have one issue there.<br />
I also do not want to have the user have an sqlite3 command shell open.  I just want to define the db, and have the tables created and populated later by the py script.<br />
I don't want to use a default sqlite3 db for this application, because I want to be able to save instances related to specific data sets.</p>

<pre><code class="language-py">import csv
import sqlite3 as lite
import os

con = None


def main():
    choice = "chew"
    filename=raw_input("enter the filename==&gt;  ")
    current_db = filename[:-4]+'.db' 
    print("The filename minus the extention is " + filename[:-4])
    print("This is the name of the current DB "  + current_db)
    os.system("sqlite3 $current_db")
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>wolf29</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/threads/456859/create-a-sqlite3-database-from-within-a-python-script</guid>
		</item>
				<item>
			<title>Windows WINAPI button question</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456858/windows-winapi-button-question</link>
			<pubDate>Mon, 17 Jun 2013 18:03:51 +0000</pubDate>
			<description>in my code for what happens when I click on my MAIN BUTTON runs my function light hack. Inside my lighthack function is a for(;;) {} forever loop. Inside this forever loop is a break when a condition is met. The problem I am having is when I click on ...</description>
			<content:encoded><![CDATA[ <p>in my code for what happens when I click on my MAIN BUTTON runs my function light hack.<br />
Inside my lighthack function is a for(;;) {}  forever loop.  Inside this forever loop<br />
is a break when a condition is met. The problem I am having is when I click on this button<br />
my program goes none-responding until the condition in the forever loop has been met.<br />
Upon this time nothing else on my program works. How can I have this loop running<br />
and the program still respond to events?</p>

<pre><code class="language-cpp">case IDC_MAIN_BUTTON:
                {

                LightHack();  // Inside this function is a for(;;) loop
                ShowWindow(*phwnd,SW_HIDE);
                };
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>CodyOebel</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456858/windows-winapi-button-question</guid>
		</item>
				<item>
			<title>Synchronise Mutliple JTable column Margins</title>
			<link>http://www.daniweb.com/software-development/java/threads/456857/synchronise-mutliple-jtable-column-margins</link>
			<pubDate>Mon, 17 Jun 2013 17:31:42 +0000</pubDate>
			<description>Hello good day. I am designing two JTables; one on top of the other. The first one has nine columns. And the second one has 8 columns (The first column spans the first columns of the topmost table). What I wish to do now is to make the bottom table ...</description>
			<content:encoded><![CDATA[ <p>Hello good day. I am designing two JTables; one on top of the other. The first one has nine columns. And the second one has 8 columns (The first column spans the first columns of the topmost table). What I wish to do now is to make the bottom table reactive to the movement of the margins in the topmost table. I wish for them to stay aligned.</p>

<p>How do I accomplish this please?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>CoilFyzx</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456857/synchronise-mutliple-jtable-column-margins</guid>
		</item>
				<item>
			<title>how can i connect this string</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456855/how-can-i-connect-this-string</link>
			<pubDate>Mon, 17 Jun 2013 16:20:38 +0000</pubDate>
			<description>I am a new user of c++ and not really clear on pointers and the like , I have tried to search the web for some reasonable explanation but they just don't make much sense to me still. I would like to know what I need to do to pass ...</description>
			<content:encoded><![CDATA[ <p>I am a new user of c++ and not really clear on pointers and the like , I have tried to search the web for some reasonable explanation but they just don't make much sense to me still. I   would like to know what I need to do to pass this string to my boolcheckpassc(char *) function and if you just explain it in plain words that would be great cause I am lost. The bool code is from my book page 542 of starting out with c++ control structures. The other  code is from some other program I had with a dynamic array that I got an failure on anyway. I don't want you to write the code I just want someone to explain what I need to do to get it to work. like do I need to put in char instead of string? I am so confused. My instructor is of no help and he works for the air force.</p>

<pre><code class="language-cpp">#include&lt;iostream&gt;
#include&lt;iomanip&gt;
#include&lt;string&gt;

using namespace std;




/***************************************************************************/
/***************prototypes**************************************************/
void pause ();
int menu ();
string namePassword (string &amp;newuser, string &amp;pass);
void verifylogin();
bool checkpassc(char *);
int checkupperc(char *);
int checklowerc(char *);
int checknum(char *);
int checkspace(char *);





/****************************************************************************/
/******************main function*********************************************/

int main()
{
    int cont = 2;
   string *username;//ptr to dynamic array to hold names of products
   string *passwords; //ptr to dynamic array to hold prices of products
   int size =0;//hold the size of the dynamic array
   string s1;
   string s2;
    do        
   {// start do
      int choice=menu (); // call to the menu function
      switch (choice)
      { // Open switch statement

/******************************************************************************/
/**********switch case one register username password**************************/

         case 1: 

              //Get the information from the user for the product
              namePassword(s1,s2);
              cout&lt;&lt;"\n\n Enter a username:\n  ";
              cin&gt;&gt;s1;
              cout&lt;&lt; "\tEnter a password with the following criteria:\n";
              cout &lt;&lt; "8 to 15 characters\n"; 
              cout&lt;&lt; "2 uppercase\n2 lowercase\n2 numbers\n2 special characters:\n";
              cin &gt;&gt; s2; 

   int length;
    length = strlen(s2);

    if(length &gt;= 8 &amp;&amp; length &lt;= 15)
    {
        while (!checkpassc(s2))    
       {        
          cout &lt;&lt; "Invalid Password. try again\n";        
          cin &gt;&gt; s2;    
       }    
       cout &lt;&lt; "Your password: " &lt;&lt; s2 &lt;&lt; ", is valid\n";    
    }
    else
        cout &lt;&lt; "The password entered must be between 8-15 characters long\n";            

    system("pause");    


            pause();
            break;

/*****************************************************************************/
/******************switch case 2  login **************************************/ 

      case 2://get  the login information from the user
             case 2://get  the login information from the user
 char lookUp[user];
 char *strptr=null;
 int index
 cout&lt;&lt;"enter username\n:";
 cin.getline(lookUp,user);

 for (index=0; index&lt;user; index++)
 { 
     strPtr=strstr(user[index],lookup);
 if (strPtr !=Null
 cout&lt;&lt;"incorrect username\n";
 }
 if(strPtr!


            pause();
            break;

/******************************************************************************/
/******************************************************************************/

         case 3:cont=0;
                 break;
          } // Close switch statement

   }while (cont ==2);
   return 0;
}// STOP MAIN

/******************************************************************************/
/*******************void Pause function****************************************/

void pause ()
{//clears the last 80 on buffer
   cout &lt;&lt; "Press enter to continue " &lt;&lt; endl;
   cin.ignore (80, '\n');
}

/*****************************************************************************/
/**********int menu funtion********************************************/

int menu () 
{ // start int menu prototype

   int c = -1;
   while (c&lt;1 || c&gt;4)
   {  // start menu
      system ("cls");
      cout &lt;&lt; " 1. Register\n\n\n"
           &lt;&lt; " 2. Login\n\n\n"
           &lt;&lt; " 3. Exit\n\n\n";


      cin &gt;&gt; c;
      cin.ignore (80, '\n');
   }//end of while loop
   return c;
}// close int menu prototype

/******************************************************************************/
/******************user name function**********************************************/
string namePassword (string &amp;newuser, string &amp;pass);
{

} 
/****************************************************************************/
/*******************password registration*************************************/
bool checkpassc(s2 *str)
{    

    int length = strlen(str); //function to deterine the length of the cstring
    return checkupperc(str) &amp;&amp; checklowerc(str) &amp;&amp; checknum(str) &amp;&amp; checkspace (str);
}
//test for upper case 
int checkupperc(s2 *str)
{
    int user = 0;
    int length = strlen(str);

    for (int count = 0; count &lt; length; count++)
    {
        if (!isupper(str[count]))
        user++;
    }
        return user;    
}
//test for lower case
int checklowerc(s2 *str)
{
    int user = 0;
    int length = strlen(str);

    for (int count = 0; count &lt; length; count++)
    {
    if (!islower(str[count]))
    user++;
    }
    return user;
}
//test if it is a number or alphabet
int checknum(s2 *str)
{
    int user = 0;
    int length = strlen(str);

    for (int count = 0; count &lt; length; count++)
    {
        if (!isdigit(str[count]))
        user++;
    }
        return user;
}
//test if the argument is a whitespace character
int checkspace (s2 *str)
{
    int user=0;
    int length= strlen(str);

    for(int count=0; count&lt;length; count++)
    {
            if(!isspace(str[count]))
            user++;
            }
            return user;
            }

you can ignore the login function as  that is just  an idea I am currently working on for the login verification
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>cobaltfive</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456855/how-can-i-connect-this-string</guid>
		</item>
				<item>
			<title>COM and C++ programming</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456854/com-and-c-programming</link>
			<pubDate>Mon, 17 Jun 2013 16:16:09 +0000</pubDate>
			<description>WARNING: If you don't like horribly messy questions don't read on... Autodesk Inventor is a 3D parametric CAD program and plugins can be made using COM. I have no experience with COM and some of my naive COM type questions go ignored in the Inventor forums... Look at this: hRes ...</description>
			<content:encoded><![CDATA[ <p>WARNING: If you don't like horribly messy questions don't read on...</p>

<p>Autodesk Inventor is a 3D parametric CAD program and plugins can be made using COM. I have no experience with COM and some of my naive COM type questions go ignored in the Inventor forums...</p>

<p>Look at this:</p>

<pre><code class="language-cpp">  hRes = pSketches-&gt;Add (_variant_t((IDispatch *)pWorkPlane),
                         VARIANT_FALSE,
                         pSketch);
  wprintf (L"Sketch name: %s\n",pSketch-&gt;Name.GetBSTR()) ;

  pSketch-&gt;Name = L"Tube-Base" ;

  BSTR bstrSketchName ;
  pSketch-&gt;get_Name (&amp;bstrSketchName) ;
  wprintf (L"The sketch is now called %s\n",bstrSketchName) ;
</code></pre>

<p>The above code shows how to get and change the name of a "Sketch" in different ways.</p>

<p>Basically there is pSketch-&gt;Name which is read and write, while pSketch-&gt;get_Name(&amp;Name) is a read operation.</p>

<p>My question is: after using pSketch-&gt;Name do I have to do any .Release of smart pointers or anything?</p>

<p>Autodesk seems to have created double ways of accessing the same thing. With pointers you can use the</p>

<p>ptr = pObject-&gt;Get3D() ;</p>

<p>or</p>

<p>HRESULT hRes = pObject-&gt;get_3D(&amp;ptr) ;</p>

<p>They reccommend the later because it does not throw exceptions. And the former I think uses smart pointers which I'm too stupid to understand.</p>

<p>Has anybody come across this way of doing things in COM?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>owenransen</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456854/com-and-c-programming</guid>
		</item>
				<item>
			<title>Hacking using utorrent ?</title>
			<link>http://www.daniweb.com/software-development/threads/456853/hacking-using-utorrent-</link>
			<pubDate>Mon, 17 Jun 2013 16:05:31 +0000</pubDate>
			<description>can they hack using utorrent or any torrent downloader software ?</description>
			<content:encoded><![CDATA[ <p>can they hack using utorrent or any torrent downloader software ?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/2">Software Development</category>
			<dc:creator>killer88</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/threads/456853/hacking-using-utorrent-</guid>
		</item>
				<item>
			<title>Java- How to get next data from a database</title>
			<link>http://www.daniweb.com/software-development/java/threads/456851/java-how-to-get-next-data-from-a-database</link>
			<pubDate>Mon, 17 Jun 2013 15:03:33 +0000</pubDate>
			<description>Hi, I'm having some issues with getting next data from the database, it seemed to be working before, but now it doesn't change the textfields to the next data just appends the data into TextArea1 and TextArea2, the other data TextField1 etc.. Doesn't even change, so I do not know ...</description>
			<content:encoded><![CDATA[ <p>Hi,</p>

<p>I'm having some issues with getting next data from the database, it seemed to be working before, but now it doesn't change the textfields to the next data just appends the data into TextArea1 and TextArea2, the other data TextField1 etc.. Doesn't even change, so I do not know why this is happening. Been trying to figure out I can get the next data from the database for about 3 hours would really love some help.Anyone like to shine some light into this?</p>

<p>Thanks</p>

<p>Kru</p>

<p>` private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {<br />
        // Next Button</p>

<pre><code class="language-java">    Connection con = null;
    PreparedStatement ps = null;
    ResultSet rs = null; 



    String host = "xxxx";
    String uName = "xxxx"; 
    String uPass = "xxxx";


    try {
        con = DriverManager.getConnection(host,uName,uPass);

        ps = con.prepareStatement("SELECT * FROM Job",ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
        rs = ps.executeQuery();
       // String sql = "SELECT Customer.Firstname,Customer.Surname,Customer.TelephoneNo, ";
        if(rs.next()) {

       int id = rs.getInt("JobID");
       Date date =  rs.getDate("JobDate");
       String status = rs.getString("Status"); 
       String description = rs.getString("Description"); 
       String mechanic = rs.getString("Mechanic");
       Time duration = rs.getTime("Duration");
      // int customer = rs.getInt("CustomerID");
       String txtID = Integer.toString(id);



       jTextField1.setText(txtID);
       jTextField2.setText(date.toString());
       jTextArea1.append(status);
       jTextArea2.append(description);
       jTextField3.setText(mechanic);
       jTextField4.setText(duration.toString());

       System.out.println(id + "" +  date +  status  + description + mechanic +  duration );

        }
        } catch(SQLException e) {

        e.getMessage();

     } finally {
    try {
            if(con != null) {
                con.close();
                 System.out.println("CLOSED!!");
            }      
            if (ps != null) {
                ps.close();
            }
            if(rs != null) {
                rs.close();
            }

        } catch (SQLException e) {
            System.out.println("Exception has been caught");

        }   

    }

}  `
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>KRUX17</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456851/java-how-to-get-next-data-from-a-database</guid>
		</item>
				<item>
			<title>how to make a list of number occurring in the same line with a word?</title>
			<link>http://www.daniweb.com/software-development/python/threads/456848/how-to-make-a-list-of-number-occurring-in-the-same-line-with-a-word</link>
			<pubDate>Mon, 17 Jun 2013 14:41:41 +0000</pubDate>
			<description>i have a text document 'topics.txt': 1~cocoa 2~ 3~ 4~ 5~grain~wheat~corn~barley~oat~sorghum 6~veg-oil~linseed~lin-oil~soy-oil~sun-oil~soybean~oilseed~corn~sunseed~grain~sorghum~wheat 7~ 8~ 9~earn 10~acq and so on.. here the numbers correspond to the file names, i have about 20000 files. import os import re import sys sys.stdout=open('f1.txt','w') from collections import Counter from glob import glob def removegarbage(text): text=re.sub(r'\W+',' ...</description>
			<content:encoded><![CDATA[ <p>i have a text document 'topics.txt':</p>

<p>1~cocoa</p>

<p>2~</p>

<p>3~</p>

<p>4~</p>

<p>5~grain~wheat~corn~barley~oat~sorghum</p>

<p>6~veg-oil~linseed~lin-oil~soy-oil~sun-oil~soybean~oilseed~corn~sunseed~grain~sorghum~wheat</p>

<p>7~</p>

<p>8~</p>

<p>9~earn</p>

<p>10~acq</p>

<p>and so on..<br />
here the numbers correspond to the file names, i have about 20000 files.</p>

<pre><code class="language-py">    import os
    import re
    import sys
    sys.stdout=open('f1.txt','w')
    from collections import Counter
    from glob import glob

    def removegarbage(text):
        text=re.sub(r'\W+',' ',text)
        text=text.lower()
        return text

    folderpath='d:/individual-articles'
    counter=Counter()


    filepaths = glob(os.path.join(folderpath,'*.txt'))

    num_files = len(filepaths)

    with open('topics.txt','r') as filehandle:
        lines = filehandle.read()
        words = removegarbage(lines).split()
       counter.update(words)


    for word, count in counter.most_common():
        probability=count//num_files
        print('{}  {} {}'.format(word,count,probability))
</code></pre>

<p>i need my output to be of the form:<br />
word,count of word in topics.txt,probability, list of files,number of files in list,</p>

<p>so far my program works fine till probability, but how do i get a list of the files belonging to a word?<br />
ex: 'grain' must contain the list(5,6,....)</p>

<p>would counting the line number for each word and storing the line number work?</p>

<p>how do i go about it?<br />
Plz help!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>farhaana.ahmed.58</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/threads/456848/how-to-make-a-list-of-number-occurring-in-the-same-line-with-a-word</guid>
		</item>
				<item>
			<title>serialization of an abstract data type</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456847/serialization-of-an-abstract-data-type</link>
			<pubDate>Mon, 17 Jun 2013 13:56:10 +0000</pubDate>
			<description>Currently I have something like this: class FileWritter{ ofstream file; public: FileWritter(string filename,A_Class a){//A_Class is class which has defined the &gt;&gt; and the &lt;&lt; operators file.open(filename.c_str()); file&lt;&lt;a; } ~FileWritter(){ file.close(); } }; what I want is to have something like this: template &lt;class AbstractClass&gt; class FileWritter{ ofstream file; public: FileWritter(string ...</description>
			<content:encoded><![CDATA[ <p>Currently I have something like this:</p>

<pre><code class="language-cpp">class FileWritter{
    ofstream file;
public:
    FileWritter(string filename,A_Class a){//A_Class is class which has defined the &gt;&gt; and the &lt;&lt; operators
        file.open(filename.c_str());
        file&lt;&lt;a;
    }
    ~FileWritter(){
        file.close();
    }
};
</code></pre>

<p>what I want is to have something like this:</p>

<pre><code class="language-cpp">template &lt;class AbstractClass&gt;
class FileWritter{
    ofstream file;
    public:
    FileWritter(string fileName, AbstractClass ab){
        file.open(fileName.c_str());
        file&lt;&lt;ab;
    }
    ~FileWritter(){
        file.close();
    }
};
</code></pre>

<p>in this case, the compiller shows this error:</p>

<blockquote>
  <p>use of class template requires template argument list</p>
</blockquote>

<p>my question is how can I use an template class with FileWritter?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>CPT</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456847/serialization-of-an-abstract-data-type</guid>
		</item>
				<item>
			<title>divide by zero error in python</title>
			<link>http://www.daniweb.com/software-development/python/threads/456844/divide-by-zero-error-in-python</link>
			<pubDate>Mon, 17 Jun 2013 12:50:30 +0000</pubDate>
			<description> import os import re import sys sys.stdout=open('f1.txt','w') from collections import Counter from glob import glob def removegarbage(text): text=re.sub(r'\W+',' ',text) text=text.lower() return text folderpath='d:/induvidual-articles' counter=Counter() filepaths = glob(os.path.join(folderpath,'*.txt')) num_files = len(filepaths) with open('topics.txt','r') as filehandle: lines = filehandle.read() words = removegarbage(lines).split() counter.update(words) for word, count in counter.most_common(): probability=count//num_files print('{} {} {}'.format(word,count,probability)) ...</description>
			<content:encoded><![CDATA[ <pre><code class="language-py">import os
    import re
    import sys
    sys.stdout=open('f1.txt','w')
    from collections import Counter
    from glob import glob

    def removegarbage(text):
        text=re.sub(r'\W+',' ',text)
        text=text.lower()
        return text

    folderpath='d:/induvidual-articles'
    counter=Counter()


    filepaths = glob(os.path.join(folderpath,'*.txt'))

    num_files = len(filepaths)

    with open('topics.txt','r') as filehandle:
        lines = filehandle.read()
        words = removegarbage(lines).split()
       counter.update(words)


    for word, count in counter.most_common():
        probability=count//num_files
        print('{}  {} {}'.format(word,count,probability))
</code></pre>

<p>i am getting  a zero division error:float division by zero<br />
for the line<br />
probability=count//num_files</p>

<p>how do i rectify it?</p>

<p>i need my output to be of the form:<br />
word, count ,probability</p>

<p>Plz help!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>farhaana.ahmed.58</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/threads/456844/divide-by-zero-error-in-python</guid>
		</item>
				<item>
			<title>Only allow 2 chars to be input in a console application</title>
			<link>http://www.daniweb.com/software-development/csharp/code/456836/only-allow-2-chars-to-be-input-in-a-console-application</link>
			<pubDate>Mon, 17 Jun 2013 11:40:45 +0000</pubDate>
			<description>Many situations arise when you have to choose between two options: true/false, male/female etc. This short snippet will only allow two chars to pass through: capital 'Y' or capital 'N'. The Read and ReadLine methods can serve also, but have the side effect you have to use Upper and Lower ...</description>
			<content:encoded><![CDATA[ <p>Many situations arise when you have to choose between two options: true/false, male/female etc.<br />
This short snippet will only allow two chars to pass through: capital 'Y' or capital 'N'.<br />
The Read and ReadLine methods can serve also, but have the side effect you have to use Upper and Lower case methods if-statements, or (with ReadLine) testing if only 1 char is input etc.<br />
Notice that the condition in the do - while has to be <strong>false</strong>.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/csharp/61">C#</category>
			<dc:creator>ddanbe</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/csharp/code/456836/only-allow-2-chars-to-be-input-in-a-console-application</guid>
		</item>
				<item>
			<title>Weird SOAP Message Packaging</title>
			<link>http://www.daniweb.com/software-development/csharp/threads/456834/weird-soap-message-packaging</link>
			<pubDate>Mon, 17 Jun 2013 11:13:32 +0000</pubDate>
			<description>I have a proxy generated class file as [System.SerializableAttribute()] { .. .. [System.Xml.Serialization.SoapTypeAttribute(Namespace=&quot;urn:issuing_v_01_02_xsd&quot;)] public class XXXX { private Nullable&lt;decimal&gt; income; private Nullable&lt;decimal&gt; expense; private String memeberName; ... //Properties section with decoration: [SoapElementAttribute(IsNullable=true)] } in my consumer class I obviously create an instance for this object, set all values via set ...</description>
			<content:encoded><![CDATA[ <p>I have a proxy generated class file as</p>

<pre><code class="language-cs">[System.SerializableAttribute()]
{
..
..
[System.Xml.Serialization.SoapTypeAttribute(Namespace="urn:issuing_v_01_02_xsd")]
public class XXXX
{
private Nullable&lt;decimal&gt; income;
private Nullable&lt;decimal&gt; expense;
private String memeberName;
...

//Properties section with decoration: [SoapElementAttribute(IsNullable=true)]

}
</code></pre>

<p>in my consumer class I obviously create an instance for this object, set all values via set properties but strangely after serialization, Property Income element is not present in the xml object graph. tried using various hacks to get this fixed an working but I'm running out of ideas because I believe theoretically and to my experience this should be working especially with SOAP serializer which serializes all public members unless cleared marked to be ignored.</p>

<p>tried using MustSerializeMember pattern but no luck. Has anyone ever came across such a situation or know of what could be causing this ?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/csharp/61">C#</category>
			<dc:creator>mshauny</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/csharp/threads/456834/weird-soap-message-packaging</guid>
		</item>
				<item>
			<title>BufferedStream i/o</title>
			<link>http://www.daniweb.com/software-development/java/threads/456833/bufferedstream-io</link>
			<pubDate>Mon, 17 Jun 2013 10:47:26 +0000</pubDate>
			<description>Could you please explain me what is a BufferedStream (what is a buffer and how it should be used?)? I have used a code that uses bufferedstream to write to a .txt file. I got the code while googling but don't know the theory behind how it works... please explain.</description>
			<content:encoded><![CDATA[ <p>Could you please explain me what is a BufferedStream (what is a buffer and how it should be used?)? I have used a code that uses bufferedstream to write to a .txt file. I got the code while googling but don't know the theory behind how it works... please explain.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>abra_ka_dabra</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456833/bufferedstream-io</guid>
		</item>
				<item>
			<title>Java JDK adn JRE</title>
			<link>http://www.daniweb.com/software-development/java/threads/456829/java-jdk-adn-jre</link>
			<pubDate>Mon, 17 Jun 2013 09:48:51 +0000</pubDate>
			<description>What is the difference between JDK and JRE? I know its silly to ask but i am shameless till i get my things get clarified... :D</description>
			<content:encoded><![CDATA[ <p>What is the difference between JDK and JRE? I know its silly to ask but i am shameless till i get my things get clarified... :D</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>abra_ka_dabra</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456829/java-jdk-adn-jre</guid>
		</item>
				<item>
			<title>Learning C</title>
			<link>http://www.daniweb.com/software-development/c/threads/456816/learning-c</link>
			<pubDate>Mon, 17 Jun 2013 07:17:01 +0000</pubDate>
			<description>Hello members... How are you all ??? I just started the programming and want to learn C for that.. so please tell me the best book to learn the C from the starting... Thank you in advance......</description>
			<content:encoded><![CDATA[ <p>Hello members...<br />
How are you all ???<br />
I just started the programming and want to learn C for that..<br />
so please tell me the best book to learn the C from the starting...<br />
Thank you in advance......</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>Aadhya169</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456816/learning-c</guid>
		</item>
				<item>
			<title>Program crashes while getting char input</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456815/program-crashes-while-getting-char-input</link>
			<pubDate>Mon, 17 Jun 2013 07:06:02 +0000</pubDate>
			<description>Hi there, I am implementing simple student class when i run the program it crashes after getting input for char* name. Program is as follows. #include &lt;iostream&gt; using namespace std; class Student { private: char* name; int rollNo; float cgpa; public: Student() { name = &quot;&quot;; rollNo = 0; cgpa ...</description>
			<content:encoded><![CDATA[ <p>Hi there,</p>

<p>I am implementing simple student class when i run the program it crashes after getting input for char* name. Program is as follows.</p>

<pre><code class="language-cpp">#include &lt;iostream&gt;

using namespace std;

class Student
{
    private:

        char* name;
        int rollNo;
        float cgpa;

    public:

        Student()
        {
            name = "";
            rollNo = 0;
            cgpa = 0.0;
        }

        void setName()
        {
            cout&lt;&lt;"Enter name : "&lt;&lt;flush;   //after input my program crashes
            cin &gt;&gt; name;
        }

        void setName(char* newName)
        {
            name = newName;
        }

        char* getName()
        {
            return name;
        }

        void setRollNo()
        {
            cout&lt;&lt;"Enter roll no : "&lt;&lt;flush;
            cin &gt;&gt; rollNo;
        }

        void setRollNo(int newRollNo)
        {
            rollNo = newRollNo;
        }

        int getRollNo()
        {
            return rollNo;
        }

        void setCgpa()
        {
            cout&lt;&lt;"Enter cgpa : "&lt;&lt;flush;
            cin &gt;&gt; cgpa;
        }

        void setCgpa(float newCgpa)
        {
            cgpa = newCgpa;
        }

        float getCgpa()
        {
            return cgpa;
        }
};

int main()
{

    Student s1;

    //s1.setName("Ahmad");
    s1.setName();
    cout&lt;&lt;"Name :\t\t"&lt;&lt;s1.getName() &lt;&lt;endl;
    //s1.setRollNo(23);
    s1.setRollNo();
    cout&lt;&lt;"Roll no :\t" &lt;&lt;s1.getRollNo() &lt;&lt;endl;
    //s1.setCgpa(3.45);
    s1.setCgpa();
    cout&lt;&lt;"Cgpa :\t\t" &lt;&lt;s1.getCgpa() &lt;&lt;endl;

    return 0;
}
</code></pre>

<p>Please see the comment where my program crashes, I don't know why ? Please help and explain, I am using Code Blocks. Thanks.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>new_developer</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456815/program-crashes-while-getting-char-input</guid>
		</item>
				<item>
			<title>my assignment</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456807/my-assignment</link>
			<pubDate>Mon, 17 Jun 2013 04:55:58 +0000</pubDate>
			<description>**PLS HELP ME, design a digitally controlled washing machine that sets the wash temperature to 80degree celcius for cotten clothes 40degree celcius per quick wash and 1000 revolution for rinse and dry only using MICRO SOFT V. STUDIO 2010 c++ programming, PLS ITS URGENT!</description>
			<content:encoded><![CDATA[ <p>**PLS HELP ME,  design a digitally controlled  washing machine that sets the wash temperature to 80degree celcius<br />
for cotten clothes 40degree celcius per quick wash and 1000 revolution for rinse and dry only using<br />
MICRO SOFT V. STUDIO 2010 c++ programming, PLS ITS URGENT!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>alaba81</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456807/my-assignment</guid>
		</item>
				<item>
			<title>discussion thread</title>
			<link>http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/456803/discussion-thread</link>
			<pubDate>Mon, 17 Jun 2013 01:51:50 +0000</pubDate>
			<description>how to start a visual basic 6.0</description>
			<content:encoded><![CDATA[ <p>how to start a visual basic 6.0</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/visual-basic-4-5-6/4">Visual Basic 4 / 5 / 6</category>
			<dc:creator>alaya</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/456803/discussion-thread</guid>
		</item>
				<item>
			<title>XSL Processor Stack has Overflowed</title>
			<link>http://www.daniweb.com/software-development/xml-xslt-and-xpath/threads/456801/xsl-processor-stack-has-overflowed</link>
			<pubDate>Mon, 17 Jun 2013 00:32:36 +0000</pubDate>
			<description>Not entirely sure what's happening. I've managed to narrow down the template where this error is occurring &lt;xsl:template match=&quot;Application/Comment&quot;&gt; &lt;xsl:copy&gt; &lt;xsl:choose&gt; &lt;xsl:when test=&quot;string($ImportXML/Application/Comment)&quot;&gt; &lt;xsl:apply-templates select=&quot;$ImportXML/Application/Comment/text()&quot;/&gt; &lt;/xsl:when&gt; &lt;xsl:otherwise&gt; &lt;xsl:apply-templates select=&quot;.&quot;/&gt; &lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; $ImportXML/Application/Comment = &quot;test&quot;. Essentially, I'm trying to update my document so that the XPath Application/Comment is now ...</description>
			<content:encoded><![CDATA[ <p>Not entirely sure what's happening. I've managed to narrow down the template where this error is occurring</p>

<pre><code class="language-xml">&lt;xsl:template match="Application/Comment"&gt;
    &lt;xsl:copy&gt;
        &lt;xsl:choose&gt;
            &lt;xsl:when test="string($ImportXML/Application/Comment)"&gt;
                &lt;xsl:apply-templates select="$ImportXML/Application/Comment/text()"/&gt;
            &lt;/xsl:when&gt;
            &lt;xsl:otherwise&gt;
                &lt;xsl:apply-templates select="."/&gt;
            &lt;/xsl:otherwise&gt;
        &lt;/xsl:choose&gt;
    &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;
</code></pre>

<p>$ImportXML/Application/Comment = "test". Essentially, I'm trying to update my document so that the XPath Application/Comment is now populated with "test". It is currently a blank element with no text or value but when I run the stylesheet over the xml, I am left with that error message</p>

<p>Can anyone help? Would be greatly appreciated.</p>

<p>By the way, I am using XSL version 1.0</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/xml-xslt-and-xpath/134">XML, XSLT and XPATH</category>
			<dc:creator>f_atencia</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/xml-xslt-and-xpath/threads/456801/xsl-processor-stack-has-overflowed</guid>
		</item>
				<item>
			<title>Insert into sparse matrix as linked list</title>
			<link>http://www.daniweb.com/software-development/c/threads/456800/insert-into-sparse-matrix-as-linked-list</link>
			<pubDate>Sun, 16 Jun 2013 22:21:19 +0000</pubDate>
			<description>Can someone coment this code in detail, I can't quite understand algorithm behind this? typedef struct node{ int x; int y; int value; struct node* row; struct node* col; }node; typedef struct matrix{ int height; int width; node** rowList; node** colList; }matrix; void insert(matrix** M, int row_index, int col_index, int ...</description>
			<content:encoded><![CDATA[ <p>Can someone coment this code in detail, I can't quite understand algorithm behind this?</p>

<pre><code class="language-c">typedef struct node{
int x;
int y;
int value;
struct node* row;
struct node* col;
}node;

typedef struct matrix{
int height;
int width; 
node** rowList;
node** colList;
}matrix;

void insert(matrix** M, int row_index, int col_index, int value)
{
    node* currNode=(node*)malloc(sizeof(node));
    currNode-&gt;x=row_index;
    currNode-&gt;y=col_index;
    currNode-&gt;value=value;

    if ((*M)-&gt;rowList[row_index] == NULL) { 
        currNode-&gt;row = NULL;
        (*M)-&gt;rowList[row_index] = currNode;
    }
    else if ((*M)-&gt;rowList[row_index]-&gt;y &gt; col_index) {
        currNode-&gt;col = (*M)-&gt;rowList[row_index];
        (*M)-&gt;rowList[row_index] = currNode;
    }
    else if ((*M)-&gt;rowList[row_index]-&gt;y &lt; col_index) { 
        node* rowptr = (node*)malloc(sizeof(node));
        rowptr = (*M)-&gt;rowList[row_index];
        while(rowptr-&gt;col!=NULL&amp;&amp;rowptr-&gt;col-&gt;y &lt; col_index)
            rowptr=rowptr-&gt;col;     

        currNode-&gt;col=rowptr-&gt;col;
        rowptr-&gt;col=currNode;

    }

    if ((*M)-&gt;colList[col_index] == NULL) { 
        currNode-&gt;col = NULL;
        (*M)-&gt;colList[col_index] = currNode;
    }
    else
    if ((*M)-&gt;colList[col_index]-&gt;x &gt; row_index) { 
        currNode-&gt;row = (*M)-&gt;colList[col_index];
        (*M)-&gt;colList[col_index] = currNode;
    }
}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>suncica2222</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456800/insert-into-sparse-matrix-as-linked-list</guid>
		</item>
				<item>
			<title>How do I access XML data in WebBrowser control?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456798/how-do-i-access-xml-data-in-webbrowser-control</link>
			<pubDate>Sun, 16 Jun 2013 22:09:01 +0000</pubDate>
			<description>Thanks to diafol for putting me wise to the imdb api. Unfortunately, due to my ignorance of all things related to web programming I am stuck. I fetch my information via the following Dim url As String = &quot;http://mymovieapi.com/?title=@title&amp;type=xml&amp;plot=full&amp;episode=0&amp;limit=1&amp;year=@year&amp;yg=1&amp;mt=M&amp;lang=en-US&amp;offset=&amp;aka=simple&amp;release=simple&amp;business=0&amp;tech=0&quot; url = Replace(url, &quot;@title&quot;, &quot;Star+Trek&quot;) url = Replace(url, &quot;@year&quot;, &quot;1979&quot;) WebBrowser1.Navigate(url) ...</description>
			<content:encoded><![CDATA[ <p>Thanks to diafol for putting me wise to the imdb api. Unfortunately, due to my ignorance of all things related to web programming I am stuck. I fetch my information via the following</p>

<pre><code class="language-vb">Dim url As String = "<a href="http://mymovieapi.com/?title=@title&amp;type=xml&amp;plot=full&amp;episode=0&amp;limit=1&amp;year=@year&amp;yg=1&amp;mt=M&amp;lang=en-US&amp;offset=&amp;aka=simple&amp;release=simple&amp;business=0&amp;tech=0" rel="nofollow">http://mymovieapi.com/?title=@title&amp;type=xml&amp;plot=full&amp;episode=0&amp;limit=1&amp;year=@year&amp;yg=1&amp;mt=M&amp;lang=en-US&amp;offset=&amp;aka=simple&amp;release=simple&amp;business=0&amp;tech=0</a>"

url = Replace(url, "@title", "Star+Trek")
url = Replace(url, "@year", "1979")

WebBrowser1.Navigate(url)
</code></pre>

<p>I fetch the result in the Navigated event handler as follows</p>

<pre><code class="language-vb">Dim result As String = WebBrowser1.DocumentText
</code></pre>

<p>That's when I run into problems. When I display the value of <strong>result</strong> in a textbox I get</p>

<pre><code class="language-vb">&lt;HTML&gt;&lt;HEAD&gt;
&lt;STYLE&gt;BODY{font:x-small 'Verdana';margin-right:1.5em}
.c{cursor:hand}
.b{color:red;font-family:'Courier New';font-weight:bold;text-decoration:none}
.e{margin-left:1em;text-indent:-1em;margin-right:1em}
.k{margin-left:1em;text-indent:-1em;margin-right:1em}
.t{color:#990000}
.xt{color:#990099}
.ns{color:red}
.dt{color:green}
.m{color:blue}
.tx{font-weight:bold}
.db{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;border-left:1px solid #CCCCCC;font:small Courier}
.di{font:small Courier}
.d{color:blue}
.pi{color:blue}
.cb{text-indent:0px;margin-left:1em;margin-top:0px;margin-bottom:0px;padding-left:.3em;font:small Courier;color:#888888}
.ci{font:small Courier;color:#888888}
PRE{margin:0px;display:inline}&lt;/STYLE&gt;
&lt;SCRIPT&gt;&lt;!--
function f(e){
if (e.className=="ci"){if (e.children(0).innerText.indexOf("\n")&gt;0) fix(e,"cb");}
if (e.className=="di"){if (e.children(0).innerText.indexOf("\n")&gt;0) fix(e,"db");}
e.id="";
}
function fix(e,cl){
e.className=cl;
e.style.display="block";
j=e.parentElement.children(0);
j.className="c";
k=j.children(0);
k.style.visibility="visible";
k.href="#";
}
function ch(e){
mark=e.children(0).children(0);
if (mark.innerText=="+"){
mark.innerText="-";
for (var i=1;i&lt;e.children.length;i++)
e.children(i).style.display="block";
}
else if (mark.innerText=="-"){
mark.innerText="+";
for (var i=1;i&lt;e.children.length;i++)
e.children(i).style.display="none";
}}
function ch2(e){
mark=e.children(0).children(0);
contents=e.children(1);
if (mark.innerText=="+"){
mark.innerText="-";
if (contents.className=="db"||contents.className=="cb")
contents.style.display="block";
else contents.style.display="inline";
}
else if (mark.innerText=="-"){
mark.innerText="+";
contents.style.display="none";
}}
function cl(){
e=window.event.srcElement;
if (e.className!="c"){e=e.parentElement;if (e.className!="c"){return;}}
e=e.parentElement;
if (e.className=="e") ch(e);
if (e.className=="k") ch2(e);
}
function ex(){}
function h(){window.status=" ";}
document.onclick=cl;
--&gt;&lt;/SCRIPT&gt;
&lt;/HEAD&gt;
&lt;BODY class="st"&gt;&lt;DIV class="e"&gt;
&lt;SPAN class="b"&gt;&amp;nbsp;&lt;/SPAN&gt;
&lt;SPAN class="m"&gt;&amp;lt;?&lt;/SPAN&gt;&lt;SPAN class="pi"&gt;xml version="1.0" encoding="utf-8" &lt;/SPAN&gt;&lt;SPAN class="m"&gt;?&amp;gt;&lt;/SPAN&gt;
&lt;/DIV&gt;
&lt;DIV class="e"&gt;
&lt;DIV class="c" STYLE="margin-left:1em;text-indent:-2em"&gt;&lt;A href="#" onclick="return false" onfocus="h()" class="b"&gt;-&lt;/A&gt;
&lt;SPAN class="m"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;IMDBDocumentList&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;DIV class="e"&gt;
&lt;DIV class="c" STYLE="margin-left:1em;text-indent:-2em"&gt;&lt;A href="#" onclick="return false" onfocus="h()" class="b"&gt;-&lt;/A&gt;
&lt;SPAN class="m"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;item&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;DIV class="e"&gt;&lt;DIV STYLE="margin-left:1em;text-indent:-2em"&gt;
&lt;SPAN class="b"&gt;&amp;nbsp;&lt;/SPAN&gt;
&lt;SPAN class="m"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;rating&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="tx"&gt;6.3&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class="t"&gt;rating&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV class="e"&gt;&lt;DIV STYLE="margin-left:1em;text-indent:-2em"&gt;
&lt;SPAN class="b"&gt;&amp;nbsp;&lt;/SPAN&gt;
&lt;SPAN class="m"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;rating_count&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="tx"&gt;37814&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class="t"&gt;rating_count&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV class="e"&gt;&lt;DIV STYLE="margin-left:1em;text-indent:-2em"&gt;
&lt;SPAN class="b"&gt;&amp;nbsp;&lt;/SPAN&gt;
&lt;SPAN class="m"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;year&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="tx"&gt;1979&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class="t"&gt;year&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;/DIV&gt;&lt;/DIV&gt;
&lt;DIV class="e"&gt;&lt;DIV STYLE="margin-left:1em;text-indent:-2em"&gt;
&lt;SPAN class="b"&gt;&amp;nbsp;&lt;/SPAN&gt;
&lt;SPAN class="m"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="t"&gt;plot&lt;/SPAN&gt;&lt;SPAN class="m"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="tx"&gt;An alien phenomenon of unprecedented size and power is approaching Earth, destroying everything in its path. The only starship in range is the USS Enterprise--still in drydock after a ma
</code></pre>

<p>However, the actual text displayed in the WebBrowser control (which is what I want for parsing) is</p>

<pre><code class="language-vb">  &lt;?xml version="1.0" encoding="utf-8" ?&gt; 
- &lt;IMDBDocumentList&gt;
- &lt;item&gt;
  &lt;rating&gt;6.3&lt;/rating&gt; 
  &lt;rating_count&gt;37814&lt;/rating_count&gt; 
  &lt;year&gt;1979&lt;/year&gt; 
  &lt;plot&gt;An alien phenomenon of unprecedented size and power is approaching Earth, destroying everything in its path. The only starship in range is the USS Enterprise--still in drydock after a major overhaul. As Captain Decker readies his ship and his crew to face this menace, the legendary Admiral James T. Kirk arrives with orders to take command of the Enterprise and intercept the intruder. But it has been three years since Kirk last commanded the Enterprise on its historic five year mission... is he up to the task of saving the Earth?&lt;/plot&gt; 
- &lt;genres&gt;
  &lt;item&gt;Action&lt;/item&gt; 
  &lt;item&gt;Adventure&lt;/item&gt; 
  &lt;item&gt;Mystery&lt;/item&gt; 
  &lt;item&gt;Sci-Fi&lt;/item&gt; 
  &lt;/genres&gt;
  &lt;rated&gt;G&lt;/rated&gt; 
  &lt;title&gt;Star Trek: The Motion Picture&lt;/title&gt; 
  &lt;imdb_url&gt;<a href="http://www.imdb.com/title/tt0079945/" rel="nofollow">http://www.imdb.com/title/tt0079945/</a>&lt;/imdb_url&gt; 
- &lt;directors&gt;
  &lt;item&gt;Robert Wise&lt;/item&gt; 
  &lt;/directors&gt;
- &lt;writers&gt;
  &lt;item&gt;Gene Roddenberry&lt;/item&gt; 
  &lt;item&gt;Alan Dean Foster&lt;/item&gt; 
  &lt;item&gt;and 1 more credit&lt;/item&gt; 
  &lt;/writers&gt;
- &lt;actors&gt;
  &lt;item&gt;William Shatner&lt;/item&gt; 
  &lt;item&gt;Leonard Nimoy&lt;/item&gt; 
  &lt;item&gt;DeForest Kelley&lt;/item&gt; 
  &lt;item&gt;James Doohan&lt;/item&gt; 
  &lt;item&gt;George Takei&lt;/item&gt; 
  &lt;item&gt;Majel Barrett&lt;/item&gt; 
  &lt;item&gt;Walter Koenig&lt;/item&gt; 
  &lt;item&gt;Nichelle Nichols&lt;/item&gt; 
  &lt;item&gt;Persis Khambatta&lt;/item&gt; 
  &lt;item&gt;Stephen Collins&lt;/item&gt; 
  &lt;item&gt;Grace Lee Whitney&lt;/item&gt; 
  &lt;item&gt;Mark Lenard&lt;/item&gt; 
  &lt;item&gt;Billy Van Zandt&lt;/item&gt; 
  &lt;item&gt;Roger Aaron Brown&lt;/item&gt; 
  &lt;item&gt;Gary Faga&lt;/item&gt; 
  &lt;/actors&gt;
  &lt;plot_simple&gt;When a destructive space entity is spotted approaching Earth, Admiral Kirk resumes command of the Starship Enterprise in order to intercept, examine and hopefully stop it.&lt;/plot_simple&gt; 
  &lt;type&gt;M&lt;/type&gt; 
  &lt;poster&gt;<a href="http://ia.media-imdb.com/images/M/MV5BMTQ5MzM5ODk5OV5BMl5BanBnXkFtZTcwNDY1NDYyMQ@@._V1._SY317_.jpg" rel="nofollow">http://ia.media-imdb.com/images/M/MV5BMTQ5MzM5ODk5OV5BMl5BanBnXkFtZTcwNDY1NDYyMQ@@._V1._SY317_.jpg</a>&lt;/poster&gt; 
  &lt;imdb_id&gt;tt0079945&lt;/imdb_id&gt; 
- &lt;also_known_as&gt;
  &lt;item&gt;Star Trek: The Motion Picture - The Director's Edition&lt;/item&gt; 
  &lt;/also_known_as&gt;
- &lt;language&gt;
  &lt;item&gt;English&lt;/item&gt; 
  &lt;item&gt;Klingon&lt;/item&gt; 
  &lt;/language&gt;
- &lt;country&gt;
  &lt;item&gt;USA&lt;/item&gt; 
  &lt;/country&gt;
  &lt;release_date&gt;19791207&lt;/release_date&gt; 
  &lt;filming_locations&gt;Paramount Studios - 5555 Melrose Avenue, Hollywood, Los Angeles, California, USA&lt;/filming_locations&gt; 
- &lt;runtime&gt;
  &lt;item&gt;132 min&lt;/item&gt; 
  &lt;item&gt;USA: 136 min (director's cut)&lt;/item&gt; 
  &lt;item&gt;USA: 143 min (TV version)&lt;/item&gt; 
  &lt;/runtime&gt;
  &lt;/item&gt;
  &lt;/IMDBDocumentList&gt;
</code></pre>

<p>How do I get at the actual WebBrowser XML data? Bonus question - why is <strong>result</strong> truncated to 4095 characters (a very suspicious number, indeed)?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Reverend Jim</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456798/how-do-i-access-xml-data-in-webbrowser-control</guid>
		</item>
				<item>
			<title>How to add JRadio Button at run time</title>
			<link>http://www.daniweb.com/software-development/java/threads/456797/how-to-add-jradio-button-at-run-time</link>
			<pubDate>Sun, 16 Jun 2013 21:02:00 +0000</pubDate>
			<description>I am using Netbeans 7.1 and MySQL. I need 1 column in jtable which will contain jradiobutton and user can select any 1 row's jradiobutton Please refer the fig for detail. After selecting RB further processing will be done on jbutton click event. ![64496cca6997d07cf995950d67a3e3f0](/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy8yLzY0NDk2Y2NhNjk5N2QwN2NmOTk1OTUwZDY3YTNlM2YwLkpQRw%3D%3D/500 &quot;64496cca6997d07cf995950d67a3e3f0&quot;) Here is the code - ...</description>
			<content:encoded><![CDATA[ <p>I am using Netbeans 7.1 and MySQL. I need 1 column in jtable which will contain jradiobutton and user can select any 1 row's jradiobutton Please refer the fig for detail. After selecting RB further processing will be done on jbutton click event.<br /><img src="/attachments/fetch/L2ltYWdlcy9hdHRhY2htZW50cy8yLzY0NDk2Y2NhNjk5N2QwN2NmOTk1OTUwZDY3YTNlM2YwLkpQRw%3D%3D/500" alt="64496cca6997d07cf995950d67a3e3f0" title="64496cca6997d07cf995950d67a3e3f0" /></p>

<p>Here is the code -</p>

<pre><code class="language-java">    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        final Object[] columnNames=new String[] {"Date","Flight Name","Departure Time","BC Seats Available","XC Seats Available","EC Seats Available"};
        DefaultTableModel dtm=new DefaultTableModel(columnNames,0);        
        String origin=jComboBox3.getSelectedItem().toString();
        String target=jComboBox4.getSelectedItem().toString();
        String fclass=jComboBox1.getSelectedItem().toString();
        String search = "";
        Date dt;

        //Economy Class Processing

        try
        {
           smt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
           rs = smt.executeQuery(sql);
           int i = 0;
           SimpleDateFormat sdf= new SimpleDateFormat("dd-MM-yyyy");
           boolean empty=true;
           String var1="", var2="", var3="", var4="", var5="";
           while(rs.next())
           {
               empty=false;
               var1=rs.getString(1);
               strdtver1=(String) sdf.format(rs.getDate(2));
               var2=Integer.toString(rs.getInt(3));
               var3=Integer.toString(rs.getInt(4));
               var4=Integer.toString(rs.getInt(5));
               var5=rs.getString(6);
               dtm.addRow(new Vector());
               dtm.setValueAt(strdtver1, i, 0);
               dtm.setValueAt(var1, i, 1);
               dtm.setValueAt(var5, i, 2);
               dtm.setValueAt(var2, i, 3);
               dtm.setValueAt(var3, i, 4);
               dtm.setValueAt(var4, i, 5);
               i++;

           }
           if(empty)
           {
               dtm.addRow(new Vector());
               strdtver2=(String) sdf.format(jDateChooser1.getDate());
               dtm.setValueAt(strdtver2, i, 0);
               dtm.setValueAt("No Flights", i, 1);
               dtm.setValueAt("No Flights", i, 2);
               dtm.setValueAt("0", i, 3);
               dtm.setValueAt("0", i, 4);
               dtm.setValueAt("0", i, 5);
           }
           jTable1.setModel(dtm);
           TableColumnModel m=jTable1.getColumnModel();
           TableColumn col=m.getColumn(3);
           TableColumn col1=m.getColumn(4);
           //List&lt;TableColumn&gt; removed=col;
           //removed.add(col);
           m.removeColumn(col);
           m.removeColumn(col1);
        }
        catch(Exception ex)
        {
            System.out.println(ex.getMessage());
            ex.printStackTrace();
        }
    }
</code></pre>

<p>I simply want to add JRadioButton and user can select any 1 row JRadioButto,</p>

<p>Thank you all in advance for any suggestion and guidance</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>vishalonne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456797/how-to-add-jradio-button-at-run-time</guid>
		</item>
				<item>
			<title>calculate carbon footprint program</title>
			<link>http://www.daniweb.com/software-development/java/threads/456795/calculate-carbon-footprint-program</link>
			<pubDate>Sun, 16 Jun 2013 20:26:53 +0000</pubDate>
			<description>Chaps, I have just read about java interfaces and there is a nice exercise in my book that I would like to attempt, so I was wondering if you could help me to identify the best way to go about it. Here's the exercise: &quot;Create 3 small classes unrelated by ...</description>
			<content:encoded><![CDATA[ <p>Chaps, I have just read about java interfaces and there is a nice exercise in my book that I would like to attempt, so I was wondering if you could help me to identify the best way to go about it. Here's the exercise:<br />
"Create 3 small classes unrelated by inheritance - classes <code>Building</code>, <code>Car</code> and <code>Bicycle</code>. Give each class some unique appropriate attributes and  behaviours that it doesn't have in common with other classes. Write an interface <code>CarbonFootprint</code> with a <code>getCarbonFootprint</code> method. Have each of your classes implement that interface so that its <code>getCarbonFootprint</code> method calculates an appropriate carbon foorptint for that class (check out a few sites that explains how to calculate carbon footprint).<br />
Write an application that creates objects oh each of the 3 classes, places references to those objects in <code>ArrayLists&lt;CarbonFootprint&gt;</code>, then iterates through the <code>ArrayLists</code>, polymorphycally invoking each object's <code>getCarbonFootprint</code> method. For each object print some identifying information and the object's carbon footprint".</p>

<p>Now, first of all, let me say that I don't really care about the accuracy of the carbon footprint calculation, because I am not going to build an application that somebody will actually use (there are plenty of online calculators for that), this is just an exercise aimed at helping me to understand interfaces a bit more and the usage of <code>ArrayLists&lt;T&gt;</code> which I have never used.</p>

<p>I had a look at how the footprint is calculated and these are the formulas I was thinking to use:<br />
For a car:<br />
carbon footprint = ((averageYearlyMiles * AverageMPG) * 9kg/gallon) because allegedly one gallon of gas emits 9kg of co2. (source: <a href="http://www.motherearthnews.com/nature-and-environment/carbon-footprint-calculator.aspx#axzz2WOzrsqNS" rel="nofollow">http://www.motherearthnews.com/nature-and-environment/carbon-footprint-calculator.aspx#axzz2WOzrsqNS</a>)</p>

<p>For a house:<br />
carbon footprint = monthly electricity kWh * 12 source <a href="http://www.howany.com/how-to-calculate-carbon-footprint/" rel="nofollow">http://www.howany.com/how-to-calculate-carbon-footprint/</a></p>

<p>For a bike<br />
carbon footprint = miles * 34 (takes 34 calories to bike a  mile apparently) source: <a href="http://twtitw.firebus.com/node/100" rel="nofollow">http://twtitw.firebus.com/node/100</a></p>

<p>Obviously if you have any suggestion as to how to calculate that, let me know.<br />
The questions I have are:<br />
1) is it worth doing some pseudocode? I mean in this program I will only create some objects and then calculate the carbon footprint.<br />
2)what sort of relevant attribute and behaviours do you think each of the classes should have? I was thinking that there won't be many. For example:<br />
Car:<br />
-relevant behaviours? Can't think of any<br />
attributes:<br />
-miles in a year<br />
-MPG<br />
-kg of co2 (constant amounting to 9)</p>

<p>Bike:<br />
-relevant behaviours? Can't think of any<br />
attributes:<br />
-miles in a year<br />
-calories per mile (constant amounting to 34)</p>

<p>house<br />
-relevant behaviours? Can't think of any<br />
attributes:<br />
-monthly Kwh<br />
-months (constant amounting to 12)</p>

<p>Is there anything else I need?<br />
thanks</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>Violet_82</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456795/calculate-carbon-footprint-program</guid>
		</item>
				<item>
			<title>Create Setup exe</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456791/create-setup-exe</link>
			<pubDate>Sun, 16 Jun 2013 19:00:43 +0000</pubDate>
			<description>I developed a software using VB.net. (With VS 2008 Professional edition) The Project has Crystal reports in a folder. I want to make a setup exe with that folder. there are few videos in youtube for this. But I couldnt find any form or video that adding folder to the ...</description>
			<content:encoded><![CDATA[ <p>I developed a software using VB.net. (With VS 2008 Professional edition) The Project has Crystal reports in a folder. I want to make a setup exe with that folder. there are few videos in youtube for this. But I couldnt find any form or video that adding folder to the setup file. Please tell me how to do this.<br />
This is what i did up to now.<br />
In project properties --&gt; Publish --&gt; Publish wizard button click --&gt; gave a path and NEXT --&gt; NEXT --&gt;NEXT --&gt;NEXT --&gt; Finish<br />
Setup is created without crystal report folder. Actually i have no any clear idea how to add a folder to setup project.<br />
Please tell the way of doing this......</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>weeraa</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456791/create-setup-exe</guid>
		</item>
				<item>
			<title>Writing PHP Source Formatter</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456790/writing-php-source-formatter</link>
			<pubDate>Sun, 16 Jun 2013 18:45:43 +0000</pubDate>
			<description>As heading shouts, I need to make source code formatter to format PHP Codes. RobertoP have written nice Lexical analyzer that means no need for me to tokenize file. I just do not know how to &quot;juggle&quot; with tokens to produce the formatted code. I appreciate any pointer especially simple ...</description>
			<content:encoded><![CDATA[ <p>As heading shouts, I need to make source code formatter to format PHP Codes.<br />
RobertoP have written nice Lexical analyzer that means no need for me to tokenize file.<br />
I just do not know how to "juggle" with tokens to produce the formatted code.<br />
I appreciate any pointer especially simple tutorial.<br />
Analyzer class is <a href="https://github.com/robertop/pelet/blob/master/src/LexicalAnalyzerClass.cpp" rel="nofollow">here</a><br />
TIA,<br />
Stefano</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>Stefano Mtangoo</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456790/writing-php-source-formatter</guid>
		</item>
				<item>
			<title>Help with JIT error</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456789/help-with-jit-error</link>
			<pubDate>Sun, 16 Jun 2013 18:42:03 +0000</pubDate>
			<description>Hi All, Cannot for the life of me figure out what is wrong with application, when I run on laptop cannot get error to replicate however on tablet which application is designed to run on cannot figure it out. I have a windows form which is opened as an mdi ...</description>
			<content:encoded><![CDATA[ <p>Hi All,</p>

<p>Cannot for the life of me figure out what is wrong with application, when I run on laptop cannot get error to replicate however on tablet which application is designed to run on cannot figure it out.</p>

<p>I have a windows form which is opened as an mdi child, it contains lots of combo boxes, check boxes, radio buttons etc... Loads fine however when the cancel button is clicked (simple Me.Close) it throws up the following JIT error:</p>

<pre><code class="language-vb">See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at System.Collections.Generic.List`1.Enumerator.MoveNext()
   at Microsoft.VisualBasic.PowerPacks.ShapeCollection.Dispose(Boolean disposing)
   at Microsoft.VisualBasic.PowerPacks.ShapeContainer.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at System.Windows.Forms.Control.Dispose(Boolean disposing)
   at System.ComponentModel.Component.Dispose()
   at System.Windows.Forms.Control.Dispose(Boolean disposing)
   at System.Windows.Forms.Form.Dispose(Boolean disposing)
   at BHXAOMS.WildlifeStrike.Dispose(Boolean disposing)
   at System.Windows.Forms.Form.WmClose(Message&amp; m)
   at System.Windows.Forms.Form.WndProc(Message&amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.296 (RTMGDR.030319-2900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
BHX AOMS
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Will%20Fuller/AppData/Local/Apps/2.0/Z74A4LDA.YC1/K3NK3V5E.WT8/bhxa..tion_2c24d50aa6120301_0001.0002_5f78faf5eabf05b2/BHX%20AOMS.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1001 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.233 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1002 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1001 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.237 (RTMGDR.030319-2300)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.233 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 built by: RTMRel
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Microsoft.VisualBasic.PowerPacks.Vs
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.20911.1
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic.PowerPacks.Vs/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.PowerPacks.Vs.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

&lt;configuration&gt;
    &lt;system.windows.forms jitDebugging="true" /&gt;
&lt;/configuration&gt;

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
</code></pre>

<p>Really stuck on this one, help.</p>

<p>Cheers Will</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>thewilf</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456789/help-with-jit-error</guid>
		</item>
				<item>
			<title>Want to learn Programming</title>
			<link>http://www.daniweb.com/software-development/threads/456786/want-to-learn-programming</link>
			<pubDate>Sun, 16 Jun 2013 17:23:36 +0000</pubDate>
			<description>Hi! I want to learn programming. I'm 14 years old and very fond of computing. The only problem I face is *Which programming language should I learn?* or should I learn *Programming* i.e I learn the basics of programming so that I will be capable of learning any programming language. ...</description>
			<content:encoded><![CDATA[ <p>Hi! I want to learn programming. I'm 14 years old and very fond of computing. The only problem I face is <em>Which programming language should I learn?</em> or should I learn <em>Programming</em> i.e I learn the basics of programming so that I will be capable of learning any programming language. Also, when you recommend me one of the choice I stated above then please give me resources for learning e.g book names or some websites which will start me learning from scratch. Furthermore, I want to state that I want to create cool games, softwares or even Operating Systems from programming, that might look very odd to some people. I have no previous experience of programming except I was taught GWBASIC in school and we were only taught only 4 to 5 commands and statements. I liked it a lot but, then realised that this programming language is not perfect for my ambitions. I like Python, C, Java and C++ programming language.So, please help me.<br />
Awaiting for your replies anxiously!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/2">Software Development</category>
			<dc:creator>oanahmed</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/threads/456786/want-to-learn-programming</guid>
		</item>
				<item>
			<title>Comparator and Comparable</title>
			<link>http://www.daniweb.com/software-development/java/threads/456781/comparator-and-comparable</link>
			<pubDate>Sun, 16 Jun 2013 16:46:16 +0000</pubDate>
			<description>Hi, I have class of student object with the String student name and double GPA they are stored in array. My GUI have button for sort by name and sort by grade. I want to sort the name and the grade and I want to sort it using Comparator, but ...</description>
			<content:encoded><![CDATA[ <p>Hi,<br />
I have class of student object with the String student name and double GPA they are stored in array. My GUI have button for sort by name and sort by grade. I want to sort the name and the grade and I want to sort it using Comparator, but I don't know what is Comparator and when to use it. Also what is the diffrnet between Comparator and Comparable.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>sk8ergirl</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456781/comparator-and-comparable</guid>
		</item>
				<item>
			<title>how to use &quot;into&quot;</title>
			<link>http://www.daniweb.com/software-development/assembly/threads/456777/how-to-use-into</link>
			<pubDate>Sun, 16 Jun 2013 16:18:03 +0000</pubDate>
			<description>how to use &quot;**into**&quot;?????? this is my example!!!!!! ......................................... add ax,bx into . . . . . . overflow:push ax push bx push cx push dx . . . pop dx pop cx pop bx pop ax iret .................................................... who has other examples of about &quot;**into**&quot;? i want to learn!!!!!! ...</description>
			<content:encoded><![CDATA[ <p>how to use "<strong>into</strong>"??????</p>

<p>this is my example!!!!!!</p>

<p>.........................................</p>

<pre><code>add ax,bx
into
.
.
.

.
.
.
overflow:push ax
         push bx
         push cx
         push dx
         .
         .
         .
         pop dx
         pop cx
         pop bx
         pop ax
         iret
</code></pre>

<p>....................................................</p>

<p>who has other examples of about "<strong>into</strong>"?</p>

<p>i want to learn!!!!!!</p>

<p><strong>i am sorry to disturb to you, and also sorry to ask such a simple question</strong>!!!!!!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/assembly/125">Assembly</category>
			<dc:creator>hellogoodday</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/assembly/threads/456777/how-to-use-into</guid>
		</item>
				<item>
			<title>tnFox - Gui Toolkit?</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456773/tnfox-gui-toolkit</link>
			<pubDate>Sun, 16 Jun 2013 14:57:49 +0000</pubDate>
			<description>Hi again everybody. Has anyone used tnFox Gui Toolkit? I've just looked at FLTK which seems to be perfect if you want to creat a small file size and easy to use. I'm exploring other options like this too. Is tnFox small in filesize. wxWidgets generates a rather big file. ...</description>
			<content:encoded><![CDATA[ <p>Hi again everybody.</p>

<p>Has anyone used tnFox Gui Toolkit?  I've just looked at FLTK which seems to be perfect if you want to creat a small file size and easy to use.  I'm exploring other options like this too.</p>

<p>Is tnFox small in filesize.  wxWidgets generates a rather big file.   Has anyone used it?</p>

<p>Any user reviews on this would be highly appreciated.  If you can suggest another type of Gui Toolkit which creates a small file, is Cross platform and has a RAD tool for building the gui and similar licensing terms (LGPL) it's something I will look into.</p>

<p>Thanks.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>christinetom</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456773/tnfox-gui-toolkit</guid>
		</item>
				<item>
			<title>wstring regex search</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456772/wstring-regex-search</link>
			<pubDate>Sun, 16 Jun 2013 14:41:46 +0000</pubDate>
			<description>I am trying to write some code to regex search against wide strings. The problem I am having is that the regex operations ( `regex_search` in particular ) does not take in wide arguements. Here is the snippet I am having trouble with: Function Header: void scan_filesystem( wpath const&amp; f, ...</description>
			<content:encoded><![CDATA[ <p>I am trying to write some code to regex search against wide strings. The problem I am having is that the regex operations ( <code>regex_search</code> in particular ) does not take in wide arguements. Here is the snippet I am having trouble with:</p>

<p>Function Header:</p>

<pre><code class="language-cpp">void scan_filesystem( wpath const&amp; f,  wregex const&amp; reg, unsigned i = 0 )
</code></pre>

<p>Snippet:</p>

<pre><code class="language-cpp">        while ( !fileStream.eof() ) {
            vector&lt;wstring&gt; tokens;
            wstring line;
            getline( fileStream, line );
            wistringstream iss( line );
            copy( istream_iterator&lt;wstring, wchar_t, char_traits&lt;wchar_t&gt;&gt;(iss),
                istream_iterator&lt;wstring, wchar_t, char_traits&lt;wchar_t&gt;&gt;(),
                back_inserter&lt; vector&lt;wstring&gt; &gt;(tokens));

            auto it = tokens.cbegin();
            auto end = tokens.cend();
            wsmatch m;

            while ( regex_search( it, end, m, reg ) ){

            }

            int br =0;
        }
</code></pre>

<p>Any suggestions on how to <code>regex_search</code> with wide arguements would be greatly appreciated!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>Jorox03</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456772/wstring-regex-search</guid>
		</item>
				<item>
			<title>Mouse right click in Java</title>
			<link>http://www.daniweb.com/software-development/java/threads/456771/mouse-right-click-in-java</link>
			<pubDate>Sun, 16 Jun 2013 14:36:27 +0000</pubDate>
			<description>Hi Everyone, I have a project that requires to use mouse right click. Upon right click, it should display a list of categories(drop down). How Do I do I use right click? Many thanks, Petra</description>
			<content:encoded><![CDATA[ <p>Hi Everyone,</p>

<p>I have a project that requires to use mouse right click. Upon right click, it should display a list of categories(drop down). How Do I do I use right click?</p>

<p>Many thanks,</p>

<p>Petra</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>Petranilla</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456771/mouse-right-click-in-java</guid>
		</item>
				<item>
			<title>Overloading relational operator with two different types</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456763/overloading-relational-operator-with-two-different-types</link>
			<pubDate>Sun, 16 Jun 2013 11:34:59 +0000</pubDate>
			<description>I have two containers with the type of *A* A&lt;string, double&gt; s1; A&lt;string, bool&gt; s2; So I wrote the *A* class with the necessary functions and I used a template&lt;class T, class E&gt; for it. It has a function that returns a value of *E*, in my case, it returns ...</description>
			<content:encoded><![CDATA[ <p>I have two containers with the type of <em>A</em></p>

<pre><code class="language-cpp">A&lt;string, double&gt; s1;
A&lt;string, bool&gt; s2;
</code></pre>

<p>So I wrote the <em>A</em> class with the necessary functions and I used a</p>

<pre><code class="language-cpp">template&lt;class T, class E&gt;
</code></pre>

<p>for it. It has a function that returns a value of <em>E</em>, in my case, it returns a double which I'm trying to compare to another double. I'm supposed to overload the &lt; operator for that, but I have no idea how to do that.</p>

<pre><code class="language-cpp">4.5 &lt; s1.at("a");
</code></pre>

<p>s1.at("a"); returns 1.5, so it's false. I need it to return true.<br />
I thought since they are both double values, I can just</p>

<pre><code class="language-cpp">bool operator&lt; (double&amp; rhs) {
    return rhs &lt; *this;
}
</code></pre>

<p>But it's not working. I also thought it should be friend with two parameters, but it just doesn't make sense since the rhs is a double returned by a function, not a type of <em>A</em>.<br />
So I guess it really is two different types and that's why my first idea is not working.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>sparkthesunoff</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456763/overloading-relational-operator-with-two-different-types</guid>
		</item>
				<item>
			<title>Develp a program to dertermine examination sitting arrangement above 500</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456762/develp-a-program-to-dertermine-examination-sitting-arrangement-above-500</link>
			<pubDate>Sun, 16 Jun 2013 11:20:29 +0000</pubDate>
			<description>Develp a program to dertermine examination sitting arrangementfor classes above 500 in an institution of learning</description>
			<content:encoded><![CDATA[ <p>Develp a program to dertermine examination sitting arrangementfor classes above 500 in an institution of learning</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>davidfunmi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456762/develp-a-program-to-dertermine-examination-sitting-arrangement-above-500</guid>
		</item>
				<item>
			<title>getting sql db values in multiple textboxes instead of datagridveiw</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456761/getting-sql-db-values-in-multiple-textboxes-instead-of-datagridveiw</link>
			<pubDate>Sun, 16 Jun 2013 09:54:27 +0000</pubDate>
			<description>hello folks. i have saved the values of unique_ID.text textbox1.text textbox2.text textbox3.text textbox4.text textbox5.text textbox6.text in columns column_ID and column_1 to column_6 in a table table_1 in database db_1. Now I want to update some values. but for that i want to show the values of column_1 to column_6 in ...</description>
			<content:encoded><![CDATA[ <p>hello folks.<br />
i have saved the values of<br />
unique_ID.text<br />
textbox1.text<br />
textbox2.text<br />
textbox3.text<br />
textbox4.text<br />
textbox5.text<br />
textbox6.text<br />
in columns<br />
column_ID and column_1 to column_6<br />
in a table table_1 in database db_1.</p>

<p>Now I want to update some values. but for that i want to show the values of column_1 to column_6 in textboxes<br />
textbox1.text<br />
textbox2.text<br />
textbox3.text<br />
textbox4.text<br />
textbox5.text<br />
textbox6.text<br />
against a specific ID.</p>

<p>i can search specific ID entered in a textbox but the result is in datagridveiw which i dont want. i want them to fill the textboxes for updation. I hope i made clear the whole scene.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>Affable zaki</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456761/getting-sql-db-values-in-multiple-textboxes-instead-of-datagridveiw</guid>
		</item>
				<item>
			<title>How to convert C++ program to Mips assembly language in MARs assembler?</title>
			<link>http://www.daniweb.com/software-development/assembly/threads/456755/how-to-convert-c-program-to-mips-assembly-language-in-mars-assembler</link>
			<pubDate>Sun, 16 Jun 2013 07:52:56 +0000</pubDate>
			<description>I code this exercise in c++ with title: &quot;count number of occurrences of a character in a string&quot; who can help me? thanks very much My code in c++: #include &quot;stdafx.h&quot; #include &lt;iostream&gt; using namespace std; unsigned count_check(char str[],char a) { unsigned d=0,lenght=strlen(str); for(int i=0;i&lt;lenght;i++) if(str[i]==a) d++; return d; } ...</description>
			<content:encoded><![CDATA[ <p>I code this exercise in c++ with title: "count number of occurrences of a character in a string"<br />
who can help me?<br />
thanks very much<br />
My code in c++:</p>

<pre><code>#include "stdafx.h"
#include &lt;iostream&gt;
using namespace std;
unsigned count_check(char str[],char a)
{
         unsigned d=0,lenght=strlen(str);
         for(int i=0;i&lt;lenght;i++)
           if(str[i]==a)
             d++;
         return d;
}
int main()
{
    char str[100],a;
    cout&lt;&lt;"input a string: ";
    gets(str);
    cout&lt;&lt;"input a character:: ";
    cin&gt;&gt;a;
    cout&lt;&lt;"the number of occurrences: "&lt;&lt;count_check(str,a)&lt;&lt;endl;
    system("PAUSE");
    return EXIT_SUCCESS;
}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/assembly/125">Assembly</category>
			<dc:creator>fenri90</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/assembly/threads/456755/how-to-convert-c-program-to-mips-assembly-language-in-mars-assembler</guid>
		</item>
				<item>
			<title>GridBagConstraints in java AWT issue</title>
			<link>http://www.daniweb.com/software-development/java/threads/456753/gridbagconstraints-in-java-awt-issue</link>
			<pubDate>Sun, 16 Jun 2013 05:51:20 +0000</pubDate>
			<description> import java.awt.*; import javax.swing.*; JPanel middlePanel = new JPanel(); middlePanel.setLayout(new GridBagLayout()); GridBagConstraints cons = new GridBagContraints(); cons.weightx = 1.0; cons.weighty = 1.0; middlePanel.setBorder(new TitledBorder(new EtchedBorder(),&quot;Display Area&quot;)); When i use this code snippet(this is just a rough code snippet) i get errors like &quot;can not find symbol GridBagContraints&quot; and &quot;can not ...</description>
			<content:encoded><![CDATA[ <pre><code class="language-java">import java.awt.*;
import javax.swing.*;


JPanel middlePanel = new JPanel();
    middlePanel.setLayout(new GridBagLayout());

    GridBagConstraints cons = new GridBagContraints();
    cons.weightx = 1.0;
    cons.weighty = 1.0;
    middlePanel.setBorder(new TitledBorder(new EtchedBorder(),"Display Area"));
</code></pre>

<p>When i use this code snippet(this is just a rough code snippet) i get errors like "can not find symbol GridBagContraints" and "can not find symbol TitledBorder","can not find symbol EtchedBorder". How to fix it?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>sash_kp</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456753/gridbagconstraints-in-java-awt-issue</guid>
		</item>
				<item>
			<title>Java Swing: Getting values from dynamically generated jTabbedPane</title>
			<link>http://www.daniweb.com/software-development/java/threads/456751/java-swing-getting-values-from-dynamically-generated-jtabbedpane</link>
			<pubDate>Sun, 16 Jun 2013 04:33:26 +0000</pubDate>
			<description>I have one tab by default (tab1) New tabs are generated , equal to 'No of rooms'. The dynamically generated tabs have same structure as of the default tab. I don't know the name of textfields of newly generated tabs. How can I find the name of jtexfields generated on ...</description>
			<content:encoded><![CDATA[ <p>I have one tab by default (tab1)<br />
New tabs are generated , equal to 'No of rooms'.<br />
The dynamically generated tabs have same structure as of the default tab.<br />
I don't know the name of textfields of newly generated tabs.<br />
How can I find the name of jtexfields generated on tab at run time so I can use .getText()</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>wolwayne</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456751/java-swing-getting-values-from-dynamically-generated-jtabbedpane</guid>
		</item>
				<item>
			<title>Spiral Matrix</title>
			<link>http://www.daniweb.com/software-development/c/threads/456750/spiral-matrix</link>
			<pubDate>Sun, 16 Jun 2013 03:59:03 +0000</pubDate>
			<description>Hi! I have this kind of project and im really needing help for it. The compiling and print have to be a spiral matrix. it must start in the center and then move to the right and then up and then to the left, making a spiral. I have to ...</description>
			<content:encoded><![CDATA[ <p>Hi! I have this kind of project and im really needing help for it. The compiling and print have to be a spiral matrix. it must start in the center and then move to the right and then up and then to the left, making a spiral. I have to introduce an initial and final value. the initial value must be in the center and the final value would be the end of the spiral.<br />
Like this<br />
initial Value = 4<br />
final Value = 18</p>

<pre><code class="language-c">      4   5   6
  14  15  16  7
  13  18  17  8
  12  11  10  9
</code></pre>

<p>Code:</p>

<pre><code class="language-c">#include &lt; stdio.h &gt;
#include &lt; conio.h &gt; 

void main()
{
    int m[20][20],i,j;
    int lc,hc,lr,hr,r,c,cnt;    
    clrscr();
    printf("\nEnter r &amp; c :");
    scanf("%d %d",&amp;r,&amp;c);
    cnt = 1;
    lr = 0; lc = 0;
    hr = r - 1;
    hc = c - 1;
    while ( lr &lt;=hr &amp;&amp; lc &lt;= hc )
    {
        i = lr;
        for(j=lc;j &lt;= hc;j++)
        {
            m[i][j] = cnt++;    
            j = hc;
            for(i=lr+1;i&lt;=hr;i++)
            {
                m[i][j] = cnt++;    
                if( lr != hr )
                {
                    i = hr;
                    for(j=hc-1;j&gt;=lc;j--)
                    m[i][j] = cnt++;
                }   
                if ( lc != hc )
                {
                    j = lc;
                    for(i=hr-1;i&gt;lr;i--)
                    m[i][j] = cnt++;
                }
            }
        }
        lr++;lc++;
        hr--;hc--;
    }//while    
    printf("\nSpirally filled matrix is\n");
    for(i=0;i &lt; r;i++)
    {
        for(j=0;j &lt; c;j++)
        {
            printf("%4d",m[i][j]);
            printf("\n");
        }       
    }
} // main
</code></pre>

<p>I have this program but isnt runnig well. Please please help</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>jose.a.rueda.5</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456750/spiral-matrix</guid>
		</item>
				<item>
			<title>Reading binary files in C++</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456747/reading-binary-files-in-c</link>
			<pubDate>Sun, 16 Jun 2013 03:37:02 +0000</pubDate>
			<description>Hi All. I am new to C++, infact I started watching tutorials just about an hour ago. But, I had some experiece of Javascript, PHP, so It is fine. Now, my question is that, I am untimately, learning C++ to be able to manipulate a .wav files, just to write ...</description>
			<content:encoded><![CDATA[ <p>Hi All. I am new to C++, infact I started watching tutorials just about an hour ago. But, I had some experiece of Javascript, PHP, so It is fine.</p>

<p>Now, my question is that, I am untimately, learning C++ to be able to manipulate a .wav files, just to write a script from scratch and be able to read file, and illustrate in a graphical interface like a spectrogram.</p>

<p>But, since I am a newbie, I decided to start learning about reading binary files first, and actually used a code from this website <a href="http://www.cplusplus.com/reference/istream/istream/read/" rel="nofollow">http://www.cplusplus.com/reference/istream/istream/read/</a> to read a simple [code]test.txt[/code] file, which I wrote my name in, and runned the code</p>

<pre><code class="language-cpp">// read a file into memory
#include &lt;iostream&gt;     // std::cout
#include &lt;fstream&gt;      // std::ifstream

int main () {

  std::ifstream is ("test.txt", std::ifstream::binary);
  if (is) {
    // get length of file:
    is.seekg (0, is.end);
    int length = is.tellg();
    is.seekg (0, is.beg);

    char * buffer = new char [length];

    std::cout &lt;&lt; "Reading " &lt;&lt; length &lt;&lt; " characters... ";
    // read data as a block:
    is.read (buffer,length);

    if (is)
      std::cout &lt;&lt; "all characters read successfully.";
    else
      std::cout &lt;&lt; "error: only " &lt;&lt; is.gcount() &lt;&lt; " could be read";
    is.close();

    // ...buffer contains the entire file...

    delete[] buffer;
  }
  return 0;
}
</code></pre>

<p>and It gave me, a message saying [code]Reading 32 characters... all characters read successfully.<br />
[/code] even though, I only had like 29 characters in there. Anyway, that is not the problem.</p>

<p>The problem, is that, I placed a .wav file at the place where it said test.txt and even placed the .wav file in the same directory, and when I ran the code, it does not give me error or success, it shell just says, "Process returned 0 (0x0) execution time 0.008s"</p>

<p>What am I doing wrong? I just want to read the contents of what is in that wav file only? Be it in a frequency/amplitude/sound wave whatever the term is. Why is it not show</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>Vribium</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456747/reading-binary-files-in-c</guid>
		</item>
				<item>
			<title>c++ programing language</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456746/c-programing-language</link>
			<pubDate>Sun, 16 Jun 2013 03:00:24 +0000</pubDate>
			<description>Q1: and then breaks that number down to display the equivalent minutes and seconds. Have your program ONLY do the calculation if the user enters a number LESS than 50,000 hours.number of hours, If he enters 50,000 or more print an error message and quit.Write a C++ program that reads ...</description>
			<content:encoded><![CDATA[ <p>Q1: and then breaks that number down to display the equivalent minutes and seconds. Have your program ONLY do the calculation if the user enters a number LESS than 50,000 hours.number of hours, If he enters 50,000 or more print an error message and quit.Write a C++ program that reads in one integer that represents a total number of seconds<br />
Sample Example:<br />
Input a whole number of seconds less than 50,000:<br />
7683<br />
There are 2 hours, 8 minutes and 3 seconds in 7683 seconds</p>

<p>Q2: Write a C++ program that will read 4 integer numbers within the range of 30 to 1000, then compute and print the count of numbers that are even and dividable by 7 or 3.</p>

<p>Q3: Write a C++ program to find the value of Y?<br />
Ask the user to enter an integer x from keyboard. Assume Y initially = 5</p>

<p>Y+=( x/100 + x/98 + x/96 + ……………. + x) + x!<br />
 Where x! Is the factorial of x.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>lolo nice</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456746/c-programing-language</guid>
		</item>
				<item>
			<title>IllegalBlockSizeException</title>
			<link>http://www.daniweb.com/software-development/java/threads/456743/illegalblocksizeexception</link>
			<pubDate>Sun, 16 Jun 2013 02:18:55 +0000</pubDate>
			<description>Hello, I am trying to encrypt a String using Symmetric Key Cryptography. When I try to encrypt the string, on runtime it gives me this error: input text: Hello World Exception in thread &quot;main&quot; javax.crypto.IllegalBlockSizeException: data not block size aligned at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(Unknown Source) at javax.crypto.Cipher.doFinal(DashoA13*..) at SimpleSymmetricExample.main(SimpleSymmetricExample.java:25) I know it ...</description>
			<content:encoded><![CDATA[ <p>Hello, I am trying to encrypt a String using Symmetric Key Cryptography. When I try to encrypt the string, on runtime it gives me this error:</p>

<pre><code class="language-java">input text:  Hello World 
Exception in thread "main" javax.crypto.IllegalBlockSizeException: data not block size aligned
    at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(Unknown Source)
    at javax.crypto.Cipher.doFinal(DashoA13*..)
    at SimpleSymmetricExample.main(SimpleSymmetricExample.java:25)
</code></pre>

<p>I know it has something to do with my keyBytes variable, but how to I change it so the block size is aligned?</p>

<p>Here is the SimpleSymmetricExample class:</p>

<pre><code class="language-java">import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.security.Security;
import org.bouncycastle.jce.provider.BouncyCastleProvider;

public class SimpleSymmetricExample{
    public static void main(String[] args) throws Exception {

           byte[] input = " Hello World ".getBytes();
            byte[] keyBytes = new byte[] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,
            0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17 };
            SecretKeySpec key = new SecretKeySpec(keyBytes, "AES");

        Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding", "BC");

        System.out.println("input text: " + new String(input));

        //encryption pass

        byte[] cipherText = new byte[input.length];

        cipher.init(Cipher.ENCRYPT_MODE, key);
        int ctLength = cipher.update(input,0,input.length, cipherText, 0);

        ctLength += cipher.doFinal(cipherText, ctLength);

        System.out.println("cipher text: " + new String(cipherText) + "bytes: " + ctLength);

        //Decryption pass
        byte[] plainText = new byte[ctLength];
        cipher.init(Cipher.DECRYPT_MODE, key);

        int ptLength = cipher.update(cipherText, 0, ctLength, plainText, 0);

        ptLength += cipher.doFinal(plainText, ptLength);

        System.out.println("plain text" + new String(plainText));

    }
}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>godzab</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456743/illegalblocksizeexception</guid>
		</item>
				<item>
			<title>Conway&#039;s Game of Life</title>
			<link>http://www.daniweb.com/software-development/c/threads/456740/conways-game-of-life</link>
			<pubDate>Sun, 16 Jun 2013 00:12:04 +0000</pubDate>
			<description>Hi guys, im currently doing Conway's game of life and i'm almost there. The variable and all is in German since im studying here in Germany but i think one can still understand the code. There's one thing I need help with, which is with the Glider (Gleiter). When i ...</description>
			<content:encoded><![CDATA[ <p>Hi guys, im currently doing Conway's game of life and i'm almost there. The variable and all is in German since im studying here in Germany but  i think one can still understand the code. There's one thing I need help with, which is with the Glider (Gleiter).</p>

<p>When i run it, the output is that the Glider wil move diagonally from <strong>bottom left to upper right</strong>. As it reaches the end of the field, i am required to make that it will appear again from <strong>bottom right moving to upper left</strong>. (Moves in a way that form an 'X')</p>

<p>Need help on how to make it appear again at the bottom left after it reaches the end of the field.</p>

<p>(Sorry for the crappy explanation..)</p>

<pre><code class="language-c">#include &lt;stdlib.h&gt;
#include &lt;stdio.h&gt;
#include &lt;math.h&gt;
#include &lt;time.h&gt;
#include &lt;windows.h&gt;
#include "Console.h"
#include "Console.cpp"

#define MAXX 78
#define MAXY 22


int hauptmenu()
{
    int wahl1;
     printf("\n\t\t\t\t######******######\n");
     printf("\t\t\t\t@= GAME OF LIFE =@\n");
     printf("\t\t\t\t######******######\n");
     printf("\n\t\t\t    -Willkommen in Game of Life-\n");
     printf("\nSpielregel:\n\n");
     printf("1. Eine lebende Zelle ueberlebt in der naechsten Generation, wenn sie zwei oder\n");
     printf("   drei Nachbarn hat. Sind es weniger bzw. mehr, so stirbt sie an Vereinsamung\n");
     printf("   bzw. Uberbevoelkerung\n");
     printf("2. Eine tote Zelle wird immer dann in der naechsten Generation zum\n");
     printf("   Leben erweckt, wenn sie genau drei lebendige Nachbarn hat, ansonsten bleibt\n");
     printf("   sie tot.\n");
     printf("\nGeben Sie Ihre Wahl ein.\n\n");
     printf("\t\t\t\t :- Hauptmenu -:\n\n");
     printf("\t1.Game of Life starten\n");
     printf("\t2.Beenden\n\n");
     printf("\tIhre Wahl: ");
         scanf ("%d", &amp;wahl1);
     return wahl1;  
}

int ausgabe(int feld[MAXX][MAXY], int generation){
    printf("\t\t\t |*|^|*| GENERATION:%d |*|^|*|", generation);
    printf("\n\n");
    int x=0, y=0;
    while (y&lt;MAXY){
        while (x&lt;MAXX){
            if (feld[x][y]==1) printf(" ");
            if (feld[x][y]==2) printf("X");
            x++;
        }
    printf("\n");
    y++;
    x=0;
    }
return 0;
}

int main()
{
    int generation=1;
    int feld[MAXX][MAXY];
    int x=1, y=1;

    while (y&lt;MAXY){
                   while (x&lt;MAXX){
                   feld[x][y]=1;
                   x++;
                   }
    printf("\n");
    y++;
    x=0;
    }
    int wahl1;
    do{

    wahl1=hauptmenu();

    if(wahl1==1){
    int feldneu[MAXX][MAXY];
    int wahl2;

    printf("\n\n1)Blinker\n");
    printf("2)Block\n");
    printf("3)Bienenstock\n");
    printf("4)Leuchtfeuer\n");
    printf("5)Gleiter\n");   
    printf("Bitte waehlen sie die Ausgangsmuster: ");
    scanf("%d", &amp;wahl2);
    switch(wahl2){
                  case 1:                       //Blinker
                  feld[38][11]=2;
                  feld[39][11]=2;
                  feld[40][11]=2;
                  break;
                  case 2:                       //Block
                  feld[38][11]=2;
                  feld[38][12]=2;
                  feld[39][11]=2;
                  feld[39][12]=2;
                  break;
                  case 3:                       //Bienenstock
                  feld[37][11]=2;
                  feld[36][12]=2;
                  feld[38][12]=2;
                  feld[36][13]=2;
                  feld[38][13]=2;
                  feld[37][14]=2;
                  break;
                  case 4:                       //Leuchtfeuer
                  feld[38][11]=2;
                  feld[39][11]=2;
                  feld[39][12]=2;
                  feld[36][13]=2;
                  feld[36][14]=2;
                  feld[37][14]=2;
                  break;
                  case 5:                       //Gleiter
                  feld[39][11]=2;
                  feld[40][11]=2;
                  feld[38][12]=2;
                  feld[40][12]=2;
                  feld[40][13]=2;
                  break;
                 }

    ausgabe(feld, generation);
    Sleep(1000);
    cls();

    while (generation){
                 int nachbarn=0;
                 x=1, y=1;
                 while (y&lt;MAXY){
                       while (x&lt;MAXX){
                             if (feld[x][y-1]==2) nachbarn++;
                             if (feld[x-1][y-1]==2) nachbarn++;
                             if (feld[x-1][y]==2) nachbarn++;
                             if (feld[x-1][y+1]==2) nachbarn++;
                             if (feld[x][y+1]==2) nachbarn++;
                             if (feld[x+1][y+1]==2) nachbarn++;
                             if (feld[x+1][y]==2) nachbarn++;
                             if (feld[x+1][y-1]==2) nachbarn++;

                             if(feld[x][y]==2){
                             if (nachbarn&lt;2 || nachbarn &gt;3) feldneu[x][y]=1;
                             else feldneu[x][y]=2;
                             }
                             if (feld[x][y]==1){
                             if (nachbarn==3) feldneu[x][y]=2;
                             else feldneu[x][y]=1;
                             }
                             nachbarn=0;
                             x++;
                             }
                 y++;
                 x=0;
                 }

           x=1, y=1;       
           while (y&lt;MAXY){
                 while (x&lt;MAXX){
                       feld[x][y] = feldneu[x][y];   
                       x++;
                       }
                 y++;
                 x=0;
          }
    generation++;
    Sleep(500);   
    cls();
    ausgabe(feld, generation);
    }
    }//End if loop

    else if(wahl1==2) break;
    else printf("\tUngueltige Eingabe");

    }while(wahl1&gt;2);//End do loop

    system("PAUSE");
    return 0;
}       
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>Jenniferting</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456740/conways-game-of-life</guid>
		</item>
				<item>
			<title>About python packages in Eclipse PyDev</title>
			<link>http://www.daniweb.com/software-development/python/threads/456739/about-python-packages-in-eclipse-pydev</link>
			<pubDate>Sat, 15 Jun 2013 23:50:34 +0000</pubDate>
			<description>Hy, I have a beginner question: when using PyDev should all my programs be inside a package or not?</description>
			<content:encoded><![CDATA[ <p>Hy, I have a beginner question: when using PyDev should all my programs be inside a package or not?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>G_S</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/threads/456739/about-python-packages-in-eclipse-pydev</guid>
		</item>
				<item>
			<title>Need help with Android app</title>
			<link>http://www.daniweb.com/software-development/mobile-development/threads/456738/need-help-with-android-app</link>
			<pubDate>Sat, 15 Jun 2013 23:20:28 +0000</pubDate>
			<description>Hey guys. I'm making this android app called GPS Buddy. What I want it to do is to send my gps coordinates to a phone number via a text at a set interval. The problem that I am running into is fairly simple. I have all the barebones stuff done, ...</description>
			<content:encoded><![CDATA[ <p>Hey guys. I'm making this android app called GPS Buddy. What I want it to do is to send my gps coordinates to a phone number via a text at a set interval. The problem that I am running into is fairly simple. I have all the barebones stuff done, all that I have left is implementing the the user adjustable variables.</p>

<p>Here is the problem:</p>

<p>I have a switch that will turn the background service on and off. If the switch is on, i have the boolean toggleBtn set to true, and I have it set to false if the button is off. That boolean is created is the MainActivity class, but I need to access it in my service class.</p>

<p>here is my code:</p>

<pre><code>package com.bobrown101.gpsbuddy;

import java.util.Calendar;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Switch;
import android.widget.Toast;
import android.widget.ToggleButton;
import android.telephony.SmsManager;

public class MainActivity extends Activity {

    public String Lat;
    public String Long;
    public boolean toggleBtn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
         Button buttonStart = (Button)findViewById(R.id.button1);        
         buttonStart.setOnClickListener(startListener); // Register the onClick listener with the implementation above

         Calendar cal = Calendar.getInstance();

         Intent intent = new Intent(this, MyService.class);
         PendingIntent pintent = PendingIntent.getService(this, 0, intent, 0);

         AlarmManager alarm = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
         // Start every 30 seconds
         alarm.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), 45*1000, pintent);  //7200 is 2 hours

         final Switch togglebutton = (Switch) findViewById(R.id.toggle_button);
         togglebutton.setOnClickListener(new OnClickListener() {
             public void onClick(View v) {
                 if (togglebutton.isChecked()) {
                     toggleBtn = true;
                     Toast.makeText(getBaseContext(), "Toggled switch to on!", Toast.LENGTH_SHORT).show();
                 } else {
                     toggleBtn = false;
                     Toast.makeText(getBaseContext(), "Toggled switch to off.", Toast.LENGTH_SHORT).show();

                 }
             }
         });


    }

    private OnClickListener startListener = new OnClickListener() {
        public void onClick(View v) {
            doEverything();
        }
    };

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }


    public void sendSMS(String x) {
        String phoneNumber = "MYPHONENUMBER";
        String message = x;

        SmsManager smsManager = SmsManager.getDefault();
        smsManager.sendTextMessage(phoneNumber, null, message, null, null);
    }
    public void getLocation(){
        GPSTracker mGPS = new GPSTracker(this);

        if(mGPS.canGetLocation ){

        double mLat=mGPS.getLatitude();
        double mLong=mGPS.getLongitude();
        Lat = Double.toString(mLat);
        Long = Double.toString(mLong);      

        }else{
        // can't get the location
        }
    }
    public void doEverything(){
        getLocation();
        String text = Lat + "," + Long;
        sendSMS(text);
    }


}
</code></pre>

<p>here is the next class:</p>

<pre><code>package com.bobrown101.gpsbuddy;

import java.util.Calendar;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.telephony.SmsManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Switch;
import android.widget.Toast;

public class MyService extends Service {
    public String Lat;
    public String Long;

    public void sendSMS(String x) {
        String phoneNumber = "5184950113";
        String message = x;

        SmsManager smsManager = SmsManager.getDefault();
        smsManager.sendTextMessage(phoneNumber, null, message, null, null);
    }
    public void getLocation(){
        GPSTracker mGPS = new GPSTracker(this);

        if(mGPS.canGetLocation ){

        double mLat=mGPS.getLatitude();
        double mLong=mGPS.getLongitude();
        Lat = Double.toString(mLat);
        Long = Double.toString(mLong);      

        }else{
        // can't get the location
        }
    }
    public void doEverything(){
        getLocation();
        String text = Lat + "," + Long;
        sendSMS(text);
    }


      @Override
      public int onStartCommand(Intent intent, int flags, int startId) {
        //TODO do something useful




          MainActivity main = new MainActivity();
          if(main.toggleBtn){
              doEverything();
          }else{
              Toast.makeText(getBaseContext(), "The toggle is off: text not sent", Toast.LENGTH_SHORT).show();
              Toast.makeText(getBaseContext(), String.valueOf(main.toggleBtn), Toast.LENGTH_SHORT).show();
          }
        return Service.START_STICKY; //changed from START_NOT_STICKY
      }

      @Override
      public IBinder onBind(Intent intent) {
      //TODO for communication return IBinder implementation
        return null;
      }
    } 
</code></pre>

<p>like I said the problem is the switch</p>

<p>everything else works and/or I have not finished it yet</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/mobile-development/181">Mobile Development</category>
			<dc:creator>bobrown101</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/mobile-development/threads/456738/need-help-with-android-app</guid>
		</item>
				<item>
			<title>How do I make this Update?</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456736/how-do-i-make-this-update</link>
			<pubDate>Sat, 15 Jun 2013 21:30:44 +0000</pubDate>
			<description>ys! I'm developing a software for a furniture company for keeping furniture cost to date.I'm Saving cost with the quantity and unit price for each material and keep them up to date by updating the material's unit price.For example: A chair need 3 Gallons of Thinner at $5,but today the ...</description>
			<content:encoded><![CDATA[ <p>ys!</p>

<p>I'm developing a software for a furniture company for keeping furniture cost to date.I'm Saving cost with the quantity and unit price for each material and keep them up to date by updating the material's unit price.For example:<br />
A chair need 3 Gallons of Thinner at $5,but today the price went up and it now cost $6.50.So when I update the unit price of the Thinner now the cost comes up $4.50 more.I have a Products table and a ProductMaterialCost table.What I want to do is update the Materials cost calculation and then update de Products table so the totalcost is now $4.50 more.How do I do this?Can I update the sum directly from database?</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>ariel.cepeda.35</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456736/how-do-i-make-this-update</guid>
		</item>
				<item>
			<title>Searching and Opening Files</title>
			<link>http://www.daniweb.com/software-development/csharp/threads/456734/searching-and-opening-files</link>
			<pubDate>Sat, 15 Jun 2013 20:52:19 +0000</pubDate>
			<description>Hi all, Im want to create a program for myself which will search my directories for ebooks and let me select the one i want to read. So for instance my first form has a button for C# Books, I want that then to produce a list of books found ...</description>
			<content:encoded><![CDATA[ <p>Hi all,</p>

<p>Im want to create a program for myself which will search my directories for ebooks and let me select the one i want to read. So for instance my first form has a button for C# Books, I want that then to produce a list of books found on my computer and let me pick one to read.</p>

<p>I know a way i can do this using oledb and msaccess and having a link field in the table. However the purpose is I do not wish to do this everytime I attain a new book.</p>

<p>no code snippets as of yet as i've just started the program</p>

<p>If anyone knows a way or can point me in the right direction, would appreciate it very much.<br />
Cheers Guys.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/csharp/61">C#</category>
			<dc:creator>ogsirus</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/csharp/threads/456734/searching-and-opening-files</guid>
		</item>
				<item>
			<title>How to start contributing to open source to develop my skills as a beginner</title>
			<link>http://www.daniweb.com/software-development/java/threads/456731/how-to-start-contributing-to-open-source-to-develop-my-skills-as-a-beginner</link>
			<pubDate>Sat, 15 Jun 2013 18:40:42 +0000</pubDate>
			<description>Hi, I work in PHP language for the past 2.5 yrs. I'm interested in making a career shift from PHP to Java/EE. So, I would like to start contributing to some open source software developed using Java EE, Spring, Hibernate. By that way I would like to develop my skills ...</description>
			<content:encoded><![CDATA[ <p>Hi,<br />
I work in PHP language for the past 2.5 yrs. I'm interested in making a career shift from PHP to Java/EE. So, I would like to start contributing to some open source software developed using Java EE, Spring, Hibernate. By that way I would like to develop my skills in few months in those Java framework. I'm okay with the core java and jsp,servlets. I have understanding of MVC architecture and ORM. I've worked with Symfony2, Doctrine in PHP.</p>

<p>So, I would like to know about the project I can start working with in GitHub to learn and develop my Java Web Development skill in Spring, JSP, Servlets and Hibernate. Please give the links of the projects and also step by step guide.</p>

<p>Thanks in advance.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>ronaldpaul</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456731/how-to-start-contributing-to-open-source-to-develop-my-skills-as-a-beginner</guid>
		</item>
				<item>
			<title>what is array &amp;function</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456730/what-is-array-function</link>
			<pubDate>Sat, 15 Jun 2013 18:02:20 +0000</pubDate>
			<description>`Inline Code Example Here`</description>
			<content:encoded><![CDATA[ <p><code>Inline Code Example Here</code></p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>shambel</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456730/what-is-array-function</guid>
		</item>
				<item>
			<title>forms</title>
			<link>http://www.daniweb.com/software-development/csharp/threads/456729/forms</link>
			<pubDate>Sat, 15 Jun 2013 17:42:17 +0000</pubDate>
			<description>I need help on how to link different forms when programming</description>
			<content:encoded><![CDATA[ <p>I need help on how to link different forms  when programming</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/csharp/61">C#</category>
			<dc:creator>james89</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/csharp/threads/456729/forms</guid>
		</item>
				<item>
			<title>ZOHO INTERVIEW QUESTION</title>
			<link>http://www.daniweb.com/software-development/c/threads/456728/zoho-interview-question</link>
			<pubDate>Sat, 15 Jun 2013 16:48:07 +0000</pubDate>
			<description>Write a C program to Remove even numbers and fill it with zeros. Note: You can use only one loop for your logic. Two variables apart from the array. Input array 1,2,3,4,5,6 Output 1,3,5,0,0,0</description>
			<content:encoded><![CDATA[ <p>Write a C program to Remove even numbers and fill it with zeros.<br />
Note: You can use only one loop for your logic.<br />
Two variables apart from the array.<br />
Input array 1,2,3,4,5,6<br />
Output 1,3,5,0,0,0</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/c/118">C</category>
			<dc:creator>sureshshan1292</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/c/threads/456728/zoho-interview-question</guid>
		</item>
				<item>
			<title>Getting the path of home directory in Python</title>
			<link>http://www.daniweb.com/software-development/python/threads/456727/getting-the-path-of-home-directory-in-python</link>
			<pubDate>Sat, 15 Jun 2013 16:24:06 +0000</pubDate>
			<description>Hi How to get the path of home directory in windows? I have the script that write log.txt in my windows 7 Desktop. How can I change path in python to write log.txt in homedir directory? Is there any way to do it? I tried with those 2 methods But ...</description>
			<content:encoded><![CDATA[ <p>Hi<br />
How to get the path of  home directory in windows?</p>

<p>I have the script that write log.txt in my windows 7 Desktop.</p>

<p>How can I change path in python to write log.txt in homedir directory? Is there any way to do it?</p>

<p>I tried with those 2 methods But its not work and its still write on  windows Desktop?</p>

<pre><code class="language-py">LOG_FILENAME = 'log.txt'
#Method1
homedir = os.environ['ALLUSERSPROFILE']
LOG_FILENAME = homedir
LOG_FILENAME = 'log.txt'

#Method 2
homedir = os.path.expanduser('~')
LOG_FILENAME = homedir
LOG_FILENAME = 'log.txt'
#<a href="http://snipplr.com/view.php?codeview&amp;id=7354" rel="nofollow">http://snipplr.com/view.php?codeview&amp;id=7354</a>
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>tony75</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/threads/456727/getting-the-path-of-home-directory-in-python</guid>
		</item>
				<item>
			<title>undefined reference to `WinMain@16&#039; - Error</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456721/undefined-reference-to-winmain16-error</link>
			<pubDate>Sat, 15 Jun 2013 14:36:39 +0000</pubDate>
			<description>Trying to compile an Fast Light Tool Kit project for the first time. This is one I've generated in FLUID and dragged into Code::Blocks IDE (MinGW compiler). Not sure what this error means or how to fix it but it seems that it's very common? Any clues as to what ...</description>
			<content:encoded><![CDATA[ <p>Trying to compile an Fast Light Tool Kit project for the first time.  This is one I've generated in FLUID and dragged into Code::Blocks IDE (MinGW compiler).</p>

<p>Not sure what this error means or how to fix it but it seems that it's very common?</p>

<p>Any clues as to what it means.  Thanks<br />
The error is below.</p>

<pre><code class="language-cpp">Build started on: 16-06-2013 at 00:32.23
Build ended on: 16-06-2013 at 00:32.23
-------------- Build: Release in testfluid (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -LC:\fltk-1.3.2\lib -LC:\WINDOWS\system32\gdi32.dll -o bin\Release\testfluid.exe obj\Release\main.o -lfltk -lole32 -luuid -lcomctl32 -lwsock32 -lm -lgdi32 -luser32 -lkernel32 -lmingw32 C:\fltk-1.3.2\lib\libfltk.a C:\fltk-1.3.2\lib\libfltk_forms.a C:\fltk-1.3.2\lib\libfltk_gl.a C:\fltk-1.3.2\lib\libfltk_images.a C:\fltk-1.3.2\lib\libfltk_jpeg.a C:\fltk-1.3.2\lib\libfltk_png.a C:\fltk-1.3.2\lib\libfltk_z.a C:\WINDOWS\system32\gdi32.dll -mwindows
c:/codeblocks/mingw/bin/../lib/gcc/mingw32/4.7.1/../../../libmingw32.a(main.o):main.c:(.text.startup+0xa7): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings (0 minutes, 0 seconds)
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>christinetom</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456721/undefined-reference-to-winmain16-error</guid>
		</item>
				<item>
			<title>FastMM in Delphi -How to use</title>
			<link>http://www.daniweb.com/software-development/pascal-and-delphi/threads/456718/fastmm-in-delphi-how-to-use</link>
			<pubDate>Sat, 15 Jun 2013 13:02:35 +0000</pubDate>
			<description>Hi Does anyone know how to use it? I mean FastMM in Delphi. Or any code to work with memory leaks. Clear memory when application run or stuff like that. My exe (application )growing used memory when work and open forms, click button, read from database etc. thank you</description>
			<content:encoded><![CDATA[ <p>Hi<br />
Does anyone know how to use it? I mean FastMM in Delphi.<br />
Or any code to work with memory leaks.<br />
Clear memory when application run or stuff like that.<br />
My exe (application )growing used memory when work and open forms, click button, read from database etc.<br />
thank you</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/pascal-and-delphi/124">Pascal and Delphi</category>
			<dc:creator>riki.kavadarci</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/pascal-and-delphi/threads/456718/fastmm-in-delphi-how-to-use</guid>
		</item>
				<item>
			<title>Assignment</title>
			<link>http://www.daniweb.com/software-development/cpp/threads/456714/assignment</link>
			<pubDate>Sat, 15 Jun 2013 11:11:06 +0000</pubDate>
			<description>I wanna write a C++ program using arrays to construct a table which allows me to input the names and marks of 4 subjects of 40 students.Pls someone help me......</description>
			<content:encoded><![CDATA[ <p>I wanna write a C++ program using arrays to construct a table which allows me to input the names and marks of 4 subjects of 40 students.Pls someone help me......</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/cpp/8">C++</category>
			<dc:creator>Hanshinie</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/cpp/threads/456714/assignment</guid>
		</item>
				<item>
			<title>Probability calculator</title>
			<link>http://www.daniweb.com/software-development/python/code/456711/probability-calculator</link>
			<pubDate>Sat, 15 Jun 2013 10:07:29 +0000</pubDate>
			<description>Here is a code snippet that calculates the probability of the outcome of a two sided game based on the capability of each side. I used it in my football league simulator program Could be used in any number of simulators which involve two parties. For equally strong parties, the ...</description>
			<content:encoded><![CDATA[ <p>Here is a code snippet that calculates the probability of the outcome of a two sided game based on the capability of each side. I used it in my football league simulator program<br />
Could be used in any number of simulators which involve two parties. For equally strong parties, the result is calculated based on equal probability of all three outcomes.<br />
It can be written in hundreds of different ways. Good Luck</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/python/114">Python</category>
			<dc:creator>m_ishwar</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/python/code/456711/probability-calculator</guid>
		</item>
				<item>
			<title>20 Questions game</title>
			<link>http://www.daniweb.com/software-development/java/threads/456706/20-questions-game</link>
			<pubDate>Sat, 15 Jun 2013 08:27:39 +0000</pubDate>
			<description>The link tied to this post is what I have to do. I could do this if I all the answers and questions were already established. My problem is that I don't know how to make the program start from scratch and make it &quot;learn&quot;. This is my code as ...</description>
			<content:encoded><![CDATA[ <p>The link tied to this post is what I have to do. I could do this if I all the answers and questions were already established. My problem is that I don't know how to make the program start from scratch and make it "learn". This is my code as of right now:</p>

<pre><code class="language-java">    import java.util.*;
    public class assignment8{
      static treeNode root = new treeNode("Does it have legs?", null, null);
      public static void main(String[] args){
        root.left = new treeNode("Is it a cat?", null, null);
        root.right = new treeNode("Is it a snake?", null, null);
        guess();
      }
      static void guess(){
        Scanner scan = null;
        try{
          scan = new Scanner(System.in);
        }
        catch (Exception e){
          System.out.println(e);
        }
        System.out.println(root.data);
        String ques = scan.next();
        if(ques.equals("yes")){
          root = root.left;
          System.out.println(root.data);
          String ques2 = scan.next();
          if(ques2.equals("yes")){
            System.out.println("I win! Continue?");
          }else if(ques2.equals("no")){
            System.out.println("I give up. What is it?");
            String ans = scan.next();
            System.out.println("Please type a question that is yes for " + ans + " and no for cat");
            String newQues = scan.next();
            root.right = new treeNode(newQues, null, null);
            System.out.println("Continue? yes/no");
            String cont =  scan.next();
            if(cont.equals("yes")){
              guess();
            }
          }
        }else if(ques.equals("no")){
          root = root.right;
          System.out.println(root.data);
        }
      }
    }
    class treeNode{
      String data;
      treeNode left;
      treeNode right;

      treeNode(String newdata, treeNode left, treeNode right){
        this.data = newdata;
        this.left = left;
        this.right = right;
      }
    }
</code></pre>

<p>I realize that it's all over the place. To be honest I'm quite stuck as to how to make the program "learn" as more people play it. Any help would be appreciated. I know that this is a lot to read and I apologize. Thanks in advance to any that help.</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>cjap20</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456706/20-questions-game</guid>
		</item>
				<item>
			<title>pointer</title>
			<link>http://www.daniweb.com/software-development/threads/456702/pointer</link>
			<pubDate>Sat, 15 Jun 2013 07:39:44 +0000</pubDate>
			<description>difference between : ptr=&amp;arr; and *ptr=&amp;arr;</description>
			<content:encoded><![CDATA[ <p>difference between : ptr=&amp;arr;</p>

<p>and *ptr=&amp;arr;</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/2">Software Development</category>
			<dc:creator>parth kuraria</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/threads/456702/pointer</guid>
		</item>
				<item>
			<title>Help with Methods in Java!</title>
			<link>http://www.daniweb.com/software-development/java/threads/456692/help-with-methods-in-java</link>
			<pubDate>Sat, 15 Jun 2013 04:58:29 +0000</pubDate>
			<description>My program is a math game which consists of different levels and different math operations. I'm not completely finished yet but I would like to know if there is a way to put the code for each of the four operators into their own method, and just have the main ...</description>
			<content:encoded><![CDATA[ <p>My program is a math game which consists of different levels and different math operations. I'm not completely finished yet but I would like to know if there is a way to put the code for each of the four operators into their own method, and just have the main method print the questions and ask for the answers? Also, why when I run my program, when the user enters their answer, does the pop up close and make me enter it in the program (not in a window)?</p>

<pre><code class="language-java">import javax.swing.*;
import java.io.*;

public class game
{

  public static void main (String [] args) throws IOException
  {
    BufferedReader myInput = new BufferedReader (new InputStreamReader (System.in));// Buffered Reader reads the number inputed by the user 

    int money = 0;

    String player = JOptionPane.showInputDialog(null, "Welcome to... \n - Are YOU Smarter Than a 12 Year Old? - \n Please enter your name to begin!", "Welcome", JOptionPane.INFORMATION_MESSAGE);

   JOptionPane.showMessageDialog(null, "Hi " + player + ", " + " let's see if you are really smarter than a 12 year old. \n This games consists of 3 levels of difficulty. \n Answer all 4 questions in each level and earn $500, 000! \n If you get an answer wrong you lose $100, you go home EMPTY HANDED if your money reaches 0!");

   Object[] options = {"Yes!", "No way!"};

   int x = JOptionPane.showOptionDialog(null,"Are you ready to play?","Start?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);

if (x == JOptionPane.YES_OPTION) {

   JOptionPane.showMessageDialog(null, "Your first level consists of addition and substraction of 2 numbers! \n In order to pass this level, you will need to answer all 3 questions correctly. \n For every correct question, you will earn $1,000.");

   int addA = leveloneA();
   int addB = leveloneB();
   String sumA = JOptionPane.showInputDialog(null, addA + "+" + addB + " = ", "Question", JOptionPane.INFORMATION_MESSAGE);
   sumA = myInput.readLine();
   int sum = Integer.parseInt (sumA);

   int realSum = addA + addB;
   JOptionPane.showMessageDialog(null, realSum);

   if (sum == realSum){

     money = money + 1000;

      JOptionPane.showMessageDialog(null, "CORRECT! \n You have $" + money);
   }
      if (sum != realSum){
        JOptionPane.showMessageDialog(null, "INCORRECT! \n You are not smarter than a 12 year old. \n You go home with $" + money);
        System.exit(0);
      }
 }
else if (x == JOptionPane.NO_OPTION){
  JOptionPane.showMessageDialog(null, "Goodbye!");
  System.exit(0);
}

   int subA = leveloneA();
   int subB = leveloneB();

   if (subA &lt; subB){
     subA = subB;
     subB = subA;
   }
   String differenceA = JOptionPane.showInputDialog(null, subA + " - " + subB + " = ", "Question", JOptionPane.INFORMATION_MESSAGE);
   differenceA = myInput.readLine();
   int difference = Integer.parseInt (differenceA);

   int realDifference = subA - subB;
   JOptionPane.showMessageDialog(null, realDifference);
   if (difference == realDifference){

     money = money + 1000;

      JOptionPane.showMessageDialog(null, "CORRECT! \n You have $" + money);
   }
   else if (difference != realDifference){

     JOptionPane.showMessageDialog(null, "INCORRECT! \n You are not smarter than a 12 year old. \n You go home with $" + money);
     System.exit(0);
   }
  }

  public static int leveloneA ()
  {
    int firstNum = (int)(Math.random()*20);
    return firstNum;
  }
   public static int leveloneB ()
  {
    int secondNum = (int)(Math.random()*20);
    return secondNum;
  }


}
</code></pre>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/java/9">Java</category>
			<dc:creator>incxx</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/java/threads/456692/help-with-methods-in-java</guid>
		</item>
				<item>
			<title>HELP: uppercase in textbox</title>
			<link>http://www.daniweb.com/software-development/vbnet/threads/456687/help-uppercase-in-textbox</link>
			<pubDate>Sat, 15 Jun 2013 00:37:48 +0000</pubDate>
			<description>Guys, I want my textbox are ALL CAPITAL letters even I encode a small letter and it will become Capital .. thanks guys!</description>
			<content:encoded><![CDATA[ <p>Guys, I want my textbox are ALL CAPITAL letters even I encode a small letter and it will become Capital .. thanks guys!</p>
 ]]></content:encoded>
			<category domain="http://www.daniweb.com/software-development/vbnet/58">VB.NET</category>
			<dc:creator>nashy13</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/software-development/vbnet/threads/456687/help-uppercase-in-textbox</guid>
		</item>
			</channel>
</rss>