« first day (4742 days earlier)      last day (431 days later) » 

02:38
@Aran-Fey As in truncate (overflow: hidden) or bound (max-width: 100%)? IIRC max-width can't prevent child elements from sticking out -- if one of the children has a min-width higher than the max-width.
 
3 hours later…
05:53
@Peilonrayz Neither, the parent should grow to accommodate the child
 
3 hours later…
08:41
Are you free-wheeling this or using a framework like bootstrap @Aran-Fey?
nothing, just plain ol' HTML/CSS
scuttles under the nearest rock
I basically want to have 2 rules for layouting:
1. Parents grow large enough to contain their children
2. If a parent has only 1 child, the child gets all the available space. Even if that's more than it needs
Sounds simple, but is impossible :/
09:06
"Parents grow large enough to contain their children" We're a weird bunch...
When I was in Uni, me and my best mate had a game to just loudly say the most ridiculous thing that came into our head as we walked past people on the street, just to see their reaction to our insane "conversation". In later life, I've realised that legit conversations between programmers must sound utterly bat-**** to anyone nearby
When I first created beatroute and it wasn't really known in our company, I would casually drop it in our internal meetings about how I could use it to calculate customer transport costs
"Just do the transform inside pandas, pass the result to beatroute and it'll give you back the distance as JSON, which you can unpack by key". I think most people would be sectioned if they weren't talking about programming
09:23
Programmer: "The output of this function is all wrong"
Passersby: "Oh, he's a mathematician"
Programmer: "Your class is a mess"
Passersby: "Never mind, he's a math teacher"
Programmer: "Does the process fork itself here?"
Passersby: "Wut"
09:44
@roganjosh one of my favourite things about software is that the analytics software Splunk is so expensive it gets discussed at very senior levels, which means a load of c-suite people had to say a ridiculous word in meetings a lot.
Love it!
At my last place, I did manage to get "psycho pig" as the official pronunciation of psycopg2 so we could have some fun with those conversations
I never did finish my training slides for "Psycho Pig 2: The SQL"
3
10:43
@Aran-Fey I thought you'd just remove the width setting on the parent, and it'd grow, assuming the child doesn't do something to remove itself from regular positioning
I really have no clue when it happens, but sometimes the parent just stops growing past a certain point. One time it refused to become wider than the screen, for example
Maybe it defaults to max-width: 100%?
It would be nice to have a playground for things like this
 
3 hours later…
13:52
Looks like Quora has ChatGPT embedded now
It's a nice addition to the totally baffling layout of the site where I find myself unexpectedly reading posts totally unrelated to the one I opened in the first place because the UI is garbage. Now I can have AI generate extra garbage! What a time to be alive
14:11
I've found it not to be significantly worse than much of the stuff they get from meatbags. ;)
14:35
brew install [email protected] 🎉
14:51
is it correct to say that when looping a list the indexes are not accessible and this problem is solved by using enumerate?
I wouldn't call this a "problem", but otherwise that statement seems correct.
@DimitrisPapageorgiou I assume this is from your question yesterday?
@roganjosh yes...
Most C-type languages will require you to traverse a list of indices and access a sequence using that index. Instead, Python defaults to looping through the elements themselves, so using enumerate is a convenient way to get the index back (which you need in your case)
I was just about to code it up but my taskbar has disappeared?! :O
MacBook Pro, circa 2019?
14:59
I am getting the picture...I am new to Python...coming from PHP
This reminds me of the panic when I get a contact lens lost in my eye. Oh god, what have I done?!
It's back <wipes brow>. Let's hope that doesn't happen again
You might want to read up on resetting PRAM and SMC just to be prepared.
test_list = ['peter','google_ad_height','google_ad_height']
indices = [i for i, v in enumerate(test_list) if v == 'google_ad_height']
print(indices)
I am looking in the docs the built in functions of Python....I do not understand why list methods such as append are not considered built in functions
because they are methods, not builtin functions. :P
15:02
Why would it be a builtin?
The builtin types (and their methods) are documented here: docs.python.org/3/library/stdtypes.html#
I do not know...this is what I am trying to find out...
I will put it this way...what is the difference between a built in function and a method?
You can quickly jump to the builtin type from the constructor "functions" in builtins. E.g. the builtins docs on list immediately link the the actual list class.
@DimitrisPapageorgiou Functions exist by themselves. Methods exist on classes.
The thing about builtins is they are accessible in global namespace, without any imports. You can type len([]) and get a result. You cannot type just append(...), you need to append to something
15:09
You could, I guess, have append(my_sequence, item) but then it'll blow up on tuples, dicts and sets, so it doesn't really seem very useful
Almost entirely separately @DimitrisPapageorgiou notice that I changed the variable name to snake_case. It would be worth reading through PEP8 if you're going to be using python as the style is typically relied on more than just a "nice to have" feature
Tbf such append wouldn't be much different from e.g. sorted but I think it's just that bit too specific
Except for things like a = {1, 3, 2}; print(type(sorted(a))) so it's not the same collection
@roganjosh still can't get myself convinced to that one part of PEP8. camelCase looks more clean for me.
15:27
Perhaps. I've recently been making an effort to keep to camelCase in my frontend work but it's always tied to the backend in which I use underscores being developed in tandem. One thing I do know is that I immediately judge a library source code by adherence to PEP8 even if it's arbitrary. Opening the first .py is either going to be a "phew" or "oh man, this will be tough"
 
