October 23, 2024
Chicago 12, Melborne City, USA
CSS

Table rows occupy extra space (beyond set height) despite of fixed height table container

I was debugging this issue in my project since couple of days. It took a hell out of me in this whole debugging process. You will see the bug as standalone so you might not realise that how tough it could get to debug an issue like this in a full fledged live project. But

Read More
C++

How does printf() works as a safe cancel point? What is it depends on?

I have this little program that is supposed to create a thread and cancel it. #include <stdlib.h> #include <stdio.h> #include <pthread.h> #include <unistd.h> void *thread_function(void *arg) { while(1) { printf("hello \n"); //sleep(1); } return NULL; } int main() { pthread_t thread; if(pthread_create(&thread, NULL, thread_function, NULL) != 0) { perror("Failed to create a thread"); return -1;

Read More
jQuery

I need to give an element the same class as another element

<div class="topnav" id='myTopnav'> <div class="dropdown"> <button class=" dropbtn">Adobe ▼</button> <div class="dropdown-content"> <a href="index">Photoshop</a> </div> </div> </div> <script> jQuery(function($) { var path = window.location.href; $('#myTopnav a').each(function() { if (this.href === path) { $(this).addClass('active'); $(this).parent().parent('first-child').addClass('active'); } }); }); </script> I am not very good at jQuery or even Javascript, but I would like to give the button

Read More
Android

Save data class into protobuf data store

I am working on an app which is receiving data from an endpoint. I used to save a backup of this data into the Shared Prefrences but as the object is complex the JsonToString and StringToJson serialization is not efficient specifically when there is an update in the data class. In case, the app is

Read More
PHP

How to get all account tracks in rss feed? not just the new ones?

Is there a way to get all SoundCloud tracks in RSS feed? I did that, Permissions section I ensure that the option include in RSS feed is selected. But still do not get the old ones. You need to sign in to view this answers

Read More
C#

The scanf function uses '%c' to accept input, but can perform string input

How to understand the running process of the following code. void scan(void){ char item; scanf("%c",&item); if(item == '#'){ printf("\n"); return; } printf("%c",item); scan(); } Why can I input strings into the console, and scanf will not be executed again in the recursion, but each character will be read automatically instead? You need to sign in

Read More
java

Set Cookie Recived from Server.com to Client.com application cookie

so i have my backend java hosted on render i have my frontend react js hosted on firebase actual hosted URL’s Render : https://back-i2pj.onrender.com Firebase : https://valyrian.web.app now i’m making a POST call to https://back-i2pj.onrender.com/api/auth/signin in response header’s i’ll recive a cookie in set-cookie header ex header : Set-Cookie: username=example; Max-Age=3600; Expires=Wed, 16 Oct 2024

Read More
python

pymqi – 2009 – FAILED: MQRC_CONNECTION_BROKEN

I’m running a below simple python MQ put/get program in my local machine that connects to a list of qmgrs running on a remote machine ‘qmgr.test.com’. I’m getting MQRC 2009 error. MQ Error for QMGR1: 2009 - FAILED: MQRC_CONNECTION_BROKEN MQ Error for QMGR2: 2009 - FAILED: MQRC_CONNECTION_BROKEN connectivity between my local machine and mq host

Read More
javascript

Getting the request headers in a React website

I have a React website that is hosted by IIS. I am trying to get the request headers, specifically for CaC logins. For F5/CaC authentication, the certificate is forwarded into a request header. Using ASP.Net Core/C#, I would do something like this: var subject = HttpContext.Request.Headers["X-SSL-Client-Cert-Subject"]; Since this website is a pure React website, I

Read More
pdf

Open a recent PDF created in Android

I’m using Android Studio to make a simple app to create some PDF files to store some data. I wanto just to make an intent for the generated PDF auto opens for the user. Here’s just the canvas drawing sonme text and saving the PDF on Downloads. Working fine canvas.drawText(text ,x ,y, paint); document.finishPage(page); File

Read More