Stefano Mtangoo 455 Senior Poster

Although in my opinion it would be easiest in a .NET language.... because I am more fluent in .NET

Another would give same statement for same reason :)

Any language can do. Just with right tools Job get done elegantly and....funny

Stefano Mtangoo 455 Senior Poster

goto coda;

Infamous phrase gOtO ;)

Stefano Mtangoo 455 Senior Poster

I work out a small project. I need to Get list of folders in each drive. Up to now I can get the drives but I have no Idea on how windows treats Drives. Does it treat them as super Directories (Super folders) that contain many sub-folders? If not How does it treat Them. And lastly how can I retrieve list of directories given drive name?

Thanks

Stefano Mtangoo 455 Senior Poster

What are your thought on this? There are many framework there and my thought was CakePHP is rather popular. I'm I wrong?
What do you think?

Stefano Mtangoo 455 Senior Poster

Since It cannot do it, thread closed
Thanks Vega

Stefano Mtangoo 455 Senior Poster


Here is a typical code example mostly produced by the wxFormBuilder program

No so dirty ;)

Stefano Mtangoo 455 Senior Poster

cool

Stefano Mtangoo 455 Senior Poster

That depends on whether they go to same folders or different folders. If they go to same folder then it is easy. Store only filename and retrieve with something like
HOME_DIR\folde_name\retrieve.php?filename=filename.pdf

but if they go to different folder then store folder name and filename
HOME_DIR\downloads\retrieve.php?foldername=foldername&filename=filename.pdf

Back to murali, what is the problem/ wall you are facing?

Stefano Mtangoo 455 Senior Poster

Hi saiprem, when the admin is creating the user, we no need to send email to them. The email address is got only to send reminders to them

Still the same trick is valid. After creating user:

add sent date to last_send_date column and user_created_date column
and then submitted column to 0.

Stefano Mtangoo 455 Senior Poster

And the code works. I guess he tried to implement elsewhere and defined it as void that is why the post includes void. But that is my guess :)

Stefano Mtangoo 455 Senior Poster

are you inserting PDF into database? I don't suggest you do that. I suggest you add them to the folder and add its path (Link) to the database

Stefano Mtangoo 455 Senior Poster

Have a look at - http://www.cppreference.com/wiki/about/faq and http://www.daniweb.com/forums/thread67837.html

The first link is great!
Thanks :icon_smile:

Stefano Mtangoo 455 Senior Poster

The whirlpool algorithm can be used with the following code:

<?php
echo hash('whirlpool', 'The quick brown fox jumped over the lazy dog.');
?>
//outputs
802dc377bf6dc4f905b90cf2f1ddb39d4958526c3772bce41c03488701630eeede8 51f5ddc195714ea9e35311a513e31c3b616ffce5756bd963e0fdc092b2f87

As you can see it has a longer hash and although I haven't checked the algorithm's core I would assume that it is by far more secure as 8 characters of hex = one number to decode into words.

So you just use

hash('whirlpools', 'some text to encode');
Stefano Mtangoo 455 Senior Poster

Hi,
Is your function of type void or float?

You have mixed return type. The first code says it is void. In your code it is float

Stefano Mtangoo 455 Senior Poster

Is this possible?
Any tutorial if possible?
I want to make a program to do mass conversion of my Icons without loosing resolution

Stefano Mtangoo 455 Senior Poster

welcome :)

Stefano Mtangoo 455 Senior Poster
#include <iostream>
#include <cmath>

using namespace std;
#define PI 3.14

int main(){	

	 
	 //calculate sin angle | library functions
	double angle, angle_rad, answer;

	cout << "Enter Angle in degrees: ";
	cin  >> angle;
	angle_rad = PI*angle/180;
	answer = sin(angle_rad);
	cout << "sin " << angle << " is = " << answer << endl;
	cin.get();
	return 0;
	
}
Stefano Mtangoo 455 Senior Poster

There are many decent sites for C++. However, some of Dev, including me, works most of the time offline. So I need to have one for reference. If anyone knows a decent one then please post a link

Thanks

Stefano Mtangoo 455 Senior Poster

did it redirect at all?

Stefano Mtangoo 455 Senior Poster

I thought I would let you's php gurus know that I am starting to come close to cracking the Sha1 algorithm. And surprisingly it is an easy one to crack. So I would recommend switching to something like the whirlpool algorithm.

Man you are commited to crack that algorithm! Do you want to get into world record? ;)

And whirlpool, what is it?

Stefano Mtangoo 455 Senior Poster

I have started searching long ago and haven't find one. Ye there are sites like buddy pointed above but not Manuals to download. I wonder why they dont release one

Stefano Mtangoo 455 Senior Poster

There is, sort of. It's called The C++ Standard. But most any C++ 'manual' on the web will give you the info you want.

I meant manuals available for downloads and use them offline, like other languages

Stefano Mtangoo 455 Senior Poster

I got that working

#include <iostream>
#include <string>

using namespace std;

