« first day (1986 days earlier)      last day (2962 days later) » 

12:00 AM
Is it ok if I ask a quick question about method arguments?
 
please read the room's rules
it's OK to ask without asking if it's OK to ask
but please read the room's rules
otherwise, welcome @MarfGamer
 
@AndrasDeak Thanks :)
 
so, carry on
 
In java, if you do method(String s...) that allows the method to be called as method("Test," "this", "method") and s is treated as an array. Is there a way to do this in python?
 
if you define your method as
def method(*args):
...
then all the arguments will be stored in the tuple called args
 
12:05 AM
@AndrasDeak Thanks :) It's been a long time since I've programmed in python so I'm a little rusty
 
no prob:)
 
And sanity and order has been restored; the OP switched the accept to my answer, and the author of the other answer self-deleted it.
 
well, about time:P
took you a while to track them down and show them the pointy end of a shuriken
 
@AndrasDeak that was a mistake, the shuriken missed the intended target...
 
@MartijnPieters the unaccept button?:P
@TheQuantumPhysicist thanks
 
@AndrasDeak :)
 
12:32 AM
I can neither confirm nor deny specific Ninja actions taken.
 
sure, sure, ninja code of sneakiness;)
so @TheQuantumPhysicist have you tried the barest of minimums, just putting that formula and the lambdification in a script and compiling?
 
Yep
It's there in the question
Good night, everyone!
 
ah OK, I'll read it when I'm more awake:)
good night
@TheQuantumPhysicist you seem to have a function call and loops and whatnot
I literally meant just a lambdify...
anyway, see you later
 
@MartijnPieters Balance restored! Great to hear.
 
1:45 AM
anyone partying it up in here this evening? Or whatever timezone you are in? :)
 
nearing 3 AM here
not much of a party:P
I have a dog lying on my leg fast asleep
 
you just remind me. I am supposed to watch Daredevil.
 
2:40 AM
/me would like help/a listening chatroom (does that make sense?) in figuring out how to filter leaf nodes out of an adjacency list...
It has 28,593,713 edges, so I'd rather not just load it into NetworkX and filter it afterward.
The adjacency list has two columns, with the implication: X contains Y. A leaf node is one that never appears as an X, only as a Y. So maybe I can filter out such edges by making a unique list of Xs, then including only edges where Y is in that list.
The list of Xs will still be really large, so is there an efficient way to filter the original list by such a large list of comparisons?
Presumably some binary search thingie.
 
2:59 AM
@idjaw enjoying the BA business lounge until boarding time.
 
I could do it in one pass, as follows:
    seen = set(); kept = set(); maybe = {}
    for (x,y) in rows:
       seen.add(x)
       if y in seen: kept.add((x,y))
       else: maybe.setdefault(y, set()).add((x,y))
       kept.update(maybe.pop(x,set()))
IDK how fast that would be -- but I'll probably try it.
@MartijnPieters -- enjoy your flight, wherever you are going.
 
Home, just in time for Easter.
 
/me quickly googles the date of Easter... sees it listed as the 27th... wow, that's going to be a LONG flight...?
 
hmm
isn't there a thing like set_minus? or is it way out of the question to put all of x into a set at once?
set{y}\set{x} would be what you need, otherwise
 
I want to avoid putting the whole thing into memory at once, if I can.
Due to the having over 28 million edges.
 
well either it's memory-heavy, or it's slow, right?
If your above can do it in one pass, that's as quick as it gets if you don't vectorize it in chunks. Isn't that true?
 
Hm.
probably
 
you can probably find a middle ground
treat a few tens of thousands rows at once?
 
:29532784 returning home to the UK from California.
 
How you liking California?
 
3:12 AM
hm, let me try pulling the whole dammed thing into memory -- maybe it won't choke. :-)
 
it probably will
 
Didn't get to see too much this time round, too busy. Arrived Thursday evening, flying back now, worked every day in between except for a little outing to a climbing centre.
But the weather has been somewhat dreary until today anyway, so not much lost.
 
Are you mainly stationed in California?
 
HQ is here. :-)
 
yeah :) Just didn't know which 'base' you worked out of
 
