This commit is contained in:
gferg 2001-07-18 13:41:29 +00:00
parent a6d45f9372
commit d99556c99a
5 changed files with 400 additions and 259 deletions

View File

@ -42,7 +42,7 @@ C++ Programming HOW-TO
<author>Al Dev (Alavoor Vasudevan)
<htmlurl url="mailto:alavoor@yahoo.com"
name="alavoor@yahoo.com">
<date>v40.1, 01 July 2001
<date>v40.2, 17 July 2001
<abstract>
This document provides a comprehensive list of C++ URL
pointers, links to C++ online textbooks, and programming tips on C++.
@ -475,6 +475,38 @@ class mystring:public String, string
<chapt> Best C++ compilers for MS Windows 2000/NT/95/98/ME/XP <label id = "mswin32">
-->
<sect> Best C++ compilers for MS Windows 2000/NT/95/98/ME/XP <label id = "mswin32">
<p>
Since MS Windows is quite popular for C++ development, the string class
library given in this document works well and runs very well on all the
versions of MS Windows i.e. MS Win XP/2000/NT/95/98/ME.
The C++ compilers for MS Windows are :
<itemize>
<item> GNU BloodShed at <url url="http://www.bloodshed.net/devcpp.html">
rated 1st (the best among all)
<p>
<item> Borland C++ compiler <url url="http://www.borland.com/bcppbuilder/freecompiler">
rated 2nd
<p>
<item> Microsoft Visual C++ compiler <url url="http://msdn.microsoft.com/visualc">
rated 3rd
<p>
<item> MSDOS C++ compiler <url url="http://www.delorie.com/djgpp">
<p>
</itemize>
The String class in this document is tested with all the above compilers.
It works fine with MS Visual C++ compiler v6.0, Borland C++ v5.2, Borland
C++ compiler v5.5.1 and Bloodshed compiler.
<!--
*******************************************
************ End of Section ***************
*******************************************
<chapt> Download String <label id = "Download String">
-->
<sect> Download String <label id = "Download String">
@ -712,19 +744,33 @@ see also
// instead of char[] or char *
//
#ifndef __STRING_H_
#define __STRING_H_
#ifndef __STRING_H_ALDEV_
#define __STRING_H_ALDEV_
// do not use iostream as program becomes bulky..
#ifdef NOT_MSWINDOWS
#include <iostream>
#else
#include <iostream.h> // some compilers like .h here. Why???
#endif // NOT_MSWINDOWS
#include <iostream> // do not use iostream as program becomes bulky..
#include <stdio.h> // for FILE and sprintf()
#include <list.h> // for list
//#include <list.h> // for list
// For MS Windows 95 VC++ or Borland C++ compiler do -
//see file d:\program files\CBuilder\include\examples\stdlib\list.cpp and include\list.h
//#include <list> // for list
//using namespace std;
const short INITIAL_SIZE = 50;
const short NUMBER_LENGTH = 300;
const int MAX_ISTREAM_SIZE = 2048;
class StringBuffer;
//class StringBuffer;
// I compiled and tested this string class on Linux (Redhat 7.1) and
// MS Windows Borland C++ version 5.2 (win32). This should also work
// using MS Visual C++ compiler
class String
{
public:
@ -737,7 +783,7 @@ class String
String(float bb); // needed by operator+
String(double bb); // needed by operator+
String(const String & rhs); // Copy Constructor needed by operator+
String(StringBuffer sb); // Java compatibility
//String(StringBuffer sb); // Java compatibility - but causes compile problem on MS windows and core dumps
String(int bb, bool dummy); // for StringBuffer class
virtual ~String(); // Made virtual so that when base class is deleted
// then the derived class destructor is called.
@ -745,7 +791,7 @@ class String
char *val() {return sval;} // It is not safe to make sval public
// Functions below imitate Java language's String object
unsigned long length() { return strlen(sval); }
unsigned long length();
char charAt(int where);
void getChars(int sourceStart, int sourceEnd,
char target[], int targetStart);
@ -791,6 +837,10 @@ class String
String concat(String str2); // See also operator +
String concat(char *str2); // See also operator +
String concat(int bb);
String concat(unsigned long bb);
String concat(float bb);
String concat(double bb);
String reverse(); // See also overloaded reverse()
String deleteCharAt(int loc);
@ -924,6 +974,10 @@ class String
{String tmpstr(ss); return tmpstr.parseLong();}
float floatValue() {return (float) toDouble(); }
double doubleValue() {return toDouble(); }
char * number2string(int bb); // see also String(int)
char * number2string(long bb); // see also String(long)
char * number2string(unsigned long bb); // see also String(long)
char * number2string(double bb); // see also String(double)
///////////////////////////////////////////////
// List of duplicate function names
@ -972,6 +1026,7 @@ class String
// char getCharAt(int where); Use CharAt()
// void parseArgs(int where, char ch); Use StringTokensizer class, token() or explode()
// void truncate(); Use trim(), rtrim(), chop() or chopall()
// convert number to string notostring(), int2str, long2str Use number2string()
// All Operators ...
String operator+ (const String & rhs);
@ -988,33 +1043,37 @@ class String
friend ostream & operator<< (ostream & Out, const String & str2);
friend istream & operator>> (istream & In, String & str2);
static list<String> explodeH; // list head
//do later: static list<String> explodeH; // list head
protected:
char *sval; // Not safe to make sval public
inline void verifyIndex(unsigned long index) const;
inline void verifyIndex(unsigned long index, char *aa) const;
void verifyIndex(unsigned long index) const; // not "inline" because MS Win32 complains
void verifyIndex(unsigned long index, char *aa) const;// not "inline" - MS Win32 complains
void _str_cat(char bb[]);
void _str_cat(int bb);
void _str_cat(unsigned long bb);
void _str_cat(float bb);
void _str_cpy(char bb[]);
void _str_cpy(int bb); // itoa
void _str_cpy(unsigned long bb);
void _str_cpy(float bb); // itof
private:
// Note: All the private variables and functions begin
// with _ (underscore)
//static String *_global_String; // for use in add operator
//inline void _free_glob(String **aa);
void _str_cpy(char bb[]);
void _str_cpy(int bb); // itoa
void _str_cpy(unsigned long bb);
void _str_cpy(float bb); // itof
bool _equalto(const String & rhs, bool type = false);
bool _equalto(const char *rhs, bool type = false);
String *_pString; // temporary pointer for internal use..
char *_pNumber2String; // temporary pointer for internal use..
inline void _allocpString();
inline void _allocpNumber2String();
inline void Common2AllCstrs();
inline void _reverse();
inline void _deleteCharAt(int loc);
inline void _deleteStr(int startIndex, int endIndex);
@ -1022,11 +1081,12 @@ class String
inline void _ltrim();
inline void _rtrim();
inline void _substring(int startIndex, int endIndex);
void _roundno(double input_dbl, float input_flt, short precision, bool type);
};
// Global variables are defined in String.cpp
#endif // __STRING_H_
#endif // __STRING_H_ALDEV_
</code>
<!--
*******************************************
@ -1041,8 +1101,8 @@ class String
// Author : Al Dev Email: alavoor@yahoo.com
//
#ifndef __STRINGBUFFER_H_
#define __STRINGBUFFER_H_
#ifndef __STRINGBUFFER_H_ALDEV_
#define __STRINGBUFFER_H_ALDEV_
// Imitate Java's StringBuffer object
// This class is provided so that the Java code is
@ -1054,11 +1114,12 @@ class StringBuffer: public String
{
public:
StringBuffer();
~StringBuffer();
StringBuffer(char *aa);
StringBuffer(int size);
StringBuffer(String str);
~StringBuffer();
int capacity() {return strlen(sval);}
int capacity();
StringBuffer append(String str2);
// See also operator +
//{ *this += str2; return *this;} // This is causing core dumps...
@ -1070,7 +1131,6 @@ class StringBuffer: public String
StringBuffer append(double bb) ;
StringBuffer insert(int index, String str2);
StringBuffer insert(int index, char ch);
StringBuffer reverse();
@ -1080,9 +1140,15 @@ class StringBuffer: public String
StringBuffer deleteCharAt(int loc);
StringBuffer substring(int startIndex, int endIndex = 0);
void assign(char *str);
private:
StringBuffer *_pStringBuffer;
inline void allocpStringBuffer();
inline void Common2AllCstrs();
};
#endif // __STRINGBUFFER_H_
#endif // __STRINGBUFFER_H_ALDEV_
</code>
<!--
*******************************************
@ -1097,8 +1163,8 @@ class StringBuffer: public String
// Author : Al Dev Email: alavoor@yahoo.com
//
#ifndef __STRINGTOKENIZER_H_
#define __STRINGTOKENIZER_H_
#ifndef __STRINGTOKENIZER_H_ALDEV_
#define __STRINGTOKENIZER_H_ALDEV_
// Imitate java's StringTokenizer class
// provided to compile java code in C++ and vice-versa
@ -1127,7 +1193,7 @@ class StringTokenizer: public String
inline void vPrepWorkStr(char *delimiters = NULL);
};
#endif // __STRINGTOKENIZER_H_
#endif // __STRINGTOKENIZER_H_ALDEV_
</code>
<!--
*******************************************
@ -1714,6 +1780,7 @@ and <url name="mirror site" url="http://www.cs.umd.edu/users/cml/cstyle/CppCodin
<item> Logikos C++ Coding Standards <url url="http://www.logikos.com/standards/cpp_std.html">
<item> NRad C++ coding standards <url url="http://cadswes.colorado.edu/~billo/standards/nrad">
<item> BEJUG C++ coding standards <url url="http://www.meurrens.org/ip-Links/java/joodcs/ToddHoff.html">
<item> Arctic Labs coding standards <url url="http://www.arcticlabs.com/codingstandards">
<p>
See also
<item> For rapid navigation with ctags
@ -2083,7 +2150,10 @@ Main STL sites -
<itemize>
<item>C++ STL from SGI <url url="http://www.sgi.com/Technology/STL">
<item>C++ STL from RPI univ <url url="http://www.cs.rpi.edu/projects/STL/htdocs/stl.html">
<item>Lycos C++ STL site <url url="http://dir.lycos.com/Computers/Programming/Languages/C%2B%2B/Class_Libraries/STL">
<item>C++ STL site
<url name="ODP for STL" url="http://dmoz.org/Computers/Programming/Languages/C++/Class_Libraries/STL">
and the
<url name="mirrorsite" url="http://dir.lycos.com/Computers/Programming/Languages/C%2B%2B/Class_Libraries/STL">
<item>STL for C++ Programmers <url url="http://userwww.econ.hvu.nl/~ammeraal/stlcpp.html">
<item>C++ STL from halper <url url="http://www.halpernwightsoftware.com/stdlib-scratch/quickref.html">
</itemize>

