Skip to content

Instantly share code, notes, and snippets.

View giraldeau's full-sized avatar
🔨
working

Francis Giraldeau giraldeau

🔨
working
View GitHub Profile
@giraldeau
giraldeau / buildfix_kernel_6.5.patch
Created April 6, 2024 20:44
Patch fix build failure nvidia-dkms-390 with kernel 6.5 (Ubuntu 22.04 Jammy)
Index: kernel/common/inc/nv-mm.h
===================================================================
--- kernel.orig/common/inc/nv-mm.h
+++ kernel/common/inc/nv-mm.h
@@ -23,6 +23,7 @@
#ifndef __NV_MM_H__
#define __NV_MM_H__
+#include <linux/version.h>
#include "conftest.h"
@giraldeau
giraldeau / pointhash.cpp
Created February 8, 2021 14:00
hash function for point with variable dim
template<int spacedim>
struct PointHashFunc
{
std::size_t
operator()(const dealii::Point<spacedim>&p) const
{
std::size_t h;
h = std::hash<double>()(p[0]);
if (spacedim > 1)
{
@giraldeau
giraldeau / main.cpp
Created July 24, 2019 20:32
Minimal example to understand for mass and laplace matrices
/*
* Minimal example to understand for mass and laplace matrices
*/
// The program starts with the usual include files, all of which you should
// have seen before by now:
#include <deal.II/base/utilities.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/function.h>
#include <deal.II/base/logstream.h>
@giraldeau
giraldeau / CMakeLists.txt
Created November 3, 2017 21:48
The missing example to use cmake qt5_create_translation
cmake_minimum_required(VERSION 3.8)
project(tsProject)
# Managing translations require LinguistTools module
# The cmake function is defined in the Qt installation tree:
# i.e. Qt5.9.1/5.9.1/gcc_64/lib/cmake/Qt5LinguistTools/Qt5LinguistToolsMacros.cmake
# Reference: https://doc.qt.io/qt-5/cmake-manual.html#qt5linguisttools-macros
find_package(Qt5 COMPONENTS Widgets LinguistTools)
set (CMAKE_CXX_STANDARD 11)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@giraldeau
giraldeau / fabfile.py
Created December 22, 2016 15:38
fabfile for computree svn repos
from fabric.api import local
import json
import os
from contextlib import contextmanager
@contextmanager
def cd(newdir):
prevdir = os.getcwd()
os.chdir(os.path.expanduser(newdir))
try:
#include <map>
#include <iostream>
#include <cstring>
#include <stdio.h>
using std::map;
using std::cout;
using std::cin;
using std::endl;
#!/usr/bin/env python
import argparse
import os
t = "/sys/kernel/debug/tracing"
def write_to(base, name, data):
with open(os.path.join(base, name), "w") as f:
f.write(data)
<?php
for($i=0;$i<10000000;$i++)
{
apcu_store($i,"test");
apcu_fetch($i);
}
?>
#!/usr/bin/python3
'''
Created on Nov 1, 2016
Generate data with two random gaussian samples with a tag.
Basic code to test the tag recovery from the concatenated
and shuffled samples.
@author: francis
'''
#!/bin/sh
EVS="sched_switch
sched_waking
sched_migrate_task
sched_process_free
sched_process_exit
sched_wait_task
sched_process_wait
sched_process_fork