Stefano Mtangoo 455 Senior Poster

I will pretend that I have understood and open to correction :)
I will assume also that you can query the database. There might be several way to do that but one of them is this for procedure (a bit different and easy for OOP)

index.php

<?php
include("functions.php");
?>
<html>
<head>
<title><?php echo getTitleFromDbFunction($argumentIfAny); ?></title>
</head>
<body>
<!---put your body stuffs here-->
</body>
</html>

functions.php

<?php
function getTitleFromDbFunction($argumentIfAny){
//get the title from database.argumentIfAny can be ID of title from Get or whatever
return $theRetrievedTitle;

}
?>

Note: this is to give Idea, untested and so unwarranted!

-==Zero==- commented: Thanks So Much -==Zero==- +2
Stefano Mtangoo 455 Senior Poster

no sir.. i need only ideas,suggestions or tips if how to start to make this program.. coz im only 1st yr college student in philippines.. hope you understand sir..

There goes a "suggestion"

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

To do that with C++, you need something like libcurl (http://curl.haxx.se/libcurl/).

That is what OP need. But be warned of this:

There's basically only one thing to keep in mind when using C++ instead of C when interfacing libcurl:

The callbacks CANNOT be non-static class member functions

Example C++ code:

class AClass {   static size_t write_data(void *ptr, size_t size, size_t nmemb,   void *ourpointer)   {   /* do what you want with the data */   }  }

Source

Stefano Mtangoo 455 Senior Poster

Ok i got wxwidgets but have no clue how to install help!!!

Check this Wiki entry. The best way for newbie would be using precompiled version called wxPack. Use wxDevC++. It is updated version of DevCpp and have RAD for wxWidgets.
Hope that helps!

jonsca commented: wxPack was the word I was looking for, thanks! +7
Stefano Mtangoo 455 Senior Poster

I would suggest you go for wxWidgets. You can use wxPanel/wxGLCanvas to draw your stuff depending on whether OGL or just pure wxStuffs. It is not that hard to draw images on wxPanel once you are used to wxWidgets. Good tutorial to begin with is here and good support at wxForum

jonsca commented: I saw your name as having responded to the thread, and I knew immediately what you'd be posting about. :) +7
Stefano Mtangoo 455 Senior Poster

-lwinmm is missing?
If only you learn to use google

mangopearapples commented: You are a genius! +1
Stefano Mtangoo 455 Senior Poster
diafol commented: very good +8
Stefano Mtangoo 455 Senior Poster

to convert a string into int is as easy as

long fromText;
int theIntValue;
wxString str = textBox->GetValue();
str.ToLong(&fromText);
theIntValue = (int)fromText;

I would concur on learning wxWidgets.
http://zetcode.com s best place to begin. Check also wiki for documentation and first place should be manual and samples

Stefano Mtangoo 455 Senior Poster
Celtrix commented: thanks +1
Stefano Mtangoo 455 Senior Poster

wxWidgets is event driven just like other GUIs. So here I suggest you make a text Control and then bind it to ana event handler (Class Method) and do all stuffs there
Here is simple code to Make a text ctrl

wxTextCtrl* myTextHolder = new wxTextCtrl(pointer_to_widget_parent, wxID_ANY);
wxButton* myTextHolderButton = new wxButton(pointer_to_widget_parent, wxID_ANY, wxT("Click Me!"));
Connect(myTextHolderButton->GetId(), wxEVT_BUTTON_CLICKED, wxCommandEventHandler(MyClass::MyFunction), NULL, this);

//------------------------------
void MyClass::MyFunction(wxCommandEvent& e){
    //handle your stuff here when the button is clicked!
}
Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

best example I have ever found as C++ general solution is here and another not so good example for beginner IMHO is located here

Akatosh commented: Great links +1
Stefano Mtangoo 455 Senior Poster

wait a minute,
isn't line 25 supposed to be as below?

if (!$sql) {
  // query failed
  die(mysql_error());
}
pritaeas commented: Missed my own typo. +6
Stefano Mtangoo 455 Senior Poster

what is your current code? Try to add or die(mysql_error()) in each mysql function so that you can spot where the problem is

Stefano Mtangoo 455 Senior Poster

I hope you meant $sql in the line below

if (!sql) {
Stefano Mtangoo 455 Senior Poster

Ok, in all your queries and connect (MySQL functions) add or die(mysql_error()); so that it gives you error at that point and terminates. That is, if the line was

mysql_query("SELECT * FROM dummy_table");

then change it to

mysql_query("SELECT * FROM dummy_table")or die(mysql_error());

then post the error you get (full error) and the line number it complains

Stefano Mtangoo 455 Senior Poster

If only you read readme sticky
It have the problem. Link is here

Stefano Mtangoo 455 Senior Poster

Check this system and familiarize with the techniques

Stefano Mtangoo 455 Senior Poster

After some testing, I still couldn't figure out my this was happening, but I did find out something weird as well. When I used an Alter statement in mysqli_multi_query() it did not work, but when I used the Alter statement in mysqli_real_query / mysqli_query it worked fine.

fyi, I did test my connection and query/multi query, and they were both working fine.

IMHO, alter statement is taken with many (I included) as bad design, so it much of the time, not thought to be of frequent use. So I guess that is why it isn't supported: Afterall we run the query when we mess up with design don't we? :)
Just run it as separate Query. I will check to see if my guess is so.

qazplm114477 commented: thanks for clearing up +1
Stefano Mtangoo 455 Senior Poster

can anyone help me in doing railway reservation system using visual basic

Sure and the guy is here

Stefano Mtangoo 455 Senior Poster

@evstevemd

I was wondering if you could give me your thoughts on a couple of frameworks I've seen on the web. one of the is X-Jax from http://www.xajax-project.org/ and Lithium from http://lithify.me/ I'm trying to learn how I can make a website that utilizes AJAX heavily while still working in a MVC framework (I hope thats possible).

Thanks to everyone for your great suggestions

I won't suggest you go for ajax-ified framework. I would say Check framework and Ajax library. as for me I will say take Codeigniter and JQuery :)

qazplm114477 commented: great suggestions +1
Stefano Mtangoo 455 Senior Poster

Thanks evsteve...this current code doesn't seem to work. It wont update the database. I am looking for help to get this to work and I think I am close.

I will advice you the best way to do these stuffs. Get your copy of MySQL workbench and connect to your local copy (remote site?) and test queries. Tweak them until they work. Transfer query to PHP. MWB have got syntax highlighting. You can also create view that acts as a table with all sums you need!

ceeandcee commented: Thank You! +1
Stefano Mtangoo 455 Senior Poster

1. I get sick and tired of those lazy guys, so if you aren't the like don't post on their thread "soup for free, gimme one please". The whole thread heading fueled anger as to why someone will not work. So, you are welcome!

2. Use straight english. Not many here (me included) full understand the kind of english you use.

3. Say exactly what is not working, how did you suppose it work and how it currently behaving.

4. For complete noob, read PHP Guide for complete new bees

mschroeder commented: Couldn't have said that better myself! +3
Stefano Mtangoo 455 Senior Poster

Hint: Path may be incorrect!
src="/ImageGallery/Images/mmbg3xmx3g.gif"
supposing that you have your www directory at src="Z:/home/localhost/www/ and images in subdir ImageGallery/

Using relative paths is easier than absolute paths

Stefano Mtangoo 455 Senior Poster

Sounds like plugin system?
If so, then make plugin loader/Manager.
All plugins will share interface file, let say plugins.h where variable holding the password is defined. then in all methods of the DLL, check password first and if doesn't match, return some garbage. Else do a process!

void checkPassword(std::string password){
    if(password==myPassword){
            return true;
   }else{
       return false;
   }
}
Suzie999 commented: useful information +1
Stefano Mtangoo 455 Senior Poster

Go for PHPBB3. AFAICS, it comes close to VBulletin if you customize it enough!

Stefano Mtangoo 455 Senior Poster

why using Windows thing in QT, I mean QT is designed to be Xplatform and using windoish stuffs limits the very purpose. If you plan to use it in windows then go for Win32 API, or stay away from windowing and do it QT way :)

Having said so, I suggest Zetcode QT tutorial as one of Good start

Stefano Mtangoo 455 Senior Poster

And FYI: there are several GUI RAD builder for wxWidgets, both commercial and free
Commercial:
wxDesigner By wxDeveloper Robert Roebling
DialogBlocks By wxDeveloper Julian Smart

OSS:
wxSmith - Inbuilt with Code::Blocks
wxFormBuilder - Stand alone inheritance driven RAD
wxDevCPP RAD - inbuilt designer in wxDevCpp

See here for comparison

NicAx64 commented: g00d +2
Stefano Mtangoo 455 Senior Poster

Who make better programmers? Men or Women? :) Just curious coz all around the world, in academics, women surpass men. But in this field, i guess its men :). What you say? I am a male by the way!

We have at least Narue(female) and Ancient Dragon (Male) and they are both competent and helpful friends here. I'm confident to call them C++ experts. So what's your question?

Gender have nothing to do with their being that way but rather learning and practice and learning and practice and L&P&L&P...to death!

Stefano Mtangoo 455 Senior Poster

Since I use Linux about a year ago. I never look back to Window. Yeah Window 7 looks great but the security still sucks. Games are great but once the virus attack your computer everything will be wipe out. So I cannot afford to loose my precious data and sacrifice my gaming and stick with Linux. Only one small issue with my Lexmark all in one printer. It need Window XP still no problem with virtual box but I just use it whenever I need to scan. Feel like dumping the printer and get a new one with Linux support of course.

