Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #58401 > unrolled thread

Automation

Started byRenato Barbosa Pim Pereira <renato.barbosa.pim.pereira@gmail.com>
First post2013-11-03 14:19 -0200
Last post2013-11-16 11:42 +0000
Articles 20 on this page of 74 — 28 participants

Back to article view | Back to comp.lang.python


Contents

  Automation Renato Barbosa Pim Pereira <renato.barbosa.pim.pereira@gmail.com> - 2013-11-03 14:19 -0200
    Re: Automation Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-03 23:32 +0000
      Re: Automation Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-04 11:39 +0000
      Re: Automation Rick Johnson <rantingrickjohnson@gmail.com> - 2013-11-13 20:18 -0800
    Re: Automation rusi <rustompmody@gmail.com> - 2013-11-03 20:25 -0800
    Re: Automation renato.barbosa.pim.pereira@gmail.com - 2013-11-13 19:56 -0800
      Re: Automation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-14 17:10 +0000
        Re: Automation Alister <alister.ware@ntlworld.com> - 2013-11-14 20:03 +0000
          Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-15 10:04 +1100
          Re: Automation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-15 06:25 +0000
            Re: Automation Neil Cerutti <neilc@norwich.edu> - 2013-11-15 16:53 +0000
              Re: Automation Alister <alister.ware@ntlworld.com> - 2013-11-15 20:12 +0000
                Re: Automation Alister <alister.ware@ntlworld.com> - 2013-11-15 20:45 +0000
                  Re: Automation Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-19 01:53 -0700
                    Re: Automation Grant Edwards <invalid@invalid.invalid> - 2013-11-20 16:12 +0000
                  Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-19 20:26 +1100
                  Re: Automation Ian Kelly <ian.g.kelly@gmail.com> - 2013-11-19 02:37 -0700
                  Re: Automation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-19 09:44 +0000
                  Re: Automation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-19 09:54 +0000
                  Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-19 21:48 +1100
                    Re: Automation Grant Edwards <invalid@invalid.invalid> - 2013-11-20 16:14 +0000
                      Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-21 03:19 +1100
                      Re: Automation Tim Golden <mail@timgolden.me.uk> - 2013-11-20 16:28 +0000
                      Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-21 03:33 +1100
                      Re: Automation Walter Hurry <walterhurry@lavabit.com> - 2013-11-20 16:59 +0000
                        Re: Automation Grant Edwards <invalid@invalid.invalid> - 2013-11-20 21:34 +0000
                    Re: Automation Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-20 17:58 -0500
                      Off-topic: Aussie place names [was Re: Automation] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-21 00:58 +0000
                        Re: Off-topic: Aussie place names [was Re: Automation] Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-20 22:22 -0500
                        Re: Off-topic: Aussie place names [was Re: Automation] Tim Delaney <timothy.c.delaney@gmail.com> - 2013-11-21 12:18 +1100
                  Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-19 21:50 +1100
                  Re: Automation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-19 13:50 +0000
                  Re: Automation Tim Golden <mail@timgolden.me.uk> - 2013-11-19 13:55 +0000
                  Re: Automation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-19 14:07 +0000
                  Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-20 01:08 +1100
                Re: Automation Walter Hurry <walterhurry@lavabit.com> - 2013-11-19 11:53 +0000
                  Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-19 22:58 +1100
                    Re: Automation Alister <alister.ware@ntlworld.com> - 2013-11-19 12:36 +0000
                      Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-19 23:52 +1100
                        Re: Automation Alister <alister.ware@ntlworld.com> - 2013-11-19 13:00 +0000
                        Re: Automation Alister <alister.ware@ntlworld.com> - 2013-11-19 12:59 +0000
                        Re: Automation Alister <alister.ware@ntlworld.com> - 2013-11-19 12:59 +0000
                          Re: Automation MRAB <python@mrabarnett.plus.com> - 2013-11-19 15:06 +0000
                          Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-20 02:11 +1100
                          Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-21 02:44 +1100
                        Re: Automation Alister <alister.ware@ntlworld.com> - 2013-11-19 13:00 +0000
                      Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-21 01:52 +1100
        Re: Automation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-15 06:44 +0000
          Re: Automation Paul Rudin <paul.nospam@rudin.co.uk> - 2013-11-15 07:30 +0000
            Re: Automation Grant Edwards <invalid@invalid.invalid> - 2013-11-15 15:02 +0000
              Re: Automation Chris Angelico <rosuav@gmail.com> - 2013-11-16 02:12 +1100
                Re: Automation Alister <alister.ware@ntlworld.com> - 2013-11-15 15:52 +0000
              Re: Automation Larry Hudson <orgnut@yahoo.com> - 2013-11-15 22:17 -0800
                Re: Automation William Ray Wing <wrw@mac.com> - 2013-11-16 09:18 -0500
                  Re: Automation Roy Smith <roy@panix.com> - 2013-11-16 10:11 -0500
                    grammar (was Re: Automation) Paul Smith <paul@mad-scientist.net> - 2013-11-16 12:02 -0500
                    Re: grammar (was Re: Automation) Andrew Berg <robotsondrugs@gmail.com> - 2013-11-16 21:44 -0600
                    Re: grammar (was Re: Automation) MRAB <python@mrabarnett.plus.com> - 2013-11-17 04:07 +0000
                    Re: grammar (was Re: Automation) Chris Angelico <rosuav@gmail.com> - 2013-11-17 15:16 +1100
                    Re: grammar (was Re: Automation) Andrew Berg <robotsondrugs@gmail.com> - 2013-11-16 22:34 -0600
                    Re: grammar (was Re: Automation) Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-17 12:48 -0500
                    Re: grammar (was Re: Automation) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-19 04:13 +0000
                Re: Automation Neil Cerutti <neilc@norwich.edu> - 2013-11-18 12:17 +0000
                  Re: Automation Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-11-19 19:23 +1300
                    Re: Automation Steven D'Aprano <steve@pearwood.info> - 2013-11-19 07:09 +0000
                Re: Automation Grant Edwards <invalid@invalid.invalid> - 2013-11-18 16:49 +0000
                  Re: Automation David Robinow <drobinow@gmail.com> - 2013-11-18 22:54 -0500
          Re: Automation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-15 14:23 +0000
          Re: Automation Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-15 18:54 -0500
        Re: Automation Grant Edwards <invalid@invalid.invalid> - 2013-11-15 14:58 +0000
          Re: Automation xDog Walker <thudfoo@gmail.com> - 2013-11-15 13:43 -0800
          Re: Automation Tim Chase <python.list@tim.thechases.com> - 2013-11-15 19:28 -0600
          Re: Automation Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-15 21:01 -0500
          Re: Automation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-16 11:42 +0000

Page 1 of 4  [1] 2 3 4  Next page →


#58401 — Automation

FromRenato Barbosa Pim Pereira <renato.barbosa.pim.pereira@gmail.com>
Date2013-11-03 14:19 -0200
SubjectAutomation
Message-ID<mailman.1988.1383495590.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

I have one .xls file with the values of PV MV and SP, I wanna to calculate
Kp Ki Kd with python from this file, can anyone give me any suggestion
about how can I do this? From now, thanks.

[toc] | [next] | [standalone]


#58419

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-11-03 23:32 +0000
Message-ID<l56meu$50j$2@dont-email.me>
In reply to#58401
On Sun, 03 Nov 2013 14:19:48 -0200, Renato Barbosa Pim Pereira wrote:

> I have one .xls file with the values of PV MV and SP, I wanna to
> calculate Kp Ki Kd with python from this file, can anyone give me any
> suggestion about how can I do this? From now, thanks.

Why use Python? Why not simply write excel to do the calculations?

Assuming PV, MV and SP are in columns, you simply need to write your 
equations for Kp, Ki and Kd so that they reference the relevant columns, 
and then past them down the whole spreadsheet.

Seems to me like you're using a sledgehammer to shell a peanut.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#58440

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-11-04 11:39 +0000
Message-ID<l5810n$hvf$2@dont-email.me>
In reply to#58419
On Sun, 03 Nov 2013 23:32:46 +0000, Denis McMahon wrote:

> On Sun, 03 Nov 2013 14:19:48 -0200, Renato Barbosa Pim Pereira wrote:
> 
>> I have one .xls file with the values of PV MV and SP, I wanna to
>> calculate Kp Ki Kd with python from this file, can anyone give me any
>> suggestion about how can I do this? From now, thanks.
> 
> Why use Python? Why not simply write excel to do the calculations?
> 
> Assuming PV, MV and SP are in columns, you simply need to write your
> equations for Kp, Ki and Kd so that they reference the relevant columns,
> and then past them down the whole spreadsheet.
> 
> Seems to me like you're using a sledgehammer to shell a peanut.

For some reason OP is now continuing the conversation with my by email 
and adding me to his social networks.

To the OP - observation - in the original post you said .xls file, 
not .csv file. If your data is in .csv format, you should have said so, 
not called it an .xls file.

If you ant to convert your .csv containing columns a, b and c into a .csv 
containing columns a, b, c, x, y and z, then the solution is to read your 
existing .csv file one line at a time, calculate the extra values x, y 
and z, and then write the 6 values to a new file.

You might want to delete the old file and rename the new one to the old 
name when you finish, that might be part of the implementation 
requirements.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#59407

FromRick Johnson <rantingrickjohnson@gmail.com>
Date2013-11-13 20:18 -0800
Message-ID<93f9f7ac-f5ad-44c4-96d3-16aa6932a99c@googlegroups.com>
In reply to#58419
On Sunday, November 3, 2013 5:32:46 PM UTC-6, Denis McMahon wrote:
> Seems to me like you're using a sledgehammer to shell a peanut.

And hopefully he knows whether or not he has a peanut allergy 
before he commits to enjoying the fruits of his labor.

[toc] | [prev] | [next] | [standalone]


#58429

Fromrusi <rustompmody@gmail.com>
Date2013-11-03 20:25 -0800
Message-ID<047f4359-6bf9-4420-a403-ebe8918bb284@googlegroups.com>
In reply to#58401
On Sunday, November 3, 2013 9:49:48 PM UTC+5:30, Renato Barbosa Pim Pereira wrote:
> I have one .xls file with the values of PV MV and SP, I wanna to 
> calculate Kp Ki Kd with python from this file, can anyone give me any 
> suggestion about how can I do this? From now, thanks.

You need something like this?

http://stackoverflow.com/questions/5425210/shortcut-to-apply-a-formula-to-an-entire-column-in-excel

[toc] | [prev] | [next] | [standalone]


#59405

Fromrenato.barbosa.pim.pereira@gmail.com
Date2013-11-13 19:56 -0800
Message-ID<cebce864-a614-4305-aa14-bb680c0c7e60@googlegroups.com>
In reply to#58401
Thanks for all the help, I finished the program, follow the download link and a brief explanation of the same (in Portuguese, my native language), I apologize again for my bad english and any inconvenience that I have generated.

http://mundodacana.blogspot.com.br/2013/11/programa-para-calculo-de-constantes-pid.html

Python commands :D

[toc] | [prev] | [next] | [standalone]


#59456

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-11-14 17:10 +0000
Message-ID<mailman.2610.1384449032.18130.python-list@python.org>
In reply to#59405
On 14/11/2013 03:56, renato.barbosa.pim.pereira@gmail.com wrote:
> I apologize again for my bad english and any inconvenience that I have generated.
>

I do wish that people would stop apologising for poor English, it's an 
extremely difficult language.  IIRC there are eight different ways of 
pronouncing the vowel combination au.  Whatever happened to "There 
should be one-- and preferably only one --obvious way to do it."? :)

-- 
Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#59472

FromAlister <alister.ware@ntlworld.com>
Date2013-11-14 20:03 +0000
Message-ID<A0ahu.49784$ZJ5.37383@fx09.am4>
In reply to#59456
On Thu, 14 Nov 2013 17:10:02 +0000, Mark Lawrence wrote:

> On 14/11/2013 03:56, renato.barbosa.pim.pereira@gmail.com wrote:
>> I apologize again for my bad english and any inconvenience that I have
>> generated.
>>
>>
> I do wish that people would stop apologising for poor English, it's an
> extremely difficult language.  IIRC there are eight different ways of
> pronouncing the vowel combination au.  Whatever happened to "There
> should be one-- and preferably only one --obvious way to do it."? :)

As a native of England I have to agree
it is far to arrogant to expect everyone else to be able to speak good 
English when I can barley order a beer in any other language.
(even or especially in the USA)




-- 
Only through hard work and perseverance can one truly suffer.

[toc] | [prev] | [next] | [standalone]


#59485

FromChris Angelico <rosuav@gmail.com>
Date2013-11-15 10:04 +1100
Message-ID<mailman.2629.1384470272.18130.python-list@python.org>
In reply to#59472
On Fri, Nov 15, 2013 at 7:03 AM, Alister <alister.ware@ntlworld.com> wrote:
> On Thu, 14 Nov 2013 17:10:02 +0000, Mark Lawrence wrote:
>
>> On 14/11/2013 03:56, renato.barbosa.pim.pereira@gmail.com wrote:
>>> I apologize again for my bad english and any inconvenience that I have
>>> generated.
>>>
>>>
>> I do wish that people would stop apologising for poor English, it's an
>> extremely difficult language.  IIRC there are eight different ways of
>> pronouncing the vowel combination au.  Whatever happened to "There
>> should be one-- and preferably only one --obvious way to do it."? :)
>
> As a native of England I have to agree
> it is far to arrogant to expect everyone else to be able to speak good
> English when I can barley order a beer in any other language.
> (even or especially in the USA)

http://tvtropes.org/pmwiki/pmwiki.php/Main/SeparatedByACommonLanguage

ChrisA

[toc] | [prev] | [next] | [standalone]


#59502

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-11-15 06:25 +0000
Message-ID<5285be70$0$29975$c3e8da3$5496439d@news.astraweb.com>
In reply to#59472
On Thu, 14 Nov 2013 20:03:44 +0000, Alister wrote:

> As a native of England I have to agree it is far to arrogant to expect
> everyone else to be able to speak good English when I can barley order a
> beer in any other language. (even or especially in the USA)

Apparently you can "barley" write UK English either :-)

No offence intended, I just thought that was an amusing error to make. 
The word you're after is "barely", barley is a grain similar to wheat or 
oats. Also "far too arrogant".

But yes, English is a tricky language. Who would imagine that "ghoti" 
could legitimately be pronounced "fish"?

"gh" sounds like F, as in "enough" (enuf)

"o" sounds like I, as in "women" (wimmin)

"ti" sounds like SH, as in "station" (stayshun)



-- 
Steven

[toc] | [prev] | [next] | [standalone]


#59547

FromNeil Cerutti <neilc@norwich.edu>
Date2013-11-15 16:53 +0000
Message-ID<ben1t6Fd19tU1@mid.individual.net>
In reply to#59502
On 2013-11-15, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> On Thu, 14 Nov 2013 20:03:44 +0000, Alister wrote:
>> As a native of England I have to agree it is far to arrogant
>> to expect everyone else to be able to speak good English when
>> I can barley order a beer in any other language. (even or
>> especially in the USA)
>
> Apparently you can "barley" write UK English either :-)
>
> No offence intended, I just thought that was an amusing error
> to make. The word you're after is "barely", barley is a grain
> similar to wheat or oats. Also "far too arrogant".

I just learned about this kind of error yesterday while browsing
the programming reddit!

http://en.wikipedia.org/wiki/Muphry's_law

-- 
Neil Cerutti

[toc] | [prev] | [next] | [standalone]


#59561

FromAlister <alister.ware@ntlworld.com>
Date2013-11-15 20:12 +0000
Message-ID<Levhu.35560$Mn5.29711@fx25.am4>
In reply to#59547
On Fri, 15 Nov 2013 16:53:58 +0000, Neil Cerutti wrote:

> On 2013-11-15, Steven D'Aprano <steve+comp.lang.python@pearwood.info>
> wrote:
>> On Thu, 14 Nov 2013 20:03:44 +0000, Alister wrote:
>>> As a native of England I have to agree it is far to arrogant to expect
>>> everyone else to be able to speak good English when I can barley order
>>> a beer in any other language. (even or especially in the USA)
>>
>> Apparently you can "barley" write UK English either :-)
>>
>> No offence intended, I just thought that was an amusing error to make.
>> The word you're after is "barely", barley is a grain similar to wheat
>> or oats. Also "far too arrogant".

Damn Spell checker, at least it chose a good pun I could almost get away 
with claiming it was deliberate ;-)

But also proves the point that if an Englishman can make simple mistakes 
after nearly half a century of usage then the no native speakers should 
be admired for doing as well as they do,
> 
> I just learned about this kind of error yesterday while browsing the
> programming reddit!
> 
> http://en.wikipedia.org/wiki/Muphry's_law

except I was not correcting/criticising a grammatical error but defending 
those than make them.





-- 
Lawrence Radiation Laboratory keeps all its data in an old gray trunk.

[toc] | [prev] | [next] | [standalone]


#59562

FromAlister <alister.ware@ntlworld.com>
Date2013-11-15 20:45 +0000
Message-ID<WJvhu.111788$qC.80212@fx07.am4>
In reply to#59561
On Fri, 15 Nov 2013 20:12:27 +0000, Alister wrote:

> On Fri, 15 Nov 2013 16:53:58 +0000, Neil Cerutti wrote:
> 
>> On 2013-11-15, Steven D'Aprano <steve+comp.lang.python@pearwood.info>
>> wrote:
>>> On Thu, 14 Nov 2013 20:03:44 +0000, Alister wrote:
>>>> As a native of England I have to agree it is far to arrogant to
>>>> expect everyone else to be able to speak good English when I can
>>>> barley order a beer in any other language. (even or especially in the
>>>> USA)
>>>
>>> Apparently you can "barley" write UK English either :-)
>>>
>>> No offence intended, I just thought that was an amusing error to make.
>>> The word you're after is "barely", barley is a grain similar to wheat
>>> or oats. Also "far too arrogant".
> 
> Damn Spell checker, at least it chose a good pun I could almost get away
> with claiming it was deliberate ;-)
> 
> But also proves the point that if an Englishman can make simple mistakes
> after nearly half a century of usage then the no native speakers should
> be admired for doing as well as they do,
>> 
>> I just learned about this kind of error yesterday while browsing the
>> programming reddit!
>> 
>> http://en.wikipedia.org/wiki/Muphry's_law
> 
> except I was not correcting/criticising a grammatical error but
> defending those than make them.

and if you haven't seen it before :-

Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in 
waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht 
the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl 
mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn 
mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.





-- 
Liar:
	one who tells an unpleasant truth.
		-- Oliver Herford

[toc] | [prev] | [next] | [standalone]


#59965

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-11-19 01:53 -0700
Message-ID<mailman.2894.1384851257.18130.python-list@python.org>
In reply to#59562
On Fri, Nov 15, 2013 at 1:45 PM, Alister <alister.ware@ntlworld.com> wrote:
> and if you haven't seen it before :-
>
> Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in
> waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht
> the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl
> mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn
> mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.

And the obligatory response:

Iltnsegnetiry I'm sdutynig tihs crsrootaivnel pnoheenmon at the
Dptmnearet of Liuniigctss at Absytrytewh Uivsreitny and my
exartrnairdoy doisiervecs waleoetderhlhy cndairotct the picsbeliud
fdnngiis rrgdinaeg the rtlvaeie dfuictlify of ialtnstny ttalrisanng
sentences. My rsceeerhars deplveeod a cnionevent ctnoiaptorn at
hnasoa/tw.nartswdbvweos/utrtek:p./il taht dosnatterems that the
hhpsteyios uuiqelny wrtaarns criieltidby if the aoussmpitn that the
prreoecandpne of your wrods is not eendetxd is uueniqtolnabse.
Aoilegpos for aidnoptg a cdocianorttry vwpiienot but, ttoheliacrley
spkeaing, lgitehnneng the words can mnartafucue an iocnuurgons
samenttet that is vlrtiauly isbpilechmoenrne.

[toc] | [prev] | [next] | [standalone]


#60102

FromGrant Edwards <invalid@invalid.invalid>
Date2013-11-20 16:12 +0000
Message-ID<l6in0n$2a5$1@reader1.panix.com>
In reply to#59965
On 2013-11-19, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Fri, Nov 15, 2013 at 1:45 PM, Alister <alister.ware@ntlworld.com> wrote:
>> and if you haven't seen it before :-
>>
>> Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in
>> waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht
>> the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl
>> mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn
>> mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.
>
> And the obligatory response:
>
> Iltnsegnetiry I'm sdutynig tihs crsrootaivnel pnoheenmon at the
> Dptmnearet of Liuniigctss at Absytrytewh Uivsreitny and my
> exartrnairdoy doisiervecs waleoetderhlhy cndairotct the picsbeliud
> fdnngiis rrgdinaeg the rtlvaeie dfuictlify of ialtnstny ttalrisanng
> sentences. My rsceeerhars deplveeod a cnionevent ctnoiaptorn at
> hnasoa/tw.nartswdbvweos/utrtek:p./il taht dosnatterems that the
> hhpsteyios uuiqelny wrtaarns criieltidby if the aoussmpitn that the
> prreoecandpne of your wrods is not eendetxd is uueniqtolnabse.
> Aoilegpos for aidnoptg a cdocianorttry vwpiienot but, ttoheliacrley
> spkeaing, lgitehnneng the words can mnartafucue an iocnuurgons
> samenttet that is vlrtiauly isbpilechmoenrne.

While I certainly couldn't read that at normal speed, there were only
a few words that I had to stop and actually puzzle over...

-- 
Grant Edwards               grant.b.edwards        Yow! ... My pants just went
                                  at               on a wild rampage through a
                              gmail.com            Long Island Bowling Alley!!

[toc] | [prev] | [next] | [standalone]


#59967

FromChris Angelico <rosuav@gmail.com>
Date2013-11-19 20:26 +1100
Message-ID<mailman.2895.1384853188.18130.python-list@python.org>
In reply to#59562
On Tue, Nov 19, 2013 at 7:53 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> Aoilegpos for aidnoptg a cdocianorttry vwpiienot but, ttoheliacrley
> spkeaing, lgitehnneng the words can mnartafucue an iocnuurgons
> samenttet that is vlrtiauly isbpilechmoenrne.

isbpilechmoenrne. I totally want to find an excuse to use that word
somewhere.. It just looks awesome.

Paradoxically, it's actually more likely that a computer can figure
out what you're saying here. In fact, I could easily write a little
script that reads /usr/share/dict/words (or equivalent) and attempts
to decode your paragraph. Hmm. You know what, I think I will. It's now
0958 UTC, let's see how long this takes me.

Meh. I did something stupid and decided to use a regular expression.
It's not 1020 UTC, so that's 21 minutes of figuring out what I was
doing wrong with the regex and 1 minute solving the original problem.
But here's your translated paragraph:

-- cut --
Interestingly I'm studying this controversial phenomenon at the
Department of Linguistics at Absytrytewh University and my
extraordinary discoveries wholeheartedly contradict the picsbeliud
findings regarding the relative difficulty of instantly translating
sentences. My researchers developed a convenient contraption at
hnasoa/tw.nartswdbvweos/utrtek:p./il that demonstrates that the
hypothesis uniquely warrants credibility if the assumption that the
preponderance of your words is not extended is unquestionable.
Apologies for adopting a contradictory viewpoint but, theoretically
speaking, lengthening the words can manufacture an incongruous
statement that is virtually incomprehensible.
-- cut --

It couldn't figure out "Absytrytewh", "picsbeliud", or
"hnasoa/tw.nartswdbvweos/utrtek:p./il". That's not a bad result. (And
as a human, I'm guessing that the second one isn't an English word -
maybe it's Scots?) Here's the code:

words = {}
for word in open("/usr/share/dict/words"):
    word=word.strip().lower()
    transformed = word if len(word)==1 else
word[0]+''.join(sorted(word[1:-1]))+word[-1]
    words.setdefault(transformed,set()).add(word)
    words.setdefault(transformed.capitalize(),set()).add(word.capitalize())

import re
for line in open("input"):
    line=line.strip()
    for word in re.split("(\W+)",line):
        try:
            transformed = word if len(word)==1 else
word[0]+''.join(sorted(word[1:-1]))+word[-1]
            realword=words[transformed]
            if len(realword)>1: realword=repr(realword)
            else: realword=next(iter(realword))
            line=line.replace(word,realword)
        except LookupError: # catches three errors, all of which mean
we shouldn't translate anything
            pass
    print(line)


Yeah, it's not the greatest code, but it works :)

ChrisA

[toc] | [prev] | [next] | [standalone]


#59970

FromIan Kelly <ian.g.kelly@gmail.com>
Date2013-11-19 02:37 -0700
Message-ID<mailman.2898.1384853905.18130.python-list@python.org>
In reply to#59562
On Tue, Nov 19, 2013 at 2:26 AM, Chris Angelico <rosuav@gmail.com> wrote:
> It couldn't figure out "Absytrytewh", "picsbeliud", or
> "hnasoa/tw.nartswdbvweos/utrtek:p./il". That's not a bad result. (And
> as a human, I'm guessing that the second one isn't an English word -
> maybe it's Scots?) Here's the code:

It's been posted widely on the Internet, and you can probably find the
full solution by googling it up.  For now, I'll just leave the hints
that the name of the university is Welsh, and that the second word
above is spelled in the British way, which is probably why your script
couldn't find it in a dictionary.

[toc] | [prev] | [next] | [standalone]


#59971

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-11-19 09:44 +0000
Message-ID<mailman.2899.1384854303.18130.python-list@python.org>
In reply to#59562
On 19/11/2013 08:53, Ian Kelly wrote:
> On Fri, Nov 15, 2013 at 1:45 PM, Alister <alister.ware@ntlworld.com> wrote:
>> and if you haven't seen it before :-
>>
>> Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in
>> waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht
>> the frist and lsat ltteer be at the rghit pclae. The rset can be a toatl
>> mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn
>> mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.
>
> And the obligatory response:
>
> Iltnsegnetiry I'm sdutynig tihs crsrootaivnel pnoheenmon at the
> Dptmnearet of Liuniigctss at Absytrytewh Uivsreitny and my
> exartrnairdoy doisiervecs waleoetderhlhy cndairotct the picsbeliud
> fdnngiis rrgdinaeg the rtlvaeie dfuictlify of ialtnstny ttalrisanng
> sentences. My rsceeerhars deplveeod a cnionevent ctnoiaptorn at
> hnasoa/tw.nartswdbvweos/utrtek:p./il taht dosnatterems that the
> hhpsteyios uuiqelny wrtaarns criieltidby if the aoussmpitn that the
> prreoecandpne of your wrods is not eendetxd is uueniqtolnabse.
> Aoilegpos for aidnoptg a cdocianorttry vwpiienot but, ttoheliacrley
> spkeaing, lgitehnneng the words can mnartafucue an iocnuurgons
> samenttet that is vlrtiauly isbpilechmoenrne.
>

How did you get onto my system and steal my code, it's under copyright 
you know? :)

-- 
Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#59972

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2013-11-19 09:54 +0000
Message-ID<mailman.2900.1384854869.18130.python-list@python.org>
In reply to#59562
On 19/11/2013 09:26, Chris Angelico wrote:
>
> It couldn't figure out "Absytrytewh", "picsbeliud", or
> "hnasoa/tw.nartswdbvweos/utrtek:p./il". That's not a bad result. (And
> as a human, I'm guessing that the second one isn't an English word -
> maybe it's Scots?) Here's the code:
>

I sense another letter to your Minister for Education regarding the 
teaching of Geography.  Fancy not recognising a well known UK place name 
when it's put right in front of you.  And Scots indeed, my mum will be 
turning in her grave :)

-- 
Python is the second best programming language in the world.
But the best has yet to be invented.  Christian Tismer

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#59977

FromChris Angelico <rosuav@gmail.com>
Date2013-11-19 21:48 +1100
Message-ID<mailman.2903.1384858094.18130.python-list@python.org>
In reply to#59562
On Tue, Nov 19, 2013 at 8:54 PM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> On 19/11/2013 09:26, Chris Angelico wrote:
>>
>>
>> It couldn't figure out "Absytrytewh", "picsbeliud", or
>> "hnasoa/tw.nartswdbvweos/utrtek:p./il". That's not a bad result. (And
>> as a human, I'm guessing that the second one isn't an English word -
>> maybe it's Scots?) Here's the code:
>>
>
> I sense another letter to your Minister for Education regarding the teaching
> of Geography.  Fancy not recognising a well known UK place name when it's
> put right in front of you.  And Scots indeed, my mum will be turning in her
> grave :)

Oh, I recognized Aberystwyth (though I can't spell it without the help
of a search engine), it was the second I wasn't sure about. (Though
Ian was right - I was working with a limited dictionary, which is why
it didn't pick that one up.) I guessed Scots for the second one
because it didn't look Welsh and it seemed plausible to get a
mostly-English paragraph with one Welsh name and one Scots word.
Wrong, but hopefully not so implausibly wrong as to cause gyration of
the encephalographically-challenged.

Anyway, we Aussies know more about your geography than you know about
ours, I reckon. Which of these is not a real place: Parramatta,
Warrnambool, Cerinabbin, Mordialloc? No fair Googling them, see if you
can call it. I've been to three of the above places, the other one
came up in a fantasy name generator.

Okay, maybe that's not exactly fair, but I'd still be curious to know
how many of you know Aussie place names :)

ChrisA

[toc] | [prev] | [next] | [standalone]


Page 1 of 4  [1] 2 3 4  Next page →

Back to top | Article view | comp.lang.python


csiph-web