« first day (3510 days earlier)      last day (1420 days later) » 

2:11 AM
__m128i first = _mm_loadu_si128((__m128i *)arr1);
__m128i second = _mm_loadu_si128((__m128i *)arr2);
_mm_add_epi32(first, second);// this does not seem to work for unaligned values?
 
 
1 hour later…
@ProblemSlover "hardcore stuff", or "stuff for hardcore lunatics"?
 
4:05 AM
Hardcore lunatic as opposite to ... a softcore lunatic?
in Android, 15 hours ago, by TelKitty
Just between you & me (and the whole internet), jogging while dancing like a manic at dusk on own private farm makes me tremendously happy. All the adrenaline ... and the thrill of acting like a lunatic while nobody can see is very satisfying.
 
@JerryCoffin kill me but this stuff i would love to do if i were in my student ages when i had bunch of free time.. which i wasted on video gaming instead so makes me feel quite regretful about time!
 
4:38 AM
Playing video games is much preferable to web development in C.
 
 
3 hours later…
7:47 AM
@ProblemSlover The word "security" appears zero times in the article.
 
 
2 hours later…
9:38 AM
I got a fun multithreading oddity on Windows. So one thread does while (true) {std::scoped_lock lk(m);//something} and another thread has set_value(auto a) {std::scoped_lock lk(m);A=a;}. So the fun part here is that "set value" function seems to never, ever get thread quanta. The while(true) loop always, seems to lock/unlock the damn lock.
And writing something more complex seems sad.
 
nwp
That sucks, but I'm drawn to the probably useless lk identifiers making me think of a macro to make with (lk) { //something } work.
shedding all the bikes
 
Remember Java's synchronized blocks?
 
nwp
I never used them, I only looked at them for comparison with other ways.
I used Python's with open("file") as f: quite a bit. I think that also works for mutexes.
 
10:15 AM
@nwp When you use Python's òpen("file") as f:` what does calling the read(12) method like this do?
 
nwp
It reads up to 12 characters? This sounds like a trick question.
 
@nwp hmm, not a trick question. I thought may be it would read 12 bytes.
 
nwp
I think it defaults to text mode where it reads characters. open("file", "rb") should read bytes.
 
Isn't rb default?
 
10:30 AM
@nwp that's very useful to know.
 
nwp
Aaaaah why does this not compile?
 
@nwp you got me there. I have zero experience with c++.
In fact c++ reads like hieroglyphics to me.
I'm trying to understand a C++ code base and despite my background in fellow c family languages it looks completely foreign to me.
And what's with c++ projects on github having so many files?
 
11:08 AM
What is more idiomatic, const int or int const?
 
@fredoverflow east const and west const is gang war
 
nwp
It's like tabs vs spaces. People don't agree. There are some cool videos about the topic.
And sadly it's not a formatting option in clang-format or clang-tidy.
 
Used to be east const, until this happened const int* const
 
11:37 AM
I guess I'm a west const guy:
return if (underlying is PointerType) {
    underlying.declaration("const$result")
} else {
    "const $underlying$result" // change to "$underlying const$result" for east const
}
Anyway, I'm glad converting types to C declarations (mainly for type error messages) finally works:
val callback = PointerType(FunctionType.binary(SignedIntType, SignedIntType, SignedIntType))
assertEquals("int(*(int(*)(int,int)))(int,int)", FunctionType.unary(callback, callback).toString())
 
12:12 PM
 
I find East coast more idiomatic.
 
I could choose between west const and east const in the error messages based on what the programmer actually uses in the source code.
 
Does a struct in c++ work the same as a struct in C#?
 
nwp
It doesn't.
 
struct and class are almost the same in C++.
They merely differ in visibility defaults.
 
nwp
12:23 PM
If you want serious answers about C++ consider using the Q&A room.
 
@nwp Whaat? I thought this was the main C++ chat room?
 
The lounge is casual, not serious.
 
I see.
 
nwp
It's a lounge to recover from the mental trauma caused by C++ and for hanging out. The other one is for C++ Q&A.
 
Here is busier so I'll try.
@nwp I can imagine. I thought JavaScript code does a lot of magic, but wow C++ might be worse.
My question is:
 
12:26 PM
C# classes have reference semantics, C# structs have value semantics. C++ has no such distinction. C++ classes and C++ structs both have value semantics. If you need reference semantics, use (smart) pointers.
 
What is the difference between a struct and an object since both are named containers for values, and both need to be instantiated?
 
nwp
That is really a question for the other room.
 
I don't understand the question. You can have struct objects.
 
@fredoverflow Okay, thanks. What do you mean reference semantics.
@fredoverflow Let me rephrase it:
 
12:29 PM
What is the difference between instantiating a struct and instantiating a class since both instances are named containers for values, and both instances need to be instantiated?
 
@MyWrathAcademia In C++? There is no difference regarding instantiation.
 
Members and base classes are constructed as private by default in classes, whereas they are public by default in structs.
 
@fredoverflow I just watched your video. What a great little introduction to C++. Do you make videos like this that get someone already familiar with Java and C Sharp to learn C++ quickly? It may be more effective than reading one of those huge C++ books.
By the way, you're German, yes? You have a similar accent to my friend.
@TelKitty Thanks. So except for those differences, a struct is exactly the same as a class?
 
nwp
12:55 PM
It's better to think of the struct keyword as making a class. You cannot distinguish structs from classes because they are the same thing. That class exists at all is a historic error.
 
@nwp great. I'll keep that in mind.
I'll think of the struct keyword as an alias for the class keyword.
 
nwp
Which is not quite correct because of the default visibility.
You can think of struct as an alias for class { public:. Except you have to fit the name in there and inheritance.
 
@nwp Okay. I noticed that in C Sharp unless I inherit from an instance of the same struct I have to initialize any fields and properties in the constructor. Is this the same in C++?
 
nwp
Kinda. You have to initialize things before you read from them, but it's not enforced by the language. You just get more or less screwed if you forget.
 
1:58 PM
@nwp Thanks, but what I mean is even when I am not reading from an instance field or accessing it via an instance property, in C Sharp I still need to initialize all fields because all fields and properties in a C Sharp struct must be fully assigned before control is returned to the caller of the struct's constructor.
 
nwp
There is no such rule in C++.
 
Okay, visual studio is giving me an error with that warning.
 
user7659542
Network interface cards with a SATA interface, does such a thing exist?
 
what do mean, like a NIC connected via SATA to cpu or like Ethernet over SATA? I don't remember seeing either
 
user7659542
@PeterT NIC connected via SATA to CPU
 
user7659542
2:08 PM
or is SATA really excusively used for SSD/HDD?
 
user7659542
if yes, won't be long before SATA becomes obsolete
 
I think it has a certain protocol for storage, otherwise M.2 wouldn't have bothered including additional PCIe lanes
 
user7659542
why not just use PCI(e) for everything?
 
user7659542
2:22 PM
 
user7659542
High-end SSDs had been made using the PCI Express bus before NVMe...
 
user7659542
I therefor conclude PCIe is better than SATA, as PCI is for high-end.
 
user7659542
Yet, most SSD's nowadays still use SATA for some reason.
 
SATA just wasn't made for SSDs, it's just stuck in an antiquated mindset
most? SSDs, not really
Maybe like 5 years ago and all those bought to retrofit old PCs
 
user7659542
@PeterT you re right, they mostly seem to use NVME. Thought it was still SATA but with a different/updated connector.
 
3:08 PM
@MyWrathAcademia When it comes to possible topics, I could probably make dozens of "C++ for Java programmers" videos, but so far I've stopped at 3, they simply don't get a lot of views/feedback.
@MyWrathAcademia What error/warning exactly?
 
@fredoverflow Aaah, I see. That's too bad. At least you did make three.
@fredoverflow I'm not sure how familiar you are with C Sharp, but here goes:
@fredoverflow took a screenshot of the error:
 
3:41 PM
Yeah, C# structs are weird. You need to explicitly assign a value to each field (or auto-property) in any constructor.
You can't just leave them to their default values, like you can with classes.
 
3:57 PM
@MyWrathAcademia line 2653? wow
 
nwp
> And what's with c++ projects on github having so many files?
3
 
4:16 PM
@fredoverflow Oh man, just noticed that.
@nwp I guess putting everything in the same file solves that problem.
 
 
7 hours later…
 
1 hour later…
11:51 PM
I Changed the lyric to this song, now it sings like this:
Look at this strange photograph
Every time I do it makes me laugh
How did our eyes get so red?
Since then we are getting very fat
This is where I blew up
I think the present owner fixed it up
I never knew we ever went without
The second floor is hard for sneakin' out
 

« first day (3510 days earlier)      last day (1420 days later) »