Carousel Display

Hi,

How do I post more than 10 cards in Facebook carousel ads?
On Facebook, I can create a maximum of 10 cards per ad! … But I've seen other online stores, the carousel advertising on Facebook with Endless … tons … a lot more than 10 cards per carousel !!!

How is that possible? How can I do that?

thanks

8 – WebDriverTestBase can not place / display the block configuration in an AJAX text

I write a bump test that checks the output of a page when a user has a particular cookie. Based on this cookie I have a block operated by Ajax Block which inserts the personalized block content for this user.

I tried to write the test first before implementing the implementation. From what I read, I have to use WebDriverTestBase because I'm testing AJAX behavior. Here's the beginning of the test:

class UserGreetingTest extends WebDriverTestBase {

  /**
   * {@inheritdoc}
   */
  protected static $modules = ('node', 'block', 'block_ajax', 'user', 'mymodule', 'twig_tweak', 'system');

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    parent::setUp();

    $this->container->get('module_installer')->uninstall(('page_cache'));
    $this->container->get('theme_installer')->install(('mytheme'));
    $this->container->get('config.factory')->getEditable('system.theme')->set('default', 'mytheme')->save();

    $this->drupalPlaceBlock('user_greeting', ('region' => 'user_section', 'theme' => 'mytheme'));

    $this->createContentType(('type' => 'page'));
    $this->drupalCreateNode(('type' => 'page'));
  }

  /**
   * Test the output of the block.
   */
  public function testUserGreeting() {
    $this->drupalGet('/node/1');

When calling drupalGet, the test fails and terminates with the following command:

There was 1 error:

1) Drupal Tests mymodule Functional DetectCookieTest :: testUserGreeting Undefined index: ajaxId

I could not really say what was going on, so I implemented my block for the first time anyway. The block works.

My block:

/**
 * Provides a 'Greeting' block.
 *
 * @Block(
 *  id = "user_greeting",
 *  admin_label = @Translation("User Greeting"),
 * )
 */
class HelloUser extends AjaxBlockBase {

  /**
   * The cookie we are looking for in a client session.
   */
  const COOKIE_NAME = 'CUSTOM_COOKIE';

  /**
   * {@inheritdoc}
   */
  public function build() : array {
    $build = parent::build();
    $request = Drupal::request();
    $cookie = $request->cookies->get(self::COOKIE_NAME);
    $has_session = FALSE;

    $username = NULL;
    $greeting = NULL;
    $login_url = 'https://site/login';

    if (isset($cookie)) {
      $url = Url::fromUri($login_url);
      $greeting = Link::fromTextAndUrl('Welcome, ' . $cookie, $url)->toRenderable();
      $has_session = TRUE;
    }

    $build += (
      '#theme' => 'user_greeting',
      '#greeting' => $greeting,
      '#login_url' => $login_url,
      '#has_session' => $has_session,
      '#username' => $username,
      '#cache' => (
        'max-age' => 0,
      )
    );

    return $build;

Looks pretty normal to me.

I can not really say why the test fails because the implementation works. I can manually call the site in different browsers, and those with the cookie will show the right thing I want to see, and the content will be retrieved via Ajax Block.

It seems like Ajax Block functional works, why should my test fail if the block lacks a configuration value that it should automatically have when placing it? How do you begin to debug why a test like this fails?

The BlockCreationTrait has this task:

Add support for creating custom block instances.

Could that be the culprit?

WORDPRESS category page does not display a custom post type

I have a problem with the custom post type category in WordPress.

If I have categorized posts (for example, in the "Test" category) and then clicked into that category, all posts categorized as "Test" will be displayed. That's good, but …

If I categorized a post (for example, in "trial") from a custom post type (created with the "Custom Post Type UI" plugin), that post appears in the "trial" category. However, if I click on the category "trial", it will be displayed on the page "opps nothing"

It works well in short posts from WordPress, but when I categorize posts from custom post types and click into that category, it will show up on the "Nothing found" page.
although post show that this category is assigned.

Maybe that's the problem in category.php "get_post_type ()"

get_template_part (& # 39; template-parts / content & # 39 ;, get_post_type ());

I hope you know what I mean
Thank you and wait for an answer!
hello five!

Graphics – Create a nine-region cluster diagram with tooltip to display labels for 2D points

I'm trying to create a cluster graph with nine regions using the tooltip to show labels associated with 2D points that are also displayed on them. I DO NOT want to use "FindClusters". I want to design my own cluster diagram, as explained below. The following dummy data consists of 2-D points, each point having an identifier named "NAICS" (NAICS stands for "North American Industry")
Classification system ").

mockdataWithNAICS = {{"29-1141", 186, 112}, {"41-2031", 123, 92}, {"41-1011", 65, 404}, {"43-4051", 108, 646}, {"31-1014", 643, 246},
        {"49-9071", 356, 363}, {"43-1011", 543, 381}, {"43-5081", 268, 674}, {"53-3032", 416, 653}, {"37-3011", 514, 428}, {"37-2012", 501, 58},
        {"33-9032", 441, 598}, {"35-2014", 633, 138}, {"29-2061", 414, 590}, {"53-3033", 98, 155}, {"35-3031", 179, 431}, {"49-3023", 93, 623},
        {"35-3021", 37, 578}, {"41-2011", 256, 237}, {"37-2011", 302, 50}, {"47-1011", 518, 2}, {"11-9111", 313, 294}, {"31-9092", 698, 136},
        {"43-3031", 608, 610}, {"43-6013", 562, 515}, {"13-2011", 415, 327}, {"21-1093", 191, 72}, {"41-4012", 212, 92}, {"41-3031", 546, 418},
        {"31-1011", 591, 49}, {"47-2031", 405, 526}, {"41-3021", 191, 297}, {"15-1151", 442, 445}, {"43-6011", 118, 185}, {"49-1011", 472, 402},
        {"53-7062", 348, 552}, {"43-4171", 409, 396}, {"43-6014", 348, 247}, {"53-1031", 629, 59}, {"47-2061", 589, 534}, {"27-1026", 22, 377},
        {"29-1069", 445, 74}, {"49-9021", 647, 539}, {"43-9061", 25, 543}, {"11-1021", 19, 165}, {"41-1012", 482, 199}, {"29-1062", 1, 68},
        {"43-4081", 217, 112}, {"41-3099", 663, 66}, {"11-3031", 329, 392}, {"53-7061", 357, 515}, {"35-2021", 488, 245}, {"31-9091", 318, 679},
        {"51-1011", 650, 349}, {"11-9051", 38, 145}, {"53-3031", 166, 691}, {"39-9021", 561, 127}, {"39-5012", 665, 362}, {"47-2111", 397, 532},
        {"43-3071", 326, 271}, {"29-2034", 361, 450}, {"35-9011", 12, 366}, {"29-1123", 16, 211}, {"15-1142",162, 662}, {"11-2021", 520, 164},
        {"29-2031", 339, 619}, {"25-2011", 263, 564}, {"41-4011", 551, 301}, {"29-2055", 76, 549}, {"29-2052", 285, 640}, {"13-2072", 370, 542},
        {"35-2012", 512, 547}, {"11-2022", 130, 154}, {"15-1132", 188, 274}, {"13-2052", 338, 587}, {"15-1199", 455, 5}, {"35-9031", 595, 472},
        {"17-2051", 648, 481}, {"11-9199", 430, 189}, {"39-3091", 29, 396}, {"47-2152", 412, 342}, {"29-1122", 582, 20}, {"11-9141", 276, 4},
        {"25-2021", 666, 617}, {"15-1134", 236, 334}, {"37-1011", 407, 664}, {"29-1063", 260, 278}, {"49-3031", 161, 354}, {"41-9022", 185, 144},
        {"41-9041", 551, 628}, {"25-2031", 529, 505}, {"29-2071", 548, 296}, {"29-1127", 373, 124}, {"21-1023", 473, 71}, {"29-1067", 489, 569},
        {"29-1071", 539, 277}, {"11-3121", 390, 348}, {"11-9021", 634, 20}, {"53-3041", 589, 258}, {"49-3021", 47, 206}};

L = Length(mockdataWithNAICS);
counter = Range(L);
counter = Range(L);
mock2Dvalues = {mockdataWithNAICS((#))((2)), mockdataWithNAICS((#))((3))} & /@ counter

The following measurements are required to create a raster:

minx = Round(Min(Table({mock2Dvalues((i))((1))}, {i, 1, L})));
maxx = Round(Max(Table({mock2Dvalues((i))((1))}, {i, 1, L})));

dx = Round(Subdivide(minx, maxx, 3));

miny = Round(Min(Table({mock2Dvalues((i))((2))}, {i, 1, L})));

maxy = Round(Max(Table({mock2Dvalues((i))((2))}, {i, 1, L})));

dy = Round(Subdivide(miny, maxy, 3));

gridpts = Tuples({dx, dy});

Use the following diagram to visualize the grid and all data points:

plt1 = ListPlot(gridpts, Frame -> True, PlotStyle -> Black, 
  GridLines -> {dx, dy}, Epilog :> {Blue, Point(mock2Dvalues)})

The following diagram shows the grid
Points using the tooltip to define the following nine regions:

plt2 = ListPlot(Tooltip(gridpts), Frame -> True, PlotStyle -> Black, 
  GridLines -> {dx, dy})

Here we define the nine cluster regions. We assign colors to the region name to map the 2D points to the regions to which they belong, depending on the color. The colors are arbitrary:

    magentaregion = Rectangle(gridpts((1)), gridpts((6)))

    orangeregion = Rectangle(gridpts((5)), gridpts((10)))

    cyanregion = Rectangle(gridpts((9)), gridpts((14)))

    redregion = Rectangle(gridpts((2)), gridpts((7)))

    blueregion = Rectangle(gridpts((6)), gridpts((11)))

    greenregion = Rectangle(gridpts((10)), gridpts((15)))

    lightgrayregion = Rectangle(gridpts((3)), gridpts((8)))

    yellowregion = Rectangle(gridpts((7)), gridpts((12)))

    blackregion = Rectangle(gridpts((11)), gridpts((16)))

Here the points are paid out by region, to which they belong:

remagentapts = Select(mock2Dvalues, # (Element) magentaregion &)

orangepts = Select(mock2Dvalues, # (Element) orangeregion &)

cyanpts = Select(mock2Dvalues, # (Element) cyanregion &)

redpts = Select(mock2Dvalues, # (Element) redregion &)

bluepts = Select(mock2Dvalues, # (Element) blueregion &)

greenpts = Select(mock2Dvalues, # (Element) greenregion &)

lightgraypts = Select(mock2Dvalues, # (Element) lightgrayregion &)

yellowpts = Select(mock2Dvalues, # (Element) yellowregion &)

blackpts = Select(mock2Dvalues, # (Element) blackregion &) 

The following diagrams are required to create the following final diagram:

plt3 = ListPlot(magentapts, Frame -> True, PlotStyle -> Magenta, 
   GridLines -> {dx, dy}, PlotRange -> {{minx, maxx}, {miny, maxy}}, 
   AspectRatio -> 1);

plt4 = ListPlot(orangepts, Frame -> True, PlotStyle -> Orange, 
   GridLines -> {dx, dy}, PlotRange -> {{minx, maxx}, {miny, maxy}}, 
   AspectRatio -> 1);

plt5 = ListPlot(cyanpts, Frame -> True, PlotStyle -> Cyan, 
   GridLines -> {dx, dy}, PlotRange -> {{minx, maxx}, {miny, maxy}}, 
   AspectRatio -> 1);

plt6 = ListPlot(redpts, Frame -> True, PlotStyle -> Red, 
   GridLines -> {dx, dy}, PlotRange -> {{minx, maxx}, {miny, maxy}}, 
   AspectRatio -> 1);

plt7 = ListPlot(bluepts, Frame -> True, PlotStyle -> Blue, 
   GridLines -> {dx, dy}, PlotRange -> {{minx, maxx}, {miny, maxy}}, 
   AspectRatio -> 1);

plt8 = ListPlot(greenpts, Frame -> True, PlotStyle -> Green, 
   GridLines -> {dx, dy}, PlotRange -> {{minx, maxx}, {miny, maxy}}, 
   AspectRatio -> 1);

plt9 = ListPlot(lightgraypts, Frame -> True, PlotStyle -> LightGray, 
   GridLines -> {dx, dy}, PlotRange -> {{minx, maxx}, {miny, maxy}}, 
   AspectRatio -> 1);

plt10 = ListPlot(yellowpts, Frame -> True, PlotStyle -> Yellow, 
   GridLines -> {dx, dy}, PlotRange -> {{minx, maxx}, {miny, maxy}}, 
   AspectRatio -> 1);

plt11 = ListPlot(blackpts, Frame -> True, PlotStyle -> Black, 
   GridLines -> {dx, dy}, PlotRange -> {{minx, maxx}, {miny, maxy}}, 
   AspectRatio -> 1);

This diagram shows the cluster diagram with nine regions with the points colored by the region to which they belong:

finalchart = Show({plt3, plt4, plt5, plt6, plt7, plt8, plt9, plt10, plt11})

At last; We make an association between the NAICS codes and their 2D points as follows:

mockdataWithNAICSlabels = 
  Association(#((1)) -> #((2 ;; 3)) & /@ mockdataWithNAICS);

Dataset(mockdataWithNAICSlabels)

My question is: how can I map the NAICS codes to their respective points BY COLOR REGION so that when I use tooltips; The NAICS codes are displayed for each item in the final chart above. Thanks!

How can the display resolution be simulated realistically when testing the responsive web UI?

If you want to test different screen sizes and features, I recommend that you use Chrome Dev Tools' device mode, which I think you comment on in the question. You can set up your own devices or simply play with the responsive device.

Nothing is as close as testing in the real device, For example, iOS Safari has an error with viewport units that is not replicated with DevTools. To test iOS with higher fidelity, I use the Xcode Simulator, which reproduces the bug.


Other resources:

Material Design – Resizer

bash – Influxdb does not display the name of the measurement sent by the collectd exec plugin

I use collectd to collect the system metric and press it into the inflow db.

To monitor the running process, I've written a script that uses the collectd exec plugin to move my custo m metric into the influx db … my script for the exec plugin is

#!/bin/bash
tmpfile=$(mktemp)
HOSTNAME="${COLLECTD_HOSTNAME:-slave1-collectd}"
INTERVAL="${COLLECTD_INTERVAL:-6}"
while sleep "$INTERVAL"; do
sudo systemctl list-units --type service --all | grep running | awk -v OFS='t' '{ print $1, $2, $4 }' > "$tmpfile"
done

My collected conf file


        Exec developer "/home/developer/process.sh"

If I ran the show measurement command in influxdb, it shows the measurement of another plugin that is not an exec plugin:

cpu_value
df_value
disk_io_time
disk_read
disk_value
disk_weighted_io_time
disk_write
interface_rx
interface_tx
load_longterm
load_midterm
load_shortterm
memory_value
processes_majflt
processes_minflt
processes_processes
processes_read
processes_rx
processes_syst
processes_threads
processes_tx
processes_user
processes_value
processes_write
table_value
uptime_value
users_value

Can someone help me please!

c – Please be for tomorrow How are passwords generated for each entered name and how is a function created to display the next password to be retrieved?

The program is based on passwords that are automatically generated for each registered user, e.g. For example, answering a bank that generates a password and displays the next password to call … Follow the code below.

#include   
#include   

struct NO{  
 char dados(100);  
 int senha;  
 struct NO *prox;  
};  
typedef struct NO no;  

int tam;  

int menu(void);  
void inicia(no *FILA);  
void opcao(no *FILA, int op);  
void exibe(no *FILA);  
void exibeSenha(no *FILA);  
void libera(no *FILA);  
void adiciona(no *FILA);  
no *exclui(no *FILA);  


int main(void)  
{  
 no *FILA = (no*) malloc(sizeof(no));  
 if(!FILA){  
  printf("Sem memoria disponivel!n");  
  exit(1);  
 }else{  
 inicia(FILA);  
 int opt;  

 do{  
  opt=menu();  
  opcao(FILA,opt);  
 }while(opt);  

 free(FILA);  
 return 0;  
 }  
}  

void inicia(no *FILA)  
{  
 FILA->prox = NULL;  
 tam=0;  
}  

int menu(void)  
{  
 int opt;  

 printf("nnEscolha a opcaon");  
 printf("0. Sairn");  
 printf("1. Cadastrar novo clienten");  
 printf("2. Exibir lista de clientesn");  
 printf("3, Proxinha senha a ser chamadan");  
 printf("4. Excluir cliente/senhann");  
 printf("Opcao: "); scanf("%d", &opt);  

 return opt;  
}  

void opcao(no *FILA, int op)  
{  
 no *tmp;  
 switch(op){  
  case 0:  
   libera(FILA);  
   break;  

  case 1:  
   adiciona(FILA);  
   break;  

  case 2:  
   exibe(FILA);  
   break;  

  case 3:  
   exibeSenha(FILA);  
   break;  

  case 4:  
   tmp= exclui(FILA);  
   break;  

   default:  
   printf("Comando invalidonn");  
 }  
}  

int vazia(no *FILA)   
{  
 if(FILA->prox == NULL)  
  return 1;  
 else  
  return 0;  
}  

no *aloca()  
{  
 no *novo=(no *) malloc(sizeof(no));  
 if(!novo){  
  printf("Sem memoria disponivel!n");  
  exit(1);  
 }else{  
  printf("nNovo elemento: "); scanf("%s", &novo->dados);  
  return novo;  
 }  
}  


void exibe(no *FILA)  
{  

 if(vazia(FILA)){  
  printf("FILA vazia!nn");  
  return ;  
 }  
 no *tmp;  
 tmp = FILA->prox;     
 while( tmp != NULL){  

  printf("%s - ", tmp->dados);  
  tmp = tmp->prox;  
 }  


}  


void exibeSenha (no *FILA) {  
    if(vazia(FILA)) {  
        printf("Sem nenhuma senha cadastrada. Fila vazia!n");  
        return ;  
    }  



}  

void libera(no *FILA)  
{
 if(!vazia(FILA)){  
  no *proxNO,  
     *atual;  

  atual = FILA->prox;  
  while(atual != NULL){  
   proxNO = atual->prox;  
   free(atual);  
   atual = proxNO;  
  }  
 }  
}  

void adiciona(no *FILA)  
{  
 no *novo=aloca();  
 novo->prox = NULL;  

 if(vazia(FILA))  
  FILA->prox=novo;  
 else{  
  no *tmp = FILA->prox;  

  while(tmp->prox != NULL)  
   tmp = tmp->prox;  

  tmp->prox = novo;  
 }  
 tam++;  
}  


no *exclui(no *FILA)  
{  
 no *ultimo;  
 if(FILA->prox == NULL){  
  printf("FILA ja vaziann");  
  return NULL;  
 }else{  
  no *ultimo = FILA->prox;  
  FILA->prox=ultimo->prox;  
  free(ultimo);  

  while(ultimo->prox != NULL){  
   ultimo = ultimo->prox;  
  }  

  ultimo->prox = NULL;  
  tam--;  
  return ultimo;  
 }  
} 

gnome – How do I display a notification from a Python3 application on the Ubuntu 18.04 desktop?

If an application has an error and needs to view it as a hint, Ubuntu 18.04 will first flash the note below the clock in the desktop control panel (notification pop-up) and save it in the notification area.

How do I display a hint from my python3 application the same way?

8 – How do I display a field of parent memory in my module?

I own a Drupal 8.7 site with the Drupal Commerce 2.14 module.

I have created a marketplace (several merchants on the same site). In the business type, I created a field "Text (formatted, long)" with the computer name field_terms_and_conditions,

In this field, the trader specifies his general conditions of sale, which the customer must accept during the ordering process.

If the customer orders in multiple stores, multiple shopping carts are created (the name of the store is displayed above each cart). It works very well. Now that Drupal Commerce manages the address book, orders are very fast.

At the moment I have created a view that shows the content of the field field_terms_and_conditions on one side. I've also created a custom module to display a checkbox with a link to the general sales conditions in a modal window.

I want to render the field directly field_terms_and_conditions in the modal window without using a view. How do you do that ?

/src/Plugin/Commerce/CheckoutPane/MarketplaceTermsAndConditions.php :

order->getStore()->getName();
    $store_id = $this->order->getStoreId();
    $pane_form('#attached')('library')() = 'core/drupal.dialog.ajax';
    $attributes = (
      'attributes' => (
        'class' => 'use-ajax',
        'data-dialog-type' => 'modal',
        'data-dialog-options' => Json::encode((
          'width' => 'auto'
        )),
      ),
    );
    $link = Link::fromTextAndUrl(
      $this->t('terms and conditions of the store "@store_name"', ('@store_name' => $store_name)),
      Url::fromUri("internal:/store/$store_id/cgv", $attributes)
    )->toString();
    $pane_form('marketplace_terms_and_conditions') = (
      '#type' => 'checkbox',
      '#default_value' => FALSE,
      '#title' => $this->t('I have read and accept @terms.', ('@terms' => $link)),
      '#required' => TRUE,
      '#weight' => $this->getWeight(),
    );
    return $pane_form;
  }

}