int main(){
	
	string mystring("Hello World");
	cout<<"This is Original"<<endl;	
	cout<<"This is stripped:\n"<<mystring.substr(0, 5)<<endl;
	return 0;
}
Stefano Mtangoo 455 Senior Poster

Yes Jonsca, I have already read that and I was wondering if there is one single function within standard library. I saw somewhere string::Substr() and I'm trying to check if that is what I want. Anyway the bad of C++ is that there is no official Manual to download and look like other languages (PHP, JAVA, PYTHON et al)

Stefano Mtangoo 455 Senior Poster

Hi all,
I have been looking for single function to split strings and seems to me either is not available or I miss it. So I please, help me to know if it is available and if yes where can I get it.
Thanks

Stefano Mtangoo 455 Senior Poster

I am essentially subject to unbounded interest in pretty much anything and everything - no matter what I look at or get into, it seems there is a lifetime's worth of exploration to be had...

An infinite amount to learn and experience about an infinite number of subjects and activities. The risk is not so much a failure to gain expertise as much as it is a failure to retain sanity!

Stupid infinitely awesome universe ;-)

Sure, we learn until we die. We learn a lot of varieties. But you need one field of expertise. You cant be expert in everything. The only human who have been expert in everything is Mr. Expert'n nothing ;)

Stefano Mtangoo 455 Senior Poster

int is simple function that changes "numeric" strings into integers. There is also double(), str() etc

Stefano Mtangoo 455 Senior Poster

Nice program indeed!

Sure Vega, It saved a lot of programming time in C++ (May be days or even months)

On Windows it was a little cumbersome to get the wxPython support.
I had to go through the following sequence ...

I was about to ask snippsat how he got around the DLL. Thanks for info and the link

Stefano Mtangoo 455 Senior Poster

Raj,
why do you do buffering here?
I don't understand the concept behind :)

Stefano Mtangoo 455 Senior Poster

I do not want script of blog. There is best script WORDPRESS.
I am trying to create my own blog.

I do not want to add mutiple functionalities. I just want to add post, view post, reply post and add post in archive(sorting monthwise)

Please help for coding.

Anybody????????????

Log in to admin panel and set things up

Stefano Mtangoo 455 Senior Poster

Since RSS feeds are XML files then you can get the format and do the necessary with SimpleXML. I once was finding API(or format whatsoever you call it) for podcasts which are kinda feeds and didn't find one so if you find it drop here also ;)

Stefano Mtangoo 455 Senior Poster

Check phpBB and wordpress. Nice combination.
Also I would like to know if that was request or command

Stefano Mtangoo 455 Senior Poster

Thanks for the help anyway :-)

I like your quote... too true.

It comes out of experience. I tried to know everything I can and when I evaluate myself, I knew as expert nearly as nothing. So don't try that because you'll learn it the hard way ;)

Stefano Mtangoo 455 Senior Poster

Oh c'mon, haven't you tried Windows Data Types??

I'm checking


Depending on which IDE you have, you might be able to quickly locate these things by placing the cursor on a given typedef/define and do a "go to declaration/definition" from the IDE's context menu. Check whether your IDE supports that, however you may find the all the #ifdef/#else blocks in the headers a bit confusing.

I use code::blocks

Stefano Mtangoo 455 Senior Poster

Is this even possible? And what functions should I use to read the .xls file in Python??

Also, would this be easier using another programming language?

Thanks!

Very possible but with GUI. I know wxPython can do that ;)
Check Jan's skeletons and see if it is what you want. Note that you can accomplish that with Java as well as C/C++ and many other languages. Just use right tool for the right job

Stefano Mtangoo 455 Senior Poster

I tried it with fewer lines and get the same effect - the first delete works but nothing thereafter.

I should add that each line contains 101 elements! So the total file has about 10,000 lines with each line containing 101 values (not that the values within each line need to be stored separately - I need to delete and keep entire lines)

I suggest you create a cpy of orignal and delete what you want and store that list, then take a copy of orignal modify the lines you need etc. I suggest that because deleting stuffs changes the indexing of list.

EDIT:
you got it! Bravo to G.

Stefano Mtangoo 455 Senior Poster

niek_e
Thanks for reply.
I didn't see that you have already answered my Question.
where can I get a list of these WINAPI macros and their meaning?

Thanks you for replying

Stefano Mtangoo 455 Senior Poster

Correct me if im wrong but from what I have read writing UINT is the same as unsigned int and writing LPCSTR is the same as wrting const char*

is that so?

Stefano Mtangoo 455 Senior Poster

would you try to work with few lines let say 15 lines and after it works go to that large file

Stefano Mtangoo 455 Senior Poster

Ime reading this right now but feel free to teach me anything. I'll always be learning.

Stefano Mtangoo 455 Senior Poster

Ok,
I got wxWidgets function to deal with that which served me alot of pains. Now I have to determine the drive type
I got MSDN link to a function GetDriveType

And here is what it says:

