text:
Q: realloc(): invalid next size error when reallocating memory for an array of strings I have been going through Beginning C, Fifth Edition and I'm currently on chapter 7, which is about pointers. I tried running an example that was given in the chapter but I'm coming across a realloc(): invalid next size error when the array gets beyond a capacity of 6 elements. Here's the code which is mostly copied and pasted from the book:
// Program 7.14 Using array notation with pointers to sort strings

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>

#define BUF_LEN 100                                // Length of input buffer
#define COUNT         5                            // Initial number of strings

int main(void)
{
  char buf[BUF_LEN];                               // Input buffer
  size_t str_count = 0;                            // Current string count
  size_t capacity = COUNT;                         // Current maximum number of strings
  char **pS = calloc(capacity, sizeof(char*));     // Pointers to strings
  char** psTemp = NULL;                            // Temporary pointer to pointer to char
  char* pTemp = NULL;                              // Temporary pointer to char
  size_t str_len = 0;                              // Length of a string
  bool sorted = false;                             // Indicated when strings are sorted
  printf("Enter strings to be sorted, one per line. Press Enter to end:\n");

  // Read in all the strings
  char *ptr = NULL;
  while(true)
  {
    ptr = fgets(buf, BUF_LEN, stdin);
    if(!ptr) // Check for read error
    {
      printf("Error reading string.\n");
      free(pS);
      pS = NULL;
      return 1;
    }

    if(*ptr == '\n') break;             // Empty line check

    if(str_count == capacity)
    {
      capacity += capacity/4;           // Increase capacity by 25%

      if(!(psTemp = realloc(pS, capacity))) return 1;

      pS = psTemp;
    }
    str_len = strnlen(buf, BUF_LEN) + 1;
    if(!(pS[str_count] = malloc(str_len))) return 2;
    strcpy(pS[str_count++], buf);
  }

  // Sort the strings in ascending order
  while(!sorted)
  {
    sorted = true;
    for(size_t i = 0 ; i < str_count - 1 ; ++i)
    {
      if(strcmp(pS[i], pS[i + 1]) > 0)
      {
        sorted = false;                 // We were out of order so. . .
        pTemp= pS[i];                   // swap pointers pS[i]. . .
        pS[i] = pS[i + 1];              // and. . .
        pS[i + 1] = pTemp;              // pS[i + 1]
      }
    }
  }

  // Output the sorted strings
  printf("Your input sorted in ascending sequence is:\n\n");
  for(size_t i = 0 ; i < str_count ; ++i)
  {
    printf("%s", pS[i]);
    free(pS[i]);                        // Release memory for the word
    pS[i] = NULL;                       // Reset the pointer
  }
  free(pS);                             // Release the memory for pointers
  pS = NULL;                            // Reset the pointer
  return 0;
}

The error happens on this line:
if(!(psTemp = realloc(pS, capacity))) return 1;

Also, I say the code is "mostly" copied, because the code from the book uses C11 functions like strnlen_s and strcpy_s which I don't have access to. I'm using strnlen and strcpy instead. I'm not sure if that is what's causing the issue. Here is the verbatim code from the book however:
// Program 7.14 Using array notation with pointers to sort strings
#define __STDC_WANT_LIB_EXT1__ 1
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>

#define BUF_LEN 100                                // Length of input buffer
#define COUNT         5                            // Initial number of strings

int main(void)
{
  char buf[BUF_LEN];                               // Input buffer
  size_t str_count = 0;                            // Current string count
  size_t capacity = COUNT;                         // Current maximum number of strings
  char **pS = calloc(capacity, sizeof(char*));     // Pointers to strings
  char** psTemp = NULL;                            // Temporary pointer to pointer to char
  char* pTemp = NULL;                              // Temporary pointer to char
  size_t str_len = 0;                              // Length of a string
  bool sorted = false;                             // Indicated when strings are sorted
  printf("Enter strings to be sorted, one per line. Press Enter to end:\n");

  // Read in all the strings
  char *ptr = NULL;
  while(true)
  {
    ptr = fgets(buf, BUF_LEN, stdin);
    if(!ptr) // Check for read error
    {
      printf("Error reading string.\n");
      free(pS);
      pS = NULL;
      return 1;
    }

    if(*ptr == '\n') break;             // Empty line check

    if(str_count == capacity)
    {
      capacity += capacity/4;           // Increase capacity by 25%

      if(!(psTemp = realloc(pS, capacity))) return 1;

      pS = psTemp;
    }
    str_len = strnlen_s(buf, BUF_LEN) + 1;
    if(!(pS[str_count] = malloc(str_len))) return 2;
    strcpy_s(pS[str_count++], str_len, buf);
  }

  // Sort the strings in ascending order
  while(!sorted)
  {
    sorted = true;
    for(size_t i = 0 ; i < str_count - 1 ; ++i)
    {
      if(strcmp(pS[i], pS[i + 1]) > 0)
      {
        sorted = false;                 // We were out of order so. . .
        pTemp= pS[i];                   // swap pointers pS[i]. . .
        pS[i] = pS[i + 1];              // and. . .
        pS[i + 1] = pTemp;              // pS[i + 1]
      }
    }
  }

  // Output the sorted strings
  printf("Your input sorted in ascending sequence is:\n\n");
  for(size_t i = 0 ; i < str_count ; ++i)
  {
    printf("%s", pS[i]);
    free(pS[i]);                        // Release memory for the word
    pS[i] = NULL;                       // Reset the pointer
  }
  free(pS);                             // Release the memory for pointers
  pS = NULL;                            // Reset the pointer
  return 0;
}

I have looked up lots of posts on StackOverflow and other places to help me find what's going wrong, but I wasn't able to figure it out. I also used gdb and valgrind to try to diagnose the issue, but I wasn't able to glean much from those tools as well. I am pretty inexperienced with them though, especially valgrind.
I think there's just something small I'm missing. Here's an example of running the program with input taken from the book:
Enter strings to be sorted, one per line. Press Enter to end:
Many a mickle makes a muckle.
A fool and your money are soon partners.
Every dog has his day.
Do unto others before they do it to you.
A nod is as good as a wink to a blind horse.
The bigger they are, the harder they hit.
Least said, soonest mended.
realloc(): invalid next size
signal: aborted (core dumped)

No matter what the input is, I get that error after 7 lines.
Any help on this would be greatly appreciated. Thanks in advance!

A: Thanks to user3121023's suggestion, I solved it by changing this line:
if(!(psTemp = realloc(pS, capacity))) return 1;

to this:
if(!(psTemp = realloc(pS, capacity * sizeof(*pS)))) return 1;

The reason for doing this is because I have to allocate the amount of bytes, not the amount of elements. I'm not sure why the book had it wrong, but I think it's an earlier edition so it's probably fixed in a later edition.


text:
Q: How to move text between tags to new document word from excel vba I have a long list of word documents which all have three pages. now i want every fist page in document 1, every 2nd page in document 2 and every 3rd page in document 3. I have tags on every page in my word document but every page has the same tag. I need to search for the tags, select the tags and everything in between and move them to the new document. Then, search again to find the 2nd tag (which is the same text as the first one) and do the same thing.
I have an excel sheet with the filenames/locations of all the documents with the tags, so i'm running all this from excel vba.
I've made an attempt to find/select the code, but it selects the first and the last tag, not the first one. Could you help me out?
This is my current code for opening the word docs one by one and finding tags:
Sub SelectRangeBetween()

Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")                  'Change to the correct sheetname

Dim wrdApp As Word.Application
' Set wrdApp = CreateObject("Word.Application")
Dim WrdDoc As Word.Document

Set wrdApp = New Word.Application                       '
wrdApp.Visible = True                                   'set to false for higher speed

Const StarttagColumn = "C"                              'Edit this for the column of the starttag.
Const EndtagColumn = "D"                                'Edit this for the column of the endtag.
Const FilelocationColumn = "E"                          'Edit this for the column of the Filelocation.
Const startRow As Long = 5                              'This is the first row of tags and filenames
'Const endRow As Long = 140                             'uncomment if you want a fixed amount of rows (for ranges with empty cells)
Dim endRow As Long                                      'comment out if const-endrow is used
endRow = ws.Range("B" & Rows.Count).End(xlUp).Row       'comment out if const-endrow is used

 Dim i As Long
 For i = startRow To endRow
    Dim wrdPath As String
    wrdPath = ws.Cells(i, FilelocationColumn).Value2    '

    If wrdPath <> vbNullString Then                     '
        If Dir(wrdPath) <> vbNullString Then            '
            Dim startTag As String                      '
            Dim endTag As String                        '

            startTag = ws.Cells(i, StarttagColumn).Value2   '
            endTag = ws.Cells(i, EndtagColumn).Value2       '

            Set WrdDoc = wrdApp.Documents.Open(wrdPath) '
        With wrdApp
        With .ActiveDocument.Content.Duplicate
         .Find.Execute Findtext:=startTag & "*" & endTag, MatchWildcards:=False, Forward:=False
         .MoveStart wdCharacter, Len(startTag)
         .MoveEnd wdCharacter, -Len(endTag) - 1
         .Select ' Or whatever you want to do
        End With
        End With
        With WrdDoc
        .Close
        End With
        End If
        End If
        Next i
        End Sub

A: Try this:
Private Sub Combine()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Sheet1")                  'Change to the correct sheetname

    Const StarttagColumn = "C"                              'Edit this for the column of the starttag.
    Const EndtagColumn = "D"                                'Edit this for the column of the endtag.
    Const FilelocationColumn = "E"                          'Edit this for the column of the Filelocation.
    Const startRow As Long = 5                              'This is the first row of tags and filenames
    'Const endRow As Long = 140                             'uncomment if you want a fixed amount of rows (for ranges with empty cells)
    Dim endRow As Long                                      'comment out if const-endrow is used
    endRow = ws.Range("B" & Rows.Count).End(xlUp).Row

    Dim wrdApp As Word.Application
    Set wrdApp = New Word.Application
    wrdApp.Visible = True
    Dim page1Doc As Word.Document
    Set page1Doc = wrdApp.Documents.Add

    Dim page2Doc As Word.Document
    Set page2Doc = wrdApp.Documents.Add

    Dim page3Doc As Word.Document
    Set page3Doc = wrdApp.Documents.Add

    Dim i As Long
    For i = startRow To endRow
        Dim wrdPath As String
        wrdPath = ws.Cells(i, FilelocationColumn).Value2    '

        If wrdPath <> vbNullString Then                     '
            If Dir(wrdPath) <> vbNullString Then

                Dim endTag As String
                endTag = ws.Cells(i, EndtagColumn).Value2

                Dim extractDoc As Word.Document
                Set extractDoc = wrdApp.Documents.Open(wrdPath)

                'Find first endtag
                Dim page1Rng As Word.Range
                Set page1Rng = extractDoc.Range.Duplicate
                With page1Rng.Find
                    .Text = endTag
                    .Execute
                End With

                If page1Rng.Find.Found Then
                    page1Rng.SetRange 0, page1Rng.End + 1
                    page1Rng.Cut
                    page1Doc.Paragraphs.Last.Range.Paste

                    Set page1Rng = Nothing

                    'If success, find second endtag
                    Dim page2Rng As Word.Range
                    Set page2Rng = extractDoc.Range.Duplicate

                    With page2Rng.Find
                        .Text = endTag
                        .Execute
                    End With

                    If page2Rng.Find.Found Then
                        page2Rng.SetRange 0, page2Rng.End + 1
                        page2Rng.Cut
                        page2Doc.Paragraphs.Last.Range.Paste

                        Set page2Rng = Nothing

                        'If success, yolo and cut the rest since it should left with 3rd page
                        extractDoc.Range.Cut
                        page3Doc.Paragraphs.Last.Range.Paste

                        Dim breakRng As Word.Range
                        Set breakRng =  page3Doc.Paragraphs.Last.Range.DuplicateWith page3Doc.Paragraphs.Last.Range.Duplicate
                        .Collapse
                        .InsertBreak
                        End With
                    End If
                End If

                extractDoc.Close 0
            End If
        End If
    Next i

    Set extractDoc = Nothing
    Set page1Doc = Nothing
    Set page2Doc = Nothing
    Set page3Doc = Nothing
    Set ws = Nothing

    MsgBox "Done!"
