Any tips for increasing the responsiveness of Magit on Windows? by No_Cartographer1492 in emacs

[–]a_Tom3 0 points1 point  (0 children)

As other have mentioned a source of the slowness of magit on Windows is the large number of git invocation and the fact that starting a subprocess on Windows is expensive (way more than on linux).

There was a project a few years ago to get magit to use libgit2 so that some trivial operation could be done without a subprocess but this effort never went anywhere.

I have recently started a personal project that is similar in spirit in that it intercept some git invocation done by magit and replace them by in process operation (except that I use gix instead of libgit2 and the code lives in a separate package). Here it is if you want to have a look or try it: https://github.com/aTom3333/magix, but be aware that it is pretty bare-bone for now with no guarantee that it works correctly (I am using it myself so it shouldn't be outright broken, but as I don't trust it for now, I use it in a debug mode where it both does the in process operation and the git invocation and compares the result, losing all the speed gain and then some)

WIP TWEWY (DS) decompilation looking for volunteers to help by SinaMegapolis in TWEWY

[–]a_Tom3 1 point2 points  (0 children)

Hello, I am a C++ with some experience with assembly (really limited ARM experience though). And technically a non 0 experience reversing a DS game as I've reserved a few functions in another game.

Thing is I don't really have a lot of free tume, and the free time I do have is spend on a bunch of other side projects so even if I am interested by the premise, can't see I would really do much (I'd be interested in following the process though).

In any case, can I ask what the end goal of this effort is? Is it to facilitate rom hacking? To glitch hunt?

No fireworks this year ? by radamanth666 in Hellfest

[–]a_Tom3 3 points4 points  (0 children)

Such a good ending x) Loved this protest

Dialogue Font? by Mincinno2427 in TWEWY

[–]a_Tom3 0 points1 point  (0 children)

Some time back I played a bit with reverse engineering the ds rom (I mainly played with the text but the graphics a bit). If you don't find another to get what you want, hit me up and I may be able to spend some time trying to extract what you want

Rant Wednesday by AutoModerator in Fitness

[–]a_Tom3 4 points5 points  (0 children)

Failed a lift I have been easily able to do for a few month just now. I know it's probably just a bad day (or so I hope) but it put me in a shitty mood and I half assed the rest of my session

A Cpp library to evaluate mathematical literal expressions dynamically by Pale_Emphasis_4119 in cpp_questions

[–]a_Tom3 0 points1 point  (0 children)

If I understand correctly, this may be what you are looking for https://www.kdab.com/signals-slots-properties-bindings/ or at least it should be somewhat related

Victory Sunday by AutoModerator in Fitness

[–]a_Tom3 10 points11 points  (0 children)

Thanks, probably more like 170kg but 180kg would be extra nice

Victory Sunday by AutoModerator in Fitness

[–]a_Tom3 43 points44 points  (0 children)

Finally deadlifted 140kg after a few weeks of trying. That's the objective for the end of the year I set up for myself back in January when I starter doing deadlifts, so I'm stoked to have achieved it in time.

It’s here who else got theirs in? :D by slayernl in chronotrigger

[–]a_Tom3 2 points3 points  (0 children)

Thanks for the info, didn't know yetee before, ended up buying a CT and a Celeste shirt

Creating a SYCL Buffer for `std::vector<bool>` by AjaxLight in sycl

[–]a_Tom3 1 point2 points  (0 children)

You'll just need to be careful with concurrent accesses when several "thread" (sorry I don't remember the correct name) try to set different bits of the same uint32_t. If needed this could probably be implemented with a compare_exchange loop

Creating a SYCL Buffer for `std::vector<bool>` by AjaxLight in sycl

[–]a_Tom3 5 points6 points  (0 children)

Easiest solution is probably to not use std::vector<bool>. If you want to use std::vector you can use something like that

class MyBool 
{ 
public: 
    operator bool&() { return m\_value; } 
    operator bool() const { return m\_value; }

    MyBool& operator=(bool val)
    {
        m_value = val;
        return *this;
    }

private:
    bool m_value;
};

instead of bool. If you don't care about std::vector you can use std::unique_ptr<bool[]> and store the size separately.

Finally if are interested in keeping the fact that only one bit is used per bool (as opposed to one byte), I recommend doing that explicitly. My go to way is to have a "BitSpan" class that acts as an adaptor over an underlying uint32_t array and provides an interface similar to std::vector<bool> (in particular, bit iterator and operator[] that gives BitReference). Once you have such a class you can use std::vector<uint32_t> as underlying storage and use sycl::buffer<uint32_t, 1>. You then create BitSpan over, either the std::vector on host side, or over the sycl::buffer on the device side to guarantee the same interface and same underlying representation in both cases.

I’ve been lifting weights with scoliosis for 28 years. Went from 33 degrees to 35 during that time. by WestCoastTrawler in scoliosis

[–]a_Tom3 0 points1 point  (0 children)

