on-internet

City break during 6h transit in Delhi

My international flight should land at 8:05 at Delhi on Sunday and my domestic flight is scheduled at 14:30. I would like to visit the city as 6 hour seems like lots of time. I dont need to check in or hand over luggae. I just need to get through security there and back. Am I naive? Does it make sense? When shall I arrive to Delhi to get back through the security?

Join the discussion →

Styling QR Code Generated with simple-QRcode in Laravel to Achieve Circular Eye Shape

I'm using the simple-QRcode package in Laravel to generate QR codes, and I'm trying to style the QR code to have a circular eye shape instead of the default square eye. However, I'm facing an issue where the eyeball shape remains square even though I've managed to change the eye to a circular shape. Here's the code I'm using to generate and style the QR code: QrCode::size(200) ->eye('circle') ->style('round') ->format('png') ->generate('Example', public_path('test.png')); Achieved QR Code want to achieve QR code like this

Join the discussion →

How to filter records from Activityparties table where the party lookup field is related to a systemuser using Web API

I'm querying appointment participants, from Dynamics 365 CRM, from the "Required Attendees" lookup field in the Appointments. I've created a query that returns records from the "activityparties" table, where "participationtypemask" equals 5 (Required Attendee). I've tried to apply a second filter to only return records where the party is a user, but the filter is ignored and I get records with all parties (accounts, contacts, cases, etc.). This is my query: OData.Feed("https://ar.api.crm4.dynamics.com/api/data/v9.2/" & "activityparties?" & "$select=_activityid_value, participationtypemask, _pa

Join the discussion →

How to have dependabot auto approve with multiple GitHub required approvers?

I'm looking for a way to have all PRs dependabot makes to auto merge if all required CI validations pass without any further manual intevention. The issue is, this is to be done on a repository that has two required approvers (not one) and may have "require review from Code Owners" set. I'm referencing this documented workflow to have all dependabot PRs automatically approved: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#approve-a-pull-request When running the workflow, this adds github as a reviewer. However, since our r

Join the discussion →

How to create password protect zip file in nodejs using node-7z-archive package

Please anyone guide me, how We can create password protected zip file and extract. using node-7z-archive https://www.npmjs.com/package/node-7z-archive actually I want to create password protect zip file with a folder code to create a simple zip file: const fs = require('fs'); const path = require('path'); const archiver = require('archiver'); const sourceFolder = 'create_zip'; // Replace with the actual folder path const zipFileName = 'output.zip'; // Create a writable stream to the zip file const output = fs.createWriteStream(zipFileName); // Create a zip archive const archive = archiver('zip

Join the discussion →

AttributeError: 'str' object has no attribute 'cat'

For each GENE_SYMBOLS column of a dataframe, merge the rows and retain only unique comma-separated or dash-separated values. After merging the values of each row into a list, obtain only the unique values. geneset = pd.read_csv("genesets.v2023.1.Hs.tsv", sep="\t", index_col=0) geneset = geneset.loc["GENE_SYMBOLS"] # retrieve only rows with index name "GENE_SYMBOLS" for i in geneset.columns: genes = i.cat(sep=',').tolist() # Merge all the rows of strings with "," delimiter and store as a list genes = genes.split(",") # split by the "," delimiter genes = genes.split("-") # or the "-" delimiter g

Join the discussion →

Gradle difference between compileJava and tasks.withType(JavaCompile)

I'm currently trying to convert an old code base from Java 8 to Java 11. Part of this old code base uses some Java-internal classes (specifically sun.security.x509). In order to make this work in Java 11 I have to add the "add-exports" flag to my compileJava task in Gradle to allow this internal class to be visible outside its module. So I started with this: compileJava { sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 options.compilerArgs = [ '--add-exports=java.base/sun.security.x509=ALL-UNNAMED' ] } This doesn't seem to work, as the add-exports does

Join the discussion →

Django Custom Field with Fernet Cannot Decrypt

This is my custom field that I call in a model. Migrations succeed and I'm able to insert an encrypted value into the data table. However, it will not decrypt. Here's the custom field class: class SecureString(CharField): """Custom Encrypted Field""" #kdf = X963KDF(algorithm=hashes.SHA256(), # length=32, #sharedinfo=None, # backend=default_backend()) key = bytes(settings.FERNET_KEY,'utf-8') f = Fernet(key) def from_db_value(self, value, expression, connection): return self.f.decrypt(str.encode(value)) def get_prep_value(self, value): return self.f.encrypt(bytes(value, 'utf-8')) And here is the

