Stefano Mtangoo 455 Senior Poster

next time post error! error like one below helps than "it doesn't work"
double for.cpp:16: error: 'sleep' was not declared in this scope

Stefano Mtangoo 455 Senior Poster

use double (Nested?) for loop
1st loop will iterate though the array and for each array element, It will iterate though same array, but now comparing stuffs. To get flavor of what i'm saying compile the program below and change it to suit your need. The key concept is there

#include <iostream>

void compare(int[], const int size);

int main(){
	int xyz[3]={1,2,3};
	compare(xyz, 3);
}

void compare(int Xarray[3],  const int size){
	int i;
	int j;
	for(i=0; i<size; i++){
		for(j=0;j<size;j++){
			//compare Xarray[i] and Xarray[j] here and do your other if..else
			std::cout<<Xarray[i]<<" Compared to "<<Xarray[j]<<std::endl;
		}
	}
}
Stefano Mtangoo 455 Senior Poster

Here is the solution (I guess it has to do with priority of operations, I never had that problem before, but again, I rarely use pointers to member functions):

(pointerToBase_->*pointerToComputeFooFunc_)(aValue); //notice additional parentheses.

That makes it compile!

Stefano Mtangoo 455 Senior Poster

what does not work means?
It is very general term. Please say exactly what does not work. Errors, et al

Stefano Mtangoo 455 Senior Poster

It wasn't a demand - you've just completed turned this thread around.

I was just asking for some friendly help.

Cool then, just visit the link, and ask wherever you don't understand. That is what forum means, discussion to understand things :)

Stefano Mtangoo 455 Senior Poster

You disassemble the code, look for the label "checkPassword", look for a comparison operation on the parameter "password", find the memory location of the other compared element "myPassword" and extract the value. Or, find token "checkPassword", replace the comparison operator by a comparison between password and password (always true), and you get that all passwords are valid (that is essentially how most "cracked" software are done, just by replacing the part that authenticates your CD or license by dummy operations that always yield a positive verification).

This is not reverse engineering, just requires very basic knowledge of assembly code and a decent disassembly tool.

But that is reverse engineering which we cannot avoid. If you need such tough security, then encrypt withh something like AES 128 et al and decrypt the file before using. But there you will have to add library for encryption

Stefano Mtangoo 455 Senior Poster

I was just asking if someone would be kind enough to remove the website, phone and company from the backend. I've removed it from the html but it still is asking for it.

Taking 10-20 minutes reading on "forms" in link I gave on "yes" post would make you capable of that. If you cannot do that, I hope another body willing to break the rules/norms can go ahead and do the demand of yours.

Stefano Mtangoo 455 Senior Poster

Yes, this is what I wanted but wouldn't that only work o PHP2? Is it possible to then get than name to PHP3 after going to PHP2?

Hi,
you really deserve the piece of cake we always give on noob's birthday!

Stefano Mtangoo 455 Senior Poster

Just a bit of html/css

So No PHP at all and you want to jump to forms :icon_eek:
No way, you have to learn crawling before walking

Stefano Mtangoo 455 Senior Poster

The worst thing you can do is post a solution where the OP has made no effort. This fills up the forum with fly-by posters with 'help me now' posts. This is killing the site.

Where are moderators? Can't they nail rule that gimme gimme gimme is a taboo?
Apart from purple stress (If you don't believe me visit beautiful programmingforums), the only headache is lazy people who wants somebody to earn a degree for them!
Strange and stupid :angry:

Stefano Mtangoo 455 Senior Poster

The problem with that is that even a guy like me who is not by any means a professional hacker (never done any hacking at all) could break this protection in a matter of minutes.

Break it without reverse engineering? How on earth Mike? :icon_eek:

Stefano Mtangoo 455 Senior Poster

Hi,

Its a free script - I've left the linkback to the creator intact thats why I'm asking for some help :)

What is your programming level, specifically PHP?

Stefano Mtangoo 455 Senior Poster

i need correct method tooo

I'm sorry but there is no short cut my friend. You have to dig deep and coin it

Stefano Mtangoo 455 Senior Poster

Did you code it or copied and pasted?
I ask because why should it be hard if you coded?
Ooops! Short answer is yes

Stefano Mtangoo 455 Senior Poster

Thinking in C++
I'm big fan of comprehensive C++ how to program by Deitel

