t sql – Compatibility level of databases based on the SQL Server version

We need to look for databases that do not have the right level of compatibility on a given instance. For example, if there are databases in a SQL Server 2016 instance that do not have compatibility level 130, they must be listed. On a SQL Server 2017, databases that do not have compatibility level 140 must also be listed.

Script will be helpful.

procedural generation – FMB change based on derivative and noise value

I'm still working on my procedural terrain generation and the ideas of Sean Murray (No Mans Sky programmer). I looked at this GDC17 presentation, but there are a few things that make no sense to me:

Enter image description here

Change the amplitude based on currentGain AND noise value? This leaves only all highs (large noise values ​​like 1) unchanged and the small ones make the amplitude really tiny. How does that represent the height erosion?

The audio also does not help much, he did not go into code details.

Any ideas that make sense?

sharepoint online – dynamically filter documents in a document library based on their folders and subfolders

If there are a limited number of sites, you can use the search.

Who will be the user? A "power user" who can be shown how to write search queries? If not, a user-friendly interface takes on additional tasks.


(path:"https://yourDomain/HR/policies/external" OR path:"https://yourDomain/HR/general document/external") AND isdocument=1

The search can be browsed through Web Parts, custom Web Parts, or custom code using REST queries.

From REST:

https://yourDomain/_api/search/query?querytext='(path:"https://yourDomain/HR/policies/external" OR path:"https://yourDomain/HR/general document/external") AND isdocument=1'

REST to search for a keyword in the path:


Second, even if we find a way to perform such filtering from multiple document libraries.

Search by path: or other metadata can search across all sites.

Oracle – how to make a query based on a shift schedule (day / middle / swings)

I have an existing query that I thought was correct, but after reviewing it seems to pull the wrong numbers

    ,SUM(COUNT(TKTNUM)) OVER (ORDER BY (TRUNC(E.ESCDTTM,'Y'),'YYYY'))  -- c/o Littlefoot and Stew Ashton 

"SWINGS" draws tickets between 00:00 and 06:00 or 22:00 and 24:00 on the same day. For example, a ticket was created on 02 November at 01:00. If I pull the report, it will be counted for SWINGS on November 2nd if it is to apply for service on November 1st.

I came up with something that would probably help, but I'm not 100% sure.

    WITH Shift_Sched (shiftdate,shiftsched) as
                WHEN TO_CHAR(TRUNC(sysdate,'MI'),'HH24:MI')  BETWEEN '06:00' AND '23:59' THEN TRUNC(sysdate,'DD') 
                WHEN TO_CHAR(TRUNC(sysdate,'MI'),'HH24:MI')  BETWEEN '00:00' AND '05:59' THEN TRUNC(sysdate -1,'DD')
        END as "SHIFT DATE",
                WHEN TO_CHAR(TRUNC(sysdate,'MI'),'HH24:MI') BETWEEN '06:00' AND '14:00' THEN 'MIDS' 
                WHEN TO_CHAR(TRUNC(sysdate,'MI'),'HH24:MI') BETWEEN '14:00' AND '22:00' THEN 'DAYS' 
                ELSE 'SWINGS'
        END as "SHIFT SCHED"
        FROM DUAL
    SELECT shiftdate,shiftsched,COUNT(shiftsched)  
    FROM shift_sched
    GROUP by shiftdate,shiftsched

Any help would be appreciated

Conditional Join query or another way to create a view based on two tables in Postgresql

I'm trying to create a view that combines these two materialized views with the following rules.

Returns only rows that exist in all_products, though they exist in visible_products, but if there is no result in visible_products, I want all the rows of all_products

I am unable to figure it out with links or union. Can this be solved with a case description? If both tables have rows, the inner join gives me the right result, and if visible_products do not have matching rows, a left join works, but I need a join or some other solution that works in both cases.

Both all_products and visible_products are materialized views where I can modify / add columns as needed.

Example a

id, market_id
1, 100
1, 101
1, 102

id, market_id
1, 100

result product_view

Example b

id, market_id
2, 103
2, 104
2, 105

id, market_id

result product_view
2, 103
2, 104
2, 105

Any help is greatly appreciated


Were there projects that worked to create a stable coin that is not based on a transparent blockchain?

Stablecoins have applications such as the CDP Dai by Makerdao and a privacy coin like Monero. But is there a project that combines these two technologies together to create a stable coin that is also private, and you can not see how much money was sent and where it went?

google sheets – Changes the cell color based on another cell that contains text

I'm new to Google Sheets and I'm trying to create a custom formula in conditional formatting. I'll see if anyone is kind enough to help me.

The image below shows a sample size of two serial numbers. What I need are the cells to change the color if a match is found. What I did before was to put both lists under one column and use the formula = countif (B: B, B1)> 1. However, this formula no longer works for me because my list now contains cells that contain more than one serial number.
Enter image description here
So, what I need help creating a formula that would change the color of cells if something is found in column C in column B. For cells with more than one serial number, the cell in column B would only change if all the serial numbers in the cell match. I basically try to verify that all serial numbers are in column C in column B. But I do not know how to do it or cells with more than one S / N.

That sounds like a super complicated task. I do not know if I should ask here. If I am in the wrong place, please show me where to go

google sheets – Copy cell information based on cell compliance with specific specifications

Hope you can help with this, you usually get along well with one or two functions, but this does not work for me 🙂

I need a code in N24, which is currently #FEHLER! to do the following:
If G24 = AAA AND H24: L24 contains the text DEL 1, E24 (3) should be displayed.

The result should be 3 under LIST, since DEL 1 is selected in one of the cells.
It should check all the H-L columns, but only list the cell information from the TEXT column, if that row also contains AAA in STATUS.

Hope it makes sense.

Screenshot of data

8 – How do I get a section of the menu tree based on the current node?

A way was found to fulfill all cases without having to create multiple blocks (visibility rules would be odd) or create different menus. I could not achieve this by assuming a content type as in the question, since the same content type could be nested up to several areas of the menu and does not really know if the current depth you were in was a parent type (where ) The menu block should "start" (not necessarily the parent of the page).

I've decided to cheat a bit and use the URL and the alias pattern. If the current path matched a pattern and the URL consisted of a certain number of segments, I could see that I was in a particular part of the menu where the behavior should be different from others. In this case, the current page and its children should be used instead of the parent of the current page and its siblings:

class MenuBlockEnhanced extends MenuBlock {

   * {@inheritdoc}
  public function build() {
    $node = Drupal::routeMatch()->getParameter('node');

    // If we are not on a node route, get out.
    if (!$node) {
      return parent::build();

    // If the menu being rendered is not specifically the sub nav, get out.
    if ($this->configuration("suggestion") != 'subnav') {
      return parent::build();

    $current_path = Drupal::request()->getRequestUri();
    $parts = explode('/', $current_path);
    $build = parent::build();

    /** @var DrupalCoreMenuMenuLinkManager $menu_link_manager */
    $menu_link_manager = Drupal::service('plugin.manager.menu.link');
    $route_params = array('node' => $node->id());
    $menu_links = $menu_link_manager->loadLinksByRoute('entity.node.canonical', $route_params, 'main');
    $set_parent = TRUE;

    $params = new MenuTreeParameters();

    // I don't really know of another way to 'tell' we are on a project, since
    // a project can have projects under it. We can only rely on the path and
    // how many 'parts' are in the path - anything over 4 parts would be anything
    // nested in this section.
    if (preg_match('/programs-projects/i', $current_path) && count($parts) == 4) {
      $parent = reset($menu_links)->getPluginId();
      $set_parent = FALSE;
    } else {
      $parent = reset($menu_links)->getParent();

    $uuid = str_replace('menu_link_content:', '', $parent);
    $parent_menu_content = current(Drupal::entityTypeManager()
     ->loadByProperties(array('uuid' => $uuid)));

    $params->setActiveTrail(($parent, reset($menu_links)->getPluginId()));
    $tree = $this->menuTree->load($parent, $params);

    // Transform the tree using the manipulators you want.
    $manipulators = array(
      // Only show links that are accessible for the current user.
      array('callable' => 'menu.default_tree_manipulators:checkAccess'),
      // Use the default sorting of menu links.
      array('callable' => 'menu.default_tree_manipulators:generateIndexAndSort'),
    $tree = $this->menuTree->transform($tree, $manipulators);

    $link = end($parent_menu_content->link->getValue())('uri');

    $element = $this->menuTree->build($tree);
    $build('#items') = $element('#items')($parent)('below');

    if ($link != 'route:' && $set_parent) {
      $build('#top_parent') = $element('#items')($parent);

    if (empty($build('#cache')('contexts'))) {
      $build('#cache')('contexts') = ('user.permissions');
      $build('#cache')('tags') = ('config:system.menu.main');

    return $build;


The caching strategy comes exactly from what would normally be there, frankly, I probably do not even have to specify it since I'm already calling parent::build() and just reduce this code.

In the template I fix the problem "Do I only print siblings or this page and their children?" with the in_active_path check and simulate a control break in the twig macro (see: break = true):

{% import _self as menus %}

{{ menus.menu_links(items, attributes, 0, top_parent) }}

{% macro menu_links(items, attributes, menu_level, top_parent) %}
  {% import _self as menus %}

  {% if items %}
    {% if top_parent %}
    {% set parent_list_classes = ( 'secondary-nav__item', 'secondary-nav__item--parent' ) %} {% set parent_link_classes = ( 'link', 'link--left-arrow', ) %} {{ link(top_parent.title, top_parent.url, { 'class': parent_link_classes }) }} {{ menus.menu_child_links(items, attributes, 0) }}
{% else %} {{ menus.menu_child_links(items, attributes, 0) }} {% endif %} {% endif %} {% endmacro %} {% macro menu_child_links(items, attributes, menu_level) %} {% import _self as menus %}
    {% set break = false %} {% for item in items if not break %} {% set list_classes = ( 'secondary-nav__item', item.in_active_trail ? 'is-active' ) %} {{ link(item.title, item.url) }} {% if item.below and item.in_active_trail %} {% set break = true %} {{ menus.menu_child_links(item.below, attributes, menu_level + 1) }} {% endif %} {% endfor %}
{% endmacro %}

The menu works exactly as it is required in all cases. It goes to the maximum depth and secures the chain (with the parent blue link at the top).