« first day (2469 days earlier)      last day (2497 days later) » 
00:00 - 17:0017:00 - 00:00

5:01 PM
Hmm true
You could generate a random number between 0 and 15**2, then convert to base 15, then increment each digit by 1... But I doubt very much that format strings have that capability out-of-the box ;-)
 
Indeed. It's a little annoying that int can decode number strings in any base from 2 to 36, but there's no simple function or method to reverse the process for a general base.
 
Yeah.
 
@Kevin I am guessing that will be me too. Hence the 4 hour diversion while doing list exercises to make sure I get them well(because I feel like I don't) before moving on to dicts, while working through the Automate textbook.
 
I have it working!
 
@toonarmycaptain Rightio. And it is certainly good to know how to do stuff in-place, just in case you have lots of data & you need to process it in place. OTOH, if you have lots of data then you're going to be bitten hard by the n² problem, and also, as was mentioned before, when you delete stuff from the middle of a list all the remaining items to the right of it have to be moved down. That operation happens at C speed, but it's still better if you can avoid it.
 
5:08 PM
 
@RaghavSood Excellent!
 
This is my final print function
I feel like it's written badly, though. Any suggestions?
My python skills extend as far as it takes for a hack to start functioning, so there are probably better ways to do it.
 
Hey y'all. Is anyone familiar with a tool like South for non-Django migrations? I look at Alembic, but I'm a bit wary to use it since its still in beta.
 
import random

def rand_string():
    ret = []
    while True:
        ret.append(chr(random.randint(0,255)))
        if random.choice((True, False)):
            break
    return "".join(ret)

def reverse_int(x, base):
    while True:
        s = rand_string()
        try:
            if int(s, base) == x:
                return s
        except ValueError:
            pass

print(reverse_int(33, 15))
Tadaa, bogo-reverse-base-convert
 
@faraz Don't be wary, just use it.
 
5:17 PM
You have backups anyway, right? Riiiight?
 
@Kevin Thank you @Kevin - I had to step away to run a lunchtime errand, and forgot my rbrb
 
@Kevin Oh dear. :) It looks like we don't have a canonical for calling the function arg of Tkinter's .after method. I guess it's virtually identical to calling the function that you pass as a widget command arg, but I don't feel comfortable dupe-hammering it with the canonical we have of that. stackoverflow.com/questions/45221108/…
 
Yeah I usually just ruefully link to the not-quite-canonical post, without hammering.
Not the ideal state of affairs but I haven't got enough give-a-dang juice to hunt for the perfect question and/or write the perfect question and shield it from "this has been asked a thousand times before, although funnily enough I don't have a link to an actually good example on hand" criticisms
 
Yeah, I guess if we tried to write a .after canonical Bryan would hammer it with one of the widget command ones...
 
Perhaps there should be a list of common / useful / descriptive canonicals on the sopython site?
 
5:26 PM
;-)
 
just going to sit in here now since i can't get it to stop pinging me
 
It's stopped pinging me, though, so thanks for shielding me
 
The pinging stops after like a week of not being in the room. Yes it's irritating, no we can't get balpha to do anything about it
 
You could change your name...
 
gaaaaahhhhhhhhhah
 
5:27 PM
lots of things i could do, but will not succumb
 
Open a bug report on Meta that you want to be able to unsubscribe from chat notifications manually instead of waiting for the timeout.
 
sounds.... like a 1000 downvotes
 
If I was a good person I would change my name so that pings directed at me wouldn't ping every other Kevin. But I've grown emotionally attached to my mononym.
 
I discovered what the problem is/was with my libraries. Uuuggggh!
 
@Kevin why? It's a legitimate problem and they continue to ignore it.
 
5:29 PM
cause meta is like the C++ lounge
 
It's really not.
 
Specifically pyodbc didn't do a good job with the manylinux wheel -_-
 
If I kept getting pings through the app because of some room I joined once, things would become unusable and frustrating.
 
I can imagine it being downvote bait if you word it like "please unsubscribe me from Python pings" rather than "please implement a feature allowing unsubscription from chat room pings"
 
14
Q: Please can I disable pings from rooms I'm no longer in?

Matt EllenI've read this question, so I know why I'm getting pings from the Maths room: I went there. I was there for a few minutes and then I left, and now I'm getting a bunch of pings because someone else called Matt goes there and people like him. I'd really like a button I can push to silence pings ...

 
DSM
5:32 PM
I see I already upvoted that a long, long time ago.
 
I will never join the TeX chat room again because of that
 
I would say "let's also ask for a feature to direct @'s correctly" but people would do it incorrectly anyway
 
yep lol
 
@end is part of TeX syntax...
 
DSM
Maybe we have to somehow lure a lot of the Powers That Be into chat and then have them be the victim of unending pings.
7
 
5:33 PM
should i bounty that Q?
 
Techies do not gladly suffer unsubscription requests in incorrect places, thanks to echoes of Bedlam DL3 reverberating through the collective unconscious
 
I doubt SO rep is sufficient motivation for SO devs to implement a feature :/
 
I like your thinking DSM
 
@KevinMGranger more clicks. more views. thats it
 
DSM
My current feeling about the SO dev team is something like exasperated bemusement-- but I don't know enough about the internal processes of SO to know how the prioritization process works.
 
5:37 PM
@DSM process? you have too high of faith ;-)
 
I think of the dev team as tortured artists that can't do any work today because yesterday they saw three red cars in a row on the street and it really disrupted their flow, y'know?
 
Slightly more elaborate print function. Now it highlights which value change, in what direction, and includes a timestamp
 
DSM
Too many branches!
 
Hence my asking for suggestions earlier :D
I'm positive there's better ways to do this
 
I was looking at your asking for suggestion and I got as far as:
class ColoredPrice:
    def __init__(self, price):
        self.price = price
        self.color = WHITE
    def update(price):
        if price > self.price:
            self.color = GREEN
        elif price < self.price:
            self.color = RED
        else:
            self.color = WHITE
        self.price = price

class Market:
    def __init__(self, buy, sell):
        self.buy = buy
        self.sell = sell

btc = Market(ColoredPrice(0), ColoredPrice(0))
eth = Market(ColoredPrice(0), ColoredPrice(0))
Before I thought, hmm, but what's a good way to implement that big if in the original function? Since I already discarded the old prices.
 
5:43 PM
I feel like the third and fourth branches could be eliminated if I took the coloring as numbers instead of strings
Then I can just subtract 6 from the first part
Doesn't matter if it was red or green, since it's common in both
 
DSM
I don't get the difference between RED and RED_INSTANT, but you're almost always taking the wrong direction if you start thinking about clever things you can do based on implementation details instead of conceptual relationships.
 
Even if this particular class composition doesn't quite work, in general I still like the approach of using classes since they're a more idiomatic way to store mutable state than having a cluster of globals that only differ by "buy/sell" or "btc/eth"
 
RED_INSTANT is only used if the price changed in that update. It's a red background. RED is red text, used for a general downward trend, but otherwise unchanged price
 
DSM
Your four if chains are basically doing the same thing, so just like Kevin, I'd abstract that away. I'd have gone functions w/dicts rather than classes, but that many globals is a non-starter.
 
Dicts are also a cromulent way of storing mutable state. nods
 
DSM
5:48 PM
Even the final print sections at the end show a lot of duplication which should be removed. General rule: DRY.
 
Yeah, it could definitely be a lot shorter overall
But, nearly 2 AM here. So I'll improve it while at work later
At least the basics are there now
 
DSM
BTW, there's an entire stackexchange site devoted to improving working code (Code Review). They're very good at stuff like this.
Some of us here have been known to dabble but they tend to be a lot more patient than we can be bothered to be. :-)
3
 
> cromulent
 
Ah, thanks for reminding me about them. Might post there later after a few revisions of my own
 
6:17 PM
@RaghavSood That'd make a really good question on CR.
 
I forget, does CR demand a complete MCVE, or no?
 
It needs a complete working program
 
If just that function was posted, I'd expect at least one comment like "can we see the whole code? It might make sense to change the parameters of this function, depending on how you're gathering this data in the first place"
Like, if you're pulling price change data out of a dict that was returned from a jsony web API, it doesn't make sense to do print_status_line(d["btc"]["buy"], d["btc"]["sell"], d["eth"]["buy"], d["eth"]["sell"]). May as well just do print_status_line(d, symbols_of_interest=("btc", "eth")), for instance.
Rule of thumb: design your code so that when your boss comes to you tomorrow and says, "great job on the bitcoin and ethereum price display code. Now please modify it so it also displays Peercoin, Namecoin, Dogecoin, Litecoin, PotCoin, Zcash, Monero, Boolberry, Etereum Classic, Primecoin, Ripple, Stellar, and Lisk", you don't have to add another hundred lines of conditionals to your function.
 
6:34 PM
cbg
And yeah CR requires an entire working program -- but unfortunately if your program is on the larger side, it may result in tl;dr from most people
So still helps to keep it as minimal as you can help it
 
Well found a unique bug. Apparently someone had so many nested folders, the url was longer than a browser could handle.
 
Client-side problem, WONTFIX
 
DSM
They should have followed the Zen..
 
The path is already too deep for them to handle.
 
I hereby petition to change this page's url to chat.stackoverflow.com/rooms6python
 
6:49 PM
I heard an issue arise where someone's backups wouldn't run on certain files because the filename was like 500+ characters.
 
there is probably a course going on somewhere today, where the teacher thinks it's clever to assign one-liners homework as if they're special, multiple questions like that today — Ofer Sadan 30 mins ago
 
True story
I'm always tempted to post correct but useless answers.
 
FWIW, here's my lambda that answers the OP's question. I don't want to put it on the main site, because I don't like to encourage this sort of thing.
fibseq = lambda n, a=(1,1): list(a[:-1]) if a[-1] > n else fibseq(n, a + (a[-2] + a[-1],))
The 1st version of the question I just linked was much worse: the OP only added code after 5 downvotes.
 
I approve of the practice of posting in chat if you morally object to actually posting an answer on the main site but want to prove that you know how to solve it. Because I've done it about a hundred times so far.
 
I posted a solution to someone's answer a month or so ago along the lines of ((_[True] for _ in _) for _ in _)[False] Which Python can figure out, but most new programmers would be lost.
 
6:54 PM
well...I stopped being a Linkin Park fan a long time ago, but regardless, really sad to hear about the passing of Chester Bennington.
 
The only song I remember from Linkin Park:
> I tried so hard, and got so far but in the end it doesn't even matter
 
that was from their first album I believe.
 
here it is: print(['no','yes'][any([_ for _ in[([_ for _ in _ if _ in"aeiou"],print("{} has {} vowel(s).".format(_,len([_ for _ in _ if _ in"aeiou"]))))for _ in wordlist[::3]]if len(_[False])>=3])]) A one liner for their question. repl.it
 
Kinda relevant in a sad beautiful way? I guess?
 
I'd be lying if I said I hadn't thought the exact same thing three minutes ago
 
6:58 PM
> I don't like my mind right now / Stacking up problems that are so unnecessary / Wish that I could slow things down
from their last album
possibly more relevant, considering his past
 
Their direction I was never a fan of, but his lyrics really drew that picture. Very sad.
 
I liked Collision Course.
 
that was a special kind of album
 
Hey! Do you know, that you can make for __any__ engineering problem a "brute-force" algorithm, which theoretically finds its solution, describe that algorithm as a logical scheme and then you can use an AI agent to make that logical scheme easier to compute, by simplifying unnecessary computation steps, input variables, etc?

Could you name people, who work on something like that? Thanks!
 
what just happened?
 
7:05 PM
@idjaw where?
 
So you're asking "is there a name for people employed to work with machine learning algorithms?"? Not that I'm aware of.
 
I canceled the star, not sure why it was there. @EugeneZavidovsky could you make your question more broad and less related to Python?
 
@davidism I just thought, that Python programmers were the most probable, who would be interested in that... Excuse me. I am kinda obsessed with the idea.
 
I could really use some help with this stackoverflow.com/questions/45127619/…
 
In today's episode of Bizarre Attempts to Use eval, I present stackoverflow.com/questions/45223331/…
 
7:14 PM
@Kevin People, who would be interested in developing a design and manufacturing steps of a molecular nanofactory, which would work in a given physics simulator. That problem can be described as a computing "brute-force" logical scheme, which then can be simplified by an AI agent. Imagine what possibilities that factory can bring to humanity!
 
@PM2Ring oh lord.
 
Training an AI to solve a problem and then analysing the AI's logical pathways (or whatever idk) and trying to optimize it into the simplest algorithm that still has predictive power... Sounds a thousand times harder than just analyzing the problem directly.
 
Just a thousand?
 
@Kevin Yeah, it may be so. State-of-the-art theorem provers based on Neural Networks are still not impressive. I just wonder why no one seems to use Neural Graphs instead... And why big institutions in the USA don't utilize something like Chinese TaihuLight system with its 90 PFLOPS... If you give that machine time to train itself with Neural Graphs...
 
@EugeneZavidovsky I expect that ML can make minor improvements to a brute-force algorithm, and could maybe learn to do some useful big-O order reductions, but I don't believe it could find the most efficient algorithm for a given problem just from "knowing" an inefficient brute-force algorithm. I don't know much about ML, but that ability seems magical, way better than being a mere halting oracle.
 
7:23 PM
@PM2Ring That is an interesting opinion, thank you! I just wanted a feedback on the idea...
 
I'd add to that that if you want a primer on such efforts, look at drug discovery efforts in the last 10 years. A lot of physical/biological systems are not understood enough to model in such a way that you can use brute force to solve a specific problem.
 
Isn't this what folding@home is doing, anyway
 
No worries. We know that no algorithm can be a halting oracle, and since there's no algorithm that can always decide if a given program will always halt, it's hard to imagine that an algorithm would always be able to make progress when it attempts to optimize a brute-force program.
 
@PM2Ring Well, I could not imagine that AI would be able to imitate a speaking person in 2017.
@toonarmycaptain Anyway we have some knowledge about Nature, don't we? Just reprogram those (physics at first, biology will be harder) simulators into a logical schemes or whatever that can be easily simplified by an AI.
 
Reducing all of physics into a logical scheme sounds pretty hard.
 
7:31 PM
@Kevin Laws of physics and common engineering problems are not that hard to describe actually, I think...
 
Considering things like "did event A happen before or after event B?" can't always be objectively answered in a relativistic universe like ours
 
@Kevin Well, I didn't imply such scales : D
 
If we insist on using Newtonian physics exclusively, then all your predictions fall apart once quantum effects get involved. For example, when dealing with problems at the scale of a molecular nanofactory.
 
@Kevin Yeah. I am not a specialist in MEMS or NEMS. There are those guys in the Foresight Institute, which can talk about it...
 
@EugeneZavidovsky Sure. For a given measure of "some" I'm sure you could do what you're saying, but that measure comes with a given measure of "useful" in it's solution. Unfortunately that measure isn't that great yet.
 
7:37 PM
I'm cynical about the promise of breakthroughs in AI in the near future, because they've been promising breakthroughs in AI in the near future for the last fifty years
 
^^ what Kevin said
 
what would a "promising breakthrough" be to you?
 
Which isn't to say that breakthroughs are impossible. Only that I don't want to spend a lot of emotional energy getting excited about it.
 
"Unfortunately that measure isn't that great yet."
What bothers me is that the USA seems to lose the AI hardware race to China.
 
@enderland That's a hard question to answer. For a long time, people said "no computer will ever beat the chess grand master". Then it did. Then people said "no computer will ever beat the #1 Go player". Then it did. The goalposts keep moving :-)
 
7:41 PM
that's why I asked that, I think breakthroughs are occurring
admittedly you could debate whether they are occurring because of the software or just having more firepower to throw at problems
 
Yeah, it's not clear whether Go became tractable because of a qualitative change in the approach that AI researchers were employing, or whether Moore's law inevitably trundled on and gave them the last order of magnitude boost in flops (or whatever) needed, or what.
It's far more impressive if novel algorithms employed in the Go AI project can also be used to improve computer vision and voice synthesis and sentiment analysis and and and...
 
Well that's another story. But given the venue you're choosing for this discussion, I'm going assume you understand that it's what you're telling that hardware to do, and that's what really seems to be the limiting factor. Find a workable *solution* to the three-body problem, and you'll have whatever hardware you like thrown at you to churn it out (especially if you can extend it to `n`bodies..).

That's one (Newtonian) example. You can simulate with brute force 2 body estimations, and iterate through, but noone really has the need to do that at the level requiring a supercomputer.
 
If I wake up tomorrow and Cortana is on every television channel soothingly explaining how she's hacked into and disabled all the world's nuclear weapons, I'll count that as a breakthrough. Anything less than that is an "I'll know it when I see it" deal.
 
Would Cortana still be called Cortana
or would it be sentient enough to decide to go through a name change
and change their name to.......Kevin.
plot twist
 
@Kevin "I disabled them all by exterminating all bases by detonating every single nuclear device simultaneously" ?
 
7:52 PM
I wish SO had a slap editor feature for when they make partial edits. "whit space pornlem" apparently wasn't worthy of editing in the title...
 
we now require more vespene gas
 
I'd settle for "Cortana, I need a molecule administered to a patient in any of a dozen routine ways, that disrupts this enzyme's activity at this binding site, without any serious/problematic side effects, with little to no activity elsewhere, and excreted in a timely manner without too much stress on liver, kidneys etc"
 
@enderland Already have safeguards in place bro:
 
She will call herself "AM"
 
I'd settle for a "Cortana make sure there is a steak waiting for me at home, medium rare"
 
7:53 PM
for someone who worked with optimization... that number might not be big enough depending on exponents ;)
 
if Cortana can throw out a dozen options, ONE of which settles the criteria in a drug trial, then Cortana will be worth easily a trillion dollars of investment to get it to that point.
 
I'm Ok with anything over 9000
 
@toonarmycaptain No-no! One doesn't need to find a solution himself. All what is needed is to describe a problem as a logical scheme, which "brute force" all (im)possible solutions, and then simplify it and calculate. That's all.
 
Computer scientists know very well that often, merely describing a problem is actually the entire problem :-)
4
 
Careful, don't give away our civilization's position while solving the three body problem, it only ends in existential fear and depression.
2
 
7:56 PM
Haha, okay, people. Thank you!
 
@Kevin did you finish the Three Body trilogy?
I changed the reference just in case it was still a spoiler.
 
I finished book #2 just last week. One of the better books I've read this year. I intend to pick up #3 Soon (tm)
Generally I find that being spoiled on something doesn't dramatically lessen my enjoyment of it. Unless, like, the entire work is one long setup for a "surprise!" moment at the end.
I knew about Darth Vader's true identity when I first watched Star Wars, for instance. Still good.
 
Okay, sure! -1 me for trying to help. — Bodurin 30 secs ago
on a lazy/wrong answer. sigh
Ah nice, they deleted/undeleted to clear the flag.
 
8:12 PM
I don't get it?
clear the flag?
 
DSM
Clever.
 
@idjaw I flagged it as VLQ. If a user deletes and then undeletes their post, all flags are cleared.
It's a known bug.
 
that means they get notified of that flag
right?
flagged :P
 
8:32 PM
 
t
That ladies and gentlemen, was the "t" in "Spotify" as I was trying to open Spotify and I hit enter too fast
 
cbg
I got a job offer!
 
pineapple
 
thanks
I will likely be working with Flask on some of the projects.
It has been on my radar to learn and now I have a really good reason to dive in.
 
I've taken your feedback, thanks. Please kindly remove it. — Bodurin 48 secs ago
Except they still didn't answer the question, they just put some unrelated information.
 
8:45 PM
yaaay congrats @Code-Apprentice
 
thanks
 
Does that make you not an apprentice anymore?
 
I'll always be an apprentice.
Now I'm an apprentice with a salary.
 
Pineapple
 
or will be soon
@TemporalWolf melon
 
8:50 PM
@Code-Apprentice Watermelon, although I still think you're now a Code-Associate
 
DSM
Pineapples for C-A. And salaries are very nice things to have.
 
what's the expression I'm looking for?
ah yes
dollar dollar bill.....yall
 
@TemporalWolf I'm a Code-Associate-Apprentice...or maybe a Code-Apprentice-Associate.
 
Pineapples on your pizza @Code-Apprentice :D Hope you enjoy your new job
 
cbg
 
9:01 PM
@MooingRawr pizza isnt' salad!
 
@RompePC This is the Python room.
 
ups
 
Room owners can move messages to rooms they don't own?
 
May 23 '16 at 19:37, by Bhargav Rao
Jan 28 at 15:43, by tristan
in Lounge<C++>, Jan 30 '15 at 2:30, by Borgleader
"Hi I have a question about my retirement fund"
"Sir this is a convenience store..."
"I know but it's the only thing open at this hour"
 
9:04 PM
uugh...fine.....look....you need to diversify your bonds.
 
And I hope you're maxing out any employer 401k matching.
 
Jun 5 '16 at 21:44, by davidism
@Skullomania does that work in real life? "The McD's down the street was closed, so I figured I'd walk into this 5 star restraunt instead. Where's my $1 burger?"
 
What is the opposite of "risk averse"?
 
@Code-Apprentice You have pineapples on your salad? you monster :(
 
@Code-Apprentice daring
 
9:06 PM
@KevinMGranger I need to google 401k or unless you want to give me a tldr :D
 
when it comes to risky investing, "daring" doesn't sound quite right
 
thrill seeker, adrenaline junkie
 
@MooingRawr like an RSPP
 
@MooingRawr 401k is an investment plan in the US. Typically an employee invests a small percentage of their earnings and the employer matches up to a certain amount.
 
Literally got my first job 7 months ago, (not even a part time before that). I have zero clue on what a RSPP a RESP a RESPECT ( oh wait I know what this is ) :D
ahh pension plans
 
9:08 PM
And that money isn't taxed, but there's rules about when you can cash out. But we're now living a joke
 
which joke?
 
DSM
In finance I think they say "risk-tolerant", "risk-friendly", and "risk-loving", depending on where you fall.
 
those all sound good...I am definitely risk-tolerant when it comes to investing. Diversify? Pshhh
Right now I'm betting on Square to make it big
 
DSM
Oh, maybe risk-seeking too.
 
9:10 PM
ooo...that's a good one, too. All related terms with slightly different meanings.
 
TFSA is my homeboy
 
What kind of returns do you get on those?
 
DSM
Okay, time to flee while the sky is (partly) blue. Rhubarb for all!
 
@Code-Apprentice Not much
The idea is that the government can't tax you on it
and you have an upper limit of 5K annually
and you can touch it when you want unlike an RRSP
 
It looks like it isn't just a "savings account" (at least not in the same way as US savings accounts). You have a much wider choice of investment options.
this talk about investments reminds me that I upgraded my eTrade account so that I can trade options. I haven't looked into using that at all yet.
and I still need to get back to my bot
 
9:17 PM
Do you have anything like that in the US?
 
Seems somewhat similar to an IRA.
 
@idjaw sort of - Roth IRA is kind of like that
 
IRA == Individual Retirement Account
yah, and the Roth IRA specifically
 
can you touch the IRA whenever you want?
because if I try to touch any retirement savings I get penalized
 
There are rules about when you can withdraw money
 
9:20 PM
@idjaw you can withdraw Roth IRA principal contributions whenever without penalty
which is why it's "kind of like that"
 
I've heard insider trading can net impressive returns, and is high-risk.
 
IIRC, contributions can be withdrawn, but not earnings.
 
ah ok.
 
if by "high risk" you mean the possibility of spending years in prison...then yes
 
Exactly. For risk-lovers only.
 
9:25 PM
there's so much marketing material for marketers here
 
9:35 PM
rbrb for now
 
10:04 PM
It's not common you see someone with 6k rep post a non-answer...
 
@TemporalWolf you need to get out more! that's way more common than you want to think...
 
 
1 hour later…
11:20 PM
Is it allowed to ask questions in the chat?
 
So long as the rules are followed
 
11:35 PM
Thank you.
 
00:00 - 17:0017:00 - 00:00

« first day (2469 days earlier)      last day (2497 days later) »