« first day (2525 days earlier)      last day (2648 days later) » 

00:07
@Kenshin I am not very good in python (or another coding language) but if you show me your code (or an example of the problem) in pastebin maybe I can find the error.
Ignore the indentation errors, they are correctly indented on my end of the code, but just happened to be pasted this way
00:33
help with c please
01:20
Sorry @Kenshin, I don't know about that subject (ctypes) and I get an error when I execute from referential_array import build_array so even I can't test your code. Sorry.
no problem, thanks for trying
it's python 3.6 by the way
I have python 3.6 but I get ModuleNotFoundError: No module named 'referential_array'.
oh, the referential_array needs to be a separate file in the same folder as the array class file
named as referential_array
Do you mean that def build_array(size): is in the file referencial_array?
01:24
Ok, I'll try
02:06
I don't know what you are doing but if I replace self.the_array2.append(self[i]) with self.the_array2 = [*self.the_array2, self[i]] it doesn't give an error. I hope that could be useful.
Oh k, I'll give it a try thanks, maybe need some clarification as to what that line means too
I'm trying to copy the_array onto the_array2, then with the extra size from the_array2, copy them back onto the_array again
Ok this worked for increasing an array from base size to double its size, but once that double size has been reached again, it no longer doubles it anymore, i need it to keep doubling when it gets full
Is there an error?
@Kenshin this is ridiculous. Start debugging your code. Don't dump a poorly formatted long mess on the room and expect others to help.
Please see stackoverflow.com/help/mcve before continuing.
ok sorry
02:19
Good evening, everyone!
@SomeNewPythonGuy Good evening, but also good bye. It's 11:20 p.m and in a couple of minute I have to go to bed.
I understand that @EnderLook. I just wanted to introduce myself is all. Never knew this was here, haha
Anyway, I have an issue I need help with, if anyone wants to, that is. Python 3.6
@SomeNewPythonGuy welcome, please read the room rules: sopython.com/chatroom
02:25
No you didn't offend me @ender. I was stating that it's bedtime for someone around here
 
2 hours later…
04:36
hey...
anyone there ..
 
1 hour later…
05:42
cbg
 
1 hour later…
07:19
cbg
07:57
Cabbage
08:09
question: let's say you have several lists that you want to incorporate into a big lists and change the the several lists as several sublists into the big list. Is there a way to automatize it with a loop or something else? I give you an example
a = ['a','b']
b = [''c,'f']
c = ['f','h']
...
z = ['a','1']
If you can do it manually, can do it automatically too. Only the effort required in each will have to be considered (complexity)
@AshishNitinPatil I mean is there a library that I can use or something like that ...?
the aim is to have that
aim desire :-p
biglist = [['a','b'],[''c,'f'],['f','h'],...,['a','1']]
So basically, just a list of all your individual lists?
08:13
yes
I would need to know every existing lists, first hand
something like using * in bash
08:30
that's an odd thing to do. why do you even have 26 separate lists?
@Rawing it is not technical per se. More if I wanted to do something like, what should I do? yesterday when talking to DSM, I asked him what would be the best way to append two lists , making them sublists into a bigger list. His answer was to do that biglist = [[sublist1],[sublist2]]
I wanted to know if there was multiple sublists like in this case, is there a way to figure them out and to append them?
there shouldn't be. if you've stored each list in a separate variable, that would imply that they're not related - because if they were related, you'd have stored them in a dict or in another list to begin with. if you find yourself in a position where you have to combine a lot of variables into a list, it's likely that your code smells
if you're asking out of pure curiosity, then yes, you can probably use locals() to find all variables that hold lists... but again, that smells
def autoconcat():
    a = [1, 2]
    b = [3]

    variables = locals()
    c = [value for value in (variables[var] for var in sorted(variables)) if isinstance(value, list)]
    print(c) # [[1, 2], [3]]
