October 22, 2024
Chicago 12, Melborne City, USA
Android

Run connectedAndroidTests without re-installing APK

I have several instrumentation tests that I want to run as part of a build pipeline. I’m assembling and installing the APK on the device in a previous step and don’t want it to run through that process for the module again when I run ./gradlew app:cAT, is there an easy way to do that?

Read More
PHP

regex to remove all whitespaces except between brackets

How do i prevent preg_replace() altering the content of () in following JavaScript-Snippet: myVar.replace(/\u00AD/g, ''); This is my PHP function (I am not sure, which part is responsible): $output = preg_replace('/true/', '!0', $output); $output = preg_replace('/(?:(?:\/\*(?:[^*]|(?:\*+[^*\/]))*\*+\/)|(?:(?<!\:|\\\)\/\/[^"\'].*))/', '', $output); $output = preg_replace('/ = /', '= ', $output); $output = preg_replace('/\s*\n\s*/', '', $output); $output = preg_replace('/([^A-Za-z0-9\_\$])\h/', '$1',

Read More
C#

STM32 FDCAN filters not filtering anything

The problem I am unable to get the HAL CAN filters to filter anything. I have FDCAN working perfectly on my STM32H723VGT6 uController. I would like to now implement CAN filters, but when I configure the FDCAN filter, nothing is filtered, all Rx messages still trigger the RxFIFI0 callback. What I have tried: // Can

Read More
java

Does LibGDX support Primitive Restarts for Triangle Fans in Mesh Indices?

OpenGL supports the ability to start a new Triangle Strip in an index array by inserting two duplicate indices, (what they call a "degenerate triangle"), like this: GLuint idxs[] = {0, 1, 2, 3, 3, 4, 4, 5, 6, 7}; And it supports a similar ability to start a new Triangle Fan in an index

Read More
python

can someone help me figure out what is wrong with my code?

import os import zipfile import pandas as pd Function to find ZIP files with the relevant keywords (VTE, CLI, ART) def find_zip_files(month_folder_path): zip_files = {"vte": None, "cli": None, "art": None} List all files in the month folder for filename in os.listdir(month_folder_path): if "VTE" in filename and filename.endswith('.zip'): zip_files["vte"] = os.path.join(month_folder_path, filename) elif "CLI" in filename

Read More
javascript

Pending promise stored as property in object array, do not know how to access to fulfill

I’m trying to fill an array of objects with specific property values and am using Promises with async/await with Javascript in a Node.JS environment. Here is the main part: getPublicNotes(connectHeaders, baseurl, pubKey, noteKeyList).then((nkl) => { if (nkl.length > 0) { getSecurityAbEntry(connectHeaders, baseurl, nkl); for (let count = 0; count < nkl.length; count++) { let secGroupKey

Read More
pdf

Borders generated in PDF Template using Java Apache PdfBox

In the nearest future I will be developing a PDF generating service. It’s all about a simple template being filled using data coming from request. During my research I heard about Apache PDFBox and at the moment I am testing it – looks very handy, but I have some annoying problem – when the PDF

Read More
templates

Access non-type template parameter of CRTP derived class from CRTP base class

In the following CRTP code, is there a simple way to access the non-type template parameter N in Base that is exposed by Derived? template <typename TDerived> struct Base { int array[TDerived::NValue]; }; template <int N> struct Derived : Base<Derived<N>> { constexpr static int NValue = N; }; int main() { Derived<8> derived; } The

Read More
security

How to access installed packages from an Android app?

Can a non-system installed app access the /data/app folders where installed package files are stored? I know they are accessible using a file explorer app but how would this be implemented in an Android app? I’m not sure how to test this outside of writing a specific app You need to sign in to view

Read More
SQL

SQL join: unnesting rows with same column names (but different data) without resorting to aliases

Let’s say I have three tables: t1: client_id transmission_id timestamp column_A 1 AAA1 2024-10-16 10:31:27 Banana 1 AAA2 2024-10-16 11:31:27 Citrus 2 BBB1 2024-10-16 09:12:14 Apple t2: client_id transmission_id timestamp column_B 1 AAA1 2024-10-16 10:41:27 Paris 1 AAA2 2024-10-16 11:41:27 London 2 BBB1 2024-10-16 09:22:14 NY t3: client_id transmission_id timestamp column_C 1 AAA1 2024-10-16 10:31:27

Read More