StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

FCM Notifications implementation in Node Js based Flutter App

12 June 2026 @ 10:14 am

I want to implement a new notification feature in Node Js based Flutter app. It is a multi vendor app, the app has super_admin login, the admin sends the message to other users, the user sees the messages in the chat (addition the users who paid for premium services are allowed to use the chat feature) but the notification feature is missing. Whenever the admin message in the chat the users should be notified (main requirement). Any opinions regarding the implementation.

Elasticsearch restore snapshot form S3- snapshot_missing_exception

12 June 2026 @ 10:06 am

I have an Elasticsearch 9.2.1 cluster configured with Snapshot Lifecycle Management (SLM) that takes nightly snapshots to an S3 repository. The snapshots are successfully created, and I can see all snapshot metadata in the S3 bucket. I created a new Elasticsearch 9.2.1 cluster and registered a repository pointing to the same S3 bucket. The repository registration succeeds, and I can see the snapshots: GET _snapshot/nightly-snapshots-003/_all I can also retrieve information about an individual snapshot: GET _snapshot/nightly-snapshots-003/snapshot-2026-06-11-00-00-00-utc However, when I try to restore the snapshot: POST /_snapshot/nightly-snapshots-003/snapshot-2026-06-11-00-00-00-utc/_restore?pretty I get: { "error": { "root_cause": [ { "type": "snapshot_missing_exception", "reason": "

Flutter app runs in debug buildbut crashes when in release build with no errors and exceptions. Straight crash when opening

12 June 2026 @ 10:05 am

So if this happened to you, you might want to consider this. The problem (for me but it could happen to you) is that I used libraries like ffmpeg_kit_flutter_new and just_audio. Somehow, R8 which is google's code shrinker/obfuscator strips down bridging classes that causes the immidiate crash. App worked on debug because R8 doesn't run in debug. buildTypes { release { signingConfig = signingConfigs.getByName("debug") isMinifyEnabled = false } } if there's still errors use, buildTypes { release { signingConfig = signingConfigs.getByName("debug") isMinifyEnabled = false isShrinkResources = false } } isMinifyEnabled = false -- is the minimal solution I thought at first it was caused by Impeller but it wasn't. Note, I don't know if this is a permanent fix, though Claude said that a good pro-guard is permanent.

How to fix json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 9035) without modifying a file? [duplicate]

12 June 2026 @ 9:43 am

I am working on a polymarket bot and downloaded historical bitcoin data from bybit. Whenever I try to iterate it I get this error: json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 9035) What am I doing wrong? import json import pytz import pandas as pd from datetime import datetime, timezone import requests orderbook = "C:/Users/Owner/PycharmProjects/polymarket strategy/.venv/historical orderbook data" import os data = [] file_number = 0 class File: def __init__(self,file_number): self.file_number = file_number file_number += 1 def get_timestamp(self): with open(filepath, 'r') as file: json.load(file) timestamps = [] for row in file: timestamps.append(row.get("ts")) print(timestamps) lowest_timestamp = timestamps[0] highest_timestamp = timestamps[-1] for filename in os.listdir(order

Where to learn agentic AI systems and cybersecurity with aligning with the latest trend

12 June 2026 @ 9:03 am

I want to learn Agentic AI systems and Cybersecurity using a project-based approach rather than only theory. I am interested in: AI agents and agentic workflows Multi-agent systems RAG (Retrieval-Augmented Generation) MCP (Model Context Protocol) AI security and LLM security Network, cloud, and application security SOC automation and threat detection I am looking for: Beginner-to-advanced project roadmaps Real-world projects used in industry Open-source repositories for hands-on practice Labs, CTFs, and cybersecurity challenges Resources aligned with current 2026 industry trends Projects that combine AI agents and cybersecurity My background: Beginner What projects and learning resources would you recommend to build

display map in picturebox based lat and long

12 June 2026 @ 8:39 am

How to display map in picturebox based lat and long i'm on vb 6.0 for example lat: 44,1268600 long: 8,2071763 tks

Is Python an efficient way to automate View/Table construction for database?

12 June 2026 @ 8:20 am

Is it “appropriate” to use Python to automate the creation of certain tables/views in PostgreSQL? The thing is, some columns have too many unique values, and writing the script becomes time-consuming compared to the value it provides. Besides, Excel could do it faster and more simply. Since Python is more “efficient”—particularly thanks to loops, for example—it would save time and easily cover all possible scenarios. However, the task involves creating a table or view from an existing table in the database. Which, in the case of using a Python script, would amount to “extracting” the source table from the database, transforming it, and writing the result back to the database. So, this solution seems unnecessarily “costly” to me—especially in terms of time and resources—as the source table grows, doesn’t it? Is it acceptable in terms of “best practices,” “maintainability,” and performance? How do you handle this, and what feedback c

How to migrate an existing database in MySQL at phpAdmin to an existing Laravel project?

12 June 2026 @ 7:25 am

im currently doing a project for my test and this problem kinda slow me down, i have this existing database i made on phpAdmin and i want to connect from phpAdmin to my Laravel project, not the other way around. Can someone help me this problems please? Thank you

Is destructuring in Kotlin really badly designed?

11 June 2026 @ 9:05 pm

This snippet suggests that object destructuring in Kotlin uses the order properties are declared in the class (rather than matching the variable name to the property name) data class Person ( val age: Int = 22, val firstName: String = "first", val lastName: String = "last" ) fun main() { // destructure the person properties val (firstName, lastName) = Person() // prints "22 first" because destructuring uses the order properties are // declared in the class rather than matching the variable name to the // property name println("$firstName $lastName") } Surely this is a terrible design? It means any destructuring code can be broken if a property is added to the class of the object being destructured?

How can my rotating image gallery be made to fit within the main container of a responsive website?

11 June 2026 @ 6:56 pm

I am attempting to make my own website. The layout is lifted from here. I found a guide on making a marquee here (it's a div with a CSS animation) and combined it with a flexbox horizontal image gallery based off what I found here to make a rotating image gallery. This is my second attempt making one, and the first time it's worked. However, the problem is that the marquee's width must be smaller than the horizontal image gallery's width for the images to actually scroll (and not elongate the entire web page, which has been the problem I am running into). But this set pixel width means my website is no longer responsive; I want for when the window is downsized, for the marquee width to also be shrunk. H