mac

 

6h
comment Python unittest - opposite of assertRaises?
@user9876 - Nope. The test exit conditions are 3 (pass/nopass/error), not 2 as you seem to erroneously believe. The difference between errors and failures is substantial and treating them as if they were the same is just poor programming. If you don't believe me, just look around to how test runners work and what decision trees they implement fro failures and errors. A good starting point for python is the xfail decorator in pytest.
20h
reviewed Approve suggested edit on Python @property versus getters and setters
1d
comment Getting curl to output HTTP status code?
Maybe obvious, but -i does work with any HTTP method, not just GET and POST... :)
Oct
10
accepted Elasticsearch is using way too much disk space
Oct
10
comment Elasticsearch is using way too much disk space
@mailq - Supercool maliq, thank you a ton. If you expand on your comment and write a proper answer, I'd be glad to mark it as accepted (otherwise I will do it later on, but don't want to steal your thunder!).
Oct
10
comment Elasticsearch is using way too much disk space
@mailq - AFAIK, Elastic compresses both data and indices, and you still should notice a decrease in space usage on your disk, compared to text logs. I assume mileage may vary according to log structure, but logs are typically very repetitive in nature, so indexing shouldn't be the most space-consuming of operations. ...or am I getting this wrong?
Oct
10
asked Elasticsearch is using way too much disk space
Oct
9
awarded Good Answer
Oct
8
comment Using argparse in conjunction with sys.argv in Python
@p014k - It sounds to me like yours is a separate, unrelated question relative to how to exclude mp3 files from an os.walk loop then (or am I misunderstanding you again?). From what I got from your comment above I would simply use the builtin function filter on the list returned by os.walk. Something like filter(lambda fn: fn[-3:] != 'mp3', list_of_files) (untested). HTH, but in case it doesn't, you're better opening your own question! :)
Oct
8
comment Using argparse in conjunction with sys.argv in Python
@p014k - I'm not sure I got your question. Do you want to pass a list of files using the asterisk [*] wildcard but without letting the shell making the expansion for you? If that's the case, you have to quote the argument: ./p.py --doh '*.py'. From within the p.py script you will have to use fnmatch to do the expansion for you. Or did I misunderstand you?
Oct
8
awarded Enlightened
Oct
8
awarded Nice Answer
Oct
2
revised Looking for advice on how to develop applets for Gnome / Ubuntu
fixed typo
Oct
2
awarded Popular Question
Sep
30
awarded Explainer
Sep
26
comment What is the meaning of "something AND 1=0" command in SQL?
@D.W. - There is a ton of reasons why this question is legit, and albeit you are right to point out how the question could be improved, there's no valid reason to attack the OP as if he had violated the Human Rights convention.
Sep
24
awarded Autobiographer
Sep
24
awarded Autobiographer
Sep
24
awarded Famous Question
Sep
24
awarded Autobiographer
1 2 3 4 5