« first day (3596 days earlier)      last day (1344 days later) » 
00:00 - 19:0019:00 - 23:00

12:03 AM
I think iced tea might have to be part of phase 2 of my observational trials :)
 
Can you even find that in your neck of the woods?
 
In a big-enough supermarket I think they stock a bit of it but I don't know people that really buy it. I feel like I've tried some in the last few years but that's a best-guess. My dad spent all his formative years in the US and I know he doesn't go looking for it
I think there's just a carousel of companies that try to launch it and it never works
Anywho, I best go to bed. I've rambled on for a while now. Fun chat, rbrb
 
12:35 AM
@CodyGray to be fair. Most of my family add "afternoon" in front of "tea" when they are talking about the meal (though I don't know if that's a regional thing - they are from the British North)
"Would you like to join us for afternoon tea?"
Versus "Would you like some tea?"
And all my Southern kin would have something to say about "Sweet Tea" too ;)
.... I'm currently having a Carolina Ice Tea (it's too hot for my favorite spiked tea - a hot toddy - but it's yummy :)
 
12:51 AM
@roganjosh Uhh... "supermarket"? Iced tea is the same as hot tea in unbrewed form...
So yeah, you can't not have it at the supermarket.
You literally just brew hot tea, and then add ice (or refrigerate it).
@LinkBerest Do you drink tea at "afternoon tea"? Or do you eat a meal? Still confusing.
@LinkBerest I assume you don't mean this one? :-p
Peach schnapps and Southern Comfort can't make tea...
There's no tea!
 
@CodyGray afternoon tea is a meal. Like a brunch for people who work nightshift
Sweet tea with Southern Comfort ... Ugh. Who would add schapps. peaches are not in season and I only use fresh peaches when I add them ;P
And a small hit of salt let's you use less sugar
 
Ah, well, the only other recipes I saw for "Carolina Ice Tea" were all talking about schnapps, vodka, and Southern Comfort.
@LinkBerest That seems odd.
 
Yep. But true
 
Even if true, I'm not sure what the advantage is.
Doc: "You're gaining too much weight. You need to reduce your sugar intake."
Patient: "Oh, good idea. I'll replace some of the sugar in my diet with salt, thus allowing me to use less sugar!"
Doc: "..."
 
Some people add baking soda instead of salt
 
1:06 AM
When brewing iced tea, I add 1/4 cup of sugar to a gallon of iced tea. Then I further dilute it half-and-half with water in the glass. So...not all that sweet.
Just enough tea flavor to make the water taste like something.
There are some restaurants where I order sweet tea, though, and there's probably more sugar in the glass than tea.
 
See they should have added baking soda :P
There's a company that made Carolina sweet tea vodka and now it's hard to find the original recipes (which is just tea + SoCo or other brandy + some fruit juice)
 
I've never been a fan of all that extra stuff in my tea, though.
I don't even like lemon.
Why ruin your delicious brandy with iced tea, and vice versa? :-)
 
iced tea is amazing
 
There we go! A supporter!
 
weird question but did sphinx suddenly stop generating commented stuff in your conf.py? I distinctly remember the last time I tried it and gave up, it had prompted for more questions and generated commented code.
now I'm trying it and it's smaller but I can't figure out if they changed it or I'm doing something wrong
also side rant but cool docs websites like flask and requests implement so much custom stuff on top of the default sphinx stuff I set out to create a ✨shiny✨ website for my project but will probably end up lifting code from them instead of doing it directly sigh
 
 
5 hours later…
6:02 AM
Binary search does not operate on linked lists. It operates on binary search trees, and a sorted array can be considered a binary search tree with the root in the middle, just like a heapified array considered a binary heap with the top in the first element... — Antti Haapala 55 secs ago
 
 
1 hour later…
7:24 AM
Hey all, I’m working with a large data frame and trying to establish a frequent pattern in email addresses, trying to root out people who come up with silly email addresses. I’ve looked at the longest common string, Levensthein distance, KMP and Rabin-Karl algorithms but they’re more designed for a substring in a string. Would anyone be willing to share some advice on how best to do this please?
At first for this I’m working with disposable
email addresses, try establish a pattern in that
 
I know a lot of people who genuinely use silly email addresses, so I'm not really sure what you are trying to achieve.
 
Just trying to root them out
Most fake/silly email addresses in my data can be traced back to fraud
Trying to widen my pool to find more people of that nature
By silly I mean keyboard mash, disposable, blatantly not a primary email
 
As a hunch, I'd go for a frequency analysis. I'd assume real addresses to contain less randomness than fake addresses. Whether that is significant or not depends on your data, of course.
 
user11702787
7:42 AM
just for understanding when I deploy a app to a cloud service are the enviroment variables also stored on that server ?
 
I am so noob with regex that I don't even know how to search properly
didn't need it much so far, but know wanna learn it
I am thinking about:
how to match two strings connected by a character which doesn't matter?
 
Thank you Mister
 
ie match AanythingC in ABCDE, I'd like to get ABC
 
@zabop Did you consult the documentation?
 
yeah, trying to find the relevant parts...
 
7:47 AM
@WiliamSnyder if by "environment variables" you mean "things that end up in os.environ", yes, they are part of your running program and thus on the server.
@zabop you are looking for "any character".
 
@MisterMiyagi thanks!
 
user11702787
@MisterMiyagi thx for clarification
 
@zabop If you want to get familiar with regular expressions, services such as regex101 are a good idea to use.
 
oh that's pretty good indeed! Was thinking ab sth similar but didn't find.
 
There's also pythex.org if you get good and then want to practice or just validate your regex in-general.
 
 
1 hour later…
@MisterMiyagi OP objects and you haven't replied. Is it still a dupe?
 
@AndrasDeak yes, I erroneously reverted my own hammering before consulting the docs. I just got fed up with their tangents afterwards.
Have to re-adjust my no-go list of topics to stay away from.
thanks
 
OK, OP's confused. More news at 6.
 
10:02 AM
Hello
Can anyone help me with this error (trying to install python-vlc)
C:\Users\Acer\Downloads\python-vlc-3.0.11115>python
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import vlc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Acer\Downloads\python-vlc-3.0.11115\vlc.py", line 210, in <module>
    dll, plugin_path  = find_lib()
  File "C:\Users\Acer\Downloads\python-vlc-3.0.11115\vlc.py", line 170, in find_lib
 
@ChrisP no
that error is Greek to me
something about monads at the end :P
 
Did you install the module or only download it?
 
both
I put path of libvlc.dll in windows enviroment variables.
Now i have other error.
 
I hope it's also Greek
 
OSError: [WinError 193] Το %1 δεν είναι έγκυρη εφαρμογή Win32K
 
10:12 AM
Yes!
I think the problem is egy mukkot sem értek a hibaüzenetből, mert nem beszélem az anyanyelved
 
Are you sure it was installed correctly? According to the docs it should just work
 
Are we really trying to help without addressing the elephant in the room?
 
@ChrisP please at least pretend to help people help you and translate the error.
 
Pff, i will just quit.
Because i am on vacations.
 
@ChrisP oh no
 
10:20 AM
The propose of the program would be basically for ubuntu users.
 
@ChrisP so am I
 
@ChrisP same here.
 
@AndrasDeak Nice!!! :)
 
it's actually a national holiday today
 
10:38 AM
Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] on win32

What means on win32 ?
 
It means your OS is Windows
 
11:30 AM
@ChrisP winerror 193 means the program is not a valid windows program
Want more help than that: MVCE and translate
 
12:02 PM
I solve the error: I reinstall vlc and then put libvlc.dll path in path enviroment variable.
That's i did at first, but now it's work.
 
12:20 PM
@AndrasDeak What holiday is it?
 
Complete with fireworks, sounds like July 4th in the states
 
Yeah, same thing.
 
@Dodge "do you celebrate July 4th in Hungary" - "Yes, our July 4th is in August"
 
I can't imagine what the US will be like when we celebrate 1000 years of existence
 
12:57 PM
> implying the US will exist for 1000 years
 
@Arne Doesn't seem probable at this point but if Hungary can do it so can we :)
 
to be fair humanity's outlook was a lot better 1000 years ago
 
TIL Hungary is a 1000 years old
I would have thought austro-hungary would have reset that clock?
 
Yeah, my assertion is completely wrong probably but they did have a king nearly a 1000 years ago
 
in legal terms Hungary is 8 years old...
@Dodge we occupied the Carpathian Basin nominally in 895, 1100 years ago
kingdom as of 1000 AD (but we got better)
 
1:12 PM
Hi ! I am having a rather basic issue that I am struggling with. I can't post my question to the site because it keeps saying my block of code needs to be fenced. I have tried everything to fence properly but it still errors out when I hit 'Submit'
(I am working on Python/Scrapy )
 
@MohammadTaksokhan does the question's preview look right?
 
I believe so, it places my block of code into the grey background.
 
Is it only complaining about bad formatting? It might also happen that there's too much code and too little text.
 
I see, Is it appropriate to post my question here?
 
No, I think you should post it (your exact question body) to a code paste service and link here. We can look at it to see if anything's off
we can probably figure out what's off and then you can ask on the main site (although after that you'll have to wait 2 days before asking about the same problem here as well)
I guess my "no" was unclear
 
