on-internet

How to reattach original point labels to factoextra kmeans() cluster plot [closed]

I am using kmeans() to examine whether clusters in my data fall into expected categories, and factoextra::fviz_cluster() to visualize the result. To run kmeans(), I had to strip the "type" character variable from the dataset. How can I replace the default point labels with the original "type" values in my fviz_cluster() plot? Example code: library(factoextra) # Example data type <- c(rep("occurrence", 3), rep("random", 3)) water <- c(18.8, rep(17.2, 4), 16.6) barren <- c(3.34, rep(3.20, 4), 3.21) evergreen <- c(75.5, rep(72.2, 4), 77.8) mixed <- c(0.461, rep(0.457, 4), 0.459) test_frame <- dat

Join the discussion →

Reattaching original data labels to kmeans cluster for plotting

I am experimenting with using kmeans clusters to examine whether the clusters fall into expected categories or not (specifically examining land cover between areas around species occurrence records and random points). I have created my clusters using kmeans and visualized them using fviz_cluster, but to do this I had to strip my factor variable (occurrence or random) from the numeric dataset (percentage of each land cover type). I would like to reattach this factor variable so that I can plot the labels of each point (occurrence or random) on the fviz_cluster, but I'm new to these functions an

Join the discussion →

Configuring Content Understanding in Microsoft Foundry via Terraform

Microsoft Foundry has a tool called Content Understanding which is part of the Foundry Tools. I'm managing my infrastructure via Terraform. However, I'm struggling to configure Content Understanding in my Foundry setup. I also want to deploy the default models that Content Understanding requires. Is there a way to do this via Terraform? There doesn't seem to be a resource type for this, neither in the azurerm provider nor in the AzAPI provider.

Join the discussion →

Limit query results (like LIMIT in SQL)?

I’m using GridDB with the Java API and ran into a small issue while working with queries. I have a container with a lot of data, and I only need to read a small portion of it (for example, the first 100 rows). My query looks like this: Query<SensorData> query = container.query( "SELECT * FROM sensor_data WHERE deviceId = 'device_1'" ); RowSet<SensorData> rs = query.fetch(); This returns all matching rows, which can be quite large. In a typical SQL database, I would just use something like LIMIT 100, but I couldn’t find a clear equivalent in GridDB’s query syntax. I tried checking the documenta

Join the discussion →

Why x86 doesn't have conditional predicated execution like ARM's IT / ITT, and why no link-register for return addresses?

