Stefano Mtangoo 455 Senior Poster

check wxWidgets. It have got classes that deals with that. I think it is wxFTP plus some drag n drop issues

Stefano Mtangoo 455 Senior Poster

Thanks Jas,
It seems a way complicated when it comes to C++/XML
Should I learn Boost or just jump in your example?

Stefano Mtangoo 455 Senior Poster

Hi Vega, okay i used your py2exe template and converted my app to an windows app. when i tried to run the app i got the missing dll error message(MSVCR90.dll). so downloaded the dll and copied it into the system32 folder

I would rather copy it in same folder with app than clogging my System folders, But again that is my behaviour ;)

Stefano Mtangoo 455 Senior Poster

Hi
Im so sorry if i bottered you english is not my mothertongue so i may make some mistakes

No problem


.(Im a girl)

:)

Stefano Mtangoo 455 Senior Poster

Here is just simple rumbling around same example

#include<iostream>

int sum = 0;

int main()
{
     int x, y;

     std::cout << "Enter number X: ";
     std::cin >> x;
     
     std::cout << "Enter number Y: ";
     std::cin >> y;

     std::cout << "The memory address for the number is: " << *Summation(number);

return 0;
}

int* Summation(int x,  int y)
{
     sum = x+y;
     return& sum;
}
Stefano Mtangoo 455 Senior Poster

Thanks I will go for it and see how it does

Stefano Mtangoo 455 Senior Poster

I forgot to mention that it should be small not very big as I will use basic functionalities. What think you of tinyXML++. Is there anyone who have used it? I'm looking at boost

Thanks

Stefano Mtangoo 455 Senior Poster

I want to have complte control. So which one is the best?

Stefano Mtangoo 455 Senior Poster

That only affects the error log and console output ...

# redirect=False sends error and print messages to the console window
# redirect=True sends error and print messages to a wx popup window 
app = wx.App(redirect=True)

I misunderstood the question :'(

Stefano Mtangoo 455 Senior Poster

You sould completly replace cmd.exe with your own version of that program. For example Microsoft has already done it with PowerShell. Another example here

Nope!
I want to make GUI wrapper on top of cmd.exe
I want to make something flexible but still backend should remain as cmd.exe. Only a front end. so I was looking for way to hook my GUI to cmd.exe sending commands typed to it and getting results back. I hope that is wrapper than purely new shell. I will check for power shell though

Stefano Mtangoo 455 Senior Poster

After many weeks of studying and attempting to reverse the sha1 algorithm I have come to the following conclusion:

I hope you have got great experince while jumping the hoops.

Stefano Mtangoo 455 Senior Poster

Hi All,
I want to parse simple XML file and I was looking if there is C++ standard library classes for doing that. IF no what are good yet simple XML C++ third party libraries?

Thanks

Stefano Mtangoo 455 Senior Poster

if you don't mind about the learn curve then learn wxpython. It is very elegant in handling events. I have no way to understand TK for now. So sorry, someone will jump in the wagon ;)

Stefano Mtangoo 455 Senior Poster

in wxApp you should disable it

myApp = wx.App(False)
Stefano Mtangoo 455 Senior Poster

Thanks a lot

Stefano Mtangoo 455 Senior Poster

Thanks alot.
My head is now very tired and is as if it want to stop thinking. I will rest and apply your ideas and see where I get. One last Question. Can this Static variable be a pointer? (I saw that description on your top post but I want to be sure of that). And also small good tutorial on static variables/methods is appreciated

Thanks alot

Stefano Mtangoo 455 Senior Poster

can I use combination of static variable and friend function to expose that variable to only one method of another class?

Thanks sir

Stefano Mtangoo 455 Senior Poster

Sure, It should be larger than bare win32 but I meant small in comparison with space available. Those who comes from wxPython will know that its size is bigger (sometims 10s of MB).

But it has advantage over win32 if you want to go cross platform

Stefano Mtangoo 455 Senior Poster

And don't forget, you can use Foreign library interface; The so called ctypes
It comes with Python (>=2.5) and It is in Docs

Stefano Mtangoo 455 Senior Poster

Thanks all

Stefano Mtangoo 455 Senior Poster

So can you explain a little bit on Static thing? I might need that
Thanks for replying

Stefano Mtangoo 455 Senior Poster