3:14 AM
@JesseW and how about using a set for the elements of y, and keep calling .discard(x) on it?
 
I'm in the London office, biggest engineering office outside of Menlo Park.
 
cool!
 
Hm.
@AndrasDeak -- I'm not sure I understand what you mean by this.
 
@MartijnPieters I just looked to see if it was near where I was a few jobs ago when I went out for a consultation...nope. :P
I was near Leicester Square
 
oh yeah, you're right
that would need 2 passings:(
that's surely slower
 
3:18 AM
heh
 
I meant something like
leafs = set()
for (_,y) in rows:
    leafs.add(y)
for (x,_) in rows:
    leafs.discard(x)
I just didn't realize at first that it would take two turns
wait
you're constructing unique(xset) in your code above anyway
nevermind
I can't come up with anything:D
guess I should go to bed
 
eh, I'm happy for the suggestions and response
and I've kicked it off
 
@idjaw Facebook used to be in Covent Garden, not too far from Leicester Square, but moved to the current location in 2013.
Next up: another move to near Tottenham Court Road.
 
Oh, btw since I'm a numpy fanboy, I'd probably turn blocks of rows into np.array's, then run np.setdiff1d() on the second and first column:P
I have no idea about the performance
 
Sadly, I am a numpy virgin, so I probably won't do that.
(I really need to get familiar with NumPy)
 
3:26 AM
@MartijnPieters ah cool. I think that is near University College of London? My dad did his PhD there
 
ok, kicked it off again, slightly more correctly
 
well if your rows is a list of lists or something compatible, then it's as simple as
import numpy as np
...
treepart=np.array(rows[i1:i2])
leafspart=np.setdiff1d(treepart[:,1],treepart[:,0])
if I'm not mistaken (but I probably am, since it's past 4 AM)
so with that, good night
 
g'night! thanks for the help
 
no problem:)
 
it made it to around the m's (the source of this data is items at the Internet Archive, BTW)
and got stuck
Hm, I wonder if I sort it by X's whether that would work better. I think it might.
 
3:33 AM
@idjaw This place: google.com/maps/@51.5170027,-0.1351986,18z, or soon to be "One Rathbone Square". The old postoffice depot there is gone, a new building is being built.
 
that might eat much of your performance gain, no?
anyway, good night now for real:D
 
Yeah, I don't want to keep you from sleep.
 
I've been doing that for 4 hours, no help necessary;)
 
I'm just still thinking out loud (hopefully not boring the other chat room denizens)
 
worst case is you'll be kickbanned
I mean asked to stop;D
 
3:34 AM
heh, asked would be preferred
 
bye
 
g'night.
 
Ok so I just thought of this
So apparently there is documentation of the java class file format online, and there are different JVM's made in different programming languages
So what if someone made a JVM with Java
a JVM running a JVM
 
This is the Python room...
 
3:46 AM
@davidism Oh, clicked on the wrong room. Sorry
 
A 2 pass solution worked quite quickly and found there were only 16,279 nodes with only 40,775 edges between them.
 
 
2 hours later…
6:06 AM
cbg
 
7:04 AM
Somebody have been a python pipeline developer before? On scale 1-10 how is that knowledge applicable in other software engineering areas and in which way?
I mean what do you do as pipeline developer?
 
I think almost every job helps you later if you "apply thinking" to it.
Experience with whatever is always great, but you have to have a critical mind of whats good and bad, otherwise you might say "this paradigm or methodology I've been doing on that role was good so I should always use it"
and that might not so be a good idea
 
7:39 AM
cbg
 
8:24 AM
cbg
 
cbg
what is a pipeline developer?
@Ilja you at the office?
 
@AnttiHaapala home office
 
@Kevin btw this code is wrong :P
should be key=attrgetter('blah')
that's the only obvious way to do that, not those obscure lambdas ;)
 
9:49 AM
Anyone got any experience with ConfigObj? I like it's improvements over the standard configparser but lack the ability to "stack" files
With configparser.read you can give a list of files, allowing you (say) to pick up the base configuration from /etc/configfile then overwrite that with values specified in ~/configfile and then ./configfile, giving you flexibility of configuration
 
