CD is not showing up in the "All Music" section when trying to rip a CD into Foobar2000

Ripping a CD using Foobar2000. Converter setup is:

  • Format = WAV
  • Destination = File name pattern: [%tracknumber%. ]%title% Overwrite existing files.

The CD is not showing up in the "All Music" section.

sharepoint online – Adding newly create group to “Site Permissions” section ( XXX/_layouts/15/user.aspx )

After creating a SharePoint group, you need to assign the permissions to it at site (web) level.

Add a new action ‘Send HTTP request to SharePoint’ and configure the action to use endpoint as below:

/_api/web/roleassignments/addroleassignment(principalid=<GROUPID>, roledefid=1073741827)

roledefid is for Permission Levels which are as follows:

1073741829 – Full Control

073741827 – Contribute

1073741826 – Read

<GroupID> is the id of the group.

Reference: SharePoint Group Operations in Microsoft Flow

power automate – Adding newly create site to “Site Permissions” section ( XXX/_layouts/15/user.aspx )

Hope you are all doing well.

I managed to use Power Automate to create SP groups and add users to them using the HTTP request action.

The problem i have is the newly created groups are created at the “root” (in People and Groups section) level but not in the site in the “Site Permissions” section so user that i add to the group still do not have access to the site.

I created a flow that adds the group(s) to “site Pages” , “Site assets” and to the specific libraries but they don’t have access to the site itself since the groups are not in “Site Permissions”.

Does anyone know how to add a newly created group to “Site Permissions” ?

Thanks a lot in advance !!

c++ – Allow one thread to execute section while others wait and resume

I have a requirement that is summarized below.

void update()
{
  |   |   |   |
  |   |   |   |
  |   |   |   |
 |  |  |  |
  =============
      meat           <--- Only one thread must execute here, the rest should skip it.
  =============
  |   |   |   |  <--- Other threads wait here until the "first" thread is done w/ "meat"
  |   |   |   |
  |   |   |   |
  "https://codereview.stackexchange.com/"https://codereview.stackexchange.com/"https://codereview.stackexchange.com/"/
}

From an outsider perspective, “meat” should be executed just once (by the first thread that encounters it)

This post is similar but differs in that it also requires other threads to execute the meat code block one at a time.

// testExecutive.cpp
#include <atomic>
#include <condition_variable>
#include <iostream>
#include <mutex>
#include <thread>

struct Target {
  int nhits = 0;
  inline void hit() { ++nhits; }
};

struct Executive {
  Executive() = delete;
  Executive(int _Id, Target &_Tgt) : m_Id(_Id), m_Ready(false), m_Tgt(_Tgt) {}
  void update() {
    { // only one thread can execute this
      std::scoped_lock<std::mutex> lk(m_Mtx);
      // std::cout << "++Acquired lk " << m_Id << " | tid: " <<
      // std::this_thread::get_id() << "++n";
      if (!m_Ready.load()) {
        // std::cout << "==Updating" << m_Id << " | tid: " <<
        // std::this_thread::get_id() << "==n";
        m_Ready.store(true);
        m_Tgt.hit();
        m_Cv.notify_all();
      }
      // std::cout << "++Releasing lk " << m_Id << " | tid: " <<
      // std::this_thread::get_id() << "++n";
    }

    // the rest should wait here
    std::mutex wait_mtx;
    std::unique_lock<std::mutex> lk(wait_mtx);
    m_Cv.wait(lk, (&)() -> bool { return m_Ready.load(); });
  }
  inline void reset() { m_Ready.store(false); }

private:
  int m_Id;
  Target &m_Tgt;
  std::condition_variable m_Cv;
  std::mutex m_Mtx;
  std::atomic_bool m_Ready;
};

int main(int argc, char *argv()) {
  int n(2);
  if (argc >= 2) {
    n = atoi(argv(1));
  }
  Target tgt;
  Executive e(1, tgt);
  auto updFn = (&e)() { e.update(); };

  // update same executive from 3 threads. Repeat n times.
  int i(n);
  while (i > 0) {
    e.reset();
    {
      std::thread t1(updFn), t2(updFn), t3(updFn);
      t1.join();
      t2.join();
      t3.join();
    }
    --i;
  }
  std::cout << (n == tgt.nhits ? "(OK)" : "(ERR)") << " Updates: " << n << " | "
            << "Hits: " << tgt.nhits << "n";
  return 0;
}

I setup a simple method to verify that exactly one out of three threads executes the desired code. The method hit() is called in Executive::Update. Compile and test like so.

