log – My system creates 1 GB Syslog file Docker error per minute

I use Ubuntu 18.04. Recently, when I start my PC, I get the error message that there are still 0 bytes in your / root directory. I used that du Command and found out that /var/log/syslog and /var/log/syslog.1 are huge with syslog about 832M and syslog.1 about 44G. I've deleted syslog.1, but my syslog file is growing at a rate of about 1 GB per minute.

Syslog details:

samxaverian@sam-pc:~$ tail /var/log/syslog
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040442741+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040490440+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040548312+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040601064+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040647849+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040700726+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040758378+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040806368+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040855320+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby
Nov 20 09:50:36 sam-pc docker.dockerd[1845]: time="2019-11-20T09:50:36.040909485+05:30" level=error msg="failed to get event" error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" module=libcontainerd namespace=moby

I've noticed that this docker and socket connection error occurs repeatedly.

mysql – Creates a trigger that runs at most once a day

I have a table big_table with a large number of daily inserts, and this table has a column interesting_val, For the first line and only for the first line inserted after 00:00 UTC on each date, I want to SELECT interesting_val and INSERT to another table daily_interesting_val, Can I achieve this behavior with a combination of procedures and triggers?

Whenever big_table has created at least one line after 00:00 UTC, but daily_interesting_val has no corresponding line with the new one interesting_valMy application is in an illegal state and I want to keep this window as small as possible.

A solution that I can imagine, but not if it's possible in MySQL:

Create a scheduled procedure that creates a trigger at 00:00 each day. This trigger calls a procedure that (1) checks for the presence of a line, (2) if it does not, inserts the line, (3) if present, deletes the trigger.

google sheets – Creates a list of cell addresses contained in a range

I am looking for a single array formula to convert a particular area, e.g. B2:D4In this case, a list of addresses (no values!) Contained in this area B2,B3,B4,C2,C3,C4,D2,D3,D4,

Try so far

Google has not delivered useful results.

I tried to count through the array and am able to extract two number lists that match the row and column numbers, but did not find a combined formula.

Aggregation:

=ArrayFormula(
   ROW(INDIRECT(SUBSTITUTE(ADDRESS(ROW(),ROW())&":"&ADDRESS(ROW()+
      COLUMNS(B2:D4)
   -1,ROW()),"$","")))-ROW()+
      CELL("col", B2:D4)
)

Row calculation:

=ArrayFormula(
   ROW(INDIRECT(SUBSTITUTE(ADDRESS(ROW(),ROW())&":"&ADDRESS(ROW()+
      ROWS(B2:D4)
   -1,ROW()),"$","")))-ROW()+
      CELL("row", B2:D4)
)

Note that in the formulas above, the ROWS () / COLUMNS () function is used to determine the range size, and the CELL () function to determine the range beginning.

c ++ function that creates pointers to classes

I'm trying to create a function that creates pointers to instances of a Player class.

That's because I want to create as many player instances as I want at the beginning of my game.

This is intended to make the game a 2-player, 4-player or 3-player game and theoretically an infinite number of players determined by the user's input.

The problem I face is that when I use my function, I create pointers as follows:

to edit: player is a custom class that I made.

void createPointer()
{
    player * player1 = new player("George");
}
  1. The pointer is only declared locally, which results in a memory leak, because I can not reference the pointer player1 because it is deleted when the createPointer () function completes.
  2. As shown above, I could not refer the players correctly because they all have the name player1. I think I should use templates in c ++ to change the name of the variable every time a player is created.
  3. As shown below, I could not delete the player instance at the end of the game:
void endGame()
{
    //delete the object the pointer
    //is pointing to in memory
    delete player1;
    //set the pointer to point to NULL
    //as default, so can check if pointer is pointing
    //to anything
    player1 = NULL;
}

So I just wondered if I could choose a different approach? I know a solution that is to globally declare the pointers first. i.e.

player * player1 = NULL;
player * player2 = NULL;
player * player3 = NULL;
void createPointer()
{
    player1 = new player("George");
}

However, this would mean that I can not create a variable number of players without first declaring them all, as shown in the above example.

Sorry, if I misunderstand something, I would be very happy about any advice.

java – Creates a constructor that copies values ​​from the parameter into an array called data

You can not figure out how to copy the values ​​from the parameter into the new array data. How would I proceed?

Class weight

{

int () data;

// Constructor

Weight (int () init)
{

// Make data the same length
// as the array referenced by init.

data = new   ; // this part has caused me the most headache (most of the errors)

// Copy values from the 
// input data to data.
for (int index=0; index < init.length; index++  )
{
  data(index) = init(index);
}

}

//To Print
public String to String ()
{
dates

}
}

You still get errors like "array dimension is missing"

python – Creates a matrix from a dictionary: script problem

I have a problem and I do not know how to create a matrix

I have a dictionary of this type:

dico = {
"banana": "sp_345",
"apple": "ap_456",
"pear": "pe_645",

}

and such a file:

sp_345_4567 pe_645_4567876  ap_456_45678    pe_645_4556789
sp_345_567  pe_645_45678
pe_645_45678    ap_456_345678
sp_345_56789    ap_456_345
pe_645_45678    ap_456_345678
sp_345_56789    ap_456_345
s45678  f45678  f456789 ap_456_52546135

What I want to do is create a matrix in which we find more than n times a value from the dictionary in the line.

So I want to proceed:

Step 1 Create a dictionary with the associated values ​​and the number of rows:

Just like that:

dictionnary = {'1': 'sp_345_4567','pe_645_4567876', 'ap_456_45678', 'pe_645_4556789'; '2': 'sp_345_567', 'pe_645_45678'; '3:' 'pe_645_45678','ap_456_345678'; '4:' etc ..

Then I would like to compare the values ​​with my first dico dictionary, for example, to see how many times the banana key appears on each line (and therefore does so for all the keys in my dictionary), except that the problem exists that the values ​​of my dico do not match those of my dictionary, because they follow this pattern & # 39; _ w + & # 39; & # 39;

The idea would be to create a final_dict that looks like this to create a matrix at the end:

final_dict = {'line1': 'Banana' : '1' ; 'Apple': '1'; 'Pear':2; 'line2': etc ...

Here is my code that does not work:

import pprint
import re
import csv

dico = {
    "banana": "sp_345",
    "apple": "ap_456",
    "pear": "pe_645",
}

dictionary = {}
final_dict = {}
cnt = 0
with open("test.txt") as file :
    reader = csv.reader(file, delimiter ='t')
    for li in reader:
        grp = li
        number = 1
        for li in reader:
            dictionary(number) = grp
            number += 1
            pprint.pprint(dictionary)
            number_fruit = {}
            for key1, val1 in dico.items():
                for key2, val2 in dictionary.items():
                     if val1 == val2+'_w+':
                         final_dict(key1) = val2

Thanks for your help

quaternion – Creates a random vector relative to the current vector in a certain degree in 3D space

I create a simple raytracer and think that would be the best place to ask for it. I created my own engine in Go and got quite a bit. I now implement diffuse surfaces, so I have to create a random direction to falsify scattered rays that are diffuse.

I looked at the other questions here and found that they were similar to my question, but for 2D space, not 3D.

Let's say I have a direction a, and I want to create a new direction that is random and within 45 degrees of direction a, Since I work in 3D space, I can not just find the vertical angle and the gap between them, so I have to do something else. I would do that in 2D, for example:

dir = Vector2(1, 1).Normal()

perpDir = dir.Perp() // gets the perpendicular direction of `dir`

randDir = dir.Lerp(perpDir, rand() - 0.5) // rand is (0, 1)

I'm not very knowledgeable when it comes to math, so it must be pretty crazy for me to understand. Is there an easy way to find a random direction based on a current direction with a maximum rotation of a specified maximum rotation of 90 degrees?

poo – Creates a class diagram

I am new to this POO and still do not understand its operation well. I'm trying to create a class diagram, but I do not know which classes to create. For example, if you want to create an agenda for football matches and need the team's name, representative, phone number, and registration, as well as the names of the players, you'll need to know how many players are entering the pitch, and what dates the matches will take place.
Enter image description here

I have created 3 team, player and match classes with an association relationship. But I have no idea if I am fine, if I place the attributes well, if I have to place a function …

I am very lost

Thank you very much

postgresql – Creates a stored procedure with a dynamic number of columns and column names

I am relatively new to postgresql and have some problems creating my first stored procedure. The real problem is that I have to have it somehow dynamic and therefore have trouble finding earlier threads that asked that question.

Suppose I have a table with the following information

Table nominal_dollars
year       GDP        Dividends
2000      100              20
2001      110              30
2002      120              40

In the above table, the numbers are not adjusted for inflation. A common technique I want to do is to create a new table that adjusts the numbers for inflation. This means I need to connect the above table to a new table, Consumer Price Inflation (CPI), which has the following form

Table cpi
year       cpi_adjustment
2000      1            
2001      2             
2002      3             

This allows you to create a new table that adjusts all numbers for inflation, d. H. The original numbers are multiplied by the cpi adjustment:

Table nominal_dollars_adj
year       GDP        Dividends
-----------------------------------------
2000      100              20
2001      220              60
2002      360              80

Where the GDP for the new table is equal to the GDP from the original table * cpi_adjustment and the same for dividends.

Now I want to do this CPI fitting procedure for many different tables, which may have different numbers of columns.

So I want to create a stored procedure that uses a table (or table name) as input, and in this function I want to create a new table with the same exact names and number of columns as the original table, but with all of the inflation-adjusted values as above.

Any ideas?

All the best,

Jake