Also some good sites to visit like CplusPlus and CProgramming. Also don't miss Soulie's tutorial

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

I am trying to figure out a way to use maps to keep a total number of items.

I was using arrays before

total[x] = total[x] + (function to add another int);

Now I made total a map, but have no idea how to get the same result.

Gives me an error.


Any help would be greatly appreciated.

Where is a map?
You need to get this milk before you start chewing!

Stefano Mtangoo 455 Senior Poster

I am a beginner in c++, I taught myself c++ through the book "c++ primer plus", it really took me a lot of will to finish the book. Now i just want to use the thing i learned to do some pratical things in my life, can anybody tell me how to accomplish? Some advice for my learning will receive my appreciation too.

try some console apps, depending on your interests. If you love math, go to project eura and keep with their questions. After you get little advanced (IDEs of course) make some interesting project. I would suggest simple audio player (console one) using some libraries like Zplay or Bass. Then Choose GUI toolkit (wxWidgets/QT/GTKmm) and transfer you console App into GUI application. Keep adding things like Podcasting, streaming....and you end up with open/Closed source applications.

That is Just example, you can geer yourself into any direction of your interest. The rule of the thumb is, start with simple app, learn new concept, exapand your app.

My Suggestion:
Compiler: GCC/MiNGW
IDE: CodeLite or Code::Blocks
GUI Toolkit: wxWidgets

hope it helps

Stefano Mtangoo 455 Senior Poster

what is your current code?
I'm not familiar with class forwarding so I'm lost in Mike's code.
Where is BaseClass?

Stefano Mtangoo 455 Senior Poster

I'm not quite sure what you meant by that, but apparently it was because I forgot a semicolon. Funny how it marks the next command as wrong.

Because semicolon is a "punctuation mark". It sees two statements as one statement.
like I Love Tanzania It is most beautiful! (Two sentence but missing full stop)
The difference here is, you are more intelligent than a compiler

Stefano Mtangoo 455 Senior Poster

so far i have gotten the code for 1 and 2.

Congrats!

please correct me if i am wrong.thanks.

Just make simple sample to test your software if is working correctly :)

any idea on how to compare each value is included in an array twice?

Can you clarify this please

Stefano Mtangoo 455 Senior Poster

No problem, mark the thread solved :)

Stefano Mtangoo 455 Senior Poster

Definitely check out Zend. I have never been anything but impressed by its capabilities and flexibility.

I have never used Zend so i cannot comment on it. However all MVC frameworks are almost alike except for classes(and hence functionalities), configurations, dependencies and How tight MVC the framework it is. Some are strictly MVC and some, like CI are loosely MVC. By loose MVC it means you can drop Model and yet it works.

I would be happy to hear what Zend and CakePHP features!
So far I have read little of CI vs CPHP

Stefano Mtangoo 455 Senior Poster

For me, I prefer Fedora, I think it is more Linux like in it's implementation of things whereas I feel that Ubuntu tries to hard to copy Windows and OSX, that does not however invalidate anyone else's opinion.

That's why I did delete my Vista partition only to load Ubuntu Lucid lynx. However your statement is incomplete IMHO. I think it should go like
Ubuntu tries to hard to copy Windows and OSX, while preserving basic linuxish :)
Fedora was my first encounter with and all I can say is wonderful too!

Stefano Mtangoo 455 Senior Poster

Thanks for the detailed response. I went ahead and tried your suggestions, and everything seems to work fine, except that the compiler throws this error:

This is linked to the following line of code:

pointerToBase_->*pointerToComputeFoo_(aValue);

I can't seem to get around this, and it's very strange to me, since the error shows that it's in the scope of FooClass that the pointer to member function pointerToComputeFoo_ is compiled, whilst the typedef explicitly places it in the scope of BaseClass.

Something rather funky seems to be happening here.

I hope you can help me sort this out.

Your feedback is much appreciated.

Thanks in advance,

Kartik

Is it not the same issue of forgetting the ClassName:: *iamAPointer?
Try adding the class in which it is contained

Stefano Mtangoo 455 Senior Poster

;)
"bad boy" nice ;) i like it.
you realy don't understand what I mean on my CLEAR question is.
actualy i'm very2 know how to update / insert / delete mysql records but this case, i don't.

