ndowens 0 Newbie Poster

Oops. I missed those. I noticed the ones in cSearch I did but failed to notice those. Thanks for pointing that out. Sorry, I am just now trying to learn.

ndowens 0 Newbie Poster

I have tried this in other languages such as C++ and ruby and it works just fine.

ndowens 0 Newbie Poster
def cDownload():
    
    print("Enter package name ")
    sName=input
    print("Enter download location ")
    sLocation=input
    command = "wget http://aur.archlinux.org/packages/" + sName + "/" + sName + ".tar.gz -O" + sLocation + "/" + sName + ".tar.gz"
    os.system(command)

I get
TypeError: Can't convert 'builtin_function_or_method' object to str implicitly

ndowens 0 Newbie Poster

>>I can not see any right for any government to censur or cut off people from Internet

Govenments can do as they please, afterall it is the government that makes the rules. I don't like what some governments to either, but there is nothing I can do about it. I can only control my own destiny, not that of anyone else.

Actually we can do something about it, we still hold the power in democracy. For example, if we wanted to kick out the President we could. We only give the gov't power so they can vote so we don't have to everyday, though if we don't like it, you can get enough people to stand against it and make them change it. We have the power to control the country and it seems most people has forgotten that.

ndowens 0 Newbie Poster

Ah thanks so much

ndowens 0 Newbie Poster

I am writing a application for Arch Linux, actually I already wrote it, but I wanted to do it a little differently then the other. The origional one uses the goto statement. Here is the code:

#include <iostream>
#include <string>
using namespace std;

int main()
{
   cout
    << "\tAurDown v2.1\n"

    << "\tLicense: GPL3\n\n"
    << "Menu\n"
    << "1. Search for package\n"
    << "2. Download a package\n";
   cout << "Enter Selection\t";
   cin >> nSel;
 
  while((nSel != 1) || (nSel != 2))
    {
   cout << "Please Enter a valid selection"\n;
   cin >> nSel;
         
    }
}

I am wanting to it to print "Please enter a valid selection" as many times as somebody enters anything other than 1 or 2 and if the person enters 1 or two after they get the error "Please enter a valid...." it will resume. Sorry this is a newbie question. I know it has to be a simple problem, but can't find it.

Thanks

ndowens 0 Newbie Poster

If you are running Linux, you could do something like cat TEXTFILE | sed 's|WORD||g' which would find the word and remove it from the file

Note to the Mods:
Didn't notice this thread was old. Sorry.

ndowens 0 Newbie Poster

Oh yeah, duh! Can't believe I forgot that....

Thanks for pointing out my blonde moment :D

ndowens 0 Newbie Poster

Still doesn't work. I even put in numbers to add in the code and same problem.

ndowens 0 Newbie Poster

I am trying to learn C++. I wrote a little calculator using class to see if I can do it and give some practice. The following is the code:

#include <iostream>
using namespace std;

class Calculator
{
	float a, b;
public:
	float add(float, float);
	float subtract(float, float);
	float multiply(float, float);
	float divide(float, float);
};

float Calculator::add(float a, float b)
{
	return (a+b);
}
float Calculator::subtract(float a, float b)
{
	return (a-b);
}

int main()
{
	Calculator calc;
	float a,c;
	char b;
	cout << "Enter math problem (eg. 1 + 2)" << endl;
	cin >> a >> b >> c;

	switch (b)
	{
	case '+':
		calc.add(a,b);
		cin.ignore();
	default:
		cout << "Please Enter correct math problem" << endl;
	}
}

When the command line pops up, it asks me to Enter math problem and I do, such as I do 1+2 and it returns the default switch "Please Enter correct math problem". Then I tried adding cout << "True"; to see if it was actually going to the correct switch and it printed true. So it seems that it isn't doing calc.add(a,b) though I am not sure why not.

ndowens 0 Newbie Poster

Hmm now I am lost on which book would be good for me lol. I thought I found a good book

ndowens 0 Newbie Poster

Ah Thanks for the reply, I think I may get the C++ Primer Plus 5th edition, as it has like 68 5-star reviews and a one or two of the 1-2star review.

Which as mentioned it has a lot more pages as well.

ndowens 0 Newbie Poster

I was thinking about C++ Primer Plus 5th edition. It got a lot of good reviews, like 70 something reviews with only like betweeen the 1st and 3rd star, there is probably only one each of them.

ndowens 0 Newbie Poster

I am wondering if somebody could recommend a good book and/or tutorial for an absolute beginner with no previous programming experience.

Thanks.

Also If I can do decent at programming, I may end up going to college in order to try and make programming a possible career

ndowens 0 Newbie Poster

Hi,
I deliberately do mistake on line INSERT INTO table2....... but, it still commits despite variable of rowcount is set to 0. How can solve it?

Thanks

BEGIN
DECLARE rowcount INT;					
INSERT INTO table1 ………					
SELECT row_count() INTO rowcount;

IF (rowcount=1) THEN
    SET rowcount=0;
    INSERT INTO table2 ……………..
    SELECT row_count() INTO rowcount;

    IF (rowcount=1) THEN
        COMMIT;
    ELSE
       ROLLBACK;
    END IF;
END IF;
END

I believe it to be because you put SET rowcount=0;