« first day (3840 days earlier)      last day (1101 days later) » 

1:03 AM
cbg :D
 
 
3 hours later…
4:09 AM
are there anybody online right now?
 
Hi, @baozilaji
 
4:59 AM
Visited 1611 days, 2 consecutive
RIP my consecutivity(?)
 
@cs95 well... you've already got the "Fanatic" badge so... :p
 
former fanatic here, haha
 
5:37 AM
wow just came back to see... 16 upvotes on this answer: i.stack.imgur.com/pbN8V.png going viral somewhere?
 
@cs95 half way down the latest blog: stackoverflow.blog/2021/04/19/…
With a post score of 3,497 and 11,829 copies, I am happy to announce that How to iterate over rows in a DataFrame in Pandas received the most copies. Answered in 2013, this question continues to help thousands of people each week.
 
Ooooh
good catch thanks for that!
nice to see i'm outpacing the accepted answer lol
 
@cs95 one of yours I missed /gasp
 
 
1 hour later…
6:55 AM
Hi everyone, can I ask a question related to specific use case of feature engineering here? If not , please direct me to the appropriate channel
 
7:42 AM
PEP 563 delayed until 3.11, it is announced today. "In the Steering Council’s unanimous opinion, rolling back the default flip for stringified annotations in Python 3.10 is the least disruptive of all the options"
PEP 469 similarly deferrred.
@AndrasDeak Except that it could be used to control browser Java applets.
 
@holdenweb finished the 4th edition yet? You've had a week and a bit :p
 
Still trying to assemble the team ... had one volunteer who's gone quiet (unless I forgot to hit "send' ... [checks]). Scratch that - there's an email still in draft.
 
ahh... glad to know I've contributed in a way :p
 
raf
@Kevin I checked it. But I didn't understand how to apply it to my streamlit app.
 
7:58 AM
@holdenweb Good to know. Stumbled on some of those issues, but didn't know it had that much of an impact.
 
There has been outcry in various places where annotations have been used more broadly than the SC anticipated, I believe, pydantic not least among them. So now we need something like pragmas to explain what annotations are supposed to mean. Or something ...
 
Sounds tricky. I wonder if they consider to backpedal and just take quoting to mean "delayed evaluation".
 
Not that simple ... there are many issues to struggle with, but there are hopes of a resolution. Personally I feel the whole effort shows a poor sense of priorities in the development of the language, but that's the whole nature of open source.
 
8:17 AM
Just realized I had completely forgotten about PEP 649. D:
 
8:37 AM
Anybody used protobuff msgs and know about their efficency? I have a msg which has an enum in it with 20 values. I need 4 of those. Also that msg besides having an enum in it has 10 optional fields. Now if I only fill this one field, I would assume it won't waste extra space for the other fields? Or would it make more sense to create another smaller message
 
8:57 AM
Ello ello, been a while since i've been in here, nice to see some of the same faces. :)
 
@Withnail howdy - how goes things?
 
Hey Jon :) All good on this end, been working in the infra/platform space for the last little bit so doing less python day-to-day, but it's good despite that. Up to my neck in pods and containers, how're things with you?
 
same old... 'fraid not much interesting to report... (boring ol' me)
 
Given the current state of gestures vaguely, I feel like nothing to report is probably A Very Good Thing all in all
 
oh... I haven't been outside in ages... is something happening? :p
 
9:17 AM
I don't undertand where I went wrong
P.S the function i created was in Aggregating_Functions.py
They are all in the same directory
 
did you do the 101 "have you tried turning it off and on again" step?
basically, restart your notebook kernel
 
I did. that still didnt help
i was wondering if there was a problem with the name?
 
okay, then the next 101, did you verify that you actually saved the function in the Aggregating_Functions.py file? and then the next 101, the file where youre writing code, you're sure its the correct path? don't assume, double check.
 
oh wait.. lol, this time i restarted anaconda as well, not just exit and relaunch jupyter
that was wierd
thanks mate
 
np. 101 to the rescue!
 
9:25 AM
i dont understand why it is like that
 
Someone will mention this at some point - but your file/module names should be lower_case_with_underscores, no caps - python.org/dev/peps/pep-0008/#package-and-module-names
 
if you're asking why "i closed the browser tab that had jupyter notebook in it and it didn't do anything" well, you're right, closing the browser tab doesnt do anything.
 