I'd not even use that file format myself any more
I'd use YAML instead
ah though that supports nested sections
 
Scratch that - ConfigObj.merge will do what I want
Yeah, ConfigObj has some useful complexities
 
what I mean that I'd definitely not use configparser and its format for anything
Pyramid uses it (inherited from pylons) and it is PITA.
 
@holdenweb how'd your release go?
 
10:33 AM
CBG all.
 
Oh - you haven't got your gold badge yet? :(
 
'Fraid not. And I'd already CV'ed before someone else noticed it was a dupe.
I foolishly persist in answering questions by 1 rep newbies who can't upvote my answers. :)
Ta, Jon.
 
10:48 AM
Ahh... being helpful is more important than a gold badge :p
 
@JonClements still struggling to integrate the last component (which is why I gave the team a 24-hr advanced deadline - we really need this stuff by the end of today)
@PM2Ring kudos for helping people in preference to advancing your own rep
 
Wow, 104 ups for that answer that took me ten minutes to write
 
Ooo nice :)
 
@poke: I have a minor quibble re: your excellent answer to stackoverflow.com/questions/21553327/… : You say "Because we are catching every exception, we also catch NameErrors and SyntaxErrors". But it won't catch SyntaxError, since the script won't run at all with a SyntaxError.
@holdenweb Thanks, although I'm not completely aloof to gaining rep from such questions: I normally post a comment asking the OP to consider accepting my answer if it's helped them, with a link to a Meta post about accepting. And I usually get a good response from that, but it doesn't get me any closer to earning a gold tag badge.
 
10:59 AM
cbg again
 
@JonClements I remember that answer. :) The code's concise and clever, but quite readable (assuming the reader is familiar with iter, as anyone but a total newbie should be).
 
I've still below 100 on my tops
well, I've upvoted @holdenweb already
 
11:36 AM
@PM2Ring Cheers - only question to get me 2 gold badges :p
 
What is this gold badge everyone keeps talking about, anyway?
@JonClements That 140-vote use of any() twice on the same iterator. Now 141 votes!
 
Haha... thanks... looks like my very brief pickle answer might trickle to 100 at some point... it's had a few years now...
 
cbg all
Thanks @JonClements :)
 
12:05 PM
cbg
 
Cbg
 
just had a 15 month old question accepted - quite odd.
 
12:35 PM
hi
 
hello
 
I am trying to make a single player tic tac toe. So far I have made 2 player. Any ideas? I just need a direction
 
What do you mean by "a direction"?
What are you struggling with?
 
The logic.
 
@SarthakAgarwal Do you mean how to make a simple "AI" to play the game? The simplest (rather naive) way would be to eliminate the locations that would let the other player win, and then randomly choose a location from whatever remains :-)
 
12:38 PM
You'd be better doing some research on this yourself as it's not really a Python problem, it's a logic problem (please don't say something like "But I'm coding in Python!")
 
You need to be much more explicit with your problem @SarthakAgarwal
SO questions are for very specific problems. Not general "how do I implement my project" type questions.
For example, read on how to provide an MCVE. That is typically the type of problem you want to bring forward.
 
@Carpetsmoker Yes. Okay thanks. :D @Ffisegydd @idjaw okay. My bad. Thanks
 
OTOH - this is a chatroom. I'd think @carpetsmoker's idea is a good first direction. If you can get that working, you can progress onto cleverer strategies.
 
^^Yes, that is a good point as well.
 
@JRichardSnape Okay. I'll do that :D
 
12:44 PM
@SarthakAgarwal: You might like to give Minimax a go.
 
@SarthakAgarwal @JRichardSnape advice is a good one in many situations. First get the simplest possible solution working (which is typically not the best solution or the solution you want) and then expand on that. This divides the problem in smaller chunks which are easier to solve.
In this case, you're only solving the problem "which moves let the player win?". A second step might be something like "which moves let the player win in two moves?", or "which move sets us up for a winning move the next round?"
 