End Sub

redpajama_set_name: RedPajamaStackExchange


text:
Q: Set index to group of repetitive row values in a csv file using Python I am new to python. I want to set index to specific set of row elements which are repetitive for each group.
My dataframe:

data_dict ={'0_deg': [2, 11, 21, -17, 5, 40, 22, 7, 20, -6, -6, -6, 24, 21, 20, 61, 21, 5, 2, 17],
 '10_deg': [12, -21, 11, 1, 4, -2, 33, 53, 18, 10, -3, -1, 23, 18, 23, 8, 11, -25, 21, -14],
 '20_deg': [23, -10, 3, 20, -41, 13, 10, 5, -9, 7, -4, -21, 14, -26, -31, 9, 1, -15, 3, -6],
 '30_deg': [12, 9, -5, 4, 9, -46, 1, -8, -27, 3, -9, -14, 15, -6, 14, 7, -11, 5, 19, -4]}

data_dict = pd.read_csv('Dataset.csv')
data_dict = data_dict.set_index('Indexes')

#row idx of a group in this list
idx =[4,10,37,109,133]

Here a list is created as idx and index values are written maunally.
But for a bigger matrix of 1000+ indexes(random values) per group, this would be a very difficult task.
What I want is that when I read a CSV file, the 1st value in the row should be selected and until the same value occurs in the same index, it should be considered as 1 group, and the indexes for 1st group must get stored in idx
Eg: In my small version of dataset, from 1st column Indexes, the 1st values i.e. 4,10,37,109,133 are my indexxes for 1st group. These values repeat in same sequence for next groups.
Only they shoud not be entered manually in code. A group should be considered unitl next 4 occurs. So index values 4 to 133 must be considered as 1 group under idx. This is because I need idx for further part of the code.
My actual dataset has 1000+ index values per group. So idx must automatically take all values of a group.
# getting some dimensions and sorting the data
row_idx_length = len(idx)
group_length = len(data_dict['0_deg'])
number_of_groups = len(data_dict.keys())
idx = idx*number_of_groups
data_arr = np.zeros((group_length,number_of_groups),dtype=np.int32)

A: I believe you need numpy.tile with integer division for number of repeating:
df.index = np.tile(idx, len(df.index) // len(idx))

But if get error (N and M are some integer numbers):

ValueError: Length mismatch: Expected axis has N elements, new values have M elements

It means in last group missing some elements, so add next group by 1 and filter by length of index of DataFrame:
#added 150 to idx list
idx =[4,10,37,109,133,150]
df.index = np.tile(idx, len(df.index) // len(idx) + 1)[:len(df.index)]
print (df)
     0_deg  10_deg  20_deg  30_deg
4        2      12      23      12
10      11     -21     -10       9
37      21      11       3      -5
109    -17       1      20       4
133      5       4     -41       9
150     40      -2      13     -46
4       22      33      10       1
10       7      53       5      -8
37      20      18      -9     -27
109     -6      10       7       3
133     -6      -3      -4      -9
150     -6      -1     -21     -14
4       24      23      14      15
10      21      18     -26      -6
37      20      23     -31      14
109     61       8       9       7
133     21      11       1     -11
150      5     -25     -15       5
4        2      21       3      19
10      17     -14      -6      -4

A: If i understand your question correctly, you need to actually get the idx given the dataframe with the index setup like that.
data_dict ={'0_deg': [2, 11, 21, -17, 5, 40, 22, 7, 20, -6, -6, -6, 24, 21, 20, 61, 21, 5, 2, 17],
 '10_deg': [12, -21, 11, 1, 4, -2, 33, 53, 18, 10, -3, -1, 23, 18, 23, 8, 11, -25, 21, -14],
 '20_deg': [23, -10, 3, 20, -41, 13, 10, 5, -9, 7, -4, -21, 14, -26, -31, 9, 1, -15, 3, -6],
 '30_deg': [12, 9, -5, 4, 9, -46, 1, -8, -27, 3, -9, -14, 15, -6, 14, 7, -11, 5, 19, -4]}
import pandas as pd
df = pd.DataFrame(data_dict)

idx =[4,10,37,109,133]
df.index = idx * (len(df)//len(idx))

print(df)
#Output:
     0_deg  10_deg  20_deg  30_deg  groups
4        2      12      23      12       1
10      11     -21     -10       9       1
37      21      11       3      -5       1
109    -17       1      20       4       1
133      5       4     -41       9       1
4       40      -2      13     -46       2
10      22      33      10       1       2
37       7      53       5      -8       2
109     20      18      -9     -27       2
133     -6      10       7       3       2
4       -6      -3      -4      -9       3
10      -6      -1     -21     -14       3
37      24      23      14      15       3
109     21      18     -26      -6       3
133     20      23     -31      14       3
4       61       8       9       7       4
10      21      11       1     -11       4
37       5     -25     -15       5       4
109      2      21       3      19       4
133     17     -14      -6      -4       4

With the setup done, you just need to calculate where the 0th value repeats. You could just calculate it directly, but perhaps it is also more useful to make an additional column for further calculations.
temp = df.index == df.index[0]
groups = temp.cumsum()
idx_out = list(df.index[groups == 1])

print(idx_out) #[4, 10, 37, 109, 133]

#Optional:

df['groups'] = groups #can be very useful for aggregations and groupby calculations


text:
Q: parameter in cloud functions is undefined I have an old code for Google Cloud Functions, it resized an image to create a thumbnail, I wrote it three years ago and was in NodeJS 6, it was working fine but i had to update to NodeJS 10, i added
"engines": {
    "node": "10"
  }

other functions continued working but this not
exports.generateThumbnail = functions.storage.object().onFinalize(async (object) => {
    const contentType = object.contentType;

it throws an error when i try to access "object" apparently is undefined, the log error is
TypeError: Cannot read property 'contentType' of undefined
    at exports.generateThumbnail.functions.storage.object.onFinalize (/workspace/index.js:30:32)
    at cloudFunctionNewSignature (/workspace/node_modules/firebase-functions/lib/cloud-functions.js:120:23)
    at cloudFunction (/workspace/node_modules/firebase-functions/lib/cloud-functions.js:151:20)
    at Promise.resolve.then (/layers/google.nodejs.functions-framework/functions-framework/node_modules/@google-cloud/functions-framework/build/src/invoker.js:199:28)
    at process._tickCallback (internal/process/next_tick.js:68:7)

I updated firebase-admin, firebase-functions, google-cloud-storage, but it did not solve my problem
What could have happened and how do I solve it?

A: In this Github issue other users were facing the same issue you are, the propose solution had to do with the need to set a new variable in order to refresh the objects in your function and redeploying it.
So, if you were to add a new variable to your to your index.js like this:
process.env.X_GOOGLE_NEW_FUNCTION_SIGNATURE = true;

And redeploy the function, the issue is suppose to be fixed.


text:
Q: Export users and passwords from Active directory into PHP I am developing a web application for my university project this summer and I am looking for some advice, The web application is to be deployed in to a windows environment that has around 500 users. The users will need to login before they can access the web application, this is where my first problem appears.
Do I need a way to export the users from active directory with their passwords on a daily basis. However I know that passwords are stored as a hash not clear text so id have to mimic the hashing in my web app. So do I use LDAP to authenticate the users for me? I would appreciate some advice of maybe a link to a resource that anyone knows that would be worth me reading.
Note.
The web application will be made in PHP with a sql database running on a windows server inside the same domain.
Thanks

A: PHP has an LDAP module that allows you to interface the Active Directory without exporting it.
Here is an example of implementing an LDAP authentication through php:
http://code.activestate.com/recipes/101525-ldap-authentication/

A: Since PHP has libraries to assist you with interacting with LDAP already then that might be the way to go. Exporting and managing users yourself sounds like reinventing the wheel.

A: Just contact the auth server using PHP::LDAP. This blog post shows a good example.


text:
Q: how to fix Main method? how to fix this problem: Main method not found in class jamel.Jamel, please define the main method as:
   public static void main(String[] args)
enter image description here

A: The main method is just a method that java calls that actually does stuff in your program. If you don't create this method then what is your program for? You'll just have a bunch of classes that you don't use.

A: If Jamel is your main class where your application starts from scratch then you need
public static void main(String[] args) {
}

this is the entrance of your application to start with.
from here on-words in your main method you should start calling other object.
but from the screenshot I assume that that is not your want. My guess may be wrong. but figure out what is your starting class and does it have a main method and main method calling right object to start your application.


text:
Q: Get a gtalk XMPP auth token from android's AccountManager I have an SASL mechanism set up to respond to X-GOOGLE-TOKEN.
I also have my AccountManager and Account that I want to use from the device.
Now I call the getAuthToken method like this to get a token:
accountManager.getAuthToken(account, "talk", null, this,
            new AccountManagerCallback<Bundle>() {...});

And it prompts me to allow the app access to Google Talk.
Then I send it back like so:
"<auth mechanism="X-GOOGLE-TOKEN">" + "\0" + user@gmail.com + "\0" + token + "</auth>"

However, google then responds with an authentication failed... So I must be requesting the token incorrectly... Or maybe the token I'm getting is for OAUTH?
If it's for OAUTH, is there a pre-written SASLMechanism for that? If so, where do I get a google API key to use the the token android provides me, or do I need one?


text:
Q: Combinatorics Statistics Question The problem I am working on is:
An academic department with five faculty members—Anderson, Box, Cox, Cramer, and Fisher—must select two of its members to serve on a personnel review committee.
Because the work will be time-consuming, no one is anx-ious to serve, so it is decided that the representative will be selected by putting the names on identical pieces of paper
and then randomly selecting two.
a.What is the probability that both Anderson and Box will
be selected? [Hint:List the equally likely outcomes.]
b.What is the probability that at least one of the two members whose name begins with C is selected?
c. If the five faculty members have taught for 3, 6, 7, 10,
and 14 years, respectively, at the university, what is the
probability that the two chosen representatives have a
total of at least 15 years' teaching experience there?

For a), I figured that since probability of Anderson being chosen is $1/5$ and Box being chosen is $1/5$ the answer would simply be $2/5$. It isn't, though. It is $0.1$ How did they get that answer? I might need help with parts b) and c) as well.

A: (a) You will have to consider the 10 different outcomes. Each combination of $"A-B", "B-Cox", "B-Cramer", ...$ is equally likely to be drawn. There are
 $${5 \choose 2} = 10 $$
10 ways to choose 2 people from a group of 5. Since we are only considering 1 possibility, the answer will be $\frac 1 {10} = 0.1$.
For (b), there are a few possibilities where at least 1 "C" member gets selected. Consider $$"Cox-A", "Cox-B", "Cox-Cramer", "Cox-F"$$ and $$"Cramer-A", "Cramer-B", "Cramer-Cox", "Cramer-F"$$ Notice that $"Cox-Cramer"$ appears twice, so one needs to be eliminated. Turns out there are 7 different possibilities out of 10...so we have $0.7$.
Alternatively, you can consider the different ways no "C" member gets selected. Turns out there are 3 ways  $$"A-B", "A-F", "B-F"$$ resulting in $0.3$ chance of the compliment case happening. Taking  $1 - 0.3$, you will still get $0.7$ as the answer.
For (c), I'd personally recommend taking the "compliment" of events. ie, how many combinations have LESS than 15 years? Turns out there are 4 combinations - $(3,6), (3,7), (3,10) , (6,7)$. You can use the answer from (a) and evaluate this to become $1 - \frac 4 {10} = 0.6.$

A: (a) There are $\binom{5}{2}=10$ different ways of selecting 2 unique objects out of 5. Only 1 of them is success, hence the probability is $\frac{1}{10}$.
(b) It is 1-probability that no C's are selected, hence it is $1-\frac{3}{10}=\frac{7}{10}$
(c) same approach: 1-probability that the selected members have taught for 14 or less years, hence it is $1 - \frac{4}{10}=\frac{6}{10}$

A: I think that it could be a possibility of what the persons population of their city or state to have any outcome to which you will need to find how to answer the question like for instants I live in Anderson and we could have a population of 2,364, so I can conclude that the possibility of someone in Anderson to think of the same number I'm thinking of will be 1/2364 so it could a numerous of numbers for the population so me and anyone can find out their probability of their city, state, and/or country.

A: most simple way to understand this problem.
(i just did this problem just now just now) lol
A, B, Co, Cr, and F exist.
pick 1 of 5 at random. (1/5)
pick another at random, but this time around there are only 4 choices. so (1/4)
multiply the two values. (1/20)
BUT! that's considering that A is picked at first try then B on the second.
you also have to consider the possibility that B would be picked first and etc.
so you add (1/20) + (1/20) = (2/20) = (1/10) = 0.1
pce


text:
Q: Connect to dockerized MySql with Springboot App - Communications link failure In my production environment with this command I run my docker-compose:
docker-compose -f docker-compose.yml up -d

DOCKER-COMPOSE
version: "3.3"
services:
  db:
    image: mysql
    platform: linux/amd64
    restart: always
    container_name: mysql-db-users
    environment:
      MYSQL_ROOT_PASSWORD: 'password'
      MYSQL_DATABASE: 'userDb'
    ports:
      - "3306:3306"
  phpmyadmin:
    image: phpmyadmin
    restart: always
    container_name: php-my-admin-users
    ports:
      - "8081:80"

Now by connecting to 172.22.14.43:8081 I can login to phpmyadmin when I can find that userDb has been created.
The next step is to connect a dockerized Springboot app to this userDb, but I continue to obtain:
com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure

This is the dockerfile of my SprigBoot App:
DOCKERFILE
FROM openjdk:17-jdk
ARG JAR_FILE=target/*.jar
COPY target/ldap-conn-*.jar /ldap-conn.jar
ENTRYPOINT ["java", "-jar", "/ldap-conn.jar" ]
EXPOSE 8090

APPLICATION.YML
server:
  port: '8090'
spring:
  application:
    name: ldap-connection
  datasource:
    username: 'root'
    password: 'password'
    platform: 'mysql'
    url: jdbc:mysql://mysql-db-users:3006/userDb?useSSL=false&allowPublicKeyRetrieval=true
  sql:
    init:
      mode: always
  jpa:
    defer-datasource-initialization: 'true'
    hibernate:
      ddl-auto: update
    properties:
      hibernate:
        data: classpath:Data.sql
        dialect: org.hibernate.dialect.MySQL5InnoDBDialect
        format_sql: true
    show-sql: true
eureka:
  client:
    service-url:
      defaultZone: http://172.17.0.2:8761/eureka
    fetch-registry: true
    register-with-eureka: true

And in my POM.XML I have both these dependencies:
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-jdbc</artifactId>
    </dependency>

I run my image in this way:
docker run -d -p 8090:8090 --name ldap myRepo/ldap1.0:ldap

I think the main issue is this line:
 url: jdbc:mysql://mysql-db-users:3006/userDb?useSSL=false&allowPublicKeyRetrieval=true

As far as I understand using the container name is the way to go, but it doesn't seem to work.
I've tried by using the ip address of the docker container (with Eureka server is working)
jdbc:mysql://172.17.0.2:3006/userDb

the server ip
jdbc:mysql://serverIp:3006/userDb

but this is not working.


text:
Q: Как правильно сделать таблицу vue cli Использую vue2 cli. Есть таблица. Начала делать ее на плагине vue-tables-2, но уже думаю что без плагина нужно крутится. Проблемы таблицы заключается в том, что tbody имеет кастомный скрол. Немного подумав сделала thead position stiky и через calc вычитала высоту и top что бы скрол не наползал на шапку. Но так же требуется, что бы шапка не обрезалась, а уходила в право, так что бы было видно что там что то есть, а вот боди должно быть обрезано. При чем при скроле все скролится вместе(по горизонтали имею в виду). Прошу подсказать, нужно делить теперче на две таблицы шапка и боди?, тк в таблицу невозможно впихнуть кастомный скролл. Или же есть плагин который позволяет вертеть tbody по вертикали, а по горизонтали tbody и thead не используя позиционирования. На просторах интернета искала, но не нахожу ничего подходящего. Может у кого был опыт в таких таблицах. То что имею сейчас - https://codepen.io/KatushaSan/pen/wvjzYae

Vue.use(VueTables.ClientTable);
Vue.use(vuescroll);

function getData() {
    return [
        {
            modal: 'что то',
            checkedId: 'check1',
            date: '85.12.3021',
            fio: 'что то',
            floor: 'что то',
            dateBeathdey: 'что то',
            area: 'что то',
            research: 'что то',
            idPacient: 'что то',
            quality: 'что то',
            AETitle: 'что то',
            direction: 'что то',
            registrationNumber: 'что то',
            priority: 'что то',
            institution: 'что то',
            appointed: 'что то',
            nameProtokol: 'что то'
        },
      {
            modal: 'что то',
            checkedId: 'check1',
            date: '85.12.3021',
            fio: 'что то',
            floor: 'что то',
            dateBeathdey: 'что то',
            area: 'что то',
            research: 'что то',
            idPacient: 'что то',
            quality: 'что то',
            AETitle: 'что то',
            direction: 'что то',
            registrationNumber: 'что то',
            priority: 'что то',
            institution: 'что то',
            appointed: 'что то',
            nameProtokol: 'что то'
        },{
            modal: 'что то',
            checkedId: 'check1',
            date: '85.12.3021',
            fio: 'что то',
            floor: 'что то',
            dateBeathdey: 'что то',
            area: 'что то',
            research: 'что то',
            idPacient: 'что то',
            quality: 'что то',
            AETitle: 'что то',
            direction: 'что то',
            registrationNumber: 'что то',
            priority: 'что то',
            institution: 'что то',
            appointed: 'что то',
            nameProtokol: 'что то'
        },{
            modal: 'что то',
            checkedId: 'check1',
            date: '85.12.3021',
            fio: 'что то',
            floor: 'что то',
            dateBeathdey: 'что то',
            area: 'что то',
            research: 'что то',
            idPacient: 'что то',
            quality: 'что то',
            AETitle: 'что то',
            direction: 'что то',
            registrationNumber: 'что то',
            priority: 'что то',
            institution: 'что то',
            appointed: 'что то',
            nameProtokol: 'что то'
        },{
            modal: 'что то',
            checkedId: 'check1',
            date: '85.12.3021',
            fio: 'что то',
            floor: 'что то',
            dateBeathdey: 'что то',
            area: 'что то',
            research: 'что то',
            idPacient: 'что то',
            quality: 'что то',
            AETitle: 'что то',
            direction: 'что то',
            registrationNumber: 'что то',
            priority: 'что то',
            institution: 'что то',
            appointed: 'что то',
            nameProtokol: 'что то'
        },{
            modal: 'что то',
            checkedId: 'check1',
            date: '85.12.3021',
            fio: 'что то',
            floor: 'что то',
            dateBeathdey: 'что то',
            area: 'что то',
            research: 'что то',
            idPacient: 'что то',
            quality: 'что то',
            AETitle: 'что то',
            direction: 'что то',
            registrationNumber: 'что то',
            priority: 'что то',
            institution: 'что то',
            appointed: 'что то',
            nameProtokol: 'что то'
        },{
            modal: 'что то',
            checkedId: 'check1',
            date: '85.12.3021',
            fio: 'что то',
            floor: 'что то',
            dateBeathdey: 'что то',
            area: 'что то',
            research: 'что то',
            idPacient: 'что то',
            quality: 'что то',
            AETitle: 'что то',
            direction: 'что то',
            registrationNumber: 'что то',
            priority: 'что то',
            institution: 'что то',
            appointed: 'что то',
            nameProtokol: 'что то'
        }
    ]
}
const BaseTable = new Vue({
    el: "#baseTable",
    data() {
        return {
            dataEl: getData(),
            ops: {
                scrollPanel: {
                    initialScrollX: 1,
                    initialScrollY: 1,
                },
            },
            columns: [
                'choice',
                'status',
                'modal',
                'dateTime',
                'fio',
                'floor',
                'dateBeathdey',
                'area',
                'research',
                'idPacient',
                'quality',
                'AETitle',
                'direction',
                'registrationNumber',
                'priority',
                'institution',
                'appointed',
                'nameProtokol',
            ],
            filterable:  [
                'choice',
                'status',
                'modal',
                'dateTime',
                'fio',
                'floor',
                'dateBeathdey',
                'area',
                'research',
                'idPacient',
                'quality',
                'AETitle',
                'direction',
                'registrationNumber',
                'priority',
                'institution',
                'appointed',
                'nameProtokol',
            ],
            options: {
                headings: {
                    status: 'что то',
                    modal: 'что то',
                    dateTime: 'что то',
                    fio: 'что то',
                    floor: 'что то',
                    dateBeathdey: 'что то',
                    area: 'что то',
                    research: 'что то',
                    idPacient: 'что то',
                    quality: 'что то',
                    AETitle: 'что то',
                    direction: 'что то',
                    registrationNumber: 'что то',
                    priority: 'что то',
                    institution: 'что то',
                    appointed: 'что то',
                    nameProtokol: 'что то',
                },
                sortable: [
                    'status',
                    'modal',
                    'dateTime',
                    'fio',
                    'floor',
                    'dateBeathdey',
                    'area',
                    'research',
                    'idPacient',
                    'quality',
                    'AETitle',
                    'direction',
                    'registrationNumber',
                    'priority',
                    'institution',
                    'appointed',
                    'nameProtokol',
                ]
            },
        }
    }
});
.table {
    border-collapse: collapse;
  background: black;
    font-size: calc(100vw * 19/834);
    line-height: calc(100vw * 31/834);
    letter-spacing: -0.015em;
    color: #fff;
    width: 100%;
    overflow: auto!important;
}

.table thead th{
    border-right: 2px solid #3E5266;
}

.VueTables thead tr {
    border-bottom: 2px solid #3E5266;
    position: relative;
    z-index: 1;
    background: #597A95;
}

.VueTables thead th {
    font-family: 'Inter-SemiBold';
    background: linear-gradient(180deg, #3E523F 0%, rgba(67, 91, 114, 0.00520833) 260.84%, #234636 260.87%);
}

.table thead th:last-child {
    border-right: none;
}

.VueTables {
    border-collapse: collapse;
}

.VueTables th {
    white-space: nowrap;
    font-weight: normal;
}

.table__edit-img {
    padding: 0;
    width: calc(100vw * 30/834);
    height: calc(100vw * 30/834);
    vertical-align: middle;
}

.table__edit-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.VueTables thead {
    z-index: 1;
    position: sticky;
    top: 0;
}

.VueTables thead th:first-child {
    padding-left: calc((100vw - 320px) / (1024 - 320) * (7 - 2) + 2px);
    padding-right: calc((100vw - 320px) / (1024 - 320) * (7 - 2) + 2px);
    line-height: 0;
}

.VueTables__sortable  {
    padding: calc(100vw * 5/834) calc(100vw * 6/834);
    cursor: pointer;
}

.VueTables__heading {
    display: inline-block;
    vertical-align: middle;
}

.VueTables__sortable::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 4px;
    background-image: url('../images/marker-sort.svg');
    background-repeat: no-repeat;
    background-size: contain;
    width: calc((100vw - 1024px) / (2560 - 1024) * (18 - 12) + 12px);
    height: calc((100vw - 1024px) / (2560 - 1024) * (10 - 8) + 8px);
    opacity: 0;
    transition: opacity 0.3s;
}

.VueTables__sortable[class*="-sorted-asc"] .table__wrap-sort,
.VueTables__sortable[class*="-sorted-desc"] .table__wrap-sort,
.VueTables__sortable[class*="-sorted-asc"]::before,
.VueTables__sortable[class*="-sorted-desc"]::before {
    opacity: 1;
}

.VueTables__sortable[class*="-sorted-asc"] .table__wrap-sort .arrow-up {
    fill: #D9D9D9;
}

.VueTables__sortable[class*="-sorted-desc"] .table__wrap-sort .arrow-down {
    fill: #D9D9D9;
}

.VueTables td {
    padding-left: calc((100vw - 320px) / (1024 - 320) * (4 - 2) + 2px);
    padding-right: calc((100vw - 320px) / (1024 - 320) * (4 - 2) + 2px);
    text-align: center;
    border-right: 2px solid #3E5266;
    white-space: nowrap;
    height: calc((100vw - 1024px) / (1440 - 1024) * (28 - 24) + 24px);
    line-height: calc((100vw - 1024px) / (1440 - 1024) * (28 - 23) + 23px);
    padding: calc(100vw * 4/834) calc(100vw * 6/834);
}

.VueTables tbody tr:nth-child(odd) {
    background: #6B6D8A;
}

.VueTables tbody tr.active {
    background: rgba(255, 147, 80, 0.45);
}

.VueTables--client>.row:first-of-type {
    display: none;
}

.VuePagination__pagination {
    display: flex;
    align-items: center;
}

.VuePagination__pagination-item {
    list-style: none;
}

.VuePagination {
    display: none;
}

.bottom-table {
    width: calc((100vw - 1440px) / (2560 - 1440) * (383 - 340) + 340px);
}

.wrap-table {
    position: relative;
    overflow: hidden;
    border-radius: 0px 0px 4px 4px;
    border: 2px solid #3E5266;
    /* border-bottom: none; */
    height: 100%;
}

.table__wrap-sort {
    display: flex;
    position: absolute;
    width: calc((100vw - 320px) / (1024 - 320) * (19 - 13) + 13px);
    height: calc((100vw - 320px) / (1024 - 320) * (16 - 10) + 10px);
    top: 50%;
    transform: translateY(-50%);
    right: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

.table__wrap-sort svg {
    width: 100%;
    height: 100%;
}

.table__wrap-sort .arrow-down,
.table__wrap-sort .arrow-up {
    transition: fill 0.3s;
}

.VueTables tr td:last-child {
    border-right: none;
}

.table-characteristics thead {
    display: none;
}

.table-characteristics.VueTables td {
    text-align: left;
}

.__vuescroll.hasHBar .VueTables {
    padding-bottom: calc(100vw * 22/834);
}

.table__wrap-sort {
    width: calc((100vw - 1024px) / (2560 - 1004) * (19 - 12) + 12px);
    height: calc((100vw - 1024px) / (2560 - 1004) * (19 - 12) + 12px);
}
.table__status-item {
    width: calc(100vw * 20/834);
    height: calc(100vw * 20/834);
    margin-right: calc(100vw * 5/834);
    padding: 0;
}

.table__status-item:last-child {
    margin-right: 0;
}

.table__status-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.table__status {
    display: flex;
    align-items: center;
}

.table__status-color {
    border-radius: 50%;
    background: #fff;
    border: 2px solid #D9D9D9;
    height: 100%;
}

.table__status-color[data-color="green"] {
    background: #54EE51;
}

.table__status-color[data-color="red"] {
    background: red;
}

.table__status-color[data-color="black"] {
    background: black;
}

@media (min-width: 1024px) {
    .table {
        font-size: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);
        line-height: calc((100vw - 1024px) / (1440 - 1024) * (32 - 26) + 26px);
    }

    .VueTables td {
        padding-left: calc((100vw - 1024px) / (1024 - 320) * (6 - 4) + 4px);
        padding-right: calc((100vw - 1024px) / (1024 - 320) * (6 - 4) + 4px);
    }

    .VueTables thead th:first-child {
        padding-left: calc((100vw - 1024px) / (1440 - 1024) * (10 - 7) + 7px);
        padding-right: calc((100vw - 1024px) / (1440 - 1024) * (10 - 7) + 7px);
    }

    .table__status-item {
        width: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);
        height: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);
        margin-right: 5px;
    }

    .table__check label {
        width: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);
        height: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);
    }

    .table__check label::before {
        transform: translateY(-50%) translateX(-50%);
        width: calc((100vw - 1024px) / (1440 - 1024) * (8 - 6) + 6px);
        height: calc((100vw - 1024px) / (1440 - 1024) * (8 - 6) + 6px);
    }

    .__vuescroll.hasHBar .VueTables {
        padding-bottom: calc((100vw - 1024px) / (1440 - 1024) * (24 - 20) + 20px);
    }

    .VueTables__sortable  {
        padding-left: calc((100vw - 1024px) / (1440 - 1024) * (28 - 17) + 24px);
        padding-right: calc((100vw - 1024px) / (1440 - 1024) * (28 - 17) + 24px);
        padding-top: calc((100vw - 1024px) / (1440 - 1024) * (7 - 4) + 4px);
        padding-bottom: calc((100vw - 1024px) / (1440 - 1024) * (7 - 4) + 4px);
        cursor: pointer;
    }

    .table__edit-img {
        width: calc((100vw - 1024px) / (1440 - 1024) * (28 - 22) + 22px);
        height: calc((100vw - 1024px) / (1440 - 1024) * (28 - 22) + 22px);
    }
}

@media (min-width: 1440px) {
    .VueTables__sortable  {
        padding-left: 31px;
        padding-right: 31px;
        padding-top: 5px;
    }

    .VueTables thead th:first-child {
        padding-left: 10px;
        padding-right: 10px;
    }

    .VueTables td {
        padding-left: 6px;
        padding-right: 6px;
        height: 28px;
    }

    .table__edit-img {
        width: 28px;
        height: 28px;
    }

    .vuetable th,
    .vuetable td {
        padding-left: 6px;
        padding-right: 6px;
    }

    .table {
        font-size: 20px;
        line-height: 32px;
    }

    .__vuescroll.hasHBar .VueTables {
        padding-bottom: calc((100vw - 1440px) / (1920 - 1440) * (20 - 24) + 24px);
    }

    /* checkbox */
    .table__check label {
        width: 20px;
        height: 20px;
    }
    .table__check label::before {
        width: 8px;
        height: 8px;
    }
    /* end checkbox */

    /* status icon */
    .table__status-item {
        width: 20px;
        height: 20px;
    }
    /* end status icon */
}

@media screen and (min-width: 1920px) {

    .VueTables__sortable  {
        padding-top: calc((100vw - 1920px) / (2560 - 1920) * (6 - 5) + 5px);
        padding-bottom: calc((100vw - 1920px) / (2560 - 1920) * (6 - 5) + 5px);
    }

    .table__edit-img {
        width: calc((100vw - 1920px) / (3840 - 1920) * (36 - 28) + 28px);
        height: calc((100vw - 1920px) / (3840 - 1920) * (36 - 28) + 28px);
    }

    .vuetable th,
    .vuetable td {
        padding-left: calc((100vw - 1920px) / (3840 - 1920) * (10 - 6) + 6px);
        padding-right: calc((100vw - 1920px) / (3840 - 1920) * (10 - 6) + 6px);
    }

    .table {
        font-size: calc((100vw - 1920px) / (2560 - 1920) * (22 - 20) + 20px);
        line-height: calc((100vw - 1920px) / (2560 - 1920) * (36 - 32) + 32px);
    }

    .__vuescroll.hasHBar .VueTables {
        padding-bottom: calc((100vw - 1920px) / (2560 - 1920) * (27 - 20) + 20px);
    }

    .VueTables td {
        height: calc((100vw - 1920px) / (2560 - 1920) * (31 - 28) + 28px);
    }

    /* checkbox */
    .table__check label {
        width: calc((100vw - 1920px) / (3840 - 1920) * (26 - 20) + 20px);
        height: calc((100vw - 1920px) / (3840 - 1920) * (26 - 20) + 20px);
    }
    .table__check label::before {
        width: calc((100vw - 1920px) / (3840 - 1920) * (11 - 8) + 8px);
        height: calc((100vw - 1920px) / (3840 - 1920) * (11 - 8) + 8px);
    }
    /* end checkbox */

    /* status icon */
    .table__status-item {
        width: calc((100vw - 1920px) / (2560 - 1920) * (32 - 28) + 28px);
        height: calc((100vw - 1920px) / (2560 - 1920) * (32 - 28) + 28px);
    }
    /* end status icon */
}

@media (min-width: 2560px) {
    .table {
        font-size: calc((100vw - 2560px) / (3840 - 2560) * (24 - 22) + 22px);
        line-height: calc((100vw - 2560px) / (3840 - 2560) * (39 - 36) + 36px);
    }

    .VueTables td {
        padding-left: calc((100vw - 2560px) / (3840 - 2560) * (10 - 6) + 6px);
        padding-right: calc((100vw - 2560px) / (3840 - 2560) * (10 - 6) + 6px);
        padding-bottom: calc((100vw - 2560px) / (3840 - 2560) * (8 - 4) + 4px);
        padding-top: calc((100vw - 2560px) / (3840 - 2560) * (5 - 4) + 4px);
    }

    .VueTables__sortable  {
        padding-top: calc((100vw - 2560px) / (3840 - 2560) * (9 - 6) + 6px);
        padding-bottom: calc((100vw - 2560px) / (3840 - 2560) * (9 - 6) + 6px);
        padding-left: calc((100vw - 2560px) / (3840 - 2560) * (37 - 35) + 35px);
        padding-right: calc((100vw - 2560px) / (3840 - 2560) * (37 - 35) + 35px);
    }

    .VueTables thead th:first-child {
        padding-left: calc((100vw - 1024px) / (1440 - 1024) * (12 - 10) + 10px);
        padding-right: calc((100vw - 1024px) / (1440 - 1024) * (12 - 10) + 10px);
    }

    .table__wrap-sort {
        width: calc((100vw - 1920px) / (2560 - 1920) * (23 - 19) + 19px);
        height: calc((100vw - 1920px) / (2560 - 1920) * (20 - 16) + 16px);
    }

    .__vuescroll.hasHBar .VueTables {
        padding-bottom: calc((100vw - 2560px) / (3840 - 2560) * (32 - 27) + 27px);
    }

    .VueTables td {
        height: calc((100vw - 2560px) / (3840 - 2560) * (39 - 31) + 31px);
    }

    /* status icon */
    .table__status-item {
        width: calc((100vw - 2560px) / (3840 - 2560) * (37 - 32) + 32px);
        height: calc((100vw - 2560px) / (3840 - 2560) * (37 - 32) + 32px);
    }
    /* end status icon */
}

.__rail-is-horizontal {
    display: flex;
    align-items: center;
    background: #3E5266!important;
    height: calc(100vw * 24/834)!important;
    border-radius: 0!important;
    bottom: -2px!important;
    width: 100%;
}

.__rail-is-vertical {
    height: 100%;
    background: #3E5266!important;
    border-radius: 0!important;
    width: calc(100vw * 24/834)!important;
    right: -2px!important;
    display: flex;
    justify-content: center;
    height: 100%;
}

/* .mouseEnter .__rail-is-vertical {
    opacity: 1;
} */

.__bar-wrap-is-horizontal {
    background: #3D607E;
    border-radius: 12px!important;
    height: calc(100vw * 20/834)!important;
}

