Главная страница


ru.unix

 
 - RU.UNIX ----------------------------------------------------------------------
 From : Stepan Koltsov                       2:5020/400     06 Sep 2001  17:36:31
 To : "Alexey Neyman"
 Subject : Re: 1 000 000 000 seconds since the Epoch
 -------------------------------------------------------------------------------- 
 
 Hаплодят всякого кала в /tmp, а мне потом разгребать... Hадо
 
 #!/bin/sh
 set -e
 cleanup() { rm /tmp/epoch 2>/dev/null; }
 trap cleanup 0
 gcc -o/tmp/epoch -xc - << !EOF
 ... text of program
 !EOF
 /tmp/epoch
 # :-)
 Alexey Neyman <alex.neyman@auriga.ru> wrote:
 
 > On Thu, 06 Sep 2001 14:46:06 +0400 Jen Linkova <jen@comp.chem.msu.su> wrote:
 > JL> Sergey Skvortsov <skv@protey.ru> wrote:
 >>> perl -e "print scalar localtime 1000000000;"
 > JL> 
 >>> Sun Sep  9 05:46:40 2001        
 > JL> 
 > JL> Таак..Кто следующий? ;-) Это уже n-ый постинг (n>3) за последнее время ;-)
 > JL> И вообще - зачем все так усложнять? perl, print, scalar, localtime 
 > Hо мне кажется, я знаю, во что это выльется :)
 > В соревнование, на скольких языках можно сосчитать 10^9 секунд от Эпохи.
 
 > Кстати, из книги про POSIX.4, Programming for the Real World, глава Basic
 > Unix Clocks:
 
 > The time call is standard in System V and POSIX.1. It returns the number
 > of seconds, which are the number of seconds that have expired since the
 > world was created. According to UNIX lore, the world was created in the
 > dim, distant past, when monstrous beasts roamed the earth: 00:00 AM,
 > January 1, 1970. This time is called The Epoch, and in that time there
 > were no microwaves, compact discs, or ATM machines, and there was very
 > little cable television. You can see why time doesn't go back any further
 > than that.
 
 > Мой вклад:
 > ----- epoch.sh -----
 > #! /bin/sh
 
 > cat > /tmp/epoch.c << !END
 > #define _POSIX_SOURCE
 > #include <sys/types.h>
 > #include <unistd.h>
 > #include <stdio.h>
 > #include <time.h>
 
 > int main(void)
 > {
 >  time_t x = (time_t)1000000000;
 >  printf("1.000.000.000 seconds since the Epoch:\n%s",
 >     asctime(localtime(&x)));
 >  return 0;
 > }
 > !END
 > gcc -o /tmp/epoch /tmp/epoch.c
 > /tmp/epoch
 > rm /tmp/epoch /tmp/epoch.c
 > ----- end -----
 
 > -- 
 > -------------------------------+---------------------------------
 >      May the Sun and Water     |     Regards, Alexey V. Neyman
 >      always fall upon you!     |   mailto: alex.neyman@auriga.ru
 > -------------------------------+---------------------------------
 
 -- 
 mailto:yozh@mx1.ru
 ICQ:26521795
 http://www.mx1.ru/
 
 ... Они жили долго и счастливо и надоели друг другу в один день...
 --- ifmail v.2.15dev5
  * Origin: Defi (2:5020/400)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 1 000 000 000 seconds since the Epoch   Sergey Skvortsov   06 Sep 2001 15:25:33 
 Re: 1 000 000 000 seconds since the Epoch   Jen Linkova   06 Sep 2001 14:46:06 
 Re: 1 000 000 000 seconds since the Epoch   Alexey Neyman   06 Sep 2001 16:26:59 
 Re: 1 000 000 000 seconds since the Epoch   Stepan Koltsov   06 Sep 2001 17:36:31 
 Re: 1 000 000 000 seconds since the Epoch   Michael B. Babakov   07 Sep 2001 21:32:54 
 Re: 1 000 000 000 seconds since the Epoch   Nikki Chumakov   07 Sep 2001 22:01:24 
 Re: 1 000 000 000 seconds since the Epoch   Nikki Chumakov   07 Sep 2001 22:11:33 
 Re: 1 000 000 000 seconds since the Epoch   Alex Korchmar   08 Sep 2001 00:24:22 
 Re: 1 000 000 000 seconds since the Epoch   Andrey Blochintsev   08 Sep 2001 13:56:30 
 1 000 000 000 seconds since the Epoch   Serguei Revtov   08 Sep 2001 13:06:52 
 1 000 000 000 seconds since the Epoch   pavel kurnosoff   08 Sep 2001 16:25:04 
 Re: 1 000 000 000 seconds since the Epoch   Antony Y. Bolotin   07 Sep 2001 22:09:31 
 1 000 000 000 seconds since the Epoch   Slawa Olhovchenkov   07 Sep 2001 21:53:32 
 1 000 000 000 seconds since the Epoch   Serge Matveev   07 Sep 2001 23:53:44 
 Re: 1 000 000 000 seconds since the Epoch   Valery Shishkov   08 Sep 2001 14:47:42 
 Re: 1 000 000 000 seconds since the Epoch   Valentin Nechayev   08 Sep 2001 10:08:08 
 1 000 000 000 seconds since the Epoch   Serge Matveev   08 Sep 2001 15:03:56 
 Re: 1 000 000 000 seconds since the Epoch   Victor Sudakov   10 Sep 2001 04:38:43 
 1 000 000 000 seconds since the Epoch   Valentin Nechayev   10 Sep 2001 11:33:59 
 Re: 1 000 000 000 seconds since the Epoch   Alex Korchmar   11 Sep 2001 00:07:16 
 Re: 1 000 000 000 seconds since the Epoch   Nikki Chumakov   11 Sep 2001 01:36:31 
 1 000 000 000 seconds since the Epoch   Valentin Nechayev   13 Sep 2001 16:51:04 
 Re: 1 000 000 000 seconds since the Epoch   Antony Y. Bolotin   14 Sep 2001 14:22:39 
 1 000 000 000 seconds since the Epoch   Slawa Olhovchenkov   12 Sep 2001 17:35:54 
 Re: 1 000 000 000 seconds since the Epoch   Valentin Nechayev   13 Sep 2001 16:03:48 
 1 000 000 000 seconds since the Epoch   Slawa Olhovchenkov   13 Sep 2001 17:31:02 
 Re: 1 000 000 000 seconds since the Epoch   Oleg Polianski   14 Sep 2001 07:13:12 
 1 000 000 000 seconds since the Epoch   Slawa Olhovchenkov   14 Sep 2001 10:08:14 
 1 000 000 000 seconds since the Epoch   Lev Serebryakov   14 Sep 2001 12:30:23 
 Re: 1 000 000 000 seconds since the Epoch   Oleg Polianski   14 Sep 2001 13:39:37 
 1 000 000 000 seconds since the Epoch   Lev Serebryakov   14 Sep 2001 15:25:45 
 Re: 1 000 000 000 seconds since the Epoch   Oleg Polianski   15 Sep 2001 10:52:36 
 1 000 000 000 seconds since the Epoch   Alexey Froloff   09 Sep 2001 01:01:09 
 1 000 000 000 seconds since the Epoch   Andrey N. Demushkin   08 Sep 2001 09:44:56 
 Re: 1 000 000 000 seconds since the Epoch   Maxim Timofeyev   09 Sep 2001 17:40:23 
 1 000 000 000 seconds since the Epoch   Andrey N. Demushkin   10 Sep 2001 00:45:50 
 Re: 1 000 000 000 seconds since the Epoch   Maxim Timofeyev   10 Sep 2001 15:13:05 
Архивное /ru.unix/7807bc12fe22.html, оценка 2 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional