Posts

Showing posts from April, 2023

Search and print result along with earlier information

I have total 30 test result files, each having 12 iterations in it. The structure of the file is as below: File1_loc/result.txt # starting information # User information # Time stamps # Random infomration # Thousnads of lines in between # ----------------- Iteration 1 ---------------------- # $Test show addr 0x2341233 data 0x241341 # $Test matches Pass # $Test show addr 0x123324 data 0x223245 # $Test matches Pass # Few hundreds line # $Test time: ERROR: Results_dont_Match Loc: Actual=31ABCDEF Expected=21ABCDE # ******:time ns: CHANGE ERROR COUNT TO: 1 # $Test show addr 0x2341233 data 0x241341 # $Test matches Pass # $Test show addr 0x123324 data 0x223245 # $Test matches Pass # Few hundreds line # ---------------------------------------------------- # ----------------- Iteration 2 ---------------------- # $Test show addr 0x2341233 data 0x241341 # $Test matches Pass # $Test show addr 0x123324 data 0x223245 # $Test matches Pass # Few hundreds line # $Test time: ERROR: Results_dont_...

VS Code: Connecting to a python interpreter in docker container without using remote containers

I know it is generally possible to connect to a container's python interpreter with: remote containers remote ssh The problems I have with these solutions: it opens a new window where I need to install/specify all extensions again it opens a new window per container. I am working in a monorepo where each services's folder is mounted in a different container (connected via docker compose) Is there a solution that allows me to specify a remote container to connect to simply for the python interpreter (and not for an entirely new workspace)?

Stop/kill Bigquery in console

We have an use case regrading the big query. We have one dashboard to identify long running query or query which scanned more data and need to optimize. Suppose any user writing a query in bigQuery Cloud Console, and it showing it will scan 300 GB data, so any method to stop that user before running the query in realtime. I try with cloud function and pub/sub, but problem is, I can not figure it out, which bigQuery event will trigger that function

Installing specific version of NodeJS and NPM on Alpine docker image

I need to use a standard Alpine docker image and install a specific version of Node and NPM. Heres is my attempt so far: FROM alpine:3.17.2 RUN apk update RUN apk upgrade RUN apk add bash git helm openssh yq github-cli RUN apk add \ curl \ docker \ openrc # nvm environment variables ENV NVM_DIR /usr/local/nvm ENV NVM_VERSION 0.39.3 ENV NODE_VERSION 18.16.0 # install nvm # https://github.com/creationix/nvm#install-script RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v$NVM_VERSION/install.sh | bash # install node and npm RUN source $NVM_DIR/nvm.sh \ && nvm install $NODE_VERSION \ && nvm alias default $NODE_VERSION \ && nvm use default # add node and npm to path so the commands are available ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH RUN ls -asl $NVM_DIR/versions/node/v$NODE_VERSION/bin RUN ls -asl $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modul...

Using @Context for a mapstruct mapper is considered like an additional parameter

I have a mapper where I'm trying to use a repository as context so I can fetch my object during the mapping. I spent a lot of time searching how context work and this is what I came up with @Mapper(componentModel = MappingConstants.ComponentModel.SPRING, nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT) public interface EnumValueMapper { @Mapping(target = "enumDefinition", source = "enumDefinitionId", qualifiedByName = "getEnumDefinition") EnumValue toEntity(EnumValueBean enumValueBean); @Mapping(target = "enumDefinitionId", source = "enumDefinition.name") EnumValueBean toBean(EnumValue enumValue); @Named("getEnumDefinition") static EnumDefinition getEnumDefinition(String enumDefinitionName, @Context IEnumDefinitiontDao enumDefinitionDao) { return enumDefinitionDao.findById(enumDefinitionName).orElse(null); } } The issue with this is that I get the error Qualifier...

Model is nil, even though a function creates it