1:20 PM
sorry
 
cabbage all. Anyone used the django api client with link header pagination? The requests package does a lovely job of exposing the links, but I can't find anything django-specific that does.
 
@holdenweb not aware of anything that does that off the top of my head
 
Weird - popular as RESTful interfaces are you'd have thought the Django ecosystem would have eaten that problem alive. I can't help feeling I must be missing something REALLY obvious!
If I patched the standard Django APIClient, however, I'd have to ask someone else to make a PR.
Subclassing seems to be a pragmatic solution to extending it.
 
1:39 PM
That seems to be the way from the Django RESTful example
Actually, nm, it's relying on a 3rd party library
 
Ooo... not had a MemoryError: Unable to allocate 296. MiB for an array with shape (127, 305204) and data type object before...
 
I've seen that on SO before. IIRC it was a bug on github
 
"data type object", nuff said
 
Just concatenating about 120 excel worksheets together...
 
Ah, nm, it was in some other package that threw the error of MBs not MiBs. I think it's probably a genuine issue in this case :P
 
1:55 PM
@JonClements use a list? :P
 
Well... they're in varying formats so want to take advantage of pd.concat and get auto alignment :)
 
Love it when the first email I lay eyes upon in the morning starts with "please do not panic".
Luckily I know exactly where my towel is
 
No bulldozer just idling outside your place is there?
6
Well... so just re-ran the concat and it worked fine this time... must have been a glitch in the matrix...
 
There's a truck from an aluminum siding company outside my neighbor's. I could lie down in front of it in protest, but I don't think it would accomplish much.
 
@JonClements maybe I wasn't imagining it then. What version of Pandas? It was a while back that I saw the error posted
 
2:04 PM
I think it probably helped closing a couple of instances of Chrome and shutting down redis that I don't know why's gone back to starting on boot - so looks like I was genuinely pushing memory limits... and for some reason I no longer have a swap file either so... some weird stuff going on here...
MemoryError: Unable to allocate 498. MiB for an array with shape (135, 483341) and data type object errr.... this is getting slightly worrying...
 
Reminds me of the old DOS games that say "error: game requires 28 KB of hard drive space, but you only have 35,593,962 KB available"
Lesson: use 4 bytes for your integers.
 
2:19 PM
...and... when you had to keep different boot disks to run things that required a different configuration for conventional, extended and expanded ram
 
 
2:32 PM
Lol
 
2:47 PM
@JonClements at least the number checks out
>>> np.empty((135, 483341), dtype=object).nbytes/1024**2
497.82588958740234
 
Well... just got another 20 sheets to add to it as well... this is fun... :p
 
Jon's most recent MemoryError is nearly twice as large as the previous one. If this trend continues, the amount of memory required will blot out the sun in eight hours
 
If I'd have known memory errors could causing blotting of the sun I'd have deliberately caused them as it was far too warm the last couple of weeks :p
 
Imagine that I am the bedraggled scientist at the beginning of a disaster movie that the president refuses to listen to because my documents are poorly organized
 
@Kevin I find that worryingly easy to imagine :)
 
If I have to experience an apocalypse, I'd like my final words to be "I told you so". Dying the way I lived: being unhelpfully correct.
Minus was an excellent webcomic, it's a shame that the author went dark and let the domain expire
 
@roganjosh Yeah, the code to access paginated sets in requests is a doddle because it populates the response's link attribute with a subset of {first, next, prev, last} URLs. But then you lose the APIClient convenience methods.
 
3:09 PM
I remember you saying:
Aug 14 at 16:05, by holdenweb
Link header pagination is the shiznit!
It's actually not something I've used before, and I only realised it was a thing when you mentioned it then. What kind of problem does this kind of pagination solve for you? I'm just curious
 
It's highly useful in RESTful data transfer, as it breaks potentially large responses up into manageable chunks thereby avoiding both over-long HTTP messages and sometimes extensive database contention problems. My preference for the link header mechanism is simply that being outside the envelope there is no need to change the structure of the envelope, avoiding a wrapping layer. I suppose.
 
I'll have to play with it a bit in Flask. For pagination, I think I store the position in the rendered template, so it's pretty far removed from a RESTful API, which I haven't really explored much
 
Interesting, I didn't know link headers were a thing. Looks useful.
"Why isn't this thing well-supported in popular libraries? I must be missing something obvious" is a very familiar feeling to me, and IME the answer is usually "the thing you want isn't as in-demand as you think it is"
 
It also saves you having to repeat any query parameters and change the page requested etc... as the system can also take advantage of caching the next page that would be retrieved if it's accessed rather than re-querying...
 
