azure – How to implement timing-mechanism for fantasy draft process utilizing ASP.NET Core 3.1 SignalR

I have developed a Fantasy Draft system utilizing ASP.NET Core SignalR, along with Azure’s SignalR service (for backplane/scaling stuff).

Last year I utilized a poor-mans’ javascript version that just polled the database every 5 seconds to check for new “picks” in the draft, or any changes that may have happened in the draft room.

I realized pretty quickly, that version didn’t scale very well, hence my conversion to SignalR.

So, the version I use relies on the commissioner of the group to be IN the draft room for the entire duration of the draft. This is necessary because it’s the commissioner’s connection on the client-side (via javascript intervals) that the “timer-expired auto-pick” fires. As well as when the draft completes, there’s a “finalize draft” process that needs to execute.

Surprisingly, I finally had my first instance of where a commissioner left the draft room while it was still going on (I was a member of the group, but NOT the commissioner). Because he left the draft room briefly, and it just so happened that a user timed-out on their pick at the same time, we saw the “current pick timer” go all the to -20 seconds (negative 20).

After that, the commissioner left the draft room right before it completed, therefore that “finalize draft” process never got executed.

My original attempt at trying to fix that last issue was to develop an Azure Function (triggered via timer) to check every X seconds if A) there are any picks assigned to a user that have surpassed their timer and B) check if the draft has completed, and it HASN’T been “finalized”.

This would fix both of those scenarios, with a simple Azure Function running in the background…hopefully not tieing up too many resources.

But my question is, is that approach a workable approach, to have a “background process” watching the timers?

Is there a better process to orchestrate the timer mechanism for a draft/bidding process? Are there possibly more issues that will rear-their-head that I’m not thinking of if I continue down the path of the background process/Azure Function timer to handle these timer-expired events?

theming – How to show content of a node render using view in content moderation in draft mode Drupal 8

I am using content moderation module and it working for normal fields of the content type but if I render the content with view then its not visible in the latest revision if the node saved as draft So I have a node with having fields.

title
body
primary section title
primary section desc
Primary section image
Secondary fields

in the above fields i am using below fields in view as slideshow to render in the page( more clear – all the above used in the node but to make the slider functionality I have render these fields content with view). Now I see when I made the change of below fields in my node these fields value does not show in latest revision in the node when I save them draft its working fine in published.

primary section title
primary section desc
Primary section image

How long has it taken for BIP-Taproot to go from draft specification to activation?

The idea of using the leaves of a Merkle tree to store alternative Bitcoin scripts dates back to Russell O’Connor in 2012. The idea of using Schnorr signatures instead of ECDSA has been discussed for at least as long. So you could say that what we will collectively call BIP-Taproot (BIP 340, BIP 341 and BIP 342) has been in the making for over eight years at this point.

However, there have been different iterations of how to apply these ideas and what we now consider BIP-Taproot was first proposed on the Bitcoin dev mailing list by Greg Maxwell in January 2018.

The draft of the Schnorr BIP (what became BIP 340) was first sent to the Bitcoin dev mailing list in July 2018.

The draft of the Taproot BIP and the Tapscript BIP (what became BIP 341 and BIP 342) were sent to the Bitcoin dev mailing list in May 2019. The BIPs were all allocated BIP numbers in January 2020.

Jonas Nick laid out the full timeline of BIP-Taproot progress here.

At the time of writing (December 2020) the Taproot PR has been merged into the Bitcoin Core repository but there has been no Bitcoin Core release with activation parameters set and hence Taproot is not currently activated on the Bitcoin blockchain.

Why is BIP133 listed as ‘Draft’ when it has been implemented for years?

BIP133 is listed as ‘Draft’ but it has been implemented since v.0.13.0

https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki

Is there anything preventing it from being labelled as ‘Final’?

dnd 5e – Could you potentially turn a draft horse into a warhorse?

Mechanics of the game don’t include anything like this so it’s homebrew/ DM discretion all the way.

Destriers are trained from birth to be ready for battle so the process would be lengthy in the real world.

Historically, warhorses weren’t the massive beasts media portrays them as. They needed strength and agility to perform battlefield manoeuvres and to be a comfortable ride for the knight.

Draft horses are big, built to drag heavy loads and have good stamina but they lack speed and the ability to stop, turn and accelerate.

But that is all just real world issues and DnD isn’t a life simulator so ask your DM. The rule of cool always wins.

game mechanics – How to implement a system like the draft from NFL/NHL/NBA for an mmo?

I want to build a soccer manager mmo and I’m currently thinking about how to get young players into the game.

The classic way would be to invest into the youth and produce better youth players each season. But that’s kinda oldschool.

