rstudio – R Markdown prints empty tables with kable ()

Since I had to uninstall and reinstall R and R Studio on my PC, I can not see the tables created with the kable () function in R Markdown.

When I run the block, there is no error creating the table, but in the notebook output, the elements of the table, with the exception of the titles in white and the default invisible white background, appear the contents of the table, unless they are select the text with the cursor. However, the table is displayed correctly in the viewer. When I knit HTML, the table is also displayed correctly with all visible elements. The only problem is that in the same output of the chunk, I can not visualize tables that I've seen well in the past.

This is problematic because I am a student and need to visualize the output of my spreadsheets to be able to further process my deliveries, since I have to use kable () yes or yes and it is too tedious to know the viewer or to process HTML. to be able to do this Check if my table is correct.

I currently have R Studio 1.2.5001 and R 3.6.1. I used to have the latest version of R Studio, but I do not remember which version of R I had installed, but it was certainly not up to date and I had no problems viewing the tables in R Markdown.

I hope you can help me with my problem. Thank you very much

sharepoint online – How do I parse JSON to return null as the default if the complex object is empty / null / undefined?

Use the HTTP request to get an SP element. There are problems parsing JSON to return something for a zero object.

Can return null for an empty string column, as shown below, as is done for a more complex object such as a search if no value is selected?

{
"type": "object",
"properties": {
    "Area": {
        "type": "object",
        "properties": {
            "Id": {
                "type": "integer"
            }
        }
    },
    "Package": {
        "type": ("string","null")
    }
}

If the object does not exist in the JSON output, no logic can be executed on the object.

unity – Public MonoBehavior string fields empty

That's bizarre enough that it Has I be to be an idiot.

I have a MonoBehaviour with some public fields and public methods:

public class MyComponentA : MonoBehaviour
{
    public string Message = "Foobar";
    public int Integer = 42;

    public string GetMessage() => "This is a message.";
    public int GetInteger() => 42;
}

I have added it to a prefab house called Circle_A,

Circle_B has a MonoBehavior that will instantiate an instance of Circle_A, get the component and log off the values ​​returned by the fields and methods:

public class CircleB : MonoBehaviour
{
    (SerializeField) private GameObject _circleAPrefab;

    private void Start()
    {
        var circleAInstance = Instantiate(_circleAPrefab, new Vector2(10, 10), Quaternion.Euler(Vector3.zero),transform);
        var myComponentA = circleAInstance.GetComponent();
        var message = myComponentA.Message;
        LogIt(message);
        LogIt(myComponentA.GetMessage());
        LogIt(message);
        Log(myComponentA.Integer);
        Log(myComponentA.GetInteger());
    }

    private static void LogIt(string message)
    {
        switch (message)
        {
            case null:
                Log("NULL");
                return;
            case "":
                Log("EMPTY");
                return;
            default:
                Log($"'{message}'");
                return;
        }
    }
}

The integer field and both methods return the number as expected 42 and the messageThis is a message, However, the message field is always an empty string.

What's happening?

t sql – Empty strings, NULLs, and For XML Path

I have no control over the source table.
There is a mixture of zeroes and empty strings.
What I need is that all users in a line and with a semicolon delineate a list of all their permissions. I can remove the leading semicolon in the later code, but the double semicolon and the empty string semicolon kill me.

My table:

EMPLOYEEID | USERNAME | ISPRIMARY | ENTITLEMENTS 
123456     | BSmith   |   Y       | ac-les-all-full;ac-haw-all-full
123456     | BSmith   |   N       | ac-sco-all-full
987654     | ZJones   |   N       | NULL
987654     | ZJones   |   Y       | ac-trn-std-full Y
987654     | ZJones   |   N       | 
456789     | RTaylor  |   Y       |

I want to return:

USERNAME | ENTITLEMENTS
BSmith   | ;ac-les-all-full;ac-haw-all-full;ac-sco-all-full
ZJones   | ;ac-trn-std-full
RTaylor  | 

My current SQL:

SELECT
    USERNAME
    ,ENTITLEMENTS = (
        SELECT DISTINCT ';' + ENTITLEMENTS
        FROM (staff_user_data) STS
        WHERE STS.(EMPLOYEEID) = STP.(EMPLOYEEID)
        FOR XML PATH(''))
FROM (staff_user_data) STP
WHERE ISPRIMARY = 'Y'

What I get is

USERNAME | ENTITLEMENTS
BSmith   | ;ac-les-all-full;ac-haw-all-full;ac-sco-all-full
ZJones   | ;;ac-trn-std-full
RTaylor  | ;

User Centered Design – What is the best empty shopping cart page / message for ecommerce?

I'm looking for an ecommerce experience and find it really boring to just show a message that your cart is empty. I think we need to show users something more interactive.

What's the better empty shopping cart message / page you've seen?
Do you have data / statistics for the conversion of empty shopping carts?

Look what I've designed and give me your opinion on which should work better, please.

PS.: My user has between 25-55 years, mostly male and buys roofing material. The sales process is not so short, not so impulsive and sometimes the user can put items in the shopping cart, in the other and back, and not always the shopping cart is still there (if he does not save).

Option 1) All blank and no value with some opacity, but looks like the real shopping cart. Simulate where the products are and click on "Ads" to get to the start page.
Enter image description here

Option 2) All blank and no value with some opacity, but looks like the real shopping cart. Funny picture, so as not to be so boring.
Enter image description here

Option 3) All blank and no value with some opacity, but looks like the real shopping cart. Show last viewed items.
Enter image description here

Consider all discussed and template options. Which one do you think better?

8 – Paginated form with Ajax check box triggers: The specified # ajax callback is empty or unavailable

Using Drupal 8.7.7 I have a form that consists of a paginated user table.

Each user line contains a checkbox in the form to which an Ajax event is attached. Essentially, this allows me to save the selection in the user's session as they select users and switch to other pages.

The form works properly on the first page. However, if you switch to the second page, only the first selection works. Each selection made afterwards triggers the error:

Symfony Component HttpKernel Exception HttpException: The specified # ajax callback is empty or can not be called. in Drupal Core Form FormAjaxResponseBuilder-> buildResponse () (line 67 of /var/www/html/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php).

Here is the content of buildForm:

public function buildForm(array $form, FormStateInterface $form_state) {
    /** @var SymfonyComponentHttpFoundationSessionSession $session */
    $session = $this->requestStack->getCurrentRequest()->getSession();
    /** @var DrupalnodeEntityNode $node */
    $node = $this->requestStack->getCurrentRequest()->get('node');
    if (!$session->has($node->id().'_register_selection')) {
      $this->requestStack->getCurrentRequest()->getSession()->set($node->id().'_register_selection', ());
    } else {
      $selected = $session->get($node->id().'_register_selection');
    }

    $form('selected_users') = (
      '#type' => 'container',
      '#attributes' => ('id' => 'selected-users'),
    );

    $users = $form_state->getValue('user_list');
    if (!empty($users)) {
      foreach ($users as $user) {
        if ($user('check') == TRUE) {
          $selected($user('uid')) = $user('uid');
        } elseif (array_key_exists($user('uid'), $users)) {
            unset($selected($user('uid')));
        }
        $session->set($node->id() . '_register_selection', $selected);
      }
    }

    if (!empty($selected)) {
      foreach ($selected as $item) {
        $form('selected_users')($item)('user') = (
          '#type' => 'item',
          '#markup' => t('user: @user', ('@user' => $item)),
          '#weight' => '0',
        );
      }
    }

    $header = (
      ('data' => $form('user_list')('check_all') = (
          '#type' => 'checkbox',
          '#title' => t('Select all'),
          '#return_value' => TRUE,
          '#wrapper_attributes' => (
            'class' =>('align-middle', 'm-0')
          )
        ),
        'class'=> ('py-4')
      ),
      'uid' => ('data' => t('UID'), 'class'=> ('align-middle', 'py-4')),
      'username' => ('data' => t('Username'), 'class'=> ('align-middle', 'py-4')),
      'sits_id' => ('data' => t('SITS ID'), 'class'=> ('align-middle', 'py-4')),
      'name' => ('data' => t('Name'), 'class'=> ('align-middle', 'py-4')),
      'mail' => ('data' => t('Email'), 'class'=> ('align-middle', 'py-4')),
      'college' => ('data' => t('College'), 'class'=> ('align-middle', 'py-4')),
      'programme' => ('data' => t('Programme'), 'class'=> ('align-middle', 'py-4')),
      'course' => ('data' => t('Course'), 'class'=> ('align-middle', 'py-4')),
      'year' => ('data' => t('Year'), 'class'=> ('align-middle', 'py-4')),
    );

    $form('user_list') = (
      '#type' => 'table',
      '#header' => $header,
      '#empty' => t('No users found with the selected filters.'),
      '#prefix' => "
", '#suffix' => "
", '#attributes' => ( 'class' => ('table-sm'), 'style' => 'font-size: .85rem', ) ); $query = $this->database->select('users_field_data', 'ufd'); $query->leftJoin('profile', 'profile', 'profile.uid = ufd.uid'); $query->leftJoin('profile__field_prof_sits_id', 'sitsid', 'sitsid.entity_id = profile.profile_id'); $query->leftJoin('profile__field_prof_first_name', 'fname', 'fname.entity_id = profile.profile_id'); $query->leftJoin('profile__field_prof_last_name', 'lname', 'lname.entity_id = profile.profile_id'); $query->leftJoin('profile__field_prof_college', 'college', 'college.entity_id = profile.profile_id'); $query->leftJoin('profile__field_prof_programme', 'programme', 'programme.entity_id = profile.profile_id'); $query->leftJoin('profile__field_prof_course', 'course', 'course.entity_id = profile.profile_id'); $query->leftJoin('profile__field_prof_sits_year', 'year', 'year.entity_id = profile.profile_id'); $query->fields('ufd', ('uid','name', 'mail')); $query->addField('sitsid', 'field_prof_sits_id_value', 'sits_id'); $query->addField('fname', 'field_prof_first_name_value', 'first_name'); $query->addField('lname', 'field_prof_last_name_value', 'last_name'); $query->addField('college', 'field_prof_college_target_id', 'college_gid'); $query->addField('programme', 'field_prof_programme_target_id', 'programme_gid'); $query->addField('course', 'field_prof_course_target_id', 'course_gid'); $query->addField('year', 'field_prof_sits_year_value', 'year'); $query->extend('DrupalCoreDatabaseQueryTableSortExtender')->orderByHeader($header); $pager = $query->extend('DrupalCoreDatabaseQueryPagerSelectExtender')->limit(10); $results = $pager->execute()->fetchAll(); if ($results) { foreach ($results as $data) { $form('user_list')($data->uid)('check') = ( '#type' => 'checkbox', '#ajax' => ( 'callback' => '::processUser', 'wrapper' => 'selected-users', ), '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0', 'p-0', 'text-align-center') ), '#attributes' => ( 'class' => ('m-0'), 'style' => 'position:relative;', ), '#default_value' => isset($selected($data->uid)) ? TRUE : FALSE, ); $form('user_list')($data->uid)('uid') = ( '#type' => 'item', '#markup' => $data->uid, '#value' => $data->uid, '#weight' => '0', '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0') ) ); $form('user_list')($data->uid)('username') = ( '#type' => 'item', '#markup' => $data->name, '#value' => $data->name, '#weight' => '0', '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0') ) ); $form('user_list')($data->uid)('sits_id') = ( '#type' => 'item', '#markup' => $data->sits_id, '#value' => $data->sits_id, '#weight' => '0', '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0') ) ); $form('user_list')($data->uid)('name') = ( '#type' => 'item', '#markup' => $data->first_name . ' ' . $data->last_name, '#value' => $data->first_name . ' ' . $data->last_name, '#weight' => '0', '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0') ) ); $form('user_list')($data->uid)('mail') = ( '#type' => 'item', '#markup' => $data->mail, '#value' => $data->mail, '#weight' => '0', '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0') ) ); $form('user_list')($data->uid)('college') = ( '#type' => 'item', '#markup' => $data->college_gid, '#value' => $data->college_gid, '#weight' => '0', '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0') ) ); $form('user_list')($data->uid)('programme') = ( '#type' => 'item', '#markup' => $data->programme_gid, '#value' => $data->programme_gid, '#weight' => '0', '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0') ) ); $form('user_list')($data->uid)('course') = ( '#type' => 'item', '#markup' => $data->course_gid, '#value' => $data->course_gid, '#weight' => '0', '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0') ) ); $form('user_list')($data->uid)('year') = ( '#type' => 'item', '#markup' => $data->year, '#value' => $data->year, '#weight' => '0', '#wrapper_attributes' => ( 'class' => ('align-middle', 'm-0') ) ); } } $form('actions') = ( '#type' => 'actions', '#attributes' => ( 'class' => ('mb-4', 'd-flex', 'justify-content-center') ) ); $form('actions')('submit') = ( '#type' => 'submit', '#value' => $this->t('Register'), '#name' => 'update', ); $form('pager') = ('#type' => 'pager'); return $form; } }

And the processUser callback:

  public function processUser(array &$form, FormStateInterface $form_state) {
    return $form('selected_users');
  }

This seems to work correctly without pagination. However, if you enable pagination, it will be interrupted. Has anyone experienced that?

Plot – ListPlot of Table returns empty

I'm trying to do something that I thought would be easy, but I come across a roadblock and I do not know why. I have the following table:

Kerr = Table({s((i))/m((i))^2, m((i))}, {i, 1, Length(m)})

Where s and m are one-dimensional arrays of equal length imported from data files. I combine them in the table with the name Kerr, and I want to draw that (with s/m^2 on the x-axis and m on the y-axis. The table looks like this:
table

If I try ListPlot(Kerr)the axes come back empty. I assume that I'm doing something fundamentally wrong, but I have no idea what. Any ideas?

Content Query Web Part – Why do some of my CQWPs appear empty to visitors?

I have a page with about twenty CQWPs, all from the same library. It looks fine to me (admin), but for the visitor authorization group, some fields are blank – no error message, just nothing! The header is still there and there is no error message. I checked the library documents and there are no permissions issues. If I recreate one of the empty CQWPs (new web part with the same search parameters and display settings), the visitor will still be unable to see them. This does not seem to be a problem with Web Parts that are not set up with these settings. I am at a loss! Thankful for any help.

Illustration of Web Parts that correctly displays blank Web Parts and Web Parts

Excel – Can I use SUMPRODUCT to ignore empty cells?

My table contains a list of names (some are repeated) in column A, a list of numbers stored in a string in column B, and column C uses a formula to get the first number of the string in column B. It has been create a list of unique names from column A. In column F, they appear several times in the data list and in column G. You then want to retrieve the corresponding data from column C each time they appear in the list to calculate the average cost.

I tried that

=SUMPRODUCT(($A$1:INDEX($A:$A,COUNTA($A:$A))=$E4)*($C$2:INDEX($C:$C,COUNTA($C:$C))))/$F4

The problem I have is that in the list of data some of the cells in column C are empty, so I get a #VALUE Error.

Here's a screenshot of what I'm trying to do:

new edition

Can SUMPRODUCT still be instructed to skip the lines where there is no number data?

Obviously this is just an example and my actual table is a bit more complicated, there are thousands of data lines and the names are repeated many times.

SQL Server Behavior of the STUFF function on empty strings

When answering another question (to SO), I came across an unexpected behavior with the function STUFF.

SELECT STUFF
(
    'a', -- character expression
    1,  -- start
    1,  -- length
    'z' -- replaceWith_expression
)

returns NULLwhile I would expect it to be & # 39; z & # 39; returns.

The STUFF function inserts a string into another string. It deletes a specified character length in the first string at the start position, and then inserts the second string at the start position into the first string.

syntax

STUFF ( character_expression , start , length , replaceWith_expression )

Remarks

If the start position or length is negative, or if the start position is greater than the length of the first string, a null string is returned. If the start position is 0, a null value is returned. If the length to be deleted is longer than the first string, it is deleted up to the first character in the first string.

An error is thrown if the resulting value is greater than the maximum supported by the return type.

According to the documentation, there are a number of reasons why a NULL string is returned:

  • If Beginning is longer than the first zeichen_ausdruck
  • If Beginning is negative or 0
  • If length is negative