If 90% of Django users are too clueless to implement pagination, and 90% of the remainder don't know about pagination best practices, and 90% of the remainder know about pagination best practices but don't bother with them, this may explain the lack of support
 
3:22 PM
(in fact... shopify switched to that method and removed their existing pagination methods)
 
@Kevin mmm, maybe. But pagination isn't so much about the developer and more about the user experience, no? The end user of the site probably doesn't care how it's implemented but, if it helped with their experience of the site, you'd assume the library would support it for people who knew how to implement it
Or maybe the biggest beneficiary of pagination is the developer, not the end user, to stop gigantic queries running. My totally unsubstantiated gut feeling is that that's not the case, though
 
Yeah, one problem with my explanation is that even if most developers don't care about best practices, the Django devs should care about them, and provide a way to use them regardless of how many of their users never discover it exists
Now I'm leaning towards "link header pagination is a honking great idea, but it's not widespread enough to be a best practice". We can't get mad at the Django devs for not including all honking great ideas in their framework.
 
And both Django and Flask (via SQLA) supports pagination. I guess it just boils down to why the link header pagination method isn't explicitly supported by Django. In which case, your original statement/anecdote is correct :)
 
it has a bit of that.... it's also called "cursor based pagination" instead of "page based"... So normally you'd make a request along the lines of ?page=1, then ?page=2, ?page=3 etc... (along with other params needed) and then you'd have to check either in meta data of the response that the page you're on wasn't the last one, or if the api didn't return that, then maybe check if the data payload in the response wasn't empty, or maybe check if you got an HTTP 204
 
Incidentally I stumbled upon djangorestframework-link-header-pagination which may or may not be useful towards @holdenweb's goals
Unclear to me whether this can be used in the specific "api client" context that we're playing in
 
3:34 PM
with cursor based... if there's more data - you request the link in the header... if there isn't more data then the link isn't in the header... makes "paging" through large amounts of data much more convenient (and as said before - enables the server to pre-cache a response of the next page on the assumption you're going to be requesting it)
 
It bothers me that Github's guidelines for link header pagination advise you to only rely on first/next/previous/last rels, and not try to guess the format of the request. What if I'm on page 1 and the last page is 200 and I want to jump to 100? I'll have to shlep through O(N) requests!
 
I suppose it depends how you see RESTful systems. If you see applications as data-driven DOM renderers (which they increasingly are) then pagination is desirable because it reduces and dissipates data load.
@Kevin Well you could follow the "last" link and then go backwards down the "prev"s :-P
 
Alternatively I could do url.replace("200", "100"), and be done in O(1) time, with a mere 15% chance that the url becomes hopelessly mangled because there was a number somewhere other than the argument list
 
@Kevin a lot of apis probably support an "offset" argument... so if you know the page size is 100 (or whatever) you can ask for an offset of 1000 to start on page 10
 
But pagination isn't for random access - there are already suitable mechanisms for that. It's for application-layer chunking.
 
3:39 PM
True :-)
I actually did something a lot like this the other month, when I wrote a search function for a site that provided paginated data
 
For rapidly-moving datasets, cursor pagination reliably shows all entries when other methods might not if the query set gets modified between pages, but none of that applies to the work I'm currently noodling with.
 
@holdenweb I've tried passing pagination off to dataTables on the front-end before. It's kinda fun; people talk of "FOUC" but if you pass 1000 rows of 60 columns, it's more like watching a zombie burst from a grave and slowly haul itself out. Great user experience :P
 
I'm sure the site appreciates that my crawler only performs O(log(N)) requests as it binary searches for the title I desire
 
How nice, my working week is over.
 
@roganjosh what a dramatic image :)
 
3:43 PM
Time for a walk. Rhubarb, all.
 
I never managed to get to grips with its AJAX API. I had a choice between "immediate need for implementation" and doing the right thing. It's an internal tool - they'll forever live with the former :P
 
They'd probably appreciate it more if I signed up in order to use their members-only search feature, but I don't want The Man getting any more of my data than they already have
 
@JonClements The modern-day Thriller :P
 
Wow... haven't seen that music vid. in ages...
 
If you want to form a comprehensive image of my consumer habits, you'll have to perform the trivially difficult step of deriving my identity from my ip address, just like every other service. It's about the principle of the thing.
 
3:45 PM
@JonClements It's dated. It needs more dataTables.
 
I was contemplating making sure a Scavenging Ooze was on the battle field :)
 
Scooze is best practice for eliminating zombie processes and lingering cache spirits and other such undead
 
It's probably easier to add that as an animation squishing its way around the screen as a loading animation while dataTables does its thing in the background, than figure out how to fix the ajax
And more fun :)
 
