on-internet

PHP Change color of text based on $value (ctype_alpha)

What's the easiest way to change a text's color based on a variable (ctype_alpha) in PHP? In a table on mysql I have updates about some tasks' status (pending/processing/processed) For example: If $var is PENDING-> red; PROCESSING-> yellow; PROCESSED-> green. I know how to do it with numbers, but can't find a solution with text

Join the discussion →

Scraping 13F filings from SEC using R

I'm trying to scrape the data in the SEC FORM 13-F Information Table from the following link: https://sec.report/Document/0001567619-21-010281/ I tried the below script: library(timetk) library(tidyverse) library(rvest) url <- "https://sec.report/Document/0001567619-21-010281/" url <- read_html(url) raw_data <- url %>% html_nodes("#table td") %>% html_text() However, I'm unable to get the data components and under values, it says that raw_data is empty.

Join the discussion →

How to get a Packed circle chart in react chartjs?

I want to introduce a Packed circle chart (a variation of bubble chart which contains only the radius as its dimension). React Chartjs and even Chartjs support only Bubble chart but not Packed circle chart. Here is an example of the expected chart I want to add Can I get something like this using react-chartjs? For example, one needs to do something like below for a regular initiation of a bubble chart. const defaultDatasets = [ { label: ["China"], backgroundColor: "rgba(255,221,50,0.2)", borderColor: "rgba(255,221,50,1)", data: [{ x: 735, y: 50, r: 15 }] }, { label: ["Denmark"], backgroundCol

Join the discussion →

Could a barrel be made using the full length of tree trunks?

Could a barrel be made with extremely large planks made from the entire length of a tree trunk? Let's say that the trees are about 20m tall. These barrels would be made by the fossorial people described in this question, and would be partially set into the ground as a silo. They might also use them (or smaller versions) to make things that couldn't be carved into soil

Join the discussion →

Why I get net::ERR_CONNECTION_RESET message?

I am working on a ASP.NET Web Api, and I write a little code to test one of my api controllers. But when I call the method the chrome sends this: http://localhost:44333/api/GradesReader/getTest/ net::ERR_CONNECTION_RESET jquery.min.js:2 Here is my API project Startup.cs: public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } public void ConfigureServices(IServiceCollection services) { services.AddMvc(x => x.Filters.Add(new AuthorizeFilter())).AddXmlSerializerFormatters() .AddXmlDataContractSerializerFo

Join the discussion →

Is there a way to know when an msal redirect is in progress?

I'm using the @azure/msal-browser and @azure/msal-angular packages in order to simply retrieve an MSAL token for my signed in users. Since all I really need is the token, I have only provided the MsalService and MSAL_INSTANCE in my app.module.ts. I am using the redirect flow and have chosen to subscribe to the .handleRedirectObservable() method myself instead of using the MsalRedirectComponent (so that I know exactly when the token is available). My problem is that when the redirect happens and I am forwarded back to my application there is a period of time where my app is running but the redi

Join the discussion →

New .NET MAUI App project throws 'The name 'InitializeComponent' does not exist in the current context' build errors

I've attempted to play with .NET MAUI, and I've set up my development environment following the steps as described in: https://learn.microsoft.com/en-us/dotnet/maui/get-started/first-app?pivots=windows https://learn.microsoft.com/en-us/windows/apps/project-reunion/set-up-your-development-environment#required-workloads-and-components https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/device-manager?tabs=windows&pivots=windows I've also run the 'maui-check' CLI tool and everything checks out, but when I create a new .NET MAUI App with Visual Studio 2019 v

Join the discussion →

Immer only supports setting array indices and the 'length' property

What types of things would cause Immer only supports setting array indices and the 'length' property' from the code below? This FoodLogState type is a class. I've done something very similar with no issue. I notice I am not updating even the array from state yet. Only the status that is a string. import { createAsyncThunk, createSlice } from "@reduxjs/toolkit"; import { FoodLogState, getFoodState } from "../AccountAPI"; export interface FoodLogs { foodLogs: Array<FoodLogState>; status: "idle" | "loading" | "failed"; } const initialState: FoodLogs = { foodLogs: null, status: "idle", }; export c

Join the discussion →

How to get a single tooltip when there are multiple lineBarsData FlChart

I'm using the fl_chart package, and there is the possibility of when you move the mouse over a line of the graph to show a tooltip with the data but of all the lines on the graph. This is what happens now. I attach an example below: I would need to have a single tooltip and not for all lines in the graph. I attach an example below:

Join the discussion →

STM32 For Vscode extension printf to console

I am using macOS as my developing OS. I have recently downloaded all the required tools to setup programming environment. I am trying to program STM32WB55 nucleo board. I have created a default makefile project using STM32cubeMX and I am using stm32 vscode extension to build/flash and debug my device. I am able to build project and flash it without any issue, however, I want to setup printf to print to the vscode console but I have not managed to do it yet. I do not like the fact that everytime I want to print something, I must open a terminal program and connect to the port and then listen to

Join the discussion →

Postman Request body data from Excel / CSV file - forward slash

I get request body data from Excel file. I have already coverted it from Excel to CSV format. I am kind of able to find a solution but it is not working 100% as jsonbody format is not fetching data correctly. It shows a forward slash in CSV import data from runner collections. Request Body {{jsonBody}} Set Global variables jsonBody Running collection select data file as CSV file as per the screenshot request body shows it with a forward slash. After running the collection I'm getting the incorrect version of the body with a forward slash. This below screenshot shows the correct version on CSV

Join the discussion →

How can i use an image as a background in Tkinter?

So I want to use an image as my background in Tkinter kind of like how windows has background images in desktop. This is my code but it doesn't seem to work: root = tk.Tk() root.attributes("-fullscreen", True) background_image=tk.PhotoImage("image") The code runs but it shows up as a white background.

Join the discussion →

Drawing to a texture in Unity is very slow

I have been learning Unity for the last few weeks in order to create a simple ant simulation. The way I was rendering everything was writing to a texture the size of the camera in the Update function. It works, but problem is that it is extremely slow, getting only around 3-4 FPS doing so. What could be done to speed it up? Maybe a completely different way of rendering? Here is the code of a simple test where some Ants just move around in random directions. I have the AntScript.cs attached to the camera with a texture under a Canvas where everything is being written to. AntScript.cs using Syst

Join the discussion →

Spring Boot ReactiveCircuitBreaker configuration not working

I'm using a circuit breaker implementation in my reactive web service built on Spring Boot Webflux. I'm using below dependencies in pom.xml: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.4</version> </parent> ... <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-circuitbreaker-reactor-resilience4j</artifactId> <version>2.0.1</version> </dependency> And then I created the beans related to Circuit Breaker: @Configuration public class NetworkProfileCircuitBreakerConfig { ... @Bean("net

Join the discussion →

Error: Predis\Connection\ConnectionException: `SELECT` failed: ERR value is not an integer or out of range [tcp://redis:6379] in file

I have redis problem in laravel, I'm using laradock to upload my containers, but I don't know why it's not working. When I ran the command redis-server in the terminal inside the bash of redis I saw that I was returning this error: C:\Users\danil\OneDrive\Área de Trabalho\BuilderAll\mercaloo-seller\laradock>docker-compose exec redis bash root@2e4c45a362d1:/data# redis-server 25:C 12 Jun 2021 10:33:24.322 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo 25:C 12 Jun 2021 10:33:24.322 # Redis version=6.2.4, bits=64, commit=00000000, modified=0, pid=25, just started 25:C 12 Jun 2021 10:33:24.322 #

Join the discussion →

How to use OpenSSL in.NET Core

I add an OpenSSL package(System.Security.Cryptography.OpenSsl) to my .net core project in NuGet, but I don't know how to use it.Please give me some tips.Thank you!!!

Join the discussion →

Scala/Java parse date unknown format

I have the following code: val dateString = "12/Sep/2017:11:25:29 +0200" println(LocalDateTime.parse( dateString, DateTimeFormatter.ofPattern("dd/LLL/yyyy:HH:mm:ss X") )); and the following error: Exception in thread "main" java.time.format.DateTimeParseException: Text '12/Sep/2017:11:25:29 +0200' could not be parsed at index 3 What is wrong in my format? I read https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html but do not find the correct one EDIT1: "dd/MMM/yyyy:HH:mm:ss X" does not work either

Join the discussion →

Problem in tracking my position with Gocoder

I'm working on a project where I want to track my exact position with Python. I have problem every time when I try to track my position as it doesn't give an exact position; instead, it gives the wrong position at a different city. I'm using Geocoder library: import geocoder g = geocoder.ip('me') a=g.latlng b=g.city My current country is Tunisia and this is my current position: This is what Geocoder returns: Is there a solution for this? Is the problem with my provider?

Join the discussion →

Problem in tracking my position with Gocoder python

I'm student and i'm working in project where i want to track my exact position with python. I have problem everytime when i try to track my position, it doesn't give an exact position it gives the wrong position with different city i'm using Geocoder library import geocoder g = geocoder.ip('me') a=g.latlng b=g.city my current country is Tunisia This is my current position This is what Geocoder return to me Is there a solution for this?? Is the problem with my provider?

Join the discussion →

How to install a particular version of click?

I obtained the following error during an installation. ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. gitsome 0.8.4 requires click<7.0,>=5.1, but you have click 8.0.1 which is incompatible. I tried: pip install click<7.0,>=5.1 which led to ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. flask 2.0.1 requires click>=7.1.2, but you have click 6.7

Join the discussion →

Flask: how to automate OpenAPI v3 documentation?

I need to document an API written in pure Flask 2 and I'm looking for what is a consolidated approach for doing this. I found different viable solutions but being new to Python and Flask I'm not able to choose among them. The solutions I found are: https://github.com/marshmallow-code/apispec https://github.com/jmcarp/flask-apispec https://github.com/marshmallow-code/flask-smorest In order to separate the different API endpoints I use the Flask blueprint. The structure of a MWE is as follows: I first defined two simple domain objects, Author and Book. # author.py class Author: def __init__(self

Join the discussion →

How do I compile hadoop.dll and winutils.exe for Windows 10 Pro x64 (IAMD)

I need to compile hadoop.dll and winutils.exe for Windows 10 Pro x64 (AMD), and am having no success there. I cannot find hadoop.dll or winutils.exe for Windows 10 Pro x64 (AMD) downloadable anywhere that work. They are no where to be found. I tried this: https://github.com/cdarlint/winutils (but it is out of date - might work for Windows98 and Windows NT) I created: c:\hadoop and HADOOP_HOME = c:\hadoop I dropped the files in c:\hadoop\bin, and added %HADOOP_HOME%\bin to my Windows PATH. and when used get: java.io.IOException: Cannot run program "C:\hadoop\bin\winutils.exe": CreateProcess err

Join the discussion →

pip install raise ValueError("check_hostname requires server_hostname") while VPN is on

pip install <package> gives exception. raise ValueError("check_hostname requires server_hostname") ValueError: check_hostname requires server_hostname while VPN is on, let say. My only option is VPN. I can not turn it off. How to solve this problem. Pip Version pip 21.1.1 Python 3.9.5 Conda version conda 4.10.1 Here is a full exception. WARNING: Ignoring invalid distribution -rllib3 (c:\programdata\anaconda3\envs\pycharm\lib\site-packages) WARNING: Ignoring invalid distribution -rllib3 (c:\programdata\anaconda3\envs\pycharm\lib\site-packages) ERROR: Exception: Traceback (most recent call last)

Join the discussion →

Set the column value from page item by using JavaScript (Oracle APEX interactive grid)

I'm working with APEX 20.1 interactive grids and I'm using the following code to get the value from the item "P7_DATE" into the column 'ADDING_DATE'. var widget = apex.region('myIG').widget(); var grid = widget.interactiveGrid('getViews','grid'); var model = grid.model; model.forEach(function(r) { model.setValue(r,"ADDING_DATE",apex.item("P7_DATE").getValue()); }); I have two issues: This code only works for the first row; I have another column called 'code' and I need to add a condition that (if 'code' is not null then run the code above). Thank you for your help

Join the discussion →

Python and Redis. Why is scan_iter() so much slower than keys() with mget()?

I made a script to compare query speeds between methods in the redis library. As I understand it, I should not use redis.keys() because it's a blocking function. The preferred method is scan_iter(), which doesn't block. That makes sense. But I don't understand why scan_iter is so terribly slow. This script uses three techniques to query a redis database. Use redis.keys() to get all of the keys. Use redis.mget() to get all the values. Use a for loop with redis.scan_iter and redis.get() to get the values. (Note I don't need keys, just values) Use redis.scan_iter() to get all of the keys. Use red

Join the discussion →

How does Playit app prevent videos from playing in other media players? What technology does it use

There is a website pdisk.net and whatever the video we upload from our computer to the site and share the link to view it, the videos open only in Playit android app. Only first 15 seconds can be viewed after that a screen appears showing "to play the video, install Playit app from playstore". What is happening to the videos in the backend when we upload on pdisk.net website? I think the site is owned by Playit app only. I noticed that the uploaded videos use final url a6.hentai.com...etc to stream the videos which can be streamed fully using the app only. Can someone tell if the videos are en

Join the discussion →

How to fix the ''module java.base does not "opens java.io" to unnamed module '' error in Android Studio?

Background I started my first project in android studio to get familiar with Android programming. I am following this tutorial, in which I created a new project Empty Activity, without any change It is supposed to simulate a simple app that shows "Hello World" message Problem Description But every time I try to run and build (I want to emulator as of now), I get the following error message. Unable to make field private final java.lang.String java.io.File.path accessible: Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io"

Join the discussion →

How to set a buy order in binance api

I am trying to set a buy order with binance api in Javascript/Nodejs. https://github.com/binance-exchange/binance-api-node For example, assume that last price of X coin is 4.25 I want to buy when its price increased to 4.32 When i use order api; await client.order({ symbol: X, side: 'BUY', type: 'LIMIT', quantity: quantity, price: 4.32 }) It always buy at 4.25. Because last price of X coin is 4.25 but i want to set an order which buy at 4.32. How can i achieve that ? I also tried orderOco api; await client.orderOco({ symbol: X, side: 'BUY', quantity: quantity, price: 4.32, stopPrice: 4.13, sto

Join the discussion →
Older stories