« first day (1921 days earlier)      last day (3030 days later) » 

9:10 PM
See Python run. Run, Python, run!
 
late to the party though
 
What are your guys' favorite books when it comes to algs/data structures?
 
None, Python already has the data structures I need.
 
I learned about algorithms & datastructures before learning python (in c++), so my books come from SO's C++ booklist.
 
I have read CLRS, CTCI, Design Patterns, and Concrete Mathematics -- but I still feel as though I have gaps all over the place
 
9:17 PM
Still find the explicit iterator interface sometimes produce cleaner code than python's mix-n'-match interface.
 
I'm not sure which resources would be appropriate for me
 
Though python is definitely faster and easier..
 
@amrcsu we're not sure what's appropriate for you either, given that we know nothing about you, what you do/don't know, or why you think you need more books.
 
I don't need a lot of fancy data structures when I make CRUD apps for my day job. Oops I made myself sad.
 
@amrcsu I'd say: education is the best resource. - A well written set of sources will prevent gaps in knowledge, as it's then up to the instructor to look for books that work well together.
 
9:19 PM
SICP?
 
Reading more books will just fill the gaps but create also other gaps.
 
Is SICP the one that uses Scheme?
 
I can identify with that. Seems like every time I learn something, I learn about five other things that I didn't know existed but now need to learn.
 
There were some guys at my meetup that were using an algorithm book, can't remember which one though
 
@amrcsu what are you trying to do? Asking for "a book on data structures" is too broad compared to "a book about list implementations because I have some weird requirement that means I need to write my own data structure".
 
9:21 PM
The ratio of (things I grok / things whose existence I am aware of) is always converging to zero.
 
Btw for my application I'm in need of a tree structure, which supports "multiple parenting".
 
If you are just looking to learn, I suggest just finding a textbook, and doing it in C.
 
@davidism I think we should assume he has a graduate level education and 5 years of experience with Python, if I recall his exposition earlier correctly.
 
C has the benefit that you're actually accomplishing something with your work instead of reinventing the language's built-in wheels.
 
9:22 PM
And being able to iterate over it linearly..
Actually equally to what python does with it's MRO/super().
 
@AaronHall Undergrad education in a non-CS subject (but at a competitive uni)
 
@AaronHall thanks, but that doesn't inform me at all about what he needs
 
He wants to prepare to interview, I think.
 
@davidism I suppose that's my problem: I don't know what I need. :P
 
How many people will kill me if I start using class hierarchies (and create dynamic classes during runtime) as a container? Where a class itself is the data?
 
9:23 PM
@amrcsu what about the previous books did you find lacking? What do you think you still need to know?
 
+1 @AaronHall. I was just about to say that.
 
I can't tell which subjects I can consider myself sufficiently proficient in and which I need to learn more about
 
Welcome to the real world, there's nothing we can do for that.
 
Yeah :P
I'm experiencing a severe burnout over this and I don't know how to turn it off
 
Given the question "what data structures should I learn?", the most common implicit footnote is "... that I will get quizzed on by potential employers?"
 
9:25 PM
Go outside.
 
Or is there actually a library already that supports trees with diamond-like structure? (And the linearisation)
 
@amrcsu There's some clever chinese saying about that :P
 
@AnttiHaapala I do have that book
 
@AnttiHaapala that's the book
 
9:26 PM
@paul23 Please elaborate. How is your desired data structure different from a directed graph?
 
The question was actually our favorite books on the subject. I have one and I'm trying to find the name now.
 
@amrcsu that is a good book
 
I'm guessing "there is only ever one root node" is one of them, but that doesn't disqualify the use of a directed graph for your purposes
 
@Kevin Actually a directed graph is even more generic indeed.
 
As long as you don't accidentally add another root node yourself.
 
9:27 PM
 
@Kevin directed graph is anything that has pointers to nodes
 
Well and there are "leaves"/I know there won't be circular references
 
Hey guys, in terms of code style and documentation, is it ok to always use i as the variable in a for loop? (obviously nested loops would use different ones)
 
yes, we give you permission
 
or should I be using something more suggestive?
 
9:27 PM
No circular references, eh? Ok, now we can use a Directed Acyclic Graph.
 
Need to linearise it to iterate over all options in exactly the way super() works btw.
 
@Kevin directed graph has: vertices, and edges which have direction. that's it.
 
@andofcourse I like to reserve i exclusively for integer indices.
 
directed acyclic does not have cycles
 
Does anyone have any experience with mentorship programs they can recommend, perhaps?
 
9:29 PM
+1. I use i, j, k, l for integers
 
Hence "No circular references eh"
 
and then e for element, and so on
 
@paul23 the mro algorithm is called c3: python.org/download/releases/2.3/mro
 
Yeah, so for example, I wrote a little script with about 5 for loops throughout the whole thing, and all of them use i, because they're not nested. Is this good coding practice?
 
I've never have anyone mentor me :/
 
9:29 PM
Oops gotta go. I need to stop initiating conversations at 4:25.
 
searching "python c3 library" produced: pypi.python.org/pypi/C3Linearize
@andofcourse sure, why not?
 
@davidism Well yes, but I just wonder if I won't be reinventing the wheel that some well known library has already crafted....
 
@davidism Alright, thanks! I'm going to be submitting this as an application for a job, so I just wanted to make sure :P
 
