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

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


Comment by Sourav Kannantha B on x86 MUL operation at hardware level

@SK-logic what is the large lookup table for? Also for Dadda multiplier, how do they shift a number 32 times? Does it have 32 barrel shifters?

View Article


Comment by Sourav Kannantha B on How do I add custom field to Python log...

Can there be log record factory per thread?

View Article

Comment by Sourav Kannantha B on Creating an un-instantiable class

@Puddle In my case, I want to create an interface and have multiple different implementations of that interface. Hence module style doesn't work AFAIK as I can't ensure that those implementations...

View Article

Reorder WhatsApp images in Google Photos according to the dates in the name

When I bought new Android device and installed WhatsApp there, it downloaded all media files from Drive backup. Now when I open Google Photos, all those 1000+ images are in same date, the date in which...

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 C++20 Concept to check tuple-like types

Note that en.cppreference.com/w/cpp/utility/tuple/tuple-like says that reference for a tuple-like is also tuple-like.

View Article


Comment by Sourav Kannantha B on Forwarding all constructors in C++0x

Implicitely generated CTADs seem to be not working with this. Do you have any idea?

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 all 60 articles
Browse latest View live


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