Two programs with same logic

Hi,
Two set of codes can be compared by using
beyond compare or other equivalent software
to determine the areas of differences and the
areas of similarities. But, there are scenarios
in which the same logic would be used by 2 set of
programs/softwares but that the variable names
might be different. So, how to determine this
without executing the program ? Is there any tool
that will help in identifying the existence of similar
logics in two different programs ? Any ideas ?

Thx in advans,
Karthik Balaguru
0
12/20/2009 3:42:18 PM
comp.lang.c 29955 articles. 1 followers. spinoza1111 (3247) is leader. Post Follow

12 Replies
504 Views

Similar Articles

[PageSpeed] 26
karthikbalaguru <karthikbalaguru79@gmail.com> writes:
>in which the same logic would be used by 2 set of

  Determining whether two programs behave the same for
  every input should in general be equivalent to the

http://en.wikipedia.org/wiki/Halting_problem

  .

  For special conditions, it should still be possible: 
  For example, when variables are only renamed, one 
  can replace both name sequences by generated names.

  (I have removed other groups from the �Newsgroups:�
  header.)

0
ram
12/20/2009 3:50:16 PM
ram@zedat.fu-berlin.de (Stefan Ram) writes:
> karthikbalaguru <karthikbalaguru79@gmail.com> writes:
>>in which the same logic would be used by 2 set of
>
>   Determining whether two programs behave the same for
>   every input should in general be equivalent to the
>
> http://en.wikipedia.org/wiki/Halting_problem
>
>   .
>
>   For special conditions, it should still be possible: 
>   For example, when variables are only renamed, one 
>   can replace both name sequences by generated names.
>
>   (I have removed other groups from the »Newsgroups:«
>   header.)

The original article was cross-posted to
comp.os.linux.development.apps, comp.programming,
comp.unix.programmer, and comp.lang.c.  Why did you remove everything
but comp.lang.c?  The question isn't specific to C or to any other
language; surely comp.programming would be more appropriate.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
0
Keith
12/20/2009 6:19:41 PM
Keith Thompson <kst-u@mib.org> writes:
>The question isn't specific to C or to any other language;
>surely comp.programming would be more appropriate.

  Since it was posted to comp.lang.c, I assumed that the
  OP was referring to a C program. This assumption might
  have been wrong, but I had it at the time I was reading
  his OP.

>Why did you remove everything but comp.lang.c?

  Since I had this assumption, I deemed the other groups
  to be not appropriate. (I might have been wrong with
  this assessment.)

  It is my own posting style not to crosspost to multiple
  groups without sufficient reason. This was another reason
  for me to trim the Newgroup header.

0
ram
12/20/2009 6:40:19 PM
"karthikbalaguru" <karthikbalaguru79@gmail.com> wrote in message news:
> Two set of codes can be compared by using
> beyond compare or other equivalent software
> to determine the areas of differences and the
> areas of similarities. But, there are scenarios
> in which the same logic would be used by 2 set of
> programs/softwares but that the variable names
> might be different. So, how to determine this
> without executing the program ? Is there any tool
> that will help in identifying the existence of similar
> logics in two different programs ? Any ideas ?
>
I think such exist. Whilst in the general case "do two programs have the 
same output for the same input?" is the same as the halting problem, you are 
probably not interested in the general case, but intwo programs which have 
been copied from the same source, with identifiers changed and maybe a few 
minor control paths added. 


0
Malcolm
12/20/2009 7:20:09 PM
On 20 Dec 2009 at 15:50, Stefan Ram wrote:
> karthikbalaguru <karthikbalaguru79@gmail.com> writes:
>>in which the same logic would be used by 2 set of
>
> Determining whether two programs behave the same for every input
> should in general be equivalent to the
> http://en.wikipedia.org/wiki/Halting_problem

A gold medal there for exceeding even the customary level of uselessness
in a clc response.

It's obvious that the OP doesn't care about whether two programs behave
the same for every input. He's interested in the question:
heuristically, given two programs, are they "very similar"?

