First day beginner to python, add to counter after nested loop

K

Kushal Kumaran

rusi said:
A fully automatic solution would be for google to stop screwing up :)
One step less is to have some kind of javascript (greasemonkey??) plugin for firefox to cleanup GG's mess

Since I dont pretend to know JS/greasemonkey, I have made a small emacs script.
It involves
1. cut-pasting from browser to emacs
2. pressing a key
3. Cut pasting back

Getting off topic here, but if you use Firefox, there is an extension
that can do steps 1 and 3 for you:
https://github.com/docwhat/itsalltext/
More details https://groups.google.com/forum/#!topic/comp.lang.python/Imo2m4GrS_I

So...
4 choices:

1. Do it by hand
2. Do it by emacs
3. Ignore and get unpopular
4. Dont use Google Groups

--
regards,
kushal

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iQEcBAEBAgAGBQJScTQ4AAoJEKolkdITDqLtlM0H/0ustPvApc9ia2VPoCNocN2L
sagvw7mez1tz30xZ7K8tfC2VB+ZDhZdiza3FzHWJpCTtYW5p797NbC0aIgUI4v1y
FByCFddA8q+4Iq5fHKRdF7/nWDsMlbgb+1Dn9voBktc8YmEkPA+bJ6Xfe4iSLNSd
gT/TLbsIclbreESwlxIw9mkJEkzkr3BQ581Npfe88kZtn/fvqgaPtJxegxqEpAmT
nPHBCJOhyV7LvXZ27ilebf7PjfB8Q6x7OE3w1JNXidxxSSNK4k5LL+lOf0/O4y+d
hx6TW2PVUKvAevjFYwtxuCGLaL/FTY6nHVPBaZXNGT/qR1Vs7WG9TO2ip60KUgw=
=X/n+
-----END PGP SIGNATURE-----
 
J

jonas.thornvall

Den onsdagen den 30:e oktober 2013 kl. 17:22:23 UTC+1 skrev Mark Lawrence:
I have no need to implement a newsreader as I can quite happily send and

receive data using Thunderbird. There are several other similar email

options available. An alternative is for you to show others some

courtesy and follow the instructions that would show just a few lines up

from here, except that your insistence on using bug ridden technology

means it's actually light years away.



--

Python is the second best programming language in the world.

But the best has yet to be invented. Christian Tismer



Mark Lawrence

No that is not my problem, apparently so it is that the newsreader constructors do not like the competition of Google groups otherwise they would had written the five lines of codes necessary to remove the empty linebreaks.
I like web based features, and i will use them until "they get it right, understood?"
End of story
 
R

rusi

Super Kushal!
Below is the result of that
First the original
Then emacs' cleaned up version!



-----------------Original --------------------------

rusi writes:












Getting off topic here, but if you use Firefox, there is an extension

that can do steps 1 and 3 for you:

https://github.com/docwhat/itsalltext/









--

regards,

kushal




----After replacement-------------------




rusi writes:
Getting off topic here, but if you use Firefox, there is an extension
that can do steps 1 and 3 for you:
https://github.com/docwhat/itsalltext/
 
R

rurpy

Op 30-10-13 13:17, Chris Angelico schreef:

Easier said than done. First of all I can be as consistent as possible,
I can't just take code from someone else and insert it because that
other person may be consistenly doing it different from me.

I disagree it is very easy.
[...]
2) when importing code from someone else a simple search & replace of tab
with 4 spaces will instantly correct the formatting on code using tab
without breaking code that doesn't.

Tabs can occur in strings as well as tokens in Python
code and such code will be broken by a global search and
replace:

print (" %s" % message)
^^^^^^--- This is a literal tab.

Or:

CSVDATA = '''
item qty cost
44522 100 30.25
44107 55 15.50
45229 1007 77.20
'''
where the spaces between the columns above need to be
tabs to be correctly processed as csv text.

Your "easy fix" will break code like the above.
(And please note that because you can write the above
using "\t" or avoid literal tabs in other ways, that:
1) Does not negate the fact that the above code is
legal python code that is broken by your suggestion.
2) Alternatives such as using '\t' have their own
downsides such as readability or lack of compatibility
with other parts of a larger system.

Note too that even replacing only leading tabs is not
safe since the cvs data above could have leading tabs.
 
M

MRAB

