« first day (2551 days earlier)      last day (2622 days later) » 

01:53
Anyone knowledgeable about special methods?
DSM
DSM
That's a little broad. Can you be more concrete about your question?
 
2 hours later…
03:55
hey
hi
is there any good chart plugin for flask ?
does it have to be for flask?
No , But flask is good choice to write api server
Yes, I love flask as well but I wasn't sure if the code that creates your chart has to interact with flask
04:05
(pandas + numpy + matplotlib) is also good , but it's no easy to interact ..
maybe your flask app can treat the thing that creates the chart as a black box?
Did you do the agg thing?
No , for now
import matplotlib as mpl

mpl.use('Agg')
have you heard about echartJS?
sorry i have not
04:09
expect flask-echart born
04:51
Morning cbg
 
1 hour later…
06:05
I'm having python2.7 and python3.5 both installed in my Mac. The default is 3.5 and hence the pip installs packages for python3.5. I want to install enum package for python2.7. And so, I'm looking for pip but it points to 3.5. So, how do I install enum module for my python2.7?
06:56
Thanks! Anyway I got it by using curl -O bootstrap.pypa.io/get-pip.py and then installing the pip as python2.7 get-pip.py
cbg
07:25
any knows about kaggle datasets ?
 
1 hour later…
08:37
Cabbage
cbg
@Rahul Refer to room rules (Just drop your question, don't ask with a preamble)
What's cbg?
Green Bean
Melon
08:57
#!/usr/bin/python
v = [{ "active": "1", "buildVM": "tets", "javahome": "test", "productionVM": "test"}, {"active": "2", "appFolder": "test", "buildVM": "test", "javahome": "test", "productionVM": "test"}, {"active": "3", "appFolder": "test", "appName": "test", "buildVM": "test", "javahome":
"test", "productionVM": "test"}]

dict={}
for d in v:
    dict.update(d)

print "Value : %s" %  dict
Hi can anyone review this code what am doing wrong there all the list values are not getting updated into dict
#!/usr/bin/python
v = [{ "active": "1", "buildVM": "tets", "javahome": "test", "productionVM": "test"}, {"active": "2", "appFolder": "test", "buildVM": "test", "javahome": "test", "productionVM": "test"}, {"active": "3", "appFolder": "test", "appName": "test", "buildVM": "test", "javahome":
"test", "productionVM": "test"}]

d = {}
for i in v:
d.update(i)

print "Value : %s" % d
avoid using reserved words as variable names
dict is a builtin type and for this reason is better to not use it as variable name
i am not using it actually that was just an example but thanks :)
Because you have the same key inside each item ..
It’s not clear to me what you expect as an output
09:04
so ,only the last key will be store ...
@poke i want a single dict with all those value merged like [{a:b},{c:d}] -> { a:b, c:d }
That’s what’s happening, yes.
you have repeat the key ... each item ...
It’s just that you have [{a:b, c:d}, {a:e, c:f}] -> {a:e, c:f}
09:05
Avocado
@Rohitsaraf on my debian I have pip2 and pip3 (and pip points to pip3)
Letturce
yes @poke and @landpack i guess i understand a little now i guess thanks now i need to think of how to reach to a solution
There's also the python -m pip syntax
Cool boy @AtharvaPandey
09:55
cbg
i have this dictionary in python and i want to print the values that are greater than 9 only
dict = {'kevin': 9, 'henk': 7, 'jan': 6 , 'test': 10 , 'test1': 7 , 'test2': 5, 'test3': 10, 'test5': 7}
im kinda new but i tried this
if dict.values() > 9:
doesnt work
use a dict comprehension
or, you know, a loop
new_dict = {k:v for k, v in old_dict.items() if v > 9}
, the only place where super broad questions get upvotes…
@AndrasDeak You and your crazy ideas
10:23
got it :)
11:00
for i in range(N):
    for j in range(N):
        xi = X[i, :]
        xj = X[j, :]
        dist = np.dot(xi, xj)
        M[i, j] = dist
