« first day (3547 days earlier)      last day (1384 days later) » 
00:00 - 22:0022:00 - 00:00

12:02 AM
@roganjosh and a lot of "code challenge" style questions
 
True :/
 
I think we were musing about this a few days ago and wondering if it was due to enrollments being up in universities, online code learning programs (of various quality), and people trying the code challenge websites
i.e. lot of newly furloughed or otherwise out-of-work now looking to learn new skills or add to resume
 
We were, but I only considered it in terms of an increase in those type of questions. Not necessarily that there would be a decrease in the general level of numpy/pandas questions
 
A lot of data people were let go (a fact I know all too well) so before removing experienced, hard to replace, people it would make sense if many companies looked at their interns & juniors
 
Perhaps my perception is off, though. It's possible that I'm perceiving a lower level of the other types of questions just through the influx of the other types. I don't know any way to measure it
 
12:06 AM
How can I compare a datetime object with a string date?

datetime.now() with '2020/1/1 12:12:12'
 
@X4748-IR By converting them to a common base. Either convert one to a string, or the other to a datetime
 
..... though I've certainly seen the opposite too (companies which are now putting a lot of pressure on junior data engineers/scientists after letting go of their senior talent)
@roganjosh SEDE query by tag and date (years past compared to current)
 
Don't think it covers chat
 
Though I am curious if there is a correlation to lack of answers in certain tags and more people asking in chat
yeah ^ (I meant at least it would check the general trend)
 
@X4748-IR Actually, ignore the second part of my last comment. The string isn't ISO 8601, so you'll need to convert that string to a datetime
 
12:11 AM
Right. But that's the problem lol
I saw somebody was using strptime method, but it needs a format. Isn't there anything that convert both of them to timestamps or somthing?
 
So provide the format
 
@AndrasDeak Yep. They've learned a bit about coding, but they haven't been taught debugging. So they really don't understand what info they need to supply, and why it's needed. And what stuff is superfluous or irrelevant.
Nov 2 '17 at 13:34, by PM 2Ring
@cᴏʟᴅsᴘᴇᴇᴅ I know what you mean. But as Kevin said, the people posting such questions aren't programmers, and they really don't understand how programming works. As far as they're concerned, we're wizards who know The Secrets of Programming, so they just need to show us the problem code and we can use our magic to fix it.
 
@X4748-IR Here's the format codes
 
@PM2Ring what we used to call the difference between a code monkey and a software engineer
Then we were told that was mean and to stop doing that but I always liked referring to myself as a code monkey (and the show was awesome) but C'est la vie
 
Also,
Jul 7 '17 at 17:45, by Kevin
"Can I get tips on the care and maintenance of my houseplant?"
"Please be specific. Is it a fern or a cactus, or something else? Care and maintenance will vary depending on your answer"
"Allow me to be more specific. My houseplant is three years old. It is sixteen inches tall. I named it 'Carl'. I bought it at Steve's Plants on 33d and Market Ave from a man named Emilio."
"That is not enough detail."
"Do you need Emilio's last name too? I can dig that up if necessary"
 
12:18 AM
I once spent 3 hours debugging a person's issue (the computer wouldn't turn on) before realizing he had called me on his cellphone (which was unusual). I asked "why are you on your cellphone?" and he said (and I quote): because the power is out for the entire block so our phones don't work
4
 
@LinkBerest You don't want much, eh? :P I can cobble together a SEDE but I think the chat correlation is beyond me. There aren't even tags in chat, so I'm not sure it's capable of it.
 
nah, I'd have to have the time to scrape our transcripts and then munge that and then add some NLP and then make a dataframe that someone else could analyze cause that would already be enough work ;)
 
Hey, you suggested it :P Can't wait for the results!
 
yes, you'd think work would have taught me not to open my mouth like that :P
 
(and no, I didn't misread. I tactically applied my Manager ears)
 
12:23 AM
@LinkBerest "Did you try turning it off and on again?" "I can't, there isn't any power! ...oh"
 
...might have has a UPS?
 
yes they did - they don't work after the power has been out all night apparently 6 hours was their max
@roganjosh That's what I meant by work :P ;) The scraping wouldn't be hard but the NLP....that would be interesting criteria to develop for automated categorization (what makes a question "code challenge" vs. "pandas" vs. etc...)
 
Tbh, I don't think you'd get much noise. I'm not sure I've seen many people doing those challenges that employ either numpy or pandas. Or, we can circumvent this, pretend we did the analysis, and rely on intuition :)
 
yeah, lets go with option B - that counts as a Neural Net right? ;)
 
I'm inclined to agree. Now, what journal are we targeting for our findings? :P
 
12:34 AM
lol - if this was last month I might have actually put this together but I'm fully back at work now (which is nice) and prepping for two online classes next Month so time and me are not friends right now :)
 
:) Enjoy it mate. Right, I must return to my slumber for a while. rbrb
 
rbrb
 
1:11 AM
@MisterMiyagi How to exec the code with a custom globals dictionary?
 
1:24 AM
@whatsnext Create an empty dict, and pass it to the exec function.
If you're doing anything with exec, compile, or eval, I recommend you take a look at stackoverflow.com/a/29456463/4014959 You may not understand everything there, especially on the 1st read through, but it has plenty of useful information.
Your custom globals doesn't have to be empty. You can put stuff in it before you call exec. Here's a fairly basic example, in an answer I wrote a few years ago. stackoverflow.com/a/43273080/4014959
 
1:48 AM
@roganjosh Thanks, man. :flower:!
 
 
3 hours later…
4:48 AM
Food for thought: If all you answer are beginner questions, you're still a beginner yourself
...not that there's anything wrong with that, you just don't want to remain a beginner forever.
 
@cs95 That's definitely not true. Giving good answers to beginner questions is often the hardest.
5
 
Hey Cody. I suppose you can interpret the challenge of writing a good answer to a beginner question as actually helping OP understand the code, their error, and the solution... rather than helping them cargo cult their way to their next error (and question)
and from that perspective you'd be right. But my thought is more along the lines of challenging yourself with harder questions.
 
Sometimes, "harder" questions are really just those where someone has designed themselves into a corner.
So while they are challenging, they don't necessarily reflect true skill.
 
5:04 AM
@roganjosh I need to reread this now and again :)
@cs95 A deeper understanding of what's going on in 'Monty ' + 'Python' -> 'Monty Python' such that you can both concisely convey the solution to the simple query, at the same time as impressing deeper truths and concepts on beginners, whilst still imparting something useful to more advanced readers, is truly excellent. It involves a deep conceptual knowledge, comprehension of significance in wider context, and the ability to convey that in text. Not at all unchallenging.
 
New user running amok with globals instead of proper OO decomposition, in a Tetris implementation... anyone want to give them advice? stackoverflow.com/questions/62671055/making-tetris-on-python
 
@toonarmycaptain if we're talking about beginner questions in general, sure. On stackoverflow a question about string concatenation would probably be closed as duplicate or unclear (since there's no RTFM close reason)
 
"It's unclear to me why you don't just read the documentation"
^^ This is not a close reason.
 
5:20 AM
@cs95 A brand new question, surely. My point remains. Some of the best answers I've read break something simple down into underlying CS concepts, python internals, correct/good use in code, efficiency considerations etc, all without being verbose or complex. I find choosing what to elaborate on and what to leave in, and how to frame the answer to be a valuable skill.
Admittedly, a different one from answering really difficult questions. But I don't think less worthwhile, or less reflective of programmer skill. They say you don't know something until you can teach it, to which I add...to both the dunce and the Nobel laureate, simultaneously, without boring or losing either.
anyway, I myself am getting verbose. rhubarb
 
5:39 AM
@PM2Ring Ah, now that's a point. So I have understandood it wrong. Thanks, now I can narrower down my interpretations of the text.
If I 'm interested in making a package "Automate Django Tests" with faker , how should I go about it? I 'm not asking how to push it to pypi or anything, I know that. I 'm asking here that after I clone the project, I used python setup.py develop, write some code which creates the test and push it to pypi?Is this the general flow or do I need to ask the django developers first or something else?
 
