Skip to content

Instantly share code, notes, and snippets.

View vincent-picaud's full-sized avatar
🌴
On vacation

pixor vincent-picaud

🌴
On vacation
View GitHub Profile
@arashpath
arashpath / README.md
Last active February 21, 2022 17:35 — forked from martin0258/README.md
Mi Cloud Batch Download Recordings and Gallery

Why COW was deemed ungood for std::string.

COW, short for copy on write, is a way to implement mutable strings so that creating strings and logically copying strings, is reduced to almost nothing; conceptually they become free operations like no-ops.

Basic idea: to share a data buffer among string instances, and only make a copy for a specific instance (the copy on write) when that instance's data is modified. The general cost of this is only an extra indirection for accessing the value of a string, so a COW implementation is highly desirable. And so the original C++ standard, C++98, and its correction C++03, had special support for COW implementations, and e.g. the g++ compiler's std::string implementations used COW.

So why was that support dropped in C++11?

In particular, would the same reason or reasons apply to a reference counted immutable string value class?

@GuillaumeDua
GuillaumeDua / 13_valuable_things_I_learned_using_CMake.md
Last active June 3, 2025 01:33
13 valuable things I learned using CMake

13 valuable things I learned using CMake

Author : Dua Guillaume
Date : 04-26-2020

Requirement : A first experience with CMake

Intro

As a modern C++ specialist, my job is to focus on software development, from a performance and quality perspective.

@CookiePLMonster
CookiePLMonster / repro.cpp
Last active September 16, 2020 13:23 — forked from riverar/repro.cpp
VS optimizer bug sample
#include <iostream>
#include <cmath>
// Sample of an optimizer bug in Visual Studio 2003 - 2019 (or more)
//
// Compiling this program in Release (/O1, /O2 or /Ox and LTCG) in both x86 and x64
// configurations produces a different output from unoptimized (Debug) configurations.
//
// Expected output: 709
// Produced output: 31
@GuillaumeDua
GuillaumeDua / Concept-based polymorphism in modern Cpp.md
Last active May 7, 2025 15:58
Concept-based polymorphism in modern C++

Concept-based polymorphism in modern C++

Date 05-05-2021 - 10-17-2023
Revision R3
Author Guillaume Dua
Reviewers Loïc Joly, Antoine Morrier
@cscherrer
cscherrer / zigzag-soss.jl
Last active April 22, 2022 19:50
ZigZag sampler with a Soss model
using Soss
using ZigZagBoomerang
using Soss: logdensity, xform, ConditionalModel
using ForwardDiff
using ForwardDiff: gradient!
using LinearAlgebra
using SparseArrays
using StructArrays
using TransformVariables
using MeasureTheory
@GuillaumeDua
GuillaumeDua / MeetingCpp2021_trip_report.md
Last active January 2, 2022 16:15
Meeting Cpp 2021 - Trip report

Meeting Cpp 2021 - Trip report

Author Guillaume Dua
Date 10/11/2021 - 12/11/2021

Table-of-content

@anthonyclarka2
anthonyclarka2 / emacs_navigation_cheat_sheet.drawio
Last active March 22, 2022 19:09
Emacs Navigation Cheat Sheet
<mxfile host="Electron" modified="2022-03-13T20:44:33.536Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/16.5.1 Chrome/96.0.4664.110 Electron/16.0.7 Safari/537.36" etag="R_SOdd2db7crDnFWafUC" version="16.5.1" type="device"><diagram id="qbLhw_JT5a_EEhQz4K1e" name="Page-1">7Z1td5s2GIZ/jT+6B8T7x8Zu2q5zt9Ns67pvxMg2C0YM48TJr59kwDE8yolpjBBGaY9DBAis5/ItcevFI2Oy3n1M/WQ1IwGORkgLdiNjOkJINxEasf9a8JinuKaXJyzTMCgOek64CZ9wkagVqdswwJvKgRkhURYm1cQ5iWM8zyppfpqSh+phCxJVr5r4SwwSbuZ+BFO/h0G2KlJ1TXve8QmHy1Vxadcqdtz687tlSrZxcb0RMq73P/nutV/mVRy/WfkBeThKMj6MjElKSJZvrXcTHLGyLYstP+/6hb2H+05xnJ1ywuevH4i5w//Ef3z98vTj753zy/ZuXORy70fbojz+TIrbzR7LIsrwjl7hapWtI5qg000/Cpcx3Z7Ta+OUJtzjNAtpob4vdqzDIGCnX6V4Ez75t/usNPp3QsI424fMuhpZU5bXNiObHAuW9SZLyR2ekIjQfKcxiVkuizCK6kkkzgqadJtdiEUCB8Vl2N5rfx1GjMpv5JZkhL6nGYlJeSrZpnN28irLKGnIMt7TF1p47IUdsHm3JGQZYT8JN+/mZL3fMd/sD71e5FnTzUPmFro6yr68WQqFOWX/aDoMWFn6tPDw7iipCOBHTNY4S+l1tGKvZRj5KcWHrWTx4Zlco0haHTFbIugXn5XlIeNnXuhGgUwDfBDAZ0oeYgWQvAChKkCOAwmyRBJkAIKuSfrgp0EDiCK8yDgI0WL
@brenhinkeller
brenhinkeller / mpihello.jl
Created October 19, 2022 16:28
Natively compile and run parallel Hello World with MPICH_jll MPI in Julia!
using StaticCompiler, StaticTools, StaticMPI, MPICH_jll
function mpihello(argc, argv)
MPI_Init(argc, argv)
comm = MPI_COMM_WORLD
world_size, world_rank = MPI_Comm_size(comm), MPI_Comm_rank(comm)
printf((c"Hello from ", world_rank, c" of ", world_size, c" processors!\n"))
MPI_Finalize()