on-internet

"Returned" Chinese Visa Application. Which Option to Do?

Applied via VFS Dubai – Visa Returned Despite VIP & Express Service – Confused About Reapplying Process (Need Advice) I recently applied for a Chinese visa through VFS in Dubai. I opted for the VIP package and chose express processing to speed things up. Everything seemed in order — until an issue came up with the “Passport Country” field on my Canton Fair invitation. Apparently, due to a glitch in the Canton Fair invitation system — likely caused by the unusually long company address of my Dubai employer — the country field didn’t appear correctly. At the visa center, the agent asked if I had

Join the discussion →

AnyLogic simulation crash on multiple replication

My model contains GIS map, routes, multiple process flow, etc. There are 110 facilities and 20360 demand points. It captures travel time, queue times, service times, utilization, etc. Model runs fine in regular simulation environment. I designed an experiment for 30 replications. In each replication, it stores each facility and demand's info, thus makes the output file quite big. The experiment runs fine for 1 or 2 replication, But even when put 5 replications at a time, it hanged or crashed. Sometimes it says out of memory. I thought huge output file for multiple replication creates problem.

Join the discussion →

Why does the SEC EDGAR API throw an error about an undeclared automated tool when I connect?

I am attempting to retrieve SEC filings from sec.gov using their API with Python 3, and getting this error no matter what I do: Error: Request Rate Threshold Exceeded - Your Request Originates from an Undeclared Automated Tool Following the example provided here, including headers: https://www.sec.gov/about/webmaster-frequently-asked-questions#code-support def get01(): myHeaders = { "User-Agent": "Example_Company [email protected]", "Accept-Encoding": "gzip, deflate", "Host": "www.sec.gov" } url = "https://www.sec.gov/Archives/edgar/data/2062466/000206246625000004/wk-form4_1743625808.xml" resp

Join the discussion →

Error: Request Rate Threshold Exceeded - Your Request Originates from an Undeclared Automated Tool

I am attempting to retrieve SEC filings from sec.gov using their API with Python 3, and getting this error no matter what I do: Error: Request Rate Threshold Exceeded - Your Request Originates from an Undeclared Automated Tool Following the example provided here, including headers: https://www.sec.gov/about/webmaster-frequently-asked-questions#code-support def get01(): myHeaders = { "User-Agent": "Example_Company [email protected]", "Accept-Encoding": "gzip, deflate", "Host": "www.sec.gov" } url = "https://www.sec.gov/Archives/edgar/data/2062466/000206246625000004/wk-form4_1743625808.xml" resp

Join the discussion →

Search highlights don't match the expected word. How can I fix the highlight accuracy?

