[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [SVN-DEV] Re: [PATCH] replacement for getdate.y

From: C. Scott Ananian <cananian_at_lesser-magoo.lcs.mit.edu>
Date: 2001-08-23 21:10:59 CEST

On Thu, 23 Aug 2001, Branko [ISO-8859-2] �ibej wrote:

> >The attached patch replaces getdate.y and getdate.cw with the new
> >svn_date.c code. Instructions:
[...]
> Unfortunately, IMO it not ready for commit yet. [...]

yeah, granted; I just had to do the patch to show y'all that it fits in
and actually works with the SVN stuff.

Here's my proposal for making it more portable:
 - I like your idea of the apr_strptime function. I also agree that it
   will be very hard to do all the localization stuff in a
   reimplementation of strptime. So apr_strptime should use the native
   strptime if available (getting all the localization goodies) or it
   should fall back to its own somewhat simpler implementation of strptime
   otherwise. No localization, but all the basic features will still
   work. I assume we've got SVN guys in close with the APR developers so
   that I could get a apr_strptime API committed if written?

> * I wouldn't start using gettext just now. Maybe just use it as a
> marker. I'd like to take time to review the gettext usage, anyway.

 - okay, you should do this ASAP, because I don't like the idea of ripping
   out gettext for no good reason. You've got two choices: catgets or
   gettext. Neither are POSIX, and there are LGPL'ed as well as GPLed
   implementations of both. I don't care which, just choose one.

> At first glance, it's too simplistic. (For instance, in Slovenian,
> having only a choice of "%d <whatever> ago" and "%d <whatever>s
> ago" is not enough.

 - That's not a problem for my implementation at all. You can have as
   many phrase entries as you want. Perhaps you could help me out by
   providing all the reasonable Slovenian variants for, let's say, "N
   years ago". Romance languages (with which I am most familiar) are nice
   in that there are very few noun inflections. Slovanian undoubtedly has
   more, but the basic technique should still work: even if Slovanian
   has 99 different noun declensions for the numbers 1-99, we can
   certainly include the forms for "1 year ago" to "9 years ago" which
   should cover the most common cases. I'm not claiming that our parser
   will be able to parse any time concept expressible in the language,
   just the most useful common ones.

> See `info gettext', the bit about mgettext().

I think you meant 'ngettext', which seems to be a GNU-gettext-only
function. In any case, it's not needed, because the parser is sloppy.
The current parser allows you to say both:
   "1 years" and "2 year"
it doesn't care that the nouns don't match. As long as there are a finite
number of plural forms in Slovenian [there are, right? =) ] we can attempt
to match them all.

OK, that's all for now. Off I go to write apr_strptime.
 --s

Boston postcard plastique quiche Moscow Leitrim anthrax Qaddafi NSA
SEAL Team 6 Yakima Cocaine SSBN 731 Peking shotgun Rule Psix operation
              ( http://lesser-magoo.lcs.mit.edu/~cananian )
 --
 "These students are going to have to find out what law and order is
 all about." -- Brig. General Robert Canterbury, Noon, May 4, 1970,
 minutes before his troops shot 13 unarmed Kent State students, killing 4.
 --
            [http://www.cs.cmu.edu/~dst/DeCSS/Gallery/]
#!/usr/bin/perl -w
# 526-byte qrpff, Keith Winstein and Marc Horowitz <sipb-iap-dvd@mit.edu>
# MPEG 2 PS VOB file on stdin -> descrambled output on stdout
# arguments: title key bytes in least to most-significant order
$_='while(read+STDIN,$_,2048){$a=29;$c=142;if((@a=unx"C*",$_)[20]&48){$h=5;
$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$d=
unxV,xb25,$_;$b=73;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=($t=255)&($d
>>12^$d>>4^$d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9
,$_=(map{$_%16or$t^=$c^=($m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t
^=(72,@z=(64,72,$a^=12*($_%16-2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271))
[$_]^(($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:36 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.