jim mcnamara 19 Junior Poster

Yes. - it's called a static link. It means that all of the runtime you need is part of the image file - obviously a much bigger image file.

I can't tell which version of unix you have, but your man ld page will tell you how to do that. In most flavors of Unix you provide the cc command with a list of static libraries ".a" files including libc.a. You will also have to put your own runtime into one of these archives as well - or link against the objects in it. Again, the ld manpage is your friend.

jim mcnamara 19 Junior Poster

Using Oracle and the SQL langauge are somewhat different things. Oracle has a lot of "features" like Oracle Forms and PL/SQL that are Oracle-specific.

Oracle comes with a learning "set" -- the scott/tiger schema. Most books that teach about Oracle and SQL assume you already have the "EMP" table for example.

The best book out there is "ORACLE Database 10g the Complete Reference" by Kevin Loney. (There is a ORACLE8 and an ORACLE9 version as well) If you are going to program in an Oracle environment you will have to get it sooner or later.

If you are just playing around with the free Oracle Express 10g then consider
"Oracle database 10g A Beginner's Guide" by Ian Abramson.

jim mcnamara 19 Junior Poster

That's good.
Do you have a valid tnsnames.ora and sqlnet.ora file? ie., please post them here.
They are in your Oracle home directory (like ORA92)

If you version of 9i is old they will be in (oraclehome)\NET80\ADMIN
Otherwise they will be in (oraclehome\NETWORK/ADMIN

jim mcnamara 19 Junior Poster

Get yourself a CEH, Narue. It's worth the effort (Security Testing Certification -
Certified Ethical Hacker, not kidding).

See Jack Koziol's 'Shellcoder's Handbook'

jim mcnamara 19 Junior Poster

chris - you're correct. Perl is overkill which I guess was my point to start with.
3 lines of awk:

awk ' BEGIN {connected=-1}
     $2 ~ /^connected/  {connected*=-1 ; continue}
     connected<0 {print $0 } ' filename

on this file:

PIN connected<112>
USE TEST ;
PORT
LAYER TRUE ;
END
END connected<112>

PIN address<110>
USE TEST ;
PORT
LAYER TRUE ;
END
END address<110>

PIN connected<11>
USE TEST ;
PORT
LAYER TRUE ;
END
END connected<11>

produce this output:

kcsdev:/home/jmcnama> t.awk

PIN address<110>
USE TEST ;
PORT
LAYER TRUE ;
END
END address<110>
voidyman commented: brilliant! +1
jim mcnamara 19 Junior Poster

If this is any version of unix:

grep -v "connected" filename > newfile

deletes all of the lines having the word: connected

jim mcnamara 19 Junior Poster

Have you tried running it in a debugger?
If you do a stack dump (backtrace)
it will show exactly where it bombed.

jim mcnamara 19 Junior Poster
This file:
#include <math.h>
int main(int argc, char *argv[])
{
        printf("%f\n",pow(2., 3.5) );
        return 0;
}
compiled this way (This is unix does not matter)
kcsdev:/home/jmcnama> cc t.c -lm
Gives this result:
kcsdev:/home/jmcnama> a.out
11.313708
jim mcnamara 19 Junior Poster

The STL is fantastic, but C does not support it. It looks like the OP wants to work in C only.

jim mcnamara 19 Junior Poster

This works:

int main(int argc, char *argv[])
{
	char table[5][10]={"Hello","Hello","Hello","Hello","Hello"};
	int i=0;
	for(i=0;i<5;i++)
	{
		printf("%d %s\n",i,table[i]);
	}
	return 0;
}

Also, don't compile C under a C++ compiler, if you can avoid it,
you will get some odd results.

jim mcnamara 19 Junior Poster
#include <unistd.h>
#include <errno.h>

int change_priority(int value)
{
     int retval=0;
     errno=0;
     retval=nice(value);
     if(errno && retval=(-1) )
     {
          perror("Error setting priority");
          return 1;
     }
     return 0;
}

read the man 2 nice page - nice values work backwards - negative numbers increase priority, for example, and require privilege.

jim mcnamara 19 Junior Poster

You need to look at expect rather than trying to use perl.
expect is used for automating interactive dialogues.

jim mcnamara 19 Junior Poster

echo "some prompt" - displays a prompt
read variablename - reads input from the terminal
echo "$variablename" >> filename - appends a line

Now you put them together.

jim mcnamara 19 Junior Poster

factorials get BIG really fast and exceed the limits of 32-bit unsigned integer variables by 13!.

If you want to play with them use a datatype that can handle huge numbers, or switch to an extended precision mathematics library like GMP.

jim mcnamara 19 Junior Poster

The OP wants the tries data structure.
I don't know of any class that supports it.

jim mcnamara 19 Junior Poster

Whenever you compile C code you should enable warnings. Some compilers will not complain unless you tell them to complain.

What compiler are you using? Is it an ancient version
of BORLAND C++ or TURBO C? You really need to use a modern compiler - there are free ones on the internet starting with gcc.

And in general, don't compile straight C with a C++ compiler even though it seems to work.

jim mcnamara 19 Junior Poster

the functions count_char and test_letter_content are from
something else, but they provide:

an example of changing case
a way to compare the letter content of two char arrays

I put a "main()" on the code so you can see how it works.
You will have to find a way to trim char arrays.

The principle is to add up characters characters based on their ascii code - string the result in an array of integers.
Thne you compare the two arrays (in this case) only for uppercase ascii values.