What Linux Distro are you using? I have Ubuntu Lucid and everything runs fine but I use HP Printers. I added it and I never installed anything. If you use Ubuntu check below links
(BTW there is a wrapper I guess ndswrapper that installs windows drivers in Linux)

https://help.ubuntu.com/community/Printers
http://ubuntuforums.org/showthread.php?t=49714

rubberman commented: I am using Linux Mint (a clone of Ubuntu) right now. It is very nice! +14
Stefano Mtangoo 455 Senior Poster

I wont be posting complete solutions ever again

That is not wisdom my friend. It is a matter of show-effort-and-we-help!
If he shows enough effort you can help him like that but not give him copy and paste and bang, here is 100%. Some people use week(s) trying to resolve same problem showing a lot of efforts, reading a lot. I think it is fair for big hand to be given to those but not lazy gimme boys.

I would rather get MY 0% than get 100% which is NOT MINE.
I think that should be the motive, but then that is my opinion ;)

jonsca commented: Too true +4
Stefano Mtangoo 455 Senior Poster

Can a few less than moderately experienced programmers design large scale C++ software?

Stop endless question with no progress. The questions you are repeating are already answered. I say yes and no. Yes if you use some library. for example, i don't have to port my codes to Linux or Mac with wxWidgets. Already big team have worked on Xplatform issues.

I don't mean to discourage you but why don't you dive in? Somebody already said there is no such a thing as "standard coding", so is the definition of Big project. I think you can do it but it depends on definitions of "big" and "standard" you have in your head. ;)

That said, many people have done that some are:
Eran Ifrah - CodeLite
Kevin Hock - Bitwise IM
Julian Smart - Alot of things at Anthemion

so the best way is using library to solve the problem and only code one if there is none.
There are scale of project that can't be done with one person "practically". Something Like Ubuntu Lucid, MacOSX, Windows 7 just can't be done by one person.

So drop your fears in trash can and start coding and finish up your project.
Then take cup of coffee :icon_wink:

StuXYZ commented: excellent final summation post +3
Stefano Mtangoo 455 Senior Poster

For anyone wondering how, this blog answered it simply. I will let this thread on for a while

Stefano Mtangoo 455 Senior Poster

Hi all,
I know many here have been working on big project and can help me on this. We will be having a project to do and we are more than 3 people. We will be working at different times and places(We are not employed developers per se Just hobbyists). My friends are Java addicts and hence we will be doing it in Java as web app. I have two questions that i need your help:
1. What is the best way to manage such project so that we won't collide?

2. What are advice(s) you will like to give someone like me working with team for first time? (All the time I have been working on personal projects alone)

Stefano Mtangoo 455 Senior Poster

see here

Ancient Dragon commented: nice link :) +28
Stefano Mtangoo 455 Senior Poster

If/Else will evaluate only bools.
Switch will evaluate integers in whatever form they come from.
Jonsca have given solid examples. BTW have you passed this tutorial and this one?

Stefano Mtangoo 455 Senior Poster

I was looking for Jump start tutorial for JSP/MySQL. I found Peter budo's sticky. Since I wanted to learn it even offline I decded to put it in word Doc.

