RE: Perl - Was Unix time conversion function

2003-01-29 Thread Jesse, Rich
Because I'm picky.  I ruled out OracleTool because it's web-based.  While it
may be an advantage at times (don't need to install on every machine I use),
it's a whole number of layers I don't want to troubleshoot when in Crisis
Mode.

OraC is pretty cool.  I looked at it when I got O'Reilly's Oracle and Open
Source.  It's nice, but not what I want/need.  All I want is a tool that
will allow the user, Me, to design and maintain system events and their
respective metrics and thresholds and notify the user when those thresholds
have been exceeded.  We already have a few tools that do this, but they all
have their drawbacks.  OEM's drawbacks are that is doesn't notify us half of
the time (and doesn't seem to have a mechanism to log notifications), and
that it's custom interface is TCL (another language I don't want to have to
learn to perform a single task).

I also liked the Jareds_tools module...  :D

Rich


Rich Jesse  System/Database Administrator
[EMAIL PROTECTED] Quad/Tech International, Sussex, WI
USA

p.s.  I could have sworn I sent this out yesterday (Tuesday), but as I'm in
the middle of a three-day PC rebuild (Winders bites!), I guess I'll take MS
Lookout's word for it that I didn't.

-Original Message-
Sent: Tuesday, January 28, 2003 11:36 AM
To: [EMAIL PROTECTED]
Cc: Jesse, Rich
Importance: High


 Also, on scant nights I've even been rolling my own KISS-method Perl/Tk 
OEM
 replacement.  Sorry Jared, but sometimes I like GUIs!  :)

Why?  Look up OraC and OracleTool on google.

Jared
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jesse, Rich
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was Unix time conversion function

2003-01-29 Thread Jared . Still
This sounds cool.  You will of course share this, won't you?

Re Jareds_tools - I just made a suggestion and got my
name in the code.  :)

Jared





Jesse, Rich [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
 01/29/2003 07:30 AM
 Please respond to ORACLE-L

 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
cc: 
Subject:RE: Perl - Was Unix time conversion function


Because I'm picky.  I ruled out OracleTool because it's web-based.  While 
it
may be an advantage at times (don't need to install on every machine I 
use),
it's a whole number of layers I don't want to troubleshoot when in Crisis
Mode.

OraC is pretty cool.  I looked at it when I got O'Reilly's Oracle and Open
Source.  It's nice, but not what I want/need.  All I want is a tool that
will allow the user, Me, to design and maintain system events and their
respective metrics and thresholds and notify the user when those 
thresholds
have been exceeded.  We already have a few tools that do this, but they 
all
have their drawbacks.  OEM's drawbacks are that is doesn't notify us half 
of
the time (and doesn't seem to have a mechanism to log notifications), and
that it's custom interface is TCL (another language I don't want to have 
to
learn to perform a single task).

I also liked the Jareds_tools module...  :D

Rich


Rich Jesse  System/Database Administrator
[EMAIL PROTECTED] Quad/Tech International, Sussex, 
WI
USA

p.s.  I could have sworn I sent this out yesterday (Tuesday), but as I'm 
in
the middle of a three-day PC rebuild (Winders bites!), I guess I'll take 
MS
Lookout's word for it that I didn't.

-Original Message-
Sent: Tuesday, January 28, 2003 11:36 AM
To: [EMAIL PROTECTED]
Cc: Jesse, Rich


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




Perl - Was unix time conversion function

2003-01-28 Thread Robert Freeman
Title: unix time conversion function



Cary I once thought I wanted to do some Perl coding... So I bought a 
book and started to play with it. It made my head bleed... literally I had 
little droplets of blood emerging from my head They rushed me to the 
hospital and put me in the Perl ward where I languished for days on IV's of 
Mountain Dew and pulverized Ritz crackers. it was close.

In my 
mind there is nothing obvious about Perl, this coming from and old C coder 
who did pointers and linked lists in his sleep years ago. I don't know, 
maybe I was having a bad day and it's time to get my "learning 
Perl" book out again

Anyone 
else feel that way about Perl or am I a lone wolf in a Perl 
world?

RF

  -Original Message-From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]On Behalf Of Cary MillsapSent: 
  Friday, January 24, 2003 4:29 PMTo: Multiple recipients of list 
  ORACLE-LSubject: RE: unix time conversion 
  function
  
  At the risk of 
  stating the obvious, doing it in Perl looks like this:
  
  #!/usr/bin/perl
  use Date::Format 
  qw(time2str);
  my $t = 1043447100; # 
  for example
  print time2str("%T %A 
  %d %B %Y", $t), "\n";
  
  
  Cary 
  MillsapHotsos 
  Enterprises, Ltd.http://www.hotsos.comUpcoming 
  events:- 2003 Hotsos 
  Symposium on Oracle System Performance, Feb 912 Dallas- 
  RMOUG Training Days 2003, Mar 56 
  Denver- Hotsos 
  Clinic101, Mar 2628 London
  -Original 
  Message-From: 
  [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Post, EthanSent: Friday, January 24, 2003 3:30 
  PMTo: Multiple recipients of 
  list ORACLE-LSubject: RE: 
  unix time conversion function
  
  
  Kinda...you 
  can change the year to 1970 if you want, this also converts to minutes, not 
  seconds. It is a really ugly function but it seems to work. You 
  could always use perl.
  
  
  
  function 
  f_minutes { # Funky function I use to calculate the number of 
  minutes since 2000 MIN_YEAR=$( date +"%Y" ) 
  MIN_YEAR=$( expr ${MIN_YEAR} - 2000 ) MIN_YEAR=$( expr 
  ${MIN_YEAR} \* 525600 ) MIN_DAYS=$( date +"%j" 
  ) MIN_DAYS=$( expr "${MIN_DAYS}" - 1 ) 
  MIN_DAYS=$( expr "${MIN_DAYS}" \* 1440 ) MIN_HOURS=$( date 
  +"%H" ) MIN_HOURS=$( expr "${MIN_HOURS}" \* 60 
  ) MIN_MINS=$( date +"%M" ) MIN_TOTAL=$(( 
  ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} + ${MIN_MINS} )) 
  print ${MIN_TOTAL}}
  
-Original 
Message-From: Adams, 
Matthew (GECP, MABG, 088130) [mailto:[EMAIL PROTECTED]]Sent: Friday, January 24, 2003 1:14 
PMTo: Multiple recipients 
of list ORACLE-LSubject: 
unix time conversion function
Anybody 
got a handy little function to convert a standard unix seconds-since-Jan-1970 
epoch time 
(stored as a number) to a readable date? 
It 
would save me a lot of time not having to re-invent the 
wheel. 
Matt 
 Matt Adams - GE Appliances - 
[EMAIL PROTECTED] My computer beat me at chess, but I 
won when it 
came to kick boxing. 



RE: Perl - Was unix time conversion function

2003-01-28 Thread Cary Millsap
Title: unix time conversion function









I think its like almost any subjective
idea: its beautiful if you love it, heinous if you hate it.



I love Perl; it does what I mean. The only
thing I really dont like about Perl 5 is its yucky way of supporting complex
data structures. Im eager to have some spare time someday to study the Perl
6 spec in more detail.





Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com

Upcoming events:
- 2003 Hotsos Symposium on
Oracle System Performance, Feb 912 Dallas
- RMOUG Training Days 2003, Mar 56
Denver
- Hotsos Clinic101,
Mar 2628 London



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Robert
Freeman
Sent: Tuesday, January 28, 2003
12:40 AM
To: Multiple recipients of list
ORACLE-L
Subject: Perl - Was unix time
conversion function





Cary I once thought I wanted to do
some Perl coding... So I bought a book and started to play with it. It made my
head bleed... literally I had little droplets of blood emerging from my
head They rushed me to the hospital and put me in the Perl ward where I
languished for days on IV's of Mountain Dew and pulverized Ritz crackers.
it was close.











In my mind there is nothing obvious about
Perl, this coming from and old C coder who did pointers and linked lists in his
sleep years ago. I don't know, maybe I was having a bad day and it's time to
get my learning Perl book out again











Anyone else feel that way about Perl or am
I a lone wolf in a Perl world?











RF





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Cary
Millsap
Sent: Friday, January 24, 2003
4:29 PM
To: Multiple recipients of list
ORACLE-L
Subject: RE: unix time conversion
function

At the risk of stating the obvious, doing
it in Perl looks like this:



#!/usr/bin/perl

use Date::Format qw(time2str);

my $t = 1043447100; # for example

print time2str(%T %A %d %B %Y,
$t), \n;





Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com

Upcoming events:
- 2003 Hotsos Symposium on
Oracle System Performance, Feb 912 Dallas
- RMOUG Training Days 2003, Mar 56
Denver
- Hotsos Clinic101,
Mar 2628 London



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Post,
Ethan
Sent: Friday, January 24, 2003 3:30
PM
To: Multiple recipients of list
ORACLE-L
Subject: RE: unix time conversion
function





Kinda...you can
change the year to 1970 if you want, this also converts to minutes, not
seconds. It is a really ugly function but it seems to work. You
could always use perl.











function
f_minutes {
 # Funky function I use to calculate the number of minutes since
2000
 MIN_YEAR=$( date +%Y )
 MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
 MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
 MIN_DAYS=$( date +%j )
 MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
 MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
 MIN_HOURS=$( date +%H )
 MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
 MIN_MINS=$( date +%M )
 MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} +
${MIN_MINS} ))
 print ${MIN_TOTAL}
}





-Original Message-
From: Adams, Matthew (GECP, MABG,
088130) [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 24, 2003
1:14 PM
To: Multiple recipients of list
ORACLE-L
Subject: unix time conversion
function

Anybody got
a handy little function to 
convert a standard unix
seconds-since-Jan-1970 epoch 
time (stored as a number) to a
readable date? 

It would
save me a lot of time not having to re-invent the 
wheel. 

Matt




Matt Adams - GE Appliances -
[EMAIL PROTECTED] 
My computer beat me at chess, but I
won 
when it came to kick boxing.













Re: Perl - Was unix time conversion function

2003-01-28 Thread Rachel Carmichael
I've managed to successfully avoid learning Perl for a while now... my
reaction, while not quite so dramatic as yours, was that it made my
head hurt to try to understand it!  :)