@Kevin actually put together the other week a semi-okay mono green deck... a few oozes, pelt collectors, an ozoloth, vivien and that other planeswalker for counters, lots of cards that put counters on things, all the Hydra's Growth, and some ram throughs... surprised it actually did as well as it did - guess people just don't expect to see mono green much
 
Whenever I do a binary search on alphabetically sorted string data, I always intend to refactor it into a base-26ish search, taking advantage of the fact that English text has a fairly even distribution of letters and spaces, but I never get around to actually implementing it
I bet this kind of "radix search" is relatively simple, and a pre-existing recipe might even exist online, but it's hard to muster enough enthusiasm for optimizing a O(log(N,2)) solution to a O(log(N, 27)) one
@JonClements Sounds a bit like the mono green historic deck that was recently tested out my Notable Internet Person SaffronOlive
 
3:58 PM
The combo of nissa and hydras growth is nice... make a land a creature with +3 counters on it, hydra growth it, it's got vigilance and haste, attack face, next turn you've got an 8/8 land...
if you can do that at the same time as a questing beast... which is reasonably okay with nissa as you get double mana for each forest you tap... so you can normally play quite aggressively for green
 
Personally I recently brewed up a "big green +1 counters" Commander deck, led by Selvala, Heart of the Wilds
 
Ahh... that deck's similar - the pelt, ooze and vivien's are the same, but went with questing beasts, nissa and the ozolith - was thinking about a Karn and a mini sideboard of artifacts... graffdiggers cage is always handy - keep stuff in graveyards so ooze can eat em :)
 
The card I'm most fond of is Heroes' Bane, which can turn N mana into 4 * (2 ^ ((N-1)/4)) mana, possibly multiple times in one turn if you've got any untap effects
From 9 to 32 to 8192 to ~2^2000... Love me some exponentiation
 
oooo nice... would be easy to with untap/nissa to pump that ability a few times and use something like a ram through or possibly fling and that'd be game
oh... would need to get trample for ram through to work convincingly though
 
I can get trample fairly reliably with Kamahl, Fist of Krosa. Good for pushing through chump blockers, and it can also discourage your opponents from playing board wipes if you leave up enough mana to turn all of their lands into creatures in response
Although in practice my group has a gentleman's agreement to not destroy a gratuitous amount of lands all at once, so I usually end up just picking off particularly annoying ones like Mystifying Maze or Wasteland
 
4:14 PM
is the main reason to prefer pathlib over os the fact that pathlib is lighter than importing whole of os?
 
@aadibajpai not really - it's object orientated and just far more pleasant to use
 
Agreed
 
@Kevin removing basic lands I find is a little below the belt... although stuff like castles seem more fair game to me
(and things like Blood Moon while not removing lands - can really irritate someone's mana base...)
 
Yeah, indiscriminate land destruction is traditionally something that you hold off on unless you get explicit buy-in from your group on
I'm on the fence about Blood Moon, because it tends to harm players proportionately with the amount of money they spend on their mana base. Robbing from the rich and giving to the poor, as it were
If you're playing with basics and terramorphic expanses and rampant growths, then you make out better than mr moneybags with his $500 playset of ravnica fetches and pain lands
 
@JonClements do you mean the os thing where u need to call functions inside of functions versus chaining in pathlib?
 
4:21 PM
fabled passage and triomes are quite big at the moment, as well as the two colour scry/shock/life gain lands
@aadibajpai that's certainly convenient at times... but there's also lots of handy functions to rename extensions or get the name/stem etc...
 
I see, I've been using os all along but recently noticed everyone recommending pathlib
 
As a mono green deck, you should cheer when your opponent plays Blood Moon, because he wasted a card slot on an enchantment that barely does anything to you :-)
 
yeah... I wouldn't be happy if I was playing a two colour deck with dual land cards though and one of my colours wasn't red :p
 
I hear you there. Blood Moon is infamous for its ability to crush the spirits of players.
To the super competitive pro types, I advise them to suck it up and better design their decks to handle a Blood Moon heavy meta. Everybody else should sit down with their group and hash out their policy on power levels and fun-killers
 
aggro-red and embercleaves is slowly falling out of fashion which is good... they're just horrible... unless you've got a deck geared towards it, in which case, it's strangely satisfying just smashing things down...
 
4:36 PM
I never did get the hang of mono red... I like decks with enough gas to kill a player even if they started at 40 life instead of 20
 
control decks are definitely more fun for sure...
 
Mono red is like in cartoons when a person driving a car encounters a series of mishaps that gradually strips away parts of their vehicle until they finally arrive at their destination perched atop a single squeaky wheel
 