File diff suppressed because it is too large Load Diff

View File

@ -37,7 +37,7 @@
" name="
bri@cs.uchicago.edu
">
<date>v2.9, 04 July 2001
<date>v3.0, 15 July 2001
<abstract>
This is a detailed guide to kernel configuration, compilation, upgrades,
@ -431,15 +431,34 @@ bash# rpm -i /mnt/cdrom/contrib/kernel-modules*.rpm
-->
<sect1> Post Kernel Building <label id="postkernel">
<p>
After successful build and booting of linux kernel you may want to do these
additional steps to make some of your devices to work.
(The steps below were tested on Redhat linux but should work with others too)
After successfully building and booting the Linux kernel, you may be required
to do these additional steps to make some of the devices to work with Linux.
(The steps below were tested on Redhat Linux but should work with other distributions
as well.)
<bf>Video card/Monitor configuration: </bf>
<itemize>
<item> Please see the video card manual which is usually shipped with the PC.
You should look for a "Technical Specifications" page.
<item> Please see the monitor's manual and look for a "Technical Specifications" page.
</itemize>
You can configure the Video card and monitor by using these commands:
<code>
bash$ su - root
bash# man Xconfigurator
bash# /usr/bin/X11/Xconfigurator --help
bash# /usr/bin/X11/Xconfigurator
bash# /usr/bin/X11/Xconfigurator --expert
</code>
If your card is not detected automatically, then you can use the --expert option
and select the "Unlisted card". If your monitor is not listed then select the generic
monitor type SVGA 1024x768.
<bf>Sound card configuration: </bf>
<itemize>
<item> Connect your external speakers to the sound card's audio port.
<item> Connect your CDROM audio wire to sound card's audio 4-pin socket. (Otherwise
your cdrom drive will not play music from your music cd)
your cdrom drive will not play the music from your music cd)
<item> Refer to HOWTO docs on 'Sound' at <url url="http://www.linuxdoc.org">
</itemize>
<code>
@ -459,6 +478,20 @@ and adjust the sound volume.
<item> Refer to HOWTO docs on 'Networking' at <url url="http://www.linuxdoc.org">
</itemize>
<bf>Configure Firewall and IP Masquerading : </bf>
For Linux kernel version 2.4 and above, the firewall and IP Masquerading is
implemented by NetFilter package. Hence in kernel config you should enable
Netfilter and run the Firewall/IPMasq script. Download the scripts from
<url name="Firewall-IPMasq scripts" url="http://www.BoingWorld.com/workshops/linux/iptables-tutorial">
, main page of Netfilter is at
<url url="http://netfilter.samba.org">.
Related materials at <url name="firewalling-matures" url="http://www.linuxsecurity.com/feature_stories/kernel-netfilter.html">
and <url name="Netfilter-FAQ" url="http://netfilter.filewatcher.org/netfilter-faq.html">.
For kernel version below 2.4 you should install the firewall rpms from
<url name="rpmfind.net" url="http://rpmfind.net/linux/rpm2html/search.php?query=firewall">
or <url name="firewall.src.rpm" url="http://rpmfind.net/linux/RPM/contrib/noarch//SRPMS//firewall-2.2-3.src.html">.
<bf>Configuration of other devices: </bf>
Refer to HOWTO docs relating to your devices at <url url="http://www.linuxdoc.org">
<!--

