Skip to content

Instantly share code, notes, and snippets.

View DavidAce's full-sized avatar
🔬

David Aceituno Chávez DavidAce

🔬
  • KTH - Royal Institute of Technology
  • Stockholm
View GitHub Profile
@DavidAce
DavidAce / cmake-conan-integration-dependency-provider.md
Last active March 30, 2023 07:27
cmake-conan dependency provider (for conan v1)

CMake-Conan integration for conan v1.

Inspired by the dependency-provider mechanism for conan v2

This uses the new CMake dependency provider feature to let conan resolve dependencies when you call find_packkage(<lib>) from CMakeLists.txt in your own project.

Requires

  • conan>=1.59
  • cmake>=3.24
@DavidAce
DavidAce / fmt-complex.h
Last active May 10, 2023 11:26
fmt formatter for std::complex<T> type
template<typename T, typename Char>
struct fmt::formatter<std::complex<T>, Char> : fmt::formatter<T, Char> {
typedef fmt::formatter<T, Char> base;
enum style { expr, pair } style_ = expr;
fmt::detail::dynamic_format_specs<Char> specs_;
FMT_CONSTEXPR auto parse(format_parse_context &ctx) -> decltype(ctx.begin()) {
using handler_type = fmt::detail::dynamic_specs_handler<format_parse_context>;
auto type = fmt::detail::type_constant<T, Char>::value;
fmt::detail::specs_checker<handler_type> handler(handler_type(specs_, ctx), type);
auto it = ctx.begin();
@DavidAce
DavidAce / nvidia-tdp.service
Last active November 1, 2024 13:06
Nvidia power limit at boot
[Unit]
Description=Set NVIDIA power limit above default
[Service]
Type=oneshot
ExecStartPre=/usr/bin/nvidia-smi -pm 1
ExecStart=/usr/bin/nvidia-smi -pl 275
@DavidAce
DavidAce / slack.mplstyle
Last active October 26, 2021 08:15
Matplotlib stylesheet for sharing on slack (wip)
# This is a modified style based on seaborn-darkgrid
# Seaborn common parameters
# .15 = dark_gray
# .8 = light_gray
figure.facecolor : white
text.color : .15
axes.labelcolor : .15
@DavidAce
DavidAce / prb.mplstyle
Created October 26, 2021 08:12
Matplotlib stylesheet for prb (WIP)
# Font sizes
# xx-small 5.79
# x-small 6.94
# small 8.33
# medium 10.0
# large 12.0
# x-large 14.4
# xx-large 17.28
# larger 12.0
# smaller 8.33
diff --git a/Eigen/src/SVD/BDCSVD.h b/Eigen/src/SVD/BDCSVD.h
index a5b73f8f2..2a6b08f62 100644
--- a/Eigen/src/SVD/BDCSVD.h
+++ b/Eigen/src/SVD/BDCSVD.h
@@ -952,8 +952,18 @@ void BDCSVD<MatrixType>::perturbCol0
Index i = perm(l);
if(i!=k)
{
- Index j = i<k ? i : perm(l-1);
- prod *= ((singVals(j)+dk) / ((diag(i)+dk))) * ((mus(j)+(shifts(j)-dk)) / ((diag(i)-dk)));
diff --git a/Eigen/src/SVD/BDCSVD.h b/Eigen/src/SVD/BDCSVD.h
index 1134d66e7..bb9944b41 100644
--- a/Eigen/src/SVD/BDCSVD.h
+++ b/Eigen/src/SVD/BDCSVD.h
@@ -921,7 +921,17 @@ void BDCSVD<MatrixType>::perturbCol0
Index i = perm(l);
if(i!=k)
{
- Index j = i<k ? i : perm(l-1);
+ //Sometimes we get i >= k and l == 0, leading to perm(l-1) being out of bounds
Ingredienser:
1 lime (en halv lime kan räcka, det är smaksak).
1 matsked socker (rörsocker helst)
4cl mörk rom
5-10 myntablad
is
kolsyrat vatten
Pressa ur limesaften i ett (inte för stort) glas, spara några bitar limeskal.
I samma glas, lägg i några limeskal socker och mynta.
@DavidAce
DavidAce / postinstall_commands.md
Last active September 16, 2017 09:16
Ubuntu post-install

Some programs

sudo apt install firefox nemo

Set nemo as default instead of nautilus and set terminix terminal as default for nemo

gsettings set org.gnome.desktop.background show-desktop-icons false
gsettings set org.nemo.desktop show-desktop-icons true
xdg-mime default nemo.desktop inode/directory
gsettings set org.cinnamon.desktop.default-applications.terminal exec terminix
@DavidAce
DavidAce / guacamole.md
Last active January 20, 2024 10:11
Guacamole

Guacamole (dip for ~4 people)

  • 2 ripe avocados
  • 1 lime
  • 1 big tomato or the corresponding amount of cherry tomatoes (whatever tastes best at the moment)
  • 1 large fistful/pot of finely chopped koriander/cilantro
  • 1/2 mild onion (red, shallot, silver... avoid the regular white onion which can be too sharp)
  • optional: chipotle sauce, just a few drops, or smoked paprika powder.
  • salt and pepper to taste