And you've already done the very first simplest solution to some extent (in that you have a 2 player manual input version - I've just had a go!). So you just need a function to play as e.g. Player 2. And it could look a lot like your current win function with a tweak.
However, @SarthakAgarwal, your implementation does have a bit of a bug. Consider what happens if Player 2 enters to put their marker on the same square as player 1 (or vice-versa)...
 
@idjaw I thought that asking more general/broad questions like "How do I get started with this problem" is okay here? I don't see anything about it in the rules unless I missed something?
 
Yes, broad / general questions are okay here... as long as they're answerable. :) So the tic-tac-toe question is fine by me.
Similarly, requests for tutorials, suggestions for 3rd-party modules, and other resource requests are ok here, even though they are off-topic for the main SO site.
 
That makes sense. We do chat about a whole bunch of things here, so it is only fair that Python related things are pretty general as well.
 
1:02 PM
OTOH, as Fizzy said, it's not strictly a Python question. It's a general programming / algorithms question. And to answer it in detail would take forever. But general answers that point the OP in a useful direction are fine. IMHO. But I don't speak for all room owners.
 
"Soft" discussion is pretty much the reason the entire chat system exists in the first place.
> I think a web-based real time chat system like Campfire could offer that informal public gathering third place -- a space for people who love the topic to meet, discuss, and collaborate in a different way. It would foster community, and be complementary to both strict Q&A;, and meta-discussion.
 
I'm just a miserable bast***.
 
cabbage
 
I'd say "a miserable Welsh bast***", but that's a bit redundant. :)
 
@Kevin Good ol' Jeftt Atwood ;-)
 
1:04 PM
Enjoy my typos, for they are rare and beautiful like diamonds.
(ok, they're not actually rare. But neither are diamonds, so the metaphor holds)
 
@Kevin You missed the opportunity to introduce a deliberate typo there sighs
 
I don't want to explode anyone's head with next-level irony.
Whenever I read an article about diamonds naturally forming out in space / on other planets, I am suspicious that they're talking about materials that are technically diamond but not recognizable as such by ordinary people.
 
I thought that was when he spelled simile m-e-t-a-p-h-o-r
 
Ex. maybe diamond rain is a gray carbon slurry that just happens to have a crystalline molecular structure
 
1:08 PM
@Kevin Diamonds that you dig out of the ground on earth also aren't recognizable as such by most. e.g. would you consider this a diamond?
 
No.
 
stackoverflow.com/questions/36200858/… answer dump overload happening.
 
You need polishing to make it shine
 
has anyone here ever worked on a product which ended up in alpha/beta among a small group of users? (as in, for a company)
 
@Kevin Fizzy's link talks about ~1cm diameter crystals, not slurry.
 
1:10 PM
@corvid yes.
 
@idjaw Do you ever have to directly interface with customers as a software engineer?
 
@corvid yes (to the first question), as well as yes to the second question
 
@corvid Most likely, yes. Typically with a small user base you want direct feedback.
 
I occasionally interact with my users. But it usually happens like: the user enters the QA director's office to complain about a bug or lack of feature. I overhear him because QA is ten feet from me, and enter uninvited so I can deflect blame for my poor design choices offer a technical viewpoint
There's no "official" channel of communication though.
 
@RobertGrant I appreciate your attention to detail :)
 
1:15 PM
As the user base gets bigger, typically you want to concentrate that communication to someone like a product owner who will take care of all that chatter and prioritize the issues in a backlog..wait..............AGILE PARTY!!!!!!!
where's tristan when we need some more great analogies on agile
 
@JRichardSnape bows
@idjaw I can quote that Steve Yegge article "Agile is rubbish because you should have an unlimited budget, hire smart people and just wait for them to do stuff. Works at Google where I am!"
 
I found that talking to customers can either be really helpful, or extremely stressful. It greatly depends on the customer involved...
 
^^absolutely. I've been on both ends of the spectrum.
 
I generally like my user because he shows up with a printout of the web page with the problem circled in red pen. That's as close to a MCVE as I could hope for from a muggle.
 
@Kevin I worked as a tech help in a computer shop, and you had people come in with a handwritten copy of a BSOD (the full page)
 
1:21 PM
@RobertGrant Unfortunately too many companies copy each other without realizing what really works for their own productivity. If it worked for company X it HAS to work for us....but it isn't? MAKE IT WORK!
 
The pain comes when he has problems circled that have already been solved in dev but not prod. "I fixed that last week". "But it's still happening"
I've tried explaining the arcane magic that is our release schedule, but it's not very effective.
 
I always liked those people, because even though they obviously are grossly lacking in tech skills, they at least tried to make my life easier by giving me something to work with (as opposed to people who came in with "something didn't work, yeah, I think I got an error message, not sure what it was")
 
it's at least somewhat interesting to see how people interact with web app, some things people do seem way different than I would have thought of them
 
It's interesting to watch a user use the site and discover that the page I put 100 hours into, they use 1% of the time, and the page I threw together in 15 minutes, they use 99% of the time.
[insert obligatory reference here - that one comic where one guy is searching online for a thing, and the techie is slowly dying inside because he didn't put his search term in quotes and doesn't use the scroll wheel]
 
Sharing today's music I've discovered for myself for those interested in listening to something new.
 
1:32 PM
Actually one glitch I had was that the validator for a date was supposed to be 12 / 2017 with spaces between the /, but when you hid and re-showed the form, the thing that formats it for you would stop working
 
that darn thing!!! Always getting in the way of making the other thing work
 
The accepted answer here is nice: stackoverflow.com/questions/36198540/…
 
morning
 
what's really annoying is when there's a glitch, and you know exactly what caused it, and it's much more complicated than they think, but you wouldn't be able to explain to a non-technical person
 
oh my goodness....this is going to be third attempt to get the OP to fix their question.....they are just repeating themselves.
 
1:40 PM
is now a certified Neo4j professional for whatever it's worth
 
Proud of you fizzy
 
Got a certificate and everything.
 
congrats Fizzy!
 
What's Neo4j?
 
congratulations:)
 
1:44 PM
Cabbage!
 
A graph database
 
Congratulations @Ffisegydd!
 
@Kevin The answer to your problem is the old saw "Fixed in next release." Tell him that the old software is only recalled every couple of weeks if he understands cars
 
Don't be too proud of me, it was an hour long exam that I did in 20 minutes. Didn't even have to pay for it, just did it on their website and added it to my LinkedIn.
 
@PM2Ring Not exactly true, see this (constructed but still valid) example:
# a.py
print 'moo'

# b.py
try:
    import a
except:
    print('whee')
 
1:46 PM
Someone once put an SIR (system improvement request) for VMS that read in its entirety "VAX VMS X.Y does not work". DEC's response was "Fixed in next release"
 
@Ffisegydd Oh, so it’s actually just a random certification? Still something I guess!
 
:P
 
@idjaw FWIW, that's a GCSE assessment task. IOW, the mark the student gets for completing this assignment goes towards their official final (junior) high school exam score. Of course, the OP may be doing this task outside of the GCSE system, so feel free to ignore my remarks. :)
@poke Ah, ok.
 
I didn't have to study or anything for it. It's just their little special exam on the tech stack. Well I suppose my "studying" was using the tech for 8 months.
 
@PM2Ring What does that imply though to the quality of the question?
 
1:54 PM
The question was terrible. FWIW, the OP's just edited their code right down, but the question's still terrible. There are dozens if not hundreds of questions on the site asking about this task, and I must admit that most of them are pretty bad, but it's not too hard to find answers with good code if you know how to search.
 
Ah OK. I understand what you are saying now.
 
user559633
@Ffisegydd Do you know kung fu4j now?
 
I was (mostly) just pointing out it's not merely a "do my homework for me" question. It's a "pass my final programming exam for me" question. See GCSE
 
I would like to have your >3k rep moderating attention for a moment, please:)
There's a user called Drew whose hobby is collecting partially closed questions in tag-categorized batches. By sorting these according to close votes, it's possible to look at a group of highly-closevoted questions, and spend close votes efficiently (since in the review queue the votes are scattered among posts, and are likely to age away).
So if anybody is interested in looking at collected mostly-poo [tag:python] questions, please take a look at the beehive: https://sites.google.com/site/technologydrew/files . T
 

« first day (1986 days earlier)      last day (2962 days later) »