Re: [FWP] sorting text in human-order
Glenn Linderman <[EMAIL PROTECTED]> writes: > David Cantrell wrote: > > > And in any case, I can think of three different ways of saying 1821 in > > English alone. > > > > One thousand eight hundred and twenty one > > One thousand eight hundred twenty one > > Eighteen hundred and twenty one > > > > As far as *I* am concerned, the middle one is wrong (although I believe it > > is considered correct in some parts of the world), and whether to use the > > first or the thrid form would depend on context. > > At the grade school I attended here in the United States, I was taught > that the first and third forms would represent the number 1800.21 -- > the "and" is used to represent a decimal point or the beginning of a > fraction (as in "one and one quarter" or "one and two thirds"). And > there is a good bit of ambiguity without a trailing "hundredths", > because it could be "thousandths" or even "millionths". But, but... 0.21 is *not* 'point twenty one', it's 'point two one', otherwise you get into weirdness with: .21 and .210 being spoken as 'point twenty one' and 'point two hundred (?:and)? ten' and all of a sudden the '2' in that figure has gained an order of magnitude which is just plain *wrong*. Ghod knows how this GST would have you pronounce 5.6.0, 'five and six and oh'? -- Piers
Re: [FWP] sorting text in human-order
On Fri, 05 Jan 2001, Piers Cawley wrote: > But, but... 0.21 is *not* 'point twenty one', it's 'point two one', > otherwise you get into weirdness with: .21 and .210 being spoken as > 'point twenty one' and 'point two hundred (?:and)? ten' and all of a > sudden the '2' in that figure has gained an order of magnitude which > is just plain *wrong*. Then it would be "one eight zero zero point two one." Yes, at least the U.S. used to teach that the gratuitous use of "and" was wrong - "one thousand eight hundred twenty-one," but the rules have been loosened for integer numbers. One thousand eight hundred twenty-one. One thousand eight hundred and twenty-one Eighteen hundred and twenty-one. One thousand eight hundred and twenty-one hundredths. One thousand eight hundred and two million, one hundred thousand ten millionths. How did we get on this subject? Oh, yes, sorting by the number spelled out... That should throw several cultures for a loop. Four and twenty blackbirds, baked 'e' and 'pi'. > > Ghod knows how this GST would have you pronounce 5.6.0, 'five and six > and oh'? The computer kulture has its own rules for written and spoken grammar. -- Bryan C. Warnock bwarnock@(gtemail.net|capita.com)
Re: [FWP] sorting text in human-order
"Bryan C. Warnock" <[EMAIL PROTECTED]> wrote: > On Fri, 05 Jan 2001, Piers Cawley wrote: > > But, but... 0.21 is *not* 'point twenty one', it's 'point two one', > > otherwise you get into weirdness with: .21 and .210 being spoken as > > 'point twenty one' and 'point two hundred (?:and)? ten' and all of a > > sudden the '2' in that figure has gained an order of magnitude which > > is just plain *wrong*. > > Then it would be "one eight zero zero point two one." > Yes, at least the U.S. used to teach that the gratuitous use of "and" was > wrong - "one thousand eight hundred twenty-one," but the rules have been > loosened for integer numbers. Are you guys nuts or just bored? Ok, let's be pedantic. The one thing that I learned in high school speech class was that, if you say it, and people understand you, it's correct. It may not be proper, but it's correct, because it serves its purpose. The discussion was about the word "ain't". However, I think it applies. In proper American English, to be gramatically correct, there is no "and" in $109.00 ("One hundred nine dollars"). We usually say "One hundred and nine dollars", however, when speaking, especially in the south and midwest. Since internet communication is more typed speech than written messages, it could be seen as either/or. In British English, the and is normally used for a decimal point for money except in Britain itself (colonies have different currency... I've yet to know what a quid is in England), ommitted for real numbers otherwise. In german and other languages, however, and ("und") is used quite frequently, and left out for the cents (DM129.09 "Ein hundert neun und zwanzig Mark neun"). 0.005 is either "zero point zero zero 5" in American English, or "five one thousandths", with the former normally substituting "oh" (which is incorrect since "oh" is a letter not a number) and the latter is falling out of use. FWIW, I pronounce 5.6.0 as "five six oh" and "command.com" as "command com" and "autoexec.bat" as "autoexec bat" and every other file name I pronounce the "dot". (I pronounced 5.005_03 as "five double-aught five oh three".) The point is, if people understand you, you said it in one of possibly several "correct" ways. If people look at you funny, you need some adjustment. p's $0.02 p
Multithreaded Socket
Hi, can you give me a hand...I am getting serious problem with my Multithreaded Socket. Can you send me a simple code regarding this issue. I'm under pressure to finish the code. Anyway I am sending my code so you can pinpoint the error(TONS OF DEFUNCT PROCESSES ARE BEING CREATED) Tks in advance. #!/usr/up/tools/bin/perl5 push(@INC, "/usr/up/papi/lib"); require 5.002; use strict; use Socket; use Carp; my $sub; my $rc; my $self; my $zombie; my $port = X; my $proto = getprotobyname('tcp'); my $paddr; my $Sbuff; my $Nbuff; my $child; my $iaddr; socket(Server, PF_INET, SOCK_STREAM, $proto) || die "socket: $!"; setsockopt(Server, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) || die "setsockopt: $!"; bind(Server, sockaddr_in($port, INADDR_ANY)) || die "bind: $!"; listen(Server,SOMAXCONN) || die "listen: $!"; select(STDOUT); $| = 1; # ( autoflushing) select(Server); $| = 1; while(1) { $paddr = accept(Client,Server)|| die "Erro accept() - $!"; select(Client); $| = 1; if(($child = fork()) == 0) { ($port,$iaddr) = sockaddr_in($paddr); while ( defined(sysread(Client,$Sbuff,300)) ) {&Retrieve_SubId($Sbuff); # GETS THE ID close(Client); } exit; }# Fim do if fork() else{ do{ $zombie = waitpid(-1,$child);#Se tiver processo aberto, mata o processo print STDOUT $zombie }until $zombie == -1; } close(Client); # Caso nao entre no fork() } # Fim do while
Re: Multithreaded Socket
At 06:02 PM 1/5/01 -0800, Andre Ferrari de Aquino wrote: >Hi, can you give me a hand...I am getting serious problem with my >Multithreaded Socket. Can you send me a simple code regarding this >issue. I'm under pressure to finish the code. Anyway I am sending my code >so you can pinpoint the error(TONS OF DEFUNCT PROCESSES ARE BEING CREATED) You have the wrong mailing list--this one is for the design of perl 6. You might want to ask this on the comp.lang.perl.misc newsgroup. Dan --"it's like this"--- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk
Re: [FWP] sorting text in human-order
David Grove wrote: > > Ok, let's be pedantic. Everyone is pedantic. And they're all *right*. > The one thing that I learned in high school speech class was that, if you > say it, and people understand you, it's correct. It may not be proper, but > it's correct, because it serves its purpose. This is an anti-pedantic argument. (Not that I disagree...) > We usually say "One hundred and > nine dollars", however, when speaking, especially in the south and > midwest. Wow, you do get around. > In British English, the and is > normally used for a decimal point for money except in Britain itself What other British English are you referring to? > I've yet to know what a quid is It's a pound, of course. > ommitted You mean "omitted", right? Not to be pedantic... > languages, however, and ("und") is used quite frequently, and left out for > the cents (DM129.09 "Ein hundert neun und zwanzig Mark neun"). Not unheard of in English, either. Five foot two, eyes of blue... Can also be seen in certain technical protocols, such as resistances: 4K7 Ohms = 4700 Ohms. > (I pronounced 5.005_03 as "five double-aught five oh three".) That's not pedantic, that's anal. I say "five five three". ObPerl: use Lingua::EN::Numbers; sub infix_units { my( $n, $u ) = $_[0] =~ /([.\d]+)\s*(\w+)/; my $s = Lingua::EN::Numbers->new($n)->get_string; $s =~ s/point/$u/g; $s } print infix_units( "45.60 Pounds" ); -- John Porter What would Gabrielle do?
Re: [FWP] sorting text in human-order
generally speaking when you look a number and convert it into text you go through some simble steps say we start with this number 123,456,789 first we divide into sets of three (123,000,000)+(456,000)+(789) then we expand (123*1,000,000) + (456*1,000)+(789) and expand further (((1*100)+(20+3))*1,000,000) + (((4*100)+(50+6))*1,000)+((7*100)+(80+9)) then we convert to words (((one*hundred)+(twenty+three))*million)+(((four*hundred)+(fifty+six))*thousand)+((seven*hundred)+(eighty+nine)) now we replace math with spaces except the + between the tens and ones producing one hundred twenty-three million four hundred fifty-six thousand seven hundred eighty-nine each and every one of these steps can easily be done by a very simple fnction that would call itself every time it has to expand untill the end now all that is left over is what is after the decimal this can be done with the 'point one two three' convention or the 'and one hundred twenty-three hundredth' convention the first would be as simple as adding ' point' to the end of the string and then adding each number the second would add ' and' to the end of the string the sending the number through the function that did the first part and the adding the correct nth to the end both of these methods for dealling with decimalls are both widly used and accepted and I have never met any one that didn't understand both of them and as far as I know other speaking languages use systems sinular if not the same as the one used in english thus the code to to it will iether be the same or extremly similar. also while using somthing such as 1800 it technicaly is not mathmatically correct (or so I've been told by every math teacher I have ever had) Brian Finney ps for now I am simply throwing in the ideas if anyone would like I can also toss in a little code that could accomplish these things "Bryan C. Warnock" wrote: > On Fri, 05 Jan 2001, Piers Cawley wrote: > > But, but... 0.21 is *not* 'point twenty one', it's 'point two one', > > otherwise you get into weirdness with: .21 and .210 being spoken as > > 'point twenty one' and 'point two hundred (?:and)? ten' and all of a > > sudden the '2' in that figure has gained an order of magnitude which > > is just plain *wrong*. > > Then it would be "one eight zero zero point two one." > Yes, at least the U.S. used to teach that the gratuitous use of "and" was > wrong - "one thousand eight hundred twenty-one," but the rules have been > loosened for integer numbers. > > One thousand eight hundred twenty-one. > One thousand eight hundred and twenty-one > Eighteen hundred and twenty-one. > One thousand eight hundred and twenty-one hundredths. > One thousand eight hundred and two million, one hundred thousand ten > millionths. > > How did we get on this subject? Oh, yes, sorting by the number spelled out... > That should throw several cultures for a loop. > > Four and twenty blackbirds, baked 'e' and 'pi'. > > > > > Ghod knows how this GST would have you pronounce 5.6.0, 'five > and six > > and oh'? > > The computer kulture has its own rules for written and spoken grammar. > > -- > Bryan C. Warnock > bwarnock@(gtemail.net|capita.com)
Re: [FWP] sorting text in human-order
On Fri, Jan 05, 2001 at 09:42:12PM -0500, Brian Finney wrote: > generally speaking when you look a number and convert it into text you go through > some simble steps > > say we start with this number > 123,456,789 > first we divide into sets of three > (123,000,000)+(456,000)+(789) > then we expand > (123*1,000,000) + (456*1,000)+(789) > and expand further > (((1*100)+(20+3))*1,000,000) + (((4*100)+(50+6))*1,000)+((7*100)+(80+9)) > then we convert to words > >(((one*hundred)+(twenty+three))*million)+(((four*hundred)+(fifty+six))*thousand)+((seven*hundred)+(eighty+nine)) > > now we replace math with spaces except the + between the tens and ones producing > > one hundred twenty-three million four hundred fifty-six thousand seven hundred > eighty-nine Nonono. Everybody should know that it is satakaksikymmentäkolme miljoonaa neljäsataaviisikymmentäkuusi tuhatta seitsemänsataakahdeksankymmentäyhdeksän. Now, maybe I be so bold as to suggest that we get back to perl6-language, please? -- $jhi++; # http://www.iki.fi/jhi/ # There is this special biologist word we use for 'stable'. # It is 'dead'. -- Jack Cohen