Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Anyone know Programming?

Reply to topic
Bike Chat Forums Index -> The Geek Zone
 Topic moved: from Random Banter to The Geek Zone by G (26 Feb 2011 - 12:42)
View previous topic : View next topic  
Author Message

blurredman
World Chat Champion



Joined: 18 Sep 2010
Karma :

PostPosted: 14:55 - 24 Feb 2011    Post subject: Anyone know Programming? Reply with quote

Nothing was asked here,
This thread does not exist.
It is a glitch in the Matrix.
____________________
CBT: 12/06/10, Theory: 22/09/10, Module 1: 09/11/10, Module 2: 19/01/11
Past: 1991 Honda CG125BR-J, 1992 (1980) Honda XL125S, 1996 Kawasaki GPZ500S, 1979 MZ TS150.
Current: 1973 MZ ES250/2 - 18k, 1979 Suzuki TS185ER - 10k, 1981 Honda CX500B - 91k, 1987 MZ ETZ250 - 40k, 1989 MZ ETZ251 - 52k.


Last edited by blurredman on 00:00 - 26 Feb 2011; edited 5 times in total
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts

angryjonny
World Chat Champion



Joined: 01 Sep 2006
Karma :

PostPosted: 15:44 - 24 Feb 2011    Post subject: Reply with quote

No idea of Python (except the dead parrot sketch) so these are general "developer" type questions:

This is probably not the root of your problem, but surely the line "text_file.write(v)" is going to write the number of attempts into your file, not the IP address.

Also - don't you need to specify the path to your file, not just the filename - how does your app know where to put it?

Have you tried creating the file manually and seeing if anything gets appended to it - the file() function might be expecting the file to already exist.

I also have no idea if you're using the split function correctly - if so it works differently to how it does in VB.

Like I said - not a python programmer - just a once-upon-a-time software developer.
 Back to top
View user's profile Send private message You must be logged in to rate posts

Pete.
Super Spammer



Joined: 22 Aug 2006
Karma :

PostPosted: 15:46 - 24 Feb 2011    Post subject: Reply with quote

Can't help you with your problem, but I do see the irony of using Python to create a spam-blocking script Very Happy

https://www.youtube.com/watch?v=anwy2MPT5RE
____________________
a.k.a 'Geri'

132.9mph off and walked away. Gear is good, gear is good, gear is very very good Very Happy
 Back to top
View user's profile Send private message Visit poster's website You must be logged in to rate posts

ncrn
World Chat Champion



Joined: 24 May 2006
Karma :

PostPosted: 15:58 - 24 Feb 2011    Post subject: Reply with quote

It looks like you are opening your text file within the for loop. This means every time you run through the loop you create a new file.

Try this instead;

Code:

text_file = file('blacklistips.txt', 'wt')

for ip in [k for k,v in ips.iteritems() if v >= 13]:
     text_file.write(v)

text_file.close()


Note the indentation, so that you close the file AFTER the for loop. Also I'm not seeing how v gets loaded with anything useful.
____________________
Past: 55 Sym Jet, 91 ZZR250, 03 NSR125R. Present: 97 ER-5.
https://www.nsr125.co.uk - NSR Owners forum.
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

blurredman
World Chat Champion



Joined: 18 Sep 2010
Karma :

PostPosted: 16:05 - 24 Feb 2011    Post subject: Reply with quote

Nothing I tells ye!
____________________
CBT: 12/06/10, Theory: 22/09/10, Module 1: 09/11/10, Module 2: 19/01/11
Past: 1991 Honda CG125BR-J, 1992 (1980) Honda XL125S, 1996 Kawasaki GPZ500S, 1979 MZ TS150.
Current: 1973 MZ ES250/2 - 18k, 1979 Suzuki TS185ER - 10k, 1981 Honda CX500B - 91k, 1987 MZ ETZ250 - 40k, 1989 MZ ETZ251 - 52k.
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts

The999Kid
World Chat Champion



Joined: 11 Jan 2008
Karma :

PostPosted: 21:46 - 25 Feb 2011    Post subject: Re: Anyone know Python? Reply with quote

Blurredman wrote:
Nothing was asked here,
This thread does not exist


https://images.icanhascheezburger.com/completestore/2008/11/18/128714980171785075.jpg
____________________
NDB 19/10/1989 - 1/11/2010 |Nowhere.Elyseum wrote: I get the distinct feeling that Tim should be our secret weapon for future trolling. I don't know many people that can rip the piss in Iambic pentameter
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

yuri2085
World Chat Champion



Joined: 05 Jul 2008
Karma :

PostPosted: 21:49 - 25 Feb 2011    Post subject: Reply with quote