Hello people,
I have two classes everyone with private data.
I want only one function from each class to access private data from another class. I have checked "friend" function but It needs the class object as an argument. That is making things complicated on my side and I have no idea on how to do this.
Is this possible? If yes, how can I archieve that?
Thanks alot

Stefano Mtangoo 455 Senior Poster

It might be a basic question, but bear with me as google didnt help.
I want to create awrapper for cmd.exe that is more comfortable in terms of user interface (I enjoy a lot Konsole in *nix). Right now I have no Idea how to hook to cmd.exe and get the results. I want to have my own window for user to type commands but cmd.exe is the one to do the job.

So how do I connect my app to cmd

Stefano Mtangoo 455 Senior Poster

I suggest wxWidgets ;)
It is simple, well supported and Heavily documented and very liberal licence.
Its executables are also small

Stefano Mtangoo 455 Senior Poster

if windows you can use code below(Just alternative). Not tested though

import os
os.system("myprog //mydir_where_there_is_xm//myxml.xml")
Stefano Mtangoo 455 Senior Poster

One day, my Java friend asked me if there are threads with PHP. I didn't knew and I have to poke around net and manual only to find none.

enough of useless words. Here my question goes. Is it possible to create abstract class with virtual and pure virtual functions like C++?

Thanks

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

people have been trying to make successful de-compilers for years with limited success, and the compilation algorithm is known!

Although I'm ignorant about cryptology that sounds very logical.
But how comes Even 100 characters long produce 40 Hash character. It kinda abracadabra doesn't it?

Stefano Mtangoo 455 Senior Poster

Didi you intend this to be a class? If yes (which is probable) you forgot keyword class

#
public TheArea()
#
{
#
//JFrame frame = new JFrame();
#
setSize(1000, 650); //h

Fix and try this

#
class TheArea()
#
{
#
//JFrame frame = new JFrame();
#
setSize(1000, 650); //h
Stefano Mtangoo 455 Senior Poster

The lexer turns source code into something that's easier to parse. That's really all there is to it. ;)

So it turns source code into something IT can parse. So you mean it have nothing to do with human readable part. Have I got you well?

Stefano Mtangoo 455 Senior Poster

I solved partly with wxWidgets. And will finish remaining part using C++ (MSDN have the remaining part well documented)

Thanks all for replies

Stefano Mtangoo 455 Senior Poster

Thanks for input!
It seems symphony won

Stefano Mtangoo 455 Senior Poster

Yup! And that loops infinitely if it finds no error :)

Stefano Mtangoo 455 Senior Poster

I apologise in advance for my naivety, but isn't the fact that you get one result enough to hack an unsalted password field in a login form?
If you get the hash (e.g. somehow from the db), you could just use the first result from the algorithm to gain access?

You are not alone lost in these geeky way of talking. I was hinking something like that and...I'm lost :)

Stefano Mtangoo 455 Senior Poster

Also, its good practice to not have functions that are using names that are already taken. Such as print, int, str, list bool and so on. So it's probably best if you change your list() function to another name. :)

If you do large project, names get finished. I use sometimes, myList, Listed, .. et al

Thanks to OOP for the rescue ;)

Stefano Mtangoo 455 Senior Poster

you mean each product have a gip file. then how can i gip those files.
and i have another doubt for example admin once uploaded files after he added new files to that product. then how zip file updated.

Mhh! If you regularily update, zip isn't decent solution. Use folders then. But after time you will have gazillion of folders. But nice thing is you will manipulte the via interface.

So everytime you make new product, a script should make subdirectory in products DIR and give it next ID in the DB. Then it should insert in DB ID, Foldername and Filename, and may be alias (Nice name like Cadillac Specifications.pdf). To refer a produc, use url like: http://www.mysite.com/products.php?folder=321&filename=2354

Hope you get it :)

Stefano Mtangoo 455 Senior Poster

Haven't got you well can you elaborate your example?
Thanks for reply

Stefano Mtangoo 455 Senior Poster

not specifically answer to your question, but there is duplication of subprocess imports
Just use one

from subprocess import call
Stefano Mtangoo 455 Senior Poster

Sorry guys, I know it is not C++ specific, but Wikipedia confused me.
I have devoted a little time to look at programing tools and little on their innner workings. This term have boggled my mind.

So any explanation on what this animal is?
Thanks