--- Robert Freeman [EMAIL PROTECTED] wrote:
 unix time conversion functionCary I once thought I wanted to do
 some
 Perl coding... So I bought a book and started to play with it. It
 made my
 head bleed... literally I had little droplets of blood emerging from
 my
 head They rushed me to the hospital and put me in the Perl ward
 where I
 languished for days on IV's of Mountain Dew and pulverized Ritz
 crackers. it was close.
 
 In my mind there is nothing obvious about Perl, this coming from and
 old C
 coder who did pointers and linked lists in his sleep years ago. I
 don't
 know, maybe I was having a bad day and it's time to get my learning
 Perl
 book out again
 
 Anyone else feel that way about Perl or am I a lone wolf in a Perl
 world?
 
 RF
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Cary
 Millsap
   Sent: Friday, January 24, 2003 4:29 PM
   To: Multiple recipients of list ORACLE-L
   Subject: RE: unix time conversion function
 
 
   At the risk of stating the obvious, doing it in Perl looks like
 this:
 
 
 
   #!/usr/bin/perl
 
   use Date::Format qw(time2str);
 
   my $t = 1043447100; # for example
 
   print time2str(%T %A %d %B %Y, $t), \n;
 
 
 
   Cary Millsap
   Hotsos Enterprises, Ltd.
   http://www.hotsos.com
 
   Upcoming events:
   - 2003 Hotsos Symposium on OracleR System Performance, Feb 9-12
 Dallas
   - RMOUG Training Days 2003, Mar 5-6 Denver
   - Hotsos Clinic 101, Mar 26-28 London
 
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Post,
 Ethan
   Sent: Friday, January 24, 2003 3:30 PM
   To: Multiple recipients of list ORACLE-L
   Subject: RE: unix time conversion function
 
 
 
   Kinda...you can change the year to 1970 if you want, this also
 converts to
 minutes, not seconds.  It is a really ugly function but it seems to
 work.
 You could always use perl.
 
 
 
   function f_minutes {
  # Funky function I use to calculate the number of minutes since
 2000
  MIN_YEAR=$( date +%Y )
  MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
  MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
  MIN_DAYS=$( date +%j )
  MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
  MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
  MIN_HOURS=$( date +%H )
  MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
  MIN_MINS=$( date +%M )
  MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} +
 ${MIN_MINS} ))
  print ${MIN_TOTAL}
   }
 
 -Original Message-
 From: Adams, Matthew (GECP, MABG, 088130)
 [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 24, 2003 1:14 PM
 To: Multiple recipients of list ORACLE-L
 Subject: unix time conversion function
 
 Anybody got a handy little function to
 convert a standard unix seconds-since-Jan-1970 epoch
 time (stored as a number) to a readable date?
 
 It would save me a lot of time not having to re-invent the
 wheel.
 
 Matt
 
 
 Matt Adams - GE Appliances - [EMAIL PROTECTED]
 My computer beat me at chess, but I won
 when it came to kick boxing.
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Rachel Carmichael
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was unix time conversion function

2003-01-28 Thread April Wells

Personally... I think that if I had the same teacher to help me through Perl
that REALLY taught me what C was doing in memory and got me to REALLY
understand the power and elegance of pointers, I would code more in Perl.  I
can, and occasionally do, code in Perl, but nothing fancy or real creative.


ajw

April Wells
Oracle DBA 
Great spirits have always encountered violent opposition from mediocre minds
-- Albert Einstein



-Original Message-
Sent: Tuesday, January 28, 2003 4:59 AM
To: Multiple recipients of list ORACLE-L


I've managed to successfully avoid learning Perl for a while now... my
reaction, while not quite so dramatic as yours, was that it made my
head hurt to try to understand it!  :)


--- Robert Freeman [EMAIL PROTECTED] wrote:
 unix time conversion functionCary I once thought I wanted to do
 some
 Perl coding... So I bought a book and started to play with it. It
 made my
 head bleed... literally I had little droplets of blood emerging from
 my
 head They rushed me to the hospital and put me in the Perl ward
 where I
 languished for days on IV's of Mountain Dew and pulverized Ritz
 crackers. it was close.
 
 In my mind there is nothing obvious about Perl, this coming from and
 old C
 coder who did pointers and linked lists in his sleep years ago. I
 don't
 know, maybe I was having a bad day and it's time to get my learning
 Perl
 book out again
 
 Anyone else feel that way about Perl or am I a lone wolf in a Perl
 world?
 
 RF
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Cary
 Millsap
   Sent: Friday, January 24, 2003 4:29 PM
   To: Multiple recipients of list ORACLE-L
   Subject: RE: unix time conversion function
 
 
   At the risk of stating the obvious, doing it in Perl looks like
 this:
 
 
 
   #!/usr/bin/perl
 
   use Date::Format qw(time2str);
 
   my $t = 1043447100; # for example
 
   print time2str(%T %A %d %B %Y, $t), \n;
 
 
 
   Cary Millsap
   Hotsos Enterprises, Ltd.
   http://www.hotsos.com
 
   Upcoming events:
   - 2003 Hotsos Symposium on OracleR System Performance, Feb 9-12
 Dallas
   - RMOUG Training Days 2003, Mar 5-6 Denver
   - Hotsos Clinic 101, Mar 26-28 London
 
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Post,
 Ethan
   Sent: Friday, January 24, 2003 3:30 PM
   To: Multiple recipients of list ORACLE-L
   Subject: RE: unix time conversion function
 
 
 
   Kinda...you can change the year to 1970 if you want, this also
 converts to
 minutes, not seconds.  It is a really ugly function but it seems to
 work.
 You could always use perl.
 
 
 
   function f_minutes {
  # Funky function I use to calculate the number of minutes since
 2000
  MIN_YEAR=$( date +%Y )
  MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
  MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
  MIN_DAYS=$( date +%j )
  MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
  MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
  MIN_HOURS=$( date +%H )
  MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
  MIN_MINS=$( date +%M )
  MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} +
 ${MIN_MINS} ))
  print ${MIN_TOTAL}
   }
 
 -Original Message-
 From: Adams, Matthew (GECP, MABG, 088130)
 [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 24, 2003 1:14 PM
 To: Multiple recipients of list ORACLE-L
 Subject: unix time conversion function
 
 Anybody got a handy little function to
 convert a standard unix seconds-since-Jan-1970 epoch
 time (stored as a number) to a readable date?
 
 It would save me a lot of time not having to re-invent the
 wheel.
 
 Matt
 
 
 Matt Adams - GE Appliances - [EMAIL PROTECTED]
 My computer beat me at chess, but I won
 when it came to kick boxing.
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Rachel Carmichael
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).



The information contained in this communication,
including attachments, is strictly confidential
and for the intended use of the addressee only;
it may also contain proprietary, price sensitive,
or legally privileged information. Notice is
hereby given that any disclosure, distribution, 
dissemination, use, or copying of the information 
by anyone

RE: Perl - Was Unix time conversion function

2003-01-28 Thread Jamadagni, Rajendra
Title: RE: Perl - Was Unix time conversion function





I used to be, but I finally bit the bullet ... I ordered my copy of Jared's book from Amazon.com yesterday !!


Raj
__
Rajendra Jamadagni MIS, ESPN Inc.
Rajendra dot Jamadagni at ESPN dot com
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc. 
QOTD: Any clod can have facts, but having an opinion is an art!


-Original Message-
From: Robert Freeman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 1:40 AM
To: Multiple recipients of list ORACLE-L
Subject: Perl - Was Unix time conversion function



Cary I once thought I wanted to do some Perl coding... So I bought a book and started to play with it. It made my head bleed... literally I had little droplets of blood emerging from my head They rushed me to the hospital and put me in the Perl ward where I languished for days on IV's of Mountain Dew and pulverized Ritz crackers. it was close.

In my mind there is nothing obvious about Perl, this coming from and old C coder who did pointers and linked lists in his sleep years ago. I don't know, maybe I was having a bad day and it's time to get my learning Perl book out again

Anyone else feel that way about Perl or am I a lone wolf in a Perl world?


RF



This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*2



RE: Perl - Was unix time conversion function

2003-01-28 Thread Alex
Perl is great for getting the job done fast. It's harder to
write a large maintainable system in perl than other languages
but you use the right tool for the job. And, IMO, if you are ever
writing fancy or real creative code rewrite it. K.I.S.S.

On Tue, 28 Jan 2003, April Wells wrote:


 Personally... I think that if I had the same teacher to help me through Perl
 that REALLY taught me what C was doing in memory and got me to REALLY
 understand the power and elegance of pointers, I would code more in Perl.  I
 can, and occasionally do, code in Perl, but nothing fancy or real creative.


 ajw

 April Wells
 Oracle DBA
 Great spirits have always encountered violent opposition from mediocre minds
 -- Albert Einstein



 -Original Message-
 Sent: Tuesday, January 28, 2003 4:59 AM
 To: Multiple recipients of list ORACLE-L


 I've managed to successfully avoid learning Perl for a while now... my
 reaction, while not quite so dramatic as yours, was that it made my
 head hurt to try to understand it!  :)


 --- Robert Freeman [EMAIL PROTECTED] wrote:
  unix time conversion functionCary I once thought I wanted to do
  some
  Perl coding... So I bought a book and started to play with it. It
  made my
  head bleed... literally I had little droplets of blood emerging from
  my
  head They rushed me to the hospital and put me in the Perl ward
  where I
  languished for days on IV's of Mountain Dew and pulverized Ritz
  crackers. it was close.
 
  In my mind there is nothing obvious about Perl, this coming from and
  old C
  coder who did pointers and linked lists in his sleep years ago. I
  don't
  know, maybe I was having a bad day and it's time to get my learning
  Perl
  book out again
 
  Anyone else feel that way about Perl or am I a lone wolf in a Perl
  world?
 
  RF
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Cary
  Millsap