@VisheshMangla you'd open a pull request with your code on a separate branch, if they accept your change they will approve your pull request and merge and then delete your branch.
 
5:54 AM
well, if they reject the idea that code would be wasted. Hours will be wasted of mine. Also someone said django community won't include external dependencies(Faker) so easily
 
@VisheshMangla yes, which is true for most things in your work life, you'd want to know if your stakeholder is first interested in the idea before sinking time into it
 
yes, that's y I 'm asking first because I wasted time on 2 projects and now client is not responding
 
 
1 hour later…
6:58 AM
Am I reading this correctly, python 3.5 will reach its end of life in less than 2 weeks?
 
7:27 AM
@LinkBerest The problem was the word "monkey," which was frequently used as a slur against African Americans, so you are a victim of cultural fall-out.
@LinkBerest Rule 1: check power supplies; rule 2: start with the physical layer.
 
For custom tags of PyYAML, is that possible to use multiple tags for one value? For example, "host: !ENV !FORMAT APP_HOST". stackoverflow.com/questions/43058050/…
I have created tag classes for both ENV and FORMAT. They work fine separately but failed if I put them together.
 
Am I crazy for considering to implement a custom Path class that supports byte paths and has an absolute() method? I'm not, right? Right?
 
7:44 AM
@Aran-Fey "yes, that's fine"
 
Alright, I'm doing it
 
@Aran-Fey Are you subclassing the Python path object, or writing from scratch?
 
Good question. Haven't thought about it yet. Does it matter?
 
8:11 AM
Working with paths really makes me want to drop python 3.5 support. I have to backport soooooo many functions just because they don't accept path-like objects in 3.5
 
8:30 AM
@Aran-Fey What is a "byte path"?
 
>>> os.listdir(b'/srv')
[b'ftp', b'http']
A regular path, only as bytes rather than text
 
How are bytes different from text?
Don't you store text as bytes?
Is that just another way of saying a UTF-8 string?
 
Well, it's not utf-8. The encoding depends on your OS/file system/whatever, and not every valid path can be represented as text
 
@Aran-Fey why are you on Py3.5 anyways? Even we aren't, and we still have Py2.6 in some places.
 
What do you mean "not every valid path can be represented as text"? Why in the world not?
 
8:35 AM
@MisterMiyagi I'm not, I'm just writing my stuff in a 3.5-compatible way. For the benefit of the users I don't have
 
@CodyGray bytes are raw, well-defined machine data. text is independent of its encoding.
 
....?
 
@CodyGray Honestly, I'm wondering that myself. I remember reading it somewhere in the docs. Lemme see if I can dig it up
 
Text is represented as bytes
 
8:37 AM
Okay... that seems to be what I thought, but different from what you're saying.
 
for example, the string 'a' may be ASCII encoded, LATIN, UTF-???, whatever. Python does not give a guarantee.
 
So a byte string is a UTF-8 representation
Whereas another type of string might be represented using some other types of characters, like UTF-16, UTF-32, etc.
 
the closest "string thingy" to bytes is ASCII
or C char
but that's just a convenient representation for punny humans
 
> Unfortunately, some file names may not be representable as strings on Unix, so applications that need to support arbitrary file names on Unix should use bytes objects to represent path names. Vice versa, using bytes objects cannot represent all file names on Windows (in the standard mbcs encoding), hence Windows applications should use string objects to access all files.
 
ASCII is an encoding. That's not the same thing.
 
You can represent anything you want as bytes.
 
we're hung up on different terminology, it seems
 
Maybe so
PEP 393 makes perfect sense to me
That's almost exactly how I'd implement it
@Aran-Fey This claim is more interesting to me. I have to think about this.
 
My life would be a lot easier if I stopped reading the fine print in the standard library tbh
 
Is anyone distributing crystal balls? I need to predict unseen requirements in questions.
 
8:44 AM
Mine broke a long time ago. I just use the "close" link instead.
 
whiny voice but that's not welcoming!
 
Are we defining sorcery as welcoming now?
It's the snarky comments that Jay Hanlon wanted to kill, not votes.
Now, I was upset about this as anyone. I live for snarky comments.
 
