on-internet

Vulkan unpack uvec4 from integer

I've observed some strange behavior. I have an array of unsigned 32bit integers. I use one integer to encode 4 values, each one byte in size. I'd like to then pass such buffer to vertex shader layout (location = 0) in uvec4 coords; In order to achieve this, I use VkVertexInputAttributeDescription with format set to VK_FORMAT_R8G8B8A8_UINT. I have defined such handy struct struct PackedUVec4{ unsigned char x; unsigned char y; unsigned char z; unsigned char w; }; Then I build my buffer as PackedUVec4[] and such buffer is then sent to GPU. However, what I have observed, is that the order of bytes

Join the discussion →

Nest JS role and permission based access control

I've already worked with nodeJS and express. Now I came across NestJS and found it quite interesting. There are several references to authorization in the NestJS documentation. RBAC (role-based access control) CASL (claims-based authorization) But I'm not sure which of the many variants meet my requirements. The aim is to create a REST API where on the one hand server-side permissions (rights to call up the route or change data records) and client-side permissions (which widgets are displayed in the frontend, what can the user see ) covers. I programmed everything myself in NodeJS and express,

Join the discussion →

Anchor Tag in Next.js

I'm trying to use an anchor tag in Next.js. I don't get any console errors when I set it up and click the link, but the page does not jump to the element with indicated id property. This issue on GitHub suggests that people need to write a lot of custom code to use anchors. That can't be right. I have: const links = [ { label: 'Solutions', href: '#solutions', id: 'solutions' }, ]; <NavLink.Desktop key={index} href={link.href} id={link.id}> {link.label} </NavLink.Desktop> I get no errors, but the page does not jump to the label that has an id of 'solutions'. Does anyone know how to solve this,

Join the discussion →

React Native: error Failed to install the app. Make sure you have the Android development environment set up

I am new to react native, I tried to install BackEndless from this link: Patch for using Backendless JS-SDK inside React Native App. but I recognized that this was a mistake to do, any way, after installing the Backendless, the android application is not working any more and I get this problem: npm run android [email protected] android react-native run-android info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. (node:7797) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-wa

Join the discussion →

Visual Studio Code : Select a language to get started. Start typing to dismiss, or don't show this again

I appreciate if you could help me with such silly question. I used to have a line prompting me to choose a programming language whenever a new file is created in 'visual studio code'. By mistake, I clicked on don't show and, now, I need to return it back!. Do you have any idea how to display it again. The line is saying "Select a language to get started. Start typing to dismiss, or don't show this again." It is the first line appears in the created new file. I tried to search the settings, but I got lost. Thanks in advance,

Join the discussion →

Root detection Implementation can be bypassed using Magisk hide : Android App vulnerability

I have recently have been assigned new security fix for my Android App: This time Vulnerability Assessment and Penetration Testing (VAPT) team using Magisk and Magisk hide to bypass the Android root detection implementation. Description given by VAPT team: Root detection is checked based on package name and availability of su binary. Steps followed by VAPT team for Root detection bypass on Android device: Set Magisk application package name to random. Next Apply Magisk hide settings. It will hide su binary from Application. So, Application work as normal. The means Magisk Hide lets you use app

Join the discussion →

Blazor Web Assembly Project Not running in Browser (Edge/Chrome/IE)

I am trying to execute the Blazor WebAssembly Standalone project in Edge, suddenly this project is producing the following error Microsoft Visual Studio One or more errors occurred. Failed to launch debug adapter. Additional information may be available in the output window. Unable to launch browser: "Could not connect to debug target at http://localhost:1051: Could not find any debuggable target" OK I have tried the solution suggested on one or more errors occurred failed to launch debug adapter Visual Studio 2019 But it is not working. Can anybody help me on this? Thanks in advance Regards M

Join the discussion →

Access to XMLHttpRequest at https://login.microsoftonline.com has been blocked by CORS policy

I have an ASP.NET web app which calls an API to get some data from an ASP.NET Core web app of mine. This worked fine until I added Microsoft sign-in to the ASP.NET Core app. I followed this Microsoft Documentation exactly step-by-step to add the sign-in. The sign-in works perfectly; however, this has caused an issue with the API. Now when the API call is made, I get this error in the console (with the sensitive info replaced by {...}): Access to XMLHttpRequest at 'https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize?client_id={client_id}&redirect_uri= {redirect_uri}&response_typ

Join the discussion →

How to use branded string as an index to a Record type