Sent: Friday, January 24, 2003 4:29 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: unix time conversion function
 
 
At the risk of stating the obvious, doing it in Perl looks like
  this:
 
 
 
#!/usr/bin/perl
 
use Date::Format qw(time2str);
 
my $t = 1043447100; # for example
 
print time2str(%T %A %d %B %Y, $t), \n;
 
 
 
Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com
 
Upcoming events:
- 2003 Hotsos Symposium on OracleR System Performance, Feb 9-12
  Dallas
- RMOUG Training Days 2003, Mar 5-6 Denver
- Hotsos Clinic 101, Mar 26-28 London
 
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Post,
  Ethan
Sent: Friday, January 24, 2003 3:30 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: unix time conversion function
 
 
 
Kinda...you can change the year to 1970 if you want, this also
  converts to
  minutes, not seconds.  It is a really ugly function but it seems to
  work.
  You could always use perl.
 
 
 
function f_minutes {
   # Funky function I use to calculate the number of minutes since
  2000
   MIN_YEAR=$( date +%Y )
   MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
   MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
   MIN_DAYS=$( date +%j )
   MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
   MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
   MIN_HOURS=$( date +%H )
   MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
   MIN_MINS=$( date +%M )
   MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} +
  ${MIN_MINS} ))
   print ${MIN_TOTAL}
}
 
  -Original Message-
  From: Adams, Matthew (GECP, MABG, 088130)
  [mailto:[EMAIL PROTECTED]]
  Sent: Friday, January 24, 2003 1:14 PM
  To: Multiple recipients of list ORACLE-L
  Subject: unix time conversion function
 
  Anybody got a handy little function to
  convert a standard unix seconds-since-Jan-1970 epoch
  time (stored as a number) to a readable date?
 
  It would save me a lot of time not having to re-invent the
  wheel.
 
  Matt
 
  
  Matt Adams - GE Appliances - [EMAIL PROTECTED]
  My computer beat me at chess, but I won
  when it came to kick boxing.
 


 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 --
 Please see the official ORACLE-L FAQ: http://www.orafaq.net
 --
 Author: Rachel Carmichael
   INET: [EMAIL PROTECTED]

 Fat City Network Services-- 858-538-5051 http://www.fatcity.com
 San Diego, California-- Mailing list and web hosting services
 -
 To REMOVE yourself from this mailing list, send an E-Mail message
 to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
 the message BODY, include a line containing: UNSUB ORACLE-L
 (or the name of mailing list you want to be removed from).  You may
 also send the HELP

Re: Perl - Was unix time conversion function

2003-01-28 Thread Denny Koovakattu


  The only problem I had was differentiating between the actual code and the 
encrypted version of the same ;) But we will get there eventually.

Denny

Quoting Robert Freeman [EMAIL PROTECTED]:

 unix time conversion functionCary I once thought I wanted to do
 some
 Perl coding... So I bought a book and started to play with it. It made
 my
 head bleed... literally I had little droplets of blood emerging from
 my
 head They rushed me to the hospital and put me in the Perl ward
 where I
 languished for days on IV's of Mountain Dew and pulverized Ritz
 crackers. it was close.
 
 In my mind there is nothing obvious about Perl, this coming from and old
 C
 coder who did pointers and linked lists in his sleep years ago. I
 don't
 know, maybe I was having a bad day and it's time to get my learning
 Perl
 book out again
 
 Anyone else feel that way about Perl or am I a lone wolf in a Perl
 world?
 
 RF
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Cary
 Millsap
   Sent: Friday, January 24, 2003 4:29 PM
   To: Multiple recipients of list ORACLE-L
   Subject: RE: unix time conversion function
 
 
   At the risk of stating the obvious, doing it in Perl looks like
 this:
 
 
 
   #!/usr/bin/perl
 
   use Date::Format qw(time2str);
 
   my $t = 1043447100; # for example
 
   print time2str(%T %A %d %B %Y, $t), \n;
 
 
 
   Cary Millsap
   Hotsos Enterprises, Ltd.
   http://www.hotsos.com
 
   Upcoming events:
   - 2003 Hotsos Symposium on OracleR System Performance, Feb 9-12
 Dallas
   - RMOUG Training Days 2003, Mar 5-6 Denver
   - Hotsos Clinic 101, Mar 26-28 London
 
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Post,
 Ethan
   Sent: Friday, January 24, 2003 3:30 PM
   To: Multiple recipients of list ORACLE-L
   Subject: RE: unix time conversion function
 
 
 
   Kinda...you can change the year to 1970 if you want, this also
 converts to
 minutes, not seconds.  It is a really ugly function but it seems to
 work.
 You could always use perl.
 
 
 
   function f_minutes {
  # Funky function I use to calculate the number of minutes since
 2000
  MIN_YEAR=$( date +%Y )
  MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
  MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
  MIN_DAYS=$( date +%j )
  MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
  MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
  MIN_HOURS=$( date +%H )
  MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
  MIN_MINS=$( date +%M )
  MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} +
 ${MIN_MINS} ))
  print ${MIN_TOTAL}
   }
 
 -Original Message-
 From: Adams, Matthew (GECP, MABG, 088130)
 [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 24, 2003 1:14 PM
 To: Multiple recipients of list ORACLE-L
 Subject: unix time conversion function
 
 Anybody got a handy little function to
 convert a standard unix seconds-since-Jan-1970 epoch
 time (stored as a number) to a readable date?
 
 It would save me a lot of time not having to re-invent the
 wheel.
 
 Matt

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Denny Koovakattu
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was Unix time conversion function

2003-01-28 Thread Hately, Mike (NESL-IT)
Perl kind of makes sense but I haven't reached the point where it clicks and
becomes natural. I still need to think about it very hard when I'm writing
it. Hence, a lot of the time I fall back on shell scripts supplemented by
pre-written (some would say shamelessly ripped off) perl code for the stuff
that would get really messy is ksh.
 
Regards,
Mike Hately
 

-Original Message- 
mailto:[EMAIL PROTECTED] ] 
Sent: Tuesday, January 28, 2003 1:40 AM 
To: Multiple recipients of list ORACLE-L 


Cary I once thought I wanted to do some Perl coding... So I bought a
book and started to play with it. It made my head bleed... literally I had
little droplets of blood emerging from my head They rushed me to the
hospital and put me in the Perl ward where I languished for days on IV's of
Mountain Dew and pulverized Ritz crackers. it was close.

In my mind there is nothing obvious about Perl, this coming from and old C
coder who did pointers and linked lists in his sleep years ago. I don't
know, maybe I was having a bad day and it's time to get my learning Perl
book out again

Anyone else feel that way about Perl or am I a lone wolf in a Perl world? 

RF 





**
 
The information contained in this e-mail is confidential and 
intended only for the use of the addressee. If the reader of 
this message is not the addressee, you are hereby notified 
that you have received this e-mail in error and you must not 
copy, disseminate, distribute, use or take any action as a 
result of the information contained in it.

If you have received this e-mail in error, please notify 
[EMAIL PROTECTED] (UK 01384 275454) and delete it 
immediately from your system.

Neither Npower nor any of the other companies in the 
Innogy group from whom this e-mail originates accept any 
responsibility for losses or damage as a result of any viruses 
and it is your responsibility to check attachments (if any) for 
viruses.
Npower Limited
Registered office: Windmill Hill Business Park, Whitehill 
Way, Swindon SN5 6PB. Registered in England and Wales: 
number 3653277
This e-mail may be sent on behalf of a member of the Innogy 
group of companies.
**

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Hately, Mike (NESL-IT)
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was unix time conversion function

2003-01-28 Thread Orr, Steve
Title: unix time conversion function



Now 
that's what I call a "Perl Breakdown!!"...A nervous breakdown brought on 
by pathological eclecticism. The cure for this is a healthy dose of Python. It 
is truly refreshing!!


Steve 
Orr
Oracle 
DBA and part-time Python Evangelist.


  -Original Message-From: Robert Freeman 
  [mailto:[EMAIL PROTECTED]]Sent: Monday, January 27, 2003 
  11:40 PMTo: Multiple recipients of list ORACLE-LSubject: 
  Perl - Was unix time conversion function
  Cary I once thought I wanted to do some Perl coding... So I bought 
  a book and started to play with it. It made my head bleed... literally I had 
  little droplets of blood emerging from my head They rushed me to the 
  hospital and put me in the Perl ward where I languished for days on IV's of 
  Mountain Dew and pulverized Ritz crackers. it was 
  close.
  
  In 
  my mind there is nothing obvious about Perl, this coming from 
  and old C coder who did pointers and linked lists in his sleep years 
  ago. I don't know, maybe I was having a bad day and it's time 
  to get my "learning Perl" book out again
  
  Anyone else feel that way about Perl or am I a lone wolf in a Perl 
  world?
  
  RF


RE: Perl - Was unix time conversion function

2003-01-28 Thread Stephen Lee

Original Message

In my mind there is nothing obvious about Perl,
Anyone else feel that way about Perl or am I a
lone wolf in a Perl world?


I think the correct progression is to start with ksh; then mix in sed, awk,
and maybe a dash of egrep.  When you finally are comfortable with
co-processes (aaaugh!!), then you are ready to start on Perl.  Not that Perl
has anything as goofy as co-processes; but if you can do that, you should be
ready for Perl.  The ksh function definition and calling as vaguely similar
to C, so you won't be on completely unfamiliar turf.  When you have gotten
the hang of sed, awk, and egrep, than at least some of Perl will be deja vu
all over again.

KSH!  PERL?!  We don't need no stinkin' Perl!

(except the ksh you get with Linux is probably the lame, piece-of-crap
version.  Download and build the REAL ksh93.)
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephen Lee
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was Unix time conversion function

2003-01-28 Thread Jesse, Rich
For me, it was either Perl or an icky bass-ackward pipe-laden awk/sed/regex
unmaintainable bastion.  OK, I couldn't get rid of the regex.  While I'll
not be entering the Obfuscated Perl contest anytime soon, I think Perl is
much easier to understand for a traditional programmer (Assembly, BASIC,
COBOL, FORTRAN, and a little C).  I bought O'Reilly's Learning Perl, and
most of what I needed to do was in the book as an example.

