ID Platform Language Software Question Resolution
21 UNIX Shell Script UNIX
How do you list all the files that were changed during the past 'n' days? "find . -ctime n -print" OR "find . -ctime n -exec ls -l {} \;"
22 N/A UNIX
How do you configure sendmail? The file to configure is sendmail.mc. One possible location: /etc/mail
23 C++ N/A
How to strip whitespace in C? /* trim leading and trailing whitespace */
while (isspace (*Equality) && (*Equality != '\0')) Equality ++;
Here is the code piece, Equality is of char* type. for (char *c=&Equality[strlen(Equality) - 1];isspace (*c);*(c--) = '\0');
if (*Equality == '\0') continue;
1 SQL*PLUS N/A Oracle How to insert a value into type LONG Guys,
Got the insert statement to work from sqlplus from KDD_SEQ_PTTRN.
Once into sqlplus, set the following
set define off
set long 2000
set sqlterminator "~"
Be sure to end the insert statement with ~.
Have fun.
For example:
SET DEFINE OFF;
SET SQLTERMINATOR "~";
INSERT INTO FIRM.KDD_SEQ_PTTRN ( PTTRN_ID, DESC_TX, PTTRN_TX ) VALUES (
1795, 'Accounts with a high concentration in a single security',
'<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE seq-pattern PUBLIC "-//SRA//DTD Patterns//EN" "pattern.dtd">
<seq-pattern action="BreakAction" actionobj="callbacks.so" id="p1">
<datasets>
<dataset href="/datasets/843" id="ds2" name="CONC_POSN_ACCT_Q"/>
<tags>
<tag name="timefilterobject">callbacks.so</tag>
<tag name="order">d_FAKE_DT,d_FAKE_TM</tag>
<tag name="timefilterfunction">TimeFilter</tag>
</tags>
</datasets>
<scenario href="/scenarios/694" id="s4" name="Concentrated Position"/>
<roles>
<role format="%S" name="NET_WORTH">Net Worth =</role>
<role format="%S" name="EQ_PCT">Equity % =</role>
<role format="%S" name="SYMBOL">Security =</role>
<role name="SEC_NO">Security Id:</role>
<role name="ACCOUNT">Account:</role>
<role format="%S" name="MKT_VAL_HI">Conc Posn Mkt Val =</role>
</roles>
<sequence name="Conc Posn -- Acct Quarterly">
<comment>Accounts with a high concentration in a single security</comment>
<distance max="1"/>
<row dataset="ds2">
<comment>Concentrated Position in Account</comment>
<constraint>
MRGN_EQTY_PT &lt;= 40 &amp;&amp;
HI_CNC_SCRTY_EQTY_PT &gt;= 80 &amp;&amp;
TOT_CASH_SCRTY_VAL_AM &gt;= 500000
</constraint>
<binding name="SYMBOL">&quot;&quot;</binding>
<binding name="SEC_NO">HI_CNC_SCRTY_INTRL_ID</binding>
<binding name="ACCOUNT">ACCT_INTRL_ID</binding>
<binding name="MKT_VAL_HI">HI_CNC_SCRTY_VAL_AM</binding>
<binding name="NET_WORTH">NET_WRTH_AM</binding>
<binding name="CONC_PCT">HI_CNC_SCRTY_EQTY_PT</binding>
<binding name="EQ_PCT">MRGN_EQTY_PT</binding>
<binding name="TOT_CASH_SEC">TOT_CASH_SCRTY_VAL_AM</binding>
</row>
</sequence>
</seq-pattern>')~
COMMIT;
2 SQL*PLUS N/A Oracle How do you find all the information about a constraint, say "FK2_XYZ" Step 1. To find the table, ownership, do
select * from all_constraints where constraint_name = 'FK2_XYZ';
Step 2. To find the exact columns that are constrained by this constraint, do
select * from all_cons_columns where CONSTRAINT_NAME = 'FK2_XYZ';
3 UNIX Shell Script N/A
Advanced 'find' command find . -name '*.so' -exec cp {} /users/changn/plat_2.0_b02/lib \;
4 SQL*PLUS Solaris Oracle What is the syntax of calling stored procedure in SQL*PLUS? Calling a stored procedure
SQL> desc schwab.p_sequence_nextbatch;
PROCEDURE schwab.p_sequence_nextbatch
Argument Name Type In/Out Default?
------------------------------ ------------------------ ------ --------
IN_SEQUENCE_NAME VARCHAR2(30) IN
IN_BATCH_SIZE NUMBER(38) IN
OUT_START_VALUE NUMBER(38) OUT
OUT_END_VALUE NUMBER(38) OUT
OUT_ERROR_CODE NUMBER OUT
OUT_ERROR_MSG VARCHAR2 OUT
SQL> variable out1 number;
SQL> variable out2 number;
SQL> variable out3 number;
SQL> variable out4 varchar2;
exec schwab.p_sequence_nextbatch('ACTIVITY_ID_SEQ', 2, :out1, :out2, :out3, :out4);
SQL> print out1;
SQL> print out2;
5 C++ N/A
What is MAP? MULTIMAP? Map: Mathematics. The correspondence of elements in one set to elements in the same set or another set.Map is a Sorted Associative Container that associates objects of type Key with objects of type Data. Map is a Pair Associative Container, meaning that its value type is pair<const Key, Data>. It is also a Unique Associative Container, meaning that no two elements have the same key.
Map has the important property that inserting a new element into a map does not invalidate iterators that point to existing elements. Erasing an element from a map also does not invalidate any iterators, except, of course, for iterators that actually point to the element that is being erased
6 C++ N/A
What happened if you insert the same value to the map?
7 SQL N/A RogueWave No nesting beingTransaction and CommitTransaction() blocks? there is only conn.beginTransaction() without conn.CommitTransaction()
This causes the Sybase select() statement does not return.
8 SQL N/A Database What are Foreign Key and Constraint? Foreign Key: the link from a child table to a parent table
the parent table can be thought of, for example, a configuration data, where child references
to or looks up to it.
i.e. child can not have a value which is not present in the parent table
Parent/Child table: To remove data from a parent table, the data in the child table has to be removed first so
that there is no entry referring to any item in the parent table. Once all the links to the parent
table have been removed, the the data in the parent table can be removed.
Primary Key: the information that uniquely identifies a record in a table. It can be one or multiple values.
Foreign Key: Therefore, serves as a constraint for data integrity purpose.
9 C++ N/A RogueWave What is RWHashDictionary? An RWHashDictionary represents a group of unordered values, accessible by external keys. Duplicate keys are not allowed.
RWHashDictionary is implemented as a hash table of associations of keys and values.
Both the key and the value must inherit from the abstract base class RWCollectable,
with a suitable definition of the virtual function hash() and isEqual() for the key.
10 C++ UNIX
Need to solve the dependency issue in compiling... Create .d file looks at Makefile document at www.gnu.org
11 C++ N/A
What is Pollymorphism? Generally, the ability to appear in many forms. In object-oriented programming, polymorphism refers to a
programming language's ability to process objects differently depending on their data type or class.
More specifically, it is the ability to redefine methods for derived classes. For example, given a base
class shape, polymorphism enables the programmer to define different circumference methods for any number
of derived classes, such as circles, rectangles and triangles. No matter what shape an object is, applying
the circumference method to it will return the correct results. Polymorphism is considered to be a requirement
of any true object-oriented programming language (OOPL).
The type of polymorphism described above is sometimes called parametric polymorphism to distinguish it from
another type of polymorphism called overloading.
12 SQL N/A Database How to normalize a database? First Normal Form
1. Eliminate repeating groups in individual tables.
2. Create a separate table for each set of related data.
3. Identify each set of related data with a primary key.
Second Normal Form
1. Create separate tables for sets of values that apply to multiple records.
2. Relate these tables with a foreign key.
Third Normal Form
1. Eliminate fields that do not depend on the key
Fourth Normal Form
1. In a many-to-many relationship, independent entities can not be stored in the same table.
14 JAVA Solaris
What is the package level visibility in Java? If a member's scope is not specified, it's default to package visibility. I.E. It is only visible to the classes within the same package but not to other classes in other packages.
17 SQL Linux
How to plan disk partition under Linux Recommended Partitioning Scheme
18 Linux
Setup Procedure What are the steps of Linux installation? 1. netcfg: eth0, eth1
info: DNS, IP, ip forwarding?
2. Pppoe (pppd package)
run "adsl-setup"
3. Sendmail
The file to configure is sendmail.mc. One possible location: /etc/mail
4. Apache, MySQL, and PHP
The steps that I did so far is setting up MySQL using rpm method,
Then setting up Apache,
./configure --prefix=/path/to/apache --enable-shared=max
OR
./configure --with-layout=GNU --enable-shared=max
Then setup PHP using
./configure --with-apxs=/path/to/apache/bin/apxs --with-config-file-path=/path/to/apache
--with-mysql
Then configure file to modify is httpd.conf, change Port and ServerName, and add the following line for PHP support.
AddType application/x-httpd-php .php .php3
AddType application/x-httpd-php-source .phps
5. for internet access sharing, using ipchains.
This assumes that your external interface is called `ppp0'. Use ifconfig to find out, and adjust to taste.
# ipchains -P forward DENY
# ipchains -A forward -i ppp0 -j MASQ
# echo 1 > /proc/sys/net/ipv4/ip_forward
This assumes that your external interface is called `ppp0'. Use ifconfig to find out, and adjust to taste.
# ipchains -P forward DENY
# ipchains -A forward -i ppp0 -j MASQ
# echo 1 > /proc/sys/net/ipv4/ip_forward
19 C++ C++
What is using keyword? What is "using namespace"? The "using namespace" statement specifies that members of a "namespace" will be used frequently throughout a program. A namespace is defined by keyword "namespace". The body of a namespace is delimited by braces ({}). Unlike class bodies, namespace bodies do not end in semicolons.
For example:
In .h file
namespace Example {
const double PI=3.14;
void printValues();
class ClassA
{
int a, b;
};
}
In .cc file
using namespace Example;
15 UNIX
OS In Solaris and Linux, how to add an additional disk space to an existing partition? 1. Mount a drive to a mount point, 2. Copy a big sub-directory to this drive, 3. Make a link from this sub-directory to this newly mounted point
13
SQL ORACLE How to do a left (outer) join in Oracle? The joins we have seen so far are inner joins. An inner join selects records from both tables only when they match. In some cases this leaves out records that we want to include.

A left join includes all records from the left table - even if they do not have a matching record from the right table. There is also the right join (what you'd expect) and full join which includes all records from both tables.

i.e. to do a right outer join
SELECT msp.name, party.name
  FROM msp ,party
  WHERE msp.party(+)=party.code

a.foo = b.foo(+)  left outer join
a.foo(+) = b.foo  right outer join
16 SOLARIS
OS How to To configure a DNS on SUN Solaris? [1] create a /etc/resolv.conf file with proper entries, such as DNS, domain name
sample:
domain is.ge.com
nameserver 3.82.180.46
search is.ge.com

[2] create a /etc/defaultrouter with gateway parameters
3.19.140.1

[3] modify the entry of "hosts" in /etc/nsswitch.conf, add "dns" before "files"
...
hosts: dns files
...
24 Linux PHP PHP How to verify if PHP installed correctly?
Creating a small file phpinfo.php with this line.
<? phpinfo() ?>
25 Linux PHP MySQL What is the GUI tool for managing MySQL through Web?
The best web based admin tool for MySQL is phpMyAdmin 2.2.0
http://phpwizard.net/projects/phpMyAdmin/
26 Linux

How do I install an RPM package?
For most things, you can type
rpm -Uvh filename.
This will upgrade the RPM if you already have it on your machine. One occasion when you would not want
to use the U flag is when you are installing a kernel. If you are installing a kernel, you'll want to leave
your old kernel there in case the new one does not boot. For more information about installing new kernels,
please see our Kernel Upgrade HOWTO.
27 Linux

How do I use RPM? What are some general commands that I will use with this command? Also, for whatever reason,
I think files have changed on my system but I don't know which ones. Can RPM help?
In general, normal usage of the rpm command can be summarized as follows:
Installation/Upgrading/Removal
To install a package: rpm -ivh < filename >
rpm -ivh somepackage.1.1-4.i386.rpm
To upgrade a package: rpm -Uvh < filename >
rpm -Uvh somepackage.1.1-5.i386.rpm

To remove a package: rpm -e < packagename >
rpm -e somepackage
Also for upgrading or installing some packages you may need to use additional flags to force the install happen.
It is only recommended to use these if you know why these flags were needed.
--force will overwrite files that are owneed by other packages.
--nodeps will install even if the package needs packages that were not
installed.
Querying
To see if a package is installed: rpm -q < packagename >
rpm -q somepackage
To get info on an installed package: rpm -qi < packagename >
rpm -qi somepackage
To list which files belong to a package: rpm -ql < packagename >
rpm -ql somepackage
To see what package a file belongs to: rpm -qf < path-to-filename >
rpm -qf /usr/bin/some_executable
One can usually join various query commands together, so rpm -qil will give info and list all the filles in the package.
To look at an RPM filename that isn't installed, you add the p to the query line.

rpm -qilp somepackage.1.1-4.i386.rpm

This will list the information and the files contained in somepackage.
More Advanced
More advanced usages can be found in the man page for RPM and at the web site, http://www.rpm.org
Verification
To see what files on the system may have changed from their initial settings you can use RPM, to check up on them.
rpm -Va
will give you a list of all files that have changed in one form or another since the package it is associated was installed. This can be a lot of files (and a lot may be changed due to post installation work). To just see what packages have changed so that you can verify them more individually, you can do the following:
rpm -Va --pipe "awk '{print $2}' | xargs rpm -qf | sort -u" &> /tmp/file1
Then look in the file /tmp/file1 for which packages have had changes from them.
28 Linux
PHP Your apax script is broken...
Your apxs script is broken for some reason. I have seen this happen quite a
few times, but I am not sure what causes it. If you look near the top of
your apxs script you will see lines similar to these:
my $CFG_TARGET = 'httpd';
my $CFG_CC = 'gcc';
my $CFG_CFLAGS = '-O2 -m486 -fno-strength-reduce -DLINUX=2 `../apaci`';
my $CFG_CFLAGS_SHLIB = '-fpic -DSHARED_MODULE';
my $CFG_LD_SHLIB = 'gcc';
my $CFG_LDFLAGS_SHLIB = '-shared';
my $CFG_LIBS_SHLIB = '';
my $CFG_PREFIX = '/usr';
my $CFG_SBINDIR = '/usr/sbin';
my $CFG_INCLUDEDIR = '/usr/include/apache';
my $CFG_LIBEXECDIR = '/usr/lib/apache';
my $CFG_SYSCONFDIR = '/etc/httpd/conf';
If you look at yours, I bet a bunch of these are empty. ie. set to ''
Specifically you *must* have CFG_LD_SHLIB and CFG_LDFLAGS_SHLIB set to
something valid like 'gcc' and '-shared' respectively.
Try simply modifying your apxs script by hand and see if that fixes
things for you.
-Rasmus
29 Linux
MySQL How to load data into a table with ease.
Note: This allows you quickly to export data from Access to MySQL.
You could create a text file `pet.txt' containing one record per line, with values separated by tabs, and
given in the order in which the columns were listed in the CREATE TABLE statement. For missing values
(such as unknown sexes or death dates for animals that are still living), you can use NULL values.
To represent these in your text file, use \N. For example, the record for Whistler the bird would look like this
(where the whitespace between values is a single tab character):
Whistler Gwen bird \N 1997-12-09 \N
To load the text file `pet.txt' into the pet table, use this command:
mysql> LOAD DATA LOCAL INFILE "pet.txt" INTO TABLE pet;
30 Linux
Setup Procedure What is Linux Runlevels?
Init Runlevels
Generally, Red Hat Linux operates in runlevel 3 — full multi-user mode.
The following runlevels are defined in Red Hat Linux:
0 — Halt
1 — Single-user mode
2 — Multi-user mode, without networking
3 — Full multi-user mode
4 — Not used
5 — Full multi-user mode (with an X-based login screen)
6 — Reboot
If your machine gets into a state where it will not boot due to a bad /etc/inittab,
or will not let you log in because you have a corrupted /etc/passwd or have simply forgotten your password,
boot into single-user mode by typing 'linux single' at the LILO boot prompt.
A very bare system will boot and you will have a shell from which you can fix things.
'Init' looks at and implements the /etc/inittab file.
The /etc/inittab file describes how the system should be set up in each runlevel and sets the default runlevel.
This file states that /etc/rc.d/rc and /sbin/update should be run whenever a runlevel starts
To shutdown an interface, you can just call ``ifconfig eth0 down''.
31 Linux

How do I get data from a floppy to my hard drive?
Most floppies you will run into are DOS formatted. However, Red Hat Linux defaults to using
its native format called ext2. Because of this you can run into some difficulties unless you do the following:
If you plan to always look at DOS floppies, it is easy to edit the file /etc/fstab and change the line:
/dev/fd0 /mnt/floppy ext2 noauto,owner 0 0
to
/dev/fd0 /mnt/floppy vfat noauto,owner 0 0

You will then be able to use the command mount /mnt/floppy to mount the floppy,
and umount /mnt/floppy to unmount the floppy before you eject it.
Otherwise you can manually mount the DOS floppy with the following command:
mount -t vfat /dev/fd0 /mnt/floppy
to mount the floppy, and
umount /mnt/floppy
before you eject it.

Finally if you are using the X Window System with either KDE or GNOME,
you can use the file managers to mount and unmount your floppy by right clicking on the floppy icon.
Once the floppy is mounted, you can use the cp command to copy data to the disk, like so:
cp filename /mnt/floppy

32 Linux

How do I mount my CD-ROM drive?
If your system was installed properly, typing:
mount /mnt/cdrom

should work. If it does not, you must edit your /etc/fstab file and add a line that refers to your CD-ROM device.
Here's an example:
/dev/hdc /mnt/cdrom iso9660 noauto,ro 0 0
(CD-ROM device) (directory) (filesystem type and options)

To find out what the CD-ROM device is, type
dmesg | more

and scan it for information regarding your CD-ROM.
If you wish to mount the CD-ROM without adding this to your /etc/fstab, just type:
mount -t iso9660 /dev/hdc /mnt/cdrom

33 Linux

I forgot my root password. What do I do?
When the system comes to the LILO prompt, type:
linux single

When you get the # prompt you will need to type the following:
passwd root

This will update the password to a newer one. At this point you can type shutdown -r now and the system
should boot up with your new password available
35 Linux
OS What is the exact boot sequence of Linux? 1. Each rc?.d directory contains a series of link to the "real" script
that start or stop each service. If the link is S.... the service is
Started, if the link is K... the service is stopped (Kill).
If a service is in 'S' or in 'K' in both the runlevel you are leaving
and the runlevel you are entering, the service is left untouched.
Usually the links have a sequence number that is used to fire them
in sequence (this prevent to start NFS before NETWORK...). So the
link is something like Knn<service> or Snn<service>.
If you want to turn OFF a service in a run level simply remove the
"S" link in that level, or rename the link to something that does
not start with an "S".
2. although the other posts explaining the startup procedure and the
symbolic links correctly, you should try to avoid removing or renaming
the links manually.
There is a system utility called chkconfig which does the job for you
and allows you to easily turn scripts on or off, even depending on the
run level.
In your case you would use the command
chkconfig kudzu off
The command
chkconfig --list
will show you which scripts are started in which run level.
This way you can create your own scripts in /etc/rc.d/init.d. Have a
look how these scripts are built, it's quite straight forward.
3. http://www.linuxdoc.org/guides.html
34 Linux

How does 'service <service_name> {start|stop|restart}' structure work?
36 Java Java
How do I generate java document? http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
Simple examples:
1. javadoc -d <dest doc directory> -sourcepath <src directory> <source file>
2. javadoc -d <dest doc directory> -sourcepath <src directory> <package name>
37
C++
What is RTTI? Run-Time Type Information
<compiler> (RTTI) Facilities included in C++ compilers to allow the type of an object to be determined at run time.
This facility, found in good C++ compilers and some other high level languages, adds type information to memory resident objects (i.e. type name or unique type-id). This allows the run-time system to determine if an object is of a specific type, for example, to ensure that a cast of an object is valid.
typeid Operator
#include <typeinfo.h>
#include <assert.h>
void use_of_typeinfo( )
{
A a1;
const A a2;
assert( typeid(a1) == typeid(a2) );
assert( typeid(A) == typeid(const A) );
assert( typeid(A) == typeid(a2) );
assert( typeid(A) == typeid(const A&) );
B b1;
assert( typeid(a1) != typeid(b1) );
assert( typeid(A) != typeid(B) );
}
38 Linux
OS Set up ipchains to trap and reject all packets bount for banner ad sites,
microsoft, real.com (Real audio), etc. use the whois server at arin.net
to see who owns what IP address block.

39 Linux
OS Simple firewall configuration: The location of ipchains service:
/etc/init.d
The location of configuration file:
/etc/sysconfig/ipchains
1. To stop ipchains: do "service ipchains stop"
2. Setup appropriate rules by running individual commands, such as
ipchains -A DENY ...
ipchains ...
3. To list the current chains: do "ipchains -L'
4. To save the current configuration: do "service ipchains save"
40 Linux
Aureal Sound Card Driver How to install Sound Card driver on Linux? Step1: My distribution of Red Hat 7.1 did not have the kernel source files installed by default. It is essential that these files are installed in order to be able to compile and install the driver. To install the kernel sources insert CD2 of the operating system into your drive. Launch a shell prompt and su to root:
#su -
Now run gnorpm:
#gnorpm&
Click the install button. In the next screen expand the tree Development then the subtree System. Select the kernel source rpm and click install.
Step2: Download au88xx-1.1.2.tar.bz2 (i created a directory called aureal_driver in my home directory and downloaded it into that).
Step3: Unpack using the following commands:
#bunzip2 au88xx-1.1.2.tar.bz2
#tar -xvf au88xx-1.1.2.tar
Step4: There should now be a directory called aureal. cd into that directory and you will find a whole bunch of files and folders. Use your favourite editor to open Makefile. I used gedit as follows:
#gedit Makefile &
Step4: Go to the INCLUDEDIR line and edit the directory string. It should read as such:
INLCUDEDIR = -I/usr/src/linux-$VER/include
$VER is whatever version of the kernel you are running. In Red Hat 7.1 it's 2.4.2.
Save the file and quit.
Step5: Create a sybolic link from the source directory to the /usr/src/linux by typing in the following:
# ln -s /usr/src/linux-$VER/inlcude/usr/src/linux
$VER is whatever version of the kernel you are running. In Red Hat 7.1 it's 2.4.2 so substitute that for $VER
Step6: You are now ready to install. I have a Vortex 2 chip so installed by typing
# make install
Step7: This should work if you have this chipset. It will give you the famous Error 1, but it ignores it. Run modprobe for the driver (in my case, au8830)
# modprobe au8830
Step8: Crack open the beers it's a successful install
I'm currently listening to "They don't sleep on Coney Island Anymore" by "Godspeed You Black Emperor" Sounds absolutely amazing!
Thanks to everyone who has helped me along the way.
Hope this helps you guys.
41

Sybase How to call a stored procedure in Sybase? Using isql or SQL Advantage.
example:
begin transaction
select * from FIRM.KDD_COUNTER
declare @out_next_value2 numeric(38,0)
declare @out_start_value2 numeric(38,0)
declare @out_end_value2 numeric(38,0)
declare @out_error_code2 int
declare @out_error_msg2 varchar(255)
exec FIRM.P_SEQUENCE_NEXTBATCH 'TEST_ID_SEQ',100,@out_start_value2 output, @out_end_value2 output, @out_error_code2 output, @out_error_msg2 output
select @out_start_value2, @out_end_value2, @out_error_code2, @out_error_msg2
select * from FIRM.KDD_COUNTER
rollback
42

Sybase How to connect to Sybase...from NT and from Java...and what to do once you are there... There has been a bit of confusion about connecting to Sybase, which stems from how Sybase operates...
Let me clear things up for you...about connecting the the database, utilities to use, and accessing tables inside of the database...
I strongly suggest you save this e-mail, print it out, and keep it handy for a while...
Connecting to the Database
We have been thinking in terms of a connect string (PD1192S26 or PLATDS1192S26) for specifying how to connect to a database, which is great for Oracle, and pretty good for Sybase outside of Java...
If you want to use the normal SQL tools on your NT system, you need to configure your sql.ini in the \Sybase\ini directory...you can find the latest on \\tradingfloor\projects\Sybase\ini\sql.ini, which has the latest connect strings...
However, if you want to use Java or Jconnect to talk to the Sybase server, things are a little different. Instead of the string, you need to specify the machine name (or IP address), the port the Sybase server listens on, and the database you wish to connect to...so for example...to connect to PD1192S26 (or PLATDS1192S26) and to the PLATD21 database, use the following:
Sybase JDBC connectivity is achieved using the Sybase provided driver called jConnect. Here is an example connection pool setup string for WebLogic:
weblogic.jdbc.connectionPool.sybaseDevPool=\
url=jdbc:sybase:Tds:greg:5000/PLATD21?,\
driver=com.sybase.jdbc.SybDriver,\
initialCapacity=1,\
maxCapacity=3,\
props=user=PLATD21KDD_WEB;password=PLATD21KDD_WEB
This connect to PD1192S26 (on greg, and using port 5000) and the PLATD21 database...
Kevin and company have a great discussion of configuration in ?:\kds\process\software_engineering\guidelines\DevelopmentEnvironment.doc
For your future reference, please use the following for Platform access:
PLATDS1192S26 or PD1192S26 on greg, port 5000 PLATD20 and PLATD21 databases
PLATIS1192S26 or PI1192S26 on greg, port 5001 PLATI20 and PLATI21 databases
PLATTS1192S26 or PT1192S26 on greg, port 5002 PLATT20 and PLATT21 databases
As we get new release versions of Platform, we will add additional databases.
Utilities to Use
If you have RapidSQL., DBArtisan, SQLProgrammer, etc. you probably can access to your heart's content...however, we have a simple command available for Sybase that is similar to sqlplus for Oracle: isql...
You call it as follows:
isql -U<login> -S<server> -P<passwd> -D<database>
where:
<login> is the Sybase Login you wish to use
<server> is the connect string (PD1192S26 or PLATDS1192S26)
<passwd> is the Sybase Login password
<database> is the database you wish to go to
(Password and Database are optional, but you will be prompted for a password)
There are other options (-i <infile> -o <outfile> for input and output files, etc.) that you can investigate on your own...
Once inside the database, here are a few things to remember:
SQL is executed by entering 'go' (without the quotes) on a line by itself after the SQL...(not by using a ; or /)
Insert ...
go
If you want to be sure you are in the desired database, enter the following command:
use <database>
go
On NT, if you want to edit a command, type in edit on the isql command line and it will bring up the dos editor.
Instead of descr <object>, use sp_help '<object>' to find out about something. This is Sybase's dictionary interface...
sp_help 'FIRM.KDD_DMN_CD'
go
If you want to insert today's date and time, use the getdate() function instead of the Oracle SYSDATE function...
insert into foo (date, data) values (getdate(), 'data')
go
Accessing Platform Tables inside the Database
Once you have logged in and gone to your desired database, be aware that when you qualify the table name with the owner, you DON'T put the login name (with the PLATx## stuff), but the usual generic information. In our development and integration environments, we have the following users/owners inside the databases:
PLATDS1192S26/PD1192S26 Server: (Development use)
PLATD20 database:
PLATD20FIRM login translates to FIRM owner inside the database
PLATD20KDD login translates to KDD owner inside the database
PLATD20KDD_MNR login translates to KDD_MNR owner inside the database
PLATD21 database:
PLATD21FIRM login translates to FIRM owner inside the database
PLATD21KDD login translates to KDD owner inside the database
PLATD21KDD_MNR login translates to KDD_MNR owner inside the database
PLATIS1192S26/PI1192S26 Server: (Integration use)
PLATI20 database:
PLATI20FIRM login translates to FIRM owner inside the database
PLATI20KDD login translates to KDD owner inside the database
PLATI20KDD_MNR login translates to KDD_MNR owner inside the database
PLATI21 database:
PLATI21FIRM login translates to FIRM owner inside the database
PLATI21KDD login translates to KDD owner inside the database
PLATI21KDD_MNR login translates to KDD_MNR owner inside the database
PLATTS1192S26/PT1192S26 Server: (System Test use)
PLATT20 database:
PLATT20FIRM login translates to FIRM owner inside the database
PLATT20KDD login translates to KDD owner inside the database
PLATT20KDD_MNR login translates to KDD_MNR owner inside the database
PLATT21 database:
PLATT21FIRM login translates to FIRM owner inside the database
PLATT21KDD login translates to KDD owner inside the database
PLATT21KDD_MNR login translates to KDD_MNR owner inside the database
So when you finally log in, how do you select from KDD_DMN_CD?
Regardless of which database and server, it is:
select * from FIRM.KDD_DMN_CD
go
We are not this fortunate in Oracle...Why? Oracle has one instance and one database for that instance. Sybase has one instance (they call it a server) but allows multiple databases under that instance--heck there are always at least 4 databases (master, model, temp, and sybsystemprocs) plus user databases (like PLATx20 and PLATx21)...
43 Java Java Oracle How to change expired password in Oracle? Sue-
The issue is, as Nick found out, that our JDBC driver does not support changing a user's password after it has expired. Our current "change your password" code requires that a connection already be established, which can't happen if the user's password has expired. Oracle's OCI JDBC driver has a new feature (only for 8.1.7) which will allow you do change an expired password. However, there are a lot of problems with using this driver, not the least of which is the fact it will require an Oracle client installation on every workstation. Nick called SequeLink support and was told that it may be possible that the next realese of SequeLink may support this feature, but it is not likely.
At our meeting this morning we discussed two possible solutions. The first would be to use Oracle's grace period. If a user attempts to log in during the grace period, he would be forced to change his password. The downside to this approach is that if a user doesn't log in within the grace period (on vacation, etc), his password will expire and he will be locked out until a DBA can reset his account. The grace period could be as long as we want it (10 days, etc).
The second solution would be to have the BEAMS client itself take care of password expiration. Maybe by using an additional column in the kdd user table (or some other mechanism) to know when the password will expire, the client will force the user to change his password after a specified period. The downside to this approach is that it is separated from Oracle security. The user will be able to log in using SQL*plus or some other mechanism without having his password expire.
Either approach will require a change in the wording of the requirements.
If anyone has anything to add, please do so.
- Jeremy
-----Original Message-----
From: Jones, Sue
Sent: Friday, February 09, 2001 4:51 PM
To: Chang, Nick; Thamasett, Paul; Wiles, Judy; Doraiswamy, Raghuram
Cc: Shields, Jeremy
Subject: RE: BEAMS 2.0 expired password issue
Hmmm.....we need to get those on the distro list together on Monday. I know we tested password expiration to see how it would respond a few weeks ago, but not sure what was done would have uncovered what you found.
Paul/Judy - Is Fidelity using Oracle 8.1.6 or 8.1.7?
Nick - Can you check with those above Monday AM and see when we can get together?
Thanks, Sue
-----Original Message-----
From: Chang, Nick
Sent: Friday, February 09, 2001 4:42 PM
To: Jones, Sue
Cc: Shields, Jeremy
Subject: BEAMS 2.0 expired password issue
Sue,
Currently the JDBC driver BEAMS is using (Sequelink v4.5) does not support this feature to allow users to change expired passwords. This is confirmed by the test result that I've done and further confirmed by MERANT's tech support.
The feature, however, is supported by the latest ORACLE 8.1.7 JDBC driver. I have verified it by modifying the sample code that I've got from ORACLE's web site. This feature is not supported in JDBC driver of 8.1.6 which is the current version of the ORACLE client software that we have here in SRA.
To add this new feature into BEAMS 2.0, one obvious solution will be use ORACLE 8.1.7 JDBC driver along with Sequelink driver. In addition, we will also be required to update ORACLE's client software to version 8.1.7.
Please let me know of your opinion on this issue.
Nick
44 C++ C++
const usage In reference to my action item regarding the use of const in parameter lists, I found the attached recommendation. I recommend that we use const to denote, to the caller, parameters that will not change. Unless the function writer deems it necessary to make a const "passed by value" parameter, it is unnecessary to make these parameters const. For example:
// The following denotes to the caller that methodX can only call
// const methods of ClassY, thus ensuring that it will not change
// the contents of the reference
void methodX(const ClassY &referenceToClassY);
// Since the following method passes the data by value, the caller is assured that
// methodY will not change Z.
void methodY(int Z);
REC) Maximize the use of const in function declarations
Check whether functions have any constant behavior (return a constant value; accept constant arguments; or operate without side effect) and assert the behavior using the const specifier.
Example

const T f(...); // Function returning a constant object.

T f(T* const arg); // Function taking a constant pointer.
// The pointed-to object can be
// changed but not the pointer.
T f(const T* arg); // Function taking a pointer to, and
T f(const T& arg); // function taking a reference to a
// constant object. The pointer can
// change but not the pointed-to
// object.
T f(const T* const arg); // Function taking a constant
// pointer to a constant object.
// Neither the pointer nor pointed-
// to object may change.
T f(...) const; // Function without side-effect:
// does not change its object state;
// so can be applied to constant
// objects.
45 Linux
OS Where does the system log files go in Linux? /var/log/messages
46

Sybase how to delete lots of stuff in Sybase?
HOWEVER, NOW THAT I HAVE YOUR ATTENTION, LET ME GIVE YOU THE SECRET TO DELETING LOTS OF STUFF ON SYBASE...besides, it will kill the time while the database recovers...
You need to use a loop and limit how many rows you delete at a time to keep the transaction log from filling up. This is assuming that you really, really want to delete the rows and will just continue deleting if it is not completed...like when you clean up...
Here is a code fragment with some comments...
-- @ct holds the number of rows delleted in the loop
declare @ct int
-- Typical value for batch deletes is between 5000 and 20000; your mileage may vary
-- We will use 5000 here, and use the SET ROWCOUNT feature to limit the number of
-- rows modified by SQL code
set rowcount 5000
-- set the value of @ct to the same as rowwcount
select @ct = 5000
while ( @ct = 5000 )
begin
delete <table>...
-- capture the number of rows deletted
select @ct=@@rowcount
end
-- set things back to have no limitts on what you do
set rowcount 0

You can only do one table at a time with this, but you can copy and paste this as needed for the tables...
Please use this approach when deleting large tables (or selectively deleting...the delete clause is flexible, like most SQL...) and you are going to delete a lot of rows when all is said and done...
This will keep the transaction log from filling up and forcing delays like this...
47 INTERNET

How to block an access to a website easily on a particular machine? Edit 'hosts' file and add the following entry
127.0.0.1 www.too_addictive_site.com
48
XML XML What is the difference between SAX and DOM parsers? Parser interface: There are two accepted standards for XML parser interfaces: SAX and DOM. The difference between these two models in simple words is as follows: a SAX-capable parser calls a registered function for each start tag, end tag, and the data inbetween. The parsing is done sequentially, so there is no need to have the whole document in memory at any time (in some cases it is not even necessary to have the whole document available, it may be received in chunks). The downside is that the elements have to be processed as they are encountered during parsing. If an application needs access to previous or later elements, it has to do some sort of buffering. On the other hand, a DOM-capable parser creates an in-memory representation of the whole document. This may need a lot of memory for large documents, but all elements can be accessed freely at any time during processing.
49 XML
XML What is the basic concept of DOM? The Node interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the Node interface expose methods for dealing with children, not all objects implementing the Node interface may have children. For example, Text nodes may not have children, and adding children to such nodes results in a DOMException being raised.
The attributes nodeName, nodeValue and attributes are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific nodeType (e.g., nodeValue for an Element or attributes for a Comment), this returns null. Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information.
The node type:
ELEMENT_NODE
ATTRIBUTE_NODE
TEXT_NODE
CDATA_SECTION_NODE
ENTITY_REFERENCE_NODE
ENTITY_NODE
PROCESSING_INSTRUCTION_NODE
COMMENT_NODE
DOCUMENT_NODE
DOCUMENT_TYPE_NODE
DOCUMENT_FRAGMENT_NODE
NOTATION_NODE
50
JAVA JAVA What is final keyword? A Java(TM) programming language keyword. You define an entity once and cannot change it or derive from it later. More specifically: a final class cannot be subclassed, a final method cannot be overridden and a final variable cannot change from its initialized value.
51 Linux
apache What are the kickstart thing to learn in installing Apache? 1. Read the README README.configure
2. Important switches
./configure --show-layout
./configure --show-layout --with-layout=GNU
./configure --show-layout --with-layout=Apache
3. A suggested one:
./configure --with-layout=GNU --prefix=/usr/local/apache --enable-shared=max
52 Linux
cvsweb What are the steps to set it up? 0. get cvsweb http://stud.fh-heilbronn.de/~zeller/cgi/cvsweb.cgi/
1. Make sure perl is installed
2. copy cvsweb.conf to /etc/httpd
3. copy cvsweb.cgi to /usr/local/apache/share/cgi-bin
4. modify cvsweb.conf
%CVSROOT = (
'major' => '/home/cvsroot'
^^^^^^ ^^^^^^^^^^^^^
symbolic name actual path
);
$cvstreedefault = 'major';
^^^^^^ symbolic name.
$mime_types = '/etc/httpd/conf/apache-mime.types';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$ENV{'PATH'} = '/usr/bin';
^^^^^^^^^^ &#36889;&#37002;&#26159;&#20320; rlog rcsdiff &#30340;&#20301;&#32622;
modify cvsweb.cgi
$config = $ENV{'CVSWEB_CONFIG'} || '/etc/httpd/conf/cvsweb.conf';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Make sure CVSROOT is readable by apache
http://localhost/cgi-bin/cvsweb.cgi/
53 Linux
cvs How to Set up the server for password authentication? If your inetd allows raw port numbers in `/etc/inetd.conf', then the following (all on a single line in `inetd.conf') should be sufficient:

2401 stream tcp nowait root /usr/local/bin/cvs
cvs -f --allow-root=/usr/cvsroot pserver
(You could also use the `-T' option to specify a temporary directory.)
The `--allow-root' option specifies the allowable CVSROOT directory. Clients which attempt to use a different CVSROOT directory will not be allowed to connect. If there is more than one CVSROOT directory which you want to allow, repeat the option. (Unfortunately, many versions of inetd have very small limits on the number of arguments and/or the total length of the command. The usual solution to this problem is to have inetd run a shell script which then invokes CVS with the necessary arguments.)
If your inetd wants a symbolic service name instead of a raw port number, then put this in `/etc/services':

cvspserver 2401/tcp
and put cvspserver instead of 2401 in `inetd.conf'.
If your system uses xinetd instead of inetd, the procedure is slightly different. Create a file called `/etc/xinetd.d/cvspserver' containing the following:

service cvspserver
{
port = 2401
socket_type = stream
protocol = tcp
wait = no
user = root
passenv = PATH
server = /usr/bin/cvs
server_args = -f --allow-root=/usr/local/cvsroot pserver
}
(If cvspserver is defined in `/etc/services', you can omit the port line.)
Once the above is taken care of, restart your inetd, or do whatever is necessary to force it to reread its initialization files.
Then, at a client, use the following commands
>cvs -d :pserver:nick@nick_mobile:/usr/local/cvsroot login
>cvs -d :pserver:nick@nick_mobile:/usr/local/cvsroot checkout Track
54 Linux
service How to add a inetd service? For an example, look at item 53 on adding a cvs pserver service.
55



What are the development life cycles?
Modern OO methodologies directly address these points and emphasize the
incremental, iterative, evolutionary, concurrent and situational nature of
software development.  [Boehm 86] presents a seminal spiral life-cycle model
with a risk-driven incremental prototyping approach.  [Booch 91, 6.1]
proposes a "round-trip gestalt" design with analyze-design iterations and
an overall system perspective and [Berard 93] proposes an (incremental)
"parallel-recursive design" with analyze-design-implement-test iterations.
[Coad 91b] presents the following development cycle breakdown:

  Waterfall-
    Analysis
    Design
    Programming

  Spiral-
    Analysis, prototyping, risk management
    Design, prototyping, risk management
    Programming, prototyping, risk management
 
  Incremental-
    A little analysis
    A little design
    A little programming
    Repeat
56



What is Cocoon
Apache Cocoon is an XML publishing framework that raises the usage of XML and XSLT technologies for server applications to a new level. Designed for performance and scalability around pipelined SAX processing, Cocoon offers a flexible environment based on a separation of concerns between content, logic, and style. To top this all off, Cocoon's centralized configuration system and sophisticated caching help you to create, deploy, and maintain rock-solid XML server applications.

Cocoon interacts with most data sources, including filesystems, RDBMS, LDAP, native XML databases, and network-based data sources. It adapts content delivery to the capabilities of different devices like HTML, WML, PDF, SVG, and RTF, to name just a few. You can run Cocoon as a Servlet as well as through a powerful, commandline interface. The deliberate design of its abstract environment gives you the freedom to extend its functionality to meet your special needs in a highly modular fashion.
57


C++
What is Copy Constructor?
The copy constructor only applied to initializations. It does not apply to assignment. By default, when an initialization occurs, the compiler will automatically provide a bitwise copy. (That is, C++ automatically provides a default copy constructor that simply duplicates the object.) However, it is possible to specify precisely how one object will initialize another by defining a copy constroctor.
All copy constructors have this general form:
classname (const classname &obj) {
   // body of constructor
}
C++ defines two distinct types of situations in which the value of one object is given to another. The first situation is assignment. The second situation is initialization, which can occur three ways:
* when an object is used to initialize another in a declaration statement.
* when an object is passed as a parameter to a function
* when a temporary object is created for use as a return value by a function
i.e.
myclass x = y; // y explicitly initializing x
func1(y); // y passed as a parameter
y = func2(); // y receiving a returned object
In the first two cases, a reference to y would be passed to the copy constructor. In the third, a reference to the object returned by func2() is passed to the copy constructor.
58
.Net


What is the best procedure to learn DotNet on Windows?
On learning ADO.NET and creating GUI using DotNet

Steps:

1. After Studio Installation, installing the sample application from the
directory: C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\StartHere.html

2. Installing MSDE (MicroSoft Data Engine)

3. Learning about DataSet, DataAdapter, and sqlConnector objects
    Key Items:
    * Associating a database table with DataAdapter
    * In IDE environment, using server explore to access the Database instance
    * DataSet could be automatically generated after a table is dropped in and
      associated with a DataAdapter, using data in IDE
    * Bind a control to DataSet and set the proper displaymember       
   
4. Next Steps
    * Identify how the changes in GUI gets updated in Database
    * It seems a generic classes doing it..
      * CurrencyManager
      * Binding
      * BindingContext
     
    * How to verify the validity of the data entry before inserting data into
      database?
      * Use Parse and Format methods of Binding object

59
.Net

C#
In C#, what is the keyword, override? Use the override modifier to modify a method or a property. An override method
provides a new implementation of a member inherited from a base class. The method
overridden by an override declaration is known as the overridden base method.
The overridden base method must have the same signature as the override method.

You cannot override a non-virtual or static method. The overridden base method
must be virtual, abstract, or override.

An override declaration cannot change the accessibility of the virtual method.
Both the override method and the virtual method must have the same access level
modifier.

You cannot use the following modifiers to modify an override method:

new   static    virtual   abstract

An overriding property declaration must specify the exact same access modifier,
type, and name as the inherited property, and the overridden property must be
virtual, abstract, or override

60


C/C++/C#
What is Mutex?
A synchronization primitive than can also be used for interprocess synchronization.

When two or more threads need to access a shared resource at the same time, the system needs a synchronization mechanism to ensure that only one thread at a time uses the resource. Mutex is a synchronization primitive that grants exclusive access to the shared resource to only one thread. If a thread acquires a mutex, the second thread that wants to acquire that mutex is suspended until the first thread releases the mutex.

You can use WaitHandle.WaitOne to request ownership of a mutex. The thread that owns a mutex can request the same mutex in repeated calls to Wait without blocking its execution. However, the thread must call the ReleaseMutex method the same number of times to release ownership of the mutex. If a thread terminates normally while owning a mutex, the state of the mutex is set to signaled and the next waiting thread gets ownership. If no one owns the mutex, the state of the mutex is signaled.
61
.Net

C#
What is the technique to ensure only one instance app is running? Using Mutex, for example.

        [STAThread]
        static void Main()
        {
            Mutex mutex = new Mutex(false, "PACTS Application");
            bool bRunning = !mutex.WaitOne(0, false);
            if (bRunning)
            {
                // exit program and reactivate the previous instance.
                MessageBox.Show("Windows cannot start this application because an instance is already running.", "PACTS");
                return;
            }

            Application.Run(new MainForm());
        }

62
.Net

C#
Q: Clarification about Simple DataBinding When a data is bound to a control, such as TextBox, if the value is changed, the bounded data is also change in the dataset. In the sense that it creates an new value of proposed type. This value will not go into the data set until EndEdit() is called.


Use the BeginEdit() method to put a DataRow into edit mode. In this mode, events are temporarily suspended allowing the user to make multiple changes to more than one row without
triggering validation rules. For example, if the values of several rows must add up to 100, you can put each of the rows into edit mode to suspend the validation of the row values until the user attempts to commit the values.

The BeginEdit() method is called implicitly when the user changes the value of a data-bound control; the EndEdit() method is called implicitly when you invoke the DataTable object's AcceptChanges method.) While in this edit mode, the DataRow stores representations of the original and new proposed values Therefore, as long as the EndEdit method has not been called, you can retrieve either the original or proposed version by passing either DataRowVersion.Original or DataRowVersion.Proposed for the version parameter of the Item property. You can also cancel any edits at this time by invoking the CancelEdit method.

To see if the row contains an original or proposed value, call the HasVersion method.

The DataRowVersion values are used when retrieving the value found in a DataRow using Item or the GetChildRows of the DataRow object.

The DataRowVersion informs you what version of a DataRow exists. Versions change under the following circumstances:

After calling the DataRow object's BeginEdit method, if you change the value, the Current and Proposed values become available.
After calling the DataRow object's CancelEdit method, the Proposed value is deleted.
After calling the DataRow object's EndEdit method, the Proposed value becomes the Current value.
After calling the DataRow object's AcceptChanges method, the Original value becomes identical to the Current value.
After calling the DataTable object's AcceptChanges method, the Original value becomes identical to the Current value.
After calling the DataRow object's RejectChanges, the Proposed value is discarded, and the version becomes Current.

Members

Member name        Description
Current            The row contains current values.
Default            The default row version, according to the current DataRowState.
Original        The row contains its original values.
Proposed        The row contains a proposed value.

63
Java

Java
What is final keyword?
The final keyword is a modifier that may be applied to classes, methods, and variables. It has a similar, but not identical meaning in each case. A final class may never be subclassed. A final method may never be overrideen. A final variable may never have its value set.  
A static final variable could be exactly cacluated by the compiler to be used in the run-time. The similar concept in const static variable. (There is no const keyword in Java.. perhaps final is doing the trick for the variable concept.)


1
1