« first day (1942 days earlier)      last day (3004 days later) » 
00:00 - 19:0019:00 - 00:00

DSM
7:02 PM
aaargh client is driving me loopy
You know how we have a special games room? We need one which is just for venting..
 
that doesn't keep a permanent chat log
:)
 
yellPy for when you want to yell at the world with no records.
 
Can anyone take a look at this? stackoverflow.com/q/35297520/5415084
 
Welcome @Leuthus please familiarize yourself with the rules http://sopython.com/chatroom :

Per the rules:

Do not link your recent (< 1-2 days) questions in the room. The main site is the dedicated space for posting questions, and having them answered.
 
I would subscribe to a venting room.
I could spend a while venting about terrible legacy code. Or how stack based languages make my brain hurt.
 
7:12 PM
I would vent about things like commercial jingles and people being used as letters in advertisements.
 
DSM
@MorganThrapp: why the listcomp? [] is 2, but : is only 1.
 
@DSM Oh yeah, good point. I originally had the full list comp in my print statement.
 
DSM
@MorganThrapp: new idea-- replace the for with x=65 and while x<=max(k):print;x+=1. Should save a few.
 
@DSM You have a special games room? D: FizzyCorp needs a special games room.
Creative has a table tennis table, that's about it.
 
DSM
@Ffisegydd: ? I mean the room you people who collect cards with pictures of creatures on them, or craft mines, or whatnot, have here on SO to congregate.
 
7:26 PM
@DSM Yup, that saves me two.
 
Thoughts on Does CPython's garbage collection do compaction?? I thought the OS was responsible for defragmenting.
 
Oh right I thought you meant that DSMCorp have a special games room for venting.
 
DSM
The firm does not, as it happens, more's the pity. I'm happy whenever I manage to escape my minders and make it out into the real world..
 
I would assume that any language that brags about doing it themselves, do so because they have their own dedicated memory management system. I imagine they only make one allocate/deallocate call to the OS per execution, and work from a single large internal pool the rest of the time.
If my understanding is accurate, then it's neither good nor bad that one language advertises "compaction" and another doesn't.
I slept through 50% of my computer architecture lessons, which is why I'm not putting all this conjecture into an answer.
 
I'm learning Python and came across Modules. Aren't they pretty much a class with static methods that can be used without having to initialize the class?
 
7:31 PM
No.
 
I tried looking at gcmodule.c to confirm my thoughts, but it's predictably inscrutable.
 
What's the difference then?
88
A: Module vs. Package?

Yam MarcovicA Python module is simply a Python source file, which can expose classes, functions and global variables. When imported from another Python source file, the file name is treated as a namespace. A Python package is simply a directory of Python module(s). For example, imagine the following direc...

So it's a file that contains a list of class prototypes, functions and variables?
 
"module - An object that serves as an organizational unit of Python code. Modules have a namespace containing arbitrary Python objects. Modules are loaded into Python by the process of importing."
A module is an object, and a class is an object, so there's some overlap there. But then, lots of things are objects.
 
An imported module is an object
 
DSM
Also, Python doesn't really use the "class prototype" terminology, so thinking like that will just lead to confusion.
 
7:37 PM
Coming from a Java and JavaScript background makes it harder.
 
I guess it comes down to the definition of "X is pretty much a Y". "X and Y have similar interfaces"? Sure, ok. "X's type is a child of Y's type, and you can demonstrate this programmatically"? Not so much.
 
DSM
Standard warning: People coming from Java often insist on carrying a primitive/non-primitive object classification into Python even though it doesn't fit. There are some simple cases in which -- by coincidence -- Python's object model in the case of mutable and immutable objects makes it seem like Python treats certain objects differently (pass by value vs pass by reference) depending on their "primitiveness". There is no such distinction in Python: you've just got objects.
 
> package - A Python module which can contain submodules or recursively, subpackages. Technically, a package is a Python module with an __path__ attribute.
 
> People coming from Java
Not all Javans...
;)
 