I will nice format it if I get time and make PDF out of it. However I know some might have that time or might be more skilled than I do. So I post here with very little editing (And formatting of course).

I have to rush somewhere, so if you have time, take it add something and repost back. Peter, please check if there is anything to add or remove, even my bragging ;)

Thanks

Stefano Mtangoo 455 Senior Poster

Thank you i figured out how to do the sqrt of d but i need help with my Driver program.

well glad I helped!
Let's go again!

How would i test my squareRoot() function for a negative?

Well answered by Vernon Dosier

and I also need help with my power() function, if the exponent is a negative what do i need to do...Here is what i have: double

let see
if if x is raised to power of -y then it is equal to reciprocal of x raised to y. If that is true, mystery is then solved as your function would recurse itself y times while each times accumulating x*x; The final answer is then reciprocated and that is the power. Note that test for y and if it is negative (i.e <0), do reciprocal before retuning an answer. Otherwise don't reciprocate. That will solve for both positive and negative values of y

Stefano Mtangoo 455 Senior Poster

don't know how to get the square root of d (can't use cmath)

what is issue with cmath? Have lecturer banned you from using it?
Cool then here is the necessary algorithm to do it.
See this one

Stefano Mtangoo 455 Senior Poster

where is the problem?
You can pass here and brush yourself on wxthings and where you hit a wall, come back and post specific problem Check wxPython tutorial

barabass commented: Nice tutorials, very useful! +0
Stefano Mtangoo 455 Senior Poster

Not necessarily. It simply means you cannot predict the next value -- which in fact may be the same as the current value.

you missed my point :)
I mean all that changes is value and not position

WaltP commented: Oh. OK. +11
Stefano Mtangoo 455 Senior Poster

I'm going to give you something that will help you make sense out of C++
Please read them and you will save yourself a lot of pain
http://www.cprogramming.com
http://www.cplusplus.com/

especially their good tutorials
http://www.cprogramming.com/tutorial.html
http://www.cplusplus.com/doc/tutorial/

and for free book (Massive Thinking in C++)
http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

What about this?

tkud commented: This post is really helpful. +0
Stefano Mtangoo 455 Senior Poster

You should make random function that will take range and at any time return two random numbers. Then present those numbers to her and calculate her answer. Compare to the real answer and then grade her (array?)

Stefano Mtangoo 455 Senior Poster

Design a file manager with Two Panels Like Krusader in KDE Linux or Total Commander. The File Transfer between two sides should be done via menu (Copy/Cut/Paste), Buttons, Context Menu, Shortcut Keys and Drag and drop.

Additionally you can add FTP functionality Even SSH. Cross Platform should be a buzzword :)

Stefano Mtangoo 455 Senior Poster

I have tried that is the POINT I dont know where to start i am new to this so i dont understand the syntax ?

As far as I know, one cannot learn a language before learning the basics. So before you tr to do anything, grab the basics

Then go back to scripts given before and make whatever you want out of them. If you fail somewhere, come back and ask.

nav33n commented: Bingo! +6
Stefano Mtangoo 455 Senior Poster

if you know how to do it from CLI then try subprocess

Stefano Mtangoo 455 Senior Poster

I'm have not well understood but I thinks functions are good ways to go.
Here I have little time (at work) so I will try to do little thing to show example of function. One can improve it ;)

// InfoMenu.cpp : main project file.

#include <stdafx.h>
#include <iostream>
#include <string>

using namespace std;

//define function prototypes
void MyMenu();

int main()
{
int test=1;//test conditio that user want to continue{1=Yes, 0=no}
if(test==1){
	MyMenu();
}
else{
	return 0;
}
  
}

void MyMenu(){
	
	  int loop=1;
	  int choice;
	  string getinput;

	  while(loop==1)
	{
		cout << "Type 'exit' to leave at any time\n"
			 << "Type 'login' to begin\n";
		cin >> getinput;
		if(getinput=="exit") // Exit Code
		{
			exit(0);
		}
		if(getinput=="login") // Login Code
		cout << "Username:"; // Username Code
		cin >> getinput;
		if (getinput=="Test")
		{
			cout << "Passsword:"; // Password Code
			cin >> getinput;
			if(getinput=="Pass")
			cout << "Welcome...";
			
		}
	}
  }
	
}