.__bar-wrap-is-vertical {
    background: #3D607E;
    border-radius: 12px!important;
    width: calc(100vw * 20/834)!important;
}

.__bar-is-horizontal {
    opacity: 1!important;
    background: #8495A2!important;
    border-radius: 12px!important;
    height: 100%!important;
}

.__bar-is-vertical {
    opacity: 1!important;
    background: #8495A2!important;
    border-radius: 12px!important;
    width: 100%!important;
}

.scroll-tabs .__rail-is-horizontal {
    width: 100%;
    margin: 0!important;
    bottom: -2px!important;
}

/* .__vuescroll.hasVBar.hasHBar .__rail-is-vertical {
    height: calc(100% - (100vw * 42/834));
    top: calc(100vw * 42/834)!important;
} */

.__vuescroll.hasVBar.hasHBar .__bar-wrap-is-vertical {
    height: calc(100% - calc((100vw - 1024px) / (1440 - 1024) * (27 - 22) + 22px));
}

.__vuescroll.hasVBar.hasHBar .__bar-wrap-is-horizontal {
    width: calc(100% - (100vw * 40/834));
}

@media screen and (min-width: 1024px) {
    .__rail-is-horizontal {
        height: calc((100vw - 1024px) / (1440 - 1024) * (24 - 20) + 20px)!important;
    }

    .__rail-is-vertical {
        width: calc((100vw - 1024px) / (1440 - 1024) * (24 - 20) + 20px)!important;
    }

    .__bar-wrap-is-horizontal {
        height: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px)!important;
    }

    .__vuescroll.hasVBar.hasHBar .__bar-wrap-is-horizontal {
        width: calc(100% - calc((100vw - 1024px) / (1440 - 1024) * (27 - 20) + 20px));
    }

    .__bar-wrap-is-vertical {
        width: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px)!important;
    }
}

@media screen and (min-width: 1440px) {
    .__rail-is-horizontal {
        height: 24px!important;
    }

    .__rail-is-vertical {
        width: 24px!important;
    }

    .__bar-wrap-is-horizontal {
        height: 20px!important;
    }

    .__bar-wrap-is-vertical {
        width: 20px!important;
    }
}

.wrap-table {
  height: 200px;
}
<!DOCTYPE html>
<html lang="en" {IF CLASSES}class="classes"{/IF}>

<head>
  <meta charset="UTF-8">
</head>
<body>
  <div class="wrap-table wrap-table--main" id="baseTable">
                      <vue-scroll class="scroll-table" :initialScrollY="true" :ops="ops">
                          <v-client-table
                              :columns="columns"
                              :data="dataEl"
                              :options="options"
                              :show-sort-icons="true"
                              class="table-main"
                              :filter="false"
                          >
                              <div
                                  v-for="(column, index) in columns"
                                  :key="'column'+index"
                                  :slot="`h__${column}`"
                                  class="bin"
                              >
                                  <span v-if="index !== 0" v-html="options.headings[column]"></span>
                                  <span v-if="index !== 0" class="table__wrap-sort">
                                      <svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 15.7 16" enable-background="new 0 0 15.7 16" xml:space="preserve">
                                          <path class="arrow-down" fill="#808e9b" d="M14.2,8.6H1.5c-0.7,0-1.2,0.4-1.4,1s0,1.3,0.6,1.7L7,15.7C7.2,15.9,7.5,16,7.8,16s0.6-0.1,0.9-0.3l6.3-4.5 c0.5-0.4,0.8-1,0.6-1.7C15.4,9,14.8,8.6,14.2,8.6z"/>
                                          <path class="arrow-up" fill="#808e9b" d="M1.5,7.4h12.7c0.7,0,1.2-0.4,1.4-1c0.2-0.6,0-1.3-0.6-1.7L8.7,0.3C8.2-0.1,7.5-0.1,7,0.3L0.6,4.8 c-0.5,0.4-0.8,1-0.6,1.7S0.8,7.4,1.5,7.4z"/>
                                      </svg>
                                  </span>
                              </div>
                              <template slot="h__choice">
                                  <button class="table__edit-img" @click="updateTable">
                                      <img :src="imgUpdate" alt="" width="22" height="22">
                                  </button>
                              </template>
                              <div class="table__status glyphicon glyphicon-star" slot="status" slot-scope="props">
                                  <button class="table__status-item" v-for="(item, index) in props.row.status.slice(0, 7)" :key="'status-table-'+index">
                                      <img v-if="item.statusImg" :src="item.statusImg" :alt="item.statusText" width="" height="" />
                                      <div v-if="item.color" class="table__status-color" :data-color="item.color">
                                          <!-- выпадающий список из цветов, наверное, пока застилить кружком -->
                                          <!-- <div>color</div> -->
                                      </div>
                                  </button>
                              </div>
                              <div slot="dateTime" slot-scope="props" v-html="props.row.date"></div>
                          </v-client-table>
                      </vue-scroll>

    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.0/dist/vue.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/vue-tables-2@2.3.5/dist/vue-tables-2.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/vuescroll@4.17.5/dist/vuescroll.min.js"></script>
</body>

Буду благодарна за совет. Схематично накинула как это выглядеть должно

A: Вариант 1

*

*При монтировании и загрузке данными таблицы делаем ширину колонок в thaed и tbody одинаковыми.

*При клике на table header , делаем его активным и позволяем обрабатывать только его скрол, аналогично при клике на table body, для сенсорных нужно будет обрабатывать касания.

*При скролировании делаем скрол другого элемента на ту же позицию
В случае прокрутки колесиком table body запоминаем верткальную позицию прокрутки (как при скроле)

function getData() {
    return Array.from(new Array(7)).fill(
        {
            modal: 'что то',
            checkedId: 'check1',
            date: '85.12.3021',
            fio: 'что то',
            floor: 'что то',
            dateBeathdey: 'что то',
            area: 'что то',
            research: 'что то',
            idPacient: 'что то',
            quality: 'что то',
            AETitle: 'что то',
            direction: 'что то',
            registrationNumber: 'что то',
            priority: 'что то',
            institution: 'что то',
            appointed: 'что то',
            nameProtokol: 'что то',
            //status: ['статус','статус','статус','статус','статус','статус','статус','статус','статус','статус','статус']
        })

}

new Vue({
    el: "#app",

    data() {
        return {
            count: 0,
            active: 'head or body', // костыльчик 1 (конфликт скроллинга)
            scrollXPos: 0,
            scrollYPos: 0, // костыльчик 3 (позиция скрола по высоте)
            dataEl: getData(),
            columns: [
                'choice',
                'status',
                'modal',
                'date', // <- было 'dateTime' (найти данные в объекте)
                'fio',
                'floor',
                'dateBeathdey',
                'area',
                'research',
                'idPacient',
                'quality',
                'AETitle',
                'direction',
                'registrationNumber',
                'priority',
                'institution',
                'appointed',
                'nameProtokol',
            ],
        }
    },
    mounted() {
        const th = this.$refs.thead.querySelector('table thead tr')
        const tr = this.$refs.tbody.querySelector('table tbody tr')
        const h = Array.from(th.querySelectorAll('th'))
        const r = Array.from(tr.querySelectorAll('td'))
        for (c in r){
            const minColumnWidth = 100
            w = Math.max(Math.min(h[c].clientWidth, r[c].clientWidth), minColumnWidth)
            h[c].style.maxWidth = `${w}px`
            h[c].style.width = `${w}px`
            r[c].style.maxWidth = `${w}px`
            r[c].style.width = `${w}px`
        }
    },
    methods: {
        activate(e) { this.active = 'head' },
        scrollHanlder(e) {
            if (this.active === 'head'){
                this.$refs.tbody.scroll(e.target.scrollLeft, this.scrollYPos)
            }
        },
        activate2(e) { this.active = 'body' },
        scrollHanlder2(e) {
            this.scrollYPos = e.target.scrollTop
            if (this.active === 'body'){
                this.$refs.thead.scroll(e.target.scrollLeft, 0)
            }
        }
    },
})
.header-wrapper {
    display: flex;
    align-items: flex-start;
    width: 100vw;
    height: 40px;
    overflow-x: scroll;
}
.fix-header { /* костыльчик 4 (дополнить скролл) */
    min-width: 25vw; /* = (100vw - .body-wrapper.width) */
}
.body-wrapper {
    width: 75vw;
    height: 120px;
    overflow-x: scroll;
}
.theader {
    width: 200%;
    border-collapse: collapse;
}
.table thead th{
    border-right: 2px solid #3E5266;
    font-family: 'Inter-SemiBold';
    background: linear-gradient(180deg, #3E523F 0%, rgba(67, 91, 114, 0.00520833) 260.84%, #234636 260.87%);
}
tbody tr:nth-child(odd) {
    background: #6B6D8A;
}
.table { /* костыльчик 2 (сделать таблицы одинаковой ширины) */
    min-width: 3000px;
    width: 3000px;
}
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.0/dist/vue.js"></script>

<div id="app">
    <div class="header-wrapper" ref="thead" @scroll="scrollHanlder" @mousedown="activate">
        <table border="1" class="theader table">
            <thead>
                <tr>
                    <th v-for="(item, index) in columns">{{item}}</th>
                </tr>
            </thead>
        </table>
        <div class="fix-header"> </div>
    </div>
    <div class="body-wrapper" ref="tbody" @scroll="scrollHanlder2" @mousedown="activate2" @wheel="scrollHanlder2">
        <table border="1" class="theader table">
            <tbody>
                <tr v-for="(row, index) in dataEl">
                    <td v-for="(item, index) in columns">{{row[item]}}</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>

Стили я прописал минимальные, просто чтобы можно было видеть основные моменты. На счет сортировки можно попробовать посмотреть например такой пример и реализовать что-то похожее для этих данных. Заголовки колонок не подменял - для экономии места и наглядности.
Вариант 2:
Этот вариант экзотический, и понятное дело тоже немного костыльный. По части горизонтального скрола я его не доделал нужен тот же фикс что был в пеовом варианте (JS:создать и внедрить элемент после таблицы) По поводу общего исполнения, в данном случае понадобилось только дописать css,  где clip-path задает Г-образную форму таблицы и скроллбары смещаются:
.scroll-table.__vuescroll.hasVBar.hasHBar {
   clip-path: polygon(100% 0%,100% 23%,95% 23%,95% 100%,0% 100%,0% 0%);
}
.__rail-is-vertical{
    top: 23% !important;
    right: 5% !important;
    z-index: 1;
    max-height: 77%;
}
.__rail-is-horizontal{
    max-width: 95%;
}

Посмотреть результат можно тут

 .table {border-collapse: collapse;background: black;font-size: calc(100vw * 19/834);line-height: calc(100vw * 31/834);letter-spacing: -0.015em;color: #fff;width: 100%;overflow: auto!important;}.table thead th{border-right: 2px solid #3E5266;}.VueTables thead tr {border-bottom: 2px solid #3E5266;position: relative;z-index: 1;background: #597A95;}.VueTables thead th {font-family: 'Inter-SemiBold';background: linear-gradient(180deg, #3E523F 0%, rgba(67, 91, 114, 0.00520833) 260.84%, #234636 260.87%);}.table thead th:last-child {border-right: none;}.VueTables {border-collapse: collapse;}.VueTables th {white-space: nowrap;font-weight: normal;}.table__edit-img {padding: 0;width: calc(100vw * 30/834);height: calc(100vw * 30/834);vertical-align: middle;}.table__edit-img img {width: 100%;height: 100%;object-fit: cover;}.VueTables thead {z-index: 1;position: sticky;top: 0;}.VueTables thead th:first-child {padding-left: calc((100vw - 320px) / (1024 - 320) * (7 - 2) + 2px);padding-right: calc((100vw - 320px) / (1024 - 320) * (7 - 2) + 2px);line-height: 0;}.VueTables__sortable {padding: calc(100vw * 5/834) calc(100vw * 6/834);cursor: pointer;}.VueTables__heading {display: inline-block;vertical-align: middle;}.VueTables__sortable::before {content: '';position: absolute;bottom: 4px;left: 4px;background-image: url('../images/marker-sort.svg');background-repeat: no-repeat;background-size: contain;width: calc((100vw - 1024px) / (2560 - 1024) * (18 - 12) + 12px);height: calc((100vw - 1024px) / (2560 - 1024) * (10 - 8) + 8px);opacity: 0;transition: opacity 0.3s;}.VueTables__sortable[class*="-sorted-asc"] .table__wrap-sort, .VueTables__sortable[class*="-sorted-desc"] .table__wrap-sort, .VueTables__sortable[class*="-sorted-asc"]::before, .VueTables__sortable[class*="-sorted-desc"]::before {opacity: 1;}.VueTables__sortable[class*="-sorted-asc"] .table__wrap-sort .arrow-up {fill: #D9D9D9;}.VueTables__sortable[class*="-sorted-desc"] .table__wrap-sort .arrow-down {fill: #D9D9D9;}.VueTables td {padding-left: calc((100vw - 320px) / (1024 - 320) * (4 - 2) + 2px);padding-right: calc((100vw - 320px) / (1024 - 320) * (4 - 2) + 2px);text-align: center;border-right: 2px solid #3E5266;white-space: nowrap;height: calc((100vw - 1024px) / (1440 - 1024) * (28 - 24) + 24px);line-height: calc((100vw - 1024px) / (1440 - 1024) * (28 - 23) + 23px);padding: calc(100vw * 4/834) calc(100vw * 6/834);}.VueTables tbody tr:nth-child(odd) {background: #6B6D8A;}.VueTables tbody tr.active {background: rgba(255, 147, 80, 0.45);}.VueTables--client>.row:first-of-type {display: none;}.VuePagination__pagination {display: flex;align-items: center;}.VuePagination__pagination-item {list-style: none;}.VuePagination {display: none;}.bottom-table {width: calc((100vw - 1440px) / (2560 - 1440) * (383 - 340) + 340px);}.wrap-table {position: relative;overflow: hidden;border-radius: 0px 0px 4px 4px;border: 2px solid #3E5266;height: 100%;}.table__wrap-sort {display: flex;position: absolute;width: calc((100vw - 320px) / (1024 - 320) * (19 - 13) + 13px);height: calc((100vw - 320px) / (1024 - 320) * (16 - 10) + 10px);top: 50%;transform: translateY(-50%);right: 2px;opacity: 0;transition: opacity 0.3s;}.table__wrap-sort svg {width: 100%;height: 100%;}.table__wrap-sort .arrow-down, .table__wrap-sort .arrow-up {transition: fill 0.3s;}.VueTables tr td:last-child {border-right: none;}.table-characteristics thead {display: none;}.table-characteristics.VueTables td {text-align: left;}.__vuescroll.hasHBar .VueTables {padding-bottom: calc(100vw * 22/834);}.table__wrap-sort {width: calc((100vw - 1024px) / (2560 - 1004) * (19 - 12) + 12px);height: calc((100vw - 1024px) / (2560 - 1004) * (19 - 12) + 12px);}.table__status-item {width: calc(100vw * 20/834);height: calc(100vw * 20/834);margin-right: calc(100vw * 5/834);padding: 0;}.table__status-item:last-child {margin-right: 0;}.table__status-item img {width: 100%;height: 100%;object-fit: contain;}.table__status {display: flex;align-items: center;}.table__status-color {border-radius: 50%;background: #fff;border: 2px solid #D9D9D9;height: 100%;}.table__status-color[data-color="green"] {background: #54EE51;}.table__status-color[data-color="red"] {background: red;}.table__status-color[data-color="black"] {background: black;}@media (min-width: 1024px) {.table {font-size: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);line-height: calc((100vw - 1024px) / (1440 - 1024) * (32 - 26) + 26px);}.VueTables td {padding-left: calc((100vw - 1024px) / (1024 - 320) * (6 - 4) + 4px);padding-right: calc((100vw - 1024px) / (1024 - 320) * (6 - 4) + 4px);}.VueTables thead th:first-child {padding-left: calc((100vw - 1024px) / (1440 - 1024) * (10 - 7) + 7px);padding-right: calc((100vw - 1024px) / (1440 - 1024) * (10 - 7) + 7px);}.table__status-item {width: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);height: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);margin-right: 5px;}.table__check label {width: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);height: calc((100vw - 1024px) / (1440 - 1024) * (20 - 16) + 16px);}.table__check label::before {transform: translateY(-50%) translateX(-50%);width: calc((100vw - 1024px) / (1440 - 1024) * (8 - 6) + 6px);height: calc((100vw - 1024px) / (1440 - 1024) * (8 - 6) + 6px);}.__vuescroll.hasHBar .VueTables {padding-bottom: calc((100vw - 1024px) / (1440 - 1024) * (24 - 20) + 20px);}.VueTables__sortable {padding-left: calc((100vw - 1024px) / (1440 - 1024) * (28 - 17) + 24px);padding-right: calc((100vw - 1024px) / (1440 - 1024) * (28 - 17) + 24px);padding-top: calc((100vw - 1024px) / (1440 - 1024) * (7 - 4) + 4px);padding-bottom: calc((100vw - 1024px) / (1440 - 1024) * (7 - 4) + 4px);cursor: pointer;}.table__edit-img {width: calc((100vw - 1024px) / (1440 - 1024) * (28 - 22) + 22px);height: calc((100vw - 1024px) / (1440 - 1024) * (28 - 22) + 22px);}}@media (min-width: 1440px) {.VueTables__sortable {padding-left: 31px;padding-right: 31px;padding-top: 5px;}.VueTables thead th:first-child {padding-left: 10px;padding-right: 10px;}.VueTables td {padding-left: 6px;padding-right: 6px;height: 28px;}.table__edit-img {width: 28px;height: 28px;}.vuetable th, .vuetable td {padding-left: 6px;padding-right: 6px;}.table {font-size: 20px;line-height: 32px;}.__vuescroll.hasHBar .VueTables {padding-bottom: calc((100vw - 1440px) / (1920 - 1440) * (20 - 24) + 24px);}.table__check label {width: 20px;height: 20px;}.table__check label::before {width: 8px;height: 8px;}.table__status-item {width: 20px;height: 20px;}}@media screen and (min-width: 1920px) {.VueTables__sortable {padding-top: calc((100vw - 1920px) / (2560 - 1920) * (6 - 5) + 5px);padding-bottom: calc((100vw - 1920px) / (2560 - 1920) * (6 - 5) + 5px);}.table__edit-img {width: calc((100vw - 1920px) / (3840 - 1920) * (36 - 28) + 28px);height: calc((100vw - 1920px) / (3840 - 1920) * (36 - 28) + 28px);}.vuetable th, .vuetable td {padding-left: calc((100vw - 1920px) / (3840 - 1920) * (10 - 6) + 6px);padding-right: calc((100vw - 1920px) / (3840 - 1920) * (10 - 6) + 6px);}.table {font-size: calc((100vw - 1920px) / (2560 - 1920) * (22 - 20) + 20px);line-height: calc((100vw - 1920px) / (2560 - 1920) * (36 - 32) + 32px);}.__vuescroll.hasHBar .VueTables {padding-bottom: calc((100vw - 1920px) / (2560 - 1920) * (27 - 20) + 20px);}.VueTables td {height: calc((100vw - 1920px) / (2560 - 1920) * (31 - 28) + 28px);}.table__check label {width: calc((100vw - 1920px) / (3840 - 1920) * (26 - 20) + 20px);height: calc((100vw - 1920px) / (3840 - 1920) * (26 - 20) + 20px);}.table__check label::before {width: calc((100vw - 1920px) / (3840 - 1920) * (11 - 8) + 8px);height: calc((100vw - 1920px) / (3840 - 1920) * (11 - 8) + 8px);}.table__status-item {width: calc((100vw - 1920px) / (2560 - 1920) * (32 - 28) + 28px);height: calc((100vw - 1920px) / (2560 - 1920) * (32 - 28) + 28px);}}@media (min-width: 2560px) {.table {font-size: calc((100vw - 2560px) / (3840 - 2560) * (24 - 22) + 22px);line-height: calc((100vw - 2560px) / (3840 - 2560) * (39 - 36) + 36px);}.VueTables td {padding-left: calc((100vw - 2560px) / (3840 - 2560) * (10 - 6) + 6px);padding-right: calc((100vw - 2560px) / (3840 - 2560) * (10 - 6) + 6px);padding-bottom: calc((100vw - 2560px) / (3840 - 2560) * (8 - 4) + 4px);padding-top: calc((100vw - 2560px) / (3840 - 2560) * (5 - 4) + 4px);}.VueTables__sortable {padding-top: calc((100vw - 2560px) / (3840 - 2560) * (9 - 6) + 6px);padding-bottom: calc((100vw - 2560px) / (3840 - 2560) * (9 - 6) + 6px);padding-left: calc((100vw - 2560px) / (3840 - 2560) * (37 - 35) + 35px);padding-right: calc((100vw - 2560px) / (3840 - 2560) * (37 - 35) + 35px);}.VueTables thead th:first-child {padding-left: calc((100vw - 1024px) / (1440 - 1024) * (12 - 10) + 10px);padding-right: calc((100vw - 1024px) / (1440 - 1024) * (12 - 10) + 10px);}.table__wrap-sort {width: calc((100vw - 1920px) / (2560 - 1920) * (23 - 19) + 19px);height: calc((100vw - 1920px) / (2560 - 1920) * (20 - 16) + 16px);}.__vuescroll.hasHBar .VueTables {padding-bottom: calc((100vw - 2560px) / (3840 - 2560) * (32 - 27) + 27px);}.VueTables td {height: calc((100vw - 2560px) / (3840 - 2560) * (39 - 31) + 31px);}.table__status-item {width: calc((100vw - 2560px) / (3840 - 2560) * (37 - 32) + 32px);height: calc((100vw - 2560px) / (3840 - 2560) * (37 - 32) + 32px);}}.__rail-is-horizontal {display: flex;align-items: center;background: #3E5266!important;height: calc(100vw * 24/834)!important;border-radius: 0!important;bottom: -2px!important;width: 100%;}.__rail-is-vertical {height: 100%;background: #3E5266!important;border-radius: 0!important;width: calc(100vw * 24/834)!important;right: -2px!important;display: flex;justify-content: center;height: 100%;}.__bar-wrap-is-horizontal {background: #3D607E;border-radius: 12px!important;height: calc(100vw * 20/834)!important;}.__bar-wrap-is-vertical {background: #3D607E;border-radius: 12px!important;width: calc(100vw * 20/834)!important;}.__bar-is-horizontal {opacity: 1!important;background: #8495A2!important;border-radius: 12px!important;height: 100%!important;}.__bar-is-vertical {opacity: 1!important;background: #8495A2!important;border-radius: 12px!important;width: 100%!important;}.scroll-tabs .__rail-is-horizontal {width: 100%;margin: 0!important;bottom: -2px!important;}.__vuescroll.hasVBar.hasHBar .__bar-wrap-is-vertical {height: calc(100% - calc((100vw - 1024px) / (1440 - 1024) * (27 - 22) + 22px));}.__vuescroll.hasVBar.hasHBar .__bar-wrap-is-horizontal {width: calc(100% - (100vw * 40/834));}.wrap-table {height: 200px;}
/******************************/
    * {
      margin: 0;
    }

    .scroll-table.__vuescroll.hasVBar.hasHBar {
       clip-path: polygon(100% 0%,100% 23%,95% 23%,95% 100%,0% 100%,0% 0%);
    }
    .__rail-is-vertical{
        top: 23% !important;
        right: 5% !important;
        z-index: 1;
        max-height: 77%;
    }
    .__rail-is-horizontal{
        max-width: 95%;
    }
<!DOCTYPE html>
 <html lang="en">
 <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.0/dist/vue.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue-tables-2@2.3.5/dist/vue-tables-2.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vuescroll@4.17.5/dist/vuescroll.min.js"></script>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="wrap-table wrap-table--main" id="baseTable">
        <vue-scroll class="scroll-table" :initialScrollY="true" :ops="ops">
            <v-client-table
                :columns="columns"
                :data="dataEl"
                :options="options"
                :show-sort-icons="true"
                class="table-main"
                :filter="false"
            >
                <div
                    v-for="(column, index) in columns"
                    :key="'column'+index"
                    :slot="`h__${column}`"
                    class="bin"
                >
                    <span v-if="index !== 0" v-html="options.headings[column]"></span>
                    <span v-if="index !== 0" class="table__wrap-sort">
                        <svg version="1.1" id="Слой_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 15.7 16" enable-background="new 0 0 15.7 16" xml:space="preserve">
                            <path class="arrow-down" fill="#808e9b" d="M14.2,8.6H1.5c-0.7,0-1.2,0.4-1.4,1s0,1.3,0.6,1.7L7,15.7C7.2,15.9,7.5,16,7.8,16s0.6-0.1,0.9-0.3l6.3-4.5 c0.5-0.4,0.8-1,0.6-1.7C15.4,9,14.8,8.6,14.2,8.6z"/>
                            <path class="arrow-up" fill="#808e9b" d="M1.5,7.4h12.7c0.7,0,1.2-0.4,1.4-1c0.2-0.6,0-1.3-0.6-1.7L8.7,0.3C8.2-0.1,7.5-0.1,7,0.3L0.6,4.8 c-0.5,0.4-0.8,1-0.6,1.7S0.8,7.4,1.5,7.4z"/>
                        </svg>
                    </span>
                </div>
                <template slot="h__choice">
                <!--
                    <button class="table__edit-img" @click="updateTable">
                        <img :src="imgUpdate" alt="" width="22" height="22">
                    </button>
                -->
                </template>
                <div class="table__status glyphicon glyphicon-star" slot="status" slot-scope="props">
                    <button class="table__status-item" v-for="(item, index) in props.row.status.slice(0, 7)" :key="'status-table-'+index">
                        <img v-if="item.statusImg" :src="item.statusImg" :alt="item.statusText" width="" height="" />
                        <div v-if="item.color" class="table__status-color" :data-color="item.color">
                            <!-- выпадающий список из цветов, наверное, пока застилить кружком -->
                            <!-- <div>color</div> -->
                        </div>
                    </button>
                </div>
                <div slot="dateTime" slot-scope="props" v-html="props.row.date"></div>
            </v-client-table>
        </vue-scroll>

    </div>

<script>
Vue.use(VueTables.ClientTable);
Vue.use(vuescroll);

function getData() {
    return Array.from(new Array(7)).fill(
        {
            modal: 'что то',
            checkedId: 'check1',
            date: '85.12.3021',
            fio: 'что то',
            floor: 'что то',
            dateBeathdey: 'что то',
            area: 'что то',
            research: 'что то',
            idPacient: 'что то',
            quality: 'что то',
            AETitle: 'что то',
            direction: 'что то',
            registrationNumber: 'что то',
            priority: 'что то',
            institution: 'что то',
            appointed: 'что то',
            nameProtokol: 'что то',
            status: ['статус','статус','статус','статус','статус','статус','статус','статус','статус','статус','статус']
        })

}
const BaseTable = new Vue({
    el: "#baseTable",
    data() {
        return {
            dataEl: getData(),
            ops: {
                scrollPanel: {
                    initialScrollX: 1,
                    initialScrollY: 1,
                },
            },
            columns: [
                'choice',
                'status',
                'modal',
                'dateTime',
                'fio',
                'floor',
                'dateBeathdey',
                'area',
                'research',
                'idPacient',
                'quality',
                'AETitle',
                'direction',
                'registrationNumber',
                'priority',
                'institution',
                'appointed',
                'nameProtokol',
            ],
            filterable:  [
                'choice',
                'status',
                'modal',
                'dateTime',
                'fio',
                'floor',
                'dateBeathdey',
                'area',
                'research',
                'idPacient',
                'quality',
                'AETitle',
                'direction',
                'registrationNumber',
                'priority',
                'institution',
                'appointed',
                'nameProtokol',
            ],
            options: {
                headings: {
                    status: 'что то',
                    modal: 'что то',
                    dateTime: 'что то',
                    fio: 'что то',
                    floor: 'что то',
                    dateBeathdey: 'что то',
                    area: 'что то',
                    research: 'что то',
                    idPacient: 'что то',
                    quality: 'что то',
                    AETitle: 'что то',
                    direction: 'что то',
                    registrationNumber: 'что то',
                    priority: 'что то',
                    institution: 'что то',
                    appointed: 'что то',
                    nameProtokol: 'что то',
                },
                sortable: [
                    'status',
                    'modal',
                    'dateTime',
                    'fio',
                    'floor',
                    'dateBeathdey',
                    'area',
                    'research',
                    'idPacient',
                    'quality',
                    'AETitle',
                    'direction',
                    'registrationNumber',
                    'priority',
                    'institution',
                    'appointed',
                    'nameProtokol',
                ]
            },
        }
    }
});
</script>

 </body>
 </html>


text:
Q: @mysqli_select_db -- access denied I want to use @mysqli_select_db() to switch between two databases.
Both databases have the exact same user, but when I run this function, I get an access denied error.
What is happening?
Update: Problem solved. I wrote my database name incorrectly in @mysqli_select_db(). Thanks for the help anyways.

A: access denied indicates that user you are using to connect to the database server simply is not allowed to the database you want to switch to. use GRANT to extends user's privileges.

A: Please look at this list from MySQL. There can be multiple reasons for this particular error message.

A: Problem solved. I wrote my database name incorrectly in @mysqli_select_db().


text:
Q: wxMediaCtrl->Create returns false after windows 10 update I'm using wxWidgets 3.1.0, VS2013, Win10-Home
The following code used to work (bOK was true and I could further load&play a movie):
m_mediactrl = new wxMediaCtrl();
bool bOK = m_mediactrl->Create(this, wxID_MEDIACTRL, wxEmptyString, wxPoint(0, 0), size, 0, wxMEDIABACKEND_WMP10);

However, after Windows updated, the Create function returns false.
It happens the same with the Mediaplayer sample.
I tried the directshow backend, but same result.
Anyone has a suggestion?


text:
Q: Database not browsable during COPY on PostgreSQL When using COPY to restore a CSV file, phppgadmin shows that the real database size(4GB) but when I choose to browse the table it shows Estimated row count to 0. I did a VACUUM ANALYZE. simple SELECT queries returns 0 rows, but the database size is 4GB. Also:
SELECT count(*) FROM tbl_data

return 0. Can anyone help?

A: Because the estimated row count is just that -- an estimate.  IIRC, the stats aren't updated until after the copy, and perhaps not after that (you might have to do a VACUUM ANALYZE first).

A: I asked this question on PostgreSQL. They told:

COPY runs inside a transaction, so it is not visible to outside.


text:
Q: How can i make a flexible update function with prepared statement with Mysqli? The prepared statements and pdo are new for me.
I have now the Insert en select with prepared statements in one class
 public function query($string, $parameters = null)
{
    try {
        $statement = $this->pdo->prepare($string);
        $statement->execute($parameters);
        $this->rowCount = $statement->rowCount();
        return $statement->fetchAll(PDO::FETCH_OBJ);
    } catch (PDOException $e) {
        // Show nice message
        return $e->getMessage();
    }
}
public function selectAll($table)
{
    return $this->query("SELECT * FROM `${table}`");
}
public function select($table, ...$fields)
{
    $sql = sprintf(
        "SELECT %s FROM `%s`",
        implode(', ', $fields),
        $table
    );
    return $this->query($sql);
}
public function insert($table, $parameters)
{
    $sql = sprintf(
        "INSERT INTO %s (%s) VALUES (%s)",
        $table,
        implode(', ', array_keys($parameters)),
        ':' . implode(', :', array_keys($parameters))
    );
    return $this->query($sql, $parameters);
}

I saw on the internet much examples but with no flexible amount of columns and their values
I need that its flexible because i have some controllers with update things that have all diffrent amount of colmns in the database.
Can someone tell me how to make a Function for my database class with a update query with flexible prepared statements?


text:
Q: Problem with microphone in Unity Android app I've posted this question on the Unity forum but still didn't get any response so I decided to post it here.
After some changes/updates in our project we have now not working microphone on Android version of the application. On iOS and PC it works without any problem.
Unity: 2020.1
Phone: OnePlus 5, Android 9
In a logcat I see 2 suspicious messages:
Debug Unity Failed to install Player data archive: /storage/emulated/0/Android/obb/com.<...>/main.200035.com.<...> .obb/assets/bin/Data/data.unity3d!

and error below it says:
Error Unity [NetworkLobby.Recorder] Local input source setup and voice stream creation failed. No recording or transmission will be happening. See previous error log messages for more details.
Error Unity #0 0x7c1072776c (libunity.so) GetStacktrace(int) 0x3c
Error Unity #1 0x7c104ec8b4 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x1f0
Error Unity #2 0x7c100ef0d0 (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x90
Error Unity #3 0x7c100eeffc (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0x128
Error Unity #4 0x7c0cdf2bd0 (libil2cpp.so) ? 0x0

I was trying to google this issue but didn't find anything similar.
What can be the reason? Have anybody seen such an error before?
Thanks in advance.


text:
Q: regex storing matches in wrong capture group I am trying to build a python regex with optional capture group. My regex works for most case but fails to put the matches in the right group in one of the test case.
I want to match and capture the following cases:

*

*namespace::tool_name::1.0.1

*namespace::tool_name

*tool_name::1.0.1

*tool_name
Here is the regex I have so far:
(?:(?P<namespace>^[^:]+)::)?(?P<name>[^:]*)(?:::(?P<version>[0-9\.]+))?

This regex works fine for all my 4 test cases but the problem I have is in case 3, the tool_name is capture in the namespace group and the 1.0.1 is captured in the name group. I would like them to be captured in the right groups, name and version respectively
Thanks

A: You may make tool_name regex part obligatory by replacing * with + (it looks like it always is present) and restrict this pattern from matching three dot-separated digit chunks with a negative lookahead:
^(?:(?P<namespace>[^:]+)::)?(?!\d+(?:\.\d+){2})(?P<name>[^:]+)(?:::(?P<version>\d+(?:\.\d+){2}))?

See the regex demo
Details

*

*^ - start of string

*(?:(?P<namespace>[^:]+)::)? - an optional non-capturing group matching any 1+ chars other than : into Group "namespace" and then just matches ::

*(?!\d+(?:\.\d+){2}) - a negative lookahead that does not allow digits.digits.digits pattern to appear right after the current position

*(?P<name>[^:]+) - Group "name": any 1 or more chars other than :

*(?:::(?P<version>\d+(?:\.\d+){2}))? - an optional  non-capturing group matching :: and then Group "version" captures 1+ digits and 2 repetitions of . and 1+ digits.


text:
Q: convert gdb to csv in batches I have 88 gdb files on Arcmap that I need to export to csv format. Is it possible to do this in batches? maybe, without using the python window

A: There is a solution to this referenced using a python script to run this bulk conversion:
Conversion Solution Using Python
For the most part this looks outlined fairly well, and for any bulk processes (which it seems like you are doing a lot of bulk processes with bouncing between GIS and other software) python is very useful. I would look into this any try to give it a go. Also if you want to learn more about python and how it can help you, check out the following sites:
Codecademy
Python For Beginners
ArcPy Cafe
There are countless other resources out there, and the more you familiarize yourself to multiple options, the better your chances are to finding a best fit solution.
I hope that those references help you.


text:
Q: dictionary comprehension with items divided to lists based on attribute as key. we have following code:
class A:
    def __init__(self,x):
        self.x = x

a = A(1)
b = A(2)
c = A(2)
d = A(2)
e = A(1)
list = [a,b,c,d,e]

How to get following output?
{1:[a,e],
2:[b,c,d]
}

i was thinking of something like:
{item.x: [].append(item) for item in list}

Thanks
Jano

A: The defaultdict from collections is a good solution for this problem.
from collections import defaultdict

class A:
    def __init__(self,x):
        self.x = x

a = A(1)
b = A(2)
c = A(2)
d = A(2)
e = A(1)
mylist = [a,b,c,d,e]

out = defaultdict(list)

for e in mylist:
    out[e.x].append(e)


text:
Q: Build Date object with a date and a time I receive two Strings, one with a date (say, "15-05-13") and with a time (say, "10:00").
What I need to achieve is make a Date object with both Strings, so I can check if the now Date is < 15 minutes than the Date formed with both Strings. How can I put together both Strings in the same Date object? Simply concatenating both Strings? I haven't tried, but I bet its not so simple...
Thank you.

A: After parsing each date / time, get just the milliseconds since epoch and compare
try {
    SimpleDateFormat date = new SimpleDateFormat("DD-MM-YY");
    SimpleDateFormat time = new SimpleDateFormat("HH:mm");
    long dateTime = date.parse("15-05-13").getTime() + time.parse("10:00").getTime();
    long mins = 15 * DateUtils.MINUTE_IN_MILLIS;
    if(Math.abs(System.currentTimeMillis() - dateTime) < mins) {
        //yup
    }
}
catch (ParseException e) {
    e.printStackTrace();
}

The Math.abs is to see if the target date is within 15 mins of now (past and future) rather than only 15 mins in the past, or switch to dateTime - System.currentTimeMillis() for 15 mins in the future

A: Calendar c = Calendar.getInstance();
c.set(Calendar.YEAR, 2013);
c.set(Calendar.MONTH, 5);
c.set(Calendar.DAY_OF_MONTH, 23);
Date date = c.getTime();

and go on with the hours. The default calendar you get is initialized with now

A: Here, c1 contains both dates.
Date date1 = ; // parse date "15-05-13"
Date date2 = ; // parse date "10:00"

Calendar c1 = Calendar.getInstance().setTime(date1);
Calendar c2 = Calendar.getInstance().setTime(date2);

c1.set(Calendar.HOUR, c2.get(Calendar.HOUR));
c1.set(Calendar.MINUTE, c2.get(Calendar.MINUTE));


text:
Q: How to sort dictionary by value? My dictionary like this:
var items = [Int: [String]]()
var itemsResult = [Int: [String]]()

itmesResult stores the data downloaded from server.
and pass the data to items use of items = itmesResult
the value has 3 elements like ["Apple","/image/apple.png","29"]
and I want to sort the dictionary by first value which is Apple.
for (k,v) in (itemsResult.sorted(by: { $0.value[0] < $1.value[0] })) {
  items[k] = v
}

The result of above code is not my expectation.
I would like to sort it alphabetically how can I do this?
Edit:
origin:
1:["Apple","/image/apple.png","29"]
2:["AAA","/image/aaa.png","29"]
3:["Banana","/image/banana.png","29"]

sorted:
2:["AAA","/image/aaa.png","29"]
1:["Apple","/image/apple.png","29"]
3:["Banana","/image/banana.png","29"]

I would like to sort it by first value.

A: So if I take your example, this does the trick:
var items = [Int: [String]]()

items[0] = ["Apple","/image/apple.png","29"]
items[1] = ["AAA","/image/aaa.png","29"]
items[2] = ["Banana","/image/banana.png","29"]

let itemResult = items.sorted { (first: (key: Int, value: [String]), second: (key: Int, value: [String])) -> Bool in
    return first.value.first! < second.value.first!
}

print (itemResult)

The right thing to do is to use objects of course, and note that I'm not null checking the "first" object in each array, but this is not a problem to change.
Let me know if this is what you were looking for, the output is:
[(1, ["AAA", "/image/aaa.png", "29"]), (0, ["Apple", "/image/apple.png", "29"]), (2, ["Banana", "/image/banana.png", "29"])]

EDIT:
Also note, that this case doesn't actually "sort" the dictionary, because a dictionary is by definition not sorted, this creates an array of key-value objects sorted using the array indexes

A: Instead of saving these variable into an array of arrays, make them an array of dictionaries.
You can do this like so:
var dictionaries:[Dictionary<String, String>] = []
for item in items {
  let dictionary = {"name": item[0], "url": item[1], "id" : item[2]}
  dictionaries.append(dictionary)
}

You can get your sorted list of dictionaries like this:
dictionaries.sorted(by: { $0["name"] < $1["name"] })


text:
Q: Explain javascript code with regular expressions I navigated to a file while browsing the source code of a project. It is a javascript file and it contains the following:
var Tools = {};
...
Tools.EMAIL_ADDR_PATTERN = /\w+@[a-zA-Z0-9_-]+?(?:\.[a-zA-Z]{2,6})+/gim;

What type is the EMAIL_ADDR_PATTERN? Why is capitalised? How can be invoked?
This might be quite simple, however my js knowledge is very limited.

A: This is literally what it looks like. A regular expression literal is assigned to the variable Tools.EMAIL_ADDR_PATTERN. There's nothing special about capitalisation, it's likely a convention in the code to emulate constants.

A:

What type is the EMAIL_ADDR_PATTERN? Why is capitalised?

EMAIL_ADDR_PATTERN is the name of the property that the programmer has chosen. It can be anything.

How can be invoked?

Use the pattern in any method that accepts Regular Expression pattern such as:string.match(Tools.EMAIL_ADDR_PATTERN)

A: Short answer: it's regular expression literal.
You can open a console in your favorite browser (press F12) and try for yourself:
> var r = /\w+@[a-zA-Z0-9_-]+?(?:\.[a-zA-Z]{2,6})+/gim
> typeof(r)
"object"
> r.constructor
function RegExp() { [native code] }
> r.test("hello world")
false
> r.test("me@myself.com")
true

A REPL console is always a good friend. The Chrome one will even auto-complete method names so you can discover them more easily.

A: This is how you would use it:
var email = "name@somedomain.com";

if (email.match(Tools.EMAIL_ADDR_PATTERN)) {
  alert("this is an email");
}

A: Tools.EMAIL_ADDR_PATTERN just to validate the email string.
you can use like:
var flag = /\w+@[a-zA-Z0-9_-]+?(?:\.[a-zA-Z]{2,6})+/gim.test('hello@world.com')

flag will be  (boolean)true


text:
Q: How to model a scheduling problem with interruptible tasks using docplex.cp (Constraint programming)? I would like to model a scheduling problem using constraint programming (Python API of CPLEX : docplex.cp) where I have machines to allocate to activities. Activities are performed during work shifts and some tasks can be divised in at most 3 parts but can also not be seperated into several parts. I use interval variables to model activities and optional interval variables (with "Alternative" constraints) to model equipement allocations. The different parts of a given tasks may be performed using different equipments or the same.
A naive approach might be to force the division of long activities but I would like to make sure that the model choose the division only when it is necessary.
Thanks in advance for your ideas and for the help!

A: The best way is to create a chain of intervals and use logical primitives to use the lower indexed ones when less than the full number of segments is needed.  Here is a code:
from docplex.cp.model import CpoModel

cp = CpoModel()

n = 3
total_duration = 100

itvs = [ cp.interval_var(optional=True, name="I_{}".format(i)) for i in range(n) ]

for i in range(1, n):
    cp.add(cp.end_before_start(itvs[i-1], itvs[i]))
    #cp.add(cp.presence_of(itvs[i-1]) >= cp.presence_of(itvs[i]))
    cp.add(cp.if_then(cp.presence_of(itvs[i]), cp.presence_of(itvs[i-1])))

cp.add(cp.sum(cp.length_of(itvs[i]) for i in range(n)) == total_duration)

cp.export_as_cpo("chain.cpo")

You will then have the following in the chain.cpo file:
#line 11 "chain.py"
I_1 = intervalVar(optional);
I_0 = intervalVar(optional);
I_2 = intervalVar(optional);

//--- Expressions ---
#line 11 "chain.py"
endBeforeStart(I_0, I_1);
#line 13
presenceOf(I_1) => presenceOf(I_0);
#line 11
endBeforeStart(I_1, I_2);
#line 13
presenceOf(I_2) => presenceOf(I_1);
#line 15
sum([lengthOf(I_0), lengthOf(I_1), lengthOf(I_2)]) == 100;


text: Q: WebApi No type was found that matches the controller named "BlaBla" issue There are 2 servers (Win 2003 Server, IIS6) in farm. Both have same code. On one WebApi requests works good, on other - error "No type was found that matches the controller named ... ". What exact configurations\installed components need to be checked\compared to fix?


text:
Q: ViewPager fragment is sliding underneath the System bar I have a companion configuration app for my watchface, which just presents the various settings as fragments (one for each setting so you can swipe through them quickly)
I would like the fragment views to be scrollable while maintaining the action bar, but what's happening instead is that if you swipe up on the action bar it disappears under the system bar and is very hard to move back.
Sorry if that's unclear, but here are a couple of screen shots.

Here are my various layout and code components; let me know if there's more I need:
AndroidManifest/xml
 <?xml version="1.0" encoding="utf-8"?>

<uses-feature android:name="android.hardware.type.watch" android:required="false"/>

<!-- Required to act as a custom watch face. -->
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<!-- So we can keep the screen on and start vibrations -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE"/>

<application
    android:allowBackup="true"
    android:icon="@mipmap/ref_watch_icon"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".RefWatch"
        android:launchMode="singleTop"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

        <intent-filter>
            <action android:name=
                        "com.pipperpublishing.RefWatch.wearable.watchface.CONFIG_DIGITAL" />
            <category android:name=
                          "com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

</application>

My activity's layout XML:
 <?xml version="1.0" encoding="utf-8"?>

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingTop="@dimen/appbar_padding_top"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:layout_scrollFlags="scroll|enterAlways"
        app:popupTheme="@style/AppTheme.PopupOverlay">

    </android.support.v7.widget.Toolbar>

</android.support.design.widget.AppBarLayout>

<android.support.v4.view.ViewPager
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">
</android.support.v4.view.ViewPager>

 <android.support.design.widget.FloatingActionButton
    android:id="@+id/fab_previous"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="start|bottom"
    android:layout_margin="@dimen/fab_margin"
    android:src="@android:drawable/ic_media_rew" />
<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab_next"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="end|bottom"
    android:layout_margin="@dimen/fab_margin"
    android:src="@android:drawable/ic_media_ff" />

and most of my OnCreate:
     @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_ref_watch);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
...
    /*-------------------------------------------------------------*/
    /* Set up Settings Pager, Adapter, and floating action buttons */
    /*-------------------------------------------------------------*/
...
    // Create the adapter that will return a fragment for each of the     menu setting sections
    mSettingsPagerAdapter = new  SettingsPagerAdapter(getSupportFragmentManager());
...
    mSettingsViewPager = (ViewPager) findViewById(R.id.container);
...
    // Set up the ViewPager with the Settings adapter.
    mSettingsViewPager.setAdapter(mSettingsPagerAdapter);
...

A: This answered my question: https://guides.codepath.com/android/Using-the-App-ToolBar#using-toolbar-as-actionbar as well as some other stackoverflow questions. I added this code:
         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
    params.setScrollFlags(0);  // clear all scroll flags

and voila, Action Bar no longer scrolls under the system bar.