My strings take a certain format so I often type them to be sure they are in a particular format. For example I check my strings are prefixed with foo. How can I use a branded string as an index to a record? type Foo = string & { _fooBrand: undefined } type T = Record<Foo, string> const f = (a: T, b: Foo) => { const c = a[b] // Type 'Foo' cannot be used as an index type. }

Join the discussion →

This can enable a Reflected Cross-Site Scripting (XSS) attack

I have this code: const implementation = async (req, res, next) => { const rut = req.user && req.user.nickname.toUpperCase(); const data = req.body; // ERROR !!! if (!rut || !data) res.send(400, {message: 'Error al recibir los datos'}); let MetaData = await UserMetadata.findOneAndUpdate({rut}, {emergencyContact: data}, {new: true}); if (!MetaData) res.send(400, {message: 'Ha ocurrido un error'}); return res.send(200, MetaData); }; Codegate is giving me a security error in the line 3: The application's async embeds untrusted data in the generated output with send, at line 3 of "my file". This u

Join the discussion →

Removing skype for business using powershell

Hello I am wondering if there is a way to remove skype for business from a bulk of computers using a powershell command? I tried a few things, such as Get-ChildItem -Path "C:\Program Files (x86)\Microsoft Office\root\Office16\*lync*" -Recurse | Remove-Item This commands removes everything that has with skype business to do in the root folder Office16. But it doesn't do the trick as it is not accepted as an official way of removing it from the client computer, and could potentially cause issues. The other one is Get-AppxPackage *Microsoft.SkypeApp* | Remove-AppxPackage however this only applies

Join the discussion →

Create a Function which will tell us if an array is sorted or not in C programming

New to C programming ^^. I am working on an assignment, and I have to create a function that verifies if my array is sorted. I have to use a predefined template of code and solve it in a certain way. Description : Let's create a function which will tell us if an array is sorted or not. What is sorted? :-) Write a function that takes an integer array as a parameter (input) and returns a boolean (true/false). Your function should return true if the integer array is sorted in either ASC(ascending) or DESC(descending) order. Your function should return false if the integer array is not sorted. Num

Join the discussion →

Using range function in Python

I have a question about using the range function to iterate a string. Let's say I need to capitalize everything in the following string: string = 'a b c d e f g' Can I just write the following code? for i in string: i = i.upper() return string Or should I use the range function to iterate every element in the string? Finally, a more general question is whenever I need to iterate all elements in a string/list, when should I use the range function and when can I just use the "for" loop?

Join the discussion →

Getting syntax errors in Verilog

I'm working on my first big Verilog project and having some problems, mostly in this snippet: always @(posedge clk) begin if (ii) begin instruction_register <= bus; end end for (integer i=0; i<=3; i++) begin assign bus[i] = io ? instruction_register[i] : 1'bz; end // STEP COUNTER always @(posedge clk) begin step_counter <= step_counter+1; if (step_counter == 4) begin step_counter=0; end end I keep getting syntax errors, invalid module item errors, and invalid module instantiation errors, and I'm really not sure how to fix them. The full code can be found at https://github.com/adarmaori/SUP-1-c

Join the discussion →

How do I step through code when debugging in VSCode?

I'm very new to debugging. My whole programming "career" has been limited to inserting print statements to try to figure out why things aren't working the way I want them to. Now I'm trying to step through my Python code in Visual Studio Code, but when I try to step into the debugger, it jumps straight to the first exception (which is like 50 steps in to be clear). I saw that there are debugging configurations, but surely I don't have to learn all about those just to step through the code. And I know you can set breakpoints, but I'd like to see each step for now. Is there something I'm missing

Join the discussion →

Prisma migration needs default value?

I'm having a problem with Prisma data modeling give tried almost everything but i still don't get what this error is giving me. It says that table needs a default value when I already have given it a ID then i tried to remove the relation name same thing happens here my model: model UserToUser { id Int @id @default(autoincrement()) userId Int? follower User? @relation("follower",fields: [userId], references: [id]) following User @relation("following", fields: [followingId], references: [id]) followingId Int } Then it gives me an error saying "Step 2 Added the required column followingId to the

Join the discussion →

EXIF location data removed when sharing photo via Intent

I have recently switched my app to Scoped Storage. However, I have noticed that when I share an image from within the app (via an Intent), the GPS location data is removed from the image's Exif metadata. I am aware that Scoped Storage has some restrictions on accessing the Exif location data of an image and I am aware about the permission <uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION" />, however adding this permission does not seem to have any effect when sharing the image. Any idea how to share images via Intent while retaining the location data in the image's Exif

Join the discussion →

Is it possible to create Avro schema for Dictionary object

Trying to implement avro serialization and deserialization in .net for kafka messages. Message model as follows. public class SampleMessage { public string Hash{ get; set; } public string FileName { get; set; } public string Data { get; set; } public Dictionary<string, string> Content { get; set; } public string LineDetails { get; set; } } So, Is it possible to create Avro schema for Dictionary in c#?

Join the discussion →

How can I get IntelliJ's Find in Files to always open in "In Project" mode?

As a long-time Visual Studio user, I often use Find in Files to find things throughout the project. In IntelliJ, this is causing me problems, because sometimes IntelliJ decides, for some reason, that what I want is "Directory" rather than "In Project". (I usually notice this after I'm baffled by the small number of matches.) How can I get IntelliJ to exclusively open Find in Files in In Project mode, and never in one of the other settings?

Join the discussion →

Elasticsearch Escaping special characters in regexp

i want to search in elasticsearch using regexp but i must to escape caractere speciaux in this phrase " http://10.10.100.100/test.txt " I tried : GET indexname/_search { "query": { "nested": { "path": "test", "query": { "bool": { "must": [ { "regexp": { "test.search1": "http://10.10.100.100.*" } }, { "match": { "test.search2": "url" } } ] } } } } } not working. when i replace "http://10.10.100.100." with "http." it's working so i need to escape ":" and "//" how to do that with elasticsearch

Join the discussion →

web page breaks at 767px, 991px, 1199px using bootstrap 3

i'm working on a project where my web page breaks at 767px, 991px and 1199px and i don't know why this happens. i'm using bootstrap 3.3.7 and where ever i use hidden-* classed in my project where there is an image at the middle and there are two other columns at the right and left, i face this issue. now i don't know if it's because of hidden-* classes or putting an image at the middle column. if you didn't get what i mean, take a look at these codes: <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.

Join the discussion →

Toggle Text from asterisk to Normal text

Is it possible to have text starting out as ****** and display a 'reveal' icon (like an eye), and when they click the icon it is replaced with 123456? The number that I want to show/hide is stored in MySQL, and also what they use to reset their password, so would it also be possible to show ****** again after like 5-10 seconds.

Join the discussion →

Problems with ABC/Interfaces using pydantic + Mixins pattern

TL;DR: why does this: class Data(BaseModel): a: int class IData(ABC): @abstractproperty def a(self): ... class XData(Data, IData): ... raise: TypeError: Can't instantiate abstract class XData with abstract method a when I instantiate XData likes x = XData(a=1)? I'm trying to implement Mixin pattern while I'm using Pydantics BaseClass to facilitate the instantiation and validation of data from my class. The problem is that my Mixins cannot inherit from my base classes (actually, the dependency is the opposite). Also, I'm using mypy so my implementation needs to be correctly typed. Let's see a s

Join the discussion →

Get Jump status after Jump to bootloader from Application

I'm using the LPC845 Cortex-M0+ chip. I'm able to jump from the bootloader to the application and from the application to the bootloader. Once the microcontroller is power on the first time, it checks whether the application is present or not. If the application is present, it jumps to the application. When I would like to jump back to the bootloader, I’m using the same logic to jump to the bootloader, and it works well. Now I would like to perform some specific task if the bootloader is executing from the application. Is there a best way to check whether the bootloader execution starts from t

Join the discussion →

Jackson MismatchedInputException (no String-argument constructor/factory method to deserialize from String value)

I am using SpringBoot 2.3.1-RELEASE and am trying to deserialize JSON string to a POJO containing list of objects but I keep running into this error: Cannot construct instance of com.response.dto.RootDTO (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('Meta') at [Source: (String)""Meta":[{"DimensionName":"Version","DimensionId":"3b4860b9-b215-4192-bd7a-a76f377fc465","DimensionType":"Regular","Alias":"C0","AttributeId":"211d5-d91f-40ec-9668-20e0da2ae7b3","AttributeName":"Version Name","AttributeKey":"VersionKey"; line: 1, c

Join the discussion →

generate random six character base 36 string

I need to generate a random six character base 36 string. I am using below two packages, but it not always returning the six characters. const seed = require('random-seed').create(); const bases = require('bases') console.log(bases.toBase36(seed(10000000, 99999999)))

Join the discussion →

Webpack sideEffects won't remove unused function

In the babel-loader I am declaring side-effects to false which means that any unused function should be removed from the bundle. But in my case logFour function remains. util.js export function logThree() { console.log(3); } export function logFour() { console.log(4); } logThree(); logFour(); index.js import { logThree } from "./util"; logThree(); bundle.js (() => { "use strict"; function o() { console.log(3); } o(), console.log(4), o(); })(); webpack module.exports = { mode: "production", entry: ["./src/index"], devtool: "source-map", output: { path: path.resolve("dist/"), publicPath: "/publi

Join the discussion →

React material ui select all checkbox

I need to make that when selecting checkbox Select All, the rest of the checkboxes from the list are checked, and each checkbox can be selected separately. But when select one of the checkboxes does not checked the previous checkbox. sandbox const options = [ 'Selected Item 1', 'Selected Item 2', 'Selected Item 3']; export default function App() { const [selected, setSelected] = useState([]); const isAllSelected = options.length > 0 && selected.length === options.length; const handleChange = (event) => { const value = event.target.value; console.log(value) if (value === "all") { setSelected(se

Join the discussion →

How to configure and use `git send-email` to work with gmail to email patches to developers

How do I configure git send-email to work with gmail? I'd like to contribute to glibc (the GNU C Library, not to be confused with GNOME's GLib library), for instance, to update the glibc/benchtests/bench-malloc-thread.c malloc speed test benchtest, but they are old and archaic and living in the Dark Ages still where we have to submit patches through email at the command-line instead of opening a Pull Request through GitHub or GitLab. :) See glibc's contribution instructions here: https://sourceware.org/glibc/wiki/Contribution%20checklist: Create one or more patches using git format-patch Use g

Join the discussion →
Older stories