played properly they can normally win (or so close to it it doesn't matter) in 4 turns though
 
If you play out your entire hand and your opponent is more than one lightning bolt away from dying, your best strategy is to say your prayers
 
oh yeah... it's a kamikaze approach but its success rate is strangely high
 
4:41 PM
No doubt. Regardless of my personal tastes, it's an essential part of any meta in order to curtail everybody trying to durdle around for ten turns setting up their ultimate engine of doom
naughty Johnny Combo Player must be punished with eight damage on turn two
 
at least Teferi, Time Raveler is banned in formats now... that's one of those cards that just broke things
 
I've heard many horror stories about him. And Oko before him. WOTC keeps saying "We've learned our lesson, and surely this 3 cmc walker will be strong but not format warping"
 
When writing a unit test for something that has many parameters, like a test that validates the creation of a point-in-time sensor reading object in a database (dajngo REST), is it reasonable to have an adjacent text file to the test.py file to read in mock sensor data. Or should i just write all of that into the test?
 
5:01 PM
@Kevin this looks like an interesting way to play blue though: youtube.com/watch?v=3r6bGo_o7Yg
 
5:21 PM
Is there canon for this? I'm a bit stumped on what to search to get at it
Maybe this? I don't think it's a good fit. It feels like there should be a dupe, and I'm also not sure I'm the best to give a definitive answer if there isn't one :(
 
umm... yeah... don't think so... they really don't want to be deliberately accessing a function inside a function...
they also don't even want to be taking the approach they are in general anyway... quite a few bits odd with that
 
Perhaps there's too much going on then. Scrapping the web is one thing just layered on top of bad design. I don't feel satisfied on behalf of the OP, though, to leave it at that :( Ugh, stupid empathy
 
5:48 PM
stackoverflow.com/q/63506714/4799172 needs more detail. I'm quite baffled by that one, actually
 
plus the unclosed string :)
 
I don't wanna bump it by editing at this point because the latest comment is baffling me :P
"I buried treasure in next door's garden and can't seem to dig it up again in my own back yard" (paraphrased). I bet physicists are to blame somewhere here
 
@JonClements Gadwick's fun. I played him in a deck with Verity Circle, plus a bunch of Opt-esque instants to keep the board locked up until I could win with Jace.
 
I was wondering why appdirs would use such a complicated approach like github.com/ActiveState/appdirs/blob/master/appdirs.py#L462-L483 instead of simply doing stackoverflow.com/a/13184486/9044659?
backward compatibility?
 
what the heck - it's 7pm already? Should probably eat something... rbrb for a bit
(I'm sure it was 1pm half hour ago...)
 
6:04 PM
More evidence of physicist intervention <jots down notes>
 
deja vu moment I was like where have I seen Jon and it was literally the answer I linked
 
I found a function like fib = lambda n:n if n < 2 else fib(n-1)+fib(n-2) and it works for smaller numbers. When i try print(fib(55)), it takes like 1min + for showing output
 
@CoolCloud did you edit that on purpose? You can also delete chat messages
@CoolCloud nevermind, that answers my question :P
 
@AndrasDeak lol :p
 
@CoolCloud start writing out on paper what happens when you call fib(55). It's a lot of function calls at the end
 
6:07 PM
@aadibajpai according to docs.microsoft.com/en-us/windows/win32/shell/csidl#remarks, CSIDL values supersede environment variables as the "right" way to get special folder locations
 
Do you have a question related to that fibonacci code?
 
@AndrasDeak oh actually its true, but the number at the end is not that of a big number either
@Aran-Fey My question was related to the fibonacci sequence doe :p
 
@Kevin looks like it's deprecated Vista stuff, appdirs is probably using it for legacy reasons (codebase 10y old)
 
It doesn't go into detail about what happens if you continue using environment variables anyway. I'm betting on "it will still work... For now"
 
I'm not aware of a question, but alright
 
6:09 PM
@CoolCloud was it?
 
for practical purposes, the env variable would be fine I am assuming, since that answer is also eight years old
 
@AndrasDeak was it what??
 
Was it related to the Fibonacci sequence?
 
@CoolCloud A question. You haven't actually asked anything, just made a statement
 
needs more crystal balls ;)
 
6:12 PM
@roganjosh MY BAD😂, I meant to ask why was that happening
@AndrasDeak yep
 
Implement it iteratively with for _ in range(55) and see how fast that is
 
Think about it this way: the function calculates the answer by adding together smaller terms. The only terms that don't recurse are 0 and 1. So in order to return, say, 6765, it has to first add 1 and 1 and 1 and 1 and... etc, until it adds up to 6765. That requires at least 6765 function calls, and in practice substantially more
 
@AndrasDeak bro chill, my knowledge in python is less, explainn😂
 
yeah, looks like it's legacy because docs.microsoft.com/en-us/windows/deployment/usmt/… contains APPDATA so I should be good
 
@Kevin makes sense, thats hell lot of functions, anyway to make it fastrer?
 
6:16 PM
@CoolCloud I'm as cool as a cucumber
 
look into memoization
 
>>> class CallCounter:
...     def __init__(self):
...         self.calls = 0
...
...     def __call__(self, n):
...         """Do worst Fibonacci ever"""
...         self.calls += 1
...         return n if n < 2 else self(n - 1) + self(n - 2)
...
... fibber = CallCounter()
... fibber(20)
... print(fibber.calls)
21891
I was waiting for the n=55 case to run but I gave up waiting.
 
lol 😂
 
@CoolCloud The easiest way is to not use recursion.
 
@CoolCloud see if those 22k function calls are in line with what you expect for n=20
 
6:17 PM
ill actually find a way and be back, cause basically ik a bigger way, but one-liners are simple. well nvm😂
 
@CoolCloud sounds like an important lesson you just learned
 
@AndrasDeak duh ;)
 
