User Controls

  1. 1
  2. 2
  3. 3
  4. ...
  5. 109
  6. 110
  7. 111
  8. 112
  9. 113
  10. 114
  11. ...
  12. 227
  13. 228
  14. 229
  15. 230

Posts by rabbitweed

  1. rabbitweed African Astronaut
    Never heard of grequests (I'm straight just like aldra). But I checked out the github, which says:

    Note: You should probably use requests-threads or requests-futures instead.

    So there we go.

    https://github.com/requests/requests-threads

    each request is a new thread.
  2. rabbitweed African Astronaut
    Originally posted by aldra I don't code in python because I'm not a homosexual but you were probably right the first time, this is going to be the bottleneck:



    not so much slow code but it'll queue up each page get, you'll want to use threading to run several of them concurrently if at all possible

    I completely missed that bit, but you're totally right. That's the worst bottleneck in the whole loop.
  3. rabbitweed African Astronaut
    And most importantly... benchmark now, then benchmark after every optimisation you add. Just because you feel something is faster doesn't mean it actually is.
  4. rabbitweed African Astronaut
    It's hard to tell without being able to run it here myself, but these should be pretty universal


    # Get all articles for the day
    for date in pandas.date_range('2011-01-01', '2020-09-01', tz='Europe/London').tolist():

    There's no need to transform the date range to a list. A date range is already iterable, and you're just allocating more memory for no reason.

    articles += f"title: {content['title']}\narticle: {' '.join(content['article'])}\n"


    Never ever use += on an python string. They are immutable so you're reallocating memory every loop. Use join, like you mentioned before. Some info here:
    https://waymoot.org/home/python_string/

    It was 30 times slower to use += then to use join in this benchmark


    with open(f"{os.getcwd()}/scrape/data/dailymail.txt", 'a+') as file:
    file.write(articles)

    The easiest win is here. You're opening and closing a file every loop, just to write to it. Open it before the loop starts, and close it when the loop ends instead.

    If you use threads like sophie suggested, I'd have a queue of articles. One thread adds articles to the queue, another thread takes them from the queue and writes them to the file.
  5. rabbitweed African Astronaut
    I have to agree with G here. Lying is great, definitely gets results if you don't over do it.
  6. rabbitweed African Astronaut
    Originally posted by A College Professor i suggest reddit

    now there's some fresh free thinkers, with a hint of edge. a bastion of rebellious intellects.
  7. rabbitweed African Astronaut
    Originally posted by G No brag he asked a question, I answered.

    Perfection is a matter of perspective, change yours.

    You do nothing here but talk about how great you are. Just like speedy.

    It's transparent. Secure people can admit their fuckups, or stuff that isn't so great.

    I see through you old man.
  8. rabbitweed African Astronaut
    Originally posted by G Lucrative investments,fruitful income,savings,vibrant sex life,classic whips,salon quality hair & skin.

    The more you brag about your life the more we all believe absolutely nothing is wrong and you're perfect.

    This is an old school online message board you tard. Not a facebook feed.
  9. rabbitweed African Astronaut
    Originally posted by Fonaplats

    That's a SNES controller.

    N64 had the dick handle
  10. rabbitweed African Astronaut
    Originally posted by the man who put it in my hood Let's ditch shell. She can chill with her imaginary dogs in the parking lot while we live our real lifes

    But what about Lucy?
  11. rabbitweed African Astronaut
    What's even the best way of getting acid these days? Get someone to mail it to you on one of them darknet stores?

    I'd rather not actually meet with drug dealers IRL.
  12. rabbitweed African Astronaut
    Originally posted by aldra reminds me of this:


    Ironically reading this mates me passionately hate white people.

    Being a racist is confusing.
  13. rabbitweed African Astronaut
    Originally posted by aldra a society based on the accumulation of debt has no use for them

    We'll be thrown in prison one day for not having debt.
  14. rabbitweed African Astronaut
    Grylls is so fucking stupid he couldn't even figure out it was a location, let alone that it was a Greek word.
  15. rabbitweed African Astronaut
    Durrr where is Thessalonika durrr
  16. rabbitweed African Astronaut
    I wish you nothing but success and happiness.

    I also hope I never have to live near you because smokers are gross.
  17. rabbitweed African Astronaut
    Originally posted by MORALLY SUPERIOR BEING 2020 IV: Intravenous Soyposting OP literally made this thread to shit on non-black people.

    You know me, I'm not politically correct. I've never seen bummy shitting on white people, except all the drugged up losers here who call him 'nigger' (even though he probably earns more than someone like grylls, US pay > UK pay).

    He's pretty chill. He should stop having sex with single mothers or reacting to six letter words, but none of us are perfect.
  18. rabbitweed African Astronaut
    You cannot travel to Taiwan with a PRC passport.

    I've been to Taiwan. China doesn't run it at all.

    It's an interesting place. The land is beautiful, the towns built on it are hideous looking, save for the odd brightly coloured temple. Public transport is amazing, crime is low, driving is pretty bad, everyone's pretty friendly, people are very relaxed but constantly doing dangerous shit like 3 men riding a scooter without helmets. It's first world but their hearts are still in the third world. It's great and crappy at the same time. I recommend it.
  19. rabbitweed African Astronaut
    Originally posted by WellHung I don't think he cares about being called that.

    Even if that was true, I wouldn't do it.

    Folks, that's what we call "politeness".
  20. rabbitweed African Astronaut
    Originally posted by aldra why do you think the nigger word is ignorant?

    Isn't it a bit?

    I mean when you make a post I dont't go around saying "gook"
  1. 1
  2. 2
  3. 3
  4. ...
  5. 109
  6. 110
  7. 111
  8. 112
  9. 113
  10. 114
  11. ...
  12. 227
  13. 228
  14. 229
  15. 230
Jump to Top