Random snippets of all sorts of code, mixed with a selection of help and advice.
Obtaining one type of forecasts from another one with the fable package
23 April 2026 @ 8:09 pm
I I have a data set (from https://fable.tidyverts.org/index.html) and I run the difference of the log of the dependent variable (Close) on the difference of log of a covariate(High) in order to forecast
fit<- google_2015 |>
filter(Date < "2015-12-23") |>
model(ARIMA(log(Close) ~ log(High) + pdq(0, 1, 0)))
forecast <- fit |>
forecast(new_data = google_2015 |> filter(Date >= "2015-12-23"))|>
mutate(.median=mean(Close))
forecast %>% as.data.frame() %>% select(.mean, .median)
.mean .median
1 747.3169 761.455
2 744.1898 761.455
3 755.4646 761.455
4 771.9889 761.455
5 769.6716 761.455
6 761.7894 761.455
My question is what R code we can use in order to obtain the .mean column from the .median. column?
Visual Studio 2026 update broke autobuild of my project during debug
23 April 2026 @ 8:05 pm
After the latest update to Visual Studio 2026, my .NET 9 Maui project has stopped automatically building whenever I click the "Run" option while in debug mode. It also applies to when I clean the Bin and Obj folders, which do not get rebuilt, until I manually click build.
I have no idea where to even look to find why it no longer auto-rebuilds whenever I run the project after some code changes.
I've looked in Options > Project & Solution, and the only things I've found, I didn't need to change as they were already on.
I've also tried to do CLI workload fixes as suggested as possible solutions, but neither dotnet workload repair or dotnet workload install maui had any effect
I have no idea what happened, what
I have no idea where to even look to find why it no longer auto-rebuilds whenever I run the project after some code changes.
I've looked in Options > Project & Solution, and the only things I've found, I didn't need to change as they were already on.
I've also tried to do CLI workload fixes as suggested as possible solutions, but neither dotnet workload repair or dotnet workload install maui had any effect
I have no idea what happened, what The workflow in subscription and resource group 'selfhostingresourcegroup' is currently locked
23 April 2026 @ 8:02 pm
I am trying to enable or save an automated Power Automate flow which contains connections to SharePoint & outlook, but i am getting this error:-
The workflow '70ad9987-ce8b-4706-902e-ae4befa68eb7' in subscription '4f36630d-ee46-e9cd-85bc-5b25fec5240f' and resource group 'selfhostingresourcegroup' is currently locked. Please try again shortly.
Delete a section of a file Bash Script
23 April 2026 @ 7:51 pm
Last paragraph is my actual question, the rest of this post is just context. At my internship I have been asked to learn how to script (I’m terrible at it, assume I’m a beginner)
I’m trying to remove 3 lines of code in a file so I thought at first to use sed and rm lines 1-3 like this:
sed ‘1d;2d;3d’ file
but then my lead system admin said I may run into issues because in another scenario there might be more code so that wouldn’t work. So then I thought maybe to match the lines like this:
sed ‘/specific thingy/d’ file-path
sed ‘/next thingy/d’ file-path
sed ‘/last line/d’ file-path
But then he said “what if the lines are different” and it dosent exactly match so then he gave me a hint to use grep. In the actual code the first and third line are comments so how would you grep the first comment, last comment, and then anything inbetween those comments delete?
Deeplinking to one of another Tab's screens and then be able to navigate back to the current one
23 April 2026 @ 7:36 pm
When using a NavigationStack with a TabView, like this:
TabView(selection: $selectedTab) {
Tab("MainTab", systemImage: "tray.and.arrow.down.fill", value: 0) {
MainTabView(onDeepLink: { deepLink in
if let moreDeepLink = deepLink as? MoreDeepLink {
selectedTab = 1
moreDeepLinkHandler.handle(deepLink: moreDeepLink)
}
})
}
Tab("More", systemImage: "magnifyingglass", value: 1) {
MoreTabView(deepLinkHandler: moreDeepLinkHandler)
}
}
struct MoreTabView: View {
@ObservedObject var deepLinkHandler: MoreDeepLinkHandler
@State var paths: [MoreDestinations] = []
var body: some View {
NavigationStack(path: $paths) {
VStack {
}.navigati
Problem: Gupshup error 403 despite having the tokens [closed]
23 April 2026 @ 6:49 pm
I’m programming and using Gupshup’s partner APIs. I’m using the corresponding tokens, but I’m getting an “authentication failed: 403 forbidden” error. I don’t understand why this is happening if I’m complying with everything.
Playwright Automation Script
23 April 2026 @ 6:20 pm
Hey Hope you are doing well,
I need swagger api automation done via playwright python automation script on chrome browser
Also need python framework for Ansible tower automation
Add your suggestions here with solution
Thanks in advance
Can't get the right Charset on a Java app
23 April 2026 @ 4:13 pm
I am building a simple java app that uses a few rest webservices (that get parameters from the url) to insert into a database data that is relevant to the progress of some students in a course. This app is to be used by some employees to insert said data as students progress but it has come to my attention that the data (such as the course name) gets altered into funky chars as i have seen happing before, nothing new so far, where it gets interesting is...
If i use UTF-8 encoding (on the webservice) without changes on the frontend (i only use base64 on the frontend to make the strings URL safe) computers where the Windows is in English work well but i get black diamond squares with interrogation points inside if the Windows where the app is being used is in Portuguese. So i tried using ISO-8859-1 instead of UTF-8... now it's the opposite, portuguese Windows work well and English ones don't but i thought UTF-8 was like some sort of super Chartset that it supported everything.
Explanation for RuntimeWarning
23 April 2026 @ 1:35 pm
Importing ruamel.yaml before pyqt causes warning, even if it's not used.
I have this simple script, that illustrate my problem.
import sys
from ruamel.yaml import YAML as rYAML # important - do not delete
from PySide6.QtWidgets import QApplication, QLabel
# 1. Create the application instance
app = QApplication(sys.argv)
# 2. Create a widget (a label in this case)
label = QLabel("Hello World!")
label.resize(400, 200)
# 3. Show the widget
label.show()
# 4. Start the event loop
sys.exit(app.exec())
I want to modify the Pyside6 import to qtpy:
from qtpy.QtWidgets import QApplication, QLabel
When I do that, I get many runtime warnings, such as
shibokensupport/signature/parser.py:265: RuntimeWarning: pyside_type_init:_resolve_value
UNRECOGNIZED: 'PySide6.QtWidgets.QFileDialog.ViewMode'
OFFENDING LINE: 'PySide6.QtWidgets.QFileDialog.viewMode(s
99 Bottle of Beer - Javascript ()
23 April 2026 @ 12:38 pm
I'm new to JavaScript and created the "99 Bottles of Beer"-lyrics in code.
How to make this more professional?
for (var numberOfBottles = 99; numberOfBottles >= 0; numberOfBottles-- ){
var bottleWord = " bottles";
if (numberOfBottles===1) {
var bottleWord = " bottle"
}
console.log( numberOfBottles + bottleWord + " of beer on the wall, " + numberOfBottles + bottleWord + " of beer.");
numberOfBottles--;
if (numberOfBottles<=0) {
var bottleWord = "No more bottles"
var numberOfBottles = ""
}
console.log("Take one down and pass it around, " + (numberOfBottles) + bottleWord + " of beer on the wall. ");
}
console.log("No more bottles of beer on the wall, n