I have two comma delimited strings containing embeddings. Each index should be able to fit into a float and they are 128 elements long. I am following this linear algebra intro in the ojAlgo library. I'd like to convert the two strings to ojAlgo matrices, normalize them, and then compute their cosine similarity. I am testing with a single matrix first - I expect when I compute its cosine similarity it should be 1.0. PhysicalStore.Factory<Double, Primitive32Store> storeFactory = Primitive32Store.FACTORY; String dummyMatrixValues = "0.47058824,0.5647059,0.54901963,0.54509807,0.54901963"; Primiti
Since win11 recently (in 23H2) added native support for rar/7zip/etc. is there any API to use those from c++ ? (Or it's just explorer thingy, that cannot be used by app) I need this for demoscene related purposes.
I installed on VSCode (Version: 1.85.0 - MacOS Ventura) the Oracle Java Platform Extension for Visual Studio Code and following the instructions I added to settings.json "jdk.jdkhome": "/Library/Java/JavaVirtualMachines/zulu-11.jdk/Contents" (using the provided JDK downloader) and "jdk.userdir": "global" then I restarted VSCode and tried the Java: New Project command. I am getting in the Output the following: Initiating server activation Request to kill LSP server. Cannot kill: current process is None Launching Oracle Java SE Language Server with /Library/Java/JavaVirtualMachines/zulu-11.jdk/C
I have a working ssh key and when I try to connect Dataform to Github with it, I get the error "We are unable to connect to your Git provider with the configured credentials". There's no other information about the error. If there is, I'm not sure where to look. What I've done so far: Created a secret in GCP with the file selection left empty, and set the secret value as the private ssh key like the following: -----BEGIN OPENSSH PRIVATE KEY----- private_key -----END OPENSSH PRIVATE KEY----- Bound the secret to Dataform repository, and set the "Host public key" value as the following: ssh-ed255
I am using Valrgind-Massif to monitor memory allocation in my program. The default output of Massif contains all allocations throughout the program. However, I would like to only inspect memory allocation in one specific function. How can I do that?
I've been recently doing a collection of lookups of indices that satisfy a given criterion as follows, some_vector.partition_point(|x| x < &el) In a loop that does millions of lookups for el in elements { let iloc = some_vector.partition_point(|x| x < &el); some_other_vec.push(iloc); } This works rather fine, however, it seems there might be a faster way to perform the iloc lookups still. What am I missing here? The some_vector is ordered. Note: using the partition point to find the amount of elements that satisfy a given criterion (= what is the bin that holds a given float el) - there might
After major updates, I started encountering the following errors in my application: Uncaught Error: Minified React error #418; visit https://reactjs.org/docs/error- decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings. Uncaught Error: Minified React error #423; visit https://reactjs.org/docs/error- decoder.html?invariant=423 for the full message or use the non-minified dev environment for full errors and additional helpful warnings. These errors don't specify the exact component or code causing the issue, and I'
I am experiencing a very funny bug in Django. I have gone every way possible including resetting migrations. I have written a pytest for a Django project however the above error occurs when running. Accounts model class Account(AbstractBaseUser): email = models.EmailField(unique=True, verbose_name='email', max_length=255) phone = models.CharField(max_length=100, verbose_name='phone') first_name = models.CharField(max_length=100) last_name = models.CharField(max_length=100) id_number = models.CharField(max_length=100) role = models.CharField(max_length=100) date_joined = models.DateTimeField(au
Python 3.12 has the type statement. How do I document the type alias properly? I tried: type Number = int | float """Represents a scalar number that is either an integer or float""" But this doesn't seem to associate the docstring with the alias. I tried putting the docstring after the = and before the alias definition, but that generated an error.
i am unable to render my React website after deploying and publishing code via github and/or netlify. It gives me a blank page instead of rendering my website. I have referred to existing answers and tried many possible solutions but it still doesn't work any help will be highly appreciated. I am trying to access my website via index.html in root folder, however, instead of url accessing my main.jsx through index.html, it is simply rendering my index.html in root. The website is published here: https://mustafafarooqusman.github.io/Murtazaportfolio-main/ (showing a blank page) My repository is
I'm building a multi tenancy app with django-tenants and want to run my REST API in the same project as django-tenants. But if I make my API a shared tenants app, every tenant subdomain ends up having their own API. For example, all registered tenants adopt the API routes as part of their subdomain (tenant1.example.com/api, tenant2.example.com/api, etc.). I don't want my API to be underneath each tenant, I want to run it on one domain, preferably api.example.com. How do I set this up?
I am trying to fill null values in a numeric table using duckdb. Let's consider the simple table df: x y 0 2.0 1 NULL 3 NULL 5 7.0 6 4.0 8 5.0 9 NULL that you can create with CREATE TABLE df (x NUMERIC, y NUMERIC) INSERT INTO df VALUES (0, 2), (1, NULL), (3, NULL), (5, 7), (6, 4), (8, 5), (9, NULL) then i would like to create a SELECT statement to retrieve: x y 0 2.0 1 3.0 3 5.0 5 7.0 6 4.0 8 5.0 9 NULL I think that a correlated subquery which finds the following and previous non-null values and then computes the interpolation should work: SELECT x, COALESCE( y, ( SELECT prev.y + ( (next.y - p
My sister and I applied for a 30-day tourism visa for UAE. When we finally got the visas, our photos were mixed up (my photo is on my sister's visa and my sister's photo is on mine). All other information is correct and the passport numbers are correct. Will there be any issue? We will be leaving together at the same time.
So I wanted to add tests to my CLI app, but I am struggling to replace my db with a temporary one. So far I have used SQLModel for database access, but for the app testing I want to assert the db values using raw SQL statements. However, I get a connection error when trying to access my temporary DB. sqlite3.OperationalError: unable to open database file My plan so far is the following: In my test file I replace the sqlite uri with one directing it to a sqlite db in a temporary dictionary (using pytest tmp_path). My assumption was, that if I create that DB with SQLModel, I'd be able to access
Every time, after a pull, I run. git init git pull npm i or npm install In the first time all pages working as I wish. But when changing from one page to another in localhost - I get this error: missing required error components, refreshing... In my console, I have something like that: ⨯ Error: ENOENT: no such file or directory, open '/Users/jonasoliveira/Documents/Documentos - MacBook Pro de Jonas/next/sala-two/.next/server/pages/api/external/news-api.js' at Object.readFileUtf8 (/Users/jonasoliveira/.vscode/extensions/wallabyjs.console-ninja-1.0.266/out/buildHook/index.js:1144:66509) at Objec
I deployed a PostgreSQL instance in k8s with a master pod and a single replica pod. I want to know how can I perform read queries on the read replica and write queries on the master? Currently, all the requests I send to the DB are served by the master (after connecting to the master). Do I need to explicitly connect to the read replica for queries to go there or is there some mechanism in Postgres which can route traffic to the read replica?
I am using swagger_dart_code_generator for my Flutter app to generate code based on an openapi.json. It does its job for application/json requests, however it does not work with multipart/form-data. I am sure that the api works, I tried it from the swagger web ui. In case it helps, here are the relevant parts of the openapi.json: "post": { "operationId": "ImageListApiView_post_images_post", "requestBody": { "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/ImageMetaForm" } } }, "required": true }, /* ... */ }, "ImageMetaForm": { "properties": { "file": { "descript
This code is used to simulate the virus spread in the network of 20 computers with the probability of 0.1 ~ 10%. It initially starts with only 1 computer being infected and each day has a chance that it spreads to other computers in the network. The output for each trial should be: time to remove the virus from the network, probability that each computer gets infected at least once, and the expected number of computers that get infected each trial. Logically each trial should have a random for each of the outputs listed. My problem is that each trial produces the same output, and I don't under
I'm trying to run jaeger and an OTEL collector as docker containers. Unfortunately I run into the following error message: otel-collector | Error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding: error decoding 'exporters': unknown type: "jaeger" for id: "jaeger" (valid values: [logging otlp otlphttp file kafka prometheus debug opencensus prometheusremotewrite zipkin]) My docker compose file looks as follows: version: '3' services: otel-collector: container_name: otel-collector image: otel/opentelemetry-collector command: ["--config=/etc/otel-collector-config.yaml
Since the react hook form provider is based on context Api, for large nested forms it can cause performance issues due to multiple re-renders during state updates. I came across this section in the documentation: https://react-hook-form.com/advanced-usage#FormProviderPerformance, which basically uses react memo to stop additional re-renders unless the property isDirty changes. I added the above implementation to my code and it has helped speed up the form performance a little but I now realize that my validations are not working since my memo does not check for updates to the formState. https:
Let's say I have a dataframe that has a column named mean that I want to use as an input to a random number generator. Coming from R, this is relatively easy to do in a pipeline: library(dplyr) tibble(alpha = rnorm(1000), beta = rnorm(1000)) %>% mutate(mean = alpha + beta) %>% bind_cols(random_output = rnorm(n = nrow(.), mean = .$mean, sd = 1)) #> # A tibble: 1,000 × 4 #> alpha beta mean random_output #> <dbl> <dbl> <dbl> <dbl> #> 1 0.231 -0.243 -0.0125 0.551 #> 2 0.213 0.647 0.861 0.668 #> 3 0.824 -0.353 0.471 0.852 #> 4 0.665 -0.916 -0.252 -1.81 #> 5 -0.850 0.384 -0.465 -3.90 #> 6 0.721 0.67
I am trying to use foreach in SystemVerilog. What I am doing wrong here? `define size 3:0 //variable module tb; reg [7:0] temp; initial begin temp = 8'd25; $display("%d", temp[`size]); foreach ((temp[`size])[i]) $display("%d", temp[i]); (temp[`size])[i] = 1'b0; end endmodule
I have a large Vec<u8> representing the raw pixel values of a gray image. Since the pixel format is actually 16-bit width, two u8 makes one pixel. Now I'd like to use the image as if it was 8-bit width, so I only take the higher 8-bit part of a pixel. As an instance, given a raw vec v = vec![0,1,2,3,4,5], how can I view it by a step 2 to a reference view : &[u8] (without the need to copy them into a new Vec, for performance), such that view can be used equivalent to &[0,2,4]. Thanks very much.
My website is crawled high frequently. I have robots.txt is below: User-agent: * Allow: .htm$ Disallow: /*?* Disallow: /mls.php?* but 'Googlebot 2' doesn't obey the robots rules. The following is a log snappet: 2023-11-03 06:46:47.856 PDT GET 200 6.62KB 433 ms Googlebot 2 https://vanfangchan.com/mls.php?mls=1355081&lang=zh_s Does my robots.txt is right, and anyone know that 'Googlebot 2' is owned by Google?
I have data in SQL Server and I need to save it in parquet format. Right now I'm using pyodbc and pyarrow libraries for this. As there are serveral million rows, I'm doing it by using queries within a for loop that retrieves chunks of data using a where clause on the SQL server that search for periods in YYYYMM format like 201501, 201502, ..., 202310 and then grouping them together by year and saving it as parquet like example_2023.parquet. The code is: conn = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server};' 'SERVER=SERVER;' 'DATABASE=DATABASE;' 'UID=USER;' 'PWD=PASS') cursor = conn.cu
I am trying to clone a repo from DevOps using Git Bash, with the git clone command I'm getting the error message: fatal: unable to access OpenSSL/3.1.2: error:0A000152:SSL routines::unsafe legacy renegotiation disabled I was trying to clone a DevOps Repo, I was expecting the repo to be cloned on to my local drive so I could make changes
I am encountering an issue in Google Sheets while utilizing the IMPORTRANGE function across two sheets, both of which I am the owner of. Whenever I attempt to import data, I am greeted with the error message: "You don't have permissions to access that spreadsheet." Here's the formula I am using: =importrange("URL_of_the_sheet","A2:A980") I have verified that I am logged into the correct Google account, and have tried refreshing the browser and the sheets, re-adding the IMPORTRANGE formula, and even creating new sheets to test the function. Despite these efforts, the error persists. Is there a
I want to forward messages from other telegram channels to my channel without being an admin of the other channels. This code below does not work because I can't add the bot to other channel. from aiogram import Bot, types, Dispatcher, executor bot = Bot(token='mybottoken') dp = Dispatcher(bot) @dp.message_handler(content_types=types.ContentType.ANY) async def copy_all_messages(message: types.Message): from_chat_id = message.chat.id # the ID of the channel from where messages are copied to_chat_id = '-##############' # the ID of the channel where messages are pasted message_id = message.messag
The problem, the code below is trying to address, is on how to effectively detect that an UTF-8 based locale might be in use so that all code points above 127 are not queried for ctype attributes, as we are dealing with plain (not wide) chars. At least in macOS 14, when using an UTF-8 based locale. the following program will show 2 problematic code points that eventhough are valid for an unsigned char, are getting as a response from toupper() values that are not able to fit on that type: #include <langinfo.h> #include <ctype.h> #include <locale.h> #include <stdlib.h> #include <string.h> #inclu