Notice that there are plenty of practical reasons for wanting to answer
this question:
* if the programs are given as source code, an instructor wants to check
for copying-with-superficial-changes; or a lawyer wants to check for a
GPL infringement
* if the programs are binary, anti-virus vendors might be interested in
this

Compare that with the halting problem, which has no practical
application and is of purely theoretical interest.

0
Antoninus
12/20/2009 7:30:20 PM
On Dec 20, 11:42=A0pm, karthikbalaguru <karthikbalagur...@gmail.com>
wrote:
> Hi,
> Two set of codes can be compared by using
> beyond compare or other equivalent software
> to determine the areas of differences and the
> areas of similarities. But, there are scenarios
> in which the same logic would be used by 2 set of
> programs/softwares but that the variable names
> might be different. So, how to determine this
> without executing the program ? Is there any tool
> that will help in identifying the existence of similar
> logics in two different programs ? Any ideas ?
>
> Thx in advans,
> Karthik Balaguru

As others have pointed out, the general problem is equivalent to the
Halting problem and is not solvable by an automated tool.

However, there are useful levels of similarity, where "similarity" is
a generalized identity:

(1) Similarity after compiler lexical analysis: "printf( \"Hello world\
\n\" );" as a fragment is similar in this way to "printf(\"Hello world\
\n\");"

(2) Similarity after parsing: "int a; a =3D 1+1;" is similar in this
sense to "int b; b =3D 1+1;"

(3) Similarity after code motion, elimination and optimization that
preserves intent: "int a; int b; a =3D 0; b =3D 0;" is similar to "int b;
int a; b =3D 0; a =3D 0;". "if (b || -1) c();" is similar in this sense to
"c();"

Factoring compilers better and providing an open architecture would
allow us to use compilers for far more than merely compiling. Instead
of shipping compilers, we should ship components. But, it's much more
amusing here to engage in the politics of personal destruction.
0
spinoza1111
12/22/2009 12:10:34 PM
karthikbalaguru wrote:
> Hi,
> Two set of codes can be compared by using
> beyond compare or other equivalent software
> to determine the areas of differences and the
> areas of similarities. But, there are scenarios
> in which the same logic would be used by 2 set of
> programs/softwares but that the variable names
> might be different. So, how to determine this
> without executing the program ? Is there any tool
> that will help in identifying the existence of similar
> logics in two different programs ? Any ideas ?

As others say, it would be difficult at best to find dups. But a
couple approaches that could help. One might be to run both codes
through an obfuscator which would replace the programmer's meaningful
variable names with generated names. Then compare. But there's still
a lot of room for programming style to mess you up.

A second approach would be to compile both to assembler and compare
the assembler code. That should remove a fair amount of programmer
style problems but not all.
0
Joe
12/22/2009 7:05:34 PM
On 2009-12-20, karthikbalaguru <karthikbalaguru79@gmail.com> wrote:
> Hi,
> Two set of codes can be compared by using
> beyond compare or other equivalent software
> to determine the areas of differences and the
> areas of similarities. But, there are scenarios
> in which the same logic would be used by 2 set of
> programs/softwares but that the variable names
> might be different. So, how to determine this
> without executing the program ? Is there any tool
> that will help in identifying the existence of similar
> logics in two different programs ? Any ideas ?

The structural similarity you are hinting at can be easily found if you parse
the code into a nice abstract syntax tree representation. Then it's just a
matter of writing an equality function which compares two pieces of code.

This is easiest to understand and illustrate through the Lisp language.

The comparison is similar to a routine that compares two trees, except that it
has to understand all ``special forms'' in the language, and their semantics.
That is to say, the comparison has to behave as a ``code walker'', with respect
to two trees at the same time. It has to recognize all special syntactic
constructs, so that it can apply the right kind of comparison.

It also must be capable of performing variable renaming.

So for instance we might want these two to be found equivalent:

  (let ((x 1)) (+ x x))

  (let ((y 1)) (+ y y))

