« first day (3531 days earlier)      last day (1417 days later) » 
00:00 - 18:0018:00 - 23:00

6:11 PM
The stuff is literally from the last century. They did this even before it was cool. 😎
says a lot that this is the most advanced stuff we have... D:
 
Python lib for your very own Boston Dynamics SPOT robodog: dev.bostondynamics.com/python/readme
 
> Google’s gRPC Python library, as well as it’s transitive dependencies.
:'(
 
brief cbg
 
@MisterMiyagi If not proprietary info, I'd be happy to include a link on the "Who's Using Pyparsing" wiki page.
 
6:31 PM
@PaulMcG it's public, though not that well-documented yet: classad – pure Python implementation of the HTCondor Classad language
 
Condor!
The hipster scheduler broker :)
 
I see you have fond memories ^^
it's always fun showing our tech stack to some HPC people ;)
 
I prefer both SGE and slurm but mainly because I'm more familiar with them
Anything that lets my jobs run is fine by me :P
 
no worries. we can just lay a full-fledged Condor batch system on top of yours. :D
wouldn't want to do parallel jobs with condor, so there's that as well :/
 
That's exactly what my jobs are like...
 
6:44 PM
By all means, go for it. The larger and more complicated your jobs are to schedule, the more backfill we get. ^^
 
Hmm. This undocumented limit for a semantically arbitrary value is"must be < 1". Wonder if -10 will work or it's a suboptimal range check...
 
there's only one way to find out...
 
Already scheduled...
 
user13682510
7:24 PM
Is eval dangerous without input?
 
what do you mean by "without input"? the input builtin function?
 
user13682510
yeah
 
eval is dangerous with any untrusted data, no matter where it is coming from.
 
user13682510
What if it's only in our script, and there is no way others can access it?
 
are you absolutely sure no one else can access it?
 
user13682510
7:30 PM
yeah
 
If you are sure all data comes from you, there is no problem using eval. I've used eval for automatic class generation.
namedtuple also still uses eval, AFAIK
 
user13682510
ohhhhh......
 
7:42 PM
Say you have a GUI instead of using input(), the user-entered data in the GUI shouldn't be passed to eval(). Similarly if you query a database that stores data that was at one time entered by a user somehow.
 
@Kevin oh wow this seems so hacky I love it! I didn't realize we could just set values to random attributes inside functions
@Kevin what does this mean
can I just use the attribute without a care in the world or should I read up on something?
 
user13682510
If we use absolutely no inputs, would using eval be exact same risky as coding in general (if risky at all) ?
 
@joshua yes, but make sure you really need it
Dynamic code generation has its uses but they are few
 
@aadibajpai Don't make an interface like that, honestly. Have you ever seen a function communicate through an attribute? No, and for good reason
 
@joshua Maybe it would be better if we were to understand why you want to use eval at all?
 
7:55 PM
Eval makes code harder to debug etc.
 
user13682510
@roganjosh use range to generate labeled variables?
 
"labeled variables" usually means you really should use a list
 
@PaulMcG I read about them opensourcing it around the same time that they released their googley eyes video. Honestly, if I had money to burn, I'd have that dancing robot in a heartbeat. So much easier if they start releasing the sourcecode :)
@wim I ended up fixing all this. Sorry for taking your time last night; it was a cocktail of misunderstanding. I ended up just using alembic.command() inside my application, which fixed all the horrible mess with imports with everything being in my_app/src/my_app. Indeed, alembic autogenerate is simple enough, I just dug myself a hole. Thanks for your suggestions
 
@joshua If you find yourself wondering how to use eval() to solve a problem, you need to exhaust all other possible solutions first.
"labeled variables" sounds like you just need a dict.
 
user13682510
@Code-Apprentice ;)
 
8:12 PM
@joshua noooo
 
user13682510
@AndrasDeak If you say so.
 
It does sound to me like you want a dictionary but Paul has suggested a list, so I'm not so sure if we're still open to interpretation here
 
user13682510
@AndrasDeak That's what Code Apprentice said.
 
@PaulMcG did you really mean "list" here and not "dict"? I'm not following if you did indeed mean "list"
 
8:15 PM
list is appropriate if the "labels" are numeric.
or more generally, use the right data structure for the situation
 
Is O(n) - O(c) where c is a constant still O(n)? Can't find the rules anywhere
 
@Code-Apprentice By index? Wouldn't that be better as an Enum?
 
@JossieCalderon yes...I think. What does - mean in this context?
 
Subtraction. Suppose I have a list of size N. Would subtracting a constant from it still make it N, or N-C? I guess I am just confusing whether N = N - C. Not true in math, not sure about size of containers.
 
@roganjosh maybe...if the indexes are a fixed set instead any arbitrary integer...now we are venturing into the realm of speculation, dict or list may be appropriate here with or without an enum. We don't have enough info to really say for sure.
@JossieCalderon I'm probably being pedantic here, but technically O(n) is a set of functions. So if mean set subtraction, then no, O(n) - O(c) != O(n). If you mean some other kind of subtraction (which is likely because big-O notation is often a little loose on the operation notation), then maybe yes, they are "equal".
@JossieCalderon "Would subtracting a constant from it"...I assume you don't mean "subtract a constant from a list" because that doesn't make any sense. You are venturing into the realm of mathematics here where the word "it" is anathema (at least to me and my past professors). Clearly state what "it" is.
So likely you mean if f(n) = O(n) (technically the function f is in the set O(n), is f(n) - c = O(n) (is f(n) - c also in O(n)? The answer to this question is undoubtably "yes". You can prove it pretty easily directly from the mathematical definition of Big-O.
 
8:23 PM
@JossieCalderon Do you that you have an N size list and remove C elements?
Is Jython bytecode/dis supposed to make sense?
>>> dis.dis("""def g0():10/1""")
          0 LOAD_CONST      26213 (26213)
          3 SLICE+2
          4 BUILD_LIST      10288
          7 STORE_SLICE+1
          8 INPLACE_DIVIDE
          9 <49>
         10 <48>
         11 <47>
         12 <49>
 
@JossieCalderon So it helps to be clear about what "subtraction" means in this context. We aren't dealing with numbers, so normal elementary school subtraction doesn't apply.
 
user13682510
what is O(n2)?
 
What is n2?
Do you mean a different variable? If so, then we don't do that in Big-O notation unless we have multiple variables...and then we usually use n and m
 
@roganjosh Usually when we see new people creating variables on the fly, they are named var_1, var_2, etc.
 
I start with var_0
 
8:36 PM
Especially when this user mentioned creating them with range
 
@PaulMcG that generally falls under the remit of the variable number of variables dupe, though, which would suggest a dict. I guess it gives the user more of what they originally wanted if they can use f'variable_{i}' in their loop
 
@AndrasDeak Nope, bit. The tricky part was deciding (by looking for a stream of SYNC characters) where in the bitstream the bytes began. The bits came in and each 8 got dumped in a circular buffer. Once a millisecond I had to service the circular buffer.
And yer tell these young programmer nowadays, and they don't believe you. I punched that code onto paper tape myself. A typical edit run on an ASR Teletype took 45 minutes.
 
Sorry - if I see code that creates var_0, etc., it almost certainly should be a list named var.
 
I agree, but I'm not aware of a canonical that suggests that. I'm not sure I've ever used either approach once I got a grip on what I'm doing
 
user13682510
8:51 PM
rbrb
 
9:11 PM
@roganjosh The accepted answer shows both a dict and list approach. I'm not brave enough to read any further...
Oh my. There are times when I wish comments could be downvoted. Mercilessly.
 
@holdenweb oof
 
@MisterMiyagi I could have sworn that Martijn had an answer in the top result for "python variable number of variables". Seems I'm incorrect
 
9:35 PM
@MisterMiyagi Yes
I gave the answer O(n - c) and left it at that.
No, this wasn't for an exam or homework. Someone was asking how I was storing my web scraping data and asked if it was O(n) space complexity.
 
circular imports are the bane of my existence. Won't be much longer til I start writing everything in one file
 
Now you make me wonder whether there is a tool to topologically sort source code...
 
user13682510
CBG!
 
@MisterMiyagi What do you mean "topologically sort"? Like by the function call tree?
@Aran-Fey This comment reminds me of my Android days. The system has a hard limit of 64k methods in your app. Solution: write your entire app in one method.
The 64k limit is quickly reached when you start adding dependencies.
 
@Code-Apprentice Yeah, call tree and inheritance. Just a random thought late at night...
 
9:48 PM
What, the limit isn't 64k per jar file? It's 64k per, what, java process?
 
@MisterMiyagi I like the idea. At my shop, we currently sort functions alphabetically, but I much prefer to have the order in a file according to the dependencies.
@Aran-Fey 64k in the distributed executable...which is basically a fancy jar
 
Ah
 
APK is the format
the joke is that Android is so heavily dependent on event callbacks, is impossible to write the whole app in a single method.
 
user13682510
I just googled "What does oof in text mean?". Why do users say "Out of my office"?
 
even beyond just good engineering principles
@joshua wouldn't that be "ooo"?
or OOMO?
 
user13682510
9:51 PM
Not according to google.
 
"out of office" means you are not at your desk with your usual computer/laptop
 
@Code-Apprentice Umu?
 
uwu?
 
no no, that's a completely different thing
 
user13682510
Announcement:
 
user13682510
10:02 PM
rbrb
 
10:19 PM
Hello
I have a question.
Can i apply some theme settings (background colour, font size, font colour) for all tkinter wigdets? (Maybe in __init())
 
10:39 PM
The easiest way is probably to write a widget factory, like
def make_widget(cls, *args, bg='red', **kwargs):
    return cls(*args, bg=bg, **kwargs)
 
I am trying to do it with:
1) https://stackoverflow.com/questions/35439598/ttk-creating-and-using-a-custom-theme
2) https://code.activestate.com/lists/python-tkinter-discuss/3718/
 
@Aran-Fey I like how the subs mostly just say "umu"
Huh it's working now
 
10:55 PM
So, to call make_widget, i can call it like: make_widget(tk.Label,container=self.root,text="123")
 
(I don't know TK) but yeah that looks right
 
00:00 - 18:0018:00 - 23:00

« first day (3531 days earlier)      last day (1417 days later) »