return M
so that is the same as
a = np.dot(X, X.T)
11:25
probably, yes
so now I have part of the for loop collapsed but the other part is norm of xi and norm of xj which I thought would be easier
Hello everyone, what would you recommend to look at to implement real-time chat in my application, it should be like P2P chat. My setup is Django REST Framework and Angular 4.
@UserNotFoundException welcome :-) sounds as though you've already made your technology choices?
@RobertGrant Thanks! Yes, I did.
perfect!
11:35
@UserNotFoundException so...what are you asking about what to look at? :-)
@UserNotFoundException socket.io + node for chat
@kush look into the maths of what the norm of a vector is. In particular, can you define it in terms of a scalar product?
sqrt(x11^2 + x12^2 + ...)
so I'd need something like np.linalg.norm(X, axis=1) I think?
12:08
@AndrasDeak Yeah I got it eventually. The instructions suggest averaging together the scores of successive block pairs. When I tried it with just two pairs, the wrong keysize had the highest score. When I started averaging eight pairs, I got the right keysize.
@AnttiHaapala Cool, thanks. This will actually make my code simpler, because I had special casing to detect when the message didn't need padding at all.
def first_multiple_gte(min, mult):
    """returns the smallest integer x such that x%mult==0 and x >= min"""
    if min%mult == 0:
        return min
    else:
        return min + mult - min % mult

def first_multiple_gt(min, mult):
    """returns the smallest integer x such that x%mult==0 and x > min"""
    return min + mult - min % mult
Hmm I think I may have been tired when I wrote this
12:36
# second function to fill, compute distance matrix without loops
def compute_stupid_smart(X):
    N = X.shape[0]  # num of rows
    D = X[0].shape[0]  # num of cols
    # use X to create M
    # a = np.dot(X, X.T)
    a = np.sum((X) ** 2, axis=1)
    print(a.shape)
    return a
so X is NxD and a is Nx1. I would like to repeat each row in a D times so a is also NxD How do?
@Kevin alas, it is an extra case.
def pkcs7(block, length):
    remaining = length - (len(block) % length)
    if remaining == 0:
        remaining = length

    return block + bytes([remaining]) * remaining
bad parameter and variable naming :d block => data, length => blocksize, remaining => padding
It's too early in the morning for me to notice why, but for me the situation is reversed: my new code has one less case rather than one more
def make_pad(amount):
    return bytes([amount]*amount)

def pad_to(message, target_size):
    return message + make_pad(target_size - len(message))

def pad_to_multiple_of(message, size):
    return pad_to(message, first_multiple_gt(len(message), size))
(please excuse these generic function names)
Possible reasons include: 1) I implemented it wrong; 2) calculating total message size, rather than just padding size, somehow makes the math easier
Aside: I should probably change that bytes([amount]*amount) to bytes([amount])*amount. It didn't occur to me that you can multiply bytes.
Despite the fact that I knew you can multiply strings, and that bytes and strings have very similar interfaces
Sadly amount isn't ever going to be larger than 16 in that function so I've probably spent more time writing about the different approaches than the time I'd actually gain by implementing the slightly more efficient version, at this point
Or, well, I guess amount gets larger when you have larger block sizes. Do real encryption algorithms have big block sizes? We'd need like a million byte block for it to be worth my while
13:01
@Kevin no, real encryption algos do not have big block sizes because they need to be fast
Ok, cool
Nx1 vector

