on-internet

How to Resolve "Google hasn’t verified this app" Issue for Firebase Social Login with Google?

I am implementing Google login using Firebase for my web application. I've set up the OAuth consent screen in the Google Developer Console and added the following scopes: /auth/userinfo.email /auth/userinfo.profile openid In developer console, I can see that app is also verified. Please see screenshot Despite this, when users try to log in, they see the following error message: I have completed the initial setup as follows: Created a project in the Google Developer Console. Configured the OAuth consent screen with the necessary information. Added the three scopes mentioned above. Verified my d

Join the discussion →

How can I use key from AndroidKeyStore instead of password to authenticate my SSH client connection?

I am unable to login to server using key authentication from my client Android app. I am able to login to server from my app using password authentication. I am able to login to server using key authentication from other clients on my network. protected String sshConnect() { String stdoutString = null; String alias = "KEYPAIRTEST"; KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); keyStore.load(null); KeyStore.Entry entry = keyStore.getEntry(alias, null); PrivateKey privateKey = ((KeyStore.PrivateKeyEntry) entry).getPrivateKey(); PublicKey publicKey = keyStore.getCertificate(alias).

Join the discussion →

generate and unnest a list column of random values in polars using np.random.binomial()

I am trying to generate arrays of varying length within a polars dataframe (i.e., a list column). For each cluster_id I would like to generate a series of 0s and 1s of length trials, which varies by cluster_id: import numpy as np import polars as pl from polars import col CLUSTERS = 200 MEAN_TRIALS = 20 MU = 0.5 SIGMA = 0.1 df_cluster = pl.DataFrame({'cluster_id': range(1, CLUSTERS+1)}) df_cluster = df_cluster.with_columns( mu = stats.truncnorm(a=0, b=1, loc=MU, scale=SIGMA).rvs(size=CLUSTERS), trials = np.random.poisson(lam=MEAN_TRIALS, size=CLUSTERS) ) I can use np.random.binomial() to gener

Join the discussion →

How to add custom text to orders in admin panel order detail page

I am trying to add a custom row to order table in WooCommerce order page. But the code I have tried is not working. I tried using this woocommerce_admin_order_item_values() hook but it's not working. This is my code add_action('woocommerce_admin_order_item_values', 'replace_quantity_td_content', 99999, 3); function replace_quantity_td_content($product, $item, $item_id) { $quantity = $item->get_quantity(); $meta_data_array = $item->get_meta_data(); foreach ($meta_data_array as $meta) { $meta_value_array = $meta->value; if (isset($meta_value_array['tabNumber'])) { $tab_number = $meta_value_array

Join the discussion →

What do these TORCH_USE_CUDA_DSA and frozen_modules errors mean and how to fix them?

I'm trying to run a Mask R-CNN model with aerial imagery. To optimise this, I run everything with CUDA. But this creates a few errors. Here is my code: # Python import torch import torchvision from torchvision.models.detection import MaskRCNN import gc import torch.nn as nn from torchvision.models.detection.rpn import AnchorGenerator from torch.cuda.amp import GradScaler os.environ["CUDA_LAUNCH_BLOCKING"] = "1" gc.collect() torch.cuda.empty_cache() # Define the model resnet_net = torchvision.models.resnet18(weights=torchvision.models.ResNet18_Weights.DEFAULT) modules = list(resnet_net.children

Join the discussion →

Valgrind massif shows ??? for simple c++ program compiled with -g

I have ran the C example provided in massif docs https://valgrind.org/docs/manual/ms-manual.html and it works as expected. However it shows??? for this simple c++ program. main.cc #include <string> int main() { std::string s{"hi i am a long string do not optimize me"}; } command line g++ -g -std=c++17 -o main main.cc valgrind --tool=massif ./main relevant massif output #----------- snapshot=3 #----------- time=2348873 mem_heap_B=72745 mem_heap_extra_B=23 mem_stacks_B=0 heap_tree=peak n2: 72745 (heap allocation functions) malloc/new/new[], --alloc-fns, etc. n1: 72704 0x4909A69: ??? (in /usr/lib

Join the discussion →

schema.org FAQPage and google

I'd like to add FAQPage json+ld to my website, but i found that the definition for this tag on google examples and schema.org documentation are different: https://developers.google.com/search/docs/appearance/structured-data/faqpage <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{ "@type": "Question", "name": "How to find an apprenticeship?", "acceptedAnswer": { "@type": "Answer", "text": "<p>We provide an official service to search through available apprenticeships. To get started, create an account here, specify the desired region, a