@davidism Using 5 for loops where list comprehension could be used :P.
 
I think Mike borrowed the code I posted on Wikipedia... :) en.wikipedia.org/wiki/C3_linearization github.com/mikeboers/C3Linearize
Although, his targeted versions would be older than my wikipedia edit...
Nevermind, great minds think alike...
 
10:29 PM
bugs.python.org/issue26107
whoaa this is the biggest change in python 3.6, me likes
 
10:57 PM
@AnttiHaapala here's mine: bugs.python.org/issue26103 I tried making all relevant people nosy, but they've pared down the nosies quite a bit... I'm surprised I got this bug report, honestly, and that I was able to do it by reviewing source code and documentation (although my purpose was in ensuring I had a correct answer here.)
 
yeah no one cares for fixing 2.7 docs
 
11:14 PM
@AnttiHaapala I closed the duplicate null coalescing question that the pep mentioned.
Anonymous users get redirected from dupes, right?
 
I'm pretty sure the issue was in 3 too
looks like they only intend to fix for 3.5 and 3.6 based on the bug report metadata
I can't imagine many PEP readers being anonymous users here. But it's conceivable.
 
I don't think there is any redirection
hmm
 
> anonymous users get automatically redirected to the duplicate target when trying to access questions closed as duplicates with no answers
so no redirect in this case since there are answers
 
yep
and they're going to read that crap
@davidism I edited the answer
 
11:34 PM
That pep seems way too confusing over the slightly more verbose syntax available now.
 
ah
it is not for if - else
but chaining methods
where it is quite a lot more than "slightly more verbose"
if you can do foo?.bar?.baz vs
 
It keeps saying "it's not about silencing errors, that would be bad", but all I see is silenced errors all over the place.
 
it is not about silencing errors
I do not know what you've been writing if you've not been annoyed by this :d
for example we play a lot with tweets, which are json structures
 
I guess I've just been lucky.
 
so we need to do nested dictionary stuff
so you could write foo.get('bar')?.get('baz')?.get('xyz')
it wouldn't remove attribute error on wrong types, it wouldn't remove type error etc.
all it would do is that if foo does not have bar, the whole stuff would nicely evaluate to None
for this special case we have dotdict though... it wraps a nested dicitonary so that you can access it with tweet['bar.baz.xyz']
and the truth is, with if ... else no one can really write that as an expression
None if foo is None else (None if foo.get('bar') is None else foo['bar'].get('xyz'))
and suddenly it is not that clear and pythonic any more
 
11:43 PM
I don't think I've ever wanted one value in a nested access where any value in the chain is optional.
 
foo['bar']['baz'].get('xyz') if 'bar' in foo and 'baz' in foo['bar'] else None
 
It seems to be going directly against "explicit better than implicit" (and I know that's not a real rule).
 
this is just the simplified Maybe monad, where None means "maybe not" :D
 
One thing I like about Python, all the operators and blocks kinda read like English. This operator doesn't.
You have to know what the special syntax means before you can understand what the code does.
Admittedly, as they say in the pep, adding keywords is pretty much impossible at this point.
 
and ... there is no good keyword
but then '%' as a formatting operator makes even less sense
 
11:47 PM
Like you said, write a function if you need that type of lookup.
It could be added in the standard library (functools maybe?)
 
but in every single project there is a significant amount of duplication because of this
majority of the if -- else
"mutable" default arguments
 
But that's just changing two lines to one line, and in a way that loses plain English readability.
 
plain English readability as in a == 5 or 6 or 7 :D
 
lol, I didn't mean it's easy to generate the correct sentence, but it's easy to read the correct one
if a in (5, 6, 7) does exactly what it says
Anyway, I'm sure you can come up with counterexamples, and I get why people would like it. I just don't think it's worth it.
 
it is more worth than the stupid if - else
 
11:53 PM
anyone of you using the anaconda distro ?
 
just ask, don't ask who you can ask
 
The existing python ternary is horrible but I don't think the None operators really fix that.
 
trying to install pycuda
pip install pipwin
pipwin install pycuda
 
@QuestionC I mean, 95 % of if else - use could be replaced with none ops and and-or
 
gives me Package `pycuda` found in cache
Choose version to download.

[0] : 2014.1+cuda6514
[1] : 2015.1.3+cuda7518
and regardless what i choose i get a zip error :
File "c:\users\skpok\anaconda2\lib\zipfile.py", line 811, in _RealGetContents
raise BadZipfile, "File is not a zip file"
BadZipfile: File is not a zip file
 
11:55 PM
Shouldn't you be using conda?
 
I also find the x or y pretty natural, but I did get infected by PERL in my youth. open or die
 
I'm not a fan either. Like in the JSON example, you just have 'dealWithJSON.py' somewhere and encapsulate the annoying stuff you need None operators in there.
 
@QuestionC exactly
so it is like you have the shell and you're like "well I did have that utility file somewhere, now lets hack it to python path"
 
That's a source management problem. It's not like you don't have to deal with that crap because you added None-aware operators.
 
data analysis
 
11:59 PM
I just want cond ? x : y like a sane language.
 
I am playing with shell
but none-ops are much better!
hehe cond ? x: y as in PHP :D
 

« first day (1921 days earlier)      last day (3030 days later) »