Random snippets of all sorts of code, mixed with a selection of help and advice.
Google Cloud IAM grafeas.v1.Grafeas.ListOccurrences logs an error every 3 minutes
29 March 2025 @ 1:26 pm
One of my Firebase projects has been logging this error twice every three minutes for the past day:
`
labels: {
method: "grafeas.v1.Grafeas.ListOccurrences"
project_id: "my-project"
service: "containeranalysis.googleapis.com"
}
type: "audited_resource"
`
Some background: I have a Github Action that deploys our Firebase Function. This particular project is just one cronjob that runs daily. I have been making edits and this Action has been deploying successfully for a couple weeks now. Yesterday, the deploys started failing with the error that there was no Artifact Registry cleanup policy. The Registry has always been set to delete by default, so had no custom policy. A few hours later, I deployed via CLI, created a policy when prompted, and the Action is working again. The listOccurrences error started right after my Action deploy failed and hasn't stopped since.
How to properly render a full LaTeX document in a React.js application?
29 March 2025 @ 1:17 pm
I am working on a React.js application where I need to render a full LaTeX document. The document is structured like a resume and contains LaTeX commands such as \documentclass{article}, \section{}, \textbf{}, etc.
What I Have Tried
I tried react-latext but it doesnt' support whole latex rendering
What I Need Help With
I am looking for the best way to fully render a LaTeX document inside React.js, preserving all formatting, without requiring users to manually generate a PDF.
Is there a better approach to rendering full LaTeX documents dynamically?
Are there any libraries that fully support LaTeX syntax inside React?
Can I convert LaTeX to HTML with better support for document structure (\documentclass, \section{})?
Optionsmenu / Actionbar / hamburger / 3-dot menu not reachable by directional pad or keyboard
29 March 2025 @ 1:17 pm
I use an action bar with a hamburger and 3-dot menu in my app.
Below this are tabs to navigate between different fragments.
Only the tabs and the content within them can be accessed via keyboard or directional pad (Android TV or Amazon Fire TV).
All actiobar elements at the top are not accessible/focusable.
You can test it yourself by creating a “Basic Views Activity” in Android Studio and starting it in the Television Emulator.
See image: green elements are reachable, red not