I'm using PDF.js to render a PDF document from a URL in React. The PDF loads fine, but I'm facing an issue with search: When using the PDFFindController to highlight search terms, the highlights don't align correctly with the actual text—they're often offset or covering incorrect words. What I’ve tried: Adjusting currentScaleValue Tweaking textLayerMode (currently using scale) Confirmed the PDF itself is fine (rendered correctly elsewhere) useEffect(() => { const loadPDFViewer = async () => { try { const { PDFViewer, PDFLinkService, PDFFindController, EventBus } = await import('pdfjs-dist/web/

Join the discussion →

How does Python represent slices in various cases?

Consider l = [1, 2, 3, 4, 5] print(l is l[:]) t = (1, 2, 3, 4, 5) print(t is t[:]) print(t[1:] is t[1:]) print('aa'[1:] is 'aa'[1:]) print('aaa'[1:] is 'aaa'[1:]) The result is, somewhat surprisingly, False, True, False, True, False. Additionally, if I create objects of types list, tuple and str with large lengths and then create large numbers of slices [1:] of each, only with str is it efficient in terms of time and memory, even though tuples are also immutable and could, just like strings, be represented without copying the range specified by a slice, just by indexing into the contiguous mem

Join the discussion →

Exactly why does this work this way? (null coalescing operator precedence) [duplicate]

The null coalescence operator has a precedent that is different from most other comparators in PHP: Example 1: (Incorrect) $var['x'] = "5"; if ((int)$var['x']??0 < 1 ) { print "less than 1"; /* Outputs this */ } else { print "more than 1"; } This will result in "less" because the comparison seems to be between $var['x'] vs 0<1 but surely that would be $var['x']??(false) which still doesn't seem to me to warrant that if being true. Example 2: (Incorrect) $var['x'] = "5"; if ($var['x']??5 < 1 ) { print "less than 1"; /* Still outputs this */ } else { print "more than 1"; } I do understand the ex

Join the discussion →

Audio delay after resuming screen recording with FFmpeg on Windows

In my screen recording software for Windows using Python I use FFmpeg for recording and psutil to pause and resume the process: import psutil import subprocess process = subprocess.Popen([ 'ffmpeg', '-y', '-rtbufsize', '100M', '-f', 'gdigrab', '-thread_queue_size', '1024', '-probesize', '50M', '-r', '24', '-draw_mouse', '1', '-video_size', '1920x1080', '-i', 'desktop', '-f', 'dshow', '-channel_layout', 'stereo', '-thread_queue_size', '1024', '-i', 'audio=Microphone (2- High Definition Audio Device)', # my audio device '-c:v', 'h264_nvenc', # encoding via Nvidia '-r', '24', '-preset', 'p1', '-p

Join the discussion →

Audio delay after resuming FFmpeg on Windows

I'm building a screen recording software for Windows using Python. I use FFmpeg for recording and psutil to pause and resume the process. Here is a sample of my code: import psutil import subprocess process = subprocess.Popen([ 'ffmpeg', '-y', '-rtbufsize', '100M', '-f', 'gdigrab', '-thread_queue_size', '1024', '-probesize', '50M', '-r', '24', '-draw_mouse', '1', '-video_size', '1920x1080', '-i', 'desktop', '-f', 'dshow', '-channel_layout', 'stereo', '-thread_queue_size', '1024', '-i', 'audio=Microphone (2- High Definition Audio Device)', # my audio device '-c:v', 'h264_nvenc', # encoding via

Join the discussion →

gconf are not setting properly in Yaws

I am only using Yaws to serve dynamic content via handlers (for example, serving API responses or dynamic pages via Erlang modules). I don't need a document root at all. Here is supervisor where I am initializing Yawsusingyaws_api:embedded_start_conf/1`. I even tried to add the gconfig manually again with yaws_api:setconf(GlobalConf, [[ServerConf]]) but global config are not set. %%%------------------------------------------------------------------- %% @doc myapp top level supervisor. %% @end %%%------------------------------------------------------------------- -module(myapp_sup). -behaviour(

Join the discussion →

Picking out file names from grep results where file name contains numbers and hyphens

I have a script that runs a grep command and formats the results nicely for me, asking if I want to open any of the resulting files in an editor etc. The core of my script is a command like this: grep -HinER -B 0 -A 2 --include "*.txt" "eight" /tmp/searchTest/letters | sed -re "s/:([0-9]+:)/\n\1/" -e "s/-([0-9]+-)/\n\1/" -e "s/^[.]/\\n./" It runs the grep, outputting the file name on every line and then runs some processing to put the file names on a different line from the results. > grep -HinER -B 0 -A 2 --include "*.txt" "eight" /tmp/searchTest/letters | sed -re "s/:([0-9]+:)/\n\1/" -e "s/-

Join the discussion →

Problem with: react.production.min.js:20 Uncaught TypeError: Cannot set properties of undefined (setting 'Children')

After building the react application with vite.js, I get this error when I access the application's home page: react.production.min.js:20 Uncaught TypeError: Cannot set properties of undefined (setting 'Children') at requireReact_production_min (react.production.min.js:20:1) at requireReact (index.js:4:20) at requireUseSyncExternalStoreWithSelector_production (use-sync-external-st…production.js:12:13) at requireWithSelector (with-selector.js:4:20) at with-selector.js:7:1. When I open the application in development, the error is not present in production mode, it is present. Have you ever encou

Join the discussion →

With CASL ABAC, is it able to parse Bigint?

The object being passed as a subject is below: permissions.can("read", subject("appprofile", profile))) The profile being checked looks like this: { name: "Dave", id: 1n, <--- the bigint from Prisma } the JSON being used in createMongoAbility is like this: [ { action: "read", subject: "appprofile", conditions: { id: "1", }, } ] ... but the check fails. I'm assuming its a bigint parsing issue in CASL or am I on the wrong track?

Join the discussion →

Postgres: JSON to bytea?

I found similar questions but unanswered or didn't work for me. I am building a json object with json_build_object and I have to store the object into a column with type bytea. Using Postgres 14. Thanks in advance.

Join the discussion →

Vite is not creating CSS source maps

I am new to Vite. I need to generate CSS sourcemap files. From what I have read in the Vite documentation, Vite itself is able to generate sourcemap files, without needing gulp task or whatever. I have my vite.config.js at the root because I need to watch files in different folders, but right now I am just working with the "theme" folder. My vite.config.js file: import { defineConfig } from "vite"; import path from "path"; export default defineConfig(async () => { const glob = (await import("glob")).glob; // Define themes and their SCSS paths const themes = ["theme_one", "theme_two"]; const sc

Join the discussion →

How can I handle GraphQL error status codes and pass them from the backend to the frontend in an Express app?

I am building a full-stack application using React on the frontend and Express with GraphQL on the backend. I need to handle errors in my GraphQL mutation and pass the appropriate status codes (like 409 for conflicts, 422 for validation errors, etc.) from the backend to the frontend. However, when an error occurs in the GraphQL mutation, I am unable to pass the correct HTTP status code to the frontend. Here's what I have so far: Backend (Express + GraphQL) I am using graphql-http to set up the GraphQL handler in my Express app, and I use formatError to catch GraphQL errors. Here’s how I set up

Join the discussion →

How to get a transparent background for a wordcloud in MATLAB?

I am unable to get a transparent background with this MWE (there are no errors). The procedure works fine for other types of MATLAB plotting functions. fileName = 'C-13.tex'; % Input file name text = ' this this this a is a test'; text = lower(text); words = split(text); [uniqueWords, ~, idx] = unique(words); wordCounts = accumarray(idx, 1); wordTable = table(uniqueWords, wordCounts, 'VariableNames', {'Word', 'Frequency'}); wordTable = sortrows(wordTable, 'Frequency', 'descend'); topWordCount = 75; % Keep top 75 words wordTable = wordTable(1:min(topWordCount, height(wordTable)), :); hf = figur

Join the discussion →

Extract UUencoded images from SEC EDGAR submissions

I am trying to automate the extraction of various files from SEC full text submissions on EDGAR (public company regulatory filings). With python, I can separate the various files, demarcated by DOCUMENT tags, easily enough. But I have been unable to convert and save the encoded images as jpg files. Best I can tell from SEC (https://www.sec.gov/files/edgar/pds_dissemination_spec.pdf#page=11), they're UUencoded. I've tried uu (which apparently is going away soon) and base64, and pasted it into some decoder websites, but I get errors in every case. Example full text submission: https://www.sec.go

Join the discussion →

Live activities are being registered but not appearing

Context I'm building an iOS app in which I register a live activity in a view model: @Observable class LiveActivityViewModel { private var activity: Activity<LiveActivityTimerAttributes>? // more properties func startActivity() { // .... (define some vars) // Create attributes let attributes = LiveActivityTimerAttributes() // Create initial state let state = LiveActivityTimerAttributes.ContentState( duration: offlineViewModel.state.durationSeconds, //defined earlier startDate: startDate, // defined earlier peopleOffline: offlineCountViewModel?.count ?? 0 // defined earlier ) let content = Acti

Join the discussion →

How to create multiple files with different names and content using a comma-separated list without loops?

I have a comma-separated list of file names, and I want to create multiple text files in MySQL. Each file should contain some static text. For example, if my input is: 'file1,file2,file3,file4' I want to generate: /var/www/output/file1.txt containing "SomeContent" /var/www/output/file2.txt containing "SomeContent" /var/www/output/file3.txt containing "SomeContent" /var/www/output/file4.txt containing "SomeContent" I want to achieve this without using loops. I tried using SELECT INTO OUTFILE like this: SELECT "SomeContent" INTO OUTFILE "/var/www/output/file1.txt"; SELECT "SomeContent" INTO OUTF

Join the discussion →

Troubleshoot Chromadb configuration with semantic kernel and Docker Compose

I have semantic kernel Open AI configuration that uses chromadb. // Initialization var collectionName = "mydataMemory"; await chromaClient.CreateCollectionAsync(collectionName, cancellationToken); // Save records var chromaMemoryStore = new ChromaMemoryStore(chromaClient); var memory = new SemanticTextMemory(chromaMemoryStore, textEmbeddingGenerationService); await memory.SaveInformationAsync(collectionName, text, id, description, metadata, cancellationToken: cancellationToken); `metadata` and `description` are always empty for now. Locally when I spawn chromadb in this way: chroma run --host

Join the discussion →

how to make a topoplot in R with coordinates variable distribution

I would like to adapt the example I have found in this page and readapt it to my data in order to get the final topoplot realized with ggplot2 topoplot in ggplot2 – 2D visualisation of e.g. EEG data Unfortunately it seems I having some problem with the interpolation system. Indeed when I try to plot the coordinates, they have spatial distribution very different from what they are supposed to be (my case is on the right and there is a different scale too) This creates a problem to make work the interpolation example posted there. I tried to find some workaround and I used a different system wit

Join the discussion →

Collect Google Play Reviews in Multiple Countries

I am trying to collect Google Play reviews on certain apps in English-speaking countries using google-play-scraper. The problem was that when I changed the 'country' parameter, it returned the same result for all countries. from google_play_scraper import reviews, Sort import pandas as pd import time # List of countries to collect reviews from. # Note: Due to Google Play's regional limitations, some countries may not have available review data. countries = ['us', 'gb', 'ca', 'au', 'in', 'sg', 'nz', 'za', 'ie', 'pk'] # TikTok's Google Play package name app_id = 'com.zhiliaoapp.musically' all_re

Join the discussion →

Material handling elevators in Anylogic

I am new to Anylogic and I am dealing with a material handling problem. I need an elevator module to transfer materials. It needs to have opening and closing time. And other transporters like forklifts or wheelbarrows are not allowed to be on the elevator. It only transports materials. Since lift module in Anylogic don't have these two features, are there any solutions to build one or any similar open-source models can be recommended? I have tried the lift module in material handling library in Anylogic, but it can't meet my requirements.

Join the discussion →

How to change where OLLAMA models are saved on linux

As far as I understood from https://klu.ai/glossary/ollama, when we download a model through OLLAMA, Ollama models are stored in the ~/.ollama/models directory. Is there a way to change this default directory, and make OLLAMA read from another directory like ~/projects/foo/modelX/? Or can we make the OLLAMA download the model to this directory in the first place? Thanks!

Join the discussion →

Execution failed for task ':react-native-screens:configureCMakeDebug'

Body: I'm getting this error while building my React Native project in Android Studio: Execution failed for task ':react-native-screens:configureCMakeDebug[arm64-v8a]'. > [CXX1300] CMake '3.22.1' was not found in SDK, PATH, or by cmake.dir property. I've already installed CMake from SDK Manager but the issue persists. How can I fix this? Installed CMake from SDK Manager (Tools > SDK Manager > SDK Tools > CMake). Ran ./gradlew clean and rebuilt the project. Checked Android Studio settings (File > Settings > Build, Execution, Deployment > CMake) and set the correct CMake path. I expected the bui

Join the discussion →

Docker compose bind mount with colon and comma in path

I have mounted my google drive folder in Ubuntu using gnome-online-accounts, which ends up being mounted like so: /run/user/1000/gvfs/google-drive:host=my_host.com,user=my.username Mounting this in a docker container works fine if I escape it correctly, i.e.: --mount "type=bind,\"source=/run/user/1000/gvfs/google-drive:host=my_host.com,user=my.username/\",target=/data/gdrive" If I try to do the same with docker compose, however, it breaks: # docker-compose.yml services: myservice: build: context: . dockerfile: Dockerfile volumes: - type: bind source: "\"/run/user/1000/gvfs/google-drive:host=my

Join the discussion →

Order WooCommerce [products] shortcode results by brand

I'm using the following shortcode to populate all products with sale prices: [products on_sale="true" columns="6" rows="7" title="Check our Products on Sale!"] Is there a way I can use an order or orderby parameter to arrange the products by their brands? By default, they're grouped by product title, but it looks messy.

Join the discussion →

How to prevent the AbortError: signal is aborted without reason

I am getting a AbortError: signal is aborted without reason. In the past I believe I was able to call abort on the signal even after fetch returned but now I'm getting this error. Maybe it is because I'm calling it twice? Is there a way to prevent this error? I've checked if signal.aborted is true but that would be checking if it was aborted not if the request was completed. Is there a property with the controller or signal that I can use to check if the fetch is done or can I simply catch the error (since it seems like it's more of a warning) and discard it? class MyClass { async send(url) {

Join the discussion →

Sending alpine.js data via htmx hx-vals as a json

My goal is to be able to serialize alpine variables into JSON and send those JSONs to my backend via htmx. This would be way more convenient then sending disparate form input values and random hx-vals. Essentially I want to use an alpine.js object that I already have and pass it into htmx-vals. This seems like a very easy premise but is proving impossible to me thus far. Right now here's the code that I'm testing: <div id="test_div" x-data="{ testTest: [1,2,3] }"> <button hx-post="/test_handle" hx-ext="json-enc" hx-vals="js:{'data': JSON.stringify(testTest)}"> Submit </button> </div> Obviously

Join the discussion →
Older stories