Join the discussion →

In NGINX, Arabic URLs do not redirect to 410 pages (status code), but English URLs redirect to 410 pages correctly

We have a website and a website with Arabic and English addresses. We need to redirect some URLs from a 404 status code to a 410 status code in the NGINX web service (for SEO). We configured the NGINX web service and added Arabic and English URLs. English URLs successfully redirect to status code 410 (NGINX error page), but Arabic URLs do not redirect and return a 404 error page. My question is why redirecting Arabic URLs doesn't work, since the configuration for both URL types (Arabic and English) is exactly the same. Example URLs: https://example.com/test And https://example.com/تست NGINX co

Join the discussion →

How do I browse the raw data collected by Prometheus?

I'm looking for a way to browse the time based database raw data, in a way similar to how SQL Server Management Studio gives you access to the raw data held within the relational database SQL creates. It can be a GUI or console based, because with SQL you can do either or, I'm really hoping for some kind of graphical interface though. Is there a way to browse through the data? Or can someone simply explain how the raw data would look, if there were such a way? With SSMS, I'm able to get so much information about the tables, fields and rows, and see how it's all structured and related. I do und

Join the discussion →

Is static async Task method is thread safety by default?

The method with signature static async Task is thread safety by default? In general, I assumed that the compiler might create some wrapper that provides "thread-safety". By the way, not on purpose. Doesn't the compiler seeing 'static async' create something similar to what happens with java compilers and the 'synchronized' keyword? Sorry for My English.

Join the discussion →

System.CommandLine mutally exclusive options

I am using System.CommandLine and I wanted to create a mutually exclusive option. The user either has to use --ipAddresses and pass in list of one or more IP addresses OR use --ipAddressesCsv and pass in a file path containing the CSV file. I am wondering if its something possible to do with System.CommandLine. This is my setup: var ipAddressesOption = new Option<IEnumerable<IPAddress>>("--ipAddresses") { Description = "The IP addresses", IsRequired = true, Arity = ArgumentArity.OneOrMore, AllowMultipleArgumentsPerToken = true, }; var ipAddressesCsvOption = new Option<FileInfo?>("--ipAddresses

Join the discussion →

NTAG 424 SDMENCFileData use-case

I've been burying my nose in the AN12196.pdf for a few days now and slowly getting a hang of it. What I cannot clearly understand is the idea behind the SDMENCFileData. In section 4.4.3 SDMENCFileData mirror, if I understand it correctly, it's saying that you can take any 32-character plaintext part of your URL, and it gets encrypted when tapping, am I right? What would be the use-case of this? If I had some secret thing, that's shorter than 32-chars, I have to pad it before encrypting, and if I had something longer I wouldn't be able to use it. I wanted to know what other's use this for.

Join the discussion →

How to Connect Langchain Database Agent with SqlServer

I need to connect my langchain database agent with my sqlserver database so that my agent can access the data, yet in the documention it does not explain how to do so, it only shows how to connect to sqlite like the following code: from langchain.agents import create_sql_agent from langchain.agents.agent_toolkits import SQLDatabaseToolkit from langchain.sql_database import SQLDatabase from langchain.llms.openai import OpenAI from langchain.agents import AgentExecutor from langchain.agents.agent_types import AgentType from langchain.chat_models import ChatOpenAI db = SQLDatabase.from_uri("sqlit

Join the discussion →

How can I allow a specific portion of my table to be responsive to clicks in html?

Consider the following set of codes I have: <table> <tr id='changeOnClick'> <td></td> <td id="metre_" >Metre</td> <td id="centimetre_">Centimetre</td> <td id="fermi_" >Fermi</td> </tr></table> Now the JavaScript I have is something like this: document.getElementById('chooseid').onclick = start; function start(){ \\Do something... } But, as you see, I don't want the first cell, that is an empty <td> to get affected by this start() in my JavaScript code. So, what changes shall I do to fix this? Do I need to consider taking all the remaining cells of the row into another container? In fact, I tri

Join the discussion →

Spring flyway Rebase migration scripts

Hi in my project I have around 200 flyway migration scripts and I need to clean those and create a new baseline. For example, I have the following schema versions V1_0_0__baseline.sql V1_1_0__schema-change1.sql V1_2_0__schema-change2.sql . . . V1_200_0__schema-change200.sql Now I need to clean the src/main/resources/db/migration files and create a new record as below. V2_0_0__baseline.sql Then I added this config and try to rebase the schema versions spring.flyway.baselineOnMigrate = true spring.flyway.baseline-version=2 flyway core version: 8.5.13 spring boot version: 2.7.7 Are there any conf

Join the discussion →

How to strongly type fetch with Typescript

I would like to create a custom fetch function which thanks to TypeScript has strongly type params and returns. Imagine I declare types like this interface ResponseData { status: 'success' | 'error'; } interface RequestBody { foo: string; bar: number; } const endpoint = { url: '/endpointurl/', method: 'get', /* A way to associate RequestBody and ResponseData types */ }; I would like to call my custom fetch function with endpoint object and automatically have typing on the body I pass in params and the data I get in returns /* myfetch would use endpoint.url and endpoint.method to fetch data */

Join the discussion →

Expected identifier but found "*" [css-syntax-error] while updating angular 10 to 14

When I updated my angular version from 10 to 14, at the time of making build I have seen warning in command prompt. The error as below:- Warning: ▲ [WARNING] Expected identifier but found "*" [css-syntax-error] styles.css:1617:2: 1617 │ *cursor: hand; ╵ ^ SS:- Remove this CSS syntax error from commant prompt while making the build.

Join the discussion →

SEC filings data using API in python with filter for specific strings

I'm trying to extract SEC filings in a certain date range with a certain key string, for several different companies. Basically I'm trying to replicate the search in this link: SEC Edgar (https://www.sec.gov/edgar/search/#) I installed the required libraries using pip and ran the below code, which gives me all the submissions in a dict format. from sec_edgar_api import EdgarClient edgar = EdgarClient(user_agent="<Sample Company Name> <Admin Contact>@<Sample Company Domain>") # Sample CIK # manual pagination handling submissions = edgar.get_submissions(cik="104169", handle_pagination=False) How

Join the discussion →

How to highlight the differences between two strings in Python?

I want to highlight the differences between two strings in a colour using Python code. Example 1: sentence1 = "I'm enjoying the summer breeze on the beach while I do some pilates." sentence2 = "I am enjoying the summer breeze on the beach while I am doing some pilates." Expected result (the part marked by asterisks should be in red): I *am* enjoying the summer breeze on the beach while I *am doing* some pilates. Example 2: sentence1: "My favourite season is Autumn while my sister's favourite season is Winter." sentence2: "My favourite season is Autumn, while my sister's favourite season is Win

Join the discussion →

How to schedule a facebook page post?

I need to shedule a facebook post using an image. It should appear in the planner tool of the Meta Business Suite. I found this example, but I can't figure out how to use an image and set a publication date. Depencency: <dependency> <groupId>com.facebook.business.sdk</groupId> <artifactId>facebook-java-business-sdk</artifactId> <version>17.0.3</version> </dependency> Code: import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class PageFeedPost { public static void main (String args[]) throws APIException { // https://github.com/facebook/facebook-java-business-sdk

Join the discussion →

Installation unsuccessful: Chocolatey installation on VS Code via CMD / Power Shell

I was installing node.js and, during the installation, was given the option to also install Chocolatey. The first issue was, it didn't install. The error will be attached below. I then ran CMD as an administrator and wrote choco upgrade -y visualstudio2019-workload-vctools This, also, did not solve the issue. I rather got the same error message, which is - ERROR: Unable to detect any supported Visual Studio product. You may try passing --installPath or both --productId and --channelId parameters. The upgrade of visualstudio2019-workload-vctools was NOT successful. Error while running 'C:\Progr

Join the discussion →

Print PDF in new browser tab

I have this two pieces of code that works today: This one gets a blob file I retrieved from backend and open a 'print dialog' on current tab: var blob = new Blob([response.body], {type: 'application/pdf'}); const blobUrl = URL.createObjectURL(blob); const iframe = document.createElement('iframe'); iframe.style.display = 'none'; iframe.src = blobUrl; document.body.appendChild(iframe); iframe.contentWindow.print(); This one opens a new tab to download a file (which is returned as inline by the server): var form = document.createElement("form"); form.target = "_blank"; form.method = method; form.

Join the discussion →

F.cross_entropy raised "RuntimeError: CUDA error: device-side assert triggered. Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions."

I met this error in loss function. An example below: import torch device = "cuda" if torch.cuda.is_available() else "cpu" a = torch.Tensor([[-10.3353, -28.4371, 2.0768, -4.2789, -8.6644, -6.0815], [-10.3353, -28.4371, 2.0768, -4.2789, -8.6644, -6.0815], [-10.3353, -28.4371, 2.0768, -4.2789, -8.6644, -6.0815], [-10.3353, -28.4371, 2.0768, -4.2789, -8.6644, -6.0815]]).to(device) b = torch.Tensor([ -100, -1, -100, 2456]).long().to(device) loss = torch.nn.functional.cross_entropy(a,b,ignore_index=-1) print(loss) Then the error is: -------------------------------------------------------------------

Join the discussion →

Difference when executing tests via @SpringJUnitConfig vs @SpringBootTest

In our test codebase, we are trying to minimize the usage of @SpringBootTest annotations in favor of more targeted @SpringJUnitConfig. Replacing it in the first of the working tests: @SpringJUnitConfig //@SpringBootTest class DataMarshallerServiceTest { @Autowired private DataMarshallerService cut; we start seeing the following stack: Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.abc.globalpayments.feeds.downstream.dailycashreport.generate.DataMarshallerService' available: expected at least 1 bean which qualifies as autowire candida

Join the discussion →

How can I create a custom TabBar in a MAUI app?

I want to create a custom TabBar in a MAUI app (Android and Windows). I want the upper edges to be rounded and ading some other customizations. What I've tried: The shell's TabBar control is not customisable at all... I was experimenting with a shell custom renderer but I am not really sure how I could achive a custom look in MAUI and how to implement it. Instead of using the shell's TabBar I created a custom TabBar which derives from the ContentView class and with a TapGestureRecogniser I navigated to a new page when an image was clicked. And I used this custom control in every page at the bo

Join the discussion →

Existe um git hook para quando uma nova tag é criada?

Temos 3 ambientes: DEV, STAGE e PRD. O deploy em STG e PRD são feitos por tag criadas no git do projeto, ou seja, se quiser subir uma nova versão do sistema em STG, deve-se antes de fazer o push para o repositório, criar uma nova tag para que esta seja selecionada na pipeline de deploy. Após a versão ser validada, a mesma tag é subida em PRD. O problema é que nos microservices - construídos em NodeJS - que dou e já dei suporte, a grande maioria (95%) não tem a "version" no package.json atualizada de acordo com a última tag criada. Essa informação de versão do projeto é importante para os healt

Join the discussion →

How to securely store a password for a script run every day using a Windows task scheduler? [closed]

I have written a PowerShell script to do some operation. When the operation is completed, I want the script to send a mail using the Send-MailMessage cmdlet. For this I used Google's app password feature. But I'm not confident about storing the app password as plain text in the script itself. I can encrypt somehow and store it in the script or separate file, but people can still see that password. Even if I encrypt the password, the decryption login will be there in the script itself. One other way I think would be useful is passing the encrypted password as an environment variable but 1. I co

Join the discussion →

Run Testcontainers inside Kubernetes pod

I have to run integration tests inside a container which is inside a Kubernetes POD. I have the folowing jenkinsfile: !groovy pipeline { agent { kubernetes { yaml libraryResource('podTemplates/pod.yaml') } } stages { stage('Checkout from VCS') { steps { checkoutScm() } } stage('Integration Testing') { steps { container('maven') { sh 'mvn test' } } }` } The pod.yaml Pod template has different containers , here its definition: apiVersion: v1 kind: Pod metadata: labels: some-label: jenkins-build-agent-maven spec: containers: - name: maven image: docker.artifactory.serv.cdc.fr/maven-ci:3.8.4-jdk-1

Join the discussion →

How can I find all variables of a TwinCat system using PyADS?

I want to use python and the PyADS library to find all the variables available of a TwinCat system/PLC. PyADS has a function called get_all_symbols which almost does what I am looking for. Here you see the variables I want to get in Python. ADS variables visible in TwinCAT When i use the get_all_symbols() function I see all the variabels from within the MAIN. Now for the problem. I can read the integers, booleans and other primitive variables in the MAIN. Result of reading the variables The problem is that I can't get the variabels within a STRUCT or FB in the MAIN using the get_all_symbols()

Join the discussion →
Older stories