Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-17 Thread Adrian Bridgett
tac will do this BTW.  (tac = cat spelt backwards.  I don't think any
Unix wizards will ever win a comedy award, except perhaps Randall
Munroe (of xkcd.com fame)).

Adrian
-- 
bitcube.co.uk - Expert Linux infrastructure consultancy
Puppet, Debian, Red Hat, Ubuntu, CentOS

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-16 Thread Daniel Pope

On 16/07/10 03:05, Vic wrote:

I don't need debugging tools. I just avoid writing code with bugs in.


Yeah, alright Dan. I'm sure we can all take that seriously.


You seemed to take my previous tongue-in-cheek comment about the 
illegibility of Perl one-liners seriously.


But seriously, I have to reach for pdb only a few times a year, it's 
nearly always due to having swallowed exceptions too broadly.


Dan

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-16 Thread Victor Churchill
> Actually, I have no idea what the semantics of <> are. I don't even know what 
> you call that syntactically - anonymous filehandle constant? Can you point me 
> to documentation about the semantics of that thing?

Its a special case of a .

perldoc perlop

If a  is used in a context that is looking for a list, a
list comprising all input lines is returned, one line per list
element. It's easy to grow to a rather large data space this way, so
use with care.

 may also be spelled readline(*FILEHANDLE). See readline.

The null filehandle <> is special: it can be used to emulate the
behavior of sed and awk. Input from <> comes either from standard
input, or from each file listed on the command line. Here's how it
works: the first time <> is evaluated, the @ARGV array is checked, and
if it is empty, $ARGV[0] is set to "-", which when opened gives you
standard input. The @ARGV array is then processed as a list of
filenames. The loop

   1. while (<>) {
   2. ... # code for each line
   3. }

is equivalent to the following Perl-like pseudo code:

   1. unshift(@ARGV, '-') unless @ARGV;
   2. while ($ARGV = shift) {
   3. open(ARGV, $ARGV);
   4. while () {
   5. ... # code for each line
   6. }
   7. }