#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>

/* count characters, there must be at least one */
int count_chars( int *dest, char *src)
{
	int i=0;
	int retval=0;
	size_t len=strlen(src);
	
	for(i=0;i<len;i++)     /* sum occurrences of each letter */
	{	
		if(isalpha((int) src[i]) ) /* is is a letter */
		{			           
			dest[ toupper((int) src[i]) ]++;  /* count as uppercase */
			retval++;
		}	
	}	
	return retval;
}

/* compare letter content of two char arrays */
int test_letter_content(char *a, char *b)
{
	int ascii_a[128]={0};
	int ascii_b[128]={0};
	int i=0;
	int retval=0;
                                  
    if(!strlen(a) || !strlen(b) ) return retval; /* check lengths */
    retval=count_chars(ascii_a, a);       /* count letters in a */
    if(!retval) return retval;
    retval=count_chars(ascii_b, b);       /* count letters in b */
    if(!retval) return retval;
	retval=1;                             /*assume okay at this point */
	for(i='A';i<='Z' && retval==1 ;i++)
	{
		if(ascii_a[i]!=ascii_b[i]) retval=0;
	}
	return retval;
}

/* this is a test - note a & b will overflow on long entries …
jim mcnamara 19 Junior Poster

The awk internal variable NR tells you what line you are currently working on

awk 'NR > 4 && NR < 11' filename

O'Reilly book 'sed & awk' - the one with the the tarsiers on the front cover.
If you're going to use awk get that book.

If you're on Linux go to the gawk (GNU awk) user's guide -

http://www.delorie.com/gnu/docs/gawk/gawk_7.html

jim mcnamara 19 Junior Poster

try:

#!/bin/ksh
# this works under ksh 
# assume TEMP2 TEMP3 TEMP4 are defined
more $TEMP2 | grep join | awk '{print $3}' > $TEMP3
while read group
do
{
   LENGTH=${#group}
   LENGTH=$(($LENGTH-2))
   echo $group > $TEMP0
   cut -c8-$LENGTH $TEMP0 >>$TEMP4
}
done < $TEMP3
jim mcnamara 19 Junior Poster

Assuming I understand your problem:

find /path1 -exec basename {} \; | sort > file1
find /path2 -exec basename {} \; | sort > file2
# at this point you can use diff file1 file2
# or
# here we want files only listed in file1 but not in file2
comm -23 file1 file2
# here we show files listed in file2 but not in file1
comm -23 file2 file1
jim mcnamara 19 Junior Poster

This is a Windows problem - Windows has an answer:

The MoveFile API allows you to defer the action until reboot, so you can move the file to NULL: or wherever.

The
MOVEFILE_DELAY_UNTIL_REBOOT -
flag is specifically meant for files like dll's and pagefiles that remain open all the time.

jim mcnamara 19 Junior Poster

Date arithmetic in shell is a pain. This link gives you several good scripts that do date compares and date arithmetic:

http://www.unix.com/showthread.php?t=13785

jim mcnamara 19 Junior Poster

This awk one-liner works pretty well -

awk '!x[$0]++' file.old > file.new

This checks the whole line

This one just checks for part of the line in this case the first 16 characters.

awk '!x[substr($0,1,16)]++' file.old > file.new
jim mcnamara 19 Junior Poster

Can you connect using sqlplus?

jim mcnamara 19 Junior Poster

That is Os dependant - what OS?

jim mcnamara 19 Junior Poster

Ok.
Game development is complex. There are lots of positions.
Usually QA is the easiest place to start.

Graphics programmers work on the game engine itself.
There may be several game engine teams - one for Windows, One for XBOX. Depending on the platform, development is usally in C++, C, and assembler.

OS specialists work on interfacing efficiently with low-level OS routines. And porting e.g. moving from PSP to Windows

Network programmers work on building Web servers to support internet play.

Graphic artists use programs like Maya to develop sprites,
tiles, and background in general. They may work with the game designers in character design.

Game designers work on the look and feel, the stragegic play, balancing, or whatever applies to the game "appearance" and user interface and user experience.

Script writers do just that - write storyboards and scenarios

QA people test modules - sometimes they are responsible to develop test harnesses. They test what other people develop.
Sometimes they asre responsible for overseeing integration

Marketing and legal people are business support.

Pick one. Everybody in the list except Marketers and office staff (and character actors) develop some kinds of high-leverl language scripts or program in general at one time or another.

jim mcnamara 19 Junior Poster

It is IT management and possibly some system admin or maybe DBA stuff - infrastructure support in general.

Software development and maintenance are sort of tangential to your field of study.
In terms of jobs, your area is not as likely to go overseas.

jim mcnamara 19 Junior Poster

http://www.acm.uiuc.edu/webmonkeys/book/c_guide/

See section 2.12.3 - File & 2.12.5 Character I/O

jim mcnamara 19 Junior Poster

I'm posting this very small insertion sort routine in C - well after your post, and possibly a homework deadline, so you can see what one looks like.

typedef THING unsigned long;
/* n= number of elements in *input */
void insertion(THING *input, int n)
{ 
    int i=0, j=0;
    THING tmp=0;
    for (i = 1; i < n; i++)
    { 
        tmp = input[i];
        j = i;
        while ((j > 0) && (input[j-1] > tmp))         
        { 
            input[j] = input[j-1];
         	j--;         
        } 
        input[j] = tmp;     
      } 
}

It's really like a deferred "swap" function - you swap only after
you find where the element belongs.