Plotting – How do I combine multiple line charts and their regressions in one chart?

I had two lines with their line regressions,
how to combine these two lines (along with line regressions)
in a graphic?

a = DATA ((7; 375, 2; 3));

ListPlot (a)

a1 = LinearModelFit (a, x, x)

a2 = Show (ListPlot (a), Plot (a1 (x), {x, 0, 0.002}), Frame -> True)


b = DATA ((7; 375, 2; 4; 2));

ListPlot (b)

b1 = LinearModelFit (b, x, x)

b2 = Show (ListPlot (b), Plot (b1 (x), {x, 0, 0.002}), Frame -> True)


I can line & # 39; a & # 39; and & bgr; & bgr; combine only with the following code:

ListLinePlot ({a, b}, Mesh -> All)


How do you combine a, a2, b, b2 in a graph? (2 curved lines and 2
reactive line regressions)

postgresql – ERROR: The check condition "dates_check" is violated by one line

ALTER table myTable ADD CONSTRAINT dates_check CHECK(start_date::date < end_date::date);

Gives ..

ERROR: The check condition "dates_check" is violated by some


select start_date, end_date from myTable where start_date::date > end_date::date;


start_date | end_date
(0 rows)

Scripts – To enable / disable the lock screen from the command line

I want to be able to quickly and easily enable and disable the lock screen. For now, I need to go to Menu> Settings> Power Manager> Security and then check or uncheck the "Lock screen when the system goes to sleep" checkbox and then look in a terminal for the process ID of xfce4-power-managerThen send a HUP signal to this PID.

How can I automate the GUI part? When I run the Power Manager GUI, the process is displayed xfce4-power-manager-settings Running, so I would probably need the equivalent command line command to run.

I run LUbuntu 18.04.

Command line – standard input for an interactive bash script

I have a bash script that uses a set of user prompts (with echoing) and stores the input in a variable (with reading). The prompts and inputs look something like this:
folder names
"Value N?"

I need to iterate this script over a folder name1 … n with the same values ​​and I'll try doing this with ./script <inp (inp contains the values ​​listed above). The script will not run. I have tried other methods, such as:

Thank you very much

How do I reference a line with two foreign keys as a primary key?

What I would do here would be to have a table with match_winner! It will be a JOINtable (also more formal than ASSOCIATIVE ENTITY as well as many other names from the side).

I'm not sure why you called two tables matches and games – Are not they the same? If not, let me know and I will change the scheme.

Something you need IMHO. There is a connection table between teams and matches

CREATE TABLE match_winner
  match_id INTEGER NOT NULL,
  team_id  INTEGER NOT NULL,
  winning_score INTEGER NOT NULL CHECK (winning_score > 0),

  CONSTRAINT 'match_winner_pk' PRIMARY KEY (match_id, team_id),
  CONSTRAINT 'mw_match_fk'     FOREIGN KEY (match_id) REFERENCES matches (match_id),
  CONSTRAINT 'mw_team_fk'      FOREIGN KEY (team_id)  REFERENCES teams   (team_id) 

I've made a small change to your scheme id INTEGER SERIAL in the team table definition – here it goes to the violin. SERIALs are great! I also added a restriction CHECK (player1 != player2),

I then ran this SQL

SELECT t.player1, t.player2,, mw.match_id, mw.team_id, mw.winning_score
FROM teams t
JOIN matches m ON t.player1 = m.team_1 AND t.player2 = m.team_2
JOIN match_winner mw ON = mw.match_id;

You can check the result on the violin. If you have the connection table, avoid the use of NULL and offers additional flexibility. Just a few recommendations – use uppercase letters for SQL keywords and lowercase letters for your own variables – or vice versa – just pick a standard and stick to it. You should also name your restrictions as I did for that match_winner Table – it is much easier to find error messages in this way.

I hope this answers your question – if not, let me know! P.S. Welcome to the forum! 😉

Oops – I hardly noticed the question. I've undone my change to your team schema – see the violin here, but the SQL is exactly the same. Use two fields PRIMARY KEY You simply connect both fields instead of just a simple one id one – et voila! Of course you can have that id and with one UNIQUE Coercion, sometimes it's a bit easier – I just wanted to tell you the identities of the players. I've added another fiddle function here, showing how you can alias a table twice in the same query to do useful things – here, to match the names of Player1 and Player2 to your results.

Line breaks in hover or button breaks

A common problem is the following.

Enter image description here

  • In the first state, everything is in line.
  • In hover the vertical line is still present.
  • In hover, the distance between the keys is not the same on both sides, which is bad.
  • If a space is added to the left of the button, the horizontal line is broken.


If you leave it as it is, the button is aborted while floating. When you add space to the button, the rest of the layout is broken.

A correction might be to add space and a visible background to correct it, but maybe a visible background is not what we want.


Is there a good way to fix this common problem?

python – rearrange data frame columns in ascending order line by line?

Suppose I have the following data frame:

    a b c d e

0   4 2 1 3 5
1   2 3 4 5 1
2   3 2 5 4 1

and please reorder my data frame as follows:

    a b c d e

0   1 2 3 4 5
1   1 2 3 4 5
2   1 2 3 4 5

How would I do that? Would you need to use a for loop and clone the data frame to edit the line and replace it in the data frame copy? Or would it be easier?

Obg right now!

Command Line – Why are some messages included in a back tick and a single quote?

I have often observed that some messages in the terminal or part of them are contained in a back tick and a single quote. For example, the output of type -a ls to generate

ls is aliased to `ls --color=auto'

I expect backticks and quotes to work in pairs, but here's 1 back tick at the beginning and 1 single quote at the end.

Why is there no closing back tick or no starting quote? Is it a standard?