nodes – Clip sites to a specific content type

I’m searching for a possibility to clip websites to Drupal much like the Clipper Chrome extension for Notion or Evernote.

In Notion, it lets me add Youtube videos to any database, takes the page title, the platform icon, the thumbnail, the URL and embeds the video to a new entry in my database. I would like to do the same with Drupal and expend on the data which is clipped like getting the channel and create a relation from one content type to another.

nodes – Change max length of title in a custom block added via a template file

A drupal 7 website has a custom block added via a template file. The block displays previews of article content type belonging to a certain rubric. It uses the following line to do so:

$block = module_invoke('views', 'block_view', 'given-block-name'); echo render($block('content'));

The articles displayed have their titles truncated at the length of 50 characters. I could not find the number 50 in the files on the hosting, so it should be somewhere in the database, and so somehow changeable via the admin panel. Yet I am having a very hard time finding where to change this number. I have changed the length of the teaser for the article content, but that apparently bears no influence on what is displayed in the given block.

Loading nodes that are only available to the current user

How do I programatically load nodes that are available to current user?

I used noad_load_multiple but it seems to directly load nodes from the db bypassing permissions.

I’m still using Drupal 7, btw.

c# – Sentinel nodes in a 2-3 tree

I want to implement a 2-3 tree in C# language, where every leaf has a unique key. The keys are from a given class that implements the IComparable interface (the specific class is unknown, and it’s should work for every class which implements the interface).

I want to use two sentinel nodes to represent plus and minus infinity, but I can’t figure out the best way to do it, that won’t be too complex.

I thought about creating a class which will implement the IComparable interface, and use it as two leaves in the tree, but I am not sure if that’s the best thing to do or not.

which CPU is better for Server Nodes (Xeon E-2288G vs AMD Ryzen 7 3700X)

Hello

I need new server to produce KVM VPS which is better for performance Xeon E-2288G vs AMD Ryzen 7 3700X

thanks… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1834957&goto=newpost

algorithms – Some nodes in binary search had broken.how we can fix it in-place by swapping nodes?

Given a binary search tree(can have any height) .Some nodes its value
changed and violate bst property how we can recover binary search
tree property in-place by just swapping a node with its children’s.

I think it can be done in $O(n^2)$ because a bst has height at most $n$ and start from parent of leaves and if two nodes violate bst property we can swap it by parent,but i want give a formal prove,anyone have any suggestion?

nodes – Access Paragraph fields programmatically in custom module

I have a Product content type with these fields; title, body, and one entity reference revisions(Paragraph: field_select_module).

I am creating a custom REST API(custom module) to export the fields in the JSON. I am able to print the title and body. Could someone help me to print the paragraph fields which have title and image(Media) and title and image will repeat 3 times. It should be inside this array ‘product_list’ => array(),

Here is my controller.

<?php

namespace Drupaldrupalup_json_apiController;

use DrupalCoreControllerControllerBase;
use DrupalnodeEntityNode;
use SymfonyComponentHttpFoundationJsonResponse;
use DrupalparagraphsEntityParagraph;

/**
 * Controller for export json.
 */
class JsonApiController extends ControllerBase {

  /**
   * {@inheritdoc}
   */
  public function data() {
    $json_array = array(
      'data' => array()
    );
    $nids = Drupal::entityQuery('node')->condition('type','product_main_categories')->execute();
    $nodes =  Node::loadMultiple($nids);

    foreach ($nodes as $node) {
      $json_array = array(
        'id' => $node->get('nid')->value,
        'title' =>  $node->get('title')->value,
        'content' => $node->get('body')->value,
        'product_list' => array(
            
        ),
      );
    }
    return new JsonResponse($json_array);
  }
}

algorithms – Finding largest disjoint subtrees spanning nodes

I have a taxonomy (tree) of product categories. To each leaf product category, I have assigned a shop department where the products of a given category can be found.

Now for each department, I would like to find the smallest number of the largest subtrees in the taxonomy.

For instance, in the example below leaf nodes have been assigned one of two departments $A$ and $B$.

example

The expected solution would be: $A$ has two subtrees, namely $x_2$ and $x_7$, $B$ has one subtree $x_4$.

The solution where $A$ has $x_1$ subtree is wrong because $x_1$ is the ancestor of nodes that belong to another department.

The solution where $A$ has $x_3$ and $x_7$ subtrees is wrong because we want the biggest subtrees possible.

Is it a known problem?

Is there a solution for it?

How do internet wallets connected to full blockchain nodes

How do internet wallets such as Coinbase connect to the a blockchain node? Doesn’t the node itself create a default wallet object on startup? How is this replaced by internet wallets which hold multiple address until account credentials.

algorithms – Shortest path of length $5k+1$ where each block of five nodes are distinct in an unweighted, undirected graph

The following problem (I’m paraphrasing) appeared in the 2019 Balkan Olympiad in Informatics:

Five friends are on a road trip in a country with $N$ cities and $M$ bidirectional roads joining them. They start in city $1$ and wish to end in city $N$.

All of them love driving, so they move in the following fashion:

  • Each day, they start in the city they ended at the previous day (city $1$ on the first day) and follow a path consisting of exactly five roads (i.e. they visit six cities and the first visited city is the last visited city of the previous day).
  • They may visit a city multiple times across multiple days, but they may not visit a city multiple times in the same day.
  • They can’t stop in the middle of the path: if they visit city $N$ after using $k < 5$ roads on some day, they can’t end their trip.

Find the shortest path needed to complete this road trip, or determine that it isn’t possible. In the case that there are multiple shortest paths, find the lexographically smallest one when looking at only the sequence formed by the ($5k+1$)-th cities visited on the path (i.e. city $1$, …, city $N$)

$N leq 10^5$ and $M leq 5 cdot 10^5$.

The official problem statement can be found on the contest website (day 2 problem 2).

I haven’t been able to find an efficient solution to this problem (from both asking others and searching online), and nobody solved it in the contest. I currently have no idea how to even approach it.

Is there an efficient algorithm to solve this problem, perhaps even for $k$ friends instead of five friends? Since $N$ and $M$ are so large, the algorithm should be linear or linearithmic.