[ 2.7627998   3.32001646  2.71838184  3.76597959  3.09085873  2.80877518
  3.36462669  3.24926606  3.51628298  2.08135104  5.24476143  3.03547005
  2.17439871  4.34825078  3.22649798  2.16592466  3.61599485  3.18542171
  3.65306991  4.56024306  3.59132618

NxN matrix

[[ 2.7627998   2.7627998   2.7627998  ...,  2.7627998   2.7627998
   2.7627998 ]
 [ 3.32001646  3.32001646  3.32001646 ...,  3.32001646  3.32001646
   3.32001646]
 [ 2.71838184  2.71838184  2.71838184 ...,  2.71838184  2.71838184
@davidism that looks pretty awesome
cabbage all
cbg \o
13:17
@MooingRawr o\
@MooingRawr I had a beer with my mate last thursday, I was nauseous
:D have some tea instead :D
@MarcusAndrews \o how goes it
all good, you
@MooingRawr true dat
13:34
busy season at work... If I can survive till mid Nov, then I basically have a super easy rest of the year... but until then :(
@Kevin Nice to see functions which are that short.
I might actually refactor those functions together into one function. Only the last one ever gets called anywhere else so there's not much point polluting my namespace like that
ah, the good ol' days when SO loved fun: stackoverflow.com/q/234075/344286 (and was less clear that it was about helping people solve programming problems :)
13:54
Those legacy questions are pretty good evidence that the average user wants SO to be the one-stop-shop for all things programming: troubleshooting, library recommendations, amusing but not objectively useful content, etc. It's not wrong to want these things, but clearly the administrators have a different idea about what the site ought to be
The flippant response is "there's nothing stopping you from creating a competing site where 'post your favorite Jon Skeet Facts' is on-topic" but even if every single SO user wants that kind of content, a new site is unlikely to succeed because it won't benefit from the absolutely monstrous network effect that SO has accumulated
DSM
DSM
Morning cabbage.
DSM \o/ 3 in a row cbg, hope you had a wonderful Thanksgiving :D
May your turkey-induced naps be filled with pleasant dreams, and may your preferred team win The Big Game
@Kevin isn't that Quora?
DSM
DSM
14:06
@MooingRawr: yeah! I remember 1993.. we'll see if it happens again. ;-)
Exercise: write a program that determines whether one string is the same as another string repeated some number of times
@RobertGrant Perhaps. I don't go there often enough to know what their Core Mission is, or whatever
@Kevin if you do that fast enough you could add that into programming languages as a feature
@DSM I hope so for all the older fans who wants to see us bring the cup home. :P
Their core mission is moar eyeballs = moar IPO
Also 34's OT winner was a beauty.....I'm so glad we drafted him..
14:10
why this was locked, I thought it was very interesting, @MartijnPieters @JonClements :D
does deleting lock or what? :d
Maybe deleting counts as rejecting the migration, which causes the post to lock automatically.
the user must have been doubly confused
@Kevin I think their core mission is making sure people are logged into Google or whatever they used to log into quora
@AnttiHaapala it says This question was voluntarily removed by its author. to me
@AnttiHaapala what @davidism just said - closure for any reason except duplicate or deletion rejects it
In that case I was wrong, since I guessed deletion = reject.
14:16
Well - you're still correct though :)
Oh wait, your sentence is parsed ambiguously.
"(closure for any reason except duplicate) or (deletion)" vs "closure for any reason except (duplicate or deletion)"?
"closure ... or deletion rejects it" vs "except duplicate or deletion"
Tricky ninja pup, can't even pin their statements down.
Tangentially related: going by how much time they spent teaching it, I thought sentence diagrams would come up much more often in my life then they did
File under useless lessons next to cursive and the Dewey Decimal system
how much time did you spend with cursive? o.O
14:20
And how do you know where to file them? The Dewey Decimal System!
drops mic
pretty sure my library does not use dewey decimal system
I remember sentence diagrams from Linguistics 165: Computational Lingustics.
My first introduction to Prolog.
I quite liked Prolog, although it was laborious. (Or the way I did it was laborious.)
@kush Hard to say since perception of time changes as you age, but I'm going to guess... An entire school year.
DSM
DSM
@RobertGrant: re: Dewey -- nice!
14:22
I took it as a freshman, wanting to get my non-CS requirements out of the way first. I had never heard of programming languages like Prolog before and they expected you to kinda already know it.
@Kevin ah I remember doing something like that in second grade or something but I can't cursive to save my life. I refuse to use it outside of cursive class
@RobertGrant what is the system where math and computer science books are filed under Q?
Cursive is a more significant subject at Hogwarts
@RobertGrant I don't need anything as formal as that, since my filing cabinet is really just a chute to the furnace
> /dev/null ?
@AnttiHaapala It was locked because it was originally migrated from SO.
It's locked as 'failed migration' now.
14:25
I have a question about binary regexes. I know I can do theregex = re.compile(b"word up") but if I have a regex that is a string, how would I do that.. ? theregex = re.compile(b, mystring) kind of thing?
Encode it. mystring.encode('utf8')
Do ballpoint pens work at Hogwarts? You never see any in the movies. What threshold of complexity do you need to reach before the "technology doesn't work here" principle applies? Does it apply to a tiny ball bearing suspended in fluid? What does it mean for a tiny ball bearing to "not work"?
thank you! I'll give that a try
@RobertGrant I took an AI course as one of my credits for my CS degree... i didn't expect Prolog to be the main language. I liked it enough to take Ai2 where we did more Prolog.... now I've forgotten most of my Prolog... :\ do you remember Prolog ?
@sniperd Terminology nitpick: the "b" in b"word up" doesn't stand for "binary", it stands for "bytes". If you were having trouble finding information about your question before, this may explain why.
14:28
I don't remember it, other than I got a pretty high mark in it at the time
ah ha! that would make a lot more sense. excellent
Dear Python devs, please change the prefixes for bytes literals or binary integer literals, so that they don't both have a "b" in them.
I suggest 0onlyOnesAndZeroes as the prefix for binary integer literals
so we can have a python 4 that is incompatible with python 3 and we can start this battle all over again?
I want a fractally incompatible language that rejects any program written longer than fifteen minutes ago
Jul 21 '15 at 20:03, by Ffisegydd
I know not what python 3 will be compiled with, but python 4 will be compiled with sticks and stones.
9
14:39
oh how I wish to star that message
14:56
@MooingRawr you can star rob's msg.
I like to start my daily routine asking myself "What breaking change can I make in the public API today?"
@JacqueGoupil en.wikipedia.org/wiki/GRPC here you go my friend
15:12
@kush I'm afraid I am missing the point.
@JacqueGoupil I assumed you use something like flask for restful api and I suggested you just switch it to grpc without notice (don't actually do it)
@kush ...that is beyond evil.
It's almost as bad as mixing spaces and tabs.
@JacqueGoupil thank you
@JacqueGoupil I need to figure out how to autopep8 automatically when I commit
rbrb
15:26
It's not Minimal by any means but it only falls short of Verifiable by a single line: add main() to the end and you do indeed get an error involving .get
But meh I'm not going to give a special dispensation just because it almost satisfies 25% of the minimal requirement for a good question. Voted
@kush Is this part of a lead-up to a Python question, or...?
no just an observation about how total requests and total unique domain seem correlated
my question is still the same
how do I do this without loops?
# first function to fill, compute distance matrix using loops
def compute_stupid_naive(X):
    N = X.shape[0]  # num of rows
    D = X[0].shape[0]  # num of cols

    M = np.zeros([N, N])
    for i in range(N):
        for j in range(N):
            xi = X[i, 🙂
            xj = X[j, 🙂
            # dist = np.dot(xi, xj)
            dist = np.dot(xi, xi)
            M[i, j] = dist
    return M
15:33
Alas, I continue to know nothing about numpy
because this looks right to me but it fails asserts
# second function to fill, compute distance matrix without loops
def compute_stupid_smart(X):
    N = X.shape[0]  # num of rows
    D = X[0].shape[0]  # num of cols
    # use X to create M
    # a = np.dot(X, X.T)
    a = np.sum((X) ** 2, axis=1)
    return a
I think you will find that you know more than I do
Flattery won't make me any smarter :-P
so apparently numpy has this thing it calls broadcasting which lets it compare nX1 things with nxn things this is my nxn thing 14-106232937-gh.circle-artifacts.com/0/test-reports/loop.txt and this is my nx1 thing 14-106232937-gh.circle-artifacts.com/0/test-reports/loop.txt and to me it looks like they're the same but the assert fails
I'm quite familiar with the frustration that comes from preparing a question only for the audience to remain quiet or mumble an excuse about lack of domain knowledge, so please accept this fraternal virtual pat on the shoulder: there, there. One day you'll look back on this and laugh.
how far are you guys into Crypto ?
DSM
DSM
15:41
What's the right word for "re-constructable from scratch"? E.g. the configuration on an OS? I can fall back on something like "deployable" which isn't quite what I mean but will serve my purpose.
can anybody help me understand some c code that i can port to python ?
its c++ and cuda
help appreciated
most of that is pretty valid Python already
Every time I go into the C# room I feel like yelling "It's as if none of you are fluent in this one decade-obsolete sub-specialty that I'm obligated to keep using as long as I maintain this legacy project"
@harvey_slash what's the problem?
are you talking to me?
15:43
@Kevin that's me with every Java question I've ever asked
there :)
thanks for reading
Fraternal shoulder pats all around
so , im not exactly sure how to turn that cuda code into a loop in python
theres a data structure called NNF (nearest neighbour field)
it is a matrix containing points
None of that is actually relevant to your code :)
okay , i thought if you understood the logic you'd be able to get context
i haven't written the cuda code , so not exactly sure whats going on
15:46
Have you tried porting the code to Python?
Have you picked some sample input to get expected out put and compared the two?
i dont know how to do yet
i have written part of it
but i dont know the values for the loop
It's all just integers and floats
there's nothing at all complicated about that
yeah, but since its cuda , that function is being called many times
and i am not sure what the range is
so? That's irrelevant to porting the code
:/
i cant serialise it till i know the range
15:48
@harvey_slash Off topic, "I" is capitalized and there is no space before punctuation. On topic, it sounds like you don't have a real problem statement yet. Please ask about a specific problem you're having.
__global__ void upSample_kernel(unsigned int * ann, unsigned int * ann_tmp,int * params, int aw_half,int ah_half)
that's the function signature
def upsample_kernel(ann, ann_tmp, params, aw_half, ah_half) is how you write that in Python
i an not sure what aw_half and ah_half mean
garlic
neither do I, but that's up to the code that's calling your function
i am using this with my project , so i cant just copy :/
15:50
I think you have some other, deeper problems here... like knowing how to ask a MCVE
lol at not knowing the difference between a kick and a ban :D
The way I see it, there are two ways to port code between languages:
1. Read the code, understand what it's trying to do, formulate its behavior in a language agnostic way, then rewrite the code in the target language
2. Do a one-to-one translation of each line into the target language without understanding the business logic.
#1 is nice if you don't have a lot of familiarity with the origin language, but can still reverse-engineer its intent by looking at variable names etc. #2 is nice if you don't have a lot of familiarity with the problem domain, but know both the languages.
But if you don't know the origin language or the problem domain, then you're in trouble
yeah , i know it was asking for too much
@Kevin origin, destination language or problem domain ;)
15:52
i just thought id ask informally here before writing a question
Then why did you ask it? Do you not respect the time of the others in here?
fair point , sorry
@MooingRawr I'm gonna start on 2.4 once I have a free block of time
Or, uh, 2.11. Didn't notice the minor version number keeps incrementing between sets.
I was too busy this long weekend to touch 1.6 :( but I do hope I would get some free time to catch up to you people.
The ones between 1.6 and 2.11 were all less complicated than 1.6, if that's encouraging at all. Just gotta crest that hill.
16:45
2.12 is pretty dang hand-wavey in its rough outline of what you should do. "6. Repeat for the next byte." is like 90% of the actual problem
'repeat x for y bytes' is generally all you do for crypto :D
17:08
138 out of 144 bytes cracked... Time to hunt for fencepost errors ;_;
I tentatively blame PKCS7 for changing the value of the post-padding plaintext.
Maybe if I just...
except KeyError:
    break
Hey, I got semi-sensible output.
18:00
enervated cbg
cabbagey
late cbg
how's everyone in room 6 doing
cryptotastic
gotastic?
18:09
PYTASTIC!!!!
my final week at <job> is spent on some peaceful zen python coding
writing tests, refactoring some stuff
it's very nice
very nice
very
``````
well that didn't work
was trying to see if I can send an empty message somehow
cbg idjaw :D
18:16
&nbsp;
Nope
<!-- we can try every possible alternative -->
; DROP TABLE Kevins_message; '--
nice try, Kevin. Nice try.
there is no room6 only Kevin
well....maybe it did work
I rewrote the Flask CLI docs, anyone want to do a "quick" review? github.com/pallets/flask/pull/2490/…
Need to start knocking these out, I don't want to just spin on docs forever.
Hey, I'm a physics student and for labs prefer using py and numpy libraries rather than excel, and was wondering if there's a way to put Python and the associated libraries onto an external drive like a USB, and be able to connect it and run python from the USB with minimal set-up / no permanent changes to the contents of the PC i'm using it on
18:26
you could use a live install of whatever linux OS you prefer
there's puppy linux which is a bit tedious to get used to, but it was designed to live in RAM so it's really good for launching off usb sticks with minimal (slow) IO during work
This question came up the other week and I think the conclusion was "yes, there are python distributions that can fit on a USB and run without installing anything"
Oh nice
oh, I think I missed that
I'm not really that acquainted with computers and programming that I'd be able to mess around with stuff independently, everything I know is roughly within the confines of the environment of Python itself
Sep 15 at 14:44, by Kevin
https://www.python.org/download/alternatives/ lists at least two things with "portable" in the description
Sep 15 at 14:45, by Kevin
After 15 seconds of reading their web page I have decided that eGenix PyRun is pretty nice, provided you're on Linux
18:29
yeah, I missed that
So do you literally just install it onto the usb, then plug it in and run it from there?
They probably come with instructions, why not check them out and try it?
A little cautious
eGenix' site says "It makes "installing" Python on a Unix based system as simple as copying a single file."
I know that this is going to sound stupid but my understanding of actual computers is limited to the point where I could probably be wiping my harddrive in cmd without realising
18:31
@Phase you're cracking the fundamental nature of the universe, time to gather your courage :P
It's literally limited to python
Which sounds like it's not quite as simple as "double click this icon" but it's in the ballpark
Even lazier solution: use an online environment such as ideone.com
Nice, I'll give it a try I suppose
oh didnt think about that
something tells me that linux versions won't work since we're talking about "cmd"
The computers at my university run windows
18:32
@Phase Boy do I ever know that feeling
I think I'm just gonna roll with an online environment
Thanks for pointing out what should've been obvious to me
hang on
there's also Python Anywhere which seems similar, and last time I checked there was a free option?
dumb question: how do online environments handle libraries
but I've got no experience with it, only read about its existence
well if it's your own online environment then it's the same as if it's local, if it's someone else's online environment you ask nicely :D
18:35
Typically they provide whichever parts of the standard library that don't expose ways to escape from the security sandbox, and sometimes include popular third party libs
So the chances of Numpy and graphing libraries
are high then?
If I'm right that some sites include popular third party libs, and I didn't just imagine that, then I would expect numpy to be one of those libs that gets included
matplotlib might be trickier because you can't just pop open a window from the web (can you?)
But now that I'm pressed on it, I can't think of any online environment in particular that has it. I'm not well-versed in the available options.
jupyter notebooks work as webapps, but I think you need to host that yourself
18:38
hm : /
@AndrasDeak Radical.
but TIO is not really meant for dev work
That's fine, it's sufficient to give one example to prove that I'm not crazy W.R.T. this one particular claim I made
18:57
Hmm, if I dump and load a dictionary to/from JSON, can I reasonably expect the key-value pairs to retain their original ordering?
which python version? :P
I would guess not, but this is truly a guess
Hmm looking at json.org, it says "An object is an unordered set of name/value pairs."
and so is a dict
From that, I expect the answer is "languages with ordered-by-default dicts will probably preserve ordering, but since the notation syntax doesn't enforce it, you ought to treat that as an implementation detail"
This is all a circuitous way of asking whether I'm allowed to provide an answer for cryptopals.com/sets/2/challenges/13 that has the keys in an order other than "email, uid, role"
I don't know if I actually want/need to do that, but it's good to know what tools are available to me
My half-baked plan is "form a query string where email= is at the end of a block and admin is at the start of the next block, then rearrange blocks, then ???, then profit"
19:13
@Kevin it is just that you don't need to :D
Yeah you're right. new questions: can we assume that uid will always be 2 digits? If not, can we assume it will be a number between 1 and 100 billion? Must the email address be an actual resolvable email address? Can email addresses contain characters in the ordinal range 1-16?
slightly more fleshed out plan. Spoilers for 2.13 obviously
^^ yeah....
If the final address must be resolvable and resolvable email addresses are ascii-only, it's still possible provided that the server does no email validation other than detecting "=" and "&", and provided that the AES key does not change between successive queries. Which I'm pretty sure must necessarily be the case, because how could the server decipher the ciphertext if it throws away the key
19:35
I suspect the actual intended solution requires some of the lessons learned from 2.12
@wim: Yeah, but there's no real connection between "Python classes and C classes have frustratingly inconsistent naming conventions" and "csv.reader isn't a class".
wim
wim
True, but I stand by my claim that the reason is because of a historical naming convention, and the naming convention is relevant to the answer.
In fact it's not even 'my' claim.
I'm searching for a mailing list thread to back this up
C-or-Python likely has something to do with the historical decisions, but if it does, it's probably because the csv module's code seems to descend from an older, non-stdlib module written before type-class unification, when types weren't callable and you had to use a factory function instead of calling the type directly.
I'm drawing a bit of a blank here....But, I'm limited to unittest2 in a py2.6 environment. I need to capture some stdout/stderr stuff. I found this, and it works, but I keep thinking there is a more idiomatic/intuitive way to do this
anyone now something off the top of their head?
interesting rare wide shot of enderland in that avatar
19:46
(The CSV PEP links to this other module as the basis for the original sample implementation of the csv module, and the other module predates type/class unification.)
wim
wim
19:57
@idjaw that's the way.
@wim Thanks for taking a look
wim
wim
in newer python you have contextlib.redirect_stdout and in pytest you have capsys fixture.
^^ yeah!
this is the first real 2.6 project I touch...so was wondering if there might have been something hidden away that was usable
this is working great...so I'm gonna stick with it and all tests are passing nicely
wim
wim
@user2357112 does that look any better?
In git, how do I determine if all the changes of branch-a are in branch-b. Is it something like git diff branch-a...branch-b?
20:02
@Code-Apprentice git diff branchX branchY works for me
That will also show all the changes from branchY which are not in branchX.
ah! I read too quickly. right..
i.e. it is a symmetric diff. I want an asymmetric one.
@wim: Better than the original, but it's still claiming (or at least heavily implying) that writing it in C forces things to be this way.
wim
wim
No it's not
It's that the fact it is a C impl is, historically, why things ended up this way
DSM
DSM
20:09
I might revise your opening to be more like "For historical reasons. It was implemented in C code, and the convention was etc. etc."
Ehh, I've hit maximum productive capacity earlier today than I was hoping. Rhubarb for all!
take care dsm :D
One
One
20:50
rhubarb
21:06
cabbage
I just realized that is a left-hand word
wim
wim
@user2357112 Ironically, [the second half of] your answer is precisely what I was getting at in the initial revision. But you worded it much better than I could.
21:34
Ugh, why is life full of subjective choices...
If I make a request to someapi/resource/123 and resource ids are supposed to be 4 characters long, should it 404 or 400 ?
I'm thinking 404 because it's what it used to be. In case of doubt, be consistent I guess.

« first day (2551 days earlier)      last day (2622 days later) »