« first day (2099 days earlier)      last day (2866 days later) » 

2:00 PM
@MorganThrapp I would expect so.
 
user559633
it's pretty straightforward. you write JS and then a manifest.json that states when it activates
 
Really? That's super easy
 
@MorganThrapp sure, even if you have less than 1k
 
Oh, huh. I would've assumed you couldn't.
I guess it makes sense though.
 
user559633
@corvid yeah, it's really not that bad
 
> cast close and reopen votes on your own questions
 
then I don't get why they asked me to do that... they said authentication was hard or something. Is there some sort of ephemeral container for data? Just need to acquire an auth token
 
You can vote to reopen your own question? Wow. Definitely didn't expect that.
 
Fffff I was all ready to submit an edit to my answer and my co-workers unplugged the router to install a new one.
Now all I can do is fume impotently on mobile chat until they finish
 
Annoying. But trying to edit answers on a mobile device is even more annoying.
 
2:09 PM
Do you have the app? Does that make it any better?
 
FWIW, my CompactEncoder would render the JSON in your 2nd example like this:
[
    1,
    {
        "2": 3,
        "4": ["5", "6", "7"]
    },
    8,
    9
]
 
That's some nice encoding.
 
That's using json.dumps(data, cls=CompactEncoder, indent=4, sort_keys=True)
So it honours the passed-in indent arg except for the inner-most nested lists or dicts, where it reverts to indent=None, it also adjusts the : and , separators, if necessary.
As an added bonus, it doesn't yam up if you try to use sort_keys=True on a dict that has mixed integer and string keys. :)
 
cabbage
 
user559633
cbg
 
2:25 PM
I wish OpenOffice had map.
 
Hey guys, if I have a string'd JSON value I want to turn into valid JSON, but fails because some potential values have double quotes in them, what's the easiest way to target it and run the replace?
 
Here's some big band bebop from the incredible kids of the Sant Andreu Jazz Band: Hi-Fly by Randy Weston featuring Magalí Datzira on vocals and bass. The tone of her voice isn't great, but she certainly has great jazz feel.
 
For example, "{"key" : "va"lue" }" where the quote inside value is desired, but needs to be escaped
string.replace() globally won't work, because it will escape the k => v quotes that are JSON valid
 
Is that "{"key" : "va"lue" }" in a file? Or do you already have it in a string, eg s ='"{"key" : "va"lue" }"'?
 
It's already in a string
 
2:31 PM
Is it like what I just posted, or is it like s ='{"key" : "va"lue" }', without the outermost quotes.
 
I believe it's like that one, without the outermost
Yeah, like that
 
Ok. That's slightly simpler. However, I think your best option is to track down the person who generated that horrible non-JSON and stab them. :)
 
Will the inner quote always be in the value, or also potentially the key? Will the inner quote ever be followed by a comma?
Yeah, level up knife skill.
 
Thankfully it's not my issue or my code lol my coworker asked me, and I told him he needs to target the value to run the replace
But yeah, knife skills need polishing because that's terrible JSON generation
The quote is only in the value it seems
 
then remove the fourth quote mark, in case there are more than 4? Or are there multiple key-values?:D
It's the latter, isn't it?
 
2:35 PM
@SterlingArcher I suspect they tried to do backslashing to escape the embedded quotes, but just didn't do it properly. So if possible, try to get them to fix it, rather than creating a nightmare parser to deal with it at your end.
 
stupid data having multiple elements...
 
So there's probably a way to write a regex that looks for something between quotes that come after a colon and come before a comma or a curly brace, but that still doesn't cover all cases. You just need to keep working out what the unique boundary is and hope that something that looks like it doesn't happen in the value.
 
tell the colleague to \\" when they \" :P
 
Non-regular languages!
 
@davidism I think \w"\w should only match the one to remove
With some lookahead/lookbehind, it should be easy. But yeah, stabbing is the pythonic way.
 
2:37 PM
Using Regular expression to parse non-regular constructions is highly irregular, but sadly all too common.
 
(last ping, honest)
 
Time for pyparsing.wikispaces.com, although I'm not sure what the parser would look like either.
 
@PM2Ring it seems like it's an upstream pipeline so he can't fix the source or get them to fix it. He's slightly upset over this lol
 
@AndrasDeak And the xkcd way.
 
2:40 PM
Sounds like it's too long range for a knife, have you considered a gun?
 
Americans
 
cabbage
 
I realized how American that sounded right after I wrote it.
 
@BhargavRao cabbage
 
Depends on the caliber
 
user559633
2:44 PM
how about a gun that shoots knives?
 
user559633
 
There are ballistic knives :P
 
Weeeeeeeeeeeeeeeeeeeeeee geohashes are fun.
 
2:47 PM
What about a knife that shoots guns?
 
Pew pew
 
user559633
hey sterling
 
But yeah, the good quotes should have a word boundary on one side or the other, and the bad quotes don't. So it may make it simpler to do it in 3 passes. On the first pass replace the good quotes with a char that doesn't occur in the document, then replace remaining quotes (which should be the bad quotes) with properly backslash escaped quotes, and then revert the good quotes.
 
hey brah
 
@RobertGrant worms worms worms... worms worms worms... :p
 
2:54 PM
worms worms worms? (trigger warning)
 
Why... why is that a trigger warning?
It's worms ._.
 
Not to be confused with Würm
 
user559633
uhh because this is a safe space you hateful person
 
@SterlingArcher because it’s a quite graphic image?
 
user559633
2:57 PM
i don't even know who is being satirical anymore
 
@poke Worms are great:)
 
and tasty too!
 
The laziest solution would be to remove all possible combinations of quote marks until one of them parses. A mere O(2^N) run time.
 
@BhargavRao wat
 
@AndrasDeak you don't eat worms? o_O
 
2:58 PM
Worms are good protein
 
Totally reasonable as long as your json has less than ten quote marks
 
Slowly walks away from the cultural divide
 
@AndrasDeak are you a freak or something - everyone eats worms :p
 
user559633
and worms eat everyone
 
user559633
the ciiiiiiiiiiircle of life
 
2:59 PM
true ^
 
I've heard good things about the online novel Worm but I couldn't slog through the chapters about high school bullying to get to the primary plot which is apparently "metahumans try to prevent the destruction of all universes". Talk about scope creep.
 
@tristan The day we arrive on the planet... and blinking step into the sun... :p
 
Imagine what all the bullying-fans feel when they encounter the actual plot.
 
@Kevin IIRC, Yudkowsky recommended it to HPMOR fans when he didn't have enough free time to finish writing HPMOR.
 
I assume the bullying subplot ends happily with the bullies being attacked by millions of spiders. So "gratified" is how those readers would feel.
 
3:05 PM
So much bully-hate in our world.
 
@PM2Ring yeah that's probably where I heard about it in the first place. Somewhere within the rationalist diaspora
 
man, I'm hungry
 
BTW, I wrote a SO Meta answer a few hours ago on the topic of newbies editing other people's answers to add newbie-friendly code comments to them. meta.stackoverflow.com/questions/327869/… Feel free to upvote, downvote, or ignore as you see fit. :)
 
I saw the question earlier
I was a bit surprised at all the "go ahead and dupe answer with comments" suggestions
I usually downvote those:P
Oops, we have a new one along those lines;)
 
I wouldn't downvote a dupe-plus-comments answer if I detected good intent, but I probably wouldn't upvote it either
Newbie comments are not useful to me, therefore no "this answer is useful" upvote
 
3:15 PM
Is there anyone here available to explain to me how process_request works in Scrapy? For example, what would have been the code solution to this stackoverflow.com/questions/16040311/…
 
@AndrasDeak If the derived answer adds value, I don't see a problem, as long as proper attribution is given to the original answer.
On a similar note, I occasionally write answers that generate timeit info for the code given in the existing answers. I don't expect to win points from such answers (although I do get them sometimes), I just do it to help readers see for themselves the speed differences between the algorithms. So even though the answer isn't directly answering the OP's question, it's still adding value to the page.
And it can stop the endless arguments that can occur in the comments when people debate the merits of their favourite algorithms without hard timing info. :)
 
Yeah that kind of meta info is p. valuable
 
A new user by the name of "jon snow" just posted a really bad question where they show they know very little about the thing they're asking about. I am beyond tempted to just comment "You know nothing" on their question.
 
cbg all
 
@Kevin is there a way i can make it into a list without typing "list1 = []" on each line — jenny 4 mins ago
My psychic debugger must be on the Fritz because I'm just getting static here.
Must be because I'm on mobile. Limited bandwidth is throttling the mystic waves.
 
3:21 PM
Still no router?
How long does it take to plug in some cables?
Are you sure they were colleagues and weren't actually pentesters who have social engineered their way in? REMEMBER YOUR TRAINING.
 
@Kevin The Force is weak with that one.
 
It seems the router requires a special activation code that we haven't got. We're brainstorming ways to get it without being on hold for two hours with tech support
 
How long have you been brainstorming? 2 hours or so?
 
Brute force is an option.
 
Approaching the ninety minute mark, I'd say
 
3:24 PM
I might go home tonight and willingly code some Java.
 
exciting. any special occasion?
 
@PM2Ring I've done that in a past, but I used community wikis for that purpose
 
I have a python ordered dictionary where each keys value is a list. Im trying to remove duplicates in the values, how do i do that. a set inside a list would do the job?
 
?
you mean remove duplicate elements in the list-valued keys?
 
3:27 PM
@Withnail Found out that you can write stored procedures for Neo4j where you write Java code to do actions, rather than relying on Cypher.
 
@AndrasDeak Fair enough. I've only ever done 1 community wiki, but I can't remember what it was. :) It was probably a timings answer, though.
 
Means you can do some things that just aren't possible in Cypher, e.g. iterative work
 
Oh interesting. Just wondered, I'm doing some Java work at the moment as well, just mucking about in Android.
 
XXXXXXX : OrderedDict(['TRIAL', ['N', 'N']]) something like this and i need to get XXXXXXX : OrderedDict(['TRIAL', ['N']])
 
@Withnail you mentioned Neo4j yesterday, I wholeheartedly recommend this plugin neo4j-contrib.github.io/neo4j-apoc-procedures
 
3:28 PM
so while appending to the list, i need to remove the duplicates
 
Adds 100 or so procedures that are very useful.
 
cool, will have a look, thanks!
 
@Anonymous are you saying that your keys are lists?
 
no the values
 
@AndrasDeak Yep. It was a timings thingy: stackoverflow.com/a/36030019/4014959 But I did it CW since I'd already submitted an answer myself.
 
3:30 PM
If you can't allow duplicates then you should use sets probably.
 
@PM2Ring I see:)
 
Can we reopen the last cv-pls chat.stackoverflow.com/transcript/message/31725099#31725099, The answers there are good.
 
@AndrasDeak The accepted answer to that question would have a score of zero if it weren't for my upvote. :)
 
@BhargavRao isn't "do this with zip" a bit too specific?
@PM2Ring that's life on SO:P
 
@BhargavRao isn't that a dupe?
zip(Å‚, Å‚[1:]) is a pretty common oneliner
 
3:44 PM
I could not find any.
 
@MartijnPieters page not found
 
certainly seems like a dupe of that... reopen and then close as dupe?
 
whistles nonchalantly
 
3:51 PM
{'345': OrderedDict([('ADMNICU', set(['Y', 'N']))])} how do i change the set to list?
 
@Anonymous change set to list?:P
 
yes
 
that was an answer
 
3:53 PM
well i did that and removed the duplicates, but after removing duplicates i want to convert the set back to list
 
why not?
 
is that doable?
 
>>> list(set([1,3,1,2]))
[1, 2, 3]
@Anonymous only if you do it
 
@AndrasDeak note that ordering there is random
(well, I know you know... but other people, you know)
 
@vaultah try again ;-)
 
3:54 PM
@WayneWerner they want a list from a set. That's guaranteed to be arbitrary.
 
yeah just stuck on how to parse the dictionary and then convert the set to a list
 
Just pointing it out in case someone gets the wrong idea
 
If anybody wants a stable unique (ahem), they should google "python unique list"
 
@Anonymous do you mean convert a dictionary to a list, because that's a horse of a different color
 
they clearly said set:P
 
3:57 PM
If you look at the example, i have a dictionary. key is 345 and the value is an ordererd dict. Inside that there is a set which i wanna to convert to a list. I have n number of keys for which i want to do this
 
@AndrasDeak still busy.
 
OK, sorry:)
 
DSM
So you basically want to turn {'345': OrderedDict([('ADMNICU', {'N', 'Y'})])} into {'345': OrderedDict([('ADMNICU', ['Y', 'N'])])}. That doesn't sound too bad.
 
DSM
3:59 PM
@AndrasDeak: is there a one-line explanation of what all the fun's about?
 
@DSM vaultah found some sneaky little peopleses
 
yes
 
Martijn seems to be handling the situation
 
Seems like you wouldn't really want carbon fiber mobos but maybe that's just me
 
4:01 PM
@AndrasDeak @MartijnPieters handling the situation, one message at a time. :-P
 
DSM
@Anonymous: so what's the problem? Do you know how to loop over the keys and values of a dictionary?
 
yes
 
I blame OSX and Stack Overflow.
 
@davidism reminds me of Death's brief career as a harvester
 
4:03 PM
OSX for binding CTRL-click and not allow it to be disabled.
and Stack Overflow for not giving me an alternative to CTRL-click..
 
one wheat stalk at a time
until the end of time (or the field)
 
DSM
@Anonymous: it might help if you show what you're trying now and why it's not working. If you know how to loop over the key/value pairs of a dictionary, and you know how to turn a set into a list, and you know how to assign a new value to a dictionary, then that's all there is to it.
 
Heh, there was a sneaky way to read messages in private rooms. The bug was fixed a few weeks ago :P (JonCle will remember)
 
24
Q: Chat move messages bug for Mac users

Raghav SoodAs a room owner on chat, you can move messages out of the room. To do this, we can click on the Room link in the sidebar and select Move Messages. This results in the following instructions: Now on a Mac, Shift-click works fine for selecting an entire set of consecutive messages. However, Ctr...

 
@MartijnPieters it might be worth a bump?:D
last comment 2 years ago
 
4:07 PM
ok made it to work
thanks guys
 
typo? no mcve? difficult to tell?
 
@AndrasDeak last comment, just now.
 
you didn't read the fine manual?
 
@AndrasDeak Or in the TL, meta.stackexchange mods: Do this asap
 
@MartijnPieters does that happen even if you have a mouse with a dedicated right click?
 
4:08 PM
1 message moved from Room for Martijn Pieters and vaultah
@davidism yes.
CTRL-Left Click -> Right Click.
Right Click -> Right Click
 
Hi all, I have a quick question about matplotlib's subplot. If I create a list of subplot objects. and then make all the subplots share an x axis with one, do I have to plot the data in the chosen-to-share plot first before calling subplot.sharex = the-chosen-plot?
 
@Dzhao Have you tried?
 
(I'd expect sharing to be mutual though)
 
So I've tried to first make subplot objects and then update their sharex
 
4:22 PM
@WayneWerner I went with typo / no repro
 
@Dzhao use the sharex keyword of subplots()
 
when plotting it seems like the x axis aren't shared because the ticks aren't lining up
 
@Dzhao Do you have an MCVE?
 
@davidism you'd think that with my setup I didn't need that CTRL, but there you have it..
 
MCVE?
 
4:23 PM
[mcve]
 
DSM
@WayneWerner: not in chat, more's the pity.
 
weak sauce
 
DSM
@MartijnPieters: for a split second I thought you had one killer view.
 
4:24 PM
no I don't. I'll make one and just post a question on the forum
 
@MartijnPieters nice distraction device
 
@MartijnPieters Looks like happiness to me
 
@Dzhao there's no forum
 
His view is not much worse.
 
I was kinda hoping this problem was trivial
Q&A page
 
4:24 PM
@DSM I do that too, but not on those screens ;-)
 
How's the Kinesis? I've seen that and wondered many times
 
@Dzhao it is
did you try what I just said?
 
@DSM Thank God! I though I was the only guy who thought that.
 
Yes.
I basically did:
 
@WayneWerner can't live without it.
 
4:25 PM
self.plots = [plt.subplot2grid(5,1), (i,0)) for i in range(5)]
 
But yeah, I switched on the screensavers to save me from having to censor the screen contents.
The whiteboard behind has the remnants of me explaining unicode stuff to a colleague. Nothing interesting there!
 
`for subplot in self.plots[1:]:
subplot.sharex = self.plots[0]
then later I added x and y data to the plots
 
Where did you get the idea that you'd think that would work?
 
@Dzhao are you trying to put 5 subplots below each other? Why not use plt.subplots with nrows=5 and sharex?
just like I said
 
@AndrasDeak Let it out.
 
4:27 PM
doesn't subplot2grid generate a subplot()?
 
@Ffisegydd I can't, I'll go mute (and suspended)
 
I'm not gonna lie - it'ls worth it.
 
I'll re-read docs
 
I guess so
 
ugh but how come whenver I google matplotlib plt.subplot I get examples and not the docs?
found it
 
4:29 PM
gotta go, I leave you in the nurturing hands of Fizzy
 
Heh.
 
head start: the docs I linked to also have examples
 
I'll take a guess "Things that only a sadist would say?"
 
it's tricky because it says "Examples" right before it
 
user559633
damn son
 
4:30 PM
Why yes, "I leave you in the nurturing hands of Fizzy" is something that only a sadist would say!
 
There's no Haskell room; Oh, Wait!
 
Those rooms don't look very functional
 
Lol, I see what you did there!
 
user559633
And ours doesn't seem very dynamic
 
Everyone say Quack - we can then at least claim it's duck like
@BhargavRao wow... the number of deleted rooms... that looks like a room that someone would be brave/insane to try and get a community going in :p
 
4:39 PM
Yep, It's tough to build a community. You know that, the best. :-)
 
Our office is full of Ekans in Pokemon Go, and everyone's blaming me for using Python.
8
 
@JonClements This looks like challenge accepted. But perhaps the user does not know that there were many rooms before that. :/
 
That ain't much clear
 
Oops, Did I scare the user here? stackoverflow.com/q/38401170/4099593
 
4:49 PM
I doubt it - probably confused them by closing a ruby question as a duplicate of a python one though?
 
The initial question had the python tag and spoke about the issue in python. (The op has reposted it). :)
 
I figured they would... at the time of deletion it was very ruby specific :)
 
Hah! That's a dupe too!
 
Fun times
 

« first day (2099 days earlier)      last day (2866 days later) »