08:46
@Rawing out of pure curiosity, nothing else. But I'll bear in mind that it is definitely a bad method to apply if I have a big piece of code to write one day.
09:16
Cbg
09:45
cbg
I appreciate this new fancy of cats in chainmail
today's unexpected problem that wants to be fixed: I somehow managed to upload more than 2GB worth of files to my 2GB Dropbox drive, so now my backup program crashes because it can't deal with that situation
have you considered not breaking the universe every once in a while?
sorry, I'm not doing it on purpose. It just happens, y'know?
I apologize in advance if I ever break the universe too much for you puny mortals to survive. Kevin and I will miss you all.
Aug 15 at 19:58, by Kevin
"Ah but this is just a 3d projection of a slice of a superellipsoid, which just happens to look like a sphere". And I'm a 4d projection of a slice of a superKevin which just happens to appear skeptical.
10:07
conjecture: any 3d projection of a superKevin is nontrivially skeptical
I've self diagnosed my back pain with a pinched nerve
self diagnoses never go bad
I'm going leave it for a week or so and if its still bad i'll head to the GP
10:26
recbg
11:25
hi
I'm wondering if I made my code too intelligent (trying to do too much in a single word - I tend to make that mistake and then later on can't decipher code anymore).
I tried to make a property "lazy" - it returns a list but only calculates on the first accessing
@property
@functools.lru_cache
def input_list(self):
    return list(self._input_list)
Hi all, does anybody know what server module is included in the standard library?
lol never mind just found it
11:42
@nobism for future reference (although a few items such as tkinter there are not stdlib, only de facto stdlib)
@AndrasDeak Ok thanks
@paul23 might surprise the user when they append to input_list and the next time they access the property it has reverted to its original form
Perhaps an input tuple would be more appropriate if you're sure nobody will ever need to mutate it
You mean as name? (For my current application I'm actually providing it a generator expression)
But it has internal "modify lists methods" - ie the list is "owned" by the class and changing would break it anyways.
11:58
Well if you change the property name to input_tuple I'd also change the type of the value to a tuple, but yeah
Although personally I try to avoid having type names in function names where possible
hmm I could change it to "input_sequence"
def input_sequence_this_won't_change_ever_promise(self):
I tend to use "list" as synonym for a generic "sequence".
@Kevin How does one quickly read what a function does without knowing what types it works on? Especially if people don't put the type in the name of the function. I'm coming from a C background.
Type hints!
12:02
I usually depend on pluralization to indicate whether a value is scalar or not. widget is a Widget, widgets is a list. 'course, it becomes a problem if the word has identical singular and plural forms
... Like input, in some contexts
I love the typing library - though it seems many people also hate it.
sumit(input_list: Sequence[int]) -> int: is clear to me.
@nobism that's one reason why decent documentation is crucial
of course that goes for C too; the fact that your function returns an *int is usually insufficient to understand its workings
ideally functions have at least a descriptive docstring that you can read using help(fun) in an interactive shell
This all sounds like a lot of work, which is why I only spend a couple days on a project so I can keep all the implementation details in my short-term memory instead of writing them down anywhere
hmm too bad whatsapp doesn't allow bots :(
Unrelated topic. The local police newsletter mentioned the thumping bass music that has been audible all throughout town. Their conclusion is "it's probably coming from the city, and the city cops are too busy investigating actual crimes to do anything about it, so oh well"
With an implication that, if we could narrow the location down farther than "probably the city", then maybe that would help.
Now I'm trying to figure out how hard it would be to triangulate the source of the noise to within the accuracy of, say, a 300 foot square.
12:15
without going within blade's reach
@Kevin depends on the frequency
It's bass, so... Low.
Well probably easiest would be to use an aerial volume measurement - if you do it within the streets building reflections & absorption would make triangulation near impossible without extensive analysis of the accoustics.
I could position two* recording devices with synchronized clocks, far apart and roughly perpendicular to the approximate direction of the sound. Then I can determine the difference in time that the two devices recorded some distinguishable noise, and do math to it, yadda yadda speed of sound in air, yadda yadda intersection of the circle with the surface of the earth, and bob's your uncle
So you'd take a balloon, add some mics to it and launch it at several places, measuring the volume.
12:19
This is assuming that the sound is traveling in a straight line and not bouncing off of a lot of walls. There is only empty space between the city and me so I'm moderately optimistic
My back of the envelope indicates that I'd need timing accuracy to within 0.05 seconds to get a reliable position
And an open field between you and the source.
It's a river, which is pretty open because it's a river
ie at my room (10th floor) I hear sounds from the street louder than those at the first floor. - just because the sounds are bounced between the buildings and in some way converge on my window.
no, that's because in The Netherlands you're below the ground, so the 10th floor is closer to ground level. #science
"all throughout town." "It's a river" - strange town you live in.
12:23
This is how they triangulate threats in the military too
Ever since WW1
Have I never mentioned before that I live on a shanty town made of rafts in the middle of a river? Odd.
12:46
Hmm, just for my knowledge: is it possible to make a method non virtual/explicitly call this class' (not a child's) method
so you want to prevent child classes from overriding your method? there's no trivial way to do that.
you're gonna need __setattr__ or metaclass magic for that
class A:
    def __actual_foo (self):
        print('The real foo!')
    def foo (self):
        return self.__actual_foo()
    def bar (self):
        # call the actual foo
        self.__actual_foo()

class B (A):
    def foo (self):
        print('Haha! Overwritten!')

B().bar() # The real foo!
Well that, or have a function in the parent's class call explicit the non-overwritten method.
Well you can always do A.method, right? I also assume that this makes more sense if method is already a classmethod
If the child class maker is following good design principles, then overriding a function shouldn't harm the execution of any other functions defined in the parent class, thanks to LSP. If they aren't following good design principles, then they're going to shoot themselves in the foot eventually no matter what you do, so you shouldn't worry too much about making the World's Safest Activity Box
12:57
@Kevin the pin has fallen off from the chat edit message again
just FYI
Already tried to repin yesterday but it’s still marked as pinned for me in the transcript (probably because I was the one who pinned it last time?), and I can neither repin nor unpin.
possible
I just tried pinning it and it didn't do anything. But my connection is bad so maybe it just didn't take. Let's try again...
I wonder if it works if you unpin and repin once every day to keep it fresh.
Bah, I spent a minute trying to figure out why opening my python module foo.f in vim gave me an empty file
@poke once every 12 days is probably enough...
13:00
Hmm, now the dropdown says "unpin this message" even though it doesn't look pinned to me on the sidebar
I had successful repins in the past, so this might be a bug
does the history say anything?
@Kevin Then you have the same problem as I
I don't see it pinned
This is unusual because I don't think I ever pinned it before, so the current working theory of "each RO can only pin a message once" doesn't fit the evidence
yup
it's probably the message that is in a borked state
what does the history of the message show?
it should say who pinned it
13:01
It’s displayed as pinned in the transcript, unpinning does just respond "ok" (but does not change anything), and trying to pin it (through the API call directly) says that "You have already voted, but the voting has been cleared by a moderator"
Pinning is not displayed in the message history
Here is the complete history.
The lazy solution is to repost the exact contents of the message and pin that. The drawback being that the star count will be back to 1
proper pins have a note of this in the history
@Kevin Naah, we don’t do that :(
13:05
Does the "pinned by..." message also appear for messages that were once pinned, but which are not currently pinned?
it's not the same without 39 stars!
@Kevin nope, I tried (for manually unpinned messages)
@AndrasDeak Okay, I can see that too for active pins.
There’s no such thing on that post though
I can try and dig up a post-timeout-unpinned message
also:
> You've earned the "protect questions" privilege! Learn more about it in the help center.
\o/ teh power
yay
13:06
Rad.
“poke, name one privilege you’ve never used.” – “protect”.
(at least as far as I can remember)
But good job and enjoy your new permission!!!!!!!!!111
If you had asked me five minutes ago, I would have told you it was a mod-only power.
lol
13:08
hehe :D
I'll go answer myself with a sock account so that I can protect it
You cannot protect everything
mod alert :-p
yes, that's why I need to add a sock answer
" at least 1 day old with a low-rep answer"
I thought the low-rep answer had to be deleted, but nay
You can probably sort by votes and check posts with latest activity
But that may be hard
I'm sure being able to use this arcane power is worth the effort
13:11
Currently considering making a meta post about the pinning problem
something tells me that by the time I'd have to use this ability I won't remember that it exists
@Kevin we could first test if one of the dozen python mods can fix it
meta.stackoverflow.com/q/272383/953482 looks similar at first glance, but is actually "I'm not an RO and have never pinned this thing, but the transcript thinks I did pin it"
Which is different than "I am an RO and I actually tried pinning it and it said it pinned it but it's not actually pinned"
But the gist I get from that is that the pin feature is a bit broken
I'm also considering going into another room and asking the ROs there if they have had this problem and if they know a workaround. But that's kind of automatically off-topic in every room that cares about on-topic-ness
lol
what other room actually cares about on-topic-ness?
13:16
we're not that topic-centric in MATLAB, but then again I'm here if you need RO info
and no, we haven't seen this yet, but we rarely pin stuff
Okay, guys. This topic - let's put a pin in it.
maybe ask in socvr
I'd say there's a positive correlation between on-topicness and the RO team being engaged and well-informed about the technical minutae of the chat system. So ironically the people most able to answer my question will be least willing
@RobertGrant But… we can’t :((
This is independent of the problem that there might not be any such RO teams
13:17
OK I found an expired pinned message
> You have starred and pinned this message.
but no pin info in the history
OK, the menu suggests that I unpin it -> OK, click, reload -> nothing happens
I believe that's a "confirmed"
OK, web-savvy personses: try the API github.com/Manishearth/ChatExchange/blob/master/docs/…
> POST /messages/MESSAGE_ID/owner-star
Pins or unpins the specified message. This is a toggle, like starring.
@AndrasDeak That’s what I said above
22 mins ago, by poke
It’s displayed as pinned in the transcript, unpinning does just respond "ok" (but does not change anything), and trying to pin it (through the API call directly) says that "You have already voted, but the voting has been cleared by a moderator"
– which is btw. an interesting fact, that cleared votes are apparently still stored but just “disabled” by ROs?
@poke yes, hence "confirmed" :|
:P
I thought that the fact that I can reproduce the problem on an expired pinned post in another room means something :P
now go try that API thing, you know what a POST request is
oh, I see
13:26
msgID: 37997172
@AndrasDeak I DID D:
WELL YOU DIDN'T SAY SO >:(
so it's consistently borked
that's a good thing because otherwise we'd have a workaround ;)
> […] and trying to pin it (through the API call directly) says […]
(emphasis mine)
ooooh WELL I DIDN'T READ THAT
so much about the “confirmed” q_q
13:27
confirmed what? :P
your first reply was to my manual machinations :D
shuddup :<
so at least it's not just Kevin's post being worn out due to all the pinholes
My API call was also manual
my API call is nonexistent >:|
Would have been the first post from Kevin that would put up a fight against being starred…
13:28
poke, do you call it ay-pee-eye as we should, or do you read it as apee?
@AndrasDeak synchronisation problem ? ack and sync
I usually go for the A P I one
this is major problem in all servers
I'd have to concentrate real hard to say the proper one; but fortunately I never talk about APIs in person :)
But APIs are everywhere :(
So you have no service architectures whatsoever?
I use them; don't talk about them
lol
0
Q: Pinned message not appearing in chat sidebar

KevinIn the Python chat room, we have a message that we like to keep pinned, because it is a useful reference for new users that are unfamiliar with the markup system. An RO pinned the message, and it stayed on the sidebar star list for a few days before falling off automatically, as expected. Anothe...

(use as in browse the web:D)
13:32
@Kevin Thanks for including the kidnapping star
our actual programs used for work are self-contained bulks
btw Lightness' bug is still alive
Hey Jon
@poke It was my privilege :-)
\o cbg
Umm... strange - it appears pinned in the transcript :)
13:34
"few days" == 14 days methinks
a few days - give or take a few weeks :D
I'm looking forward to the comments there. "What API?" "Why is that guy talking about kidnapping?"
Umm... doesn't like it does it - weird
A little bit of levity, such as discussing kidnapping, is important for achieving good meta post balance
@poke I'm pretty sure there's a FR for perma-pins out there
I mean the has to be
maybe on overmeta...
13:37
freehand red circles are also important, for an informal tone that makes the reader think "I'd like to have a beer with this guy"
Didn’t look on overmeta, but on normal meta there isn’t.
yeah, weird
15
Q: Keep pinned messages pinned (without 14 days limit) in chat rooms

David ArenburgI've read this answer to find out that pinned messages are being unpinned automatically after 14 days because "we found this feature to be abused too much". I fail to understand how a pinned message in someones chat room could abuse the site in any way. However, I find pinning a message an extre...

boo, overmeta is boo!
Imagine how nice it would be if the room description allowed proper formatting
I'd be satisfied with a simple "yep that's by design. Quit trying to pin it, you pin glutton" from someone Official
Yeah, anything along the lines of “you are not becoming mad here, this is really the intended behavior because <whatever absurd reason>” is fine.
13:41
Umm.. I've edited it, I've faffed about with the owner-star post request etc... it ain't having it... that is odd
maybe there's an ultimate limit to the age of a posted message? But then... DSM's message immediately after can be starred
"You're not crazy. Or, rather, this one particular thing is not a symptom of your craziness"
I tested in another room with a message that was only pinned once and then expired: the problem exists there too. So the problem is probably not because there are too many pinholes in that poor message. — Andras Deak 7 mins ago
Or maybe there's a limit to the total duration/number of times it could be starred - but then that'd seem a really weird thing to program in
One may be simultaneously crazy and able to submit coherent bug reports
I think it's just borked
13:43
@JonClements I’d kind of expect the SO devs to include an error message that fits that reasoning though
If pin duration limitation is an intended feature, it would be really keen if trying to pin it said something like "sorry, you can't do that" instead of happily confirming that it did the thing it didn't actually do
Oops beaten
@poke yeah, SO chat is the most well-documented piece of machinery here
not talking about documentation, talking about error messages and API response messages (that thing you don’t talk about)
:P
I know, I was lazy to elaborate on my point
I figured you'd get my point anyway *glare*
I know, I’m just mean
13:46
@JonClements sup :-)
yo bobby g! How goes it?
Good thanks! How's <REDACTED>?
Umm.... You have already voted, but the voting has been cleared by a moderator
13:53
monster!
So - doesn't appear to want to pin in another room either
that poor post looks like this now
And not even sure what It is too late to undo this operation is meant to mean when trying to star it :)
1 message moved from Python Trash - The Rotating Knives
In my expert verdict... it beeped :)
hehe :D
off I go with the commutists, rhubarb for now
@AndrasDeak ouch :(
Poor post
13:58
I'll go out on a limb and say it's a bug
Probably find that chat was never meant to be used for so long in general or something :p
morning cabbage
The chat source code was inscribed on a meteorite that fell onto the Stack Exchange campus. Modifying it is beyond the ken of man.
DSM
DSM
Wayne had the right idea. Morning cabbage for all!
Or, y'know, evening cabbage...
DSM
DSM
14:11
Since there are people from all over the world here, but each of us is usually only in one timezone, the convention is to use the time that you actually know. ;-)
Every time I see you guys, it's like watching the sunrise - so beautiful, thus it will always be morning cabbage to me.
There are three cabbages. The Cabbage of the Morning, the Cabbage of Dusk, and the Cabbage of the Evening. Traditionally the Cabbage of Dusk is not used in conversation, for legend has it that it is forever beyond our reach, having been stuck in rush hour traffic since before man knew of cabbage at all.
Only at the foretold Sunset of Man will the Cabbage of Dusk finally arrive home and get a chance to crack open a cold one with the boys
@JonClements heh, I think that "move to/from trash" action messed up the chat. Clicking "load to my last message" takes me all the way back to July instead of last night.
DSM
DSM
♫ just call it cabbage of the morning ♫ just eat the green before you leave ♫
@davidism errr... you're welcome :p
14:16
I love stir fried cabbages... so good... mini shrimps are optional.
@DSM True, maybe I've just mickle awareness, since I'm usually in the midst of conversation with three continents concurrently.
How does one prepare the breakfast cabbage?
@toonarmycaptain with great care...
with bacon and maple syrup :D
DSM
DSM
"mickle" -- wow, that brings back memories. Like passed-on-grandparents memories.
14:17
@DSM Not sure if I want to eat cabbage for breakfast
//sometimes the main page crashes when it loads for the first time in a session, and we don't know why. So we'll just catch that here and reload the page and hopefully it will work the second time
This has been in the code base for many months. I am... Displeased.
To the original coder's credit, the duct tape solution works very well. The main page is perfectly stable, at least from the user's perspective.
... At least, I assume. It's possible that the users just don't report the problem. "Oh, yeah, the page always crashes once in the morning. It's always been that way. I just have to refresh the page"
DSM
DSM
Yesterday I found out about a task which runs on a server which occasionally explodes and consumes 100% of resources. The team responsible for maintaining that server doesn't monitor it, so they only find out when other people complain, which no one else can really notice until things have already failed. And their "solution" is to restart the task and mark the problem as "fixed".
Now you just have to make sure u dont treat the first call as the true first call, and the second call becomes the first call.
14:29
hey I think it's a bit in vain to ask here: but is there a way to state (in type hints) that the return is "the same class as the input". For example:
def myFun(input: Sequence[BaseClass]) -> List[BaseClass] but if I would use ChildClass (which is a direct child of the base class and thus I can give it as argument) - the return would also be of List[ChildClass]
This actually happens in python by default - I'm just wondering how to make pycharm/type hinting understand this.
@Kevin I generally assume it's at my end, it does happen occasionally. I've a couple of other sites I regularly go to that crash/refuse to load first try or two.
@paul23 Does TypeVar help?
I thought so, but apparently:
  File "C:\Python35\lib\typing.py", line 401, in __new__
    raise TypeError("A single constraint is not allowed")
TypeError: A single constraint is not allowed
Can't do T = TypeVar("T", BaseClass)
I see.
Wouldn't TypeVar("T", BaseClass) be essentially just BaseClass anyway?
14:40
@Kevin I understand about the pinned post not functioning correctly, but why isn't that link up there under the one for the Room rules: ?
@Rawing Well "yes" apart from one thing: I could then give: def myFun(input: Sequence[T]) -> List[T] -- And then it is clear the type is the same (but can be any subtype of BaseClass).
@toonarmycaptain The link isn't up there because nobody put the link up there. Why nobody did that probably varies from person to person.
DSM
DSM
I call "never thought about it!"
Using T = TypeVar("T", BaseClass, DummyClass) actually works.
I didn't put it up there because I get tired from tooting my own horn too much. It's hard work.
14:43
Maybe a stupid idea, but how about T = BaseClass and then def myFun(input: Sequence[T]) -> List[T]?
Other valid reasons include "because the rules are more important than knowing how to get a monospace font and I don't want to imply they're equal" and "because the header is already ugly enough with just one unformatted url"
and "nobody reads the header anyway so it's futile no matter what I do"
@Rawing pycharm shows "unresolved attribute" again during static analysis. :/

« first day (2525 days earlier)      last day (2648 days later) »