Also, on scant nights I've even been rolling my own KISS-method Perl/Tk OEM
replacement.  Sorry Jared, but sometimes I like GUIs!  :)

Rich


Rich Jesse  System/Database Administrator
[EMAIL PROTECTED] Quad/Tech International, Sussex, WI
USA


-Original Message- mailto:[EMAIL PROTECTED] ] 
Sent: Tuesday, January 28, 2003 1:40 AM 
To: Multiple recipients of list ORACLE-L 


Cary I once thought I wanted to do some Perl coding... So I bought a
book and started to play with it. It made my head bleed... literally I had
little droplets of blood emerging from my head They rushed me to the
hospital and put me in the Perl ward where I languished for days on IV's of
Mountain Dew and pulverized Ritz crackers. it was close.

In my mind there is nothing obvious about Perl, this coming from and old C
coder who did pointers and linked lists in his sleep years ago. I don't
know, maybe I was having a bad day and it's time to get my learning Perl
book out again

Anyone else feel that way about Perl or am I a lone wolf in a Perl world? 

RF 

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jesse, Rich
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




Re: Perl - Was unix time conversion function

2003-01-28 Thread Markus Reger
please don't take umbridge, but I feel enticed to quote 

what you don't know, dosn't (really) matter
Larry Wall, programming with perl, O'Reilly.

just for a giggle.

sorry 

apologies for any typos overlooked

kr mr
 [EMAIL PROTECTED] 01/28/03 12:22 PM 
I've managed to successfully avoid learning Perl for a while now... my
reaction, while not quite so dramatic as yours, was that it made my
head hurt to try to understand it!  :)


--- Robert Freeman [EMAIL PROTECTED] wrote:
 unix time conversion functionCary I once thought I wanted to do
 some
 Perl coding... So I bought a book and started to play with it. It
 made my
 head bleed... literally I had little droplets of blood emerging from
 my
 head They rushed me to the hospital and put me in the Perl ward
 where I
 languished for days on IV's of Mountain Dew and pulverized Ritz
 crackers. it was close.
 
 In my mind there is nothing obvious about Perl, this coming from and
 old C
 coder who did pointers and linked lists in his sleep years ago. I
 don't
 know, maybe I was having a bad day and it's time to get my learning
 Perl
 book out again
 
 Anyone else feel that way about Perl or am I a lone wolf in a Perl
 world?
 
 RF
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Cary
 Millsap
   Sent: Friday, January 24, 2003 4:29 PM
   To: Multiple recipients of list ORACLE-L
   Subject: RE: unix time conversion function
 
 
   At the risk of stating the obvious, doing it in Perl looks like
 this:
 
 
 
   #!/usr/bin/perl
 
   use Date::Format qw(time2str);
 
   my $t = 1043447100; # for example
 
   print time2str(%T %A %d %B %Y, $t), \n;
 
 
 
   Cary Millsap
   Hotsos Enterprises, Ltd.
   http://www.hotsos.com
 
   Upcoming events:
   - 2003 Hotsos Symposium on OracleR System Performance, Feb 9-12
 Dallas
   - RMOUG Training Days 2003, Mar 5-6 Denver
   - Hotsos Clinic 101, Mar 26-28 London
 
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Post,
 Ethan
   Sent: Friday, January 24, 2003 3:30 PM
   To: Multiple recipients of list ORACLE-L
   Subject: RE: unix time conversion function
 
 
 
   Kinda...you can change the year to 1970 if you want, this also
 converts to
 minutes, not seconds.  It is a really ugly function but it seems to
 work.
 You could always use perl.
 
 
 
   function f_minutes {
  # Funky function I use to calculate the number of minutes since
 2000
  MIN_YEAR=$( date +%Y )
  MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
  MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
  MIN_DAYS=$( date +%j )
  MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
  MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
  MIN_HOURS=$( date +%H )
  MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
  MIN_MINS=$( date +%M )
  MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} +
 ${MIN_MINS} ))
  print ${MIN_TOTAL}
   }
 
 -Original Message-
 From: Adams, Matthew (GECP, MABG, 088130)
 [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 24, 2003 1:14 PM
 To: Multiple recipients of list ORACLE-L
 Subject: unix time conversion function
 
 Anybody got a handy little function to
 convert a standard unix seconds-since-Jan-1970 epoch
 time (stored as a number) to a readable date?
 
 It would save me a lot of time not having to re-invent the
 wheel.
 
 Matt
 
 
 Matt Adams - GE Appliances - [EMAIL PROTECTED]
 My computer beat me at chess, but I won
 when it came to kick boxing.
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Rachel Carmichael
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Markus Reger
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like

Re: Perl - Was unix time conversion function

2003-01-28 Thread Keith Moore
I've started writing some perl and it is hard to learn, but once you learn,
it can do some great things. And if you learned it from the Larry Wall book
like I did, then it's even harder.

The thing I've discovered about perl it that it may be the only language
(computer or otherwise) that is easier to write than it is to read. I'm sure
a perl expert would gasp at my code, it's far too readable.

Keith

- Original Message -
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Tuesday, January 28, 2003 10:09 AM


 please don't take umbridge, but I feel enticed to quote

 what you don't know, dosn't (really) matter
 Larry Wall, programming with perl, O'Reilly.

 just for a giggle.

 sorry

 apologies for any typos overlooked

 kr mr
  [EMAIL PROTECTED] 01/28/03 12:22 PM 
 I've managed to successfully avoid learning Perl for a while now... my
 reaction, while not quite so dramatic as yours, was that it made my
 head hurt to try to understand it!  :)


 --- Robert Freeman [EMAIL PROTECTED] wrote:
  unix time conversion functionCary I once thought I wanted to do
  some
  Perl coding... So I bought a book and started to play with it. It
  made my
  head bleed... literally I had little droplets of blood emerging from
  my
  head They rushed me to the hospital and put me in the Perl ward
  where I
  languished for days on IV's of Mountain Dew and pulverized Ritz
  crackers. it was close.
 
  In my mind there is nothing obvious about Perl, this coming from and
  old C
  coder who did pointers and linked lists in his sleep years ago. I
  don't
  know, maybe I was having a bad day and it's time to get my learning
  Perl
  book out again
 
  Anyone else feel that way about Perl or am I a lone wolf in a Perl
  world?
 
  RF
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Cary
  Millsap
Sent: Friday, January 24, 2003 4:29 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: unix time conversion function
 
 
At the risk of stating the obvious, doing it in Perl looks like
  this:
 
 
 
#!/usr/bin/perl
 
use Date::Format qw(time2str);
 
my $t = 1043447100; # for example
 
print time2str(%T %A %d %B %Y, $t), \n;
 
 
 
Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com
 
Upcoming events:
- 2003 Hotsos Symposium on OracleR System Performance, Feb 9-12
  Dallas
- RMOUG Training Days 2003, Mar 5-6 Denver
- Hotsos Clinic 101, Mar 26-28 London
 
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Post,
  Ethan
Sent: Friday, January 24, 2003 3:30 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: unix time conversion function
 
 
 
Kinda...you can change the year to 1970 if you want, this also
  converts to
  minutes, not seconds.  It is a really ugly function but it seems to
  work.
  You could always use perl.
 
 
 
function f_minutes {
   # Funky function I use to calculate the number of minutes since
  2000
   MIN_YEAR=$( date +%Y )
   MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
   MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
   MIN_DAYS=$( date +%j )
   MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
   MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
   MIN_HOURS=$( date +%H )
   MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
   MIN_MINS=$( date +%M )
   MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} +
  ${MIN_MINS} ))
   print ${MIN_TOTAL}
}
 
  -Original Message-
  From: Adams, Matthew (GECP, MABG, 088130)
  [mailto:[EMAIL PROTECTED]]
  Sent: Friday, January 24, 2003 1:14 PM
  To: Multiple recipients of list ORACLE-L
  Subject: unix time conversion function
 
  Anybody got a handy little function to
  convert a standard unix seconds-since-Jan-1970 epoch
  time (stored as a number) to a readable date?
 
  It would save me a lot of time not having to re-invent the
  wheel.
 
  Matt
 
  
  Matt Adams - GE Appliances - [EMAIL PROTECTED]
  My computer beat me at chess, but I won
  when it came to kick boxing.
 


 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 --
 Please see the official ORACLE-L FAQ: http://www.orafaq.net
 --
 Author: Rachel Carmichael
   INET: [EMAIL PROTECTED]

 Fat City Network Services-- 858-538-5051 http://www.fatcity.com
 San Diego, California-- Mailing list and web hosting services
 -
 To REMOVE yourself from this mailing list, send an E-Mail message
 to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
 the message BODY, include a line containing: UNSUB ORACLE-L
 (or the name of mailing list you want to be removed from).  You may
 also send the HELP command for other information (like

RE: Perl - Was unix time conversion function

2003-01-28 Thread Stephen Lee

My impression of Programming Perl was that it was primarily intended as an
ego trip for the author.  I found Learning Perl 2nd Ed. and Perl Core
Language / Little Black Book to be much more useful.  Yes, I have the Perl
for Oracle DBA's too, but haven't had the time to get into it yet.

 -Original Message-
 I've started writing some perl and it is hard to learn, but 
 once you learn,
 it can do some great things. And if you learned it from the 
 Larry Wall book
 like I did, then it's even harder.
 
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephen Lee
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was Unix time conversion function

2003-01-28 Thread Scott Stefick

What's the title of Jared's book?

-Scott

At 05:03 AM 1/28/03 -0800, you wrote:

I used to be, but I finally bit
the bullet ... I ordered my copy of Jared's book from Amazon.com
yesterday !! 

Raj 
__

Rajendra Jamadagni MIS, ESPN Inc. 
Rajendra dot Jamadagni at ESPN dot com 
Any opinion expressed here is personal and doesn't reflect that of ESPN Inc. 
QOTD: Any clod can have facts, but having an opinion is an art! 

-Original Message- 
From: Robert Freeman [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 28, 2003 1:40 AM 
To: Multiple recipients of list ORACLE-L 
Subject: Perl - Was Unix time conversion function 

Cary I once thought I wanted to do some Perl coding... So I bought a book and started to play with it. It made my head bleed... literally I had little droplets of blood emerging from my head They rushed me to the hospital and put me in the Perl ward where I languished for days on IV's of Mountain Dew and pulverized Ritz crackers. it was close.

In my mind there is nothing obvious about Perl, this coming from and old C coder who did pointers and linked lists in his sleep years ago. I don't know, maybe I was having a bad day and it's time to get my learning Perl book out again

Anyone else feel that way about Perl or am I a lone wolf in a Perl world? 

RF 


**
Scott Stefick
UNIX Systems Administrator
Oracle Certified Professional DBA
Wm. Rainey Harper College
847.925.6130
**



RE: Perl - Was Unix time conversion function

2003-01-28 Thread Jared . Still
 Also, on scant nights I've even been rolling my own KISS-method Perl/Tk 
OEM
 replacement.  Sorry Jared, but sometimes I like GUIs!  :)

Why?  Look up OraC and OracleTool on google.

Jared









Jesse, Rich [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
 01/28/2003 07:58 AM
 Please respond to ORACLE-L

 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
cc: 
Subject:RE: Perl - Was Unix time conversion function


For me, it was either Perl or an icky bass-ackward pipe-laden 
awk/sed/regex
unmaintainable bastion.  OK, I couldn't get rid of the regex.  While I'll
not be entering the Obfuscated Perl contest anytime soon, I think Perl is
much easier to understand for a traditional programmer (Assembly, BASIC,
COBOL, FORTRAN, and a little C).  I bought O'Reilly's Learning Perl, and
most of what I needed to do was in the book as an example.

Also, on scant nights I've even been rolling my own KISS-method Perl/Tk 
OEM
replacement.  Sorry Jared, but sometimes I like GUIs!  :)

Rich


Rich Jesse  System/Database Administrator
[EMAIL PROTECTED] Quad/Tech International, Sussex, 
WI
USA


-Original Message- mailto:[EMAIL PROTECTED] ] 
Sent: Tuesday, January 28, 2003 1:40 AM 
To: Multiple recipients of list ORACLE-L 


