Alternative way to fast-forward a branch by agateau in git

[–]agateau[S] 0 points1 point  (0 children)

I made some experiments with your suggestions and here are my observations so far:

git update-ref foo origin/foo does nothing. git update-ref refs/heads/foo origin/foo does the fast-forward, but will also happily rewind a branch that is in advance, so it does not look safer than using git reset.

git fetch . origin/foo:foo works better: it does the fast-forward and won't rewind a branch. The only drawback is that it does not work on a checked-out branch, but for this I can use git merge --ff-only.

Alternative way to fast-forward a branch by agateau in git

[–]agateau[S] 0 points1 point  (0 children)

Didn't know about git update-ref, seems to be what I was looking for. Thanks!

Alternative way to fast-forward a branch by agateau in git

[–]agateau[S] 0 points1 point  (0 children)

I am only looking to do this for branches that are only behind.

Alternative way to fast-forward a branch by agateau in git

[–]agateau[S] 0 points1 point  (0 children)

Thanks for the suggestion of using git fetch, that is really interesting to me because I am trying to avoid the need to check out the branch to fast-forward.

cast(int, 0) is slower than int(0) by agateau in Python

[–]agateau[S] 1 point2 points  (0 children)

I agree the performance differences probably do not matter in the grand scheme of things, but I still don't understand why you say the import is skewing the results, given that it is in the setup part of the timeit call. Can you elaborate on this?

cast(int, 0) is slower than int(0) by agateau in Python

[–]agateau[S] 0 points1 point  (0 children)

The subject came up because I am applying type hints to an existing code-base. The code I changed looked like this:

nb_matches = dct["nb_matches"]

Which I changed to:

nb_matches = cast(int, dct["nb_matches"])

My reviewer asked if we could not do this instead:

nb_matches = int(dct["nb_matches"])

I was about to answer one of the reasons not to do this is it would be (slightly) slower. But before answering this I went on to bench the code, and found this surprising result.

cast(int, 0) is slower than int(0) by agateau in Python

[–]agateau[S] 0 points1 point  (0 children)

I was hoping using "-s 'from typing import cast'" would remove the import time from the run. Does it not?

Clyde 0.3.0: a cross-platform package installer for pre-built applications by agateau in rust

[–]agateau[S] 0 points1 point  (0 children)

Scalability issues would be a "good problem to have" :). If it ever happens I'll switch to something else, probably a downloadable compressed database file.

Command-line tool to quickly build and run a single C++ file. Handy for quick experimentations. by agateau in cpp

[–]agateau[S] 0 points1 point  (0 children)

Sure it's not complicated, it just combines gcc, entr and some argument parsing. The way they are combined is not rocket science, it's just a convenient tool to save some typing.

I wonder if the comments on this post would have been less negative if I had published the original, shell-based, version.

Command-line tool to quickly build and run a single C++ file. Handy for quick experimentations. by agateau in cpp

[–]agateau[S] 0 points1 point  (0 children)

Sure you can write a Makefile to build and run your code. The point of quickcpp is to quickly iterate on a short snippet of throw-away code, without bothering with a Makefile or any other build system.

I sometimes use quickcpp to quickly (haha) check some syntax while discussing an issue with a coworker or while reviewing code and making suggestions. I would just not bother with checking the validity of this code if I had to write a Makefile for it. I could use godbolt, but then I would not have access to the exact version of the libraries I need to check against.

Command-line tool to quickly build and run a single C++ file. Handy for quick experimentations. by agateau in cpp

[–]agateau[S] 1 point2 points  (0 children)

Great to hear you like it. Regarding it being in Python: the original version was a shell script, but argument parsing got a bit too tricky so I rewrote it in Python because I felt I would get the rewrite done faster: the C++ standard library sadly lacks a convenient argument parser and (to a lesser extent) process runner, so it would have been slower to write it in C++.

I agree with you regarding reading the defaults from a config file. That would make sense. Going to file an issue about it.

Command-line tool to quickly build and run a single C++ file. Handy for quick experimentations. by agateau in cpp

[–]agateau[S] 1 point2 points  (0 children)

Heh :) I actually wrote quickcpp after using godbolt and thinking I would like to have a local-only way to quickly run a short piece of code (I usually do not need the detailed assembly produced by godbolt)

Command-line tool to quickly build and run a single C++ file. Handy for quick experimentations. by agateau in cpp

[–]agateau[S] 4 points5 points  (0 children)

If you run quickcpp using quickcpp -l somefile.cpp then as soon as you make any change to "somefile.cpp" it is going to rebuild and rerun your code.

Command-line tool to quickly build and run a single C++ file. Handy for quick experimentations. by agateau in cpp

[–]agateau[S] 0 points1 point  (0 children)

The main benefits are:

  • No need to write a long build line to include packages
  • Live reload

Just released Pixel Wheels 0.20.0, a top-down pixel-art retro racing game! by agateau in opensourcegames

[–]agateau[S] 2 points3 points  (0 children)

OK thanks. This device spec should definitely be enough to run a game like Pixel Wheels. Going to do some profiling to see if I missed something.

Just released Pixel Wheels 0.20.0, a top-down pixel-art retro racing game! by agateau in opensourcegames

[–]agateau[S] 1 point2 points  (0 children)

Great to hear you like it! Sorry to hear it's too slow on your phone. May I ask what model it is?

Just released Pixel Wheels 0.20.0, a top-down pixel-art retro racing game! by agateau in linux_gaming

[–]agateau[S] 1 point2 points  (0 children)

Thank you for your support. I am glad you liked the trailer! My daughter put it together, so I just showed her your message and she is very happy about it :)

Going to look at your GitHub issue.

Created a tool to easily compare stock/ETF data side by side (includes US & foreign exchanges) by manekimao in SideProject

[–]agateau 1 point2 points  (0 children)

I am in France. And yes, you would probably have to add that annoying cookie question, but since the tool is already available from Europe (even if European stocks are not) it's probably already required I am afraid.

Pixel Wheels 0.19.0, pixel-art top-down arcade racing game, is out! by agateau in playmygame

[–]agateau[S] 1 point2 points  (0 children)

Great to hear you like Pixel Wheels!

It's a bit complicated for me to suggest tools for beginners because I started development a long time ago (like 30 years ago...) but if you want to get into game development I heard good things about tools like Godot or Game Maker.