Odin Custom Attribute Drawer for list
29 March 2025 @ 1:14 pm
i want to make custom drawer for list of my abstract type using C# Odin Unity.
[Serializable]
[InlineProperty]
public abstract class BaseEntry : ScriptableObject
{
public string _ID;
public string _Name;
}
[Serializable]
[InlineProperty]
public class Ability : BaseEntry
{
[HorizontalLabelHeader("Test")]
public string _Description;
}
And theres how my testing script looks:
public class TestScript : MonoBehaviour
{
[SerializeField]
[ClickableList("List")]
private List<Ability> _ability;
[Button]
public void Load()
{
_ability = new List<Ability>();
_ability.Clear();
_ability = Resources.LoadAll<Ability>("").ToList();
}
}
Now the attribute and its drawer:
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = true)]
[Conditional("UNITY_EDITOR")]
[DontApplyToListEl
Bind address error when node is elected for driver on which the spark submit job is not invoked on. (cluster deploy mode vs client deploy mode)
29 March 2025 @ 1:09 pm
When running in "cluster" deploy mode and another node is elected as the driver then the app fails with address bind issues.
When running in "client" deploy mode from any of the worker nodes then the bind issue does not occur and the application
would get an executor per node. All running fine.
It is not a blocking issue as I can still run jobs on all nodes in a distributed manner when using the client deploy mode.
This is just my own cluster that I set up for learning purposes.
Please let me know if more details are needed.
I did do some port monitoring to verify that the designated ports are in LISTEN mode too with for port in {8090..8100}; do echo "Checking port $port"; sudo lsof -i :$port; done
Kind Regards
Any help is highly appreciated.
Framework details :
Java runtime 11
Hadoop 3.3.4
Spark 3.4.3
Scala 2.13.x
Delta Lake 2.4.x
Vmware instance [Ubuntu 22.04] (3 nodes resp. 6,6,4gb mem. )
Hereby full detai
Encountering with EMI Calculator issue in Python
29 March 2025 @ 1:08 pm
I am currently working on a home loan app in Python language. I am creating an EMI calculator that works on user inputs like (loan amount, rate of interest, etc.) During testing, I noticed that there was a slight change in results compared to the manual testing. My code is given below:
def calculate_emi(principal, rate, tenure):
monthly_rate = rate / (12 * 100) # Converting annual rate to monthly
emi = (principal * monthly_rate * (1 + monthly_rate) ** tenure) / ((1 + monthly_rate) ** tenure - 1)
return emi
# Test Case
emi_value = calculate_emi(500000, 7.5, 240) # Loan: 500,000 at 7.5% for 20 years
print("EMI:", emi_value)
Is there something wrong with my code or is something else an issue?
Output from script send to email using ninjaone
29 March 2025 @ 1:07 pm
I write a bash script:
#!/bin/bash
LOGFILE="/tmp/monitoring_report.log"
> "$LOGFILE" # Clear previous log
.
.
.
# Display the full log at the end (NinjaOne captures this)
cat "$LOGFILE"
The script stored in ninjaone.
Schedule to run every 10 minutes,
The output will be send to email set in "Notification Channels"
The script run success with monitoring_report.log
The issue is, ninjaone not send any output to email.
How to make ninjaone read monitoring_report.log and send the output to mail?
JavaScript Microtask order of execution in following 2 code snippets
29 March 2025 @ 1:06 pm
These are 2 codes snippets below.. Can somebody please explain the reasoning behind the each of the code's output and how microtasks are ordered in priority in cases there are multiple as in the examples below.
My Node Version : v20.17.0
1st Code Snippet
console.log("Sync");
async function test() {
await Promise.resolve();
console.log("Await");
}
test();
Promise.resolve().then(() => console.log("Then"));
o/p ---- Sync , Await , then
2nd Code Snippet
console.log("Start");
async function inner() {
await Promise.resolve();
console.log("Inner");
}
async function outer() {
await inner();
console.log("Outer");
}
outer();
Promise.resolve().then(() => console.log("Then"));
o/p ---- Start , Inner , Then , Outer
Somewhere i read that
"Microtas
Git bash displays but not executing first character in replayed command
29 March 2025 @ 1:05 pm
I have been finding that frequently, after I run a command in the git bash terminal of Visual Studio Code on my Windows machine, and then use the up arrow to replay that command; while the full command appears to be refilled, when I hit Enter to execute it, the first character of the command is actually not included and it errors out.
So if I run the following which is successfully executed:
$ dotnet script LoadStepFunctionPayloads.csx workflow_payload_index.json
and then press "up" to replay/refill the command in the terminal, followed by enter:
$ dotnet script LoadStepFunctionPayloads.csx workflow_payload_index.json
bash: otnet: command not found
So it seems like the leading d in dotnet is being truncated from the start of the command.
If I use up to replay that command once more from the error, it populates the command without the d.
$ ot
Why does Array's contains(_:) method cause an error when comparing an optional value with a non-optional value in Swift?
29 March 2025 @ 12:56 pm
I’m working with Swift and encountered an issue when using the contains method on an array. The following code works fine:
let result = ["hello", "world"].contains(Optional("hello")) // ✅ Works fine
However, when I try to use the same contains method with the array declared in a separate constant(or variable), I get a compile-time error:
let stringArray = ["hello", "world"]
let result = stringArray.contains(Optional("hello")) // ❌ Compile-time error
The compiler produces the following error message:
Cannot convert value of type 'Optional<String>' to expected argument type 'String'
Both examples seem conceptually similar, but the second one causes a compile-time error, while the first one works fine.
This confuses me because I know that S