Cary I once thought I wanted to do some Perl coding... So I bought a
book and started to play with it. It made my head bleed... literally I had
little droplets of blood emerging from my head They rushed me to the
hospital and put me in the Perl ward where I languished for days on IV's 
of
Mountain Dew and pulverized Ritz crackers. it was close.

In my mind there is nothing obvious about Perl, this coming from and old C
coder who did pointers and linked lists in his sleep years ago. I don't
know, maybe I was having a bad day and it's time to get my learning Perl
book out again

Anyone else feel that way about Perl or am I a lone wolf in a Perl world? 

RF 

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jesse, Rich
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




Re: Perl - Was unix time conversion function

2003-01-28 Thread Jared . Still
Robert,

Perl isn't really that hard.

As with any language, it can be difficult to grasp at first, but once
you begin to understand it, it can be extremely powerful.

Regarding Cary's comments about the difficulty of complex Perl
data structures, I would have to say that they aren't any more difficult
than complex C data structures.

Data::Dumper is your friend.  It can be used to print the contents and 
structure of any Perl data structure so that it is more easily understood.

As for Stephen Lee's comments that there's no need for Perl if you
have ksh:  I'll bet Stephen has a toolbox in his garage that  contains
a single flat blade screwdriver and no phillips screwdrivers nor any
wrenches.  ;)

You can do most anything in ksh:  I know, I've done it.  Then I learned 
Perl.

Jared







Robert Freeman [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
 01/27/2003 10:39 PM
 Please respond to ORACLE-L

 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
cc: 
Subject:Perl - Was unix time conversion function


Cary I once thought I wanted to do some Perl coding... So I bought a 
book and started to play with it. It made my head bleed... literally I had 
little droplets of blood emerging from my head They rushed me to the 
hospital and put me in the Perl ward where I languished for days on IV's 
of Mountain Dew and pulverized Ritz crackers. it was close.
 
In my mind there is nothing obvious about Perl, this coming from and old C 
coder who did pointers and linked lists in his sleep years ago. I don't 
know, maybe I was having a bad day and it's time to get my learning Perl 
book out again
 
Anyone else feel that way about Perl or am I a lone wolf in a Perl world?
 
RF
-Original Message-
Sent: Friday, January 24, 2003 4:29 PM
To: Multiple recipients of list ORACLE-L

At the risk of stating the obvious, doing it in Perl looks like this:
 
#!/usr/bin/perl
use Date::Format qw(time2str);
my $t = 1043447100; # for example
print time2str(%T %A %d %B %Y, $t), \n;
 
Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com

Upcoming events:
- 2003 Hotsos Symposium on Oracle® System Performance, Feb 9?12 Dallas
- RMOUG Training Days 2003, Mar 5?6 Denver
- Hotsos Clinic 101, Mar 26?28 London
-Original Message-
Sent: Friday, January 24, 2003 3:30 PM
To: Multiple recipients of list ORACLE-L
 
Kinda...you can change the year to 1970 if you want, this also converts to 
minutes, not seconds.  It is a really ugly function but it seems to work. 
You could always use perl.
 
function f_minutes {
   # Funky function I use to calculate the number of minutes since 2000
   MIN_YEAR=$( date +%Y )
   MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
   MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
   MIN_DAYS=$( date +%j )
   MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
   MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
   MIN_HOURS=$( date +%H )
   MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
   MIN_MINS=$( date +%M )
   MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} + ${MIN_MINS} ))
   print ${MIN_TOTAL}
}
-Original Message-
Sent: Friday, January 24, 2003 1:14 PM
To: Multiple recipients of list ORACLE-L
Anybody got a handy little function to 
convert a standard unix seconds-since-Jan-1970 epoch 
time (stored as a number) to a readable date? 
It would save me a lot of time not having to re-invent the 
wheel. 
Matt 
 
Matt Adams - GE Appliances - [EMAIL PROTECTED] 
My computer beat me at chess, but I won 
when it came to kick boxing. 


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was unix time conversion function

2003-01-28 Thread Orr, Steve
Title: RE: Perl - Was unix time conversion function





If you can do it in Perl chances are you can do it better in Python and someone can actually read and understand it without a PHD... AKA Perl Helper Dweeb. :-) In Perl it takes effort to write readable code but it comes naturally in Python.


Check it out:
www.python.org/doc/essays/blurb.html
http://www.orbtech.com/web/python/why
http://www.networkcomputing.com/unixworld/tutorial/005/005.html#Others
http://www.developer.com/open/print.php/610691




Steve Orr
Oracle DBA and part-time Python Evangelist ;-)



-Original Message-
From: Keith Moore [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 9:49 AM
To: Multiple recipients of list ORACLE-L
Subject: Re: Perl - Was unix time conversion function



I've started writing some perl and it is hard to learn, but once you learn,
it can do some great things. And if you learned it from the Larry Wall book
like I did, then it's even harder.


The thing I've discovered about perl it that it may be the only language
(computer or otherwise) that is easier to write than it is to read. I'm sure
a perl expert would gasp at my code, it's far too readable.


Keith


- Original Message -
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Sent: Tuesday, January 28, 2003 10:09 AM



 please don't take umbridge, but I feel enticed to quote

 what you don't know, dosn't (really) matter
 Larry Wall, programming with perl, O'Reilly.

 just for a giggle.

 sorry

 apologies for any typos overlooked

 kr mr
  [EMAIL PROTECTED] 01/28/03 12:22 PM 
 I've managed to successfully avoid learning Perl for a while now... my
 reaction, while not quite so dramatic as yours, was that it made my
 head hurt to try to understand it! :)


 --- Robert Freeman [EMAIL PROTECTED] wrote:
  unix time conversion functionCary I once thought I wanted to do
  some
  Perl coding... So I bought a book and started to play with it. It
  made my
  head bleed... literally I had little droplets of blood emerging from
  my
  head They rushed me to the hospital and put me in the Perl ward
  where I
  languished for days on IV's of Mountain Dew and pulverized Ritz
  crackers. it was close.
 
  In my mind there is nothing obvious about Perl, this coming from and
  old C
  coder who did pointers and linked lists in his sleep years ago. I
  don't
  know, maybe I was having a bad day and it's time to get my learning
  Perl
  book out again
 
  Anyone else feel that way about Perl or am I a lone wolf in a Perl
  world?
 
  RF





RE: Perl - Was unix time conversion function

2003-01-28 Thread Gogala, Mladen
Title: RE: Perl - Was unix time conversion function



I 
haven't done anything with Python but my problem with Python or Ruby is 
that
they 
don't come with many OS variants. Perl comes with any OS and there is 
a
huge 
repository of ready made scripts. I have to confess stealing some from Jared's 
PDBA
collection. I cannot do that with Python and then run 
them on both HP-UX and AIX.
Therefore, I'll stick tothe pathologically 
eclectic rubbish lister. 

  -Original Message-From: Orr, Steve 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, January 28, 2003 1:00 
  PMTo: Multiple recipients of list ORACLE-LSubject: RE: 
  Perl - Was unix time conversion function
  If you can do it in Perl chances are you can do it better in 
  Python and someone can actually read and understand it without a PHD... AKA 
  Perl Helper Dweeb. :-) In Perl it takes effort to write readable 
  code but it comes naturally in Python.
  Check it out: www.python.org/doc/essays/blurb.html http://www.orbtech.com/web/python/why http://www.networkcomputing.com/unixworld/tutorial/005/005.html#Others 
  http://www.developer.com/open/print.php/610691 
  
  Steve Orr Oracle DBA and part-time 
  Python Evangelist ;-) 
  -Original Message- From: Keith 
  Moore [mailto:[EMAIL PROTECTED]] 
  Sent: Tuesday, January 28, 2003 9:49 AM To: Multiple recipients of list ORACLE-L Subject: Re: Perl - Was unix time conversion function 
  I've started writing some perl and it is hard to learn, but 
  once you learn, it can do some great things. And if 
  you learned it from the Larry Wall book like I did, 
  then it's even harder. 
  The thing I've discovered about perl it that it may be the 
  only language (computer or otherwise) that is easier 
  to write than it is to read. I'm sure a "perl expert" 
  would gasp at my code, it's far too readable. 
  Keith 
  - Original Message - To: 
  "Multiple recipients of list ORACLE-L" [EMAIL PROTECTED] 
  Sent: Tuesday, January 28, 2003 10:09 AM 
   please don't take umbridge, but I feel enticed to 
  quote   "what you 
  don't know, dosn't (really) matter"  Larry Wall, 
  programming with perl, O'Reilly.   just for a giggle.   sorry   
  apologies for any typos overlooked  
   kr mr   
  [EMAIL PROTECTED] 01/28/03 12:22 PM   I've managed to successfully avoid learning Perl for a while 
  now... my  reaction, while not quite so dramatic 
  as yours, was that it made my  head hurt to try to 
  understand it! :)--- Robert Freeman 
  [EMAIL PROTECTED] wrote:   unix 
  time conversion functionCary I once thought I wanted to do 
