« first day (2726 days earlier)      last day (2447 days later) » 
00:00 - 15:0015:00 - 00:00

15:02
lol it's because of cache clearing cache solved it, and born another questtion
why cache behaving like this
like what
like a cache?
yea clearing browsing data fix it
i have to clear again and again to see new changes
cabbage
there's been some kicking going on
I miss all the excitement
15:06
yup
lol...Andras beat me to my first kick haha
cbg idjaw :D
o/
Oh man glad I'm busy today :D missed all the "fun"
hey guys
15:12
hey andy
@Arne o\
remember when I asked that my model was not being saved in the database?
it's seems something is doing a DELETE request to my API after the POST one
so, nothing related to SQLalchemy
@AndyK i saw your question the other day, and i thought about it a lot. It might be doable with a oneliner in python: First do the data processing in something like a list comprehension, and a decorator around it that makes a file behave like a list ¯\_(ツ)_/¯
@Arne ok
no worries
i was just asking
It was a really interesting question though
DSM
DSM
15:20
I-hate-being-called-in-for-support cabbage for all :-(
it is never easy to find out, which language is the easiest to use regarding of the context
i-feel-for-you cabbage, DSM =(
I'm coming from a awk/sed background
@DSM scroll up a bit
so it feels more like what I would go first, try a one liner instead of several lines
15:23
Do you find yourself using popen often, then?
I usually have an easier time importing utlities as opposed to reimplementing them
even in python
wim
wim
Anyone know if CPython bothers to resolve bool.__index__ when evaluating [][True] ?
I got curious after answering this. Of course the language reference / datamodel says we should look up __index__ for custom classes, but I know that CPython is in the habit of taking gratuitous shortcuts as performance optimizations when working with built-in types.
Why did you say the other answer is irrelevant ?
@DSM aww, cbg. We're here to support you
@wim would dis.dis show you?
wim
wim
hmm, good question
wow it optimized even more than I thought
>>> import dis
>>> def foo():
...     return 'abc'[i]
...
>>> def bar():
...     return 'abc'[True]
...
>>> dis.dis(foo)
  2           0 LOAD_CONST               1 ('abc')
              2 LOAD_GLOBAL              0 (i)
              4 BINARY_SUBSCR
              6 RETURN_VALUE
>>> dis.dis(bar)
  2           0 LOAD_CONST               3 ('b')
              2 RETURN_VALUE
maybe I need to push the container out to global scope too
15:37
I'm 99% sure it doesn't call __index__ at all because bool is an int subclass
wim
wim
well it uses BINARY_SUBSCR op in both cases
>>> def foo():
...     return s[i]
...
>>> def bar():
...     return s[True]
...
>>> dis.dis(foo)
  2           0 LOAD_GLOBAL              0 (s)
              2 LOAD_GLOBAL              1 (i)
              4 BINARY_SUBSCR
              6 RETURN_VALUE
>>> dis.dis(bar)
  2           0 LOAD_GLOBAL              0 (s)
              2 LOAD_CONST               1 (True)
              4 BINARY_SUBSCR
              6 RETURN_VALUE
that doesn't really give me enough info to answer my question though
I often wish for some kind of event system to hook into on the built-in types
because as soon as you subclass them, you have no idea any longer how the original type behaves :(
jjj
jjj
I have multiple loggers defined in my module. I want to log messages with some of them in different functions. Whats the best practice here? Should I call logging.getLogger(name) in every function? Or should I make my loggers gloabal variables?
@Aran-Fey good point
wim
wim
@jjj make the loggers global variables
jjj
jjj
but this looks so bad :(
(thanks wim)
wim
wim
15:40
yep, it looks bad. blame Vinay/Java if you don't like it.
jjj
jjj
okay
wim
wim
like all the crappy stuff in Python, logging was ported from java (log4j)
@Aran-Fey d'oh!! off-by-one error
oh the shame
You may want to do something about that "true but irrelevant" comment :P
You should delete imo. Just deleting the paragraph that proves you wrong only hides the fact that you got it wrong. Not proves you right.
+ it could misguide a lot of people looking at this answer
Oh, this is just an "index a list with a bool" question, how is there not a dupe for that?
wim
wim
15:46
@Aran-Fey yes, already deleted
however, I'm pretty sure the language reference says __index__ should be looked up, and CPython is taking shortcuts here
pypy example:
>>>> class MyInt(int):
....     def __index__(self):
....         return 1
....     def __int__(self):
....         return 2
....     def __trunc__(self):
....         return 3
....
>>>> i = MyInt(0)
>>>> 'abcd'[i]
'b'
Do you think it's worth mentioning CPython implementation detail on a question not tagged explicitly with CPython?
If it makes a difference, yes. But doesn't lst[True] work exactly as if True were 1? Occam's razor or something...
since both __index__ and __int__ are the same for True/False, I'm not sure this is relevant
your pypy thing is breaking my ipython paste
wim
wim
because pypy uses four > instead of three
wim
wim
seems ipython bug, worth raising
So...since CPython and pypy both do the same thing for bools and the question is about bools, I'm not sure explaining that non-bools behave weirdly with CPython
really, your answer is pointlessly overengineered considering the question
15:53
From the doc... https://docs.python.org/2/library/stdtypes.html#boolean-values

> In numeric contexts (for example when used as the argument to an arithmetic operator), they behave like the integers 0 and 1
@IMCoins python 2 docs? Boo :P
That's not a numeric context though
Indexing is a numeric context to me. :o
{'foo': 'bar'}['foo'] <- string, not number
[1,2,3][:2] <- slice, not number
wim
wim
right, not numeric context, it's a subscription context
15:59
@Aran-Fey You got me on this one.
wim
wim
@AndrasDeak It depends what you consider to be "Python". 1) The language reference, or 2) What CPython does
it should always be 1) with a caveat for 2), I'm saying that in this case it doesn't matter
I think your answer is great but it shouldn't be posted on that question :P
wim
wim
> I would like to know what happens here and what is this method called as?
perfect place to post it, imo
@wim well they might have had getitem or something in mind :P
wim
wim
maybe. I did mention getitem though. the accepted answer glosses over everything
16:01
I guess, but my suspicion is that OP's level is closer to the glossy one
oh well
wim
wim
> In Python, bool class is derived from of int. Hence True=1 and False=0
^ that seems a non-sequitur to me
Not really, if their understanding is that lst[True] === lst[1] due to magic in between
note that this is also my understanding, and explains what we see perfectly
wim
wim
"due to magic" is never an acceptable answer
I know, I meant it as an implicit assumption. If you don't even realize there's non-trivial machinery in between, you might not even pause to wonder
Hmm PyList_GetItem already assumes that the index is an int. Wonder where the magic happens.
My connection tracking project is working pretty good, and I can tell because it correctly reports that my connection is not working good
wim
wim
16:09
@AndrasDeak probably, but ...
Mar 22 '17 at 7:23, by Antti Haapala
I don't give a sh*t about OPs. I care about questions.
behold my connection strength. Gray areas are "no data" because I was writing the program. Red areas are no connection at all.
@wim I guess :P
__abs__
__float__
__hash__
__index__
__int__
__long__
__nonzero__
__pos__
__trunc__

All of these return 1 when calling dir(True). I wonder which one is really used.
Hopefully at some point I'll have enough strength to install matplotlib, so I can stop graphing stuff with PILlow primitives
if (o->ob_type->tp_as_sequence) {
   // ...
   key_value = PyNumber_AsSsize_t(key, PyExc_IndexError);
   //...
}
wim
wim
16:16
@Kevin take a look at bokeh or dash
But where does the value PyObject *key comes from ? :p
wim
wim
even matplotlib is seeming hilariously retro these days
@wim is this not where the magic happens?
PyObject *value = PyNumber_Index(item);
// ...
result = PyLong_AsSsize_t(value);
the thing with the cpython source is that I can never tell if I'm looking at completely wrong parts of the codebase
hey guys, is it normal to observe 150 kB/s throughput via ssh, but observe ~5 GB/s throughput otherwise over the network?
It's so much slower that I feel like this link is trolling me : alecjacobson.com/weblog/?p=635
rb folks
16:27
(I got the 5 GB/s from iperf)
16:44
Hmm, does it make sense to try to derive connection speed from the packet times returned from ping? Ex. If I get Reply from 172.217.8.4: bytes=32 time=38ms TTL=56, can I reasonably assume my speed is 32 bytes / 38 ms = 6.7 kbps?
Or am I measuring the wrong thing.
I don't think it's representative
I'd think that connection "speed" really depends on the width, and you seem to be measuring the "speed". But I might be completely wrong (even more so than usual)
ping should only measure latency, for actual speed you should probably try transferring more than 32 bytes of data
Hmm, agreed. Perhaps this is more representative of latency than bandwidth.
Not sure how to best test bandwidth without actually using up all of my bandwidth. I want this to run all day in the background, after all
you can try transferring a single significant-but-not-too-large file each time
I don't see how you could get around that
The compromise approach would be to measure the upload time of a big honking file, but only once every fifteen minutes, instead of twice a minute.
you just have to make sure that 15 minutes is enough to transfer the big honking file even at the worst of your connection
wim
wim
16:50
@Kevin that would be 100% incorrect
Tricky, considering I had a full hour of no connection whatsoever today
there are scripts which let you test against speedtest.com or fast.com from the command line, those presumably scale with your bandwidth
wim
wim
@AndrasDeak looks to be, yeah
feel free to edit the source link into the answer
But I don't see where the buggy (?) behaviour comes from
Setting aside the times when I had 100% packet loss, Perhaps I can use the packet return time as an extremely loose lower bound for bandwidth. I must have at least 6.7 kbps, or else my 32 bytes would have taken longer to get onto the network
16:54
I don't think so
Unless something wacky is happening like, the connection is at 6.7 kbps bandwidth for a millionth of a second while the 32 bytes squeak through, and then for the remainder of the second, bandwidth plummets to 0.1 bps
wim
wim
it will likely be a short-circuit in PyIndex_Check definition
Meaning my average bandwidth over that second is like 0.100001 bps, even though the ping reports a much better time
6.7 kbps means you can emit/receive data at that rate. What your ping measures is how fast that data is crawling in the tubes. While people like to assign large bandwidths to snails pulling DVDs, I'm not sure that works
@wim I won't have time to take a closer look soon; feel free to edit yourself in the meantime
17:07
@AndrasDeak I guess it really depends on which tubes are being measured here. If I want to know the bandwidth of my computer-to-router connection, and ping somehow measures the latency of the router-to-google-to-router connection, then I can't get the former from the latter
But if it measures computer-to-router-to-google-to-router-to-computer, then having a very narrow computer-to-router pipe should impact latency in a measurable way
if you're after the wifi connectivity then I fully agree
Hmm, I'll try to think about that
It's not enough information to actually find the real bandwidth, but it should give clues about what your bandwidth can't possibly be
Ex. In the degenerate case, if you're getting a packet back, you know with certainty that your bandwidth is higher than 0bps
I don't actually know what parts of the connection are being measured by ping, for the record
I think only that there's a hole barely big enough for 32 bytes, and the to-and-fro hot potato between routers and whatnot
Excerpt from my hastily assembled ping parser:
    packet = {}
    m = re.match(r"Reply from (.*?): bytes=(\d+) time=(\d+)ms TTL=(\d+)", lines[i])
    if m:
        packet["ip"], packet["bytes"], packet["time"], packet["ttl"] = try_make_ints(m.groups())
        packet["connected"] = True
    else:
        m = re.match("Request timed out.", lines[i])
        if m:
            packet["connected"] = False
            packet["reason"] = "timed out"
        else:
            m = re.match("Reply from .*?: Destination host unreachable", lines[i])
            if m:
I feel like I should probably try to not have a quadruple-deep if-else pyramid
Time to refactor to a bunch of elifs?
17:18
I could easily refactor into a shallowly-indented form it if there was an object which supported a method like "call match, assign its result to an attribute on this object, and return also return the result"
Well, the only branch that ever uses m outside of the if condition is the first one
m = MagicMutableMatcher(lines[i])
if m.match("foo (.*?) bar"):
    packet["foobar"] = m.group(1)
elif m.match("baz (.*?) qux"):
    packet["bazqux"] = m.group(1)
elif m.match("troz (.*?) zort (.*?) :"):
    packet["trozzort"], packet["zortcolon"] = m.groups()
else:
    raise ParseError("lol wtf is this line idk")
Then I could do this ^
Is there much code after each case? You could early return
This is why a lot of langs now have assignment-within-if features
@Aran-Fey Hmm, true. Elsewhere in my code I use the match objects more often, but you are correct that this particular section is amenable to just throwing away the results after the conditional
17:22
Non-expert opinion. Ping/latency are constants that get overwhelmed with scale. If you are measuring "small" bandwidth, it definitely plays a role. "Large" bandwidth, not so much
@KevinMGranger boooo
@AndrasDeak fite me
I would refactor to use only ifs via early returns, but that can be error prone
if worth_fiting_KevinMG = True # now look what you made me do
There's nothing like making code public for realizing that you implemented something in an obviously dumb way
17:25
m = re.match(r"Reply from (.*?): bytes=(\d+) time=(\d+)ms TTL=(\d+)", lines[i])
if m:
    packet["ip"], packet["bytes"], packet["time"], packet["ttl"] = try_make_ints(m.groups())
    packet["connected"] = True
elif re.match("Request timed out.", lines[i]):
    packet["connected"] = False
    packet["reason"] = "timed out"
elif re.match("Reply from .*?: Destination host unreachable", lines[i]):
    packet["connected"] = False
    packet["reason"] = "destination host unreachable"
else:
    raise ParseException(f"Could not match line {i}")
No more pyramid.
@holdenweb context: "This is why a lot of langs now have assignment-within-if features" ;)
I'm not crazy about assignment-within-if, even though I was just wishing for a way to change state inside a conditional header. Allowing = would trip up a whole lot of clueless newbies and a fair amount of clumsy-fingered experts
To clarify, langs should not allow assignment within conditionals if assignment returns a value. The langs I'm thinking of have a preconditional area. e.g. go's if entry, ok := dict[key]; ok
Generally speaking, I'm a fan of languages that don't have statements because everything's an expression. 'Course, you have to trust people to be responsible with that and not write horrible code
the recently-linked-here PEP suggested special syntax for it, but it would equally be confusing due to all the "smart" tricks it would allow
17:28
Yup. It would also subvert a deliberate feature of Python's design: Guido has said he didn't want Python to be an expression-based language, which is precisely why assignments don't have a result.
I don't think it would be a good fit in python
If the syntax was impossible to accidentally do without knowing that assignment-within-if was possible, like if re.match(a,b) ::-> m: or something, I would be more forgiving of the idea
@JonClements Many congratulations on your well-deserved award!
But even something as simple as if expression -> name could get screwed up by someone trying to write if f() > -y: and transposing the ">" and "-"
the problem is this is never only allowed in conditionals...
If you put that syntax in the middle of one of your y combinators, all hell breaks loose. Well, even looser.
17:31
A whole startup can be undone by a syntax issue?
I imagine we'd get some very confused newbies asking "Why does func(x=3) not change the value of my x variable and pass 3 into the function?"
Given that being statement-based is baked into the language's design, any attempt to retrofit expression-language features into it would be bound to increase the potential for errors hugely.
from __future__ import expression
from __future__ import s_expressions
(I know hy exists)
The Knight Capital Group was an American global financial services firm engaging in market making, electronic execution, and institutional sales and trading. With its high-frequency trading algorithms Knight was the largest trader in U.S. equities, with a market share of 17.3% on NYSE and 16.9% on NASDAQ. The company agreed to be acquired by Getco LLC in December 2012 after an August 2012 trading error lost $460 million. The merger was completed in July 2013, forming KCG Holdings. == Company == Knight was formerly known as Knight/Trimark Group, Inc. and Knight Trading Group, Inc. Initially, Knight...
17:41
That was a misunderstanding of distributed systems logic, not a syntax issue
Semantics :-P
Yes, it could be considered a language semantics issue
KCG Holdings is uncomfortably close to KMG holdings. I'll keep my guard up.
Without a functional and fast connection to my prosthetic memory, Google, my effective IQ is twenty points lower. Please be nice to me.
"But Kevin, memory problems shouldn't have any causative effect on intelligence, so your IQ shouldn't change either way. Your previous message is dumb." you say. And yet, because my message is dumb, it proves that it is correct, QED
17:59
Nicely circular
Security tip: embed paradoxes within everyday conversation in order to self-destruct any bots that happen to be spying on you
Again, that's a ridiculous paranoia and I'll explain why once I've finished rebooting.
If X is the set of all bots that do not reboot themselves, and Y is the bot that reboots all the bots in set X, is Y a member of X?
Not enough information to determine, no?
I was trying to present the barber paradox with a coat of paint on top but I think I missed part of the setup
18:10
AI sweats profusely
In particular, I assert that Y reboots all members of set X, but I didn't mention whether Y does or doesn't reboot non-members of set X.
If Y is allowed to reboot non-members of set X, then it's possible for Y to reboot himself and also not be a member of set X, which means there's no paradox
The correct formulation would be "Y is the bot that reboots all and only the bots in set X"
Can't pin this one on slow network times unfortunately, since I already had the wiki page open before I made the message
@KevinMGranger KMG is uncomfortably close to KCMG (Knight Commander of the Order of St Michael and St George a.k.a. Kindly Call Me God), which would necessitate a different level of deference.
Is there a standard way to handle a main file in a GUI-based desktop application?
Looks like stackoverflow.com/questions/49636383/… just got closed by a mod with no comment. Not terribly helpful to a new user - he's never going to come back if he's treated like that. What's the general philosophy on dealing with such questions?
18:25
I currently have my main file in .../myapp/gui/myapp_main, but that seems like it'd be hard to find
@holdenweb The question is deleted, so I can't see it
@StevenVascellaro In the rare cases where my project directory structure is more complicated than "everything in one folder", I try real hard to have the entry point of my program at the top level directory.
Ah, sorry. I dunno - I can see why they closed the question, but I'm not sure there's much appreciation of how dispiriting this can be to someone struggling to use a new language.
@holdenweb Can you leave a comment offering assistance on another of the users' questions/answers etc?
@Kevin You don't write pip-installable stuff, then?
@toonarmycaptain First question, which is what concerns me. He could end up a Go programmer!
@holdenweb Yes, the vast majority of my personal projects never leave my own machine, nor are they intended to
18:29
Nothing wrong with that.
This causes me some frustration in the 0.1% of cases where I do want to distribute my work, but my knowledge of doing so is so rusty that I basically have to start from zero. But such is life.
Just ask someone else to do it!
In my application, if I explicitly use a package (foo) that is installed as part of the requirements of another package (foobar), and foobar is already listed as one of my requirements in requirements.txt, does foo also need to be in requirements.txt?
Since we're on the topic of deployment, I wonder if there's some configuration option that would let you indicate where your program's entry point is? Then it wouldn't matter what directory it's in, if the user can just do python -m yourlibrary from anywhere.
Unless you always trust your direct dependencies never to change their requirements.
In other words, yes: list ALL direct dependencies.
18:31
@holdenweb thats a good point.
I could imagine one day they don't use foo anymore and then I'll be SOL.
Otherwise you can get breakage if the other dependency stops requiring foo
@Kevin Right now my folder structure has a bit too much separation
README.md
wfc_helper/
	core/
		tags.py
		wfc_connection.py
		wfc_exception.py
	gui/
		add_job_frame.py
		logon_frame.py
		wfc_helper_app.py
With wfc_helper_app being the main file
No __init__.py files?
Each frame is a separate window in my application, so I didn't want to keep them all in the same file
Yeah I'd put the entry point up there with the README, but I don't know off the top of my head what you need to do in order to get your imports to resolve correctly (if anything). I'm going to guess... Substantial amounts of __init__.pys
18:34
@holdenweb I left out the init files for a more concise diagram
I have quite a few __init__ files, but they are all empty
IMO the main file should have as little code in it as possible. If it's just from wfc_helper.gui.wfc_helper_app import MyMainWindowClass and MyMainWindowClass().mainloop(), that would be nice
If you use a setup.py file to establish console entry points they will end up as links in the environment's bin directory when installed. Works beautifully with virtualenvs.
Right now my imports look like from wfc_helper.gui.add_job_frame import AddJobFrame, which is less than ideal
wim
wim
why not use the setuptools console_scripts
@Kevin not possible without refactoring the import system
@holdenweb I see 5 regular users...wrong link?
18:36
The actual main logic to run the script isn't terribly complex
@AndrasDeak Probably me viewing an out-of-date page.
# From wfc_helper_app.py
def main():
    """Main logic loop for WFC Helper GUI"""
    app = WfcHelperApp()
    app.mainloop()

if __name__ == "__main__":
    main()
@StevenVascellaro Ok, that still meets my standards.
The main WfcHelperApp() class is above that in the same file
But the actual "main" logic for a tkinter app is fairly compact
18:39
Ehh, if I'm going whole-hog for meticulously organized project structure, I like to keep class definitions in their own files.
@Kevin I don't know if that exists, but I've so far tended to write a wrapper/launcher file in the top folder that launches the main app. That also makes it easy to have several, launch GUI, launch terminal, launch fullscreen or whatever variety of options you need.
@Kevin Hence why I wanted to separate the logic out to some sort of main file.
@AndrasDeak But it would be nice to encourage the newless cloobs rather than just yamming on them from a great height. Maybe there should be an MCVE.stackoverflow.com
@holdenweb newless cloobs :)
I had assumed that setup.py was typically used for individual modules/libraries, rather than GUI-based applications.
18:41
It was closed as no MCVE, since the code in question had a syntax error. With a link to MCVE in the close banner. I'm not sure how far we should go...
A judgment call, in the end, which I should really leave to those who do the work I guess
Closures are never meant to be final (well, assuming the question is salvageable). OP should edit and undelete, and it could get reopened (probably to be closed as a dupe I guess)
"'NoneType' object is not subscriptable" sounds fairly googlable
@StevenVascellaro So what I'm hearing is: if a project is intended to be run on its own, and never imported by anything else, then there's not much point going out of your way to make it into a package, because a big reason to make packages is so users can import them easily. My question is whether there are other reasons to make your project into a package, and whether they outweigh the minor inconvenience of polluting your environment's module list with something that should never be imported.
One other such reason might be "so you can provide a more visible entry point for your standalone app"
but I'm known to be impatient with people who aren't willing to read everything
@StevenVascellaro All Python programs are modules. Absolutely no reason why you shouldn't deliver an application that can be installed in a virtual environment. That makes testing new versions of your dependencies a breeze, since you can just spin up a new virtualenv and install a different set of dependencies.
18:48
@Kevin I could see core being used as a standalone package, which is why I separated it into it's own folder
Was just about to say: having a virtualenv completely counteracts the minor nuisance of module list pollution
Also it's very easy to establish entry points anywhere in your code (by describing them in setup.py) and have the entry points install as entirely separate programs in the environment's bin.
@holdenweb So first I should work on creating setup.py to list my dependencies
cbg everyone
I suspect some 1-2 ppl are serial downvoting my posts
You can still use a requirements file, I believe. But setup.py is where you describe the entry points.
18:55
@Prateek there's nothing we can do about that, leave a flag for mods explaining the situation
@Prateek It can happen. Back when Google Talk was a thing someone consistently downvoted everything that Fredrik Lundh and I wrote.
Oh well, time to rhubarb.
I want a "close as duplicate of the official documentation" button.
6
How would you keep version numbers in sync between setup.py and git? (I've been using git tags to denote each version)
Now that I've worked out most of the design problems of this network latency monitor, I should probably fix up the database schema so it's something better than "one table with one column that contains a dump of arbitrary json data"
Hmm, I don't think session.query(Record).filter(datetime.datetime.now() - Record.created_date < datetime.timedelta(hours=1)).all() is doing what I want it to do
session.query(Record).filter(Record.created_date > datetime.datetime.now() - datetime.timedelta(hours=1)) works, though. Baffling.
wim
wim
19:51
@user2357112 how about a RTFM userscript
@wim: It'd get flagged.
Anyone work through davidism's new flask tutorial?
20:07
@toonarmycaptain I need to finish it
@Kevin is it because it overrides operators to construct a query? datetime.datetime.now() - Record.created_date probably doesn't construct an object that can override < correctly
I've never used any web framework before, so I suppose he should bear any feedback from me with a grain of salt.
Do you know if Flask supports f'strings? He's got {} .format style string formatting in the tutorial.
"Flask supports f-strings"?
@RobertGrant That's my question. I converted on the fly by default, but then I wondered if it was the older format for a reason.
Flask is Python, so anywhere he makes a string in Python will support f-strings, as long as the version of Python you're using supports it.
He might've done that to have more backwards compatibility in the docs
wim
wim
flask supports several older python versions so putting f-string in the tutorial would be a stupid idea
20:16
I haven't written HTML since...2001? Things have changed significantly, or at least the tutorial is building something more robust than the bundle of .html files I remember linking.
May i ask a question? =D
@TorSen I don't know if you can but you may.
Hello everybody!

I'm new at python. And i'm trying to create task management system. (an app where somebody can create a task and set up a deadline date and get notifications thats gonna be console. and then web using django)
I already created a database.(sqlite)
I came from C# and dont know how my entities are going to communicate. I would like to use first approuch.

First approuch:

User entity has following fiels:

UserID <- pure model. only fields
UserName
PasswordHash
PasswordSalt
... (smth else)
@TorSen hello :-) please check out the very nice intro page to get an idea of how the room works
20:21
@wim Fair point, but I was wondering if their support or lack thereof was a reason for their omittance. I didn't think of backwards comparability.
8 mins ago, by Robert Grant
He might've done that to have more backwards compatibility in the docs
To quote davidism, ":|"
20:36
@RobertGrant I read that, but since he didn't mention that f-strings are/n't supported, but {} .format is used for backwards compatibility, I'm left unclear. At least until I get far enough through that it tries to load a page and errors. A quick google search hasn't turned up anything, so shrug
He can't tell if f-strings are supported, because he doesn't know what version of Python you're on
@RobertGrant Oh, I see what you're getting at. Probably safe to assume Flask will support whatever your version of Python supports?
Flask cares very little about how you get the strings you give it, I imagine
wim
wim
20:52
Unless they're registering a custom codec to decode the source, it's not even possible for flask to care
@AndrasDeak Cool. thanks. just wondering in how long to wait before submitting a flag.
@holdenweb ok..what google talk has to do with it i dont get.
wim
wim
21:14
omg why is PyCharm's regex find/replace so slooooowwwwww
That's part of its... PyCharm
wim
wim
they could literally shell out to sed and be 10x faster than this
You... sed it
taptaptap is this on?
^ yes... yes it is
@Prateek Simply saying that if people are ill-disposed towards you they are going to do what they do. Rise above it, and just keep doing what you're doing (though telling mods can't hurt).
21:23
@holdenweb yeah. sure..thanks :)
wim
wim
@Prateek Why do you think it's serial downvoting? Can you give a few examples of posts that were downvoted which you feel don't have anything wrong in them?
well their rep profile from today is a bit suspicious :P stackoverflow.com/users/7907591/prateek?tab=reputation
@wim because 5 of my posts (2 q + 3ans) got downvoted in last 15 hrs. the pattern seems to be from 1-2 persons.
wim
wim
wait 24 hours and see if it gets reversed
and don't bug a mod with this trivialities before that
@holdenweb wow, long time. How's life? :-)
21:28
@wim yeah.thats what i am thinking although i dont know how and what algorithm detects.
nobody does, it's intentionally obscure
Just wait and see, if it doesn't get reversed you should flag.
wim
wim
@AndrasDeak yeah. only 1 of those looks genuinely downvotable.
@AndrasDeak yeah.. few hrs to clock in next day of SO. will keep an eye on reversal
@RobertGrant Been somewhat less than amazing over the weekend, I just spent three days in bed with the 'flu. Bu feeling perkier today, so will be happily CTOing away tomorrow, I imagine. You?
these scripts usually run at midnight or 3 AM UTC
21:31
@holdenweb yeah good thanks - working quite hard before product launch, but all good
Didn't know you were CTOing at all, although I'm not surprised. Is this recent, or were you always a CTO and I just didn't know? :)
@AndrasDeak ok. i will probably flag after that. Melon!
no worries
wim
wim
how long do stars on the starboard hang around for (if left to die organically)
do brighter stars shine longer?
just curious
I was a CTO in my last job, and I am one now. So overall only two and a half years. 15-person startup with a great team, Google Cloud Platform, Kubernetes, Flask, node, PostgreSQL and probably heading off towards Sparkland as our data grows.
@wim You win Most Unusual Use Of The Word "Organically"
21:41
@wim infinite lifetime in nature
@holdenweb wow, very similar tech stack to what I'm used to
And nice, sounds really good
wim
wim
what were your thoughts about redhat buying coreos
In my head I rhymed coreos with orios
wim
wim
Jan 30 at 23:49, by wim
Redhat: “Alexa, buy a box of Oreos” Alexa: “Buying @Coreos"
^ you not the first one
21:44
@RobertGrant thank goodness
cbg mysterious stranger with a familiar name
Apparently my gravatar changes on here, too
you can probably set it back manually if you want to :)
I'll just confuse people, it's more fun that way :)
I'm actually plotting to update my photo once a month
*shakes fist*
22:36
but just like... the same place and everything
but since my appearance changes subtly...
my thought and hope is that by updating it gradually it will always stay in sync with my appearance
My avatar is in sync with my appearance... round!
wim
wim
anyone know how to set pytest options in conftest.py ?
I normally put them in a [tool:pytest] section of the setup.cfg file, but in this case I need to use a python object to add some magic pixie dust, a plain old string will not work
@wim I forget exactly. The pytest docs are pretty good though
rbrb
wim
wim
I've been digging through the docs for a while ...
23:03
attributes defined in a class scope preserve order even before python 3.6, right?
darn, looks like I have some code to fix. I wonder if I can just call sorted on my enums...
nope. sigh.
23:39
@Aran-Fey: Are you specifically using enums? Enums preserve definition order on any Python 3 version, through the use of a metaclass __prepare__.
Ooooohh, that's handy. And yes, I'm asking because I relied on iteration order over enums
Time to undo all the changes I made...
<200 rep from the last 4 days in total... guess it would be easy to analyse my rep graph and infer USC's Spring 2018 calender
Don't worry about it too much; it's good to take a break sometimes. I assure you you didn't miss (m)any interesting questions ;P
23:55
Cbg
Hmm, I missed my goal of 5 daily upvotes by 5 upvotes today. Close enough.
6
@Aran-Fey the only direction from here is up
That's not true, I might get downvotes :p
You are talking about votes received, not given?
Yeah, I'm gunning for that python gold
If I can stick to the plan I'll have it in a month
23:59
@wim You are probably looking for addopts - sets additional command-line options for pytest?
00:00 - 15:0015:00 - 00:00

« first day (2726 days earlier)      last day (2447 days later) »