noted
 
You also don't need to double import like you are there (to make your life simpler) :)
 
you have to explicitly kill the kernel by restarting it, and honestly notebooks are annoying sometimes. that's all i can say there
 
9:31 AM
one small thing, if i want to create a set of conditions that I want to be able to input into a function what is the best way to go about it?
I have done it this way, but got some errors:
def aggregating_kt_hourly(df, severly_overcast_condition, overcast_condition, cloudless_condition, mostly_cloudless_condition):
data_file = df
kt_hourly = pd.DataFrame()
kt_hourly['kt_mean'] = data_file.groupby(pd.Grouper(key='Datetime',freq='H'))['clearness_index'].mean()
kt_hourly['kt_var'] = data_file.groupby(pd.Grouper(key='Datetime',freq='H'))['kt_var'].mean()
 
odd, usually you don't actually want to give conditions, but rather pass thresholds. conditions should be treated as part of the logic, and thresholds can be adjusted.
so instead of trying to coerce python to accept logic in the functions, why dont you simply pass the thresholds and write the conditions inside the function body as usual
 
@cmk101010 Can you please take a look at the code formatting guide? Suche huge code blocks without proper formatting are quite annoying.
 
better yet, make a new function that simply takes the column and returns it's status. be it overcast, cloudy, etc
 
@MisterMiyagi, I highlighted the code and pressed ctrl+k... and it indented inside the chat box and same when I tried to re edit the post
 
cant mix code and text here
 
9:36 AM
I guess i'll just ask them to enter the function and manually make the thresholds :)
 
i was thinking the exact opposite but okay.
 
@cmk101010 The guide also has some things to say about large code blocks. Hint: If there's a scroll bar, the code is too large for chat.
 
hello
sorry cbg
 
Hi there
 
whats up
 
10:00 AM
Not much. Trying to work through getting some recent publication on parsing to something that can be used in practice.
 
that's pretty interesting
 
 
2 hours later…
11:53 AM
hey guys does pandas have a method to essentially do this
for i in range(len(valencia.columns)):
    if valencia.columns[i] not in final:
        valencia.drop(valencia.columns[i], inplace=True, axis=1)
 
if final only contains valid column names then something like valencia = valencia.loc[:, columns] might work, give or take lack of mutation
 
hmmm i went for this
for i in reversed(range(len(valencia.columns))):
    if valencia.columns[i] not in final:
        valencia.drop(valencia.columns[i], inplace=True, axis=1)
which works but feel it could be better designed
 
reversed(range(len(valencia.columns))) you can just use range with step -1 I guess range(len(valencia.columns)-1, -1, -1)
 
why drop them one by one? if final contains the correct column names, you could either just select them using final..
valencia[final]
or if you really need to do an inplace drop for some reason, just construct the list of columns to drop and drop them all in one go.
cols_to_drop = [col for col in valencia.columns if col not in final]
valencia.drop(cols_to_drop , inplace=True, axis=1) # untested.
 
bah, yeah, I meant final when I wrote columns, sorry
 
12:09 PM
essentially I am formatting loads of different dataframes to look the same thus droping that which is not needed after renaming the columns needed and then inputing that which they do not have as none the solution i am following is import, rename, drop, add, save
not sure if this is the most efficient but is the first time working with this
 
ah okay, then you dont really need to drop per se. remember, that for every operation where you "remove what you dont need", you can usually also achieve the same result by doing a "keep what you need" operation.
Often, the latter is just simpler and painless, though sometimes you need to distinguish between the two approaches (say, memory concerns)
if final is a superset of the columns you wanted to keep instead, then you can also always calculate a cols_to_keep list with a similar idea
 
@ParitoshSingh or if you have multiple references to the dataframe, say, by wanting to mutate it in a function
 
hmmm so essentially doing valencia[final]
 
@Kwsswart :|
 
is the same
 
12:13 PM
@Kwsswart why do you keep posting that?
 
sorry busy asking if that and valencia[final] work the same
 
You know how to link to a message in chat, yes? Please use it.
 
@AndrasDeak yep, good shout. that's probably the real worst case scenario
 
will do Andraw sorry
 
@Kwsswart we've both told you that it gives you the same resulting dataframe without mutating the original one. If you don't know what this means I can give you a link to python's name binding rules.
And you can run the code and see what it does.
 