You can also use functools.lru_cache, but that requires you to know how to employ decorators, or at least have a moderate understanding of functional programming
 
does that memoize calls?
 
@aadibajpai look at the docs link
 
6:19 PM
yes I didn't realize it was a hyperlink oops
 
Sorry, it took me a couple revisions before that message was coherent :-)
 
if it weren't a hyperlink you could plug it in google with site:docs.python.org
 
@Kevin hmmm i see, ill take a look at that
 
@CoolCloud take the time and implement the sequence with a dumb loop, as you would do on paper.
 
ah true, this is a nice discovery. I was working on cp problems in python once and implemented this by hand even when standard library was allowed
 
6:22 PM
Ha, I just noticed lru_cache's documentation uses fibonacci as an example :-P
Spoiler warning I guess
I remember the pre-3.2 days when lru_cache didn't exist and I had to write a memoizer manually. I didn't mind too much, it was like a coding kata
 
Hey there people. I am getting an error which is really confusing. I have this code and error:
pull_up_down=int(self._pud_mapping[PUD_UP]))
TypeError: an integer is required (got type str)
When I have clearly called the int function on it...
 
I don't see anything obviously wrong with that specific line of code.
[Insert obligatory request for MCVE here]
In the meantime, what are the types of the PUD_UP object and the _pud_mapping object?
 
crystal ball says _pud_mapping is a list and PUD_UP is a string
 
I think you are talking about this
    self._pud_mapping = { PUD_OFF:  bbio_gpio.PUD_OFF,
                          PUD_DOWN: bbio_gpio.PUD_DOWN,
                          PUD_UP:   bbio_gpio.PUD_UP }
Here is the whole line of code:
    self.bbio_gpio.setup(str(pin), str(self._dir_mapping[mode]),
                        pull_up_down=int(self._pud_mapping[PUD_UP]))
 
@Kevin Isn't that the median?
 
6:30 PM
The problem might be with one of the other arguments to setup. Python's error reporting system is sometimes off by a line.
 
There should also be a traceback showing where the error is coming from, giving context
 
@holdenweb To the best of my understanding, yes.
 
Trust Americans to com up with an unnecessarilty complex replacement for a simple phrase.
 
@Kevin, Okay. Let me have a look at the docs for the function I am calling. By the way, this is an adafruit library I am trying to fix! ;D
Well that error has been corrected with this:
 
adafruit-beaglebone-io-python.readthedocs.io/en/latest/… looks relevant. Apparently the second argument should be an int.
 
6:34 PM
    self.bbio_gpio.setup(str(pin), int(self._dir_mapping[mode]),
                        pull_up_down=int(self._pud_mapping[PUD_UP]))
 
@Linux4Life531 No you didn't. You called int outside of the function call.
 
But I am now getting this:
File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/GPIO.py", line 278, in setup
pull_up_down=int(self._pud_mapping[PUD_UP]))
SystemError: <built-in function setup> returned NULL without setting an error
@roganjosh, I don't understand
 
Hmm. Maybe setup doesn't understand the arguments you passed to it. What is the value of pin?
 
How about this ```first = 0
second = 1
print('The fibonacci sequence starting from 0 is:- ')
print(first)
print(second)
for a in range(0,15):
third = first + second
print(third)
first,second = second,third
```
 