is not the answer, mr. good guy... > :D

Is the subject of this topic not clear for you?
------------------------------------------------------------
please stop here, it's not important for you and for me
------------------------------------------------------------
@qazplm114477, thanx for helping.
But I mean:

this is a mysql table

tablename: friends
---------+---------+
memberid | friends |
---------+---------+
donny    | jack michel | 
         | mike lisa   |
------------------------

# 1 (one) word on friends column are 1 (one) another user
# and i want to update column "friends" only

how if "donny" get a new friend e.g. "paijo", or lisa outs from his friend list?
Rules: do not create another same row contains memberid='donny'.
Should I receive all friends column data first, distribute them as array, then deleting/adding more data?

$sql("UPDATE friends SET friends=friends".$newfriend." WHERE memberid='donny'"); // this does not work

thanx

Now you are becoming clearer, Mr. Bad boy :)
You want to update the list of friend in a Column Donny without overwriting existing friend right? If so then, query all friends of donny, concatenate the list with new friend and then perform update using this new string.

And don't use chat words like i luv go 4 fishing 'n' I don wannab bad boy :zzz:

Stefano Mtangoo 455 Senior Poster

Um, Never used QT, but wxWidgets is just a clone of Microsoft Foundation Classes, so dont use it, just use MFC if you were going to look at wxWidgets.

Fact or fiction? I have never read it anywhere, neither in wikipedia nor in their website
Even if I grant that, MFC osn't wxReplacement you know, it is not Xplatform.

Stefano Mtangoo 455 Senior Poster


lol i am actually laying in bed but i'm too hard headed to leave this program without solving

Mmmh, that is not very good. You debug program while tired and you use 5hrs with no success. You sleep and debug it next day, within 5minutes :)

Stefano Mtangoo 455 Senior Poster

Just do the opposite
something like, whenever he does if(isPrime) you change to if(!isPrime).
You might think of getting Juice and have a rest :)

Stefano Mtangoo 455 Senior Poster

my problem is that I don't really understand the questions and don't know where to start.

You deserve a piece of cake

Stefano Mtangoo 455 Senior Poster

why not make functions and keep main() clean?
that way you will avoid many troubles

Stefano Mtangoo 455 Senior Poster

Use search box at the top right corner.
If you used it, then you would come with something like this

Stefano Mtangoo 455 Senior Poster

Hint:

int i=0;
for(i=0; i<100;i++){
    cout<<i<<"\n";
}
Stefano Mtangoo 455 Senior Poster

1. USE CODE TAGS!!!!!
2. Comment what each line does according to your login
3. Few stuffs are not initialized
4. You cin the array not array element

Stefano Mtangoo 455 Senior Poster

Use Code tags

else if (item == 'A')
money =number *itemA;
cout << "Your total is $" << money;

should be

else if (item == 'A'){
money =number *itemA;
cout << "Your total is $" << money;
}

that is

if(....){
//=============
}
else if(...){
//==========
}
else if(...){
//=============
}
else{
//============
}
Stefano Mtangoo 455 Senior Poster

I would read a line, tokenize it with the > as delimiter and drop the part I want and write to another file. Finally as AD have said remove old and rename current

Stefano Mtangoo 455 Senior Poster

I thought I would "debunk" some myths of QT addict :)

I've had experience with both but more with Qt than wxWidgets.

Thank you for telling us that, we will consider it in your arguments. I would also say I have never used QT. So I will not try to be QT expert here. But I have long time use wxWidgets

The problems with wxWidgets is that it tries to be more like MFC than Qt. wxWidgets was made to help users that was using MFC to migrate easier to an better less buggy gui framework. So what wxWidgets made actually inherited a lot of the bad things MFC had. And what you got was wxWidgets.

I have not programed with MFC either and I know M$ sometimes complicates things, but I would love to know those "bad things". So far I haven't seen any :)

wxWidgets still believes in making the framework work on 95,98, 2000, etc. They still offer a ansi and a unicode choices. Which i believe is stupid because no one imho still lives in a world that only flows around ansi. It should be unicode and only unicode.

So what? Is it not burden to developers and advantage to users? They are dropping that anyway. I would say it is "advantage" over QT, for It serves even old grandpa's machine.

The building of wxWidgets is just complicated at most. You have to edit some god forsaken header file to enable features …