some   Perl 
  coding... So I bought a book and started to play with it. It   made my   head bleed... 
  literally I had little droplets of blood emerging from   my   head They rushed me 
  to the hospital and put me in the Perl ward   
  where I   languished for days on IV's of 
  Mountain Dew and pulverized Ritz   
  crackers. it was close. In my mind there is nothing obvious about Perl, this coming 
  from and   old C  
   coder who did pointers and linked lists in his sleep years ago. I 
don't   know, maybe 
  I was having a bad day and it's time to get my "learning   Perl"   book out 
  again 
  Anyone else feel that way about Perl or am I a lone wolf in a Perl 
world?   
RF 


RE: Perl - Was unix time conversion function

2003-01-28 Thread Cary Millsap
I'll add a clarification. With its object interface, Perl actually lets
one define much more easily accessible data structures than one can in
C. The problem with that is that the extra code path consumed by the
accessor methods is too slow to actually *use* them in some of our code
(think tens of millions of trace file lines that you need to parse in a
few seconds). Hence the need for a lot of Perl code that looks like
$a{$b}-{$c}-{$d}-[$e]. Igh.

Don't get me wrong. I have written large applications in many languages
(several thousand lines as a full-time professional software developer
using C and ksh). In the past three years, I have written several
thousand lines of Perl and accomplished more work than I would ever have
imagined ten years ago. Perl is, for me, the best computer language in
the world.


Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com

Upcoming events:
- 2003 Hotsos Symposium, Feb 9-12 Dallas
- RMOUG Training Days 2003, Mar 5-6 Denver
- Hotsos Clinic 101, Mar 26-28 London


-Original Message-
[EMAIL PROTECTED]
Sent: Tuesday, January 28, 2003 11:51 AM
To: Multiple recipients of list ORACLE-L

Robert,

Perl isn't really that hard.

As with any language, it can be difficult to grasp at first, but once
you begin to understand it, it can be extremely powerful.

Regarding Cary's comments about the difficulty of complex Perl
data structures, I would have to say that they aren't any more difficult
than complex C data structures.

Data::Dumper is your friend.  It can be used to print the contents and 
structure of any Perl data structure so that it is more easily
understood.

As for Stephen Lee's comments that there's no need for Perl if you
have ksh:  I'll bet Stephen has a toolbox in his garage that  contains
a single flat blade screwdriver and no phillips screwdrivers nor any
wrenches.  ;)

You can do most anything in ksh:  I know, I've done it.  Then I learned 
Perl.

Jared







Robert Freeman [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
 01/27/2003 10:39 PM
 Please respond to ORACLE-L

 
To: Multiple recipients of list ORACLE-L
[EMAIL PROTECTED]
cc: 
Subject:Perl - Was unix time conversion function


Cary I once thought I wanted to do some Perl coding... So I bought a

book and started to play with it. It made my head bleed... literally I
had 
little droplets of blood emerging from my head They rushed me to the

hospital and put me in the Perl ward where I languished for days on IV's

of Mountain Dew and pulverized Ritz crackers. it was close.
 
In my mind there is nothing obvious about Perl, this coming from and old
C 
coder who did pointers and linked lists in his sleep years ago. I don't 
know, maybe I was having a bad day and it's time to get my learning
Perl 
book out again
 
Anyone else feel that way about Perl or am I a lone wolf in a Perl
world?
 
RF
-Original Message-
Sent: Friday, January 24, 2003 4:29 PM
To: Multiple recipients of list ORACLE-L

At the risk of stating the obvious, doing it in Perl looks like this:
 
#!/usr/bin/perl
use Date::Format qw(time2str);
my $t = 1043447100; # for example
print time2str(%T %A %d %B %Y, $t), \n;
 
Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com

Upcoming events:
- 2003 Hotsos Symposium on OracleR System Performance, Feb 9?12 Dallas
- RMOUG Training Days 2003, Mar 5?6 Denver
- Hotsos Clinic 101, Mar 26?28 London
-Original Message-
Sent: Friday, January 24, 2003 3:30 PM
To: Multiple recipients of list ORACLE-L
 
Kinda...you can change the year to 1970 if you want, this also converts
to 
minutes, not seconds.  It is a really ugly function but it seems to
work. 
You could always use perl.
 
function f_minutes {
   # Funky function I use to calculate the number of minutes since 2000
   MIN_YEAR=$( date +%Y )
   MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
   MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
   MIN_DAYS=$( date +%j )
   MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
   MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
   MIN_HOURS=$( date +%H )
   MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
   MIN_MINS=$( date +%M )
   MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} + ${MIN_MINS}
))
   print ${MIN_TOTAL}
}
-Original Message-
Sent: Friday, January 24, 2003 1:14 PM
To: Multiple recipients of list ORACLE-L
Anybody got a handy little function to 
convert a standard unix seconds-since-Jan-1970 epoch 
time (stored as a number) to a readable date? 
It would save me a lot of time not having to re-invent the 
wheel. 
Matt 
 
Matt Adams - GE Appliances - [EMAIL PROTECTED] 
My computer beat me at chess, but I won 
when it came to kick boxing. 


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: 
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE

RE: Perl - Was unix time conversion function

2003-01-28 Thread Stephen Lee


 -Original Message-
 I'll bet Stephen has a toolbox in his garage that  contains
 a single flat blade screwdriver and no phillips screwdrivers nor any
 wrenches.  ;)
 
-

Don't need tools.  Got pshycokinesis (got milk too).  Been taking lessons
from Carrie (and dating her mom!).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Stephen Lee
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was Unix time conversion function

2003-01-28 Thread mkb
- because it would be fun to write your own app  
- sense of accomplishment
- you'd get a better handle on the language knowing
it's strength and weaknesses
etc...

Not saying that you should go and write your own dbms
or word processor or OS.  But sometimes writing a
little utility from scratch is more rewarding than
downloading a pre-packaged app.

mohammed

--- [EMAIL PROTECTED] wrote:
  Also, on scant nights I've even been rolling my
 own KISS-method Perl/Tk 
 OEM
  replacement.  Sorry Jared, but sometimes I like
 GUIs!  :)
 
 Why?  Look up OraC and OracleTool on google.
 
 Jared
 
 
 
 
 
 
 
 
 
 Jesse, Rich [EMAIL PROTECTED]
 Sent by: [EMAIL PROTECTED]
  01/28/2003 07:58 AM
  Please respond to ORACLE-L
 
  
 To: Multiple recipients of list ORACLE-L
 [EMAIL PROTECTED]
 cc: 
 Subject:RE: Perl - Was Unix time
 conversion function
 
 
 For me, it was either Perl or an icky bass-ackward
 pipe-laden 
 awk/sed/regex
 unmaintainable bastion.  OK, I couldn't get rid of
 the regex.  While I'll
 not be entering the Obfuscated Perl contest anytime
 soon, I think Perl is
 much easier to understand for a traditional
 programmer (Assembly, BASIC,
 COBOL, FORTRAN, and a little C).  I bought
 O'Reilly's Learning Perl, and
 most of what I needed to do was in the book as an
 example.
 
 Also, on scant nights I've even been rolling my own
 KISS-method Perl/Tk 
 OEM
 replacement.  Sorry Jared, but sometimes I like
 GUIs!  :)
 
 Rich
 
 
 Rich Jesse 
 System/Database Administrator
 [EMAIL PROTECTED] Quad/Tech
 International, Sussex, 
 WI
 USA
 
 
 -Original Message-
 mailto:[EMAIL PROTECTED] ] 
 Sent: Tuesday, January 28, 2003 1:40 AM 
 To: Multiple recipients of list ORACLE-L 
 
 
 Cary I once thought I wanted to do some Perl
 coding... So I bought a
 book and started to play with it. It made my head
 bleed... literally I had
 little droplets of blood emerging from my head
 They rushed me to the
 hospital and put me in the Perl ward where I
 languished for days on IV's 
 of
 Mountain Dew and pulverized Ritz crackers. it
 was close.
 
 In my mind there is nothing obvious about Perl, this
 coming from and old C
 coder who did pointers and linked lists in his sleep
 years ago. I don't
 know, maybe I was having a bad day and it's time to
 get my learning Perl
 book out again
 
 Anyone else feel that way about Perl or am I a lone
 wolf in a Perl world? 
 
 RF 
 
 -- 
 Please see the official ORACLE-L FAQ:
 http://www.orafaq.net
 -- 
 Author: Jesse, Rich
   INET: [EMAIL PROTECTED]
 
 Fat City Network Services-- 858-538-5051
 http://www.fatcity.com
 San Diego, California-- Mailing list and web
 hosting services

-
 To REMOVE yourself from this mailing list, send an
 E-Mail message
 to: [EMAIL PROTECTED] (note EXACT spelling of
 'ListGuru') and in
 the message BODY, include a line containing: UNSUB
 ORACLE-L
 (or the name of mailing list you want to be removed
 from).  You may
 also send the HELP command for other information
 (like subscribing).
 
 
 
 
 -- 
 Please see the official ORACLE-L FAQ:
 http://www.orafaq.net
 -- 
 Author: 
   INET: [EMAIL PROTECTED]
 
 Fat City Network Services-- 858-538-5051
 http://www.fatcity.com
 San Diego, California-- Mailing list and web
 hosting services

