Hacker Newsnew | past | comments | ask | show | jobs | submit | rurabe's commentslogin

i would maybe clarify in the about page that it comes from a campaign lens versus a multiplayer lens

this is maybe one step short of the underlying need which is "should i play this yet, or is there more to come?" because it seems like there would be games which are not "done" and will have additional DLC but the experience is more or less complete and releases of new maps, rebalances etc are contemplated within the release model?

imo the analogy would be like to eg https://www.macrumors.com/roundup/iphone-17-pro/ what you are presenting is "when was this last released" as opposed to a forward looking "should you buy this now"

but even thats not true because you are considering future stuff, so maybe its jus the framing of "done" vs "should i get into it now" not being the same thing when the definition of done is more stuff is coming

i love the recommendation engine though!!! make it more prominent!


This is the crux of the subjective term of "done" so I take the conservative approach. Any content or update that substantively changes or adds to the game is considered content that needs to be present to be considered done. Maps, dlc's, changes to a story, are all considerations to that. Simple bug fixes and patches do not. Effectively the basis of the site is to answer the question "If I play this game now, will I be getting the complete and total gameplay experience."

Looks so promising, what's the timeline for something like MUI?


MUI is probably the design system I'll add next, but as for the timeline I'm not really sure. I want to go a little deeper with Chakra UI and explore e.g. theming before branching out to other design systems.


It's not perfect or painless but I think jsonapi-serializer is pretty good


Big fan of raw sql, but practically speaking (as it relates to developing with rails) CTEs can be rewritten as subqueries, the advantage being that they are linear instead of nested in SQL.

With AR queries you can do the same and make it linear in ruby (and then the computer doesn't really care if your sql is nested)

    last_three_posts = Post.limit(3).order(created_at: :desc)
    @posts = Comment.where(post_id: last_three_posts)


The problem here is that you are loading all the votes as AR instances which is fine at small scale, but as your app gets larger, loading and instantiating thousands of Vote instances just to then break them down into an integer will start to drag on your controller.

If you can count in the database itself it's a big win. Although no doubt your solution is cleaner code.


One neat trick that I think is relatively lesser known is that you can select arbitrary sql expressions in ActiveRecord and those values are made available on the instances.

(Also I think the above sql needs to be tweaked since you need the votes count grouped by comment not by post)

A one to many relationship in pure SQL is an awkward fit with a Rails app as it requires serializing (at least) the many as json. Then there's this weird conceptual gotcha where one resource is an AR instance and another is a pure hash.

I'd probably make a scope and association to help out here:

    class Comment
      scope :with_vote_count, ->{ joins(:votes).select('comments.*').select('count(votes.*) as vote_count') }
    end

    class Post
      has_many :comments
      has_many :comments_with_vote_counts, ->{ with_vote_counts }, class_name: 'Comment'
    end

    # in controller
    @posts = Post.includes(:comments_with_vote_counts).limit(3).order(:created_at: :desc)

    # in view/serializer, posts and comments are both AR instances
    @posts.each do |post|
      post.comments.each do |comment|
        comment.vote_count # => Integer
      end
    end
This should give you 2 queries, one to load the posts, then one to load the comments and vote counts for the relevant posts. Controller stays nice and slim and the complexity is delegated to sql via the join scope, without any other dependencies.

* edited for HN code block syntax


Django will do something similar (possibly a little more elegantly) if one is familiar with how to use the Prefetch APIs [1]:

    Post.objects.order_by("-created_at").prefetch_related(
        Prefetch(
            "comments",
            queryset=Comment.objects.annotate(
                vote_count=Count("votes")
            ),
        )
    )[:3]

This will generate the following two queries:

    SELECT
        "post"."id",
        "post"."created_at",
        "post"."title",
        "post"."content"
    FROM "post"
    ORDER BY "post"."created_at" DESC
    LIMIT 3;

    SELECT
        "comment"."id",
        "comment"."post_id",
        "comment"."content",
        COUNT("vote"."id") AS "vote_count"
    FROM "comment"
    LEFT OUTER JOIN "vote"
        ON ("comment"."id" = "vote"."comment_id")
    WHERE "comment"."post_id" IN (3, 2, 1)
    GROUP BY
        "comment"."id",
        "comment"."post_id"


[1] https://docs.djangoproject.com/en/4.1/ref/models/querysets/#...


Personally, I find the Rails version a bit more elegant because it is declarative, reusable and composable, while Django's approach is a more utilitarian "just write the dang query when you want it." But both are a great illustration of how a well-designed ORM can give you the tools you need to get good performance.


You can do the same kind of thing in Django. The approach is a little different, but it's the same basic idea.

https://docs.djangoproject.com/en/4.1/topics/db/managers/#cu...


What about incorporating Ukraine, Belarus, Georgia, and Russia into NATO?

Ukraine gets the Donbas back in return for international recognition of Crimea as Russian territory.

Fanciful, I know. And questionable whether Article 8 would hold up. But advantages:

1. End to the conflict 2. Security guarantees for all of Europe 3. Repurposing of NATO from anti Russia alliance to anti China alliance, ie pivot to Asia


It's very difficult to imagine a world where Russia would accept being in an alliance in opposition to its largest (in economy, population, border, and area) neighbor and its current largest trading partner.

Not to mention that this current war would look like a sibling fight relative to what China would do if it saw a risk of NATO first-strike capabilities coming anywhere near its borders.


The military endgame sadly is somewhere between a destroyed Ukraine in perpetual conflict and regime change, depending on the efficacy of Ukrainian resistance.

Sorry to say, autocrats do not withdraw from a conflict like this regardless of attrition. Their power is their legitimacy and defeat is a threat to both their rule and probably their life. I mean look at how much flak Biden took withdrawing from Afghanistan despite being able to say that it was a horrible idea and someone else's fault.

This is a little different from Afghanistan and Iraq though, Russia's security concerns are valid and probably ameliorated by Ukraine as a failed state (as opposed to a NATO aligned state) so conquering and pacifying the country is not necessary.

The only real humanitarian solution is a diplomatic solution. I wonder if written guarantees that Ukraine and Georgia will never join NATO would be enough now honestly.


> I wonder if written guarantees that Ukraine and Georgia will never join NATO would be enough now honestly.

They would never have been enough; that was the abusive partner going "if you'd just do x I wouldn't have to hit you so much". Consider the ease with which Russia violated their own (https://en.wikipedia.org/wiki/Budapest_Memorandum_on_Securit...).


Honestly, I fear the resistance being too effective.

Russia is on the offensive when viewing this conflict in isolation. Zoom out to geopolitics and it is very much on the defensive.

They are locked in this conflict and if they cannot achieve their goals they will escalate. They also own the most nuclear weapons of any country on earth.

This is what the Art of War says when it says not to put enemies in a corner.

This is also a very realpolitik take on this. It goes without saying that all of this is a humanitarian disaster.


H3 cell indexes are just integers so you can easily make a compound index of (cell_index,timestamp). This would be easy in SQL and I'd have to imagine just about anything else that supports a compound index.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: