Random snippets of all sorts of code, mixed with a selection of help and advice.
Microsoft Graph API Calendar Event is found but can't be deleted
29 October 2024 @ 5:14 pm
I built a calendar syncer which works kinda fine.
Sometimes it has issues and just can't delete an event.
Note: All the events have been created with the API and the same credentials
The odd thing is, that I query the event before I delete it.
Here is a simple code to reproduce the issue:
async def delete_all_future_events(calendar_id, dry_run=True):
# Scopes required for accessing and modifying calendar events
scopes = ['https://graph.microsoft.com/.default']
tenant_id = ''
client_id = ''
client_secret = ''
user_id = ''
# Initialize ClientSecretCredential
credential = ClientSecretCredential(
tenant_id=tenant_id,
client_id=client_id,
client_secret=client_secret
)
# Create GraphServiceClient
graph_client = GraphServiceClient(credential, scopes)
# Define date range for fetching events
start_date = datetime.now(pytz.utc)
end_date = start_date +
Troubleshooting Error When Installing Devtools Package
29 October 2024 @ 5:13 pm
I am trying to install the devtools package in R (using: install.packages('devtools')) and keep running into this error:
Error installing package 'ps':
==============================
* installing to library 'C:/Users/JBRONSTE/AppData/Local/Temp/RtmpAfH3zZ/renv-staging-13cc5048466c'
* installing *source* package 'ps' ...
** package 'ps' successfully unpacked and MD5 sums checked
** using staged installation
** libs
/mingw64/bin/gcc -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -Wall px.c -o px
make: /mingw64/bin/gcc: No such file or directory
make: *** [Makevars:11: px] Error 127
ERROR: compilation failed for package 'ps'
* removing 'C:/Users/JBRONSTE/AppData/Local/Temp/RtmpAfH3zZ/renv-staging-13cc5048466c/ps'
Error: install of package 'ps' failed
What is the best way to troubleshoot this?
I double checked that Rtools is installed for the right version, not sure what else to do as I am a fairly new user and IT people have been u
How to edit text of a Text Label on joining a game [Roblox Studio]
29 October 2024 @ 5:12 pm
I've been trying to help my friend making a randomized title screen splash (like in Minecraft or Terraria) but I've been having some problems with having the text actually change. I've tried a few different methods but none of them have worked so far, these are:
Having everything set up in 1 local script within the main text variable I'm editing with (It prints both the randomized splash number and complete but doesn't change the actual text on the label)
local text = game.StarterGui.MainMenu.splash
local splashText = text.Text
local splash = math.random(1,2)
local event = game.ReplicatedStorage.splash
print(splash)
if splash == 1 then
splashText = "a"
print("Complete")
elseif splash == 2 then
splashText = "b"
print("Complete")
end
Having two different scripts linked with a RemoteEvent, one in "StarterPlayerScripts" and the other in the main ele
Anyone know what I should do to use the SHAP together with a CLIP model?
29 October 2024 @ 5:11 pm
I want to understand why an image and text had a high cosine similarity metric, so I plan to use SHAP to understand the importance of each feature in the text and image. I didn't find any material that implemented SHAP for CLIP, does anyone know how to do this?
I haven't found any resources, I've been trying to adapt any code that deals with text.
Why is the Nats By Example pub-sub not working when using CLI but works using deno or other languages?
29 October 2024 @ 5:10 pm
I'm new to Nats and have been going through the Nats by Example repo. I have the nats.exe for Windows in the root of my repo (I'm on Windows 11) and I'm trying to run the pub-sub example using ./nbe run messaging/pub-sub/cli but it fails right after the docker network is created shown below. I'm currently using Docker Desktop.
nbe run fails with CLI
I can run general nats CLI commands but I also get failure when trying to run ./nats server ls saying that the connection is refused.
nats server connection refused
The example runs fine when I run it using deno. Why doesn't the CLI work for this?
deno runs successfully
It works when running deno but fails using the CLI commands. I'm using Docker Desktop. I have
Set default input language via powershell on multilanguage system, Windows 10
29 October 2024 @ 5:10 pm
Win10x64 LTCS.
I have 3 input languages in the system: English (default), Russian, Ukrainian
The problem is that Russian becomes default after hibernate, the bug. I can cure this by visit the languages list, set Russian as default and set English as default again.
I want to automate this operation using batch file and enter commands like this. I can execute batch on rehibernate:
powersell -command "Set-WinUserLanguageList -LanguageList ru-RU, en-US, ua-UA -Force"
powersell -command "Set-WinUserLanguageList -LanguageList en-US, ru-RU, ua-UA -Force"
But something wrong, need some help
Walletconnect (Reown) network configuration?
29 October 2024 @ 5:09 pm
Apologies for any stupid questions, I am fairly new to programming
I am following documentation from Reown to implement their appkit into my project
https://docs.reown.com/appkit/react/core/installation
I've installed all necessary libraries, but to add networks it imports network configs from here:
import { arbitrum, mainnet } from '@reown/appkit/networks';
But I don't have this directory, anyone have experience with Reown and walletconnect?
I've tried lots of different ways using wagmi core and other methods but no such luck
Pull specific data from text files in PowerShell with search parameters
29 October 2024 @ 5:09 pm
We are trying to Pull AP name, bss, and ess values out of text files provided by a network team, in PowerShell 5.1. We have numerous files to go through and multiple AP Targets in each file.
Here's example of Text file. We need to extract the ap name, the ess, and bss values for each ess that matches "trustedwifi" and "guest" items only. The rest of the data is unneeded.
*********************************************************************************************************
9/5/2021 7:42:16 AM Target: AP01 (VC)
*********************************************************************************************************
WIFI AP BSS Table
------------------
bss ess port ip band/ht-mode/bandwidth ch/EIRP/max-EIRP type cur-cl ap name in-t(s) tot-t flags
--- --- ---- -- ---------------------- ---------------- ---- ------ ------- ------- -
Azure Server Error: '.NET Extensibility Feature is not installed' when Integrating PythonDLL with ASP.NET Core
29 October 2024 @ 5:05 pm
Runtime.PythonDLL = "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3";
PythonEngine.Initialize();
Application works locally, but when deploying to Microsoft Azure, I get the error message (in Azure's log stream):
"The authenticated user does not have permission to use this DLL. The request is mapped to a managed handler but the .NET Extensibility Feature is not installed. Install the .NET Extensibility feature if the request is mapped to a managed handler"
Full error message:
The authenticated user does not have permission to use this DLL. The request is mapped to a managed handler but the .NET Extensibility Feature is not installed. Things you can try: Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account. Check the event logs to see if any additional information was logged. Verify the p
Multiple ggplot legends: How do you adjust one of them?
29 October 2024 @ 5:04 pm
I would like to access only of the legend below, carb and setting the font size to 20. How can I do that. The code below changes both legends.
library(tidyverse)
ggplot(mtcars, aes(x = mpg, y = disp, color = carb, shape = as.factor(am))) +
geom_point() +
theme(legend.title = element_text(size = 20))