21 karma · joined Jan 17, 2020 (6y ago) · 28 submissions
comment 2y ago · link · parent
When I see the term "ice-cream", I think of cold white creamy thing on a cone that you can buy from fast food chains. That is different from what we call "dondurma" here in Turkey. That is much softer and more creamy than "dondurma".
Turkish people probably saw the dessert from Europeans. At least that's what Nisanyan says.
3.
C Structure Padding Initialization(interrupt.memfault.com ↗)
2 points · by belgesel · 3y ago · discuss
11.
A Teenager's Guide to Workplace Ethics(madned.substack.com ↗)
3 points · by belgesel · 5y ago · 1 comment
comment 5y ago · link · parent
comment 5y ago · link · parent
struct my_struct{int a; char private[10];}
void * get_struct_field_nonconst(struct my_struct *ptr)
{ return &(ptr->private[0]); }
With these elements you are only allowed to give non-const pointers to read or write inside private field.
In order to truly apply this to const pointers (no casting etc.) you will need another get_struct_field() function but defined as this. const void * get_struct_field_const(const struct my_struct *ptr)
{ return &(ptr->private[0]); }
This will work but it is ugly. Here _Generic keyword allows you to write these functions but use them with a common name. Such as get_struct_field(). And that would be something like this: #define get_struct_field(ptr) \
_Generic((ptr), \
const struct my_struct * : get_struct_field_const, \
struct my_struct * : get_struct_field_nonconst) \
(ptr)
Hope this would help!comment 5y ago · link · parent
Suppose that I want to return a pointer to a field inside of a struct. Either I had to write const and non-const versions of the same function and use them which brings unreadable code. Or I would have to define argument as const and return non-const pointer which defeats the purpose of const in the first place.
This keyword allows me to use same function name with const and non-const pointers.
comment 5y ago · link · parent
5G: The outsourced elephant in the room - https://berthub.eu/articles/posts/5g-elephant-in-the-room/
And also HN Discussion - https://news.ycombinator.com/item?id=26843068
comment 5y ago · link · parent
This subject was always used against Turkey in political confrontations for years. Turkey has been better and stronger ally to USA. This recognition is nothing but a political warning against Erdoğan and his latest actions against USA and also this will make Armenian residents in USA happy.
IMHO nothing will change for us (Turkish and Armenian folks living in Turkey), don’t know about Armenians living in Armenia.
So why are you happy?
comment 5y ago · link · parent
But I am wondering how will they make it work with underlying Linux mechanisms. One of the first challenge that comes to my mind is RCU or any other memory reclamation functions. Will they not use these memory mechanisms at all or call them from Rust source code?