Having trouble googling this: Is it safe to assume that some_float == json.loads(json.dumps(some_float))?
 
Seems misleading... some_float will be a JSON object, not an actual float....
But yes, json.loads and .json.dumps seem to be opposites of one another
 
9:00 AM
Didn't think I'd ever hear "JSON object" from you. What's that supposed to be? :P
 
Uh, it's a key-value pair
I have no idea how that library implements it
But it's not a float
 
You mean a collection of key-value pairs? Python represents that as a dict
There is no such a thing as a "json object", because json is basically an encoding (data -> text)
 
Yes, but it's an encoded object
That's not the same as the object itself
A "float" has a certain binary representation
 
Sure, a float is not the same as a string representation of a float. But what's a json object? Is that the text that represents my float?
 
@PM2Ring hehe
 
9:10 AM
@Aran-Fey Presumably, yes, or however that library stores it
> Note Keys in key/value pairs of JSON are always of the type str. When a dictionary is converted into JSON, all the keys of the dictionary are coerced to strings. As a result of this, if a dictionary is converted into JSON and then back into a dictionary, the dictionary may not equal the original one. That is, loads(dumps(x)) != x if x has non-string keys.
The library documentation literally says that dumps() "Serialize[s] obj to a JSON formatted str"
So, you can quibble about the terminology, but I stand by "JSON object". It's whatever that library defines as its representation for...a JSON-encoded object.
 
Right, that aligns with my mental model. Before: python object. After: text in JSON format
 
How is "text in JSON format" different from "JSON object" then?
 
Ok, so what I call text, you call an object. Alrighty
 
In my world, everything is an object. (Except those things that aren't, like free functions.)
 
Usually when someone says "json object" it's a newbie referring to a dict. Also, "json object" simply doesn't make sense in my mental model of json. So that's the 2 reasons why I don't like that phrase
 
9:16 AM
What's your mental model of JSON?
It's just a structured storage format for encoding data in text as key-value.
 
Basically, "json object" is like "ascii character". There is no such thing; what you really mean is "a character that can be/has been encoded as ascii". Likewise, there is no "json object", there is only "text in json format that represents an object"
 
Hmm. See, I also think there is such a thing as an ASCII character.
It's a character that has a valid ASCII-encoded representation
These terms are just shorthand for what you spell out long-hand.
 
Sure, but they are just shorthands and not things that actually make sense
 
That's deep
I try not to get that philosophical
 
A wise choice. Too much philosophy tends to lead to existential angst
One day, ascii characters don't exist. The next day, you yourself don't exist
 
9:28 AM
Especially because I represent my identity using ASCII characters!
 
@CodyGray check your privilege
 
10:29 AM
Ugh, what's the word I'm looking for? If we developed something in-house to replace a 3rd party solution, we need to ensure it's "value-for-money". I'm currently saying "project viability" but I'm sure there's a more technical term; I'm just drawing a mental blank
It's a bit late to ensure project viability when you're rolling it out and all the money has been sunk into the project
Cost effectiveness?
I think I've just rubber-ducked my way to that one. Sounds better. Thanks all :)
 
@Aran-Fey yes
note that strictly speaking, this seems to be implementation defined. a different JSON de/serialiser might use a different precision.
 
@roganjosh lucrativeness?
 
@MisterMiyagi as long as it works with the stdlib one, that's fine. Thanks
 
I guess that's more about net profit
 
See the note on standard json lib, implementation limitations: "This module does not impose any such limits beyond those of the relevant Python datatypes themselves or the Python interpreter itself."
so any roundtrip should be safe.
 
10:40 AM
Awesome
 
Three quatloos for the first person to prove me wrong via brute-force testing.
 
@AndrasDeak problem is that the product is only about saving money, it can't produce any money. We just needed to make sure that we were spending less to develop it than we were spending in subscription to some other company
Ah, sorry, I missed your follow-up comment. Kevin'd
 
@roganjosh arguably (money saved - money spent saving) is still profit
 
True. If it brings down the cost of services then the profit margin increases
 
10:59 AM
Ugh, 1 day wasted because of a bug in resolve: github.com/systemd/systemd/issues/10298
Well atleast it works now
 
user11702787
Im trying to get the absolute path with pathlibs resolve
 
user11702787
should this not print the absolute path
 
user11702787
p = pathlib.Path('config.ini')
print(p.resolve())
 
user11702787
insted of just 'config.ini' ?
 
What are the odds?
 
11:02 AM
It definitely should.
 
@WiliamSnyder It should, and on my system it does.
 
11:32 AM
stackoverflow.com/q/62693115/4799172 dupe of their own question, then we need to push to OP to fix the original answer
Although, their original question is also a dupe but I'm on a phone currently. I'll look for that dupe when I'm back at my laptop
 
11:51 AM
@roganjosh the manager speak is return on investment (ROI)
 
@LinkBerest Actually, I think ROI is what I was looking for. Thanks :)
 