Hmm, is "an __path__" a typo? How is that meant to be pronounced?
"an underscore underscore path"?
 
DSM
7:45 PM
I'd probably say either "a path" or "a dunder-path".
 
I'd say an underscore path, although I'd be both technically and conventionally wrong to do so.
 
I'd say undefined behavior. Most humans hearing the phrase will just gloss over the a/an, but grammar nazis will throw an exception.
 
So it only matters with -Wnazi?
 
Yea, but it's virtually impossible to recompile a person if you don't like their warning flags.
 
@ThiefMaster I have no idea why people keep writing tutorials/assignments that result in pushes to public repositories.
 
user559633
7:56 PM
probably college courses that thing adding github to a project makes it "modern"
 
The theory is probably that you need a github to have a portfolio of work when you're trying to get hired out of college.
 
user559633
@davidism Ugh. Gross.
 
@DSM now all I can think is 'Dunder Mifflin'.
 
user559633
Back in my day, the curriculum taught you how to deal with the community by t-rex rules: "if you see a senior developer, be quiet, very still, and try to study its behavior"
 
8:05 PM
I'm getting this error when trying to tunnel to ssh, Secsh channel [x] open FAILED: open failed: Administratively prohibited, why might this be?
 
> Administratively prohibited
 
@davidism At least they're polite and apparently well intentioned.
I gonna guess that an administrator didn't think you should do that, and therefore prohibited it.
 
Damn SysAdmins promptly disconnects
 
Wow. What an awful assignment.
 
@JRichardSnape I'm tunneling from my local machine to a local ssh server. I am the admin
 
8:09 PM
 
Ooh, nice levy C curve right before the blue phase.
 
I saw an 'infinite tetris' one the other day. I wish I had the link
 
I, too, saw that gif. I wish I had thought of it.
 
Take it for inspiration for future projects
 
user559633
8:11 PM
"yeah but i'm doing it in python"
 
@PeterVaro That's fantastic
 
3D fractals are a little uncanny to me, actually... Maybe it's a mild form of trypophobia
 
@davidism hacktoberfest was the worst
even though my colleague got stickers and a shirt simply by sending more smaller PRs to our work repo :D
 
@Kevin && @JRichardSnape Site of the Day
 
s/Day/Year/
 
8:14 PM
:)
 
that's exactly what this meeting needed
 
Site won't load for me, I'll try again on my home computer in 104 minutes.
 
it's a trap
 
I have yet to understand the 's/' meme. One day..
 
8:18 PM
@Programmer It's a vim command.
It means find and replace.
 
@PeterVaro NSFW in an odd way
 
So "Find "Day" and replace with "Year""
 
Ahh, it all makes sense now. Thanks
 
user559633
@QuestionC Yeah, I too work at a dog and cucumber factory
 
user559633
"Anything more than half sour is showing off"
 
8:20 PM
Oh, I thought it was a perl command. Well, I know it is, but I thought that's what everyone was referring to when using the meme, inasmuch as they're referring to anything in particular and not just copying other people using the meme, as is typical of memes.
 
I don't use perl, but I use it often in vim.
In particular :%s/find/repl/g which will find and replace globally.
 
I cannot read the word vim without thinking of this under my grandma's sink
 
DSM
@JRichardSnape: I have some under mine right now!!
#timetested
 
Look at those bright friendly colors. Makes me want to drink straight from the can.
 
:D Still going in Canada then?
@Kevin the extra bleach gives it a kick
 
8:23 PM
no canatonical for modifying list while iterating it?
 
s/.../.../ is an ed command. The program is dead, but its meme lives on.
 
I like bleach well enough, although the filler episodes tend to drag on.
 
DSM
@JRichardSnape: maybe it's a #commonwealth thing..
 
@JoranBeasley I was just about to ask the same thing :-) I don't think we've got one.
 
@QuestionC sed uses it as well
 
8:24 PM
lol amazing
 
Everyone loves a bit of awk and sed.
 
@PeterVaro It does, but ed was the progenitor. ed->sed kind of like how ed->vi->vim so vim has s/... as well.
 
is it generally a good idea for a class to store a list of different instances of itself
 
@danidee No
 
Why?
 
8:30 PM
i did that because i have different methods that work with the list to generate other results, so i didn't want to pass the list explicitly everytime
 
I think I've done that maybe once, out of all the thousands of classes I've made.
 
it didn't feel right
 
SQLAlchemy's declarative Base stores a map of the models that subclass it.
 
and my unit tests look very funny. wanted to ask this on the main site but it might be closed down as being too broad without any example
 
I kind of want an example, myself.
 
user559633
8:32 PM
@danidee your example could be a metaclass that tracks instances of instantiated classes for metrics purposes
 
It's hard to give advice more specific than "you probably don't need to do that", with the details we have so far
 
It's a very XY kind of question.
 
There's a place near here called "vim fitness"
 
:x!
 
8:40 PM
+ horrified face what have I done!!! impersonates The Scream
 
pastebin.com/AqQjyUyW a stripped down example of how the class looks like now
 
Oh, I thought you were using, like, a static attribute to store a list of every Activity ever created.
 
As did I. Ah, the power of MCVE
 
so is that good practice generally, i just feel the strong need to have the list outside the class (it makes more sense to me)
 
I mean, there's nothing wrong with having a class with an attribute whose type is that same class. That's exactly how trees work.
I don't want to say "this is good practice" and have you put self-type-lists in every class "just in case you need them later", and I don't want to say "this is bad practice" and have you never use a list as an attribute "because Kevin said so".
 
8:53 PM
:)
 
"Because Kevin said so" is now my official check-in message.
the fact that our brand new junior QA guy is also named Kevin will make it far more hilarious.
 
We'll have a good laugh about it at the next annual Meeting of All Kevins.
 
Is there a way to allow a custom class to be used as a string indice?
 
That seems unlikely to me.
 
class Pointer:
    def __init__(self):
        self.location = 0

    def __radd__(self, other):
        return self.location + other

    def __int__(self):
        return self.location
 
DSM
9:01 PM
Sure!
>>> class Fred:
...     def __index__(self): return 3
...
>>>
>>> a = "abcde"
>>> a[Fred()]
'd'
 
Oh, awesome, thanks!
 
9:13 PM
Git is definitely not easy when you first start using it as a team halfway through a sprint
 
DSM
You could have stopped before "when". :-) (Nobody saw nuthin'!)
 
:)
What's nice is it forces me to learn it, which is probably good
 
good evening
 
cbg
 
Do I need to define a specific function for += to function on a class?
I have __add__ and __radd__, but it doesn't seem to be doing anything.
Lalalala, disregard those messages, I'm an idiot.
 
9:29 PM
apparently I blinked and missed them anyway ;)
 
9:48 PM
a question from a beginner, something is not working, you dont know why, you change the structure,and it works, do you go back and try to figure out why the first structure did not work ?
 
Yeah I would
 
yes: academically you will learn something
in industry: you need to know what went wrong in the first method to make sure your second doesn't open any new vulnerabilites
 
10:06 PM
and this is where unit testing helps.
 
10:39 PM
I am confused difference between ab* and ab*? in regex.
how is ab*? evaluated?
 
*? is "non-greedy *"
so ab* matched against abbbbbbbbbbbbbbb would match the whole thing.
ab*?matched against abbbbbbbbbbbbbbbbbbbbbb only matches a
 
@AbhishekBhatia According to regex101.com, *? means "Match as few times as possible." which is not very meaningful when you're matching 'b', but if b were a group that could mean multiple things or ., then it would have a significant effect on what gets matched.
 
if you were crazy and deranged enough to try to regex-match HTML
 
DSM
The online regex explainers are really handy.
 
<.*> would match <p>this entire string</p> but <.*?> would match <p>
 
11:16 PM
Oh no, HE COMES... ZALGO IS TONY THE PONY...
 
00:00 - 19:0019:00 - 00:00

« first day (1942 days earlier)      last day (3004 days later) »