Join the discussion →

[Monitoring and Alerts Configuration for Google reCAPTCHA v3 Enterprise Edition]

I am reaching out for technical assistance regarding our implementation of Google reCAPTCHA v3 Enterprise Edition. We have successfully created keys for our sites and are now looking to set up monitoring for daily API usage. We aim to track and monitor the daily request volumes to the reCAPTCHA service and set up alerts based on certain usage thresholds. Could you provide detailed information on how we can configure these aspects within our management console? Additionally, we would be interested in knowing if there is a specific dashboard or tool that allows us to manage these settings effici

Join the discussion →

LeetCode: Climbing Stairs

I've tried to solve the LeetCode 70.Climbing Stairs. I know, it is same as fibonaci, but I've wanted to try a different solution for this. Here is the problem: You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Example 1: Input: n = 2 Output: 2 Explanation: There are two ways to climb to the top. 1 step + 1 step 2 steps Example 2: Input: n = 3 Output: 3 Explanation: There are three ways to climb to the top. 1 step + 1 step + 1 step 1 step + 2 steps 2 steps + 1 step I used static becau

Join the discussion →

Rust iterator iterate until the first element where the condition is not held

Given a Vec<i32> I'd like to create a Vec<i32> containing all first i32s with a predicate returning true dropping all elements once the first element not satisfying the predicate is encountered. The simple filter implementation as fn first_predicate<F>(vec: Vec<i32>, f: F) -> Vec<i32> where F: FnMut(&i32) -> bool, { vec.into_iter().filter(f).collect() //return all elements satisfying the predicate, not the first group } as it returns all the elements satisfying the predicate. Is there a way to stop iteration once an element not satisfying the predicate is encountered?

Join the discussion →

How can I create a Vec<[f64; 2]> from two Vec of the same length?

If I have two different Vec<f64> of the same length, how can I "zip" them to get a Vec<[f64; 2]> instead of a Vec<(f64, f64)>? Here Is what I have so far: let vec1: Vec<f64> = vec![1.,2.,3.,4.,5.,6.]; let vec2: Vec<f64> = vec![6.,5.,4.,3.,2.,1.]; let zipped_vec: Vec<(&f64, &f64)> = vec1.iter().zip(vec2.iter()).collect::<Vec<_>>(); println!("{:?}", zipped_vec); // Output: [(1.0, 6.0), (2.0, 5.0), (3.0, 4.0), (4.0, 3.0), (5.0, 2.0), (6.0, 1.0)] // If all the data is in a single Vec<f64> I found a way to do it with "chunks_exact" let data = vec![1.,12.,2.,23.,3.,38.,4.,44.,5.,59.,6.,71.]; let gra

Join the discussion →

arma::mat division by const integer causes problems

I have a function I call from R using Rcpp. I pass an argument, which is a const unsigned integer, to this function. The integer is used to scale a matrix consisting of random draws. MWE: Rcpp::cppFunction(' auto testfun(const arma::uword n = 10) { arma::dmat W = floor(arma::randu(35, 35, arma::distr_param(0, 2))); return W / n; } ', depends = "RcppArmadillo", plugins = "cpp17") This MWE makes my R crash. My actual code, on the other hand, works but returns garbage. What am I missing here? It appears that the auto declaration is causing the problems. I don't understand why.

Join the discussion →

Fitting a custom function in MATLAB fails with "Inf computed by model function"

I am trying to fit a set of data in MATLAB with a custom function, which is no more than a Gaussian distribution with an additional x^d term. However, an error is encountered. Despite many efforts, I can't solve this problem. At the very beginning, I fit the following data, "data_x": 0 0.0500000000000000 0.100000000000000 0.150000000000000 0.200000000000000 0.250000000000000 0.300000000000000 0.350000000000000 0.400000000000000 0.450000000000000 0.500000000000000 0.550000000000000 0.600000000000000 0.650000000000000 0.700000000000000 0.750000000000000 0.800000000000000 0.850000000000000 0.9000

Join the discussion →

Kotlin Apollo Client and GraphQL - rename auto-generated classes