1 hour later…
16:36
I've surrendered to the idea that APIs in Python should just use camelcase for their resource classes. Otherwise there's so much mapping work to do.
17:35
It's strange how you wrote snake_case... oO
Evening pondering: asyncio storing Tasks weakly actually makes sense. If there's nothing that could execute your task and thus holds a strong reference, might as well reap dem zombies.
17:48
Isn't the event loop the thing that can execute the task and should therefore hold a strong reference?
well, as far as my digging has revealed - actually not, no. The executing task and any task waiting on a select should be held strongly by design, but the rest not.
Say you could have a task waiting on an Event. If nothing else has a handle on either the task or Event there's no way for the task to ever run again.
Hmm. What if the task is waiting on a sleep()? Does that hold a strong reference to the task?
I think so. sleep should be handled inside the event loop by select which should by design hold strong references.
Hm, I should probably check those shoulds.
It sounds like a bug/edge case waiting to happen for very little upside tbh
Although, I guess it could be a problem for very long-running programs, like web servers
In a way, I am trying to figure out where my thinking goes wrong because those bugs/edge cases did happen to me. :/
Not sure if that means the waiting primitives are broken...
18:06
I'm not familiar enough with the asyncio internals to stand any chance of figuring that out, so you're on your own there :P
Oh well, to boldly go where no sane man has any reason to go... waves happily
<dabs eyes with hanky> So brave
18:25
@roganjosh you mean Poe? They had this for months now. It support chatgpt among other models (although they use a weird subscription I think)
And to be honest, with the quality that goes on Quora, I can't say whether output of this is worse than what people post themselves there or not
I have no idea if it's "Poe", it does just say "ChatGPT" in the interface
ah, yeah that's Poe
Shame it didn't actually answer my question at all
ChatGPoeT?
Get this man in the Marketing dept. STAT!
To be clear, I didn't actually ask on Quora, that was just suggested by Google and the site then offered a bot-driven answer. I found separate human answers that talked about the information density in the English language and answered my thoughts. The bot just spewed generic garbage
18:50
@roganjosh ah, that reminds me: saw this video about path finding yesterday youtube.com/watch?v=CgW0HPHqFE8 thought you might be interested
They're some neat visuals! It's not surprising they invoke the sense of lightening when the route is found :)
Tried to reproduce it with pygame, but iterating through the json to draw the map take too long (and even in batch/chunk, it take so much ram). I'm sure there might be a better way though
Do you know about Contraction Hierarchies?
No I don't :)
It's a heavy pre-processing step across nodes but the resulting software is silly fast
18:54
oh, that sounds nice. Never heard of this
Margeting
19:11
In terms of pygame it might not be relevant tbh. I don't have any experience with it but from what you're saying, it seems like you'd want to load thing in the background and JSON is really not a good format to be analysing in real time
yeah, the json is really small (from openstreetmap) so I don't know why it's so slow even with chunk/batch. I guess I could ask on SO since it's been a while hmm
So the game is pulling in real data?
ah no, basically I used a package to download a specific tile of some map from openstreetmap (osmnx.readthedocs.io/en/stable), and then try to display it (not as image so I can draw path on top of it for different algorithm visualization).
I'm literally throwing this out. He develops a VRP library I follow but layered stuff like 3D rendering on top of OSM data
:o that looks good. did not find this when I searched
I did find this though (closer to what I was aiming for): github.com/Mostafa-ashraf19/CPP-PathFinding-withVisualization
19:20
But that just gives a vehicle route on a map? What does it have to do with pygame? (I can imagine a tab that shows a map with a supposed route for some in-game mission)
oh, it doesn't but I just wanted to find something that was close enough to what I wanted to do. So I could either 1. use it as it is, or 2. look at the code and trying to gain some inspiration from it for my own thing
Fair enough. In that case, I think those are the limits of my suggestions, sorry. I have no idea whether they can be reasonably translated into python proper
No worries. Thanks for your suggestions, I will ponder about this some more
 
1 hour later…
20:57
Hello everyone! Has everyone ever had a problem where you could import a library on a regular script (the library being installed on a venv and/or on your native python) but it gives a module not found on a Jupyter Notebook? I tried the notebook using the default setting and also using a venv. None worked
The library in question is chessdotcom (chesscom.readthedocs.io/en/latest). A wild guess is because it is installed with pip install chess.com but in the code it's imported as import chessdotcom, but I don't know, really
Would be lovely if someone tried to import on a notebook for me :) So I would know if the problem is on my setup
Either jupyter uses a different python interpreter (than the one you used to install the module) or the sys.path is different for some reason. Try looking at sys.executable and sys.path
Ooooor jupyter is so different from normal python that none of my knowledge applies ¯\_(ツ)_/¯

« first day (4742 days earlier)      last day (431 days later) »