Quantcast
Channel: User Sourav Kannantha B - Stack Overflow
Browsing latest articles
Browse All 60 View Live

Comment by Sourav Kannantha B on How to add conflict resolving scripts in...

@sytech Comments will be retained. But approvals will be lost. There is one 'Approve' button in Gitlab MR UI isn't it?

View Article


Comment by Sourav Kannantha B on Python how to know script was executed...

@blueteeth I updated the question to give more clarity. Please check.

View Article


Comment by Sourav Kannantha B on When running two tail commands in...

@Barmar Shell exists immediately. But ssh connection stays on till all pipes are closed AFAIK. For example, ssh remote 'cat /etc/hosts &' runs fine.

View Article

Comment by Sourav Kannantha B on git commands hanging forever in mounted...

@Philippe yes, filesystem is mounted properly. All normal commands are working fine.

View Article

Comment by Sourav Kannantha B on `git lfs prune` is not pruning all lfs objects

@LeGEC --force might think it can safely delete only one file. But shouldn't it mention there a 'n' local objects? Or is there a better way to see how many local objects are there? And perhaps, which...

View Article


Does C++ guarantee a memory allocation after a successful deallocation?

Consider this example,// x is a int* allocated previously via 'new'delete x;x = new int;Does this code always guarantee a memory allocation in last line as there is definitely memory left to hold an...

View Article

Androidx Activity API belongs to which dependency?

This documentation shows how to add dependencies for Androidx Activity API. There it mentions androidx.activity:activity-ktx:$activity_version to be declared. In my project, only Androidx dependencies...

View Article

How to translate using translations editor in Android Studio?

In my project, I have lots of string resources. Now that I am planning for release of my first ever app, I wanted to translate those to some widely used languages. However, I was unable to find the...

View Article


How tty interrupts are sent from pid 0?

This code prints the pid and uid of a caught signal:#include <stdio.h>#include <unistd.h>#include <string.h>#include <signal.h>static void my_handler(int signum, siginfo_t...

View Article


BuildConfig.java is not configuring properly in flutter

When I run my flutter project, I get the following error:C:\Users\Sourav Kannantha...

View Article

How does exec* functions manage multithreaded process?

In POSIX standards, calling exec* in a thread will cause the entire process to be replaced with a new process, resulting in termination of all threads of the process.But how does exec* terminate all...

View Article

How do I create an app to customize notification panel for Android?

I want to customize notification panel in my device. Specifically, I want to move quick tiles to bottom of the panel instead of top as it is easily accessible there. But if search Google for 'Android...

View Article

Is there a safeunlink syscall in Unix?

There is an unlink syscall in Unix, which takes a path as argument, and unlinks that path from inode.Suppose this case. I will open a file, access the contents, and then decide that it should be...

View Article


What is parent directory of a process?

In lsof output, it mentions 3 types of directories, cwd, rtd and pd. I understand cwd and rtd. But what is pd aka., parent directory for a process? I tried lsof | grep ' pd ', but I got no output. So...

View Article

pip3 command is failing

I did pip3 install jira and now every pip3 command is failing with:Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 33, in vendored...

View Article


xfuncname not working in my .gitconfig file?

I know that there is a question with same title: Why isn't my xfuncname working in my .gitconfig file?. But it didn't solve my problem.This is my .attributes file:*.drd diff=drdThis is my config...

View Article

Is it possible to stop the editor from popping up once git prepare-commit-msg...

I am writing a prepare-commit-msg hook, which interactively prompts the user about some data and creates a commit message in a predefined format. In almost all cases, there is no need for the user to...

View Article


Is it possible to know which editor git is going to use programatically?

Is it possible to know which editor git is going to use programmatically? Something like this is possible?$git which editor/usr/bin/nanoBasically, I wanted to invoke a custom editor only for git commit...

View Article

How the kotlin coroutine is implemented under the hood?

Kotlin coroutines are one of the key features in the language. I was curious how they implemented it. So I wrote this kotlin code snippet,CoroutineScope(Dispatchers.IO).launch { someFun(6) // A suspend...

View Article

How to make clang-format not add new line before opening brace of a function...

When I auto-format with Clang-format, it is always inserting a newline before brace when requires clause is there.Thisconstexpr auto size() const noexcept requires(!Unique) { return...

View Article

Image may be NSFW.
Clik here to view.

Why text-based regex engines cannot handle lazy quantifiers?

I have came across many times that, text-based regex engines cannot support lazy quantifiers. But I could not find why. But I came to know that, they internally use DFAs, and they do not backtrack.Then...

View Article


Python2 unable to pickle string

This link says that both normal and unicode strings can be pickled. But when I try following, def __del__ (self): with open(self._pkl, 'wb') as f: pickle.dump(dict(self._rec), f)I'm gettingException...

View Article


Understanding sequential consistency fence in C++

I was reading about memory orders in C++. I could understand relaxed and acquire-release models a well. But I'm struggling with sequential-consistency.If I am not wrong, from cppreference,...

View Article

Failed to get default debug keystore location

I changed my project default location in Android Studio Settings from /Documents/Android Studio projects to /Documents/AndroidProjects. Then I moved an existing project from former to latter in file...

View Article

Comment by Sourav Kannantha B on Why no emplacement iterators in C++11 or C++14?

If I have deleted copy and move constructors for my class, then I suppose I can't use insert_iterator, and hence I want a emplace_iterator.

View Article


Comment by Sourav Kannantha B on Does C++ support named parameters?

@mara004 but then you almost cannot use it with any std function calls because different library vendors (libstdc++, libc++) have different names used to declare the same function. An example for that...

View Article

Comment by Sourav Kannantha B on In Unicode why क़ is excluded from...

@Luuk "The list of script-specific composition exclusions constituted a one-time adjustment to the Unicode Normalization Algorithm, defined at the time of the composition version in 2001 and unchanged...

View Article

Comment by Sourav Kannantha B on What are carriage return, linefeed, and form...

@user3346547 in your example nine is printed in the beginning of the next line because your stty has onlcr turned on which is converting \n to \r\n. If you turn that off, \n actually moves the cursor...

View Article

auto formatting using yapf to put parameters on multiple lines in condensed...

Related to this. But instead of putting all arguments on single line, I want to put them onto multiple lines in condensed form.Basically I want to transform:def f(arg1: typ1, arg2: typ2, ..., ...)...

View Article



Comment by Sourav Kannantha B on Python dataclass from a nested dict

Note that to make this work with generics, lot of additional code needs to be added. Also by fetching types from typing.get_type_hints rather than dataclasses.fields would be better as the...

View Article

Comment by Sourav Kannantha B on Python dataclass from a nested dict

@KonradHałas does this work with py3.12 generic classes?

View Article

Answer by Sourav Kannantha B for Why does Python not allow Generics with...

As mentioned in this answer, unfortunately it is not possible to type check generics at runtime. But if your use case to assert types for type checkers like my in case, this is what I came up with:def...

View Article

Answer by Sourav Kannantha B for Python dataclass from a nested dict

I came across this apischema library. It provides both serialization and deserialization of data-dataclasses.Here is an example:from apischema import deserialize, serialize# Define a schema with...

View Article


Comment by Sourav Kannantha B on Python dataclass from a nested dict

Note that this doesn't work with frozen dataclasses.

View Article

Comment by Sourav Kannantha B on How to differentiate address sanitizer error...

@StephenNewell what you are suggesting is a workaround. I'm expecting an actual solution to this issue

View Article

Answer by Sourav Kannantha B for Force gnu make to rebuild objects affected...

Above answer is preferable than this answer. But when I encountered same problem, before finding the above solution I implemented it in the following way.flagstamp.sh:#!/bin/bashFLAGS=$1FLAGFILE=$2#...

View Article

Browsing latest articles
Browse All 60 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>