[28735] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 10099 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 27 11:06:09 2006

Date: Wed, 27 Dec 2006 08:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 27 Dec 2006     Volume: 10 Number: 10099

Today's topics:
    Re: BEST PERL BOOK FOR SYSTEM ADMINISTRATION UNIX <tzz@lifelogs.com>
    Re: BEST PERL BOOK FOR SYSTEM ADMINISTRATION UNIX <tzz@lifelogs.com>
    Re: Blather-Adjusting Programs <hmessinger.removethis@comcast.net>
    Re: Blather-Adjusting Programs <grammatim@verizon.net>
        Date::Calc and postgres timestamp jeff_jones_101@yahoo.com
    Re: HTTP POST without LWP <pratap.ram@gmail.com>
    Re: HTTP POST without LWP <zentara@highstream.net>
    Re: HTTP POST without LWP <Peter@PSDT.com>
    Re: Perl equivalent to the following shell operation. <daveandniki@ntlworld.com>
        Perl, ADSI And Computer Groups salantami@gmail.com
        Use of Java script to validate form fields in Perl <kunanu@gmail.com>
    Re: Use of Java script to validate form fields in Perl <tadmc@augustmail.com>
    Re: Xah's Edu Corner: Introduction to 3D Graphics Progr <xah@xahlee.org>
    Re: Xah's Edu Corner: Introduction to 3D Graphics Progr <CANCELLAdellaver@hotmail.it>
    Re: Xah's Edu Corner: Introduction to 3D Graphics Progr <webraviteja@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 27 Dec 2006 10:02:07 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: BEST PERL BOOK FOR SYSTEM ADMINISTRATION UNIX
Message-Id: <g698xgt8jrk.fsf@dhcp-65-162.kendall.corp.akamai.com>

On 24 Dec 2006, puckdropper@yahoo.com wrote:

> Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr> wrote in news:458e7852
> $0$27366$ba4acef3@news.orange.fr:
>
>
>> People still measure application size in terms of lines of code?
>
> Sure, what other metric is common to programs that's easily
> measured?

Function points, man-hours and money spent, number of curse words in
the comments, weight of documentation... :)

> It's bad, but it's the best they've got.  I had probably 1000 LOC in a
> recent class project and probably wrote only 100 myself.  Everything else 
> was done by a GUI builder or by the UML tool I used.  (It was Java, not 
> Perl, but I constantly wished it was Perl.  Does that count as on topic 
> here? ;-))

Note that such automatically generated code will still have to exist
within your application, and some day it will throw a mysterious
error you'll have to debug.  So it's definitely a part of your LOC
count.

Ted


------------------------------

Date: Wed, 27 Dec 2006 10:10:36 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: BEST PERL BOOK FOR SYSTEM ADMINISTRATION UNIX
Message-Id: <g694prh8jdf.fsf@dhcp-65-162.kendall.corp.akamai.com>

On 24 Dec 2006, jwkenne@attglobal.net wrote:

> I seem to recall that, back in the 60s or 70s, someone did a study and
> discovered that LOCs actually was a pretty decent metric, even
> cross-language. From one language to another, one LOC seemed to take
> up about the same average amount of planning, debugging, etc.

Scripting languages like Perl, Python, etc. definitely break this
rule.  I'd say the ratio is 5-20 LOC in C to 1 LOC in Perl, depending
on the skill of the programmer and the actual application.

The "lines of comments" count, however, is about 3 to 1 for proper
documentation IMO.

Ted


------------------------------

Date: Wed, 27 Dec 2006 09:00:13 -0500
From: Harlan Messinger <hmessinger.removethis@comcast.net>
Subject: Re: Blather-Adjusting Programs
Message-Id: <4vfckqF1c3lbcU1@mid.individual.net>

vjp2.at@at.BioStrategist.dot.dot.com wrote:
>    I have seen programs which can be called "proof of concept".  I'm not as
> familiar with natural language processing, though I have seen many
> unfulfilled promises about it.  (What I most need it to do is take the prose
> of heavily filtered press releases and simplify entering its valuable info
> into my contact manager.)  Usually it takes a few generations, usually three
> for a type of program to go from "proof of concept" to "production". 
> Microsoft Beijing has developed search engines that can determine the 
> user's gender from the structure of the query. 