UINT WINAPI GetDriveType( __in_opt  LPCTSTR lpRootPathName);

my problem is with these winAPI macros like LPCSTR and UINT
I guess (just at looking) UINT might be alias for unsigned int but have no even clue of what LPCSTR is (string??)

So please help me remove fogs in my understanding on this issue
Thanks

Stefano Mtangoo 455 Senior Poster

Yup!
I missed that!
How do you generate your own classes? Same inheritance principle?

Stefano Mtangoo 455 Senior Poster

I heard that it supports wxPython but I haven't seen that!
I use wxFB version 3.0 and have only C++ features. I love wxFB and Their inheritance philosohpy is really vanilla on cake ;)

Stefano Mtangoo 455 Senior Poster

>>what is ULONG equivalent of C++ or it is just ULONG?
It is typedefed via <windows.h>, and is documented in Windows Data Types
That's a good page to lookup the data types and #defines used by Windows.

>>GetLastError()); //So GetLastError retuns a sring or char*?
No, see GetLastError Function. In general, the Windows API functions are documented in MSDN, so you can use MSDN as your primary reference.

>> //what does g_szDrvMsg do and what is TCHAR type?
Debug the while() loop there step by step so you'll understand how the thing works ;)

Thanks for informative post

Stefano Mtangoo 455 Senior Poster

Thanks for reply. Hope others will too

Stefano Mtangoo 455 Senior Poster

Should I share my love for wxWidgets?
Yes if you are starting GUI (which you didn't gave a clue) then give wx a chance and try it. Its vast Documentation, immense help (almost instant), and many advantages over QT.

IF you still want to go for QT then I second the choice to grab QT books. I have it though I don't use QT (Just there in case I need it)
;)

Stefano Mtangoo 455 Senior Poster

I decided to start on MSW and I have got it from MSDN.
It is a C code and I would like to convert it to C++ (Strangely I made C++ project in C::B and and compiled code and voila it ran!). Also there are some stuffs like TCHAR that I don't understand. So help me guys. Below is the code

// crt_getdrives.c
// This program retrives and lists out
// all the logical drives that are
// currently mounted on the machine.
//from MSDN

//QN: I want them as MS wxArrayString
//I want them in C++ not C
// I want to know CD/HDD as Well as USB

#include <windows.h>
#include <direct.h>
#include <stdio.h>
#include <tchar.h>

TCHAR g_szDrvMsg[] = _T("A:\n"); //what does g_szDrvMsg do and what is TCHAR type?

int main(int argc, char* argv[]) {
   ULONG uDriveMask = _getdrives(); //what is ULONG equivalent of C++ or it is just ULONG?

   if (uDriveMask == 0)
   {
      printf( "_getdrives() failed with failure code: %d\n",
              GetLastError()); //So GetLastError retuns a sring or char*?
   }
   else
   {
      printf("The following logical drives are being used:\n");

      while (uDriveMask) {
         if (uDriveMask & 1)
            printf(g_szDrvMsg);

         ++g_szDrvMsg[0];
         uDriveMask >>= 1;
      }
   }
}
Stefano Mtangoo 455 Senior Poster

I decided to start on MSW and I have got it from MSDN.
It is a C code and I would like to convert it to C++ (Strangely I made C++ project in C::B and and compiled code and voila it ran!). Also there are some stuffs like TCHAR that I don't understand. So help me guys. Below is the code

// crt_getdrives.c
// This program retrives and lists out
// all the logical drives that are
// currently mounted on the machine.
//from MSDN

//QN: I want them as MS wxArrayString
//I want them in C++ not C
// I want to know CD/HDD as Well as USB

#include <windows.h>
#include <direct.h>
#include <stdio.h>
#include <tchar.h>

TCHAR g_szDrvMsg[] = _T("A:\n"); //what does g_szDrvMsg do and what is TCHAR type?

int main(int argc, char* argv[]) {
   ULONG uDriveMask = _getdrives(); //what is ULONG equivalent of C++ or it is just ULONG?

   if (uDriveMask == 0)
   {
      printf( "_getdrives() failed with failure code: %d\n",
              GetLastError()); //So GetLastError retuns a sring or char*?
   }
   else
   {
      printf("The following logical drives are being used:\n");

      while (uDriveMask) {
         if (uDriveMask & 1)
            printf(g_szDrvMsg);

         ++g_szDrvMsg[0];
         uDriveMask >>= 1;
      }
   }
}
Stefano Mtangoo 455 Senior Poster

Practically impossible.

Why is it impossible? How do Dialogs get info about disks?
Ok what I want to do I get Disk lists (C: D: etc) and nail them on wxTreeCtrl and then traversing in each Node of Disk, enumerating folders and lastly files. I don't want to involve File/DIR dialogs as it needs no user interaction. So what would be the trick?
(Whether a wxWidgets trick or C++/Win32/QT.....et al)

Thanks

Stefano Mtangoo 455 Senior Poster

So you wan't to strip out non HTML tags and leave only HTML?