Add in how it meets some Key Performance Indicators (KPI) for extra warm and fuzzies
 
Oh, I've got "KPIs" and "dashboards" all over the shop :P
 
@Aran-Fey oh btw instead of complicating it a lot, I just realized I could do fake_post.assert_called_with(params) and so on
 
Fortunately, this is a technical contracting role in logistics with quite specific requirements, so I can go harder on the technical aspects and less of the fuzzies
 
11:55 AM
@holdenweb interesting, thanks for info.
 
hmm I'm not sure if there's a way to just test a few of the parameters instead of the whole thing
 
Ah, that is easier. And sounds nice :), executive summaries are the most annoying things I write :/
 
Ah, this is still a CV currently, I'm just trying to hit all their requirements and was drawing a blank on ROI. Once in a while I'm niche enough to be contacted for some really fun projects, so I'm working hard on getting this one right.
 
I have a newfound appreciation of unittest now, very close to full coverage after toiling for 5 days
 
12:22 PM
@Abhijeet.py please don't ask for help here with fresh questions on the main site, as per our rules
 
 
1 hour later…
RMM
1:29 PM
Is there a way to make if x in y match exactly and completely?
 
What does that mean? x == y?
 
RMM
yes and damn completely forgot about ==
 
On SO, somebody would be posting an answer with the code re.search('^' + x + '$', y) right about now
 
@Aran-Fey needs more f-srings
 
2:05 PM
How do I go about running my simple python echo script on a debian server as a service. All it does is take in a byte and send it back. Just trying to get used to socket programming. Currently I'm just running it with 'python3 server.py' through terminal.
 
@Hakaishin thank you
 
how does seperating data/models and code in vcs work in machine learning projects? I finally am coming around to write some unittest, but already the first function I want to test seems tricky.
def classify_img(model, titles, img):
    predictions = model.predict(np.expand_dims(img, axis=0))
    label = titles[np.argmax(predictions)]
    confidence = np.max(predictions)
    return label, confidence
now if I want to test that, I would need a test model and test img right? Which I would want in vcs, but that would bloat my repo I think
I guess I could mock the predict call, but mocking 1/3 of a function seems like it would be useless to even write such a test
 
2:36 PM
you can use an API to fetch images @Hakaishin
or a link to your Dropbox in the tests
img = request.get(.../dog.jpg).content; and further stuff
 
hmm, yeah but is that the recommended way?
 
no knowledge of that
 
I don't see what problem the Dropbox suggestion would solve
 
To not bloat the cvs
 
Ah, actually, ignore me
 
3:00 PM
Dropbox can be used to store images. And you can share them with a link
but now there's github private free repo too. Free private cloud
 
3:30 PM
If you check in your model and image once and never change them, I wouldn't expect it to bloat your repo any more than the size of those files
As I understand it, the real bloat associated with checking in binary files is when you make changes, which tends to create a much larger diff than when you alter a text file
That said, I can imagine a test-driven design requiring a lot of changes to test data, so I wonder what the idiomatic solution is there
I wonder if it's possible to tell git "don't bother downloading the first revision of this file and then applying ten thousand consecutive diffs to get the most recent version. Just save the most recent version directly and save yourself some cpu churn"
Squashing the ten thousand commits together would probably help, but then you lose valuable history
 
3:53 PM
@Kevin yeah I thought about that, but then again, what good is a static unittest, then I don't even need to have it, if I just set it up once and don't change it often. Man I don't feel like writing unittests :(
 
I feel ya :-)
At the very least, a test you never change is still useful for identifying regressions.
(Not to be confused with statistical regression errors, which I just did)
 
The only testing software I've used in Python is the built in module unittest. Mostly because I do as little testing as possible in my personal projects because it bores me
And the occasional segfault in the production environment adds a little spice to my life
 
why not create a testing framework if that bores everyone?
 
Sounds hard.
 
4:01 PM
I once talked on #django to create tests for models
but they said django community won't accept dependencies so easily
 
True. Adding dependencies to popular libraries has a lot of downstream consequences, so they take the decision seriously
@PM2Ring Hmm, interesting. I'm not sure I understand Mark's explanation for why it would be difficult to salt numeric hashes. "compute a hash in a cross-type-compatible way, then do some sort of uniform post-processing of that hash, incorporating information from a per-process random salt" seems simple enough. Can't you just XOR the deterministic hash and the salt? Or are we assuming the bad guy knows the per-process salt, and so using it in a reversible function wouldn't be useful?
 
4:21 PM
I've tried to do full testing in personal projects, and yeah, you end up changing a lot of tests...but often you're just changing the return value slightly, or adding/changing/removing an assert checking that a function is called, relevant to your application code changes. *integration* tests *shouldn't* change nearly as often.
That said, I rarely, if ever, write a test before the code, because I generally figure out what I want the code to do while I'm writing it, then write the test.
...then rewrite the code so that it passes all the edge cases I think of when I write the test.
 
Yeah, I think I will think about some good integration tests, they suited me well in the past. But unittest haven't really.
Because already the next function seems stupid to test. It's a label_img function which basically does some string formatting and then calls cv2.putText. How the hell am I gonna test cv2.putText, no clue
 
@Hakaishin In pure unit testing, you'd mock that function call.
 
then I mocked 50% of the function
the other 50% is a "{a} blabla {b}".format(42, 42) call
which I don't feel too excited about testing
 
4:35 PM
@Hakaishin In unit testing you test the 'unit'....so what you expect that function to do by itself without reliance on any other code to do what you expect it to do. Such that in actuality, that cv2.putText could be broken, but your test for my_func will still pass (because it's doing what you expect by doing the string formatting, then calling cv2.putText with expected args), and you'll know the issue is in cv2.putText (if that's tested), not my_func. I think that's the point of unit testing.
Or that's my understanding, anyway.
 
@toonarmycaptain that does make a lot of sense and sounds totally useless in my case and in many real world scenarios I can think of
 
if its django, then it shall be easy without breaking the code since we might implement it this way name=model.CharField(test_type="name") ;fake = Faker();fake.name()
I got the idea but not much motivation
 
@Hakaishin In theory, even the most complex of tasks are just a sequence of small steps that should give a predictable output given a set input, so you could break it down, provided that you supply each step with what you think the previous one would spit out
 
@roganjosh yeah, no I don't doubt it's wrong. In my cost benefit analysis it just ranks higly low on the priority of things to do. Then again, I'm out of work due to unfortune with me being sick last week and a coworker going on holidays for 2 weeks. And I should have gotten vital information from the other guy to continue working, but didn't well such is corporate life sometimes
 
I'm advocating something that I barely use, btw :)
 
4:44 PM
on the bright side I did find now 2 functions which do make sense to test :)
 
Extremely detailed testing reminds me of CS 101 assignments that require you to comment every line, like a = b + c #set a to the value of b plus c
 
haha yeah
 
@Hakaishin Sure, but that's what integration tests are for! Also fixing dependency versions, so you know that 3rd party function call won't change in an untested way.
 
def test_widget_frobnication(): assert Widget().frobnicate().is_frobnicated, "expected frobnicated widget to be frobnicated, but was not frobnicated instead"
Real useful
 
@toonarmycaptain I know it won't because it's freaking cv2 and they do care about backwards compatibility. Also because I don't autoupdate my dependencies, but do it manually.
 
4:48 PM
@toonarmycaptain or it just explodes and you find out that way? :P
 
But I see your point. Sometimes I wish I would work in a "serious/cool/big" company so I could play with the big boys, where these things really matter. But other times I'm quite happy I get away with what I get away :)
@roganjosh haha pretty much
 
Kaboom --> Angry phonecall --> Fix. Probably quicker than the unit testing malarky :P
 
@roganjosh jap, that's pretty much how it works for us :P
what was this actually about? so randomly pick a number in the half closed interval [0, 0)? is this some math joke I'm missing? Are there uncountably many numbers in this set? Is that right?
 
I mean, if you're going for five 9s uptime SLAs, you better hope the kaboomy bit doesn't happen too often
 
Hello
 
4:51 PM
@roganjosh xD
 
@roganjosh Well, that's one way to do it. I guess that's why google and aws tend to have issues every couple of years or so ;)
 