Stefano Mtangoo 455 Senior Poster

Qt has a lot of books on it. And very updated unlike wxWidgets book which was last written in a very old version of wxWidgets.

Source

Nothing have changed much of the API to require a new book. After all very active wxForum plus very active google group, makes a book needless. Plus some good tutorial out there :)

May be a book will come out when version 3 is out!

Stefano Mtangoo 455 Senior Poster

QT for ever

Biased mhhh?
Live long wxWidgets ;)

Stefano Mtangoo 455 Senior Poster

Hi, I am also having an ONLINE ENROLLMENT SYSTEM and having a problem with coding.. I am a returnee student and more programming languages has been adapt... Using php, apache, mysql, html, javascript, css etc... I am confused especially in php query.. can anyone help me here, i don't have much time.. please someone help me..ASAP..With high anticipation, God bless.

Do you mean you want to hire someone?
If no then show effort and we will help.
Work and we'll help
God bless you as you do that :)

Stefano Mtangoo 455 Senior Poster

Code Igniter is great, check it out here, http://codeigniter.com

+1 for CI
Simple, loose MVC, fine docs et al

Stefano Mtangoo 455 Senior Poster

search for wxWidgets, QT, GTKmm

Stefano Mtangoo 455 Senior Poster

AFAIK, passing pointer to class member function need you specify class Name also, i.e

typedef void ( FooClass::*pointerToDoubleTakingFunction ) ( double& );

See this link for more info

Stefano Mtangoo 455 Senior Poster

No I don't actually want the exe to be launched when an event happens. I want it to be on the form. Like how you drag a button to a form you can put the exe on there too.

C# magic? AFAIK, that is impossible. Treating exe like widget? No way.
Mya be some expert here will say something

Stefano Mtangoo 455 Senior Poster

Well as an example I have a Form1. Its got some buttons, a textbook ect. I want something that will let me actually put the .exe as a control(or something) ON THE FORM.

Do you mean pressing the button will launch exe?

Stefano Mtangoo 455 Senior Poster

Ooh! I get you now.
I would do something like
1. User enters Password
2. I hash the Password and compare to password hash stored as user password
3. If hash matches I use the key to decrypt, else I keep asking Username and present vague error like (smoething went wrong, may be user name or password is wrong)

As of risk, I would store user names vs password hashes in something like MySQL database or SQLite3 database. In case of SQLite3, I would password db file in such a way that only the application can access it. So each time user enters his credentials, SQlite3 db get decrypted and queried.

Stefano Mtangoo 455 Senior Poster

try this

//integer.h
int x;
int y;
//main.cpp
#include integer.h
#include integer.h
#include <iostream>

int main(){
x=10;
y=11;
std::cout<<x<<" "<<y<<std::endl;
    return 0;
}
Stefano Mtangoo 455 Senior Poster

Is there any way of emulating an .exe in a .NET application?

What do you mean? I can compile exe with MonoDevelop C# compiler

Stefano Mtangoo 455 Senior Poster

It happens. They have a name for it: a bug

Without the code to demo, who can say what happened.

A bus is usually "user error" :)
they are cause by programmer.
There is a saying that goes like "garbage in garbage out"

Stefano Mtangoo 455 Senior Poster

Use code tags please.
Check line 15, there is a dot there. What for?
String inData.;

import java.io.*;
import java.util.*;

public class Ch3_PrExercise1
{

public static void main(String args[] );
{
// declaration

Scanner console = new Scanner(System.in); //read from keyboard
int num1, num2;
int num3, num4;
String str;
String inData.;
// input
Scanner inFile = new Scanner(filereader("inData.txt"));
num1 = inData.nextint();
num2 = inData.nextint();
str = inData.next();
num3 = inData.nextint();
num4 = inData.nextint();
inFile.close();


// process
int sum = (num1 + num2); // add numbers from line 1
int product = (num3 * num4); // multiply numbers from line 3


// output
PrintWriter outFile = new PrintWriter("Outdata.dat");
outFile.println( "The sum of (+ num1) and (+ num2) = + sum");
outFile.println( "The character that comes after (+ str) in the unicode set is (+ <=)");
outFile.println( "The product of (+ num3) and (+ num4) = + product");
outFile.close();


} // end main
} // end Ch3_PrExercise1