I’d rather implement a draft-like system that has a pool of young players and the teams can choose one of them.

Now since the users aren’t necessarily online when they should be, it needs to be built in a way, that the draft takes place maybe over the whole season, but the players are available to the teams the season after.

There are a couple of questions that still need to be answered.
Like how to handle multiple leagues? Can all choose from the same pool or does every league have its own pool of players to choose from?

How would you do it?

sharepoint online – Cannot script check in of deeply nested draft documents using PnP

I have a site that was just migrated to SPO, and had “require checkout” turned on by default on the Documents library. Users have since bulk-uploaded a few hundred docs without checking them in. Luckily I have a PnP script for just such an occasion which simply loops through every item and checks it in if needed. The problem is that the folder structure in this library is deeeeeep, and it seems that my script doesn’t plumb the depths like it should. Documents that are buried deep in the structure don’t get checked in for some reason. I’m using paging to limit results so that I don’t run into the LVT, but I’m not sure how else to make the script check every doc. Anyone know how to accomplish that, or at least why it’s failing? Is there another method I should try?

Here’s what I’m working with:

$ListItems = Get-PnPListItem -List $ListName -PageSize 500 | Where {$_("FileLeafRef") -like "*.*"}
ForEach ($Item in $ListItems)
{
    $File = Get-PnPProperty -ClientObject $Item -Property File
    If($File.Level -eq "Checkout")
    {
        Set-PnPFileCheckedIn -Url $File.ServerRelativeUrl -CheckinType MajorCheckIn -Comment "Fixing checkout"
    }
}

recover email draft from hung gmail tab

I composed an email draft in gmail. After closing the draft and wanting to inspect it in “Drafts” gmail hangs with a “Loading…” sign.

I opened gmail in another tab and the draft isn’t there, but I can see that the tab where I composed the draft still has some knowledge of it: the counter for the “Drafts” folder is visible and greater by 1 than in the freshly opened tab.

I’ve tried turning the wifi on and off and getting gmail out of its funk by opening/closing messages and trying again, but it always ends up hanging as soon as I pressed “Drafts” or “Sent”, etc.

I’m wondering, could there be a may to recover the draft by using the dev tools on the hung tab? Like crawling the dom and looking for string fragments that the draft contained? Could anyone suggest some code?

graphql – Create draft pull request through GitHub API

I am trying to create a draft pull request through a powershell script using the github pull request and GraphQL api.

Here is my mutation that works for regular pull requests (plus what I believe to be the solution for drafts) There is a fragment that gets added later that adds all of the authorization and other junk.

mutation {
  createPullRequest(input: {repositoryId: $(ConvertTo-Json $repoID), headRefName: $(ConvertTo-Json $sourceBranch), baseRefName: $(ConvertTo-Json $targetBranch), title: $(ConvertTo-Json $title), body: $(ConvertTo-Json $Description), **draft: $(ConvertTo-Json $True)**}) {
    pullRequest {
      ...prFields
    }
  }
}

The bolded portion is what I have tried, according to the GraphQL v4 documentation (I am on v4). All authorization headers and other junk works for the regular pull request, so in theory i just need to add the draft parameter. When I try this code, the script opens file explorer signifying the PR was not created.

GraphQL v4 documentation: https://docs.github.com/en/graphql/reference/mutations#createpullrequest
This shows the draft field for input: https://docs.github.com/en/graphql/reference/input-objects#createpullrequestinput

Thank you 🙂

8 – Content moderation “current revision” not set on nodes migrated from Drupal 7 where there are both a published and draft revisions

I am working on upgrading a Drupal 7 site to Drupal 8. The upgrade uses a content-only custom migration. The Drupal 7 source site and the Drupal 8 destination do not contain any custom modules other than a Drupal 8 custom module containing the custom migration configuration. Both source and destination site were created using the Standard install profile.

I have created migrations for both the node and node revisions of the Page content type. The page node consists of a media reference field and a paragraph reference field. After running the migration I notice that for migrate nodes which had both a published and draft version in which the draft revision is more recent than the published revision then the current content revision is not set.

Here is the moderation tab of such a node in Drupal 7:

enter image description here

Here is the moderation tab of the same node after migrating it to Drupal 8:

enter image description here

Following is the content_moderation_state_revision table from the destination database. The node in question is id = 3.

enter image description here

Following is the content_moderation_state_field_revision table from the destination database.

enter image description here

Here is the config for the Page node migration:

langcode: en 

status: true 

dependencies: {  } 

id: health_node_standard_page 

label: Standard Page Nodes 

audit: true 

migration_tags: 

  - Drupal 7 

  - Content 