jaswant@HAL9000:~$ g++ testExecutive.cpp -lpthread --std=c++17
jaswant@HAL9000:~$ ./a.out 2
(OK) Updates: 2 | Hits: 2
jaswant@HAL9000:~$ ./a.out 100
(OK) Updates: 100 | Hits: 100
jaswant@HAL9000:~$ ./a.out 2
(OK) Updates: 2 | Hits: 2
jaswant@HAL9000:~$ ./a.out 4
(OK) Updates: 4 | Hits: 4
jaswant@HAL9000:~$ ./a.out 8
(OK) Updates: 8 | Hits: 8
jaswant@HAL9000:~$ ./a.out 16
(OK) Updates: 16 | Hits: 16
jaswant@HAL9000:~$ ./a.out 256
(OK) Updates: 256 | Hits: 256
jaswant@HAL9000:~$ ./a.out 1024
(OK) Updates: 1024 | Hits: 1024
jaswant@HAL9000:~$ ./a.out 8192
(OK) Updates: 8192 | Hits: 8192
jaswant@HAL9000:~$ ./a.out 100000
(OK) Updates: 100000 | Hits: 100000

So, it works. Can anyone please point out bad usage of mutex/condition variables/locks and perhaps a way to do this w/o an atomic variable in the predicate?

Exim: Can there be multiple authenticators in the “Begin Authenticators” Section, one for each smtp relay?

My exim relays all its incoming email to third-party smtp relays. They use smtp authentication (username/password).

It seems I can only define ONE username/password in the begin authenticators section of the Exim config. I want to route certain email through one relay (with its own username/password auth), and other email through a second relay (its username/password auth is different than the first).

Here’s much of my config. The begin routers relays domains in the +local_domains list to smtp-relay-1 and the rest relays to smtp-relay-2.

begin routers

my_domains_relay:
  debug_print = "R: my_domains_relay for $local_part@$domain"
  driver = manualroute
  domains = +local_domains
  transport = remote_smtp_smarthost
  route_list = * "<+ smtp-relay-1.example.com:465"
  host_find_failed = defer
  no_more

smart_host_relay:
  debug_print = "R: smart_host_relay for $local_part@$domain"
  driver = manualroute
  transport = remote_smtp_smarthost
  route_list = * "<+ smtp-relay-2.example.net:465"
  host_find_failed = defer
  no_more

begin transports

remote_smtp_smarthost:
  debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
  driver = smtp
  port = 465
  hosts_require_tls = *
  hosts_require_auth = *
  protocol = smtps

begin authenticators

login:
  driver = plaintext
  public_name = PLAIN
  client_send = ^my-username^top-secret-password

What I want is to define separate username/password auth in the begin authenticators section, and assign each to a single router/transport. Right now, the username/password auth is global and used for all relays.

8 – How to update the layout builder’s section component configuration?

How to update a component in the node’s layout builder? I have used the following code.

$node = DrupalnodeEntityNode::load($nid);
$layout = $node->get('layout_builder__layout');
$sections = $layout->getSections();
foreach ($sections as $key => $section) {
      $components = $section->getComponents();
      foreach ($components as $component) {
        if ($component instanceof SectionComponent && $component->getPluginId() === 'myplugin_id') {
          $configurations = $component->get('configuration');
          $configurations('label_display') = "0";
          $component->setConfiguration($configurations);
        }
      }
}

But now I don’t know how to update the section and layout of the node.

Because $section->setComponent($component) is a protected method.

calculus – A related rate problem of a though with a trapezoidal cross section

From the MIT exercise book (2E-7):

A trough is filled with water at a rate of 1 cubic meter per second. The trough has a trapezoidal cross section with the lower base of length half a meter and one meter sides opening outwards at an angle of 45 degrees from the base. The length of the trough is 4 meters. What is the rate at which the water level h is rising when h is one half meter?

There is a solution here, but omits a lot of details that I couldn’t follow.

My main question is how to come up with the volume of the through.

views – Drupal rendered Section 1 overlay section 2

I have the following html code and css style:

html code:

<section class="intro" id="section1" data-speed="5" data-type="background" style="background-position: 50% 0px;">
    <div class="overlay">
    <div class="headline">
      {{ page.headline }}
    </div>
  </div>
    <a href="#" id="goto-section2" class="arrow-down">Get started</a>
</section>
<main role="main" class="main">
  <div class="layout-content">
    <section id="section2" class="section">
      <div class="container">
          {{ page.before_content }}
      </div>
    </section>
  </div>