It is part of a bigger function
def setup(self, pin, mode, pull_up_down=PUD_OFF):
    """Set the input or output mode for a specified pin.  Mode should be
    either OUTPUT or INPUT.
    """
    self.bbio_gpio.setup(str(pin), int(self._dir_mapping[mode]),
                        pull_up_down=int(self._pud_mapping[PUD_UP]))
 
6:36 PM
@Linux4Life531 pull_up_down=int(self._pud_mapping[PUD_UP])) is just an assignment to a name. anything_here = int(anything_else_here) can't throw TypeError: an integer is required (got type str). There's detail missing
 
@Linux4Life531 You are complicating your life needlessly by trying to debug a complex statement, when splitting it into multiple statements will give you a much clearer idea what is going wrong. Get the code working first, then refactor for beauty (or whatever other criteria you choose).
 
@roganjosh. Oh, okay. I think the error was because of python looking at the wrong line
 
@roganjosh True. The missing context is that it's the second half of a function call.
@CoolCloud Yes, that should be substantially faster than the recursive version.
 
is there an equivalent of os.path.expandvars in pathlib? I cannot find it in their comparison table docs.python.org/3/library/… but I just want some way to do os.path.expandvars('%LOCALAPPDATA%') in Path
 
Also refer to sopython.com/wiki/… if you're curious about why the chat room mangled your indentation
TLDR: the markup engine is even pickier in here than it is on the main site
 
6:39 PM
@holdenweb, Thanks. I did not write the code originally like this, I am just trying to fix a bug in it.
 
Well simplifying it will certainly help you understand in better. You are excused!
 
@holdenweb, LOL. Thanks
For anybody instrested, here is the github file link: github.com/adafruit/Adafruit_Python_GPIO/blob/master/…
 
yes just found this bugs.python.org/issue21301 :(
I'm not sure what's the intended way for windows then, I can pass os.getenv to Path but I was trying to use pathlib as a replacement for os.path
 
@Linux4Life531, can you provide a complete stack trace? In other words, everything from "Traceback (most recent call last):" down to the error message
 
6:46 PM
Here:
Traceback (most recent call last):
  File "/home/pi/computerProjects/electronics/lcdTest/Adafruit_Python_CharLCD/examples/char_lcd.py", line 36, in <module>
    lcd_columns, lcd_rows)
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_CharLCD-1.1.1-py3.7.egg/Adafruit_CharLCD/Adafruit_CharLCD.py", line 152, in __init__
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/GPIO.py", line 278, in setup
    pull_up_down=int(self._pud_mapping[PUD_UP]))
SystemError: <built-in function setup> returned NULL without setting an error
 
Ok, thanks
 
So I called this in my char_lcd.py:
lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7,
                           lcd_columns, lcd_rows)
 
@Kevin ha this was given from the school, smh
 
And when I ctrl+click on Adafruit_CharLCD it gives me:
I am focusing on:
    for pin in (rs, en, d4, d5, d6, d7):
        gpio.setup(int(pin), str(GPIO.OUT))
 
6:48 PM
 
Let's not post gigantic walls, please @Linux4Life531. But I'm starting to see what the issue is. Let us mull it over
 
a hack might be to use Path.home() and add AppData to it myself if windows
 
@CoolCloud, Yes, I am I high school student however this is way to advanced for my year. But I love cs so I do it in my own time. @roganjosh, Okay, sorry. What should I do with it now.
@Kevin, Yup
 
@CoolCloud in case you missed Kevin's nudge in the commotion: please see our code formatting guide to chat and practice in the sandbox before posting another code block here
 
@Linux4Life531 We have room rules that suggest how you can post the code off-site and post a link to it here
 
6:51 PM
@roganjosh, It yes, I should have put the github link. Sorry... ;(
 
I notice that github.com/adafruit/Adafruit_Python_GPIO is deprecated, and CharLCD seems to depend on it... Might be part of the problem
 
@Kevin, Yes. I am struggling navigating around all of adarfuit's modules and I just followed my tutorial.
 
@Linux4Life531 It might just be me, but I'm struggling to catch up on the issue because there's a few concurrent convos. It might be best just to give people a breather (I don't think you've done anything particularly wrong in posting, but we have to get our head around things that might be very familiar to you :) )
 
@Linux4Life531 also please use the edit/delete features in chat rather than posting a single ping and nothing else in a message
 
@AndrasDeak, Sorry, I clicked enter by accident.
@roganjosh, Sorry. I will give you a break. :D
 
6:55 PM
It's a tricky problem because it threads through a lot of third-party libraries. I appreciate the links to the github pages though -- usually we have to pry that sort of information out of the asker with a crowbar
 
00:00 - 19:0019:00 - 23:00

« first day (3596 days earlier)      last day (1344 days later) »