In my function, it clones a random pre-set model and returns the model, however it returns the model as nil. I want to know how and why the model is set to nil even after the function returns the object value. function in question vvvv function choosehallway(j,i) local num = math.random(1, #hallwaychildren) local qawrestdryhouijmp = false local g local function f() local hallway = hallwaychildren[num]:Clone() hallway.Parent = Tiles hallway.Name = #Tiles:GetChildren() hallway.PrimaryPart = hallway.Floor Grid[#Grid + 1] = hallway hallway:PivotTo(CFrame.new(TileSize.X*j,Origin.Y,TileSize.Z*i)) qawrestdryhouijmp = true return hallway end --btw, grid[#grid] is the previous grid space, not the current one. --grid[#grid + 1] is the current space, grid[#grid + 1 + gridX] is the one below the current --one, grid[#grid + 1 - gridX] is the space above the current space, and grid[#grid + 2] -...

Issue spawning player

I have a door system in my game that allows the player to switch scenes. Depending on the door he triggers, he is suppose to be placed in different spots on the map. All my doors have a box collider and a sceneSwitcher script attached to them that looks like this: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; using TMPro; public class SceneSwitcher : MonoBehaviour { float distance; public GameObject player; public GameObject interactUI; public Animator Transition; public string levelToLoadNext; public float newSpawPointx; public float newSpawPointy; public float newSpawPointz; void OnMouseOver() { distance = Vector3.Distance(player.transform.position, this.transform.position); if (distance <= 5.5f) { interactUI.SetActive(true); gameStatsManager.levelToLoad = levelToLoadNext; gameStatsManager....

Split a CONVEX polygon into 2 parts vertically (python)

I have an array of points which represent the vertices of a CONVEX polygon. example: [[1,0],[3,0],[4,2],[0,5],[2,8]] Now I am trying to do is split the polygon into 2 equal parts from its longest side (vertically). For example as the image shows below: Also it doesn't have to be exactly equal areas it can be a close number to 2 halves. The image shows what kind of cut I am looking for. The red line could have cut horizontally using y axis but polygon was more stretched and long on the x axis so it split it on x axis. Also I am JUST looking for 2 split no more than that. [IMAGE] i tried to search online for some solutions but wasn't able to find a proper resource.

Making a guessing game in C but outputs are different when I change variable types [duplicate]

I am new with C first of all. I was trying to write a guessing game. It is simple, you are just guessing until you find the number that program holds in "no_to_guess" variable. The problem is if I turn variables to type of char program prints "Guess the number" prompt twice but when I change it back to int type it all works correctly. Do you guys have any idea? int main(){ int no_to_guess = 5,guess; while(guess != no_to_guess){ printf("Guess a number: "); scanf("%d",&guess); if(guess == no_to_guess) printf("You Won"); } return 0; } There is no problem with int type but when I change variables to char type the program prompts user twice to guess. I know using char type don't make sense but I just wonder why this is happening. char no_to_guess = '5',guess; while(guess != no_to_guess){ printf("Guess a number: "); scanf("%c",&...

How can I deploy a simple server container to ECS Fargate?

I've been trying to deploy my container for the last 8 days all day, but still can't (I know) It is a simple express.js API that listens for http requests on port 80 Before building the image and pushing it to DockerHub I created an endpoint for the "check health status": app.get("/health", (_, res: Response) => res.sendStatus(200)); const port = process.env.SERVER_PORT; app.listen(port, async () => { console.log(`Server is listening on port ${port}. 🚀`); }); I checked this path on my local machine and it seems to be working: Print screen Then I tried deploying it to AWS ECS Fargate: Created the cluster, created the task definition following the instructions that I used in the docker-compose.yaml file, created a service based on the task definition I created and launched that service. At the AWS console everything seems to working fine too: Print screen So I tried sending a HTTP request to the DNS name of the Load balancer /health, and also ...

Setting `proxy-request-buffering off` leads to removing original `Content-length` header

I noticed that Nginx ingress caches big requests and I found that such behaviour can be switched off by nginx.ingress.kubernetes.io/proxy-request-buffering: "off" that in terms of Nginx is equal to proxy-request-buffering off After that I started receiving no Content-Length header on my server side although it is sent on the client side Is it expected behaviour? Can I receive the original Content-Length ?

Log files containing vehicle information in Veins 5.2.i1

I am very new to the Veins OMNet++ environment. I ran the example simulation and then looked for the log files. I found the "\instant-veins-5.2-i1\Logs\VBox.log" file but I did not see the vehicle details like "Timestamp, Vehicle Node ID, Position, speed, etc.". It had the VM info like this: 00:00:02.927357 Log opened 2023-04-27T03:31:51.661539800Z 00:00:02.927358 Build Type: release 00:00:02.927360 OS Product: Windows 11 00:00:02.927361 OS Release: 10.0.22621 00:00:02.927361 OS Service Pack: 00:00:03.018921 DMI Product Name: HP ENVY x360 Convertible 15m-ed1xxx 00:00:03.022306 DMI Product Version: Type1ProductConfigId 00:00:03.022323 Firmware type: UEFI 00:00:03.022761 Secure Boot: VERR_PRIVILEGE_NOT_HELD 00:00:03.022803 Host RAM: 12049MB (11.7GB) total, 2922MB (2.8GB) I found instructions in the manual: https://doc.omnetpp.org/omnetpp/manual/#sec:sim-lib:log-output https://sumo.dlr.de/docs/Simulation/Output/index.html https://sumo.dlr.de/docs/Simulation/Outp...

Tag a player who touches script.Parent

So I want this to tag a player tho it just does nothing! local playersTouching = {} local function onPartTouched(part, player) if part == script.Parent and player and player:IsA("Player") then player:SetAttribute("Hiding", true) playersTouching[player] = true end end local function onPartTouchEnded(part, player) if part == script.Parent and player and player:IsA("Player") then player:SetAttribute("Hiding", nil) playersTouching[player] = nil end end script.Parent.Touched:Connect(function(otherPart) local humanoid = otherPart.Parent:FindFirstChildOfClass("Humanoid") if humanoid then onPartTouched(script.Parent, humanoid.Parent) end end) script.Parent.TouchEnded:Connect(function(otherPart) local humanoid = otherPart.Parent:FindFirstChildOfClass("Humanoid") if humanoid then onPartTouchEnded(script.Parent, humanoid.Parent) end end) So I ex...

Sentry not logging errors when I am in debug mode in VSCode, but logging errors normally when I run the app with "flutter run"

I am having a weird bug with Sentry. Last week, Sentry was logging the errors impeccably, but this week it started to show a strange behavior. I always used debug mode in VSCode for the hot reload and such, and Sentry, right from the beginning, logged all the errors, but this week, it just stopped. After a bit of digging, I noticed that when I run the app via "flutter run" it logs, but when I run via debug mode, it doesn't. Does anyone know what could be happening? Dunno if it is code related, since it always worked and I didn't change anything

Does Remotelock through the Graph API work?

I'm trying to make remoteLock work however I'm always getting the following error: { "error": { "code": "BadRequest", "message": "{\r\n "_version": 3,\r\n "Message": "An error has occurred - Operation ID (for customer support): 00000000-0000-0000-0000-000000000000 - Activity ID: db4dc989-7ba7-4bf1-8498-62ef8c5defb5 - Url: https://fef.amsub0202.manage.microsoft.com/DeviceFE/StatelessDeviceFEService/deviceManagement/managedDevices('e85b9c69-fd4c-405c-bc34-2af1dc84f645')/microsoft.management.services.api.remoteLock?api-version=2022-07-29\",\r\n "CustomApiErrorPhrase": "",\r\n "RetryAfter": null,\r\n "ErrorSourceService": "",\r\n "HttpHeaders": "{}"\r\n}", "innerError": { "date": "2023-04-25T12:41:30", "request-id": "db4dc989-7ba7-4bf1-8498-62ef8c5defb5", "client-request...

Strange issue with API data in WordPress

Image
I'm experimenting with an API which returns acronym definitions. My site has 2 custom post types, 'acronym' and 'definition'. I'm generating a random 2 - 3 letter string and feeding it to the API. The idea is that, if the API returns data, the randomly generated acronym is added as an 'acronym' post and the definitions are added as 'definition' posts. The definitions are then linked to the acronym via an ACF field. If the randomly generated acronym already exists as an 'acronym' post, then the definitions are simply created and assigned to that acronym post. I'm running the code using the WP admin footer hook for testing purposes. Here's a boiled down version of my code: add_action('admin_footer', 'api_fetch'); function api_fetch(){ $length = rand(2, 3); $randacro = ''; for ($i = 0; $i < $length; $i++) { $randacro .= chr(rand(97, 122)); } // Set the endpoint URL $url ...

How to decrypt cCryptoGS (CryptoJS) string using OpenSSL?

Sample function in Google Apps Script using the cCryptoGS library : function encrypt() { let message = "Hello world!"; let pw = "password"; let encrypted = cCryptoGS.CryptoJS.AES.encrypt(message, pw).toString(); Logger.log(encrypted); // Sample result, changes each time due to the salt // U2FsdGVkX19A/TPmx/tmR9MRiKU9AQPhUYKD/lyoY/c= }; Trying to decrypt using OpenSSL: echo "U2FsdGVkX19A/TPmx/tmR9MRiKU9AQPhUYKD/lyoY/c=" | openssl enc -d -a -A -aes-256-cbc -iter 1 -md md5 -pass pass:'password' && echo That command returned an error: bad decrypt 803B3E80A67F0000:error:1C800064:Provider routines:ossl_cipher_unpadblock:bad decrypt:../providers/implementations/ciphers/ciphercommon_block.c:124: OpenSSL version is OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022) . How could the cyphertext generated by cCryptoGS be decrypted using OpenSSL?

Change color of panel based on label in Grafana

Image
I would like to change the color of my panel based on the panel title. I have a simple visualization of the tally of healthy and unhealthy. The word "healthy" in the panel title is a dynamic value determined by a variable name $status. However, I want to change the color of the background if the value of $status is unhealthy. Something, like this I tried to do it by value mapping but nothing is happening. Is this possible to do?

Unable to display minor grid lines in ggplot2

I am trying to differentiate the tiles by displaying white minor grid lines but I am unable to get it to work. Could someone help me please. This is what my function looks like. I have tried changing the panel.grid.minor to specify x & y gridlines as well. Didnt work. Help please. Thanks in advance library(ggplot2) library(tidyverse) # Read the data data <- read.table("pd_output.txt", header = TRUE, sep = "\t") # Create a generic waterfall plot function create_waterfall_plot <- function(data) { data <- data %>% mutate(mutation_types = factor(mutation_types), variant_consequences = factor(variant_consequences), impact = factor(impact), clinical_annotations = factor(clinical_annotations), TE_fusion = factor(TE_fusion), hotspot = factor(hotspot)) plot <- ggplot(data, aes(x = sampleID, y = gene_name)) + theme_bw() + theme(panel.grid.major = element_blank(), panel.g...

Yup nested validation schema with conditional validation

I have created a formik object with initial values similar to {customerDetails: {id: "", name: "", mobileNumber: ""}, notes: {id: "", text: "", type: ""}} how do i write a conditional yup validation schema for this object such that if id of customerDetails is present name and mobile number are not required but required if id is not present. I tried something like this: const validationSchema = Yup.object().shape({ customerDetails: Yup.object().shape({ id: Yup.string(), firstName: Yup.string().when('id', { is: (value: string) => !Boolean(value), then: Yup.string().required("Required") }), }) }) but i am getting this error: No overload matches this call. Overload 1 of 4, '(keys: string | string[], builder: ConditionBuilder<StringSchema<string, AnyObject, undefined, "">>): StringSchema<string, AnyObject, undefined, ...

async handling in Go, unintuitive behavior with goroutines & context

Background I am working on a server and decided to move away from traditional async processing for long running requests (pub/sub, etc.) by using goroutines and context. My idea was to take a request and kick off a goroutine with a new timeout context that will complete the processing regardless of if the initial request context is cancelled (i.e. user refreshes). I had done this before on a single endpoint but wanted to make a generalized reusable wrapper this time that I could give a timeout and put an async chunk of code in (shown below is working code). type ContextSplitter struct { InitialCtx context.Context Timeout time.Duration } func NewContextSplitter(timeout time.Duration) *ContextSplitter { return &ContextSplitter{ InitialCtx: context.Background(), Timeout: timeout, } } func (c *ContextSplitter) Do(worker func(ctx context.Context) error) error { var wg sync.WaitGroup errs := make(chan error, 1) newCtx, cancel := cont...

AWS ECS Service Discovery Cors Issue?

I am implementing a full stack app on ECS with Service Discovery Enabled. The infrastructure consists of a backend which talks to a mysql RDS database and a frontend with VueJS which makes request to the nodejs backend. I am running into a cors issue when i make a request from the frontend.To reproduce the issue : Clone https://github.com/FIAF0624/backend-infra terraform init terraform plan terraform apply When the mysql instance is up and running, connect to the database using mysql -h <endpoint> -u admin -padmin123 and run the following query : DROP DATABASE IF EXISTS customer; CREATE DATABASE customer; USE customer; DROP TABLE IF EXISTS books; CREATE TABLE books ( id int NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, price int NOT NULL, PRIMARY KEY (id) ); INSERT INTO books VALUES (1,'Basic Economics', 20),(2,'Harry Potter', 15),(3,'Physics', 17); Select * from books Clone https://github.com/FIAF0624/frontend-infra terraf...

Something's wrong with react 18 useEffect. React17 useEffect functions well [closed]

https://codesandbox.io/p/sandbox/recursing-goldwasser-fde16r?selection=%5B%7B%22endColumn%22%3A37%2C%22endLineNumber%22%3A4%2C%22startColumn%22%3A37%2C%22startLineNumber%22%3A4%7D%5D&file=%2Fpages%2Findex.js Referring to the above codesandbox, the scrollup menu works well in react 17 but the transition does not appear in react 18. Problem is possibly with useEffect. What is the problem? I tried on React 17 and React 18. In react 17 the scroll up transition display correctly, but in react 18 the scroll up transition is missing. https://codesandbox.io/p/sandbox/dreamy-resonance-hdosok This is the problem in react 18. Is there any workaround to change back the behaviour of react 17 or how to keep the component structure while making the behaviour of react 17? https://github.com/websummernow/ReactBehaviours

Cannot find AwaitableTriggerDagRunOperator anymore for Airflow [Python]

I'm working on a python project using Airflow. In the project there is no requirements.txt file so I simply installed the latest version of the libraries by putting their name inside a requirement.txt file and I've been trying to make it work. The import which is causing trouble is this one: from airflow_common.operators.awaitable_trigger_dag_run_operator import ( AwaitableTriggerDagRunOperator, ) Looking online for AwaitableTriggerDagRunOperator I cannot find any documentation about this operator, the only result that comes up is this page where another person is using it and this person is importing it in the same way I am. I guess that the project was developed with a very old version of Airflow and things have changed quite a bit. Here is the version that I have installed. $ pip freeze | awk '/airflow/' airflow-commons==0.0.67 apache-airflow==2.5.3 apache-airflow-providers-cncf-kubernetes==6.0.0 apache-airflow-providers-common-sql==1.4.0 apache-airflow-...

Send data from single inputs.exec to multiple outputs.kafka in telegraf

I have data coming to telegraf and it has multiple fields. I want to be able to have one inputs.exec plugin and multiple outputs.kafka plugin to send each field to respective kafka topics. My data is in this format: { "field1": [ { "abc" : 0, "efg" : 1, "hij" : 4, "jkl" : 5 } ], "field2": [ { host : "admin1", timestamp: 1682314679774 }, { host : "admin2", timestamp: 1682314679775 }, { host : "admin3", timestamp: 1682314679773 } ] } I want to send field1 to "field1" kafka topic and field2 to "field2" kafka topic. My expected output is: In field1 kafka topic: { "abc" : 0, "efg" : 1, "hij" : 4, "jkl" : 5 } In field2 kafka topic: { host : ...

is there a better dynamic way to replace if any digit except 0 exists using sed/awk

Team, my output is below and I want to replace all non-zeros after comma to boolean 1. DA:74,0 DA:75,0 DA:79,3 < NON BOOLEAN DA:80,3 < NON BOOLEAN DA:81,3 < NON BOOLEAN DA:82,4 < NON BOOLEAN DA:83,1 so I did this sed 's/,[1-999]/,1/g' but I can't be increasing 999 to 9999 kind of manual. is there a dynamic way that if no 0 then replace with one. 1 expected output DA:74,0 DA:75,0 DA:79,1 DA:80,1 DA:81,1 DA:82,1 DA:83,1 possible values are any combinations like DA:108,23 DA:110,101 DA:111,098 DA:112,100 all above should be replaced by 1. so only case it should replace is when there is single digit 0 or single digit 1. so any non-zero number with a comma before should be replaced.

How to change marker size based on the values of multiple columns

Image
I need to do a scatter plot, where the the size of each dot is determined by the quantity of xy . Sample data is Student Performance Data Set: student-mat.csv import pandas as pd import seaborn as sns data =\ {'traveltime': [2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 3, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 3, 2, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 2, 1, 1, 1, 1, 3, 3, 1, 2, 2, 2, 1, 4, 2, 1, 1, 1, 1, 3, 2, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 3, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 4, 2, 1, 2, 1, 1, 2, 2, 1, 1, 3, 1, 2, 2, 1, 1, 2, 3, 2, 1, 1, 1, 2, 3, 1, 2, 1,...

How to visualise a changed pixmap in QIcon without resetting it on the widget?

Now that dark mode has finally come to Windows with Qt 6.5, I noticed that a lot of my icons don't look too well on a dark background. So I'd like to use different icons for light and dark mode. And, to make things difficult, have the icons change (their appearance) when the user switches mode on his OS. In order to avoid having to setIcon() on all kinds of widgets all over the place, I thought I'd subclass QIcon and have it change its pixmap on the colorSchemeChanged signal. class ThemeAwareIcon(QIcon): def __init__(self, dark_pixmap, light_pixmap, *args): super().__init__(*args) self.dark_pm = dark_pixmap self.light_pm = light_pixmap self.app = QApplication.instance() self.app.styleHints().colorSchemeChanged.connect(self.set_appropriate_pixmap) self.set_appropriate_pixmap() def set_appropriate_pixmap(self): current_scheme = self.app.styleHints().colorScheme() pm = self.dark_pm if current_scheme ...

How to activate a setter method without input in the main program code?

I'm working on a program that needs to check if a value is an integer before applying it to an attribute of a class . This must be done in a setter ("set") method . internal class Dummy { private int number; public int Number { get { return number; } set { Console.Write("Input number: "); if (int.TryParse(Console.ReadLine(), out value) == true) { number = value; Console.WriteLine("The number is " + number + "."); } else { Console.WriteLine("That is not a number."); } } } } I tried to make the input in the main program a string (objectName.Number = Console.ReadLine();) instead of an int (objectName.Number = Convert.ToInt32(Console.ReadLine()):), but this obviously gave me an error . I've then tried to just make the input an int, but use a string input when running the program. This would lead to a crash . The only way I could make this work was for the user to enter a "useless...

Bigquery Concurrently Performance

We have data size of around 100GB in BQ , we made the required partition and clustering in our table. So all our queries are simple select only queries with order by clause and having the required partition and cluster filter. We want to maintain high concurrency (around 1000) and latency of under 1 sec, Is big query the right fit for this ? Currently the query performance is good but only their google doc they say 100 limit on concurrent queries ? BI Engine is good fit here ?

Getting undefined (reading 'getLogger') with Msal Provider React TS + Vite

I'm trying to use the ms-identity-javascript-react-tutorial to manage users (sign-in/up). This is guide I'm following https://github.com/Azure-Samples/ms-identity-javascript-react-tutorial/tree/main/3-Authorization-II/1-call-api/SPA but I think since I'm using TypeScript theres some package or something that I'm doing wrong to not initialize the "intance" correctly because it's not getting the func getLogger. My AuthConfig is: /* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { LogLevel } from "@azure/msal-browser"; /** * Configuration object to be passed to MSAL instance on creation. * For a full list of MSAL.js configuration parameters, visit: * https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/configuration.md */ export const msalConfig = { auth: { clientId: "Enter_the_Application_Id_Here", // This is the O...

Address of a structure variable (in C)

When I declare a structure below struct { int a; int b; } x; &x is the address of the structure, right? But as far as I'm concerned, a structure is a collection of data, so I don't really understand what specific address &x points to. When you have an array, let's say, char a[] = "This is a test"; *a points to the first element of the array a[] , which is a[0] . What about the case above?

Spring - rest template authenticate each request with a custom jwt

I have a spring boot app where I need to query an external api which is protected by the bearer token. First i need to query the auth api for the jwt token like POST https://some-external-api.com/api/auth/signin { "username": "MyApp", "password": "PASSWORD" } I receive a response like: { "access_token": "eyJ....", "token": "eyJ....", "validFrom": "2023-04-21T09:16:50.000Z", "validTo": "2023-04-28T09:16:50.000Z", "tokenType": "bearer", "expires": "2023-04-28T09:16:50.000Z", "token_type": "bearer" } where token and access_token fields contain the same jwt token with a payload that looks like { "unique_name": "MyApp", "role": [ "Reader", "MyApp" ], "nbf": 1682068610, "exp": 16826734...

Am I creating a memory leak and how to fix it

I am asking because I am creating an initialArray, but then I point it to a new array without freeing the initially allocated space. I tried to do free(initialArray) before pointing it to my newArray, so I will free up the previously used array - it'll be like: free(initialArray); initialArray = newArray; but I am getting a core dump. any help? #include <stdio.h> #include <stdlib.h> #define ENLARGE_SIZE(x, y) x += y #define SIZE_INCREMENT 10 int *get_set(); int main() { int i = 0; int *set = get_set(); printf("Array elements:\n"); while (*(set + i) != '\0') { printf("%d,%d\n", *(set + i), i); i++; } free(set); return 1; } int *get_set() { int *initialArray = malloc(sizeof(int) * SIZE_INCREMENT); int arraySize = 5; int arrayElementCount = 0; int scannedInt; int i = 0; while (scanf("%d", &scannedInt) != EOF) { printf("Scanned %d\n", scann...

Remove blank line when displaying MultiIndex Python dataframe

Image
I have a MultiIndex Python Dataframe displaying like this: What can I do to pull up the index names ("index1", "index2") and delete the empty row above the dataframe values to get a view like this? The goal is to export the dataframe in png. Here is the code that generates the first dataframe: import pandas as pd import numpy as np style_valeurs = {"background-color" : "white", "color" : "black", "border-color" : "black", "border-style" : "solid", "border-width" : "1px"} style_col = [{"selector": "thead", "props": "background-color:yellow; color :black; border:3px black;border-style: solid; border-width: 1px" },{ 'selector':"th:not(.index_name)", 'props':"background-color: yellow; border-color: black;border-style: solid ;border-width: 1px; tex...

Android TTS (Text-To-Speech) doesn't pronounce isolated word correctly

The TTS pronounces "az-zumaru" instead of "az-zumar" when passed the following Arabic word (title of a Sura): ٱلزُّÙ…َر Any suggestions what to do to produce the correct speech? Is there some unicode character that will tell the TTS engine that "no Tanween is needed here" (for example)? My guess is it is adding a tanween when it should not, but I'm not sure as I'm not an expert in this area. I've tried different spellings (without diacritics) from https://en.wikipedia.org/wiki/Az-Zumar but it seems to pronounce it with a trailing "u" sound in all cases. If part of a longer sentence, the word appears to be pronounced correctly. I've also tried different android voices (e.g., ar-xa-x-arz-local, ar-xa-x-arc-local, etc.) and they all seem to add a trailing sound for single words.

PCI Bios 2.1 Question - How to set device interrupt

I am in hopes someone with PCI programming experience would lend me some advice. I own a piece of test equipment (Logic Analyzer) which uses an old Pentium class (circa '97) motherboard running Win98 This motherboard appears to be 'hard-configured' such that configuration through the bios is limited. There are only a couple of PCI devices which are embedded on the motherboard. However, there is an unpopulated PCI slot that I am attempting to get up and running. I managed to solder in a PCI connector and soldered several jumpers so that the slot is working fine from a hardware standpoint. I've installed a PCI LAN board which the system recognizes and allocates resources. The problem is the BIOS is not assigning an interrupt. One of the limitations of the BIOS configuration is that there is no way to assign interrupts and the BIOS is not doing that automatically. A BIOS update is not happening. My idea as to a solution was to write a small application that will write to...

Trying to pull in a folder inside /opt/lampp/htdocs: Permission denied (publickey). fatal: Could not read from remote repository

Im trying to pull my github project in my folder which is inside in htdocs. It doesnt matter what i do, it always throw the same error and i cant clone or pull from a remote repository. The error i got is this: "git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. " i've tried to make a new ssh key with rsa and added with the following command: ssh-add ~/.ssh/id_rsa Also, added it to my ssh keys in github. Addtionaly, i used the next command: ssh -T git@github.com to check if im using the correct keys. The result of the last command above was: "Hi alfito69420! You've successfully authenticated, but GitHub does not provide shell access." Finally, i tried to clone via http and the result was the same, i got the same error "Permission denied (publickey)...". However, it still throwing the same error and i dont know what else c...

clang-16: error: no such file or directory: 'Welcome'

Compilation of some R packages with R CMD build or install runs into a common clang error as follows; clang-16: error: no such file or directory: 'Welcome' clang-16: error: no such file or directory: 'at' clang-16: error: no such file or directory: 'Thu' clang-16: error: no such file or directory: 'Apr' clang-16: error: no such file or directory: '20' clang-16: error: no such file or directory: '19:30:11' clang-16: error: no such file or directory: '2023' A line, Welcome at Thu Apr 20 19:30:06 2023 appears at the very begging of R CMD build or install output as follows; R CMD build dada2 Welcome at Thu Apr 20 19:30:06 2023 * checking for file ‘dada2/DESCRIPTION’ ... OK * preparing ‘dada2’: * checking DESCRIPTION meta-information ... OK * cleaning src * installing the package to build vignettes ----------------------------------- Welcome at Thu Apr 20 19:30:07 2023 * installing *source* package ‘dada2’ ... ** using stag...

How to implement own format to replace UnityFS .bundle?

I'm using Addressables to build assets. This process creates bunch of .bundle files (in UnityFS format). I would like to create my own asset bundle format (e.g. IPFS's .car ). Is there any class that I can implement to override the default Unity's archive format which can be used for specific Addressables Group?

Range.find is not finding date from Date object

I have created a script in excel (typescript) that works all fine locally but when I run it in the Power Automate Cloud I receive the following error: Cannot read property 'getOffsetRange' of undefined clientRequestId . The purpose of the script is to find, in a table with dates, the date corresponding to the first day of the current month and write in the cell next to it. function main(workbook: ExcelScript.Workbook) { // Get the active worksheet. let sheet = workbook.getWorksheet("Blad1"); let escp_tab = sheet.getTable("table_name"); // takes the day of today let date = new Date(); // get the first day of the month let firstDay = new Date(date.getFullYear(), date.getMonth(), 1); // format the date in DD/MM/YYYY and makes it a string const formattedDate = firstDay.toLocaleDateString('en-GB', { day: 'numeric', month: 'numeric', year: 'numeric' }).replace(/ /g, '/'); ...

Run lapply with lmer function on list of list

I am struggling with launching the lmer function on a data set comprising a list of lists. I have tried converting the list as a data frame too, but it returns an error lapply(list, function(x) lapply(x, function(x) as.data.frame(x))) lapply(list, function(x) lapply(x, function(x) lmer(x[,4:7] ~ var + (1| id), x))) Error in model.frame.default(data = x, drop.unused.levels = TRUE, formula = x[, : not valid type (list) for the variable 'x' Can anyone suggest something for running lmer through lapply ? reprex library(tidyverse) library(readxl) require(writexl) write_xlsx(mtcars, 'PQ_ele_com.xlsx') dir = c('com', 'set', 'rit') init = c('PQ', 'MG') inpst = c('_ele_', '_mel_', '_col_') for (i in dir) { for (j in init) { for (k in inpst){ write_xlsx(mtcars, paste0(j, k, i, '.xlsx')) } } } files = list.files(recursive= FALSE, full.names=...

Auth0 Python quickstart - validation of signature in ID token

I'm building a Python Flask app with Auth0 as my OpenID Connect provider. The Auth0 website provides some skeleton code , which I'm using as the starting point for my app. The skeleton code works and is easily extensible; however, there are some ambiguities as to what the code is doing and why the behaviour adheres to modern security standards. I can't afford to be less than 100% confident when it comes to security, so I would like to run these ambiguities past the experts here at StackOverflow. My understanding of the skeleton code The following is the sequence of events that occur when a user interacts with this skeleton app. (See below for the code.) The user opens http://localhost:3000/ in the browser. This invokes the home endpoint in the Flask app. At this point in time, the user does not have a session cookie, so the response is some HTML containing the words "Hello guest" and a login button. The user clicks on the login button, which is a link to ht...

SpringBoot: JWT Error (Failed to authenticate since the JWT was invalid)

I've been following this tutorial to create a YouTube Clone using Angular+SpringBoot: https://www.youtube.com/watch?v=DW1nQ4o3sCI&t=15427s What i'm trying to do right is now is to create a user registration endpoint using OAuth, so i can write the user information on my database. However, i'm having some issues with JWT. Whenever i try to access the endpoint (localhost:8080/api/user/register) i do receive the following error on my console: [nio-8080-exec-3] o.s.s.o.s.r.a.JwtAuthenticationProvider : Failed to authenticate since the JWT was invalid Setting some breakpoints and debuggging the application, on SecurityConfig.java the JWT is okay (it returns a valid object). However, when trying to call the endpoint using postman and sending my token as a Bearer token, i do receive the error i sent above. And i can't even debug the UserController ; even setting the breakpoints, when i call the endpoint i don't know what happens but i just receive the error. The ...