we are using the Apollo client to generate our data classes in Kotlin. Our classes, e.g. Car and Person have a property MetaData that looks exactly the same for both classes. The client now generates two classes, MetaData for Car, and MetaData1 for Person. Can I take influence on the naming or even force Car and Person to refer the same MetaData class? Thanks in advance.

Join the discussion →

Capturing sympy math output in sphinx-gallery

I am trying to write an sphinx-gallery example for a module that uses sympy. I cannot find a way to get the output formatted like math. For example, in jupyter notebooks, the output of a sympy expression is rendered in mathmode. In an example rendered with sphinx using sphinx-gallery, just the string is shown. I tried using the functions in sympy.printing.mathml and monkey patching the expressions to show, e.g. #%% # Should show this # # .. math:: # \dot{x} = x y^2 - \frac{\sqrt{x}}{y} # from sympy.printing.mathml import mathml from sympy.core.evalf import EvalfMixin def print_html(expr): retu

Join the discussion →

How to Implementing OTA Update Feature in Flutter Apps Similar to Blinkit

I'm working on a Flutter application and I'm interested in implementing an over-the-air (OTA) update feature similar to the one used in Blinkit. My goal is to allow users to receive and install updates seamlessly without needing to go through the app store. I've researched various resources and documentation related to OTA updates in Flutter, but I'm looking for more specific guidance on how to implement this feature efficiently and securely. Shorebird is also available but it is chargeable looking for free one. Here are some questions I have: What are the best practices for integrating OTA up

Join the discussion →

How can the longest sorted sequence be extracted from a bucket array containing individually sorted buckets without repetitions?

Consider a bucket array containing sorted and/or empty buckets, and the goal is to extract the longest possible sequence in sorted order, under the following conditions: Only one element in each bucket can be used per construction, and the same element cannot be reused if encountered in another bucket. Buckets cannot be rearranged, reordered, or repositioned, and must be treated incidentally in the provided order. Empty buckets can be skipped. This is a problem that was formulated in the middle of solving a different problem with an entirely different objective. I have decided to call this Lon

Join the discussion →

How to measure energy consumption of python code running on CPU?

I want to measure the energy consumption of a python code which is running on a traditional cpu. For example, the code is a = np.random.randn(1000, 1000) b = np.random.randn(1000, 1000) # this is the code I want to measure: c = a @ b I wonder if there is a method that can tell me the duration and energy consumption of c = a @ b, such as duration = 2ms and energy consumption = 1.38mJ. I have tried a tool called pyJoules as below, it says it can measure the energy footprint of python code: from pyJoules.energy_meter import measure_energy import numpy as np x = np.random.randn(1000, 1000) y = np.

Join the discussion →

Simscape begins the simulation outside of the joint limits

