<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Velocity Reviews</title>
		<link>http://www.velocityreviews.com/forums/</link>
		<description />
		<language>en</language>
		<lastBuildDate>Fri, 24 May 2013 18:06:36 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.velocityreviews.com/forums/images/misc/rss.jpg</url>
			<title>Velocity Reviews</title>
			<link>http://www.velocityreviews.com/forums/</link>
		</image>
		<item>
			<title>Total Beginner - Extracting Data from a Database Online (Screenshot)</title>
			<link>http://www.velocityreviews.com/forums/t960996-total-beginner-extracting-data-from-a-database-online-screenshot.html</link>
			<pubDate>Fri, 24 May 2013 17:32:26 GMT</pubDate>
			<description><![CDATA[Hey guys, 
 
I'm learning Python and I'm experimenting with different projects -- I like learning by doing. I'm wondering if you can help me here: 
...]]></description>
			<content:encoded><![CDATA[<div>Hey guys,<br />
<br />
I'm learning Python and I'm experimenting with different projects -- I like learning by doing. I'm wondering if you can help me here:<br />
<br />
<a href="http://i.imgur.com/KgvSKWk.jpg" target="_blank">http://i.imgur.com/KgvSKWk.jpg</a><br />
<br />
What this is is a publicly-accessible webpage that's a simple database of people who have used the website. Ideally what I'd like to end up with is an excel spreadsheet with data from the columns #fb, # vids, fb sent?, # email tm.<br />
<br />
I'd like to use Python to do it -- crawl the page and extract the data in a usable way.<br />
<br />
I'd love your input! I'm just a learner.<br />
</div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f43-python.html">Python</category>
			<dc:creator>logan.c.graham@gmail.com</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960996-total-beginner-extracting-data-from-a-database-online-screenshot.html</guid>
		</item>
		<item>
			<title>Re: PEP 378: Format Specifier for Thousands Separator</title>
			<link>http://www.velocityreviews.com/forums/t960995-re-pep-378-format-specifier-for-thousands-separator.html</link>
			<pubDate>Fri, 24 May 2013 17:28:29 GMT</pubDate>
			<description><![CDATA[On 24.05.2013 17:25, Carlos Nepomuceno wrote: 
> ---------------------------------------- 
>> Date: Thu, 23 May 2013 19:29:14 -0700 
>> Subject: Re:...]]></description>
			<content:encoded><![CDATA[<div>On 24.05.2013 17:25, Carlos Nepomuceno wrote:<font color="blue"><br />
&gt; ----------------------------------------<font color="green"><br />
&gt;&gt; Date: Thu, 23 May 2013 19:29:14 -0700<br />
&gt;&gt; Subject: Re: PEP 378: Format Specifier for Thousands Separator<br />
&gt;&gt; From: <a href="private.php?do=newpm&amp;u="></a><br />
&gt;&gt; [some typical dihedral stuff]</font><br />
&gt;<br />
&gt; I'm sorry but I don't understand your question.</font><br />
<br />
Don't worry. I guess most people on this list don't understand it either.<br />
<br />
It looks like dihedral is a bot although nobody knows for sure. Search<br />
for some other posts from him/her/it in the archive and form your own<br />
opinion.<br />
<br />
IMHO you can simply ignore him/her/it.<br />
<br />
Bye, Andreas<br />
<br />
</div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f43-python.html">Python</category>
			<dc:creator>Andreas Perstinger</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960995-re-pep-378-format-specifier-for-thousands-separator.html</guid>
		</item>
		<item>
			<title>address of local parameter</title>
			<link>http://www.velocityreviews.com/forums/t960994-address-of-local-parameter.html</link>
			<pubDate>Fri, 24 May 2013 17:12:31 GMT</pubDate>
			<description><![CDATA[On 05/24/2013 01:12 PM, kerravon wrote: 
> I found that it was necessary to put a "static" below: 
> 
> static int...]]></description>
			<content:encoded><![CDATA[<div>On 05/24/2013 01:12 PM, kerravon wrote:<font color="blue"><br />
&gt; I found that it was necessary to put a &quot;static&quot; below:<br />
&gt;<br />
&gt; static int testGenericBlockDeviceRequest(void)<br />
&gt; {<br />
&gt;     int ret;<br />
&gt;     int x;<br />
&gt;     int y;<br />
&gt;     static PB_1560 parm_block;<br />
&gt;     char *p=&amp;parm_block;<br />
&gt;<br />
&gt; Why is that? And why didn't the compiler (TC++ 1.01)<br />
&gt; complain about it if it is wrong?</font><br />
<br />
TC++ 1.01 sounds like a C++ compiler. That's OK if you were using it in<br />
a mode where it was working as a C compiler; otherwise, you're likely to<br />
get better answers to your question in comp.lang.c++.<br />
<br />
PB_1560 is presumably a typedef. What is a typedef for?<br />
<br />
There's two different occurrences of 'static' in that code. Which one<br />
are you referring to?<br />
<br />
If the compiler didn't complain, then you reached the conclusion that<br />
'static' was needed based upon some evidence other than a compiler error<br />
message. What was that evidence?<br />
<br />
With an appropriate typedef of PB_1560, either or both of the<br />
occurrences of 'static' could be removed from your code, and it could<br />
still be part of a perfectly reasonable program, which is probably why<br />
your compiler didn't complain. Of course, removing either one would<br />
change the meaning of the program, and that difference in meaning could<br />
cause problems, but that depends upon what the rest of your program does<br />
with testGenericBlockDeviceRequest(). What was the problem you had,<br />
which you fixed by inserting 'static'?<br />
</div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f42-c-programming.html">C Programming</category>
			<dc:creator>kerravon</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960994-address-of-local-parameter.html</guid>
		</item>
		<item>
			<title>RE: PEP 378: Format Specifier for Thousands Separator</title>
			<link>http://www.velocityreviews.com/forums/t960993-re-pep-378-format-specifier-for-thousands-separator.html</link>
			<pubDate>Fri, 24 May 2013 15:25:45 GMT</pubDate>
			<description><![CDATA[---------------------------------------- 
> Date: Thu, 23 May 2013 19:29:14 -0700 
> Subject: Re: PEP 378: Format Specifier for Thousands Separator...]]></description>
			<content:encoded><![CDATA[<div>----------------------------------------<font color="blue"><br />
&gt; Date: Thu, 23 May 2013 19:29:14 -0700<br />
&gt; Subject: Re: PEP 378: Format Specifier for Thousands Separator<br />
&gt; From: <a href="private.php?do=newpm&amp;u="></a></font><br />
[...]<font color="blue"><br />
&gt; Could a separate instance like the I/O device of a subprocess<br />
&gt; to be easily available in Python?<br />
&gt;<br />
&gt; The next question would be whether the flow of several I/O data streams could be easily piped and manipulated in the high level<br />
&gt; programming designs without consuming too much resources.</font><br />
<br />
<br />
I'm sorry but I don't understand your question.<br />
<br />
Do you mean returning the output of another process to the caller? Like:<br />
<br />
import subprocess<br />
output = subprocess.check_output(['ping', 'google.com']) 		 	   		  </div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f43-python.html">Python</category>
			<dc:creator>Carlos Nepomuceno</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960993-re-pep-378-format-specifier-for-thousands-separator.html</guid>
		</item>
		<item>
			<title><![CDATA[Piping processes works with 'shell = True' but not otherwise.]]></title>
			<link>http://www.velocityreviews.com/forums/t960992-piping-processes-works-with-shell-true-but-not-otherwise.html</link>
			<pubDate>Fri, 24 May 2013 14:04:36 GMT</pubDate>
			<description>Hi everybody, 
I am new to the group (and relatively new to Python) 
so I am sorry if this issues has been discussed (although searching for topics...</description>
			<content:encoded><![CDATA[<div>Hi everybody,<br />
I am new to the group (and relatively new to Python)<br />
so I am sorry if this issues has been discussed (although searching for topics in the group I couldn't find a solution to my problem).<br />
<br />
I am using Python 2.7.3 to analyse the output of two 3rd parties programs that can be launched in a linux shell as:<br />
<br />
program1 | program2<br />
<br />
To do this I have written a function that pipes program1 and program2 (using subprocess.Popen) and the stdout of the subprocess, and a function that parses the output:<br />
<br />
A basic example:<br />
<br />
from subprocess import Popen, STDOUT, PIPE<br />
def run():<br />
p1 = Popen(['program1'], stdout = PIPE, stderr = STDOUT)<br />
p2 = Popen(['program2'], stdin = p1.stdout, stdout = PIPE, stderr = STDOUT)<br />
p1.stdout.close()<br />
return p2.stdout<br />
<br />
<br />
def parse(out):<br />
for row in out:<br />
print row<br />
#do something else with each line<br />
out.close()<br />
return parsed_output<br />
<br />
<br />
# main block here<br />
<br />
pout = run()<br />
<br />
parsed = parse(pout)<br />
<br />
#--- END OF PROGRAM ----#<br />
<br />
I want to parse the output of 'program1 | program2' line by line because the output is very large.<br />
<br />
When running the code above, occasionally some error occurs (IOERROR: [Errno 0]). However this error doesn't occur if I code the run() function as:<br />
<br />
def run():<br />
p = Popen('program1 | program2', shell = True, stderr = STDOUT, stdout = PIPE)<br />
return p.stdout<br />
<br />
I really can't understand why the first version causes errors, while the second one doesn't.<br />
<br />
Can you please help me understanding what's the difference between the two cases?<br />
<br />
Thanks a lot in advance for the help,<br />
Cheers, Luca<br />
</div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f43-python.html">Python</category>
			<dc:creator>Luca Cerone</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960992-piping-processes-works-with-shell-true-but-not-otherwise.html</guid>
		</item>
		<item>
			<title>Re: NetBSD Crypto Bug: sizeof v. sizeof()</title>
			<link>http://www.velocityreviews.com/forums/t960991-re-netbsd-crypto-bug-sizeof-v-sizeof.html</link>
			<pubDate>Fri, 24 May 2013 14:00:07 GMT</pubDate>
			<description><![CDATA[On 05/23/2013 08:20 PM, william@wilbur.25thandClement.com wrote: 
> This bad code[1] compromised[2] NetBSD's CPRNG implementation: 
> 
>...]]></description>
			<content:encoded><![CDATA[<div>On 05/23/2013 08:20 PM, <a href="private.php?do=newpm&amp;u="></a> wrote:<font color="blue"><br />
&gt; This bad code[1] compromised[2] NetBSD's CPRNG implementation:<br />
&gt;<br />
&gt; 	rnd_extract_data(key + r, sizeof(key - r),<br />
&gt; 		RND_EXTRACT_ANY);<br />
&gt;<br />
&gt; One might argue this bug stemmed from using the sizeof() idiom instead of<br />
&gt; stylistically treating sizeof as a regular operator.</font><br />
<br />
That seems like a construct for a which a compiler might want to issue a<br />
warning.<br />
<br />
--<br />
==================================================  ======================<br />
Ian Pilcher                                         <a href="private.php?do=newpm&amp;u="></a><br />
Sometimes there's nothing left to do but crash and burn...or die trying.<br />
==================================================  ======================<br />
</div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f42-c-programming.html">C Programming</category>
			<dc:creator>Ian Pilcher</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960991-re-netbsd-crypto-bug-sizeof-v-sizeof.html</guid>
		</item>
		<item>
			<title>Re: Read txt file, add to iptables not working on new host</title>
			<link>http://www.velocityreviews.com/forums/t960990-re-read-txt-file-add-to-iptables-not-working-on-new-host.html</link>
			<pubDate>Fri, 24 May 2013 13:54:05 GMT</pubDate>
			<description><![CDATA[On Sat, May 25, 2013 at 2:32 AM, JackM <notreal@earthlink.net> wrote: 
> So Chris, does this version look better? Changed to inFile to with. 
> 
...]]></description>
			<content:encoded><![CDATA[<div>On Sat, May 25, 2013 at 2:32 AM, JackM &lt;&gt; wrote:<font color="blue"><br />
&gt; So Chris, does this version look better? Changed to inFile to with.<br />
&gt;</font><br />
<br />
Heh, I didn't know you knew about with :) Since you know how to use<br />
it, you probably also know why it's useful. Anyway, the main thing is<br />
to see the exact command that's being executed, which you then should<br />
be able to try at a shell prompt.<br />
<br />
ChrisA<br />
</div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f43-python.html">Python</category>
			<dc:creator>Chris Angelico</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960990-re-read-txt-file-add-to-iptables-not-working-on-new-host.html</guid>
		</item>
		<item>
			<title>Photo ops at Acadia National Park and environs</title>
			<link>http://www.velocityreviews.com/forums/t960989-photo-ops-at-acadia-national-park-and-environs.html</link>
			<pubDate>Fri, 24 May 2013 13:42:02 GMT</pubDate>
			<description><![CDATA[Planning a week-long visit to Acadia.  Looking for interesting venues to shoot and, of course, the iconic views.  I'd be grateful for suggestions.]]></description>
			<content:encoded><![CDATA[<div>Planning a week-long visit to Acadia.  Looking for interesting venues to shoot and, of course, the iconic views.  I'd be grateful for suggestions.<br />
</div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f37-digital-photography.html">Digital Photography</category>
			<dc:creator>Bill</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960989-photo-ops-at-acadia-national-park-and-environs.html</guid>
		</item>
		<item>
			<title>RE: Read txt file, add to iptables not working on new host</title>
			<link>http://www.velocityreviews.com/forums/t960988-re-read-txt-file-add-to-iptables-not-working-on-new-host.html</link>
			<pubDate>Fri, 24 May 2013 13:15:45 GMT</pubDate>
			<description><![CDATA[No, there's no need to change your python script, although it can be improved because as it is it may flush (delete all) iptables rules and let you...]]></description>
			<content:encoded><![CDATA[<div>No, there's no need to change your python script, although it can be improved because as it is it may flush (delete all) iptables rules and let you vulnerable and don't create the new rules.<br />
<br />
All you need to do is enter the commands in the shell and send it's output.The 'iptables' have changed.<br />
<br />
<br />
----------------------------------------<font color="blue"><br />
&gt; From: <a href="private.php?do=newpm&amp;u="></a><br />
&gt; Subject: Re: Read txt file, add to iptables not working on new host<br />
&gt; Date: Fri, 24 May 2013 09:08:26 -0400<br />
&gt; To: <a href="mailto:python-">python-</a><br />
&gt;<br />
&gt; Thanks for answering. Do you mean something like this?<br />
&gt;<br />
&gt; outPut = os.popen('uname -a' '/sbin/iptables -V INPUT -s' + ' ' + IP + '<br />
&gt; ' + '-j REJECT' )<br />
&gt;<br />
&gt; Sorry but like I said, I have no experience with any of this.<br />
&gt;<br />
&gt;<br />
&gt;<br />
&gt; On 5/23/2013 11:10 PM, Carlos Nepomuceno wrote:<font color="green"><br />
&gt;&gt; Send the output of the following commands:<br />
&gt;&gt;<br />
&gt;&gt; uname -a<br />
&gt;&gt; /sbin/iptables -V<br />
&gt;&gt;<br />
&gt;&gt;<br />
&gt;&gt; ----------------------------------------<font color="darkred"><br />
&gt;&gt;&gt; From: <a href="private.php?do=newpm&amp;u="></a><br />
&gt;&gt;&gt; Subject: Read txt file, add to iptables not working on new host<br />
&gt;&gt;&gt; Date: Thu, 23 May 2013 22:44:38 -0400<br />
&gt;&gt;&gt; To: <a href="mailto:python-">python-</a><br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; First, let me say that I have no knowledge of or experience with Python<br />
&gt;&gt;&gt; or Linux/Unix. I have a script which was written by a host tech person<br />
&gt;&gt;&gt; that ran via cron on my old server. It was designed to read IP addresses<br />
&gt;&gt;&gt; from a text file and add them to be blocked on iptables. That way, we<br />
&gt;&gt;&gt; could add or remove IPs without involving tech support daily. It worked<br />
&gt;&gt;&gt; great.<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Then we changed hosts and this script is now throwing errors on the new<br />
&gt;&gt;&gt; server. This host runs Python 2.6.6. This is the script:<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; #!/usr/bin/python<br />
&gt;&gt;&gt; import os,time<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; ##Input, Output, and TimeStamp<br />
&gt;&gt;&gt; inFile = open('/var/www/html/mydomain.com/banlist.txt','r')<br />
&gt;&gt;&gt; logFile = open('/var/log/banList.log','w')<br />
&gt;&gt;&gt; stamp = time.asctime(time.localtime())<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; ##Daily Flush of blockList rules before re-applying Blocks<br />
&gt;&gt;&gt; os.popen('/sbin/iptables -F INPUT')<br />
&gt;&gt;&gt; logFile.write(stamp), logFile.write('\n'), logFile.write('Flushing<br />
&gt;&gt;&gt; Rules..\n')<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; ##Loop to read in file and Apply rules to IPtables<br />
&gt;&gt;&gt; for line in inFile.readlines():<br />
&gt;&gt;&gt; tmp = line.split(';')<br />
&gt;&gt;&gt; IP = tmp[0]<br />
&gt;&gt;&gt; outPut = os.popen( '/sbin/iptables -A INPUT -s' + ' ' + IP + ' ' + '-j<br />
&gt;&gt;&gt; REJECT' )<br />
&gt;&gt;&gt; logFile.write(IP), logFile.write(' - Has been blocked '),<br />
&gt;&gt;&gt; logFile.write(stamp),logFile.write<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; The errors we're getting are like these:<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Bad argument `174.37.65.204'<br />
&gt;&gt;&gt; Try `iptables -h' or 'iptables --help' for more information.<br />
&gt;&gt;&gt; Bad argument `94.159.162.182'<br />
&gt;&gt;&gt; Try `iptables -h' or 'iptables --help' for more information.<br />
&gt;&gt;&gt; Bad argument `95.134.132.98'<br />
&gt;&gt;&gt; Try `iptables -h' or 'iptables --help' for more information.<br />
&gt;&gt;&gt; etc.<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; Entries from the banlist.txt are like these:<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; 200.193.54.138; February 9, 2013, 7:42 am &lt;br&gt;<br />
&gt;&gt;&gt; 87.120.57.4; February 9, 2013, 7:42 am &lt;br&gt;<br />
&gt;&gt;&gt; 82.206.129.160; February 9, 2013, 7:43 am &lt;br&gt;<br />
&gt;&gt;&gt; etc.<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; I know the error points to a bad iptables command.<br />
&gt;&gt;&gt; Can someone tell me what change(s) I need to make to this script to get<br />
&gt;&gt;&gt; it working again? Thanks.<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; --<br />
&gt;&gt;&gt; My email address on the header is a non-monitored spam catching account..<br />
&gt;&gt;&gt; I can be reached via <a href="http://www.wvnh.net/contact.htm" target="_blank">http://www.wvnh.net/contact.htm</a><br />
&gt;&gt;&gt;<br />
&gt;&gt;&gt; --</font></font><br />
&gt;<br />
&gt;<br />
&gt;<br />
&gt;<br />
&gt; --<br />
&gt; <a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a> 		 	   		  </font></div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f43-python.html">Python</category>
			<dc:creator>Carlos Nepomuceno</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960988-re-read-txt-file-add-to-iptables-not-working-on-new-host.html</guid>
		</item>
		<item>
			<title>Re: Utility to locate errors in regular expressions</title>
			<link>http://www.velocityreviews.com/forums/t960987-re-utility-to-locate-errors-in-regular-expressions.html</link>
			<pubDate>Fri, 24 May 2013 13:13:41 GMT</pubDate>
			<description><![CDATA[In article <mailman.2065.1369401265.3114.python-list@python.org>, 
Devin Jeanpierre <jeanpierreda@gmail.com> wrote: 
 
> On Fri, May 24, 2013 at 8:58...]]></description>
			<content:encoded><![CDATA[<div>In article &lt;mailman.2065.1369401265.3114.python-&gt;,<br />
Devin Jeanpierre &lt;&gt; wrote:<br />
<font color="blue"><br />
&gt; On Fri, May 24, 2013 at 8:58 AM, Malte Forkel &lt;&gt; wrote:<font color="green"><br />
&gt; &gt; As a first step, I am looking for a parser for Python regular<br />
&gt; &gt; expressions, or a Python regex grammar to create a parser from.</font><br />
&gt;<br />
&gt; the sre_parse module is undocumented, but very usable.<br />
&gt;<font color="green"><br />
&gt; &gt; But may be my idea is flawed? Or a similar (or better) tools already<br />
&gt; &gt; exists? Any advice will be highly appreciated!</font><br />
&gt;<br />
&gt; I think your task is made problematic by the possibility that no<br />
&gt; single part of the regexp causes a match failure. What causes failure<br />
&gt; depends on what branches are chosen with the |, *, +, ?, etc.<br />
&gt; operators -- it might be a different character/subexpression for each<br />
&gt; branch. And then there's exponentially many possible branches.</font><br />
<br />
That's certainly true.  The full power of regex makes stuff like this<br />
very hard to do in the general case.  That being said, people tend to<br />
write regexen which match hunks of text from left to right.<br />
<br />
So, in theory, it's probably an intractable problem.  But, in practice,<br />
such a tool would actually be useful in a large set of real-life cases.<br />
</div>

]]></content:encoded>
			<category domain="http://www.velocityreviews.com/forums/f43-python.html">Python</category>
			<dc:creator>Devin Jeanpierre</dc:creator>
			<guid isPermaLink="true">http://www.velocityreviews.com/forums/t960987-re-utility-to-locate-errors-in-regular-expressions.html</guid>
		</item>
	</channel>
</rss>