Den onsdagen den 30:e oktober 2013 kl. 17:22:23 UTC+1 skrev Mark Lawrence:
No that is not my problem, apparently so it is that the newsreader constructors do not like the competition of Google groups otherwise they would had written the five lines of codes necessary to remove the empty linebreaks.
I like web based features, and i will use them until "they get it right, understood?"
End of story
Google Groups aren't following the standard. Everybody else is. Why
should everybody else have to add a fix to correct what Google Groups
keeps getting wrong?
 
J

jonas.thornvall

Den onsdagen den 30:e oktober 2013 kl. 18:44:20 UTC+1 skrev MRAB:
Google Groups aren't following the standard. Everybody else is. Why

should everybody else have to add a fix to correct what Google Groups

keeps getting wrong?

Honestly i do not understand why you direct this question to me.
 
J

jonas.thornvall

Den onsdagen den 30:e oktober 2013 kl. 18:44:20 UTC+1 skrev MRAB:
Google Groups aren't following the standard. Everybody else is. Why

should everybody else have to add a fix to correct what Google Groups

keeps getting wrong?

I do see though this have to be something related to their database, nothing they do by purpose. So unless the database storing messages change, it probably would need an ugly fix like a script.

So probably you should direct your question to either the creators of googles database or beg the creators of google groups to do a fix...

I think the later is the way to go although i suspect this has something todo with the database storing the messages.
 
J

jonas.thornvall

Den onsdagen den 30:e oktober 2013 kl. 19:01:40 UTC+1 skrev Antoon Pardon:
Op 30-10-13 17:31, (e-mail address removed) schreef:





If you persist, it will become your problem soon enough. Annoying the

people, you come to for help, will not motivate them in actually

helping you. Mark may be the loudest in making his annoyance clear, he

is not the only one that is annoyed.



You are misbehaving by burdening other people with the annoying results

of your choice of news reading tool. That the cause is buggy google ware

doesn't diminish your responsibility. As it is the mood is tense because

a number of people already feel that others are too patient with

annoying behaviour and your contributions are not helping.



So if you find it important to have a welcoming python community that in

general will gladly help you along, you may reconsider that end of

story.

Well i like help, i like explanations, i like logic, i like smartness.
But what i do not understand is how simple problems can not be solved without manual work. Do you like brackets, do you like indentations.... i don't...

I may come across like a buffon that now nothing but that is not the case, i am actually pretty smart i could say fucking smart but that would annoy the anal monkeys to know there is people a lot smarter than them that is notanal, so let us play it causal.

I simply want things done (and i certainly have had things done) both inside and outside the pyphoone community, i have no intention to steer things up, i just want everything for the better.

And ***that is not by having every stupid anal monkey sitting manually removing linebreaks by hand***

Is that understood?
 
J

jonas.thornvall

Den onsdagen den 30:e oktober 2013 kl. 19:01:40 UTC+1 skrev Antoon Pardon:
Op 30-10-13 17:31, (e-mail address removed) schreef:





If you persist, it will become your problem soon enough. Annoying the

people, you come to for help, will not motivate them in actually

helping you. Mark may be the loudest in making his annoyance clear, he

is not the only one that is annoyed.



You are misbehaving by burdening other people with the annoying results

of your choice of news reading tool. That the cause is buggy google ware

doesn't diminish your responsibility. As it is the mood is tense because

a number of people already feel that others are too patient with

annoying behaviour and your contributions are not helping.



So if you find it important to have a welcoming python community that in

general will gladly help you along, you may reconsider that end of

story.

And it is certainly no problem to me it just means 10 more minutes now and then, the first week or two looking it up myself. But it adds up and the introduction to a programming language is always the hardest part, and finding out that the monkeys that implemented python can not follow directions, was the hardest part. The fuckers turned to go anal, and i do not like it. No more then i like the anal fuckers in any programming language. There seem to be these people around on every usenet programming group, so i wonder is this a programmer feature to go anal?

I consider myself a sloppy but intelligent person. So who are these anal monkeys that seem to pop up in every NG dealing with programming i want to do a Myer-Briggs on the fuckers and make them conform to intelligence not anal behaviour but is it even possible?
 
A

Antoon Pardon

Op 30-10-13 16:50, Grant Edwards schreef:
Then don't do that.

I'm only half-kidding. Inserting incorrect tokens into program source
breaks programs in all languages. The tricky bit is that in many
editors spaces and tabs look the same. You can pick an editor that
provides a visual difference, or you can pick an editor that always
does the right thing, or you can stick with it until your fingers
learn to do the right thing.

But tab and spaces are not tokens. They are token seperators. You can
add as many tabs and spaces at the end of a line or between an
identifier and an operator and it won't make any difference.I can even
write the following.

a = (
b + c )

where I can freely choose to use any number of tabs and spaces at the
start of the second line and python will not complain. So comparing
mixing tabs and spaces with inserting an incorrect token in other
languages doesn't make much sense to me.
Those of us who've been using Python for more than a few days think it
is you who are unable to see the advantages. ;)

I started using python when it was still 1.5.2, so I think I am using
it for more than a few days too.
 
A

Antoon Pardon

Op 30-10-13 19:02, (e-mail address removed) schreef:
Den onsdagen den 30:e oktober 2013 kl. 18:44:20 UTC+1 skrev MRAB:

I do see though this have to be something related to their database, nothing they do by purpose. So unless the database storing messages change, it probably would need an ugly fix like a script.

So probably you should direct your question to either the creators of googles database or beg the creators of google groups to do a fix...

You are wrong. If you use a service that is faulty, then the annoyance
that creates, is your responsibilty.

Just suppose your neighbours rented a paint pistol that was faulty and
because of that they sprayed paint on some of your valuables. Would you
agree that it wouldn't be their problem. Would you agree they could
just continue using that paint pistol spraying paint on your possession
and telling you, you should go to the firm where they rented the paint
pistol with your complaints?

You are using faulty news software that contributes hard to read
messages and thus pollutes the newsgroup. I understand this is not
your intention but it sure is the effect of your behaviour. So
you are polluting this newsgroup and now you have been made aware of
it. Continueing with the same behaviour will not encourage others to
help you in the future.
 
J

jonas.thornvall

Den onsdagen den 30:e oktober 2013 kl. 20:05:07 UTC+1 skrev Mark Lawrence:
Nobody would have to remove line breaks by hand if you, yes you

jonasthornvall at GMAIL.COM didn't use a tool that inserts them in the

first place.



Is that understood?



--

Python is the second best programming language in the world.

But the best has yet to be invented. Christian Tismer



Mark Lawrence

No it isn't...
The programmers of the tools on either of side will have to adapt.
I wish it would be Google but it could be a database problem, but what do i know maybe their fucking with you.
 
J

jonas.thornvall

Den onsdagen den 30:e oktober 2013 kl. 20:09:45 UTC+1 skrev Antoon Pardon:
Op 30-10-13 19:02, (e-mail address removed) schreef:




You are wrong. If you use a service that is faulty, then the annoyance

that creates, is your responsibilty.



Just suppose your neighbours rented a paint pistol that was faulty and

because of that they sprayed paint on some of your valuables. Would you

agree that it wouldn't be their problem. Would you agree they could

just continue using that paint pistol spraying paint on your possession

and telling you, you should go to the firm where they rented the paint

pistol with your complaints?



You are using faulty news software that contributes hard to read

messages and thus pollutes the newsgroup. I understand this is not

your intention but it sure is the effect of your behaviour. So

you are polluting this newsgroup and now you have been made aware of

it. Continueing with the same behaviour will not encourage others to

help you in the future.

No certainly not you are incorrect, either annoyed readers, newsreaders or you chose to filter out the annoyance, or you implement the fucking 5 lines of code making it. And one certainly can wonder why Google have not done that.
 
J

jonas.thornvall

Den onsdagen den 30:e oktober 2013 kl. 20:26:06 UTC+1 skrev Mark Lawrence:
Thank you for being honest enough to tell us what you're really like.

I've certainly known a few people shoot themselves in the foot over the

years, but I never thought I'd come across a Black Knight who could chop

off his own arms and legs.



--

Python is the second best programming language in the world.

But the best has yet to be invented. Christian Tismer



Mark Lawrence

So you think there is a certain grandeur around being anal, i do not think so anal people very good can analyse and remove obstructs, even analyse code that they previously learned howto code.

Myself think that is better done by automation... i am not into put down people that hold up the current status quo by going anal, no not a bit.

What i am against is the anal people, becoming condescending towards people that may have good ideas, and sometimes being smarter and have a more plasticity favoured thought pattern then simple parroting...
 
