I would like to create a C++ app. I would like this app to be able to access a MySQL database. My current arsenal consists of Ubuntu 10.10 and a 10 minute old install of Code::Blocks.
Would someone be so kind as to tell me if these are the tools which I will need for step #1?
Step 1 = create a socket which can communicate with mySQL.
I ask the elementary questions because there seems to be alot of additional jargon as I am googling. G++, BackEnd this and Front End that with -o's and .h's.
To answer your question. No. I did not install it, however, I did read up on it. I have been searching this for about 2 days now, and it is my understanding that for security purposes, it is not good practice to connect directly to the database from the app. It appears users would be able to SNIFF the database info and password too easily. I was advised it would be better to have the app do some sort of HTTP request to do some login, and then use PHP to communicate with the database.
It is for these reasons that I am now attempting cough* attempting to install cURLpp and the Boost lib. I hope I am getting it right.
I am anxious to get started but it appears that I will be stuck here on step 1 at least a few more days. I'm learning things though. I think.
As an aside, the common vernacular in the C++ community is "program" (or "programme" for the classicists out there), rather than "app". It doesn't really matter, but it's always nice to know the convention.
Yes. It would be a client program that I would like to write. I'm guessing that is correct.
Here. I'll give a brief description of what it is that I am looking to do, and you guys can tell me what it is that I SHOULD be doing.
I have a website. I own it. When I user logs in to the site, I would like an (app, program, Extension, add-on....) to take a pre-specified path and check the contents of said folder. The folder will contain files which I would like to compare against my database. This compare should be done by CRC. I already have the contents in my database. The database contains a list of all the files and their corresponding CRC check-sums.
I have been told everything from a Cloud App, to a Browser Extension, to Lincoln Logs. I was told I should write it in C++, (not trying to start any wars about what its the right language because I honestly dont know).
This leads me to how I got here. I am trying to get everything together to write this program. I'm sure I'm going to struggle with this, but I'm willing to learn it.
Since this thread isn't getting any attention, I recommend asking the same question on http://stackoverflow.com/
It's a much larger site, although it isn't a discussion forum, so that's not too great either.
One could write such a thing in C++ without too much trouble (dirent.h to interrogate the directory, crc16.h for CRC calculations).
First I would like to say congratulations to you, Chops for being the only one on the face of the planet who has said it can be done with not too much trouble. Everyone else has seemed to be voting against the C++ option. Would I be totally out of lines to ask why not use the CRC32b? Would this not be the way to go, and isnt CRC32b the fastest way to go?
Since this thread isn't getting any attention, I recommend asking the same question on http://stackoverflow.com/
It's a much larger site, although it isn't a discussion forum, so that's not too great either.
Ham, Good suggestion. Will do. I however have really appreciated the insight from you fine fellas. ANY attention regarding my project is better that none. Were you hinting I should let this thread DIE out, or is it ok, to follow up when I see responses?
Would I be totally out of lines to ask why not use the CRC32b?
I had no idea which CRC algorithm you wanted to use, so I just picked a CRC library more or less at random. If you've already got your database of hashes, you're stuck with whichever algorithm you've already used. Otherwise, it's just whatever's convenient for you; I'm assuming that you've got no particular need for any particular method.
Yes. I do already have the database populated with hashes. So, as you mention, I will use that structure for now.
I am also being advised that I need to utilize cURLpp and Boostlib. So, Im trying to get that installed. Once I get everything setup with the IDE ( Code::Blocks) I should be ready to start. :)
You can use Code::Blocks, but I don't recommend it! Instead, I would use wxDev C++ or MinGW Developer Studio.
The problem when working on MySQL databases is that you got to learn it from scratch. You 1stly got to learn the baisics of accessing and editing a MySQL database from C++. Sure there are many videos online, so take your time, and come back when you get some code. After that I will be glad to help. (We do NOT make your code for you, we help you understand and fix it)
OK. Guys? (not sure whats going on with the postings ^^ there...
I am going to follow up with this wxDev and MinGW suggestions. I'm no expert in MySQL but I am confortable in it, I use it often with PHP. I understand it will be different from PHP if Im using it in C++, but I think (unless otherwise instructed, that for security purposes, interaction with the database(s) can be left to the PHP. This is half the reason I am looking how to do an HTTP GET from a C++ app. Not to the database, just to my site(as a login).
I'm gettin there, ROFL. At least now I know I have to have cURLpp & Boostlib, installing these and setting them up is not as easy as I would have thought here in Ubuntu 10.