</main>

#section1 {
  display: block;
  height: 100%;
  width: 100%;
}

.intro {
  height: 100%;
  width: 100%;
  background: url(../img/background.jpg) no-repeat center top fixed;
  -webkit-background-size: 100% auto;
  -moz-background-size: 100% auto;
  -o-background-size: 100% auto;
  background-size: 100% auto;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  display: block;
  background-attachment: fixed;
}

css style:

.overlay {
  display: block;
  position: absolute;
  top: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.section {
  position: relative;
  padding: 40px 0 40px 0;
  display: block;
}

.headline {
  display: block;
  position: absolute;
  text-align: center;
  top: 48%;
  width: 100%;
  z-index: 111;
}

.headline div.flexslider {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  display: block;
  text-align: center;
  width: 100%;
}

.flexslider {
  margin: 0 0 60px;
  background: #FFFFFF;
  border: 4px solid #FFFFFF;
  position: relative;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -o-border-radius: 4px;
  border-radius: 4px;
  zoom: 1;
}

.arrow-down {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 11;
  height: 60px;
  width: 70px;
  margin-left: -35px;
  background: url(../img/bg-arrow-down.png) no-repeat 21px 26px rgba(0, 136, 204, 0.8);
  background-size: 28px 16px;
  text-indent: -9999px;
  display: block;
}

#section1 h2 {
  color: #FFFFFF;
  margin-bottom: 4px;
  font-size: 40px;
  line-height: 48px;
  text-transform: uppercase;
  font-weight: 700;
}

#section1 p {
  color: #FFFFFF;
}

Section 1 followed by section 2 rendered in pure html mock up, but in drupal (version 8.9.11) section 1 overlay section 2.

In Drupal section 1 contained in custom block and rendered by custom view. While section 2 is contained in custom block standard view.

Please help to get drupal rendering same as pure html.

theming – Drupal – Section 1 overlay section 2

I have the following html code and css style

<section class="intro" id="section1" data-speed="5" data-type="background" style="background-position: 50% 0px;">
    <div class="overlay">
    <div class="headline">
      {{ page.headline }}
    </div>
  </div>
    <a href="#" id="goto-section2" class="arrow-down">Get started</a>
</section>
<main role="main" class="main">
  <div class="layout-content">
    <section id="section2" class="section">
      <div class="container">
          {{ page.before_content }}
      </div>
    </section>
  </div>
</main>

#section1 {
  display: block;
  height: 100%;
  width: 100%;
}

.intro {
  height: 100%;
  width: 100%;
  background: url(../img/background.jpg) no-repeat center top fixed;
  -webkit-background-size: 100% auto;
  -moz-background-size: 100% auto;
  -o-background-size: 100% auto;
  background-size: 100% auto;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  display: block;
  background-attachment: fixed;
}

.overlay {
  display: block;
  position: absolute;
  top: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.section {
  position: relative;
  padding: 40px 0 40px 0;
  display: block;
}

.headline {
  display: block;
  position: absolute;
  text-align: center;
  top: 48%;
  width: 100%;
  z-index: 111;
}

.headline div.flexslider {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  display: block;
  text-align: center;
  width: 100%;
}

.flexslider {
  margin: 0 0 60px;
  background: #FFFFFF;
  border: 4px solid #FFFFFF;
  position: relative;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -o-border-radius: 4px;
  border-radius: 4px;
  zoom: 1;
}

.arrow-down {
  position: absolute;
  bottom: 0;
  left: 50%;
  z-index: 11;
  height: 60px;
  width: 70px;
  margin-left: -35px;
  background: url(../img/bg-arrow-down.png) no-repeat 21px 26px rgba(0, 136, 204, 0.8);
  background-size: 28px 16px;
  text-indent: -9999px;
  display: block;
}

#section1 h2 {
  color: #FFFFFF;
  margin-bottom: 4px;
  font-size: 40px;
  line-height: 48px;
  text-transform: uppercase;
  font-weight: 700;
}

#section1 p {
  color: #FFFFFF;
}

Would expect section 1 followed by section 2, but section 1 overlay section 2.
Please help to get the expected

M2 – How to avoid element auto hiding after moving element to catalog.topnav section?

I followed the link for customer account links drop down, https://bsscommerce.com/confluence/step-by-step-tutorial-to-customize-layout-illustrations/

After move the element

During refresh the page the element showing, after complete page refresh the element hide.