12:17 PM
thank you appreciate the information, Thus if understood correctly the one that Paritosh suggested would be the better option
 
Better than what? And he suggested two things.
 
essentially using the keep whats needed approach is better than remove what isnt needed
 
no
The keep what's needed approach is simpler than remove what isn't needed. But the bottom line is whether you want to mutate your original dataframe or not.
 
oh I understand now thank you for clarifying
 
@MisterMiyagi "recent publication on parsing", sounds interesting. What would that even look like? Care to share a citation?
 
12:24 PM
@Dodge where could i view it
 
@Kwsswart The paper that Miyagi referenced? Not sure. I can see any pub through my university library online portal.
 
^Kevin'd :P
 
Thanks for that
 
does something like "install python in one computer, use in all computers in the network" exist?
I am looking for a last resort before I finally give in and download C++ build tools on Windows for some packages that need it
 
12:31 PM
Provided that the systems are binary compatible, you can share libraries across nodes just fine. Some network file system would be sufficient.
That's assuming the libraries are self-contained. If you need e.g. a shared library as dependency, that one might need installing/sharing as well.
 
Does anyone know of a good scrapy tutorial that's better than the docs?
 
@MisterMiyagi what I expect form such a setup is, having to pip install only on one laptop then use that across other laptops, so python related stuff goes in one laptop, I dont really care about doing remote manage
@CupOfJava this is / was popular in my friend groups scrapingclub.com
 
@python_user My general recommendation is that if you can do it properly, you should do it properly.
Running the pip install etc. once on each box is likely much less of a headache than worrying about getting the setup right and keeping it running.
 
^python_user thank you
 
that makes sense, I am just not willing to download C++ build tools for 2 or 3 GB, guess the time has come
 
12:37 PM
Especially if we are talking laptops, you have to worry about availability when not all of them are switched on.
 
I wonder if it's possible to put a python install on a network shared drive. No comment on whether it's a good idea.
 
this is just for my ease of use, so its not work related or anything, I will just try something, just have numpy installed and see if I can access that
 
Authoritarian simplest solution: wipe all computers' local drives every morning, and restore from a single master image, which has Python installed on it
 
@CupOfJava I have not used it personally and that is more teach by solving oriented, not sure if that is your thing
 
^python_user I just find the documentation less than helpful and was looking for other suggestions, I appreciate the resource
 
12:56 PM
morning cabbages, folks
 
1:38 PM
cbg :)
 
@python_user will "install on one computer, use on that one computer but connect to it from any computer on network" work for you? that would essentially be similar to like how we connect to a sever, or ssh to a server perhaps.
 
What's the C++ build tool you need? Sounds like a usecase for docker, tbh. Build the image and install whatever you need with the build tools then discard the big download, use that image from then on - multi-stage build.
 
Linux often comes with gcc :P
 
Bah, I hoped I'd be able to circumvent some steps in my screen scraping project by fetching text elements using Window's accessibility API. But when I use the built-in screen reader on the window I care about, it basically just says, "this is a window".
 
C++ build tools is basically the "ah shiet, i wanted to use that package, why can't life be simple, i hate IT" type of deal that every windows user has to go through
 
1:51 PM
Maybe I can threaten to cancel the dev on twitter if he doesn't drop everything and implement text accessibility
 
@Kevin i mean.. it's not wrong
 
@ParitoshSingh pretty much but I need to be able to use that in IDE, maybe sublime has a package
 
@python_user as long as you dont mind that the python code is running on this one machine, just ssh to it
 
@Kevin could be worse. could have been DOS.
 
you can connect IDEs over SSH, with perhaps a little bit of lag involved
 
1:53 PM
That just XYs the problem from "how do I put python on all computers" to "how do I put an SSH client on all computers" ;-)
 
@Withnail when I do pip install aiohttp[speedups] for a package called brotlipy it keeps throwing some C++ error, SO searches suggest it is needed on windows
 
windows now comes with ssh client :D
took them a while to jump on the bandwagon but we're here now!
i assume all common* linux distros have ssh
that leaves macs, which i know nothing of
 
Oh, nice. I was stuck using puTTY (or something similar) the last time I needed SSH
 
oh yeah, i actually remember having to use that a while back. there was another one called mobaxterm or something similar that worked great too at the time.
 