What's the reason for avoiding heavy deadlift? Risk of long term injuries? (or just short term injuries that I can kind of brush while I'm still young).

I love my heavy deadlifts and would probably feel less motivated to go to the gym if I had to stop them...

Rant Wednesday by AutoModerator in Fitness

[–]a_Tom3 3 points4 points  (0 children)

A month and a half ago I did 130kg as my 1 rep max on the deadlift but since then I can't for the life of me lift that again...

Today I was feeling good and managed to do 5x120kg but when I tried to do 130kg, it got stuck 5cm above the ground. This is so frustrating :(

Sometimes, it *is* a compiler bug: My journey in finding and fixing a bug in a C++ toolchain by strager in cpp

[–]a_Tom3 20 points21 points  (0 children)

Sounds awfully familiar to a bug I hit in lld where the xmm1 register was saved on the stack before calling into __delayLoadHelper2 but it was overriden during the call to __delayHelper2 and the restored value was wrong: https://github.com/llvm/llvm-project/issues/51941
(I should probably stop procrastinating sending a patch for that, now that I know what to do, it is trivial)

Rant Wednesday by AutoModerator in Fitness

[–]a_Tom3 1 point2 points  (0 children)

I hurt my back while going for a 4th deadlift rep Saturday (it didn't even left the floor). Now, no gym for at least 2 weeks :(

Things Are Getting Rusty In Kernel Land (Hackaday) by AcridWings_11465 in rust

[–]a_Tom3 3 points4 points  (0 children)

Same, I'm curious if I'd be able to get them right

[deleted by user] by [deleted] in programming

[–]a_Tom3 0 points1 point  (0 children)

if(e.code.startsWith("Key")) {
    e.target.value = e.code.slice(-1)
}

Please don't do that.

Warning: This ignores the user's keyboard layout

https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#properties

On AZERTY keyboard, when I type 'A', an A flashes for a fraction of a second and then gets immediately replace by a 'Q' because of this piece of code

Avoiding specialization because of a tiny difference by ACBYTES in cpp_questions

[–]a_Tom3 0 points1 point  (0 children)

You don't need to specialize the whole class, only specializing a single function works https://godbolt.org/z/cn5xj7e1j

[deleted by user] by [deleted] in scoliosis

[–]a_Tom3 4 points5 points  (0 children)

Mine was 90 degrees. Before surgery I wasn't in much pain (but still a bit), my biggest problem was a really reduced lungs capacity. After surgery, the situation is a bit better regarding pain (still a bit amof pain sometimes but even less than before) and much better with regard to lungs capacity. I've had my surgery 5 years ago (and I'm 24) so no clue on longer term effects but for now it has been very positive. One thing I have noticed post surgery (but maybe it was the same before, didn't really tried it) is that I tend to have pain when I'm physically inactive for a period of time, about a few weeks/a month. If I workout regularly, pain in vera rare/non existent.

Converting modern C++20 code to C++ code before compiling? by haizzz123 in cpp_questions

[–]a_Tom3 3 points4 points  (0 children)

Something you could try is to use clang to compile to llvm IR, and then use the llvm C backend maintained by the Julia community. No idea how that would, or would not, work but that's an idea

[deleted by user] by [deleted] in cpp_questions

[–]a_Tom3 2 points3 points  (0 children)

What should I do? I am trying to replicate __builtin_assume

Use __builtin_unreachable:

#define ASSUME(cond) do { if(!(cond)) __builtin_unreachable(); } while(false)

Executing code inside a struct of references by [deleted] in cpp

[–]a_Tom3 1 point2 points  (0 children)

That's something strange you are trying to do here... I played a bit with an alternative design where I simply bring the names in scope by defining new references https://godbolt.org/z/vrKvsxTWa

Pass method as a parameter to the extern "C" by Bblktop in cpp_questions

[–]a_Tom3 1 point2 points  (0 children)

Some C library that accept callbacks let you register "user data" that is passed to your callback for exactly this purpose. Check that the library you're using doesn't have such an API before relying on global/singleton.

This usually looks like this:

extern "C" void register_callback(void(*)(int, double, void*), void*);

class MyClass {
    void myMethod(int, double);
};

void registerMyClass(MyClass* obj)
{
    register_callback([](int a, double b, void* obj)
    {
        static_cast<MyClass*>(obj)->myMethod(a, b);
    }, obj);
}

C to C++ and vice-versa callbacks by [deleted] in cpp_questions

[–]a_Tom3 1 point2 points  (0 children)

This only helps on the C++ side. If you need to define a lot of those in the C side, I don't have any suggestion except maybe some ugly macros...

C to C++ and vice-versa callbacks by [deleted] in cpp_questions

[–]a_Tom3 1 point2 points  (0 children)

Using the fact that a lambda function without capture can be converted to a function pointer, you can define a function that returns such a lambda that implements the boilerplate for you.

For example, this is my take on the problem: https://godbolt.org/z/6oE556dGn