-
 To REMOVE yourself from this mailing list, send an
 E-Mail message
 to: [EMAIL PROTECTED] (note EXACT spelling of
 'ListGuru') and in
 the message BODY, include a line containing: UNSUB
 ORACLE-L
 (or the name of mailing list you want to be removed
 from).  You may
 also send the HELP command for other information
 (like subscribing).
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: mkb
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was Unix time conversion function

2003-01-28 Thread Alex

You can always outsource your perl development to me.  :)


On Tue, 28 Jan 2003, Hately, Mike (NESL-IT) wrote:

 Perl kind of makes sense but I haven't reached the point where it clicks and
 becomes natural. I still need to think about it very hard when I'm writing
 it. Hence, a lot of the time I fall back on shell scripts supplemented by
 pre-written (some would say shamelessly ripped off) perl code for the stuff
 that would get really messy is ksh.

 Regards,
 Mike Hately


 -Original Message-
 mailto:[EMAIL PROTECTED] ]
 Sent: Tuesday, January 28, 2003 1:40 AM
 To: Multiple recipients of list ORACLE-L


 Cary I once thought I wanted to do some Perl coding... So I bought a
 book and started to play with it. It made my head bleed... literally I had
 little droplets of blood emerging from my head They rushed me to the
 hospital and put me in the Perl ward where I languished for days on IV's of
 Mountain Dew and pulverized Ritz crackers. it was close.

 In my mind there is nothing obvious about Perl, this coming from and old C
 coder who did pointers and linked lists in his sleep years ago. I don't
 know, maybe I was having a bad day and it's time to get my learning Perl
 book out again

 Anyone else feel that way about Perl or am I a lone wolf in a Perl world?

 RF





 **

 The information contained in this e-mail is confidential and
 intended only for the use of the addressee. If the reader of
 this message is not the addressee, you are hereby notified
 that you have received this e-mail in error and you must not
 copy, disseminate, distribute, use or take any action as a
 result of the information contained in it.

 If you have received this e-mail in error, please notify
 [EMAIL PROTECTED] (UK 01384 275454) and delete it
 immediately from your system.

 Neither Npower nor any of the other companies in the
 Innogy group from whom this e-mail originates accept any
 responsibility for losses or damage as a result of any viruses
 and it is your responsibility to check attachments (if any) for
 viruses.
 Npower Limited
 Registered office: Windmill Hill Business Park, Whitehill
 Way, Swindon SN5 6PB. Registered in England and Wales:
 number 3653277
 This e-mail may be sent on behalf of a member of the Innogy
 group of companies.
 **

 --
 Please see the official ORACLE-L FAQ: http://www.orafaq.net
 --
 Author: Hately, Mike (NESL-IT)
   INET: [EMAIL PROTECTED]

 Fat City Network Services-- 858-538-5051 http://www.fatcity.com
 San Diego, California-- Mailing list and web hosting services
 -
 To REMOVE yourself from this mailing list, send an E-Mail message
 to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
 the message BODY, include a line containing: UNSUB ORACLE-L
 (or the name of mailing list you want to be removed from).  You may
 also send the HELP command for other information (like subscribing).


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Alex
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was unix time conversion function

2003-01-28 Thread Orr, Steve
Title: RE: Perl - Was unix time conversion function





Are you sure? It's written in C and is supposed to be relatively portable. I've not tried it on other platforms but, in addition to HP-UX and AIX, Python runs on: AS/400; Solaris; OS/2; Amiga; AROS; BeOS; PalmOS; QNX; VMS; VxWorks; Sony PlayStation; Sharp Zaurus; the MacIntosh, DOS; and all the Windows versions including WindowsCE. Then there's Jython, the Java implementation. Python comes packaged with most good O/S's. ;-) While Python doesn't have mindshare in the sysadmin community that's changing with the current exponential growth. Many PerlMongers have become Python converts and Pythonistas. 

Here's a quote:
While the rest of the world has been catching on to the Perl scripting language, the Linux community, long since past the pleasing shock of Perl's power, has been catching on to a different scripting animal -- Python.

http://www.linuxworld.com/linuxworld/expo/lw-python.html
http://www.linuxjournal.com/article.php?sid=3882



To know Python is to love Python... maybe some day the sneaky-snake will sneak up on you and the teeth of the hydra will be upon ya.

:-)



Steve



-Original Message-
From: Gogala, Mladen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 11:45 AM
To: Multiple recipients of list ORACLE-L
Subject: RE: Perl - Was unix time conversion function



I haven't done anything with Python but my problem with Python or Ruby is that
they don't come with many OS variants. Perl comes with any OS and there is a
huge repository of ready made scripts. I have to confess stealing some from Jared's PDBA
collection. I cannot do that with Python and then run them on both HP-UX and AIX.
Therefore, I'll stick to the pathologically eclectic rubbish lister. 
-Original Message-
From: Orr, Steve [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 1:00 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: Perl - Was unix time conversion function



If you can do it in Perl chances are you can do it better in Python and someone can actually read and understand it without a PHD... AKA Perl Helper Dweeb. :-) In Perl it takes effort to write readable code but it comes naturally in Python.


Check it out: 
www.python.org/doc/essays/blurb.html 
http://www.orbtech.com/web/python/why 
http://www.networkcomputing.com/unixworld/tutorial/005/005.html#Others 
http://www.developer.com/open/print.php/610691 




Steve Orr 
Oracle DBA and part-time Python Evangelist ;-) 



-Original Message- 
From: Keith Moore [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 28, 2003 9:49 AM 
To: Multiple recipients of list ORACLE-L 
Subject: Re: Perl - Was unix time conversion function 



I've started writing some perl and it is hard to learn, but once you learn, 
it can do some great things. And if you learned it from the Larry Wall book 
like I did, then it's even harder. 
The thing I've discovered about perl it that it may be the only language 
(computer or otherwise) that is easier to write than it is to read. I'm sure 
a perl expert would gasp at my code, it's far too readable. 
Keith 
- Original Message - 
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] 
Sent: Tuesday, January 28, 2003 10:09 AM 



 please don't take umbridge, but I feel enticed to quote 
 
 what you don't know, dosn't (really) matter 
 Larry Wall, programming with perl, O'Reilly. 
 
 just for a giggle. 
 
 sorry 
 
 apologies for any typos overlooked 
 
 kr mr 
  [EMAIL PROTECTED] 01/28/03 12:22 PM  
 I've managed to successfully avoid learning Perl for a while now... my 
 reaction, while not quite so dramatic as yours, was that it made my 
 head hurt to try to understand it! :) 
 
 
 --- Robert Freeman [EMAIL PROTECTED] wrote: 
  unix time conversion functionCary I once thought I wanted to do 
  some 
  Perl coding... So I bought a book and started to play with it. It 
  made my 
  head bleed... literally I had little droplets of blood emerging from 
  my 
  head They rushed me to the hospital and put me in the Perl ward 
  where I 
  languished for days on IV's of Mountain Dew and pulverized Ritz 
  crackers. it was close. 
  
  In my mind there is nothing obvious about Perl, this coming from and 
  old C 
  coder who did pointers and linked lists in his sleep years ago. I 
  don't 
  know, maybe I was having a bad day and it's time to get my learning 
  Perl 
  book out again 
  
  Anyone else feel that way about Perl or am I a lone wolf in a Perl 
  world? 
  
  RF 





Re: Perl - Was unix time conversion function

2003-01-28 Thread Tim Bunce
On Tue, Jan 28, 2003 at 09:59:46AM -0800, Orr, Steve wrote:
 If you can do it in Perl chances are you can do it better in Python and
 someone can actually read and understand it without a PHD... AKA Perl Helper
 Dweeb.  :-)  In Perl it takes effort to write readable code but it comes
 naturally in Python.
 
 
 Check it out:
 www.python.org/doc/essays/blurb.html
 http://www.orbtech.com/web/python/why
 http://www.networkcomputing.com/unixworld/tutorial/005/005.html#Others
 http://www.developer.com/open/print.php/610691

If you can do it in Perl chances are someone already has...

Check it out:
http://search.cpan.org

Just search for something...

Tim.
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Tim Bunce
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




Re: Perl - Was unix time conversion function

2003-01-28 Thread Glenn Stauffer
On Tue, 2003-01-28 at 17:49, Tim Bunce wrote:

 If you can do it in Perl chances are someone already has...
 
 Check it out:
 http://search.cpan.org
 
 Just search for something...
 

I think you'll find that the same is very rapidly becoming as true for
Python.  

I'm not trying to get into arguments over which language is better
because better is different for everyone.  Jared's book gives an
Oracle DBA strong incentive to use Perl.  But, if Perl doesn't fit your
thinking, do yourself a favor and start looking at other languages. 
You'll be a lot better off finding a programming language that you 'get'
as long as it works in the systems environment in which you do your
work.  For Oracle DBA's or Unix SysAdmins, I don't think you'd go wrong
to start your exploration with Python.

A good test of a programming language that you should try before you
sell your soul to it is this - write a relatively complex program, leave
it alone for 6 months, then go back to add some new non-trivial
functionality.  If you find yourself scratching your head trying to
figure out how the code works before you get started with adding to it,
think how many times you want to do that over the course of a lifetime.

That's what sold me on Python in a big way.  I write a bunch of programs
that I won't touch again for a half a year or more.  With Perl, I found
myself spending way too much time figuring out how the code worked
before I could start work on updating it.  With Python, it is seriously
a breeze for me to go back to old code, see how the program works, and
get started on changes.  My coding habits are likely partly to blame.  

Your mileage, as they say, may vary (considerably).

-- 
Glenn Stauffer
Swarthmore College
Swarthmore, PA
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Glenn Stauffer
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).




RE: Perl - Was unix time conversion function

2003-01-28 Thread Robert Freeman
Ok Jared, I'm going to buy your book and give it ONE MORE TRY.

I shall report my progress here.