@python_user some error messages are more helpful than others. Some will tell you "you need visual c++ 14 or newer". Are you sure the error is unhelpful?
 
1:55 PM
but yeah, i dont know when exactly they did the switch, but windows 10 systems come with ssh now
 
@ParitoshSingh on MacOS, It Just Works
 
ah perfect, looks like it's ssh clients for everyone
 
Google says Windows introduced it in 2015
 
believeeeee that you just need the VCC++ compiler, not the full build tools.
(but again, you can cheat here and use docker to install the compiler and use that image ;) )
 
oh actually good shout...C++ build tools shouldn't be a 2-3 gb install. I mean, it's called build tools but its not that big, right?
 
1:57 PM
@AndrasDeak the error was indeed helpful like I said I did not want to spend my limited internet on that
 
OK
sorry, I always just forget that limited internet is a thing
 
maybe I will give docker a try after all, and @ParitoshSingh stackoverflow.com/a/54136652/12502959 all this is needed and that SDK thing eats up space
 
doesn't docker need the same download plus more?
 
does it though? I assumed there must be some bare minimum image
 
If you mean there's a container built with aiohttp then yes. If you mean a container with the build tools: why would they be smaller in a container?
 
2:01 PM
yeah, but you could build it remotely on a cheap VPS, discard the intermediate big stage and then download the smaller image.
 
Or is this about figuring out which part of the 2-3 GB you need?
 
> why would they be smaller in a container?
Multi-stage build means end-result is smaller
 
@Withnail so you mean like building on aws?
I'm admittedly ignorant on the ways of containers, but surely the download must happen somewhere.
 
any remote machine, AWS, DO, Vultr. Spin up a machine for a half hour, download the big image there, and then push the result to dockerhub
 
OK, so "use someone else's computer to download the tools". Yeah, that's good :P
 
2:02 PM
Is it not possible to build the dependency exactly once and deploy only the built result to the other computers? Then you don't need to copy around a 2 GB build tool, just a 10kb dll (or whl or whatever)
 
now i'll be the first to admit this is basically my job these days and I have a container shaped-hammer that sees lots of container shaped nails ;)
 
@Kevin you could even copy the downloaded tool around the network, I think the issue is downloading it once
 
AWS has some free instances on the free tier, maybe I can try to use that
 
Does aws do windows machines? Perhaps there's free azure :P
 
Hi, is there a way to post the link with the question. Like if I were to do stackoverflow.com/q/1101750/13382000 this would just paste the link, but is there any easy way to get Tkinter: AttributeError: NoneType object has no attribute <attribute name> rather than doing it manually?
 
2:09 PM
@AndrasDeak I guess beggars cant be choosers then, :D probably wait till the end of month and just download this before the monthly cycle renews if I have enough internet
 
@AndrasDeak they do... but they're roughly 50% more expensive that linux instances...
 
I was able to download/install the 361 kb brotlipy wheel from lfd.uci.edu/~gohlke/pythonlibs/#brotlipy, and then pip install aiohttp[speedups] finished in 10 seconds using appx 1MB of bandwidth
So maybe try that @python_user
 
@JonClements 1.5 free is still free :P
 
@Kevin wow, I did not know such things existed, melon much
 
gohlke is my #1 stop after I discover that installing from pypi is a pain in the ass
The pain is almost always Microsoft's fault ;-)
 
2:14 PM
@Kevin almost? :p
 
They don't have the monopoly on pain, in a surprising turn from their usual character regarding monopolies
 
@AndrasDeak IIRC there's a free trial period, but no free tier.
 
I see
 
hi guys, in python if I have a doubly linked list, and I want to clear it, is it enough to set head to None and tail to None? (i.e. is there a garbage collector like in c# that will remove the nodes form memory because they are no longer referenced) Or do I have to iterate over each node and break the links?
 
@erotavlas there are doubly linked lists in python?
 
2:21 PM
@erotavlas the gc should find reference cycles eventually...
 
@holdenweb I think there's a "free tier" but you're limited to X amount of run time within a certain period
 
@Kevin they dont have the 3.9 version :/ also tried the amd64 one
pip install brotlipy-0.7.0-cp38-cp38-win32.whl
Defaulting to user installation because normal site-packages is not writeable
ERROR: brotlipy-0.7.0-cp38-cp38-win32.whl is not a supported wheel on this platform.
but I guess now I know what to search, maybe some one else out there has a wheel
 
@JonClements My experience isn't recent.
 
(so if you wanted to play with something that only needs to do something now and again briefly - it's effectively free to a certain point... but if you want something to run for an hour doing number crunching - you won't get that free...)
 
@python_user anyone with 3.9 could build you one
 
2:23 PM
@AndrasDeak what if the value of the node contains some large item like a bitmap image and you need to free space sooner, is there a way to remove the node from memory?
 
@erotavlas yes, loop over it and clear all references
Then refcounting will kill each link instantly
 
Downloading Python 3.8 is faster than downloading VC++ build tools, just saying ;-)
 
I wonder why so many intro courses teach double linked lists. I mean yeah you learn something, but I never needed them once later
 
can I use Del keyword on the Nodes?
 
@Hakaishin it's the fibonacci of OOP
 
2:24 PM
@Kevin yeah a 30MB download wont hurt
 
@Hakaishin And if you never needed them, why should anyone bother to teach them? :D
 
@erotavlas that deletes the names. Set the next/prev to None for each node.
 
LLs are a data structure with specific properties. If you need those properties, you need LLs.
 
what is refcounting?
 
Short for reference counting
 
2:26 PM
CPython keeps a count of every reference to an object.
This makes it easy to know when an object acn be garbage-collected.
 
I, too, have never needed a linked list for professional purposes. But more abstractly, it's useful to have an intermediate understanding of how data structures conventionally chain together.
 
But note this isn't a feature of the language, but of the CPython implementation.
 
I write code involving pointers once a year, but I think about code in terms of pointers almost every day
 
Given that Python names are pretty much references, it's a natural way to think about data structures in Python.
 
while True:
    next = cur.next
    if not next:
        break
    cur.next = next.prev = None
    cur = next
Something like that, untested
 
2:32 PM
not clear on this whole del vs None
 
All that said, I bet you could have a perfectly profitable career without understanding the mechanics of any collection type fancier than a statically sized array
 
I dont think in python you have to use del anywhere, I have not found a use for it in ~ 2 years
 
@erotavlas read nedbatchelder.com/text/names.html for starters
 
@Kevin True that, it's for sure useful for that reason. Just feels weird to learn something so indirectly, but with my little teaching experience I can say it's hard to make good examples which directly teach what you want to teach. Very often it's in an indirect way.
 
@AndrasDeak thanks
 
2:35 PM
Also I figured out why excel is so widely used and widely detested. It presents itself as structured data, while it's totally not. It's just a sheet of paper with grid lines on it, which gives people using them the impression the data is (well) structured
 
I wonder if programming is unusual compared to other professions in the sense that much of our formal education is just teaching us how to figure out arbitrary problems. The most important things I learned in college are how to google things, read tutorials, and choose the best solution on a Stack Overflow post.
 
@Kevin well put as always :)
@Kevin how to skip the question ;)
 
I don't want to give short shrift to like carpenters and lawyers or whatever, I'm sure they learn how to look stuff up too.
 
I'm always surprised how a question with 50 lines can be summarized with a google search with 1 line. It's astonishing, but really for sure 60-70% I don't need to read the question
 
Yeah sometimes I yell "stop wasting my tiiiiiiime" as I scroll down past the Q towards the answers
 
2:38 PM
@Kevin the way I see it, anyone can code, not to be rude, but only those with a formal education (not all) know when to use what, most of the "I built an app in 30 days" just dont use the right data structure, they get the job done
 
I always skip to an answers, I don't think I've ever read a question description in great detail
 
@Kevin you have been watching my mind ;) tiiiiiime. I need to save tiiiime, to spend it here :D
 
by formal education I mean anyone with a degree, not necessarily a computer based one, maths people are a lot better at coding if they learn it
 
@python_user Hmm, partially agree. I'd say there's certainly is a correlation between amount of formal education and likelihood of excelling beyond "gets the job done". And yet, a sufficiently determined nerd can get into the top tiers with only free online resources.
 
My view's always - 80% of coding problems are business problems, not compsci problems. Some companies have compsci problems, and I'm not the right flavour dev for them. :D
 
2:43 PM
80% sounds about right yeah
 
