Code Monkey home page Code Monkey logo

Comments (23)

PaladinOne avatar PaladinOne commented on June 1, 2024 2

THAT'S... NOT... HOW GRAMMAR WORKS

from mediawiki-butt-ruby.

elifoster avatar elifoster commented on June 1, 2024

I think a good way to do this would actually involve a major refactor of the existing query stuff.

First, we'd have to make a new query method, which takes the params (action: 'query' would come default obviously), as well as a new method argument on all continueable queries continue with the default value being false.

Then, if continue is true, loop until the continue parameter is not present.

Alternatively, we could use an integer argument and do int.times do, which would default to 1.

@xbony2 What do you think?

from mediawiki-butt-ruby.

xbony2 avatar xbony2 commented on June 1, 2024

An angel told me this should be worked on.

from mediawiki-butt-ruby.

elifoster avatar elifoster commented on June 1, 2024

I still don't know what you think about my ideas for it. I'll work on it once we have a set design, and the limit improvements get finalized.

from mediawiki-butt-ruby.

xbony2 avatar xbony2 commented on June 1, 2024
params = {
            "action": "query",
            "list": "categorymembers",
            "cmtitle": "Category:" + self.category,
            "cmlimit": "500",
            "cmprop": "title"
        }
        lastContinue = {"continue": ""}
        while True:
            par = params.copy()
            par.update(lastContinue)
            content = self.wiki.call(par)
            for page in content["query"]["categorymembers"]:
                #doshit
            if 'continue' not in content:
                break
            lastContinue = content["continue"]

(Kris' Python solution)

from mediawiki-butt-ruby.

elifoster avatar elifoster commented on June 1, 2024

That's basically what I described in that comment

from mediawiki-butt-ruby.

 avatar commented on June 1, 2024

Only difference is with mine, instead of redefining the variables every time, it just update the param values :P silly eli

Edit: You also want to return ALL the data in one return, since you no can constantly keep returning data's ;o

from mediawiki-butt-ruby.

elifoster avatar elifoster commented on June 1, 2024

Only difference is with mine, instead of redefining the variables every time, it just update the param values :P silly eli

I literally didn't say anything about that.

Edit: You also want to return ALL the data in one return, since you no can constantly keep returning data's ;o

I have no idea what you are saying here.

from mediawiki-butt-ruby.

retep998 avatar retep998 commented on June 1, 2024

Here's some code in Rust that is pretty robust at doing continue query stuff.

https://github.com/FTB-Gamepedia/mediawiki-rs/blob/master/src/lib.rs#L286-L325

from mediawiki-butt-ruby.

 avatar commented on June 1, 2024

I'll just stick with python >.> Faster, more stable, more powerful lol. Ever managed 16k API calls in 220 seconds with Ruby? ^_^

from mediawiki-butt-ruby.

elifoster avatar elifoster commented on June 1, 2024

Um, none of those are true? Ruby is actually faster than python according to most benchmarks you'll find, it's perfectly stable, and can do everything python can do (and vice versa).

from mediawiki-butt-ruby.

 avatar commented on June 1, 2024

Actually, if you want to argue about it, why is pretty much every linux system running python libraries and systems than ruby? Because it /is/ known to be faster in a lot of aspects. :P

Kris out.

from mediawiki-butt-ruby.

elifoster avatar elifoster commented on June 1, 2024

I've looked at 5 benchmarks this morning, all of which used older slower versions of ruby, and it was faster in every aspect than all kinds of python except cpython

from mediawiki-butt-ruby.

Chocohead avatar Chocohead commented on June 1, 2024

There are also other benchmarks that put python faster than ruby though. Changing Python code from running globally to in a function can alone speed it up massively (for example), as well as depending on the version of which you use for both of them, so you could easily find a case by case basis for which one was faster if you wanted to, purely based on the way the test you were doing was written.

from mediawiki-butt-ruby.

retep998 avatar retep998 commented on June 1, 2024

Meanwhile I just write Rust and I get faster code than both Python and Ruby any day of the week.

from mediawiki-butt-ruby.

elifoster avatar elifoster commented on June 1, 2024

Apparently not if you are picking a random lines content out of a given file :)

from mediawiki-butt-ruby.

retep998 avatar retep998 commented on June 1, 2024

@elifoster You weren't comparing plain Rust to Ruby, you were comparing calling Rust code from Ruby with all the overhead of that compared to plain Ruby. Also that was you writing Rust, not me writing Rust.

from mediawiki-butt-ruby.

elifoster avatar elifoster commented on June 1, 2024

Good points

from mediawiki-butt-ruby.

enterprisey avatar enterprisey commented on June 1, 2024

I've written a query method like the one we were talking about, and you can see it in this section of a commit.

(I'm holding off submitting a pull request until #32 is decided, because GitHub won't let me make a PR with just that commit.)

from mediawiki-butt-ruby.

xbony2 avatar xbony2 commented on June 1, 2024

(see also)

from mediawiki-butt-ruby.

 avatar commented on June 1, 2024

I would just like to say... Waffles

That is all.

from mediawiki-butt-ruby.

xbony2 avatar xbony2 commented on June 1, 2024

https://www.change.org/p/apple-add-a-waffle-emoji

from mediawiki-butt-ruby.

enterprisey avatar enterprisey commented on June 1, 2024

I'm all for working on this change in a separate branch, because, as it was mentioned earlier, a lot of queries are going to have to be changed.

from mediawiki-butt-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.