View File

@ -45,7 +45,7 @@ PHP HOW-TO
" name="
alavoor@yahoo.com
">
<date>v25.3, 03 July 2001
<date>v25.4, 13 July 2001
<abstract>
This document tells you howto develop PHP programs and also to migrate all the
Windows 95 GUI applications to powerful PHP + HTML + DHTML + XML + Java applets + Javascript.
@ -220,7 +220,15 @@ You need a web-server to run the PHP on MS Windows. You can use MS IIS web serve
or you can use free Apache web-server for MS Windows 95/98/NT/2000. To save you
lot of time here is the ready-to-install setup.exe file for apache
for Windows platform:
Apache binaries - <url url="http://www.apache.org/dist/binaries/win32">
PHPTriad which is Apache+PHP+MySQL single package is at
<url url="http://www.phpgeek.com/phptriad.php">
and at <url name="mirrorsite" url="http://sourceforge.net/projects/phptriad">.
I very strongly recommend PHPTriad as it is immensely popular among MS Windows
users (millions of downloads).
Apache binaries -
<url url="http://httpd.apache.org/dist/httpd/binaries/win32">
<!--
*******************************************
************ End of Section ***************
@ -761,6 +769,8 @@ HTML editors for PHP on Windows 95/NT/2000 are:
<item> Cool Page - Rated 2nd <url url="http://www.coolpage.com">
<item> Coffeecup - Rated 3rd <url url="http://www.coffeecup.com/editor">
<item> Arachnophilia - Rated 4th <url url="http://www.arachnoid.com/arachnophilia/index.html">
<item> Textpad <url url="http://www.textpad.com">
and <url name="textpad-php-add-ons" url="http://www.textpad.com/add-ons/files/syntax/php4.zip">
</itemize>
The best HTML editor is <bf>1st Page 2000</bf>, and it is a excellent HTML editor.
<!--

View File

@ -46,7 +46,7 @@ Vi Improved with syntax color highlighting
"name="
alavoor@yahoo.com
">
<date>v17.1, 28 June 2001
<date>v17.2, 28 June 2001
<abstract>
This document is a guide to quickly setting up the Vim color editor on Linux or Unix systems. The information here will improve the productivity of programmers because the
Vim editor supports syntax color highlighting and bold fonts, improving the
@ -1273,6 +1273,8 @@ To analyze the core dumps do
</verb></tscreen>
<p>
You can also use GUI version of gdb called xxgdb.
See also gdb interface to Vim at <url url="http://www.lxlinux.com/gdbvim.tgz">.
<p>
Memory leak tools -
<itemize>