Stefano Mtangoo 455 Senior Poster

I managed to forward X11 and used SSH.
It is elegant solution but you need stable X11 Server running.
Xming did a job though not very stable.

Thanks all

Stefano Mtangoo 455 Senior Poster

Thanks alot
I now understand how these can be handy when have projects beyond hello world type :)

This tutorial is alo complement of above, very nice!

Stefano Mtangoo 455 Senior Poster

Thanks AD,
I have found this very informative

Stefano Mtangoo 455 Senior Poster

Hi,
I have used a lot of makefiles to compile programs. The issue is, I don't know how to produce make file. Is it another "language" I have to learn or some automatic issue? Also what is short yet clea tutorial on that?

Thanks

Stefano Mtangoo 455 Senior Poster

Cool thanks!
Simple and elegant

Stefano Mtangoo 455 Senior Poster

I imagine if you followed the if block of the do/while you could get all of the directories and just save the names instead of totaling the file sizes

I'm at work and my head is saturated with today's wok. So I will have to go and do this at home after rest! ;)

Stefano Mtangoo 455 Senior Poster

Suppose I want to iterate in the directory and print out only subdirectory, how do I do that? I cannot see folder handling there. am I missing something here?

#include <iostream>
#include <windows.h>
#include <string>
using namespace std;


__int64 TransverseDirectory(string path)
{
    WIN32_FIND_DATA data;
    __int64 size = 0;
    string fname = path + "\\*.*";
    HANDLE h = FindFirstFile(fname.c_str(),&data);
    if(h != INVALID_HANDLE_VALUE)
    {
        do {
            if( (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) )
            {
                // make sure we skip "." and "..".  Have to use strcmp here because
                // some file names can start with a dot, so just testing for the
                // first dot is not suffient.
                if( strcmp(data.cFileName,".") != 0 &&strcmp(data.cFileName,"..") != 0)
                {
                    // We found a sub-directory, so get the files in it too
                    fname = path + "\\" + data.cFileName;
                    // recurrsion here!
                    size += TransverseDirectory(fname);
                }

            }
            else
            {
                LARGE_INTEGER sz;
                // All we want here is the file size.  Since file sizes can be larger
                // than 2 gig, the size is reported as two DWORD objects.  Below we
                // combine them to make one 64-bit integer.
                sz.LowPart = data.nFileSizeLow;
                sz.HighPart = data.nFileSizeHigh;
                size += sz.QuadPart;

            }
        }while( FindNextFile(h,&data) != 0);
        FindClose(h);

    }
    return size;
}

int main(int argc, char* argv[])
{
    __int64 size = 0;
    string path;
    size = TransverseDirectory("c:\\");
    cout << "\n\nDirectory Size = " << size << "\n";
    cin.ignore();
    return 0;
}
Stefano Mtangoo 455 Senior Poster

I do not want to use any script or wordpress
I want to create my blog from scratch.
I am working but there are many problems

Didi you see this?
What problems are you facing?

Stefano Mtangoo 455 Senior Poster

MSDN says it treats like Top level directory
Then how do I get list of subdirectories?

Thanks

Stefano Mtangoo 455 Senior Poster

First of all im new here so Hi all..

im also new to c/c++ have been a java php and actionscript developer for some time now and finally have time to learn something new so im gonna go for c++ im just tryna get familiar with everything but i ran into some (to me) weird results.

i was trying to make a recursive function but i kept getting errors so i stripped everything out of the function and still got an error can anyone explain me why the following fails everytime after calling the function for the 262058 time with a segmentation fault.

void recursive() {
	recursive();
}
int main( int argc, char **argv ) {
	recursive();
}

its probably very obvious and easy (just not to me)

thanks in advance,
Yrm

Now you have learned something about malicious code, don't you?
It is like looping infinitely while creating new arrays without deleting them. Guess what? ;)

Ok just rumbling, solution is well pointed above :)

Stefano Mtangoo 455 Senior Poster

yaa...i am using same folder.

actually there is number of products. each product have number of files(pdf, excel files). these files are storing one folder.
i am retriving these files using productid. then all the files download once which files containg that product.

Then you should zip them and give them one ID, of zipped file.
Otherwise, the IDs will differ and difficult will be the retrieval. or put them in same folder and refer them by folder name or folder ID