RF

-Original Message-
[EMAIL PROTECTED]
Sent: Tuesday, January 28, 2003 11:51 AM
To: Multiple recipients of list ORACLE-L


Robert,

Perl isn't really that hard.

As with any language, it can be difficult to grasp at first, but once
you begin to understand it, it can be extremely powerful.

Regarding Cary's comments about the difficulty of complex Perl
data structures, I would have to say that they aren't any more difficult
than complex C data structures.

Data::Dumper is your friend.  It can be used to print the contents and
structure of any Perl data structure so that it is more easily understood.

As for Stephen Lee's comments that there's no need for Perl if you
have ksh:  I'll bet Stephen has a toolbox in his garage that  contains
a single flat blade screwdriver and no phillips screwdrivers nor any
wrenches.  ;)

You can do most anything in ksh:  I know, I've done it.  Then I learned
Perl.

Jared







Robert Freeman [EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
 01/27/2003 10:39 PM
 Please respond to ORACLE-L


To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
cc:
Subject:Perl - Was unix time conversion function


Cary I once thought I wanted to do some Perl coding... So I bought a
book and started to play with it. It made my head bleed... literally I had
little droplets of blood emerging from my head They rushed me to the
hospital and put me in the Perl ward where I languished for days on IV's
of Mountain Dew and pulverized Ritz crackers. it was close.

In my mind there is nothing obvious about Perl, this coming from and old C
coder who did pointers and linked lists in his sleep years ago. I don't
know, maybe I was having a bad day and it's time to get my learning Perl
book out again

Anyone else feel that way about Perl or am I a lone wolf in a Perl world?

RF
-Original Message-
Sent: Friday, January 24, 2003 4:29 PM
To: Multiple recipients of list ORACLE-L

At the risk of stating the obvious, doing it in Perl looks like this:

#!/usr/bin/perl
use Date::Format qw(time2str);
my $t = 1043447100; # for example
print time2str(%T %A %d %B %Y, $t), \n;

Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com

Upcoming events:
- 2003 Hotsos Symposium on Oracle® System Performance, Feb 9?12 Dallas
- RMOUG Training Days 2003, Mar 5?6 Denver
- Hotsos Clinic 101, Mar 26?28 London
-Original Message-
Sent: Friday, January 24, 2003 3:30 PM
To: Multiple recipients of list ORACLE-L

Kinda...you can change the year to 1970 if you want, this also converts to
minutes, not seconds.  It is a really ugly function but it seems to work.
You could always use perl.

function f_minutes {
   # Funky function I use to calculate the number of minutes since 2000
   MIN_YEAR=$( date +%Y )
   MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
   MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
   MIN_DAYS=$( date +%j )
   MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
   MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
   MIN_HOURS=$( date +%H )
   MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
   MIN_MINS=$( date +%M )
   MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} + ${MIN_MINS} ))
   print ${MIN_TOTAL}
}
-Original Message-
Sent: Friday, January 24, 2003 1:14 PM
To: Multiple recipients of list ORACLE-L
Anybody got a handy little function to
convert a standard unix seconds-since-Jan-1970 epoch
time (stored as a number) to a readable date?
It would save me a lot of time not having to re-invent the
wheel.
Matt

Matt Adams - GE Appliances - [EMAIL PROTECTED]
My computer beat me at chess, but I won
when it came to kick boxing.


--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author:
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Robert Freeman
  INET: [EMAIL PROTECTED]

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information

unix time conversion function

2003-01-24 Thread Adams, Matthew (GECP, MABG, 088130)
Title: unix time conversion function





Anybody got a handy little function to 
convert a standard unix seconds-since-Jan-1970 epoch
time (stored as a number) to a readable date?


It would save me a lot of time not having to re-invent the 
wheel.


Matt



Matt Adams - GE Appliances - [EMAIL PROTECTED]
My computer beat me at chess, but I won
when it came to kick boxing.





RE: unix time conversion function

2003-01-24 Thread Adams, Matthew (GECP, MABG, 088130)
Title: RE: unix time conversion function





Nevermind,


Once I thought about it for more than 30 seconds, 
I got it.



TO_DATE('01/01/1970','MM/DD/') + SECONDS / 86400


easy as 3.141592654 



Matt Adams - GE Appliances - [EMAIL PROTECTED]
My computer beat me at chess, but I won
when it came to kick boxing.


-Original Message-
From: Adams, Matthew (GECP, MABG, 088130) 
Sent: Friday, January 24, 2003 2:12 PM
To: '[EMAIL PROTECTED]'
Subject: unix time conversion function



Anybody got a handy little function to 
convert a standard unix seconds-since-Jan-1970 epoch
time (stored as a number) to a readable date?


It would save me a lot of time not having to re-invent the 
wheel.


Matt



Matt Adams - GE Appliances - [EMAIL PROTECTED]
My computer beat me at chess, but I won
when it came to kick boxing.





RE: unix time conversion function

2003-01-24 Thread Post, Ethan
Title: unix time conversion function



Kinda...you can change the year to 1970 if you want, this also converts 
to minutes, not seconds. It is a really ugly function but it seems to 
work. You could always use perl.

function f_minutes { # Funky function I use to calculate 
the number of minutes since 2000 MIN_YEAR=$( date +"%Y" 
) MIN_YEAR=$( expr ${MIN_YEAR} - 2000 ) 
MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 ) MIN_DAYS=$( date +"%j" 
) MIN_DAYS=$( expr "${MIN_DAYS}" - 1 ) 
MIN_DAYS=$( expr "${MIN_DAYS}" \* 1440 ) MIN_HOURS=$( date +"%H" 
) MIN_HOURS=$( expr "${MIN_HOURS}" \* 60 ) 
MIN_MINS=$( date +"%M" ) MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} 
+ ${MIN_HOURS} + ${MIN_MINS} )) print 
${MIN_TOTAL}}

  -Original Message-From: Adams, Matthew (GECP, MABG, 
  088130) [mailto:[EMAIL PROTECTED]]Sent: Friday, January 24, 
  2003 1:14 PMTo: Multiple recipients of list 
  ORACLE-LSubject: unix time conversion function
  Anybody got a handy little function to convert a standard unix seconds-since-Jan-1970 epoch time (stored as a number) to a readable date? 
  It would save me a lot of time not having to re-invent the 
  wheel. 
  Matt 
   Matt Adams - GE Appliances - 
  [EMAIL PROTECTED] My computer beat me at chess, 
  but I won when it came to kick boxing. 



RE: unix time conversion function

2003-01-24 Thread Cary Millsap
Title: unix time conversion function









At the risk of stating the obvious, doing
it in Perl looks like this:



#!/usr/bin/perl

use Date::Format qw(time2str);

my $t = 1043447100; # for example

print time2str(%T %A %d %B %Y,
$t), \n;





Cary Millsap
Hotsos Enterprises, Ltd.
http://www.hotsos.com

Upcoming events:
- 2003 Hotsos Symposium on
Oracle System Performance, Feb 912 Dallas
- RMOUG Training Days 2003, Mar 56
Denver
- Hotsos Clinic101,
Mar 2628 London



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Post,
Ethan
Sent: Friday, January 24, 2003
3:30 PM
To: Multiple recipients of list
ORACLE-L
Subject: RE: unix time conversion
function





Kinda...you can
change the year to 1970 if you want, this also converts to minutes, not
seconds. It is a really ugly function but it seems to work. You
could always use perl.











function
f_minutes {
 # Funky function I use to calculate the number of minutes since
2000
 MIN_YEAR=$( date +%Y )
 MIN_YEAR=$( expr ${MIN_YEAR} - 2000 )
 MIN_YEAR=$( expr ${MIN_YEAR} \* 525600 )
 MIN_DAYS=$( date +%j )
 MIN_DAYS=$( expr ${MIN_DAYS} - 1 )
 MIN_DAYS=$( expr ${MIN_DAYS} \* 1440 )
 MIN_HOURS=$( date +%H )
 MIN_HOURS=$( expr ${MIN_HOURS} \* 60 )
 MIN_MINS=$( date +%M )
 MIN_TOTAL=$(( ${MIN_YEAR} + ${MIN_DAYS} + ${MIN_HOURS} +
${MIN_MINS} ))
 print ${MIN_TOTAL}
}





-Original Message-
From: Adams, Matthew (GECP, MABG,
088130) [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 24, 2003
1:14 PM
To: Multiple recipients of list
ORACLE-L
Subject: unix time conversion
function

Anybody
got a handy little function to 
convert a standard unix
seconds-since-Jan-1970 epoch 
time (stored as a number) to a
readable date? 

It would
save me a lot of time not having to re-invent the 
wheel. 

Matt




Matt Adams - GE Appliances -
[EMAIL PROTECTED] 
My computer beat me at chess, but I
won 
when it came to kick boxing.











RE: unix time conversion function

2003-01-24 Thread Post, Ethan
Title: unix time conversion function



Yes I knew it was easier in perl, I prefer to 
distribute a single script whenever possible and I write pretty much everything 
in shell. However, I just figured out a trick to put the perl directlyin 
my .ksh scripts (see the post I posted a few minutes ago) so I will likely 
change the way I have been doing that. Thanks for the perl however, saved 
me some time looking it up!

See ya at the Symposium!

Thanks,
Ethan

  -Original Message-From: Cary Millsap 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, January 24, 2003 4:29 
  PMTo: Multiple recipients of list ORACLE-LSubject: RE: 
  unix time conversion function
  
  At the risk of 
  stating the obvious, doing it in Perl looks like this:
  
  #!/usr/bin/perl
  use Date::Format 
  qw(time2str);
  my $t = 1043447100; # 
  for example
  print time2str("%T %A 
  %d %B %Y", $t), "\n";
  
  
  Cary 
  MillsapHotsos 
  Enterprises, Ltd.http://www.hotsos.comUpcoming 
  events:- 2003 Hotsos 
  Symposium on Oracle® System Performance, Feb 9-12 Dallas- 
  RMOUG Training Days 2003, Mar 5-6 
  Denver- Hotsos 
  Clinic101, Mar 26-28 
London