migration_group: health 

deriver: DrupalnodePluginmigrateD7NodeDeriver 

source: 

  plugin: d7_node_extended 

  node_type: page 

process: 

  nid: tnid 

  vid: vid 

  langcode: 

    - 

      plugin: static_map 

      source: language 

      map: 

        und: en 

      bypass: true 

  title: title 

  uid: node_uid 

  status: status 

  created: created 

  changed: changed 

  promote: promote 

  sticky: sticky 

  revision_uid: revision_uid 

  revision_log: log 

  revision_timestamp: timestamp 

  field_h_content_blocks: 

    plugin: sub_process 

    source: field_content_blocks 

    process: 

      paragraphs: 

        plugin: migration_lookup 

        migration: 

          - health_paragraph_content_text 

        source: value 

      target_id: 

        - 

          plugin: extract 

          source: '@paragraphs' 

          index: 

            - 0 

      target_revision_id: 

        - 

          plugin: extract 

          source: '@paragraphs' 

          index: 

            - 1 

  field_h_image_featured: 

    - 

      plugin: sub_process 

      source: field_featured_image 

      process: 

        target_id: 

          - 

            plugin: migration_lookup 

            migration: health_media_image 

            source: fid 

  moderation_state: 

    - 

      plugin: static_map 

      source: moderation_state 

      map: 

        published: published 

        draft: draft 

        needs_review: needs_review 

      default_value: draft 

destination: 

  plugin: entity:node 

  default_bundle: h_standard_page 

migration_dependencies: 

  required: 

    - health_user 

    - health_paragraph_content_text 

    - health_media_image 

Here is the config for the Page node revisions migration:

langcode: en 

status: true 

dependencies: {  } 

id: health_node_revision_standard_page 

label: Node revisions - Standard Page 

audit: true 

migration_tags: 

  - Drupal 7 

  - Content 

migration_group: health 

deriver: DrupalnodePluginmigrateD7NodeDeriver 

source: 

  plugin: d7_node_revision_extended 

process: 

  nid: 

    - 

      plugin: get 

      source: nid 

  vid: 

    - 

      plugin: get 

      source: vid 

  langcode: 

    - 

      plugin: static_map 

      source: language 

      map: 

        und: en 

      bypass: true 

  title: title 

  uid: node_uid 

  status: 

    - 

      plugin: get 

      source: status 

  created: created 

  changed: changed 

  promote: promote 

  sticky: sticky 

  revision_uid: revision_uid 

  revision_log: log 

  revision_timestamp: timestamp 

  moderation_state: 

    - 

      plugin: static_map 

      source: moderation_state 

      map: 

        published: published 

        draft: draft 

        needs_review: needs_review 

      default_value: draft 

destination: 

  plugin: entity_revision:node 

  default_bundle: h_standard_page 

migration_dependencies: 

  required: 

    - health_node_standard_page 

Both migrations make use of a custom “Source” which extends the “d7_node” and “d7_node_revision” source plugins accordingly. These extended source plugins get the moderation state info of the relevant node or node revision.

/**
 * Extended version of core Drupal 7 node source from database.
 *
 * @MigrateSource(
 *   id = "d7_node_extended",
 *   source_module = "node"
 * )
 */
class D7NodeExtended extends Node {

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    // Make the node's moderation state available to migration.
    $database = $this->getDatabase();
    $vid = $row->getSourceProperty('vid');
    $query = $database
      ->select('workbench_moderation_node_history', 'wm')
      ->fields('wm', ('state'))
      ->condition('wm.vid', $vid)
      ->orderBy('wm.stamp', 'DESC')
      ->range(0, 1);
    $value = $query
      ->execute()
      ->fetchField();
    if ($value) {
      $row->setSourceProperty('moderation_state', $value);
    }

    return parent::prepareRow($row);
  }
}
/**
 * Extended version of core Drupal 7 node source from database.
 *
 * @MigrateSource(
 *   id = "d7_node_revision_extended",
 *   source_module = "node"
 * )
 */
class D7NodeRevisionExtended extends NodeRevision {

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {
    // Make the node revision's moderation state available to migration.
    $database = $this->getDatabase();
    $vid = $row->getSourceProperty('vid');
    $query = $database
      ->select('workbench_moderation_node_history', 'wm')
      ->fields('wm', ('state'))
      ->condition('wm.vid', $vid)
      ->orderBy('wm.stamp', 'DESC')
      ->range(0, 1);
    $value = $query
      ->execute()
      ->fetchField();
    if ($value) {
      $row->setSourceProperty('moderation_state', $value);
    }

    return parent::prepareRow($row);
  }
}