J

jonas.thornvall

Den onsdagen den 30:e oktober 2013 kl. 20:26:06 UTC+1 skrev Mark Lawrence:
Thank you for being honest enough to tell us what you're really like.

I've certainly known a few people shoot themselves in the foot over the

years, but I never thought I'd come across a Black Knight who could chop

off his own arms and legs.



--

Python is the second best programming language in the world.

But the best has yet to be invented. Christian Tismer



Mark Lawrence

So i guess you do not like either Myer Briggs or IQ tests...
 
D

Dennis Lee Bieber

Google groups work good for me and i certainly have no intention to change newsreader, but i agree Google should have done something about this years ago *if the empty lines fill no purpose*. And they did a mayor change a couple of years ago, it is a mystery they could not fix this if it serve no purpose?

Google DID do "something about this"... About a year and half ago, as I
recall.

That's when they changed their internal format to work on their web
system, and inflicted the horror on any "group" that wasn't a pure
GoogleGroup (ie; things that GG is gatewaying out to UseNet or mailing
lists).

Prior to that change, the Usenet gateway from GG was clean. They've
chosen to implement something that looks good in a web browser and have no
cares about what they inflict on UseNet -- probably in the hopes of driving
others to using GoogleGroups and their advertising paid hits...
 
D

Dennis Lee Bieber

Bug of anal monkey either solve your own problems, or implement your own newsreader.

Really -- because ONE client (Google) makes a mess on all standards
conforming news clients, you suggest everyone else should implement new
clients?

I'd been holding on on the basis there might be something in your posts
worthy of responding to, but the last few tell me... No...

Goodbye.
 
A

Antoon Pardon

Op 30-10-13 21:52, Ned Batchelder schreef:
Can I suggest that perhaps Jonas is someone best ignored? It's clear
he is not willing to join the community, and does not value much of
what we have to say. In addition, he seems to be above providing details
for claims he makes.

Yes, you can suggest that. I might extend him the benefit of doubt for one
or two more exchanges, but if I don't notice any appearance of good will by
then I will in the future mostly ignore him.
 
D

Dave Angel

No that is not my problem, apparently so it is that the newsreader constructors do not like the competition of Google groups otherwise they would had written the five lines of codes necessary to remove the empty linebreaks.
I like web based features, and i will use them until "they get it right, understood?"
End of story

They are not empty linebreaks, they're lines with one or more > symbols
at the beginning and nothing following. And if all of them get deleted
by some 5 line script, it would change many valid quotations.

If you had actually looked at any of the links various people had sent
you, you might understand how stupid you sound. (Note I'm not saying
you're stupid, just ignorant)

Googlegroups has the bug, and they're not likely to change it, as
they've been asked many times. So if you continue to use gg, without
compensating, then I and many like me will stop reading.

It could have been nice.
 
R

rusi

Op 30-10-13 21:52, Ned Batchelder schreef:
Yes, you can suggest that. I might extend him the benefit of doubt for one
or two more exchanges, but if I don't notice any appearance of good will by
then I will in the future mostly ignore him.

Couple of things I wish to say:
1. One of the tragedies of human relations is escalation:
- I shout at you
- You hit me
- I shoot you
- You bomb me and mine (and not remotely mine) out of existence
- and so on

If Mark had not been rude to Jonas and explained to him at a little more length, maybe he would not be assholing in full-blast.
Or maybe not… Maybe he is just trolling… Just sayin': We dont really know

2. Antoon: I was a bit surprised at your siding with the indentation business. As an old-geezer programmer I can think of a number of reasons why,
indentation=structure is a problem. Thats a subject for another thread.

However for a thread whose subject-line says "First day beginner to python…"
I am surprised that you (ie Antoon) participated.
I say this since wrt the Nikos-issue, you seem to be the only sane guy around who feels the Nikos-threads are more the problem than Nikos.

3. I am posting this from GG. And NO hand cut-paste-edit.
Firefox sends over the text to emacs.
emacs auto-cleans up the GG crap
When I exit emacs Im back in firefox with a clean text
[Thanks Kushal for the tip]

I dont expect Jonas to try or listen but there are thousands of other GG users
And if there is some problem (textual please not political or philosophical!)
I'd appreciate being told.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,250
Latest member
Charlesreero

Latest Threads

Top