For thaat we have to recognize that we have two matching constructs
(both are ``let''). They both bind the same number of variables,
using the same initialization values. Next, we have to normalize
the bodies. We can do that by renaming the variables on each
side: e.g. both x and y get renamed to t0 (temporary variable #0).
Each time we rename a variable we generate a new temporary.
When we rename x to t0 and substitute, we end up with:

  (let ((t0 1)) (+ t0 t0))

And when we do the same substitution on the variable y on the second form we
of course also end up with:

  (let ((t0 1)) (+ t0 t0))

So now having done this substituion over the let, we can recursively process
the body of each let and continue comparing: we now end up comparing (+ t0 t0)
to (+ t0 t0). We have a positive match on the same symbol +, and we know that
it's a function call.  The two functions calls have the same number of
arguments, which we can compare one by one, finding an exact match in
ech position: the expression t0 trivially matches the expression t0.
Thus having reached bottom, we conclude that the two constructs are equivalent
(modulo variable naming).

This applies to the comparison of C programs too because for the C language,
you can pick this kind of tree representation with symbols and atoms.
Parse the code to that, and write a comparison which applies the right
kind of rules.

The question is the semantic depth that you want in the comparison.

Should the expression  !(!P || !Q) match P && Q, by the application of
De Morgan's law?

Does your equivalence function fold constant expressions, so that
2 + 2 matches 1 + 3?

There is a huge range of things you can do in between the most naive
static comparison (in which even differences in variable names do matter)
to running the program and trying to identify that it does the same things
to all inputs (running into the halting problem).


Now about implementing this. Turns out, the annoying part of parsing C to
structure is already done. For instance, there is this Japanese gentleman's
project called SC:

http://super.para.media.kyoto-u.ac.jp/~tasuku/sc/index-e.html

With this software, you would be able to just concentrate on writing the
equivalence function.
0
Kaz
12/22/2009 7:53:43 PM
On Dec 23, 12:05=A0am, Joe Beanfish <j...@nospam.duh> wrote:
> karthikbalaguru wrote:
> > Hi,
> > Two set of codes can be compared by using
> > beyond compare or other equivalent software
> > to determine the areas of differences and the
> > areas of similarities. But, there are scenarios
> > in which the same logic would be used by 2 set of
> > programs/softwares but that the variable names
> > might be different. So, how to determine this
> > without executing the program ? Is there any tool
> > that will help in identifying the existence of similar
> > logics in two different programs ? Any ideas ?
>
> As others say, it would be difficult at best to find dups. But a
> couple approaches that could help. One might be to run both codes
> through an obfuscator which would replace the programmer's meaningful
> variable names with generated names. Then compare. But there's still
> a lot of room for programming style to mess you up.
>

Agreed !

> A second approach would be to compile both to assembler and compare
> the assembler code. That should remove a fair amount of programmer
> style problems but not all.

Interesting approach ! I think, this is better than the earlier
approach. But, Need to know the kind of programmer style
problems that will not get covered by this second approach.
Any ideas ?

Thx in advans,
Karthik Balaguru
0
karthikbalaguru
12/27/2009 6:17:06 AM
On Dec 23, 12:53=A0am, Kaz Kylheku <kkylh...@gmail.com> wrote:
> On 2009-12-20, karthikbalaguru <karthikbalagur...@gmail.com> wrote:
>
> > Hi,
> > Two set of codes can be compared by using
> > beyond compare or other equivalent software
> > to determine the areas of differences and the
> > areas of similarities. But, there are scenarios
> > in which the same logic would be used by 2 set of
> > programs/softwares but that the variable names
> > might be different. So, how to determine this
> > without executing the program ? Is there any tool
> > that will help in identifying the existence of similar
> > logics in two different programs ? Any ideas ?
>
> The structural similarity you are hinting at can be easily found if you p=
arse
> the code into a nice abstract syntax tree representation. Then it's just =
a
> matter of writing an equality function which compares two pieces of code.
>
> This is easiest to understand and illustrate through the Lisp language.
>
> The comparison is similar to a routine that compares two trees, except th=
at it
> has to understand all ``special forms'' in the language, and their semant=
ics.
> That is to say, the comparison has to behave as a ``code walker'', with r=
espect
> to two trees at the same time. It has to recognize all special syntactic
> constructs, so that it can apply the right kind of comparison.
>
> It also must be capable of performing variable renaming.
>
> So for instance we might want these two to be found equivalent:
>
> =A0 (let ((x 1)) (+ x x))
>
> =A0 (let ((y 1)) (+ y y))
>
> For thaat we have to recognize that we have two matching constructs
> (both are ``let''). They both bind the same number of variables,
> using the same initialization values. Next, we have to normalize
> the bodies. We can do that by renaming the variables on each
> side: e.g. both x and y get renamed to t0 (temporary variable #0).
> Each time we rename a variable we generate a new temporary.
> When we rename x to t0 and substitute, we end up with:
>
> =A0 (let ((t0 1)) (+ t0 t0))
>
> And when we do the same substitution on the variable y on the second form=
 we
> of course also end up with:
>
> =A0 (let ((t0 1)) (+ t0 t0))
>
> So now having done this substituion over the let, we can recursively proc=
ess
> the body of each let and continue comparing: we now end up comparing (+ t=
0 t0)
> to (+ t0 t0). We have a positive match on the same symbol +, and we know =
that
> it's a function call. =A0The two functions calls have the same number of
> arguments, which we can compare one by one, finding an exact match in
> ech position: the expression t0 trivially matches the expression t0.
> Thus having reached bottom, we conclude that the two constructs are equiv=
alent
> (modulo variable naming).
>
> This applies to the comparison of C programs too because for the C langua=
ge,
> you can pick this kind of tree representation with symbols and atoms.
> Parse the code to that, and write a comparison which applies the right
> kind of rules.
>

Interesting. Agreed !

> The question is the semantic depth that you want in the comparison.
>

True !

> Should the expression =A0!(!P || !Q) match P && Q, by the application of
> De Morgan's law?
>
> Does your equivalence function fold constant expressions, so that
> 2 + 2 matches 1 + 3?
>
> There is a huge range of things you can do in between the most naive
> static comparison (in which even differences in variable names do matter)
> to running the program and trying to identify that it does the same thing=
s
> to all inputs (running into the halting problem).

Yeah. True !

> Now about implementing this. Turns out, the annoying part of parsing C to
> structure is already done. For instance, there is this Japanese gentleman=
's
> project called SC:
>
> http://super.para.media.kyoto-u.ac.jp/~tasuku/sc/index-e.html
>
> With this software, you would be able to just concentrate on writing the
> equivalence function.

Okay, I will look into this !

Thx,
Karthik Balaguru
0
karthikbalaguru
12/27/2009 7:10:16 AM
karthikbalaguru <karthikbalaguru79@gmail.com> writes:

> On Dec 23, 12:05�am, Joe Beanfish <j...@nospam.duh> wrote:
>> karthikbalaguru wrote:
>> > Hi,
>> > Two set of codes can be compared by using
>> > beyond compare or other equivalent software
>> > to determine the areas of differences and the
>> > areas of similarities. But, there are scenarios
>> > in which the same logic would be used by 2 set of
>> > programs/softwares but that the variable names
>> > might be different. So, how to determine this
>> > without executing the program ? Is there any tool
>> > that will help in identifying the existence of similar
>> > logics in two different programs ? Any ideas ?
>>
>> As others say, it would be difficult at best to find dups. But a
>> couple approaches that could help. One might be to run both codes
>> through an obfuscator which would replace the programmer's meaningful
>> variable names with generated names. Then compare. But there's still
>> a lot of room for programming style to mess you up.
>>
>
> Agreed !
>
>> A second approach would be to compile both to assembler and compare
>> the assembler code. That should remove a fair amount of programmer
>> style problems but not all.
>
> Interesting approach ! I think, this is better than the earlier
> approach. But, Need to know the kind of programmer style
> problems that will not get covered by this second approach.
> Any ideas ?

It's not just a question or programming style. You're at the semantics
of the programs.  The question is to compare the semantics of two
programs.  So you first have to represent the semantics of a program.
One way to do that would be to have a formal semantic definition of
the programming language, and to translate the programs into that
formalism,  and then compare thetheir formal semantics.
Unfortunately, not a lot of languages have a formal semantic
definition, and for most of the programming languages which have been
developed without such in mind, when one is developed for them, if it
is complete, then it is rather complex, giving formal semantic forms
that are not really more obvious than the original program (for
example, in the case of C).  In conclusion, for these kind of
programming language, the best way to express their semantics in a
formal way is to consider their compilation to some simplier
processor code, and then compare these codes.

Now of course when you compile these two programs:

(defun s1 (v) 
 (loop for e across v sum e))

(defun s2 (v)
  (do ((s 0)
       (i (1- (length v)) (1- i)))
      ((< i 0) s)
   (incf s (aref v i))))
     

you get two different listings, but you have to find a way to conclude
that they do exactly the same thing:

C/LISP[215]> (disassemble 's1)

Disassembly of function S1
(CONST 0) = 0
1 required argument
0 optional arguments
No rest parameter
No keyword parameters
19 byte-code instructions:
0     (CONST&PUSH 0)                      ; 0
1     (NIL&PUSH)
2     (CONST&PUSH 0)                      ; 0
3     (JMP L19)
5     L5
5     (LOAD&PUSH 4)
6     (LOAD&PUSH 3)
7     (CALLSR&STORE 1 1 1)                ; AREF
11    (LOAD&PUSH 0)
12    (LOAD&PUSH 2)
13    (CALLSR&STORE 2 53 0)               ; +
17    (LOAD&INC&STORE 2)
19    L19
19    (LOAD&PUSH 2)
20    (LOAD&PUSH 5)
21    (CALLS2&PUSH 72)                    ; LENGTH
23    (CALLSR&JMPIFNOT 1 50 L5)           ; >=
27    (POP)
28    (SKIP&RET 4)
NIL
C/LISP[216]> (disassemble 's2)

Disassembly of function S2
(CONST 0) = 0
1 required argument
0 optional arguments
No rest parameter
No keyword parameters
17 byte-code instructions:
0     (CONST&PUSH 0)                      ; 0
1     (LOAD&PUSH 2)
2     (CALLS2&PUSH 72)                    ; LENGTH
4     (CALLS2&PUSH 152)                   ; 1-
6     (JMP L20)
8     L8
8     (LOAD&PUSH 1)
9     (LOAD&PUSH 4)
10    (LOAD&PUSH 2)
11    (CALLSR&PUSH 1 1)                   ; AREF
14    (CALLSR&STORE 2 53 1)               ; +
18    (LOAD&DEC&STORE 0)
20    L20
20    (LOAD&PUSH 0)
21    (CALLS2&JMPIFNOT 148 L8)            ; MINUSP
24    (LOAD 1)
25    (SKIP&RET 4)
NIL


The semantics of assembly is not more obvious than the semantics of
high level programming languages.  The reason why you will work with
assembly is not that (otherwise we would keep programming in
assembly!).  The point of assembly, is that the instructions are
simplier: their semantics is simplier.  Therefore it is easier for
programs to work with it.  You want to compare semantics, then it's
simplier to compare the semantics of simplier instructions.  However,
you still have a lot of work to do, even if each step of this work
will be simplier.  But it is possible to infer mechanically from both
these assembly codes that each element of the vector is read, and
summed, and that the sum is returned by the function.  Therefore that
these two functions are equivalent semantically.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
0
pjb
12/27/2009 12:39:25 PM
In article <87fx6wmvym.fsf@hubble.informatimago.com>,
Pascal J. Bourguignon <pjb@informatimago.com> was apparently confused
about which newsgroup he was in when he wrote:
....
>Now of course when you compile these two programs:
>
>(defun s1 (v) 
> (loop for e across v sum e))
>
>(defun s2 (v)
>  (do ((s 0)
>       (i (1- (length v)) (1- i)))
>      ((< i 0) s)
>   (incf s (aref v i))))

(Channelling our good friend Kiki, who is so good at pointing out the
obvious)

Lisp and C are two different languages.

0
gazelle
12/27/2009 1:17:14 PM
Reply:
Similar Artilces:

randomly generate n of each of two types
I need access to 2*n random choices for two types subject to a constraint that in the end I have drawn n of each. I first tried:: def random_types(n,typelist=[True,False]): types = typelist*n random.shuffle(types) for next_type in types: yield next_type This works but has some obvious costs. To avoid those I considered this instead:: def random_types(n,typelist=[True,False]): type0, type1 = typelist ct0, ct1 = 0,0 while ct0+ct1<2*n: if random.random() < ((n-ct0)/(2*n-ct0-ct1)): next_type = type0 ct0 += 1 else: ...

Two-NIC, two-gateway setup
We have a setup in a colocation facility with a server running Windows 2003 (Web Edition) and a Netscreen-5GT firewall/VPN. The Windows machine has two network cards, one of which is plugged directly to the Internet, the other of which is plugged into the Netscreen. Here is a diagram: ___ Key: ------------------ NIC1| | NS = Netscreen-5GT FW / | | W = W2K3 server Internet | W | NIC1 = 1st NIC (live net) \ | | NIC2 = 2nd NIC (private net) ...

Mainframe SAS program sample
Can someone publish here a sample of SAS mainframe program? I worked with a maiframe SAS long time ago and want to prepare for an interview. Thanks, Zalek ...

How to just plot the intersection of two regions?
Sorry, I post this message again because I really need know if there is a solution in MATLAB about the following question. ------------------------------------ It is easy to overlay(that is, union) two graphs in MATLAB. Who knows how to just plot the intersection area of two graphs in MATLAB? Is there a built-in function that we can use? This question comes from that I have a contour plot, which is a rectangle. But I want to plot just a part of a contour that is restricted by a circle or an ellipse (anyway, the boundary is known). Jack ...

Keeping two lists aligned after processing #2
""" I have a population of five algorithms. Each Alg has a method, Alg.accuracy(), which calculates its accuracy. Running the accuracy method on each Alg, I end up with a list of accuracies like [0.75, 0.10, 0.45, 0.80, 0.45] Now I want to store the algorithms and associated accuracies in a file, in descending order of accuracy. Here's how I do it now. There must be a better way! This method is inelegant, and does not handle at all the issue of what to do with duplicate accuracies, such as the two different algorithms with 0.45 accuracies in the example above. It merely sa...

Two-column layout
Hi! I am experiencing a problem with a two-column layout -- apparently I am not the first person, but the solutions I found in GG did not give me what I was looking for. The page should be as follows: ................................ .. +----------+-------+ . .. I Logo + sloganI . .. +----+-----+-------+ . .. I I I . .. I N I I . .. I I content I . .. +----+ I . .. I I . .. I I . .. I I . .. +-----...

Hotsyncing two PDAs on one PC?
My wife has a Sony Clie, which she hotsyncs on our HP. I want to get a PDA myself. Do PDAs come with something akin to a signature so that desktops can distinguish one handheld from the next? To minimize frustration, should I by default stick with the same brand already on my PC? Would we be able to share a cradle? i am syncing a TT and a T2 to my pc. as long as you call them something different then you are ok. you can also chose which pda to install new software to by chosing which name in the drop down list. so i assume that you can get different make pda's as well &qu...

Compiling wxWindows program as static
Hi, Im trying to compile my application as static, but without good results. Im trying doing: `wx-config --static --libs --gl-libs` It compiles, in fact the binary file is bigger, mas but on execution does: Segmentation fault With the flag -static in g++ does: /usr/lib/libgmodule.a(gmodule.o)(.text+0x42): In function `_g_module_open': : warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking /usr/lib/libwx_gtk-2.4.a(utilsunx.o)(.text+0x1221): In function `wxGetUserHome(wxString const...

Final CFP: Workshop on Generic Programming (WGP) 2014
Apologies for multiple postings. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D CALL FOR PAPERS WGP 2014 10th ACM SIGPLAN Workshop on Generic Programming Gothenburg, Sweden Sunday, August 31, 2014 http://www.wgp-sigplan.org/2014 Co-located with t...

what has python added to programming languages? (lets be esoteric, shall we ;)
Over the time I've seen lots of remarks about python that read like "a lot like lists in lisp" or "like the hashtable in java" or any other form of "like <feature> in <language>". Are there any concepts that python has not borrowed, concepts that were not even inspired by other languages? I'm just interested if it is "merely" a best-of collection of language features or if there are actually inventions that have not - or hardly - existed in programming before python? wildemar Wildemar Wildenburger wrote: > Over the time I&...

calling other programs
hi, can you tell me any function that can call other programs within my program? something like: CallProg("rar", "a -s -md4096); i need something that can call progs with parameters/arguments thanks in advance Gizmo wrote: > hi, >=20 > can you tell me any function that can call other programs within my > program? > something like: CallProg("rar", "a -s -md4096); >=20 > i need something that can call progs with parameters/arguments Simplest is system(3), but it accepts only a single command string. More elaborate is fork...

Re: A list of compression programs and their algorithms?
>Where can I find a list of compression programs and what algoritm >does each program use? Can you help me? Have a look at: http://compression.graphicon.ru/ybs/arc.htm http://www.maximumcompression.com/programs.php ...

US-KA-Kansas City: APP PROGRAMMING, Java, WSAD, Unix, Korn Shell, 6mo+ (45354233441)
US-KA-Kansas City: APP PROGRAMMING, Java, WSAD, Unix, Korn Shell, 6mo+ (45354233441) ====================================================================================== Position: APP PROGRAMMING Reference: ZYD00095 Location: Kansas City KA Duration: 6M Skills: IBM VisualAge for Java 3.5.3 with Envy repository Unix (Solaris), Korn Shell BEA Weblogic 6.1 sp6 and 8.1 sp2 ANT WSAD 5.1 / RAD 6.0 CM Synergy Scope: Maintain multiple code branches Since the c...

Two instances?
Folks, Consider a single machine (Sun V480/Solaris 10) running Oracle 10g. Two parties are interested in cooperating (one brings the machine, the other brings the Oracle license). Disk space (>500 GB) is more than enough for both. Memory (16 GB) is more than enough for both. There are no common users. There are no common applications. There are no common schemas. There will be separate administration with possibly separate DBAs. Each party will have several schemas (total of 10 - 20 schemas). Three of one party's schemas each have in excess of 1000 tables and 1000 stored procedu...

compare two databases
there is any utility or command for compare two databases, tables structure (schema). ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) Maybe you can use : pg_dump -s -t Thetable firstdatabasename > first pg_dump -s -t Thetable seconddatabasename > second diff first second Bruno Ashok Chauhan wrote: >there is any utility or command for compare two databases, >tables structure (schema). > > &...

Comparing two sets of data
I have the following situation. One set of data has 274 rows (set2) and anther has 264 (set1). Both data sets are similar in structure as well as values for both of them were extracts from the same parent table. Hope the info would substitute DDL. I need to find the "gap" rows between these two sets. Attempted to run a query like select count(*) from set2 where not exists (select * from set1) did not yield what I desired. What else to try? TIA. NickName wrote: > I have the following situation. One set of data has 274 rows (set2) > and anther has 264 (set1). Both data ...

My first Python program -- a lexer
Hello, I started to write a lexer in Python -- my first attempt to do something useful with Python (rather than trying out snippets from tutorials). It is not complete yet, but I would like some feedback -- I'm a Python newbie and it seems that, with Python, there is always a simpler and better way to do it than you think. ### Begin ### import re class Lexer(object): def __init__( self, source, tokens ): self.source = re.sub( r"\r?\n|\r\n", "\n", source ) self.tokens = tokens self.offset = 0 self.result = [] self...

How to compare two datasets, or retrieve data
Hi SAS-Ls, I have a large dataset A, and a small dataset B. I need to compare dataset B and dataset A, if A inclues B, then in B the new variable will be coded 'yes', others in B, will be coded as 'no'. In A, it includes the same data multi-times, so I use ID and a date to find if the B's data are in A datasets. I did use 'merge' by dataset B, but after merging, alway some multi-data were merged to the B, and B has more data then it has before the merge. Could someone help me on code this problem. Datasets A ID var1 1 12/12/02 1 11/...

Socket Programming in Python
For the uninitiated: "Socket Programming in Python" at evolt.org: http://evolt.org/article/Socket_Programming_in_Python/17/60276/index.html ===== -Premshree [http://www.qiksearch.com/] ________________________________________________________________________ Yahoo! India Insurance Special: Be informed on the best policies, services, tools and more. Go to: http://in.insurance.yahoo.com/licspecial/index.html Premshree Pillai wrote: > For the uninitiated: "Socket Programming in Python" at > evolt.org: http://evolt.org/article/Socket_Programming_in_Python/17/60276/ind...

US-TX-Austin: Application Programming, Web Apps, COM/COM+, 2.5 years. (45351757602)
US-TX-Austin: Application Programming, Web Apps, COM/COM+, 2.5 years. (45351757602) =================================================================================== Position: Web Developer Reference: ZYD00026 Location: Austin TX Duration: 6 mos. (Extensions to 2.5 yrs) Skills: System design and development projects Web applications Web applications with COM/COM+, Java scripting, HTML and IIS Use of generally accepted software development methodology Software testing/QA Windows ...

TkTable
Hi! I am using TkTable right now (90 rows and 45 columns). I am thinking two implement 2 vertical scrollbars and two horizontal scrollbars in my table? Can somebody help me? Thank you very much! ukhereicome@yahoo.com wrote: > Hi! > > I am using TkTable right now (90 rows and 45 columns). I am thinking > two implement 2 vertical scrollbars and two horizontal scrollbars in > my table? > > Can somebody help me? Thank you very much! > You're going to have to be more specific. Why do you need two vertical scrollbars? Why won't one work for you? What will the...

programmed agents
Client Lotus notes 4.6. i want to program an agent to execute every hour. i jus activate local agents programmed in configuration and, i configure the agent to execute programatically. But nothing occurs. Some idea? Thanks The agent has to be signed by the same id that is running it. John Aylmer "kintango" <kintango@terra.es> wrote in message news:3F69AC52.4010104@terra.es... > Client Lotus notes 4.6. > > i want to program an agent to execute every hour. > > i jus activate local agents programmed in configuration and, i configure >...

FMCO 2004: program and last cfp
Our apologies if you receive multiple copies of this e-mail. ****************** LAST CALL FOR PARTICIPATION ******************** Third International Symposium on Formal Methods for Components and Objects (FMCO 2004) DATES 2 - 5 November 2004 PLACE Lorentz Center, Leiden University, Leiden, The Netherlands Registration form and more information at the FMCO site http://fmco.liacs.nl/fmco04.html PROGRAM TUESDAY 2nd, November 2004 8:45 - 9:00 Welcome 9:00 - 10:00 Keynote: Robin Milner (Cambridge University,...

authority for domains: how to verify from program?
Hello, I'd like to use bind API in my program to obtain a list of zones the server is authorative for (let is be the server where program is running). Are there any functions (bind8 preferable)? -- Roman In article <dog0ii$2kag$1@sf1.isc.org>, Roman Mashak <romez777@gmail.com> wrote: > Hello, > > I'd like to use bind API in my program to obtain a list of zones the > server is authorative for (let is be the server where program is > running). > Are there any functions (bind8 preferable)? The only API that BIND comes with is a r...

how to see the detailed running process of matlab program?
Hey guys: I have one question now. I have a long long program and a lot of loops inside the program. It may take the whole night to run the program. When the program stop, I want to see the whole process of the program. However, I printed the whole thing and suddenly found that it only gave me the lastest 150 pages. It's not enough for me. How can I see the whole thing, maybe it's thousands of pages. Thanks Best Regards Yi "Yi" <hvachy@163.com> wrote in message <glcnm2$hgj$1@fred.mathworks.com>... > Hey guys: > > I have one question now. I have a lon...