Readit News logoReadit News
bobbyi commented on Lateralized sleeping positions in domestic cats   cell.com/current-biology/... · Posted by u/EvgeniyZh
Fluorescence · 9 months ago
This matches my kitty.

I noticed her preference because if I lie on my left-hand side, she is a very happy little spoon and uses my arm as a pillow.

If I lie on my right-hand side, kitty is confused. She will take extra preparatory rotations hoping that one more turn will be enough for the problematic situation to resolve. After some hard stares, maybe an annoyed huff, she will reluctantly curl-up as a face-to-face non-spoon.

bobbyi · 9 months ago
That could be habit if she got used to one side rather than brain asymetry
bobbyi commented on Detecting if an expression is constant in C   nrk.neocities.org/article... · Posted by u/signa11
bobbyi · 10 months ago
I thought this would work:

#define C(x) (sizeof(char[x]), x)

sizeof is a compile-time operation so x need to be known at compile time.

It didn't work as expected. It turns out there is an exception and the standard says that sizeof is actually calculated at runtime specifically for variable length arrays:

> The sizeof operator yields the size (in bytes) of its operand, which may be an expression or the parenthesized name of a type. The size is determined from the type of the operand. The result is an integer. If the type of the operand is a variable length array type, the operand is evaluated; otherwise, the operand is not evaluated and the result is an integer constant.

bobbyi commented on Bill Gates tries to install Movie Maker   techemails.com/p/bill-gat... · Posted by u/lifeisstillgood
OldGuyInTheClub · 2 years ago
I always thought Gates was feared by his employees. Unless I'm missing something, all the following emails passed the buck with no one saying, "The boss is pissed and we had better fix the mess."
bobbyi · 2 years ago
He's not the boss anymore at this point (2003). Ballmer took over as CEO in 2000.
bobbyi commented on Weird Ruby: Nil Conversions   metaredux.com/posts/2024/... · Posted by u/unripe_syntax
Calavar · 2 years ago
I really don't consider this to be a gotcha. If you explicitly cast to type X, it isn't surprising to get back an object of type X, right? These aren't implicit type conversions a la the Javascript + operator
bobbyi · 2 years ago
It is if the object can't be meaningfully cast to the type. I'd expect to get an exception. That's why they exist.

For example, consider explicitly casting the string "abc" to an int. Python throws a ValueError. Ruby silently ignores the problem and gives 0. I consider the Ruby behavior to be a gotcha.

bobbyi commented on Phind-70B: Closing the code quality gap with GPT-4 Turbo while running 4x faster   phind.com/blog/introducin... · Posted by u/rushingcreek
rushingcreek · 2 years ago
Phind founder here. You can try the model for free, without a login, by selecting Phind-70B from the homepage: https://phind.com.
bobbyi · 2 years ago
I'm selecting 70B and it is coming back with "Answer | Phind-34B Model".

I'm not sure if it's really using the 34B model or if the UI is wrong about which one it used

bobbyi commented on Things unexpectedly named after people (2020)   notes.rolandcrosby.com/po... · Posted by u/prawn
xwowsersx · 2 years ago
I've driven the Outerbridge Crossing probably hundreds of times. That one is blowing my mind.
bobbyi · 2 years ago
The other NYC bridges are all (I think?) named Bridge, but they went with Crossing here because Outerbridge Bridge sounds weird.

Another NYC one: A lot of people think "major" in The Major Deegan Expressway means it is a significant expressway, but actually the expressway is named after (Army) Major William Deegan

bobbyi commented on Memory and new controls for ChatGPT   openai.com/blog/memory-an... · Posted by u/Josely
fritzo · 2 years ago
I end up deleting chats because I can't search them.
bobbyi · 2 years ago
Why can't you search them? In the android app at least, I've never had a problem with search working properly
bobbyi commented on Unix shells and the current directory   utcc.utoronto.ca/~cks/spa... · Posted by u/ingve
didntcheck · 2 years ago
ls -l also works. I often do

  ls -l /proc/`pidof foo`/fd
to see what files a taciturn process is working on

bobbyi · 2 years ago
lsof is also good for seeing what files a process is using https://www.thegeekstuff.com/2012/08/lsof-command-examples/
bobbyi commented on A peculiarity of the GNU Coreutils version of 'test' and '['   utcc.utoronto.ca/~cks/spa... · Posted by u/ingve
hallman76 · 2 years ago
Thanks hn for doing what you do! I'm so glad to see this here.

A few months back I noticed '[' under /bin on my mac. I tried googling to understand what it was, but my google-fu came up short. It felt like one of those ungoogleable things. This link is an excellent starting point for me.

bobbyi · 2 years ago
Searching for /bin/[ gets reasonable results for me

https://www.google.com/search?q=%2Fbin%2F%5B

bobbyi commented on Escape analysis hates copy elision (2021)   quuxplusone.github.io/blo... · Posted by u/pornel
Thorrez · 2 years ago
> Suppose S::make and take_ownership were secretly colluding, like this:

     std::unique_ptr<S> *global;
     
     std::unique_ptr<S> S::make() {
         std::unique_ptr<S> origp = std::make_unique<S>();
         global = &origp;
         return origp;
     }
     
     void take_ownership(S *rawp) {
         delete rawp;
         *global = std::make_unique<S>();
     }

>The compiler cannot rule out this possibility

Why can't the compiler rule out that possibility? That looks like undefined behavior code to me, so thus the compiler could rule it out. S::make() is storing a pointer to a local variable (origp), and then that pointer is being accessed after S::make() has returned. I'm pretty sure that's undefined behavior.

bobbyi · 2 years ago
The usual justification for having a concept of "undefined behavior" at all is specifically to allow compilers to "rule out this possibility" so they can make this sort of optimization.

u/bobbyi

KarmaCake day1158April 1, 2007View Original