I am trying to model a closed kinematic chain in Simulink, and I get problems with having a meaningful initialization. MATLAB ignores the joint limits for some joints. What I have done I imported a URDF (which itself doesn't close the chain) and added a bushing joint to close the chain at the required point. There are 5 links, but only three of them are independent (and actuated), thus I have set a position target for those with high priority (to set the desired initial conditions). In the bushing joint, for all the DOFs I want to constrain, I have set a position target of zero with low priori

Join the discussion →

Is there a way to get the content from Azure Document Intelligence in markdown BUT separated page by page?

This is what I tried. Content is in markdown but I don't have the page by page separation. On the other hand if I go into the pages attribute, there is no markdown. document_intelligence_client = DocumentIntelligenceClient(endpoint=endpoint, credential=AzureKeyCredential(key)) poller = document_intelligence_client.begin_analyze_document( "prebuilt-layout", analyze_request=AnalyzeDocumentRequest(base64_source=doc_bytes), output_content_format=ContentFormat.MARKDOWN ) As mentioned above. I also tried with the "pages" attribute - document_intelligence_client = DocumentIntelligenceClient(endpoint=

Join the discussion →

Why won't this code allow me to hide a pdf file "inside" of a png file using Ruby?

I'm trying to hide a file called "hello_world.pdf" inside of an image file "kitten.png". The code I'm using is: original_image_file = File.read("kitten.png") hidden_file = File.read("hello_world.pdf") output_file = "output.png" separator = "*----------[#{hidden_file}]----------*" output = [original_image_file, separator, hidden_file] File.open(output_file,'wb') do |f_out| output.each do |f| f_out.puts f end end I'm supposed to be able to click on output.png and see the original image (kitten.png), but then if I change the file extension to .pdf and click on output.pdf, it's supposed to show me

Join the discussion →

Springboot graphql controller with Webflux

I have a graphql controller in a reactive application using Webflux. The graphql controller is working fine, but I need to add standard cursor pagination as indicated here: https://graphql.org/learn/pagination/#slicing After reading spring graphql 1.2.6 documentation: https://docs.spring.io/spring-graphql/reference/controllers.html#controllers.schema-mapping.subrange I updated my springboot version to 3.2.4, and I worked my way through the necessary modifications. I modified my root query from: users(count: Int, offset: Int, companyId: ID): [User]! to: users(first:Int, after:String, last:Int,

Join the discussion →

PhpStorm CSS completion stopped working (Ctrl + Space gives me no suggestions) in Blade files

I am working on a Laravel project with vanilla Blade templates, jQuery & Bootstrap. After the recent update, I am no longer getting CSS class auto-completions for Bootstrap in my Blade view: I have tried the following: Invalidate the cache Reset the .idea folder (fresh import) Marked the resource root folder correctly Checked to see if power save mode is disabled Tried installing the Laravel plugin The CSS files are brought into my view/layout using the Laravel's asset() helper like this: <link href="{{ asset('plugins/bootstrap/css/bootstrap.min.css') }}" rel="stylesheet" /> <link href="{{ ass

Join the discussion →

whatsapp-web.js, How can I fix TypeError: Cannot read properties of null (reading '1')

const version = indexHtml.match(/manifest-([\d.]+).json/)[1]; ^ TypeError: Cannot read properties of null (reading '1') at LocalWebCache.persist (/Users/abc/Desktop/haba/node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:29:69) at /Users/abc/Desktop/haba/node_modules/whatsapp-web.js/src/Client.js:744:36 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Node.js v20.11.1 once the code is run the second time, it always brings this error. i was using nodemon so I did: npx nodemon index.js smooth running

Join the discussion →

Can a CBP officer verbally prescribe a shorter duration of stay than what’s listed on the I-94?

My mom arrived to the U.S. today on a B1/B2 visa. At the airport the CBP officer chided her for spending a lot of time in the US in the past 12 months (though never in excess of official limits) and told her she must leave the U.S. within 30 days. However when I checked her I-94 it showed the expected 6 months, with an Admit Until date of October 1st. Her passport was not stamped so that’s the only date we can cross check. Is there a provision in U.S. immigration law for a CBP officer to verbally require a shorter length of stay? Or can this verbal warning be safely ignored and one should just

Join the discussion →

How to scale the number of concurrent users of my LLM Chatbot RAG system for production

I have developed a chatbot using Azure OpenAI ChatGPT as LLM and AWS as the cloud provider for hosting the entire application, more details can be consulted in the image below. Now, as the topology of my chatbot is a RAG (Retrieval Augmented Generation), the maximum amount of tokens per minute (80K tokens per minute) is easily reached when I have 6 or 7 users using the chatbot in parallel, this because due to the RAG topology, each input prompt of each user is always around 10K tokens. Architecture: As you can see from the image above, it is a multicloud architecture, indeed, the infrastructur

Join the discussion →

Any automated way to view a network of pytest fixtures/functions defined in the conftest.py file?

I've inherited a large data science workflow (in python) that uses many functions scattered across many modules. Luckily for me, around 50% of these functions already have pytest coverage and make use of a conftest.py file which sets up tons of fixtures and mock objects for testing (dfs, dicts, lists, etc. with fake data). I'm responsible for creating the other 50% of tests. However, most fixtures call a maze of other fixtures from within conftest or functions/classes from internal modules, and I'm having a very hard time reverse engineering a given fixture to see how it interacts with the oth

Join the discussion →

How can a bot find out that a reaction emoji was left in a Telegram channel post? telebot python

I need the bot to understand that they left a reaction in the post and display in the console what type of reaction they gave, for example, heart, like, dislike, and I need this to work through the telebot library in python, please help, I don’t understand at all how this can be done. I tried to read data from a message, something like "message.reaction", but I got an error saying that there is no "reaction". import telebot bot = telebot.TeleBot('token') @bot.message_handler(func=lambda message: True) def handle_reaction(message): print(message.reaction) bot.polling() AttributeError: 'Message'

Join the discussion →
Older stories