Pete. wrote:
Can't help you with your problem, but I do see the irony of using Python to create a spam-blocking script Very Happy

https://www.youtube.com/watch?v=anwy2MPT5RE


The problem with that sketch is that the first two items listed don't contain any spam.
 Back to top
View user's profile Send private message You must be logged in to rate posts

blurredman
World Chat Champion



Joined: 18 Sep 2010
Karma :

PostPosted: 23:59 - 25 Feb 2011    Post subject: Reply with quote

hehehe Laughing
____________________
CBT: 12/06/10, Theory: 22/09/10, Module 1: 09/11/10, Module 2: 19/01/11
Past: 1991 Honda CG125BR-J, 1992 (1980) Honda XL125S, 1996 Kawasaki GPZ500S, 1979 MZ TS150.
Current: 1973 MZ ES250/2 - 18k, 1979 Suzuki TS185ER - 10k, 1981 Honda CX500B - 91k, 1987 MZ ETZ250 - 40k, 1989 MZ ETZ251 - 52k.
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts

Im-a-Ridah
World Chat Champion



Joined: 20 Oct 2006
Karma :

PostPosted: 09:16 - 26 Feb 2011    Post subject: Reply with quote

I only do J2SE, C and Matlab Thumbs Up
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Frost
World Chat Champion



Joined: 26 May 2004
Karma :

PostPosted: 09:52 - 26 Feb 2011    Post subject: Reply with quote

I fucking hate Matlab. Every fucker uses it and it warps their perception od what is possible and how long it will take. They seem to think that because it's a single matlab command it's going to be equally easy to make run real time in C in a microcontroller or something. Worse still they'll call some complex function repeatedly to calculate something then when it runs like shit they say "Well it'll run more efficient in C". No It'll run more efficient if you actually code it properly!

I love Python as it's programming but without all the crap. C is nice for the mad speed Smile
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

ncrn
World Chat Champion



Joined: 24 May 2006
Karma :

PostPosted: 11:04 - 26 Feb 2011    Post subject: Reply with quote

I think you need to pay for it, but you can use matlab to generate C code, which if you do some clever wrapping you can dump into a micro controller, and jobs done then. It won't be nearly as efficient as if you spent time considering it and coding it in C by hand, but its a lot quicker to prototype Very Happy.

I found with python its programming but awkwardly, the biggest pain I find is with arrays, I wish they behaved like C arrays it'd be so much easier for me to comprehend Laughing.
____________________
Past: 55 Sym Jet, 91 ZZR250, 03 NSR125R. Present: 97 ER-5.
https://www.nsr125.co.uk - NSR Owners forum.
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Rogerborg
nimbA



Joined: 26 Oct 2010
Karma :

PostPosted: 11:36 - 26 Feb 2011    Post subject: Reply with quote

When you find yourself asking "Now, which region of the platter will be under the write head when this instruction gets executed", then you're programming.

https://static.eventful.com/images/block250/I0-001/003/306/384-8.jpeg
____________________
Biking is 1/20th as dangerous as horse riding.
GONE: HN125-8, LF-250B, GPz 305, GPZ 500S, Burgman 400 // RIDING: F650GS (800 twin), Royal Enfield Bullet Electra 500 AVL, Ninja 250R because racebike
 Back to top
View user's profile Send private message You must be logged in to rate posts

panrider_uk
World Chat Champion



Joined: 23 Sep 2007
Karma :

PostPosted: 13:55 - 26 Feb 2011    Post subject: Reply with quote

Rogerborg wrote:
When you find yourself asking "Now, which region of the platter will be under the write head when this instruction gets executed", then you're programming.

https://static.eventful.com/images/block250/I0-001/003/306/384-8.jpeg


When you have to worry about that you're behind the times - get a solid state disc drive Smile

Mark
____________________
Current bikes: Honda ST1100 Pan European. Moto Guzzi V85 TT Travel
 Back to top
View user's profile Send private message You must be logged in to rate posts

Rogerborg
nimbA



Joined: 26 Oct 2010
Karma :

PostPosted: 23:00 - 26 Feb 2011    Post subject: Reply with quote

https://static.flickr.com/87/240803829_9212773615_o.png

I'm two for three - where did I put those suspenders?
____________________
Biking is 1/20th as dangerous as horse riding.
GONE: HN125-8, LF-250B, GPz 305, GPZ 500S, Burgman 400 // RIDING: F650GS (800 twin), Royal Enfield Bullet Electra 500 AVL, Ninja 250R because racebike
 Back to top
View user's profile Send private message You must be logged in to rate posts
Old Thread Alert!

The last post was made 15 years, 199 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.08 Sec - Server Load: 0.81 - MySQL Queries: 16 - Page Size: 88.03 Kb