Do It by Code
54 subscribers
713 photos
99 videos
15 files
1.24K links
We uhhhhh... do things by coding them.
Download Telegram
"An atomic load is ~5x faster than a mutex, which can matter in tight loops."

1. Mutex Operations: A mutex involves several expensive operations:
- System calls to the kernel
- Potential context switches
- Lock contention handling
- Thread scheduling overhead

2. Atomic Operations:
- Execute directly on the CPU using special hardware instructions
- Don't require kernel intervention
- No context switching
- No thread scheduling overhead

The ~5x performance difference comes from eliminating all the mutex-related overhead. However, it's important to note that atomic operations aren't always the best solution - they're ideal for simple operations like this error check, but mutexes are still necessary for more complex critical sections where you need to protect multiple operations.


- Commit
👍1
Urban Dead is shutting down
Article, Comments
Show HN: Fork of Claude-code working with local and other LLM providers
Article, Comments
https://www.perplexity.ai/page/openai-s-20000-ai-agent-nvz8rzw7TZ.ECGL9usO2YQ

Low-end agents priced at $2,000 per month, targeting high-income knowledge workers

Mid-tier agents around $10,000 per month, designed for software development tasks

High-end agents up to $20,000 per month, functioning as PhD-level research assistants

imagine paying openai this much instead of just paying for an expert...
MathArena
Evaluating LLMs on Uncontaminated Math Competitions

https://matharena.ai/
GitHub repository
#llm #math
How to Calculate a Rotation Matrix to Align Vector A to Vector B in 3D
(Based on 'Avoiding Trigonometry' by Íñigo Quílez)
https://gist.github.com/kevinmoran/b45980723e53edeb8a5a43c49f134724
I wish this had support for d and y (day and year)

would have made things so much easier
what is the differences between these two commands?

git push --force-with-lease
git push --force

Gemini's response:
The key difference between git push --force and git push --force-with-lease lies in their safety mechanisms, particularly when working in a collaborative environment. Here's a breakdown:

git push --force:

Unconditional Overwrite:
This command forcefully overwrites the remote branch with your local branch, regardless of the remote branch's current state.
This means that if someone else has pushed changes to the remote branch since your last fetch, those changes will be lost.

Risk of Data Loss:
Due to its unconditional nature, git push --force is considered risky and should be used with caution. It can lead to accidental data loss, especially in collaborative projects.

Use Cases:
While generally discouraged, it might be used in situations where you are absolutely certain that you need to completely replace the remote branch's history, such as when cleaning up a personal feature branch.


git push --force-with-lease:

Safer Overwrite:
This command provides a safer alternative to git push --force. It checks if the remote branch's state matches your local repository's expectation before overwriting it.
Specifically, it verifies that the remote branch has not changed since your last fetch.
If the remote branch has been updated by someone else, the push will be rejected, preventing accidental overwrites.

Preventing Accidental Overwrites:
git push --force-with-lease helps prevent you from unintentionally overwriting other people's work.

Use Cases:
It's recommended for situations where you need to force push after rebasing or rewriting history, especially in collaborative environments.
In essence:

--force is a blunt instrument that can cause significant damage.
--force-with-lease is a more refined tool that adds a safety net.
Therefore, git push --force-with-lease is generally the preferred option when you need to force push, as it minimizes the risk of data loss.


#git #force_push
how to change your commits' old email if you have lost access to that old email?

git filter-repo --email-callback '
if email == b"old_email@example.com":
return b"new_email@example.com"
else:
return email
'

(if you are on windows, consider using "git bash")

if you have signed your commits, then your signatures will become invalidated after running this command.

To re-sign your commits, you have multiple ways:
1. If you are a normal person and care about your commit dates:
git rebase --exec 'CURRENT_COMMIT=$(git rev-parse HEAD); GIT_AUTHOR_DATE_ISO=$(git show -s --format=%aI "$CURRENT_COMMIT"); export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE_ISO"; git commit --amend --no-edit -S --date="$GIT_AUTHOR_DATE_ISO"; unset GIT_COMMITTER_DATE GIT_AUTHOR_DATE_ISO CURRENT_COMMIT;' --root


2. If you DO NOT CARE about your commit dates being set to TODAY (this will cause significant grief and suffering for you, because your commit dates will all be set to NOW; you will lose your real commits dates):
git rebase --exec 'git commit --amend --no-edit -S' --root


(thanks to Gemini 2.0 Flash for providing code and emotional support)

#git #git_email
Tweeter (newly X) has been down for more than 3 hours now
Forwarded from frepplace
This media is not supported in your browser
VIEW IN TELEGRAM
idk if i'll keep using a 3D curve for AI, but it was fun to try
MatCap (Material Capture) in Blender is a type of shader/material visualization. It's essentially a simplified shading system that uses a spherical environment map to fake complex lighting and materials.

MatCap works by:
- Using a pre-rendered spherical image that contains lighting, reflections, and material properties
- Mapping this image onto your 3D model based on the normal direction relative to the camera
- Creating the illusion of a fully shaded material with minimal processing

It's particularly useful for:
- Sculpting, when you want to clearly see the forms without waiting for complex lighting calculations
- Quick visualization of models
- Non-photorealistic rendering styles
- Performance-critical applications

You can find MatCap in Blender's viewport shading options, and there are many MatCap textures available to simulate different material appearances like metal, clay, plastic, etc.

While not a full shader in the traditional sense (like Principled BSDF), it functions as a simplified visualization method that can be very effective for certain workflows.
Do It by Code
there isn't many more reliable news about this than what we already know tho. but apparently, the group behind this, is called lazarus-group, and it's not their first time doing this: - September 2024: BingX hack (~$52 million) - July 2024: WazirX hack…
Lazarus Targets Solana and Exodus Wallets, Infecting Hundreds of Software Developers

totally not Lazarus, someone stupid have been pushing some very obvious obfuscated js code to npm duh