For example, ARM has conditional execution IT(if-then) blocks that allow the next few instruction to be executed conditionally. (And in ARM mode, not Thumb, predication doesn't even need an extra instruction. The top 4 bits of every instruction, except some newer opcodes like SIMD, are the predicate condition.) Also ARM has an LR (link register) which allows leaf functions to be implemented without touching the stack as opposed to x86. I've heard about instructions like cmove and conditional forms of imul, but they aren't very helpful if i just need a simple ITT (if-then-then) instruction.

Join the discussion →

ESP32 not receiving ESP-NOW packages when connected to AP (despite WIFI_AP_STA mode and despite correct wifi channel)

So I have an ESP32 that I want to connect to my router and that should simultaneously receive ESP-NOW packages, as laid out in this tutorial: https://randomnerdtutorials.com/esp32-esp-now-wi-fi-web-server/ If you want to try the demo, make sure to configure the mac address of the other node as well as the correct wifi channel on both sides. Make sure to use the same channel as your router does. The sender I use is an ESP8266 running this code: #include <ESP8266WiFi.h> #include <espnow.h> #define WIFI_CHANNEL 8 uint8_t peer[] = {0x12,0x34,0x56,0x78,0x9A,0xBC}; // MAC of the ESP32 hub void onRec

Join the discussion →

How to get a notification whenever Codex CLI finishes its current task?

I ask Codex CLI to do something which will take a long time and I go do something else on another terminal. But when Codex is done I would like to get a clear GUI notification like notify-send so I can go check its work. How to get such a clear notification? One approach is if I could run an arbitrary command whenever Codex finishes with hooks as documented at: https://developers.openai.com/codex/hooks At some point around codex-cli 0.93.0. they added a terminal bell after it stops. Even better, I use tmux, so the tab that notified gets highlighted. But the notification is still not clear enou

Join the discussion →

I need to "lock" a column in VS Code

I am using VS Code in order to write COBOL. We are being pressured to move off of our legacy software. That being said, this one thing has infuriated me to no end: COBOL Tags. Here is what I am talking about: I would like for them to never move when I am coding. For example, when I backspace, they slide back into the code: Same thing with spacing or typing, it just goes out beyond the COBOL window.

Join the discussion →

I need to column "lock" in VSCODE

I am using VSCODE in order to write cobol. We are being pressured to move off of our legacy software. That being said, this one thing has infuriated me to no end: Cobol Tags. I have done extensive internet research, but maybe one of you could help? Here is what I am talking about: I would like for them to never move when I am coding. For example, when I backspace, they slide back into the code: Same thing with spacing or typing, it just goes out beyond the cobol window. If anyone can help, I would be extremely appreciative.

Join the discussion →

My firefox extension does NOT automatically start when I start my browser, don't know why

The title basically. I have a extension called NoClanker which blocks out AI websites automatically. It's been a while since I updated it since life got busy. The extension does not automatically start when I start my browser. https://addons.mozilla.org/en-US/firefox/addon/noclanker/ <-link fetch(chrome.runtime.getURL("blocked.txt")) .then(res => res.text()) .then(text => { const blockedSites = text .split(";") .map(s => s.trim().toLowerCase()) .filter(Boolean); chrome.webRequest.onBeforeRequest.addListener( details => { let url; try { url = new URL(details.url); } catch { return; } const host

Join the discussion →

Subscription Status Mismatch Between Login Account and Store Account (Firebase + RevenueCat)

I’m currently building a subscription feature using Firebase Authentication for login and RevenueCat for handling in-app purchases. I’ve run into an issue when users log in with a different account than the one used on the store (Google Play or App Store) on their device. In my case, a user logs in with account A (which is still on the free version), but the device is using store account B, which already has an active Professional subscription. When user A tries to upgrade, the system immediately detects an active subscription and treats user A as already being Professional, even though they n

Join the discussion →

Delete a section of a file Bash Script

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 yo

Join the discussion →

Playwright Automation Script

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 please.

Join the discussion →

How do I use LangChain Agent with tools in a Python project?

I’m trying to build a project using LangChain where an agent can decide when to call a tool (e.g., a calculator or API): from langchain.agents import initialize_agent, Tool from langchain.llms import OpenAI def my_tool(input): return "Processed: " + input tools = [ Tool(name="MyTool", func=my_tool, description="Processes input") ] llm = OpenAI() agent = initialize_agent( tools, llm, agent="zero-shot-react-description", verbose=True ) response = agent.run("Process this text") print(response) The agent runs but it doesn’t use the tool correctly. How does the agent decide to use a tool? What’s th

Join the discussion →

How to implement custom instruction files (e.g., MYTOOL.md) that LLM agents recognize

AI tools like copilot and codex have special handling for files like DESIGN.md, AGENT.md and SKILL.md . Where can I get a framework / process to create my own MYTOOL.md ? So far from what I have explored, if I create MYTOOL.md and keep referencing it in the Prompt the LLM is able to use it. OR If I publish it as a skill, then also its able to use it, but it still feels that LLMs are going one step ahead to tightly integreate files like SKILL.md / AGENT.md to give them a special meaning / process in AI Agents. I have explored the code for https://github.com/google-labs-code/design.md but I am u

Join the discussion →

What challenges can I prepare for and expect for a short-distance return flight in Europe during winter 2026 (jet fuel shortages and other crisises)? [closed]

During the hostilities in the ongoing Iran War and ensuing closure of the Strait of Hormuz, Iran damaged significant amounts of Middle East petroleum processing capacity, and the expectation is that it may take years for this damage to be repaired to the point of reaching the original capacity. At the same time, the Russo-Ukrainian war is still ongoing, and Ukraine is executing weekly (if not daily) attacks on the Russian oil industry that take out oil refineries, pipelines, shipping installations and distribution points. And on top of that, there is growing animosity between Europe/NATO and t

Join the discussion →

ASP.NET Core Serilog logging in a Docker container is missing TraceId and SpanId results

I have an ASP.NET Core application running inside a Docker container. I use Serilog as the logging provider behind the Microsoft.Extensions.Logging (ILogger) abstraction. I’ve noticed a strange behavior when running the application inside versus outside Docker. When I run the app locally or behind IIS, the logs contain TraceId, SpanId, and RequestId (as a GUID). However, when I run the application inside Docker, the first two disappear from the logs, and the RequestId has a different format (I know this depends on Kestrel). The configuration is the same in both cases, but I can’t understand wh

Join the discussion →

'valgrind --tool=massif' crashes with SIGTRAP inside `pthread_cond_timedwait` on RHEL 9/glibc 2.34

We're running a multithreaded C application under valgrind --tool=massif on RHEL 9 (glibc 2.34 and Valgrind 3.22.0) and seeing a crash with SIGTRAP inside pthread_cond_timedwait. The process dies without any error message from Valgrind, and the log file contains only the standard header: ==611== Massif, a heap profiler ==611== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info ==611== Command: ./myapp The crash happens in a timer thread whose inner loop looks like this: struct timespec timeout; clock_gettime(CLOCK_MONOTONIC, &curtime); // ... compute absolute timeout ... pthrea

Join the discussion →

Android Studio with AI model integration

I'm trying to build a two tier Android application in Android studio that allow to receive inputs from user and display the result in percentage after being process in AI model (it's trained model Random Forest one for getting all inputs and other for specific set of inputs). Unfortunately, the process of connecting the AI model to the Application it's unclear and it cause the whole project to crash. The only connection process that i know is after adding it to very own folder "assets" it has then adjust the gredle and sync it which later the crash happens. Can you please provide a clear or an

Join the discussion →

Defining an OpenAPI Spec for an Endpoint with a Generic Body

We define our APIs using OpenApi 3. We are using Spring-Boot on the back-end. We need to define an endpoint to receive notifications from arbitrary third parties. We will have a URL parameter for the type which we will use to find the correct plugin to handle it, but i want a single generic endpoint. For JSON and XML I guess I can't do better than type: object but for application/x-www-form-urlencoded I feel i should be able to end up with a request body that is Map<String, Object> (or even Map<String, String> ) but I can't work out how to describe this in the OAS spec. is it possible? I have

Join the discussion →

Handling imbalanced categorical classification – best approach and evaluation metrics?

I am working on a categorical classification problem using the Portugal Bank Marketing Dataset. The target variable is binary (yes / no), and the dataset is highly imbalanced (far more no than yes). I want to understand: What are the best techniques to handle imbalanced datasets in this case? Should I use resampling methods like oversampling (e.g., SMOTE) or undersampling? Or should I rely on algorithm-level methods like class weights? How do I determine which method is best for my dataset? Is there a systematic way to compare approaches? What evaluation metrics should I use? Accuracy seems mi

Join the discussion →

Handling of negative exponent in recursion

How can this concept be implemented in C++ with recursion? Negative exponent handling is giving a segmentation error. I also tried typecasting (but failed), since it should handle a double data type. int power(int base, int exp); This function definition was given to in the question: #include <iostream> using namespace std; int counter = 0; int power(int base, int exp) { counter++; if (exp == 0) if (exp < 0) { { return double(1 / base * power(base, exp - 1)); } } return base * power(base, exp - 1); } int main() { cout << "2^0 = " << power(2, 0) << "\n"; cout << "2^5 = " << power(2, 5) << "\n";

Join the discussion →

I've made a JWT service and I yet have to solve the authorization issue with my attendance controller in the Web API layer what's the solution?

I'm working on an ASP.NET Core Web API with JWT authentication. I generate a token that includes a custom claim EmployeeId, and I try to read it inside my controller, but it is always returned as null or 0. JWT generation (JwtService): public string GenerateAccessToken(User user, IEnumerable<string> roles, IEnumerable<string> permissions, int employeeId) { var secretKey = _config["Jwt:Key"] ?? "I_AM_2026"; var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(secretKey)); var creds = new SigningCredentials(key, SecurityAlgorithms.HmacSha256); var claims = new List<Claim> { new Claim(ClaimT

Join the discussion →

Retrieve data with a PL/pgSQL DO block

I have a PL/pgSQL code block to retrieve data from a selected row in a dropdown list in the user interface. Even though I'm selecting values and assigning the result in a loop, the block doesn't emit them outside, ending up not returning anything it collected: do $$ DECLARE w_idCandidato int; w_numeroDaProva int; BEGIN FOR v_idCandidato, v_numeroDaProva IN SELECT pg."idCandidato", pg."numeroDaProva" FROM public."tb_provasGeradasProCandidato" AS pg INNER JOIN public."tb_candidatos" cd ON "idCandidato" = cd.id INNER JOIN public."tb_processosSeletivos" pr ON "idProcesso" = pr.id WHERE cd.id = 27

Join the discussion →

Retrieve data from a database with PL/pgSQL? [closed]

I have a PL/pgSQL code block to retrieve data from a selected row in a dropdown list in the user interface. Even though I'm selecting values and assigning the result in a loop, the block doesn't emit them outside, ending up not returning anything it collected: do $$ DECLARE w_idCandidato int; w_numeroDaProva int; BEGIN FOR v_idCandidato, v_numeroDaProva IN SELECT pg."idCandidato", pg."numeroDaProva" FROM public."tb_provasGeradasProCandidato" AS pg INNER JOIN public."tb_candidatos" cd ON "idCandidato" = cd.id INNER JOIN public."tb_processosSeletivos" pr ON "idProcesso" = pr.id WHERE cd.id = 27

Join the discussion →

How do I retrieve data from a database with PL/pgSQL?

I have a PL/pgSQL code block to retrieve data from a selected row in a dropdown list in the user interface. It doesn't work. What is wrong? do $$ DECLARE w_idCandidato int; w_numeroDaProva int; BEGIN FOR v_idCandidato, v_numeroDaProva IN SELECT pg."idCandidato", pg."numeroDaProva" FROM public."tb_provasGeradasProCandidato" AS pg INNER JOIN public."tb_candidatos" cd ON "idCandidato" = cd.id INNER JOIN public."tb_processosSeletivos" pr ON "idProcesso" = pr.id WHERE cd.id = 27 LOOP w_idCandidato := "idCandidato"; w_numeroDaProva := "numeroDaProva"; END LOOP; END; $$

Join the discussion →

Interpreting a forest plot from Rstudio

I've made this plot in RStudio using the metafor plot: As you can see, it's a meta-analysis forest plot with age as a moderator. I just don't know what the grey diamonds show, and I've been scouring forums to find out. I know that it shows something about the moderation, but I don't know what the size of the diamonds mean. It's probably right in front of me.

Join the discussion →

Analysis with modeling on Spotify tracks dataset

I’m predicting 8 music genre families using 114,000 Spotify tracks based only on danceability, acousticness, energy, etc. My baseline neural network hit 82% accuracy but after shuffling the labels it still hit 82%. 95% of my test data fell into an "Other/Indie" bucket so the model was just predicting the majority class. Human genre labels are flawed. Songs can be both Pop and Electronic. I ran an unsupervised auto encoder (compressing 12 audio features into a 4D bottleneck) and K-Means clustering. The natural audio clusters didn't map perfectly to human labels. I switched to a multi-label appr

Join the discussion →
Older stories