Men and women have different ways of typing "Paris Hilton"?
> 
>    I genuinely do seek a tool to ease my having to deal with pompous people
> who refuse to accept simple language, but go out of their way to demand
> pompous blather. Such people do exist, and unfortunately their number is
> growing rapidly (which admittedly bodes ill for our national productuvity).

While we often depend on second-hand reports of what someone has written 
or said because the originals often contain details that we don't need 
and we just want a summary. But everyone knows that this isn't as 
reliable as the first-hand document, and if we need the details, and we 
want to be sure there were no distortions in the interpretation, we need 
to go to the original. But you're willing to rely on a *machine's* 
interpretation of what someone else has written rather than read the 
original yourself because the original is annoying and you don't want to 
have to think about it too hard?


------------------------------

Date: 27 Dec 2006 06:48:56 -0800
From: "Peter T. Daniels" <grammatim@verizon.net>
Subject: Re: Blather-Adjusting Programs
Message-Id: <1167230936.737656.317620@48g2000cwx.googlegroups.com>


vjp2.at@at.BioStrategist.dot.dot.com wrote:
> I have seen programs which can be called "proof of concept".  I'm not as
> familiar with natural language processing, though I have seen many
> unfulfilled promises about it.  (What I most need it to do is take the prose
> of heavily filtered press releases and simplify entering its valuable info
> into my contact manager.)  Usually it takes a few generations, usually three
> for a type of program to go from "proof of concept" to "production".
> Microsoft Beijing has developed search engines that can determine the
> user's gender from the structure of the query.
>
>    I genuinely do seek a tool to ease my having to deal with pompous people
> who refuse to accept simple language, but go out of their way to demand
> pompous blather. Such people do exist, and unfortunately their number is
> growing rapidly (which admittedly bodes ill for our national productuvity).
>
> *+-a rwnc who frequently posts off-topic political assertions at
>
> That's the New Gorista Way of explaining away "inconvenient" opponents..
>
> So much for their believing in free speech..
>
> I always asserted privacy and free speech are mutually exclusive,
> and such people seem determined to prove me correct..

Political assertions are off-topic at nyc.transit, and queries about AI
are off-topic at sci.lang.

I don't know what a New Gorista, or even an Old Gorista, is.



------------------------------

Date: 27 Dec 2006 06:50:39 -0800
From: jeff_jones_101@yahoo.com
Subject: Date::Calc and postgres timestamp
Message-Id: <1167231038.943941.243690@f1g2000cwa.googlegroups.com>

Dear all,

I'd little a little hint on date comparison using Date::Cal module.

I take the first date from a postgres db where the field is declared
as:
created               | timestamp(6) without time zone |
Selecting through DBI I receive a date in the form of
2006-12-14 16:08:39

The second one is a a Date::Calc

my ($y,$m,$d,$H,$M,$S) = Add_Delta_DHMS(Today_and_Now(),120,0,0,0);

I grasp a bit in Date:Calc documentation but I've not found a way to
convert the first in a delta vector, which I think it is the only way
Date:Calc could compare the the two dates.

How can I compare these two date type ? 

Thanks



------------------------------

Date: 27 Dec 2006 00:22:54 -0800
From: "pratap" <pratap.ram@gmail.com>
Subject: Re: HTTP POST without LWP
Message-Id: <1167207774.181312.60330@48g2000cwx.googlegroups.com>

> Doubtful. You can always install the module in a user specific location,
> together with your script.