except that it isn't so cumbersome to say, and will actually work. It
really does shift the @ARGV array and put the current filename into
the $ARGV variable. It also uses filehandle ARGV internally--<> is
just a synonym for , which is magical. (The pseudo code above
doesn't work because it treats  as non-magical.)

There is more.

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-16 Thread Chris. Aubrey-Smith
On 16 July 2010 03:05, Vic  wrote:

>
> > I don't need debugging tools. I just avoid writing code with bugs in.
>
> A clear breach of the first law of programming!
>
> --
> Please post to: Hampshire@mailman.lug.org.uk
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --
>
--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--

Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Vic

> I don't need debugging tools. I just avoid writing code with bugs in.

Yeah, alright Dan. I'm sure we can all take that seriously.

Vic.


--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Daniel Pope

On 15/07/10 14:08, Vic wrote:

perl -e 'print reverse <>' output.csv


Yes, but because Python is more legible I stand a better chance of
understanding what it does when I come to re-read it. Not like that
gibberish.


That's just prejudice.


Well, postjudice. I have personal experience of trying to learn and 
program with Perl.



But Perl's debugging tools do seem significantly more usable, from
what I've found so far.


I don't need debugging tools. I just avoid writing code with bugs in. 
That feature comes as standard in Python.



Describing that piece of perl above as "gibberish" is just laziness; its
meaning is trivially understood.


Actually, I have no idea what the semantics of <> are. I don't even know 
what you call that syntactically - anonymous filehandle constant? Can 
you point me to documentation about the semantics of that thing?


--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Lisi
On Thursday 15 July 2010 15:20:39 Victor Churchill wrote:
> On 15 July 2010 14:42, Jack Knight  wrote:
> > On 15/07/10 14:08, Vic wrote:
>  perl -e 'print reverse<>'output.csv
> >>>
> >>> Yes, but because Python is more legible I stand a better chance of
> >>> understanding what it does when I come to re-read it. Not like that
> >>> gibberish.
> >
> > Pedant's corner: "that gibberish" isn't even all perl  - the redirects
> > are basic *ix shell !
>
> Of the Perl bit, 'print' and 'reverse' can hardly be called gibberish,
> so it must be the '<>'.

Given that I am a Perl and Python ignoramus, I might easily have found both 
gibberish (or anyhow, unintelligible, which really isn't the same thing).  I 
found the "perl" almost fully comprehensible at first sight.  A quick google 
furnished the meaning of "-e", which was the bit I didn't understand.

It may well be generally true that Perl looks like gibberish to a Python user, 
but I don't see how it can have been in this particular case.

Lisi




--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Victor Churchill
On 15 July 2010 14:42, Jack Knight  wrote:
> On 15/07/10 14:08, Vic wrote:
>>

 perl -e 'print reverse<>'output.csv

>>>
>>> Yes, but because Python is more legible I stand a better chance of
>>> understanding what it does when I come to re-read it. Not like that
>>> gibberish.
>>>

> Pedant's corner: "that gibberish" isn't even all perl  - the redirects are
> basic *ix shell !

Of the Perl bit, 'print' and 'reverse' can hardly be called gibberish,
so it must be the '<>'.

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread James Courtier-Dutton
On 15 July 2010 14:03, Pierre Cazenave  wrote:
>
> tac input.csv > output.csv
>
> tac == cat backwards :)
>

I like that one.

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Jack Knight

On 15/07/10 14:08, Vic wrote:
   

perl -e 'print reverse<>'output.csv
   

Yes, but because Python is more legible I stand a better chance of
understanding what it does when I come to re-read it. Not like that
gibberish.
 

That's just prejudice.

Having spent some time this week trying to debug some Python, I have come
to the conclusion that it is just like any language - intelligible to
those that understand it, and impenetrable to those that don't. But Perl's
debugging tools do seem significantly more usable, from what I've found so
far.

Describing that piece of perl above as "gibberish" is just laziness; its
meaning is trivially understood.
   


Pedant's corner: "that gibberish" isn't even all perl  - the redirects 
are basic *ix shell !

Vic.


--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--
   



--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Chris Aitken
> You've got it easy, with A&L not only is it in reverse order, but the
> recent
> items section sorts things differently within a day to the final statement.
> I
> have to go through and reorder them for the running balance. Not that I'm
> planning to be with them much longer anyway. There's also a problem with
> the
> timeout mechanism. It used to fail to notify you in Firefox (even though
> they
> claim to support it), now the notification works, but clicking to stay
> logged
> in doesn't do anything and you still get logged out. When I queried it with
> tech support they sent me two letters a month apart telling me they were
> still
> working on my query and would get back to me, and then on the third month
> they
> sent me one saying the didn't understand the question - doh!!
>
>  It works fine with Firefox in Windows. Why don't you use a normal OS? :)

What I can't get my head round is how A&L can give me 3 separate balances at
the same time!
--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--

Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Vic

>> perl -e 'print reverse <>' output.csv
>
> Yes, but because Python is more legible I stand a better chance of
> understanding what it does when I come to re-read it. Not like that
> gibberish.

That's just prejudice.

Having spent some time this week trying to debug some Python, I have come
to the conclusion that it is just like any language - intelligible to
those that understand it, and impenetrable to those that don't. But Perl's
debugging tools do seem significantly more usable, from what I've found so
far.

Describing that piece of perl above as "gibberish" is just laziness; its
meaning is trivially understood.

Vic.


--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Pierre Cazenave

On 15/07/2010 12:38, Daniel Pope wrote:

On 15/07/10 12:32, Chris. Aubrey-Smith wrote:

I was blithely
informed that there was no problem, since I could buy a piece of
software which would turn the CSV files back the right way up.


cat >flip_csv.py  output.csv

tac == cat backwards :)

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Daniel Pope

On 15/07/10 12:49, Vic wrote:

perl -e 'print reverse <>' output.csv


Yes, but because Python is more legible I stand a better chance of 
understanding what it does when I come to re-read it. Not like that 
gibberish.