@Hakaishin When you do it manually, you want your tests to fail, and know it's in the updated dependency? Keep doing that integration test :)
 
also I wish foo/bar would somehow automatically be converted to os.path.join("foo", "bar") to save time. The amount of time I am writing os.path.join is annoying :P
 
@toonarmycaptain convergent evolution, right here :P
 
4:56 PM
I think it might be with Path objects, but can't you put spaces in there path1 / path2 to concatenate them with appropriate separator?
@roganjosh lol
 
I am searching for a module to play mp3 files (only mp3), to change some attributes while playing (such as sound speed,sound volume), and finally i want to make a song queue to send the mp3 data to a radio streamer (such as icecast).

Is there any good module for that in python?
 
vlc python bindings are alright
 
I am trying to run: tkvlc.py (git.videolan.org/?p=vlc/bindings/…) but it fails.
Traceback (most recent call last):
  File "vlc.py", line 555, in <module>
    player = Player(root, video=_video)
  File "vlc.py", line 243, in __init__
    self.Instance = vlc.Instance(args)
AttributeError: module 'vlc' has no attribute 'Instance'
root@chris-pc:/home/chris/Documents/Python/Papinhio player/version 2.1/main/test# python3.6 -m vlc -v
vlc.py: 20.05.04 (tkinter 8.6 N/A)
pyaudio doesn't work correct.
It supports only wav files
I tried portaudio
I have made the player front-end. It's almost ready.
 
This module only play sounds.
How can i edit the song while playing it?
@VisheshMangla Thanks for your replies.
 
you can first read it then I think librosa, scipy others can be used. I used it long ago.
a sound , image whatever is at the end is a numpy array
realpython is awesome if you need knowledge about something.
 
It's quite cool that python allows for non ascii identifier
 
which module?
 
5:28 PM
What about if i make my own module?
 
?? Chris P
 
Starting from pcm numpy array?
Sorry, it will be difficult.
 
@ChrisP github.com/librosa/librosa#audioread-and-mp3-support I just found out librosa already has support for mp3
 
6:17 PM
Wow not closed " " in html can give you the weirdest errors without you noticing and without it screaming at you for messing up. html is way too kind. and yes the road to hell is paved with good intention as shown with html
 
Shouldn't a syntax highlighter catch that?
 
It did, but some 30 lines later :O
so I was quite confused and thought, meh pycharm is weird, instead of whoops there is the wrong " "
 
Use an IDE you can trust :P
when vim's auto-indent stops working I know I forgot to close a parenthesis or bracket
 
cabbage :-)
 
@AndrasDeak haha yeah it was behaving weird. But instead of adding stuff I should have checked the previous lines :P By addind stuff I increased the line count between the error and the red flag
 
6:39 PM
@Hakaishin Isn't that part of HTML's charm, though? It somehow holds itself together, doing what you think it should be doing, then explodes on your 7th error?
 
@roganjosh Well given that we are in the python chatroom and I quite like the language you can imagine what I think of that philosophy ;)
 
<nods knowingly> Totally awesome
I swear that jazzing up my MySpace was never so difficult when I was a teen
 