The reason I LWP is not available in that computer is that, I do not
have disk space :( LWP+dependancy is quite massive.

-Pratap

John Bokma wrote:
> "pratap" <pratap.ram@gmail.com> wrote:
>
> > Hi,
> >
> > I am trying to write a script to do a HTTP POST. So, I tried doing it
> > using LWP and it worked. The problem is, the computer in which I will
> > be running this code cannot not have LWP.
>
> Doubtful. You can always install the module in a user specific location,
> together with your script.
>
> --
> John                Experienced Perl programmer: http://castleamber.com/
>
>           Perl help, tutorials, and examples: http://johnbokma.com/perl/



------------------------------

Date: Wed, 27 Dec 2006 07:12:07 -0500
From: zentara <zentara@highstream.net>
Subject: Re: HTTP POST without LWP
Message-Id: <1jo4p2d7qnhd7difkjafa272vl6nqs84h6@4ax.com>

On 26 Dec 2006 15:07:36 -0800, "pratap" <pratap.ram@gmail.com> wrote:

>Hi,
>
>I am trying to write a script to do a HTTP POST. So, I tried doing it
>using LWP and it worked. The problem is, the computer in which I will
>be running this code cannot not have LWP. So, I have to do it without
>LWP. So, I can think of a couple of options that I have,
>
>1. I can write the "HTTP POST" code using sockets ... which I assume
>would take a lot of time to make the packets (or is it simply
>$sock->send("POST http://a.com/abc.php in1=val1&in2=val ") or some
>such?).
>
>2. I can run LWP in another computer (with LWP) and take a "packet
>dump" like ToString of the Object, and pass this information to the
>actual machine. But I do not know how to do this.
>
>I am a newbie so any help or suggestions for the above would be great.
>Thanks a lot.
>-Pratap

For a pure socket web get, see:
http://perlmonks.org?node_id=392209


Here is a POST for file upload:
(Don't ask me to explain it, figure it out,
or don't use it :-) )

#!/usr/bin/perl
use warnings;
use strict;
use Socket;

my $url  = "http://zentara.zentara.net/~zentara/cgi-bin/up1.cgi";

my $upfile = shift || 'ztest.png';

my $host = "zentara.zentara.net";
$| = 1;

my $start = times;
my ( $iaddr, $paddr, $proto );
$iaddr = inet_aton($host);
#$iaddr = ( gethostbyname($host) )[4];
$paddr = sockaddr_in( 80, $iaddr );
$proto = getprotobyname('tcp');
unless ( socket( SOCK, PF_INET, SOCK_STREAM, $proto ) ) {
    die "ERROR : init socket: $!";
}
unless ( connect( SOCK, $paddr ) ) { die "no connect: $!\n"; }

my $length = 0;

open (UH,"< $upfile") or warn "$!\n";
$length +=  -s UH;

my @head = (
"POST /~zentara/cgi-bin/up1.cgi HTTP/1.1",
"Host: zentara.zentara.net",
"User-Agent: z-uploader",
"Content-Length: $length",
"Content-Type: multipart/form-data; boundary=zzzzzzzzzzzzzzzzzzz",
"",
"--zzzzzzzzzzzzzzzzzzz",
"Content-Disposition: form-data; name=\"file\"; filename=\"$upfile\"",
"Content-Type: application/octet-stream",
"",
"",
);
#try to get total length
my $header = join( "\r\n", @head );
$length += length($header);
$head[3] = "Content-Length: $length";  #2472
$header = join( "\r\n", @head );
$length =  -s UH;
$length += length($header);

select SOCK;
$| = 1;
binmode SOCK;

print SOCK $header;

while( sysread(UH, my $buf, 8196 ) ){

    if( length($buf) < 8196 ){
           $buf = $buf."\r\n--zzzzzzzzzzzzzzzzzzz--";
           syswrite SOCK, $buf, length($buf);
 	 }else{ syswrite SOCK, $buf, 8196 }
    print STDOUT '.',
 }
close UH;    

shutdown SOCK, 1;  

my @data = (<SOCK>);
print STDOUT "result->@data\n";
close SOCK;

__END__




-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


------------------------------

Date: Wed, 27 Dec 2006 12:56:01 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: HTTP POST without LWP
Message-Id: <pan.2006.12.27.12.55.10.314228@PSDT.com>

On Wed, 27 Dec 2006 00:22:54 -0800, pratap wrote:
>> Doubtful. You can always install the module in a user specific location,
>> together with your script.
> 
> The reason I LWP is not available in that computer is that, I do not
> have disk space :( LWP+dependancy is quite massive.

You've got to be kidding.  The only modules required by LWP that are not
already in perl 5.8.8 are URI and HTML::Parser, which in turn requires
HTML::Tagset.  The space they require:

$ du -sk {HTML-Tagset-3.10,HTML-Parser-3.55,URI-1.35,libwww-perl-5.805}/\
blib/{arch,bin,lib,script} \
|& perl -nle '/^(\d+)\s/ and $s += $1; END{ print $s }'
1996

You don't have room for another 2 MB?

OTOH:

$ du -sk /usr/local/lib/perl5/5.8.8/
36528   /usr/local/lib/perl5/5.8.8/

Perl itself these days is eighteen times the size of what you need. 
Yet you have it.  How can you be that hard up for disk space and still
expect web-fetching programs to work?

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/



------------------------------

Date: Wed, 27 Dec 2006 10:09:11 +0100
From: "Dave" <daveandniki@ntlworld.com>
Subject: Re: Perl equivalent to the following shell operation.
Message-Id: <45923841$0$27396$ba4acef3@news.orange.fr>


"grocery_stocker" <cdalten@gmail.com> wrote in message 
news:1167196566.656836.31470@f1g2000cwa.googlegroups.com...
>
> grocery_stocker wrote:
>> I'm analyzing a really large file. While I was bringing in carts at
>> work, I figured it would be easier/more efficient just to split the
>> file, sort it in parallel, then merge it. If I wrote a shell script, I
>> would do something like the following:
>>
>> #This code is duped from a google search
>> (cat list1 list2 list3 | sort | uniq > list123) &
>> (cat list4 list5 list6 | sort | uniq > list456) &
>>
>> wait
>>
>> diff list123 list456
>>
>> However, I'm writing this in Perl because it would be easier to sort
>> the file using the Schwartzian Transform method. Is there an equivalent
>> in Perl or would I have to use some kind of existing Perl mod?
>>
>> Chad
>
> Never mind. I entered the world 'parallel' in the search box thingy and
> google magically turned up the answer.
>

I'm not sure why use say it 'would be easier to sort the file using the 
Schwartian Transform method'. This method does not make it easier, in fact 
it makes the code more complex that simply sorting, but with the advantage 
of efficiency where re-calculating values is involved at each comparison. 
This would not be the case in the simple sort above.




------------------------------

Date: 27 Dec 2006 05:58:04 -0800
From: salantami@gmail.com
Subject: Perl, ADSI And Computer Groups
Message-Id: <1167227884.424049.128010@48g2000cwx.googlegroups.com>

How Can I Obtain all the Domain Groups the given Computer Belongs To?

Ofcourse using Perl :)



------------------------------

Date: 27 Dec 2006 01:06:55 -0800
From: "Kuna" <kunanu@gmail.com>
Subject: Use of Java script to validate form fields in Perl
Message-Id: <1167210415.117221.51270@79g2000cws.googlegroups.com>

Hi All,

I am trying to use Java script to validate the form fields. The code is
written in Perl and it is having a .pm extension for this form also
there is a index.pl file which is containing the "Save" button and the
form is posting the data to index.pl file and then it again comes to
the methods written in the .pm file which is validating the form using
server side code and submit that. But I am not able to get that where
to do the Java script validation that will validate the form in the
client side. Here I am having some codes that will give some idea about
my form.

<code>
print "<body>
   <table width='100%'  border='0' cellspacing='0' cellpadding='0'>
    <tr>
    <td width='22%' height='18'><img src='./images/logo_mmna.jpg'
width='227' height='57'></td>
    <td width=''3%'>&nbsp;</td>
    <td width='49%'>&nbsp;&nbsp;&nbsp;&nbsp;
      <div align='center'  class='v10b'><span class='style3'>"
      . $self->getText("NOTICE OF DESIGN PROCESS CHANGE") .
"</span><br>
    </div></td>
    <td width='26%' valign='top'><table width='100%'  border='0'
cellspacing='0' cellpadding='0'>
      <!--DWLayoutTable-->
      <tr>
        <td height='18' colspan='3'>&nbsp;</td>
      </tr>
      <tr>
        <td width='20%' height='18' class='v10b'><label>"
      . $self->getText("Date:") . " </label></td>
        <td width='17%'>";
    print hidden(
        -name     => '.formId',
        -value    => '4MChange',
        -tabindex => '-1',
        -override => 1
    );
    print textfield(
        -name     => 'txt-date',
        -value    => $self->retSysTime,
        -id       => 'txt-date',
        -class    => 'formelements',
        -size     => '10',
        -title    => 'Today\'s date',
        -tabindex => $tabindex
    ).'*';

    foreach my $thisLabel (@singleEntryFields) {
        $result->{$thisLabel} = textfield(
            -name  => sprintf( "txt-%s", $thisLabel ),
            -value => $data{$thisLabel},
            -id    => sprintf( "txt-%s", $thisLabel ),
            -class => ( $errLabel eq $thisLabel )
            ? 'formmsg'
            : 'formelements',
            -size  => $sizeHash{$thisLabel},
            -title => $titleHash{$thisLabel},
            -force => 1
        );
    }

    print "<td>
        <td height=\"10\" colspan=\"3\"><img src=\"/images/spacer.gif\"
width=\"5\" height=\"8\"></td>
        </tr>
      <tr>
        <td height=\"18\"></td>
        <td colspan=\"2\">&nbsp;</td>
      </tr>
    </table></td>
    </tr>
    <tr>
      <td height=\"18\" colspan=\"4\">&nbsp;</td>
    </tr>
    <tr valign=\"top\">
    <td height=\"14\" colspan=\"4\"><div align=\"left\"
class=\"v10b\"><label>"
      . $self->getText('* indicates a field is required')
      . "</label></div>";
    print p();
    print
"<table width=\"100%\"  border=\"0\" cellpadding=\"0\"
cellspacing=\"0\" bgcolor=\"#E9E9E9\">
      <tr>
        <td width=\"35%\" valign=\"top\"><table width=\"100%\"
border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\">
          <tr>
            <td width=\"22%\"><div align=\"right\"
class=\"v10b\"><label>"
      . $self->getText("Supplier Name") . "</label>:&nbsp; </div></td>
            <td width=\"20%\">";
    $tabindex++;
    print $result->{'sname'}.'*';
    print "</td>
          </tr>
          <tr>
            <td colspan='2'><img src='/images/spacer.gif' width='5'
height='8'></td>
            </tr>
          <tr>
            <td><div align='right' class='v10b'><label>"
      . $self->getText("Supplier Code:") . "</label>&nbsp;</div></td>
            <td align ='left'>";
    $tabindex++;

    print $result->{'scode'}.'*';
    print "</td>
      </tr>
        </table></td>
        <td width='35%' valign=\"top\">
	<table width='100%'  border='0' align='left' cellpadding='0'
cellspacing='0'>
          <tr>
          <td width='28%'><div align='right' class='v10b'><label>"
      . $self->getText("Supplier Contact:") . "&nbsp;</label>
</div></td>
    <td width='14%'>";
    $tabindex++;

    print $result->{'scontact'}.'*';
    print "</td>
      </tr>
          <tr>
            <td colspan='2'><img src='/images/spacer.gif' width='5'
height='8'></td>
          </tr>
          <tr>
            <td><div align='right' class='v10b'><label>"
      . $self->getText("Supplier Fax:") . "&nbsp;</label></div></td>
            <td align='left'>";
    $tabindex++;

    print $result->{'sfax'}.'*';
    print "</td>
      </tr>
        </table></td>
        <td width='30%' valign=\"top\">
</code>

This the form in the .pm file and in the index.pl is having the button
as below:

<code>
if ( param() ) {

	$act    = $cgi->param('act')    || "preprocess";
	$button = $cgi->param('button') || 'Save';
	$no     = ( defined $cgi->param('.no') ) ? ( $cgi->param('.no') ) :
$defaultNo;
	$tloc    = $cgi->param('.tloc');
	$tsvData = $cgi->param('data');
	my $error;
	$formId =
	  ( defined $cgi->param('.formId') ) ? $cgi->param('.formId') :
$formId;
	my $ev = sprintf
	  'use ACI::WebForms::Form%s; $thisform = new
ACI::WebForms::Form%s();',
	  $formId, $formId;
	if ( !eval $ev ) {
		die $@;
	}
<./code>

So what I am not able to get that since I am new to Perl, so I am not
getting any <form> tag where I can use the Java script call. Also I am
not getting any solution where to add the Java script that will take
the form input data and validate it.

Sorry if I had missed any information....Please look into this I need a
urgent help.......

Thanks and Regards,
Kuna



------------------------------

Date: Wed, 27 Dec 2006 05:47:15 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Use of Java script to validate form fields in Perl
Message-Id: <slrnep4na3.bnp.tadmc@tadmc30.august.net>

Kuna <kunanu@gmail.com> wrote:

> I am trying to use Java script 


I doubt that.

I expect you are trying to use JavaScript.


> to validate the form fields. The code is
> written in Perl and it is having a .pm extension for this form also
> there is a index.pl file which is containing the "Save" button and the
> form is posting the data to index.pl file and then it again comes to
> the methods written in the .pm file which is validating the form using
> server side code and submit that. But I am not able to get that where
> to do the Java script validation that will validate the form in the
> client side. 


You must rewrite the .pm routines in JavaScript, then from Perl
you print() the JavaScript code at the appropriate place.


>             -name  => sprintf( "txt-%s", $thisLabel ),


It is an abuse to use s(tring)printf(ormated) when you are not
applying any formatting.

    -name  => "txt-$thisLabel",


> 	$formId =
> 	  ( defined $cgi->param('.formId') ) ? $cgi->param('.formId') :
> $formId;


That is a strange way to say:

   $formId = $cgi->param('.formId') if defined $cgi->param('.formId');


> 	my $ev = sprintf
> 	  'use ACI::WebForms::Form%s; $thisform = new
> ACI::WebForms::Form%s();',
> 	  $formId, $formId;


If the module is designed to be used this way, then it is very
poorly designed.


> 	if ( !eval $ev ) {
> 		die $@;
> 	}


Using that form of eval() is very very dangerous!

You had better add some taint checking (perldoc perlsec) or
prepare to be hacked.


> So what I am not able to get that since I am new to Perl, 


The only piece of Perl knowledge that you need to accomplish this
is how to use the print() function.

You need JavaScript knowledge to know what you want to print().


> Please look into this I need a
> urgent help.......


Pleading is counter-productive.

Have you seen the Posting Guidelines that are posted here frequently?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 27 Dec 2006 00:33:19 -0800
From: "Xah Lee" <xah@xahlee.org>
Subject: Re: Xah's Edu Corner: Introduction to 3D Graphics Programing
Message-Id: <1167208399.089326.213540@a3g2000cwd.googlegroups.com>

Dear Jon Harrop,

Thanks for the informative reply.

I don't know OpenGL, but i think it is a low-level crap, and have done
the industry huge irreparable damage the same way unix has.

This wikipedia excerpt from
http://en.wikipedia.org/wiki/QuickDraw_3D
summarize my sentiment:

=C2=ABMost 3D toolkits concentrate on the lowest levels of the 3D rendering
pipeline...

For instance, the OpenGL system consists primarily of a system for
describing geometry in various ways...

Higher-level concepts of the 3D world are generally not included in
low-level libraries...

To add to the problems, OpenGL was not truly low-level..
=C2=BB

Note this:

=C2=AB
TODAY THERE REMAINS NO STANDARD HIGH-LEVEL API FOR 3D GRAPHICS. Several
attempts have been made, including OpenGL++ and the SGI/Microsoft
Fahrenheit graphics API, but none of these have made it to production.
=C2=BB

----------

As a practical example of its low-level problem, i looked at your basic
OpenGL tutorial, the minimal program
(http://www.ffconsultancy.com/products/ocaml_for_scientists/visualisation/):

let () =3D
  let argv' =3D Glut.init Sys.argv in
  ignore (Glut.createWindow ~title:"OpenGL Demo");
  GlClear.color (0.1, 0.3, 0.1);
  Glut.displayFunc ~cb:(fun () -> GlClear.clear [ `color ]; Gl.flush
());
  Glut.mainLoop ()

Immediately, a extremely intelligent alien who understand advanced
programing and geometry in 3D and higher dimensions, but who is not
familiar with OpenGL per se, would be facing 6 lines, almost all of it
are irrelevant to geometry or the mathematics of programing,
but are extraneous concepts created by the system itself . (the
exceptions are the =E2=80=9Ccolor=E2=80=9D, and =E2=80=9Cclear=E2=80=9D)

This is in contrast to the Mathematica system or its graphics. For
example:
http://xahlee.org/3d/mma.html e.g.

Graphics3D[{
Cuboid[{0, 0, 0}],
Point[{1.5, 1.5,0}],
Polygon[{{2, 2, 1}, {2, 1, 1}, {1, 2, 1}}]
}]

Even if you don't know nothing about Mathematica or never coded a
single line of 3d graphics application,  the lines above are all very
meaningful, as they are inalienable concepts of geometry, not something
extraneous as most imperative languages or systems or unix forces upon
its users.

------------

Note that the above sentiment about OpenGL, is just my sentiment on the
overall situation of graphics programing. (and in general the low-level
garbage situation applies to almost all imperative languages and vast
majority of protocols in the industry.) I don't particular know OpenGL
as a low-level graphic system is a good one or not. (but it is probably
correct to assume that Microsoft's Direct3D is far more better designed
system at the same level)

------------

Regarding VisualPython... i saw a demo in 2002 by a professor
friend. I think it is good. Though, why is its licensing not GPL or
otherwise Open Source? That's kinda odd since Pyhton is.

Thanks for your links and tutorials. I find them useful.

----

What i'm looking for, is a system that allows one to easily to graphics
programing. By graphics programing, i mean 3d geometric shapes
manipulation, as opposed to rendering or implementing CAD systems or
how to write photoshop filters or the science of realistic rendering
etc as most people are thinking of when hearing the term computer
graphics programing.

So far as i know, Mathematica is the platform that allows one to do
graphics programing. But, i think Flash probably is another platform
that does it. And i think VisualPython is also.

I'm interested in other platforms that allows one to do this.

  Xah
  xah@xahlee.org
=E2=88=91 http://xahlee.org/


Jon Harrop wrote:
> Xah Lee wrote:
> > Introduction to 3D Graphics Programing
> > http://xahlee.org/3d/index.html
>
> You will probably find it more rewarding to use a more modern graphics
> system, such as OpenGL or DirectX, with a suitable programming language
> rather than Mathematica's. I would recommend any of OCaml, F#, Haskell,
> Lisp, Scheme, Python or Ruby for graphics, you can do much more
> sophisticated, animated, real time visualisations than you can with
> Mathematica's primitives.
>
> There are lots of great web pages out there. I've written some 2D and 3D
> graphics examples in OCaml:
>
>   http://www.ffconsultancy.com/products/ocaml_for_scientists/visualisation
>   http://www.ffconsultancy.com/free/ray_tracer
>   http://www.ffconsultancy.com/free/fractal
>   http://www.ffconsultancy.com/free/maze
>
> and more recently F#:
>
>   http://www.ffconsultancy.com/dotnet/fsharp
>
> I was very impressed with the tutorial videos on VPython at ShowMeDo:
>
>   http://showmedo.com/videos/series?name=3DpythonThompsonVPythonSeries
>
> For an introduction to OpenGL, look no further than the NeHe tutorials at
> GameDev:
>
>   http://nehe.gamedev.net
>
> One of our future products at FF Consultancy is a suite of extensions for
> the F# interactive mode that allows you to visualise 2D and 3D graphics in
> real time with simplicity rivalling Mathematica but the sophistication and
> performance of DirectX, whilst also having the power of the F# programming
> language and .NET to analyse your data.
>
> --
> Dr Jon D Harrop, Flying Frog Consultancy
> Objective CAML for Scientists
> http://www.ffconsultancy.com/products/ocaml_for_scientists/index.html?use=
net



------------------------------

Date: Wed, 27 Dec 2006 10:13:02 +0100
From: Raff <CANCELLAdellaver@hotmail.it>
Subject: Re: Xah's Edu Corner: Introduction to 3D Graphics Programing
Message-Id: <4592391a$0$20812$5fc30a8@news.tiscali.it>

Xah Lee wrote:
> Dear Jon Harrop,
> 
> Thanks for the informative reply.
> 
> I don't know OpenGL, but i think it is a low-level crap, and have done
> the industry huge irreparable damage the same way unix has.

OpenGL is low level, that's right, but it is not crap. OpenGL is
hardware independent, and is a true multiplatform standard. The
difference between OpenGL and higher level libraries, like OpenInventor,
it is similar to the difference between a low-level programming language
like C and a higher level object-oriented language, IMHO.

> I don't particular know OpenGL
> as a low-level graphic system is a good one or not. (but it is probably
> correct to assume that Microsoft's Direct3D is far more better designed
> system at the same level)
> 

Direct3D it is lower level than OpenGL, and usually needs more
instructions than OpenGL to do the same things.



------------------------------

Date: 27 Dec 2006 06:39:16 -0800
From: "Ravi Teja" <webraviteja@gmail.com>
Subject: Re: Xah's Edu Corner: Introduction to 3D Graphics Programing
Message-Id: <1167230356.551596.193550@73g2000cwn.googlegroups.com>


Xah Lee wrote:

> Regarding VisualPython... i saw a demo in 2002 by a professor
> friend. I think it is good. Though, why is its licensing not GPL or
> otherwise Open Source? That's kinda odd since Pyhton is.

You are confusing VPython with Activestate's Visual Python IDE plugin
for Visual Studio.
>From VPython's home page in very bold font - "VPython is free and
open-source"
http://www.vpython.org/



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 10099
****************************************


home help back first fref pref prev next nref lref last post