umm... I might have turned out all right and I don't have a degree... heck, don't even have any A-levels... most of my experience comes from "what can I use to achieve X" and a bit of research...
 
@Kevin What a lot of top nerds lack in my experience is stamina for the bs of lots of real world jobs. They excell at those other 20% of problems, but not at all at the 80%
 
the 20% compsci problems require a certain brain architecture
 
Jon didn't need a degree, just GUMPTION and a certain JE NE SAIS QUOI. (not sarcasm)
 
@JonClements I stand corrected then :D
 
2:44 PM
My formal education is all in the humanities, which i actually think should be compulsory modules for anyone doing straight up compsci ;)
 
@Hakaishin fully agree with this. I'm still learning how to deal with the 80%
 
As a youth, my kinda-mentor-figure was a programmer with an English major.
Perhaps this has influenced my philosophy that 80% of business problems boil down to "write the requirements in an understandable fashion"
 
It's just pareto rules, the whole way down
 
Doesn't sound like a bad mentor
 
{mentor} had a profitable career indeed, and I'm pretty sure the last time I asked him about a double linked list, he said "a double what now?"
 
2:47 PM
quite a bit of the time though, I've come up empty in my research (maybe not looking for the right terms - so can see how some formal CS would be great that) - so end up writing something that makes sense to me... then find out some yam like Dijkstra had already done it :p
 
a double linked list is a list found on the internet for which you accidentally created a second bitly shortlink </cheek-tongue>
 
Isn't it what happens when you get buzzfeed lists that refer to each other?
 
Top ten buzzfeed lists that do not contain themselves
 
I think that might be a recursively linked list. But it also wouldn't be the first time I was wrong about something
 
3:02 PM
Can anyone look upto what I asked? Cant reply to my own messages here
 
Oh, permalink. Sure, next time
 
there's a "share markdown" userscript at sopython.com/wiki/Userscripts
Courtesy of Kevin as usual. Not sure if it still works, but it probably does.
 
Ha cool
 
@AndrasDeak or you could reply to your message anyway
right, that too
 
3:06 PM
It's one of my less stable userscripts, unfortunately, because SO has messed around with its HTML structure pretty frequently
So it's hard to staple the markdown link textbox to the correct popup
"hard" meaning approximately "five minutes of work every six months"
 
make it a popup that hovers above the center of the question
 
I'd be lying if I said I hadn't considered it
I'm actually not sure how to create an always-on-top absolutely positioned box that can be inserted into arbitrary DOMs and definitely still work. You never know if the existing CSS is going to mess up your custom elements, or if everything already on the page has a z order of a googolplex, or whatever
SO would probably not do either of those, so an always-on-top box might be more stable than my existing approach
Incidentally it is possible to reply to your own message. You just have to start replying to a different message, then replace its message id with your own.
 
the "start replying" part could be replaced by typing a colon
 
@Kevin For example, here I replied to myself by starting to reply to Andras' message, then replacing ":52037346" with ":52037385"
@AndrasDeak Also valid, but I don't trust myself to remember that syntax
For a nominal fee of $100, I will write a user script that re-inserts the "reply to this message" link in all triangle menus belonging to messages you wrote yourself
 
3:22 PM
@CoolCloud yes
 
...and how would that be?
 
Magic, usually
 
I prefer dark, usually.
 
Just to clarify, you're still asking "how do I share a link like this without having to type the markup?" and not "how do I do the thing being asked in the question I'm linking?", right? Try my userscript and see if that helps.
Ok, I just tried my userscript and it's broken. Let's see if I can make a v8.0 real quick...
 
I tried it too, doesnt seem like there is any change there
 
3:28 PM
PRs welcome
 
SO has shuffled their HTML around, unsurprising... What is class ".post-menu" called now...
Oh, nice, they stopped using dynamic element creation, that might cut down on my script's cpu load
 
3:45 PM
Currently diagnosing a problem in the category of "how did this EVER work???"
Possibly v7.0 was always broken and nobody ever used it. Much like all of my other projects, then ;-)
 
Oh
I guess SO should actually release this feature from their part? Just like how they should have introduced a copy button for code snippets
 
Well if I'm getting zero downloads per fiscal quarter, that probably implies that the feature isn't in high demand
 
I never knew this existed :p
 
Unfortunately you and I are a rounding error on the demand graph
Anyway, I have a hideous yet functional prototype, I'll publish either this or a prettier version by 12:00
 