@roganjosh Copy/pasting js and changing numbers and image/animation urls until it works? Sure...lol
 
It worked in the past, it should work now, damn it!
 
It still does. On IE 3?
 
6:50 PM
Ah, that's where I messed up
 
7:20 PM
@roganjosh Return on Investment (ROI) is what I think you're looking for.
But it's a bit late for any of that terminology if you're already rolling it out and have sunk the money into it. :-)
 
@CodyGray It was exactly that. LinkBerest already removed my mental fog but thanks :)
 
Oh, oops. Guess I didn't see that when I skimmed the transcript, trying to ignore all the Python stuff :-)
 
Nah, I was trying to explain in my CV exactly what my meetings with the Directors were about and couldn't find the term
The project was a success, thankfully :)
@CodyGray yeah, it's icky stuff. We don't want any of that here!
 
You can have it, I just don't want to get any of it on me
 
You'll find hazmats on the left
Hmm. I've just realised that hazmats really refer to the chemicals, while I meant the suits. I guess that working in a lab surrounded by litres of chloroform, massively concentrated sulphuric/hydrochloric acid, cyanide and enough steroids to take out a small village really shifted my terminology
 
7:40 PM
I contemplated pointing that out but I didn't want to be the resident pedant again :P Cody needs something to do too
 
Pedantry welcome. I'd be awful in a chemical disaster if I kept up that old habit! The "suit" part was superfluous when you're completely surrounded by everything that can kill you - context made it obvious
 
"Quick! Cover yourself with hazmats!"
And this is how the laboratory lost its most promising first-year student...
 
I'd like to say we had robust procedures, but it was at least a year before I was informed that I'd been microwaved daily in my office, so...
 
What are a few microwaves between friends, though?
 
non-ionizing radiation FTW, though, right?
 
7:51 PM
I'd rather be bombarded with microwaves than "thanks" emojis.
 
Well said. You now have an anecdote. I support that motion
 
Oh, that's cute. The tag strikethrough is orange. I guess because somewhere underneath that styling, there's an <a> tag.
 
8:06 PM
Thst's enough front page for me
 
Uses good ol' <strike></strike>
 
@CodyGray it isn't for me
 
Really? Hmm.
 
I see one long black line and only the question link is orange
 
must be a chrome thing?
 
8:15 PM
That's what I would expect. Chrome is doing something weird, then.
 
This is with firefox. On duckduckgo's browser I see orange on the tag.
 
DuckDuckGo has a browser?
Oh, it's just a Chromium wrapper, eh?
 
even in 2020 we have competing standards for the same thing
 
@CodyGray no idea
 
I'm on Chrome and the strikethrough is orange over the
 
8:21 PM
@cs95 It's a web thing. Very frustrating. Some day, when the web becomes a mature technology, they'll work this stuff out, I'm sure.
 
@CodyGray when it becomes a part of critical infrastructure
 
8:37 PM
Hello
How can I use python-vlc.
I installed with pip3 but when i am trying to run one of the official examples error occurs.
AttributeError: module 'vlc' has no attribute 'Instance'
I searched in google but no satisfied answer found.
 
Did you call your file vlc.py?
 
Python version: 3.6.9
Os: ubuntu 20.04
yes
 
Err, well that's the issue
 
so it's a confict?
Well give me a minute
 
You're shadowing the module. This is fundamental stuff
 
8:40 PM
with another name
ok now works!
to try
There are some notices (maybe) in bash.
[0000557b9edd2af0] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[0000557b9e9c3390] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[00007fe1980038e0] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
I will just ignore them.
 
Ok
 
 
1 hour later…
9:53 PM
Hello guys, a total noob question here: I want to check a string "if a custom string contains a word with a hashtag #likedis for example" and be able to fetch only word '#likedis' which can be arbitrary length after the hashtag. What would be the best way to do it in Python
 
@SanchezPanza little nitpick, there is no such thing as a custom string. There are just strings
check out substring and regex
 
00:00 - 22:0022:00 - 00:00

« first day (3547 days earlier)      last day (1384 days later) »