Author Topic: ddate  (Read 533 times)

ElSJaako

  • Newbie
  • *
  • Posts: 17
    • View Profile
ddate
« on: May 12, 2013, 04:30:09 PM »
One of the subtle fun things about being a discordian is seeing Discordianism popping up in unexpected places. We got a dwarf planet named (possibly), got a TV-show host to make some vague references (probably), and there's a copy of our holy book in the JFK assassination archives.

But one of the nerdiest places Discordianism used to turn up is on almost every linux computer. There was a program included by default called "ddate" that calculates the discordian date. I'll give you my output right now:

Code: [Select]
Today is Prickle-Prickle, the 65th day of Bureaucracy in the YOLD 3178
Ddate was on almost every system because it was included in a useful package of common programs call util-linux, and this package was installed on every system. Unfortunately the current maintainer of util-linux has decided that ddate is a "crazy thing" and has recently decided that it should be removed from linux by default. He did this on June 8, 2012. This K. Zak (Fun fact: "K. Zak" is the Dutch equivalent to "A. Hole") doesn't like us having fun.

Ddate was written on the 65th day of The Aftermath in the Year of Our Lady of Discord 3157 (23 dec 1991) by Druel the Chaotic (Jeremy Johnson), obviously in a fit of pre-christmas religious fervor.

In early 1994 Lee Harvey Oswald Smith, K.S.C. created a package of discordian softwares that he called "The Emperor Norton Utilities":
Quote
The Emperor Norton Utilities is a collectionm of Discordian software. It is the software equivalent of Discordian sainthood. The utilities include mainstays such as ddate, M-x dissociate, and chef, as well as anything you may care to nominate. Indeed, it can contain entire operating systems (such as Linux) and even hardware devices (such as the software-controlled Amiga power light). The documentation for this software consists of the Principia Discordia, the Ludwig Plutonium Hymnbook, Kibo's signature and that sign in California which reads STOP CASTING POROSITY", as well as other sacred tracts too numerous to mention.
(M-x dissociate is a script for transforming any text into potentially humorous garbage. Chef does pretty much the same thing, but in Swedish. Kibo is someone worth looking up, if you haven't heard about him)

In 2002 Göran Weinholt defended ddate beautifully:
Quote
  > People with more traditional moral values might not
  > appreciate a reference to or advertisement for this movement
  > being present on their system.  However, because it is in
  > util-linux, they will not be able to selectively remove it
  > (unless they write a script that is to be run after every
  > upgrade).
 
  I for one will not stand for this. I personally use ddate, I use it in
  some scripts, I know other people do the same, and I know some Debian
  developers would be annoyed if ddate was removed. There are even programs
  that use ddate, e.g. freecraft and the games that use its engine.
 
  I will be very sad if Debian can't include ddate because an imaginary
  user with "traditional moral values" means more than real users.


 Unfortunately, 10 years later, his plea was not heard, and ddate is out of default linux, and on most systems you need to add it yourself.
« Last Edit: May 30, 2013, 03:50:51 PM by ElSJaako »
All materials posted here by me are kopyleft

ElSJaako

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: ddate
« Reply #1 on: May 12, 2013, 04:30:57 PM »
Credit to El Sjaako please. There is a version with slightly more boring facts at: http://www.abnormail.org/ddate/
All materials posted here by me are kopyleft

High Priest

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: ddate
« Reply #2 on: May 12, 2013, 05:48:24 PM »
ddate was recently removed from util-linux hosted on kernel.org. In version 2.23 in fact, the most recent version. If you read the 2.23 Release Notes it says:

Quote
The command ddate has been REMOVED from util-linux.  You can find it here:
https://github.com/bo0ts/ddate

We could include a link to the ddate code at the bottom of this article.

PlacidDingo

  • Administrator
  • Newbie
  • *****
  • Posts: 33
    • View Profile
Re: ddate
« Reply #3 on: May 13, 2013, 01:00:40 AM »
I like the idea of the code being included.

ElSJaako

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: ddate
« Reply #4 on: May 13, 2013, 02:14:01 PM »
If you want to include the code you should probably go for an older, less complicated version.
All materials posted here by me are kopyleft

High Priest

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: ddate
« Reply #5 on: May 15, 2013, 01:47:38 PM »
just link to it somewhere, not the code itself.

ddate written in other languages than C here: http://rosettacode.org/wiki/Discordian_date
though ive noticed the diff code on that pages sometimes gets the date right but the day name wrong.

enkiv2

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: ddate
« Reply #6 on: May 15, 2013, 05:24:27 PM »
I'd be in favor of incorporating the code, so long as it's short and in a thematically obscure language (albiet one that does not depend upon whitespace, since the editor may well lose information in formatting -- my primary argument against python, which while not obscure is both short and thematic).

I see nothing truly appropriate on that page, though, so I'll see if I can re-implement it in something funnier.

(Probably, we'd want to use something from this list: http://esolangs.org/wiki/Language_list )

Alternately, the issue itself could be a valid program in BrainFNORD (http://esolangs.org/wiki/BrainFNORD) that performs the operation, though that might involve having several pages of junk somewhere, or being very long.

ElSJaako

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: ddate
« Reply #7 on: May 16, 2013, 10:56:41 AM »
As much as I'd like to see an INTERCAL or Brainfuck version of ddate, this article is about the C version that was included in bin-utils.

So this is the code I'd use:

Code: [Select]
/* DiscDate.C .. converts boring normal dates to fun Discordian Date -><-
   written  the 65th day of The Aftermath in the Year of Our Lady of
   Discord 3157 by Druel the Chaotic aka Jeremy Johnson aka
   mpython@gnu.ai.mit.edu 
      Worcester MA 01609

   and I'm not responsible if this program messes anything up (except your
   mind, I'm responsible for that)
*/

#include <time.h>
#include <string.h>
#include <stdio.h>

struct disc_time
{int season; /* 0-4 */
 int day; /* 0-72 */
 int yday; /* 0-365 */
 int year; /* 3066- */
};

char *ending(int);
void print(struct disc_time,char **);
struct disc_time convert(int,int);
struct disc_time makeday(int,int,int);

main (int argc,char **argv)
{long t;
 struct tm *eris;
 int bob,raw;
 struct disc_time hastur;
 if (argc==4)
    { int moe,larry,curly;
      moe=atoi(argv[1]);
      larry=atoi(argv[2]);
      curly=atoi(argv[3]);
      hastur=makeday(moe,larry,curly);
    }
  else if (argc!=1)
    { fprintf(stderr,"Syntax: DiscDate [month day year]");
      exit(1);
    }
  else
    {
      t= time(NULL);
      eris=localtime(&t);
      bob=eris->tm_yday; /* days since Jan 1. */
      raw=eris->tm_year; /* years since 1980 */
      hastur=convert(bob,raw);
    }
      print(hastur,argv);
}

struct disc_time makeday(int imonth,int iday,int iyear) /*i for input */
{ struct disc_time this;
 
  int cal[2][12] =
    {
       31,28,31,30,31,30,31,31,30,31,30,31,
       31,29,31,30,31,30,31,31,30,31,30,31
    };
  int dayspast=0;
  imonth--;
  this.year= iyear+1166;
  while(imonth>0)
     {
       dayspast+=cal[(this.year%4)==2 ? 1 : 0 ][--imonth];
     }
  this.day=dayspast+iday-1;
  this.season=0;
   if((this.year%4)==2)
     {
       if (this.day==59)
         this.day=-1;
       else if (this.day>59)
         this.day-=1;
     }
  this.yday=this.day;
  while(this.day>=73)
      {
this.season++;
this.day-=73;
      }
  return this;
 
}

char *ending(int num)

 int temp;
 char *this;
 
 this=(char *)malloc(sizeof(char)*3);
 
  temp=num%10; /* get 0-9 */ 
  switch (temp)
  { case 1:
      strcpy(this,"st");
      break;
    case 2:
      strcpy(this,"nd");
      break;
    case 3:
      strcpy(this,"rd");
      break;
    default:
      strcpy(this,"th");
    }
 return this;
}

struct disc_time convert(int nday, int nyear)
{  struct disc_time this;
   
   this.year = nyear+3066;
   this.day=nday;
   this.season=0;
   if ((this.year%4)==2)
     {if (this.day==59)
this.day=-1;
     else if (this.day >59)
       this.day-=1;
    }
   this.yday=this.day;
   while (this.day>=73)
     { this.season++;
       this.day-=73;
     }
   return this;
 
 }

void print(struct disc_time tick, char **args)
{ char *days[5] = { "Sweetmorn",
    "Boomtime",
    "Pungenday",
    "Prickle-Prickle",
    "Setting Orange"
  };
  char *seasons[5] = { "Chaos",
       "Discord",
       "Confusion",
       "Bureaucracy",
       "The Aftermath"
                     };
  char *holidays[5][2] = { "Mungday", "Chaoflux",
   "Mojoday", "Discoflux",
   "Syaday",  "Confuflux",
   "Zaraday", "Bureflux",
   "Maladay", "Afflux"
};
  if (args[1]==NULL)
    printf("Today is ");
  else
    printf("%s-%s-%s is ",args[1],args[2],args[3]);
  if (tick.day==-1) printf("St. Tib's Day!");
  else
    { tick.day++;
      printf("%s",days[tick.yday%5]);
      printf(",the %d", tick.day);
      printf("%s day of %s",ending(tick.day),seasons[tick.season]) ;
    }
  printf(" in the YOLD %d\n",tick.year);
  if ((tick.day==5)||(tick.day==50))
    { printf("Celebrate ");
      if (tick.day==5)
printf("%s\n",holidays[tick.season][0]);
      else
printf("%s\n",holidays[tick.season][1]);
    }
}
All materials posted here by me are kopyleft