Dan

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Paul Tansom
** Ian Park  [2010-07-15 12:43]:
> On 15/07/10 12:32, Chris. Aubrey-Smith wrote:
> > I thought my recent experiences with Lloyds TSB might be of interest.
> > 
> > Last Tuesday, Lloyds changed their on-line banking system. The most
> > noticeable change is that statements now appear upside-down, with the
> > latest transaction at the top. For those of us who were brought up to
> > perform arithmetic starting at the top of the page and working down this
> > seems very odd. For people like me, who monitor their finances on a
> > spreadsheet, it's a nuisance. Now I have to compare an entry at the top
> > of one list with an entry at the bottom of the other and work through
> > the two records in different directions.

> Hmmm, Smile (the Co-op internet bank) are even more confusing: if you
> grab a "recent items" statement, that comes with the most recent at the
> top; if you grab a "complete" statement (when Smile thinks a page is
> full), that comes with the most recent at the bottom.
** end quote [Ian Park]

You've got it easy, with A&L not only is it in reverse order, but the recent
items section sorts things differently within a day to the final statement. I
have to go through and reorder them for the running balance. Not that I'm
planning to be with them much longer anyway. There's also a problem with the
timeout mechanism. It used to fail to notify you in Firefox (even though they
claim to support it), now the notification works, but clicking to stay logged
in doesn't do anything and you still get logged out. When I queried it with
tech support they sent me two letters a month apart telling me they were still
working on my query and would get back to me, and then on the third month they
sent me one saying the didn't understand the question - doh!!

-- 
Paul Tansom | Aptanet Ltd. | http://www.aptanet.com/ | 023 9238 0001
==
Sponsor me in the Moonlit Memories Walk for Rowans Hospice
A 12 mile walk along Southsea seafront starting midnight 19th June
Visit: http://www.justgiving.com/MoonlitTansom2010
==
Registered in England  |  Company No: 4905028  |  Registered Office:
Crawford House, Hambledon Road, Denmead, Waterlooville, Hants, PO7 6NU

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Chris. Aubrey-Smith
>
> On 15/07/10 12:32, Chris. Aubrey-Smith wrote:
> > Hi, all!
> >
> > I thought my recent experiences with Lloyds TSB might be of interest.
> >
>
> Please post to: Hampshire@mailman.lug.org.uk
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --
>

Well, yes... there are, of course, all sorts of ways in which the records
can be put back in the correct order. but that's not really the point.

It's a stupid change, was introduced without warning and forces customers to
find a way of working round it before they can get on with their routine.

That's before I get on to the appalling way in which my enquiry was handled,
not to mention the proprietary software issue.

Chris.
--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--

Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Jack Knight

On 15/07/10 12:44, Daniel Pope wrote:

On 15/07/10 12:41, James Courtier-Dutton wrote:

python flip_csv.pyoutput.csv

>

Yes, but how much does that cost and does it have to have windows... ;-)


For that I will charge a mere £125 ex VAT consultancy fee, but I would 
recommend you pay another £450 ex VAT for me to set up a virtual 
appliance to run it for you.


Does that cost for the appliance include the Windows license fee and any 
CALs required?


;^)


--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Ian Park
Hmmm, Smile (the Co-op internet bank) are even more confusing: if you
grab a "recent items" statement, that comes with the most recent at the
top; if you grab a "complete" statement (when Smile thinks a page is
full), that comes with the most recent at the bottom.

Ian
-- 
Ian Park
17 Pyle Hill
Newbury
Berkshire
RG14 7JJ
Tel: +44 (0)1635 821420
email: i.d.c.p...@ntlworld.com
--
On 15/07/10 12:32, Chris. Aubrey-Smith wrote:
> Hi, all!
> 
> I thought my recent experiences with Lloyds TSB might be of interest.
> 
> Last Tuesday, Lloyds changed their on-line banking system. The most
> noticeable change is that statements now appear upside-down, with the
> latest transaction at the top. For those of us who were brought up to
> perform arithmetic starting at the top of the page and working down this
> seems very odd. For people like me, who monitor their finances on a
> spreadsheet, it's a nuisance. Now I have to compare an entry at the top
> of one list with an entry at the bottom of the other and work through
> the two records in different directions.
> 
> Worse was to come: For years, I have downloaded a CSV file and used a
> few simple Perl routines to conduct various analyses. Now, I was under
> the impression that the CSV file is a standard format for transferring
> data between spreadsheets. The Lloyds CSV files are now also
> upside-down, so a straightforward transfer is no longer possible and
> additional (manual) work is needed.
> 
> I was getting quite cross by this stage, so I tried to telephone the
> bank to let them have the benefit of my opinion on the unnecessary
> problems they had created. After struggling through their horrendous
> telephone security system and (inevitably) waiting in a queue, I spoke
> to someone who declared herself unaware of any changes and promptly
> dumped the connection.
> 
> Anger rising, I tried again. This time, the lady admitted that she had
> no idea what I was talking about, but gave me a number 'for people
> having problems with the new system'. Aha!
> 
> On 'phoning this number and finding myself talking to someone who
> clearly *did* understand what I was talking about, I was blithely
> informed that there was no problem, since I could buy a piece of
> software which would turn the CSV files back the right way up. Through
> clenched teeth, I asked why customers should suddenly find it necessary
> to do this and, incidentally, which operating system would this piece of
> proprietary software require..?
> 
> I gave up after that, but a few days later I received a note stating
> 'I'm pleased to send you the information we talked about.'  The
> enclosure was a booklet about banking by telephone.
> 
> Chris.
> 
> 
> 
> --
> Please post to: Hampshire@mailman.lug.org.uk
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Vic

> cat >flip_csv.py <
> import sys
> lines = sys.stdin.readlines()
> lines.reverse()
> for l in lines:
>  sys.stdout.write(l)
>
> END
> python flip_csv.py output.csv


perl -e 'print reverse <>' output.csv

Vic.


--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Daniel Pope

On 15/07/10 12:41, James Courtier-Dutton wrote:

python flip_csv.pyoutput.csv

>

Yes, but how much does that cost and does it have to have windows... ;-)


For that I will charge a mere £125 ex VAT consultancy fee, but I would 
recommend you pay another £450 ex VAT for me to set up a virtual 
appliance to run it for you.


Dan

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--

Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread James Courtier-Dutton
On 15 July 2010 12:38, Daniel Pope  wrote:
> On 15/07/10 12:32, Chris. Aubrey-Smith wrote:
>>
>> I was blithely
>> informed that there was no problem, since I could buy a piece of
>> software which would turn the CSV files back the right way up.
>
> cat >flip_csv.py <
> import sys
> lines = sys.stdin.readlines()
> lines.reverse()
> for l in lines:
>    sys.stdout.write(l)
>
> END
> python flip_csv.py output.csv
>
> Dan

Yes, but how much does that cost and does it have to have windows... ;-)

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--

Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread James Courtier-Dutton
On 15 July 2010 12:32, Chris. Aubrey-Smith  wrote:
> Hi, all!
>
> I thought my recent experiences with Lloyds TSB might be of interest.
>
> Last Tuesday, Lloyds changed their on-line banking system. The most
> noticeable change is that statements now appear upside-down, with the latest
> transaction at the top. For those of us who were brought up to perform
> arithmetic starting at the top of the page and working down this seems very
> odd. For people like me, who monitor their finances on a spreadsheet, it's a
> nuisance. Now I have to compare an entry at the top of one list with an
> entry at the bottom of the other and work through the two records in
> different directions.
>
> Worse was to come: For years, I have downloaded a CSV file and used a few
> simple Perl routines to conduct various analyses. Now, I was under the
> impression that the CSV file is a standard format for transferring data
> between spreadsheets. The Lloyds CSV files are now also upside-down, so a
> straightforward transfer is no longer possible and additional (manual) work
> is needed.
>

Does this confuse gnucash?

Can't you just sort the spreadsheet by date?

Kind regards

James

--
Please post to: Hampshire@mailman.lug.org.uk
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--


Re: [Hampshire] On-line Banking (Not entirely O.T.)

2010-07-15 Thread Daniel Pope

On 15/07/10 12:32, Chris. Aubrey-Smith wrote:

I was blithely
informed that there was no problem, since I could buy a piece of
software which would turn the CSV files back the right way up.


cat >flip_csv.py