I mean when you think about it, a lot of people do use this daily right? At least I wish something like this existed alot.
Could you @ me so I can get notified?
 
3:55 PM
Yeah
 
Thanks :D
 
@Kevin I like the non-commitment to any particular date for that time :p
 
@JonClements If I hadn't made it in time for 4/21 12:00, I absolutely would have delayed the release by eleven hours and fifty nine minutes.
 
@Kevin Damn it works mate :D
Thanks, much appreciated
 
Unfortunately I was wrong about being able to save cpu cycles. The page still uses clientside-generated html, it just does it a little earlier than usual. So I still need to spin in a busy loop waiting for the pop-up box to start existing.
 
4:02 PM
And the coincidence? It just happens when you messaged it was 8:00 here and then the version is also v8.0 :P
 
The busy loop is not a big deal but it grates on my pride
@CoolCloud Hmm, the interconnectedness of all things strikes once again
 
Also could someone give me advice here. I saw a marking criterion for a competition and it said 5 for user friendliness and 10 for efficiency(they mean how long and the memory it takes). So if I were to use a GUI I maybe could get the 5 points for user friendliness but efficiency might drop as it takes alot of memory and time too(compared to terminal). So is it better to just go for terminal and make it seem userfriendly as possible? as terminal MIGHT take up less than GUI version
 
Based on no evidence, I bet that efficiency is primarily judged on big O memory and runtime. Unless you're doing something really weird, a GUI will add no more than O(N) extra memory and time on top of your algorithm. So you can gain huge points in friendliness by sacrificing little to no points in efficiency.
In other words, even if your console app consumes 1kb memory and your GUI app consumes 1MB, they'll still be graded the same as long as doubling the size of the input doesn't double the GUI app to 2MB (or worse)
 
@Kevin That's true too
The thing is it says we can use any programing languages, so C, C++? Python. Using python, its already a disadvantage I guess, right? Since its slow
 
Ask them if they grade on a curve W.R.T. languages. If not, consider using one of the Cs.
 
4:09 PM
Python is my only choice :p I dont know anything else, But I guess itll be fine as its on school level and I dont think any school teaches C or C++
 
If runtime is judged solely on clock time, then Python is sadly at a disadvantage
(but perhaps less than you might be imagining. Experiment, take measurements, make comparisons)
 
Okays sure, thanks again :D
 
I feel like such an idiot. How do you put a # in a str
 
you type it there? as in '#'
 
it's commenting out the line
I thought it was an IDE problem but it doesn't seem to be
 
4:21 PM
can you show the entire line, perhaps?
 
Well, for "some string" in some_container is a syntax error. Other than that, it seems like your IDE's syntax highlighting is b0rked.
 
Yeah I forgot to take out the for
thanks
I had them both in the any() before
If any((for c in t) "#" in c):
 
Did you mean if any("#" in c for c in t):?
 
That's even further from correct syntax :P
 
4:28 PM
XD
 
@CupOfJava that little screenshot you've posted smells of you should be using docs.python.org/3/library/urllib.parse.html and then access its .fragment attribute?
 
I was just trying to filter out javascript href by using if any("#" in link ): pass
I'm sure scrapy has something for this
I'm just trying to write bad code because I'm lazy
 
4:45 PM
You might already know this, but just in case: if x: pass by itself basically does nothing
and if x: pass <newline> else: f() is identical to if not x: f()
 
you're using scrapy? Why are you worried about fragments anyway then?
 
Consider using continue if you want to skip ahead to the next iteration of a loop
If you're worried that your IDE is refusing to run your script because it thinks a pound sign in a string is a comment, then you could always use chr(35) instead.
>>> chr(35) in "google.com#foobar"
True
>>> chr(35) in "google.com/?q=foobar"
False
This will almost never make your code go from broken to functional, but sometimes you just need the assurance that a seemingly impossible thing is really definitely thoroughly impossible.
Good dev practices include self care, so take measures to avoid your own spiral into madness
 
Are you sure it's not '\43'?
 
At the layer of madness spiral I habitually live in, I am sure of nothing
 
@JonClements because it's passing a url like this 'www.example.com/#example' as a url that needs to be crawled
^thank you everyone for the advice :)
 

« first day (3840 days earlier)      last day (1101 days later) »