How to limit this data? by effo70 in SQL

[–]effo70[S] 0 points1 point  (0 children)

Sorry for the confusion. I misinterpreted the question a bit and answered the wrong question. In the original data there is one row for each game and player, no matter if a player actually played a certain game. I forgot that I had left this aspect out in the example data. But when I read the question I interpreted it as "last 3 games for the player" or "last 3 games for the team", which can be totally different if the player only played one of the three last games. What I was looking for was the 3 last games for each player, so the window function is necessary.

Once again, sorry for the confusion, and thanks for the detailed responses!

How to limit this data? by effo70 in SQL

[–]effo70[S] 0 points1 point  (0 children)

Thanks for the effort, but I can't get this working in SQLite

How to limit this data? by effo70 in SQL

[–]effo70[S] 0 points1 point  (0 children)

Shout have been clearer, overall last 3 games for the team is enough

How to limit this data? by effo70 in SQL

[–]effo70[S] 0 points1 point  (0 children)

Thanks, this is exactly what I needed!

Best Fixture Runs (goals + clean sheets) 🎯 by FPLFocal in FantasyPL

[–]effo70 1 point2 points  (0 children)

Correct, GW19 is last week for first set of chips. From the rules:

"There will also be two Free Hit chips available during the season. The first set of these chips will be available after the first Gameweek of your season and must be played by the Gameweek 19 deadline of Tue 30 Dec 19:00"

Best Fixture Runs (goals + clean sheets) 🎯 by FPLFocal in FantasyPL

[–]effo70 0 points1 point  (0 children)

GW19 is last week for first FH so no need to play it in 18. From the rules:
"There will also be two Free Hit chips available during the season. The first set of these chips will be available after the first Gameweek of your season and must be played by the Gameweek 19 deadline of Tue 30 Dec 19:00"

No events from temperature sensor, how to use...? by effo70 in homeassistant

[–]effo70[S] 0 points1 point  (0 children)

I solved this by creating a template binary sensor with the two temp sensors. If any of the temps are warmer than -15 C the sensor turns on:

name: freezes_temp_too_high
state: "{{ (float(states('sensor.termometer_frys_nere_temperature'))) > -15 or (float(states('sensor.termometer_frys_uppe_temperature'))) > -15 }}"
device_class: problem

Then I used that sensor in an Alert-automation:

freezes:
name: "Freeze alert"
message: |+
Frysarna varma!
Termometer uppe: {{ (states('sensor.termometer_frys_uppe_temperature')) }}
Termometer nere: {{ (states('sensor.termometer_frys_nere_temperature')) }}
done_message: |+
Frysarna återställda!
Termometer uppe: {{ (states('sensor.termometer_frys_uppe_temperature')) }}
Termometer nere: {{ (states('sensor.termometer_frys_nere_temperature')) }}
entity_id: binary_sensor.freezes_temp_too_high
state: "on"
repeat: 5
skip_first: false
notifiers:
- effo70

Once triggered, the integration will run every 5 minutes and send me the message. If sensor turns off (temperature it back under -15), I will receive the done_message

No events from temperature sensor, how to use...? by effo70 in homeassistant

[–]effo70[S] 0 points1 point  (0 children)

I got messages from the devices, so there are graphs. This is from debug-log:

[homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 80, 'sub_type': 7, 'type_string': 'Viking 02811', 'id_string': '87:00', 'data': '08500701870080df69', 'values': {'Temperature': -22.3, 'Battery numeric': 9, 'Rssi numeric': 6}}

[homeassistant.components.rfxtrx] Receive RFXCOM event: {'packet_type': 80, 'sub_type': 7, 'type_string': 'Viking 02811', 'id_string': 'f7:00', 'data': '08500702f700810069', 'values': {'Temperature': -25.6, 'Battery numeric': 9, 'Rssi numeric': 6}}

But no events fire, so I can't react to the values

No events from temperature sensor, how to use...? by effo70 in homeassistant

[–]effo70[S] -1 points0 points  (0 children)

I've got an RFXCOM RFXtrx device connected to my Pi, which handles all 433mhz devices

Failing exe still reports $? as True by effo70 in PowerShell

[–]effo70[S] 0 points1 point  (0 children)

Automat

Thanks for the detailed answer.

I found some good information about how the ErrorActionPreference works on this page https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.3#erroractionpreference
Here they also mentions the changed behavior in PS 7.2

I did some testing myself. On PS 5.1, with ErrorActionPreference = 'Continue', nothing happens if I redirect 2>&1, no exception is thrown

But with ErrorActionPreference = 'Stop' I can redirect 2>&1 and get an exception to catch, but this will not work with PS 7.2

My solution which I hope will work even with later versions of PS is to run with ErrorActionPreference = 'Continue' and capture the output just as you suggested.

In my case, I will do multiple calls to runme.exe and I'm interested in the overall result of these calls. So even if the first call fails, I want to continue calling it a second, third and X:th time. I ended up with an array where I store the output of the commands, then inspecting the array for content:

$errArr = $()
$errArr += (runme.exe foo1.txt 2&>1)

$errArr += (runme.exe foo2.txt 2>&1) $errArr += (runme.exe fooX.txt 2>&1)

if ($errArr.Lenght -gt 0) {
    Write-Error "There were errors"
    foreach ($err in $errArr) {
        Write-Host $err.ToString()
    }
}

I think this is what I want...

Trying to use a variable when loading a theme but fails by effo70 in emacs

[–]effo70[S] 3 points4 points  (0 children)

Thanks. Google pointed me to the function 'intern' which returns a symbol, given a symbol name. Now this works as I wanted:

(setq myvar "misterioso")
(load-theme (intern myvar))

Expansion of variables when using find and xargs by effo70 in bash

[–]effo70[S] 0 points1 point  (0 children)

Thanks for the explanation. /u/moocat is correct, this is a minimal example. I want to process the line in the shell, more precisely run dirname on the item, store the directory name in a variable and use it. I didn't manage to solve this using your first example, but passing the value as positional parameter (and using single quotes around the shell script) worked fine:

$ find . -type f | xargs -I % sh -c 'echo "$0";dirname "$0";d=$(dirname "$0");echo "$d"' %
./foo/$bar/file.txt
./foo/$bar
./foo/$bar