Skip to content

Instantly share code, notes, and snippets.

View FractalDesigns's full-sized avatar
🏠
Working from home

Achraf Elafrit FractalDesigns

🏠
Working from home
View GitHub Profile
@FractalDesigns
FractalDesigns / curl-ca.md
Created October 8, 2024 07:48 — forked from olih/curl-ca.md
Curl with custom CA certificates

Using curl with custom CA certificates

This document describes how to use curl with both custom and official CA SSL certificates.

Prerequisite

You would need first to install curl , see http://curl.haxx.se/docs/install.html. Using a package manager such as yum, brew, ... for your platform should be the easiest though.

Example for Mac OS:

import tracemalloc
import time
import sys
# List of filenames to exclude from output
excluded_files = ['tracemalloc.py', 'other_module.py', 'another_module.py']
def display_memory_changes(diff_stats):
total_memory_increase = 0
for stat in diff_stats:
total_memory_increase += stat.size_diff
import yaml
file = "data.yml"
with open(file, 'r') as stream:
data = yaml.safe_load(stream)
data['pg_conn']['host'] = 'ddaplx27fd9c7c.fr.world.socgen'
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --w
@FractalDesigns
FractalDesigns / sumabs.pony
Created April 14, 2017 12:43
function binding to yeppp
fun sumabs2(data: Array[F64]): F64 =>
"""
SciPony notes : Computes the sum of squares of the Array[F64] passed as argument and returns the result.
Yeppp description: Computes the sum of squares of double precision (64-bit) floating-point array elements.
"""
var res: F64 = 0
@yepCore_SumSquares_V64f_S64f[I32](data.cstring(), addressof res, data.size())
res
\usepackage{fancyhdr} % use this package to display curret section or chapter in the header
\fancyhf{} % Clear fancy header/footer
\fancyfoot[L]{ Rapport de Stage d'immersion en Entreprise 2016} % My name in Left footer
\renewcommand{\footrulewidth}{0.4pt}
\fancyfoot[R]{Page | \thepage } % Page number in Right footer
\fancyhead[L]{ENSI}
\fancyhead[R]{\rightmark}
# testing global scope
def scope2():
global a
a = "defined in scope 2"
def scope3():
scope2()
print a
def scope1():
print a
scope2()
use "path:."
use "lib:sqrt"
use "path:/usr/local/lib"
use "lib:gsl"
use "lib:gslcblas"
primitive Gsl
fun sqrt(x : F64) : F64 =>
@sqrt_gsl[F64](x)
//first you need to install gnu scientific library to run this
#include <stdio.h>
//#include <gsl/gsl_errno.h>
//#include <gsl/gsl_fft_complex.h>
#include <gsl/gsl_complex_math.h>
double sqrt_gsl(double a) {
gsl_complex b = gsl_complex_sqrt_real(a);
return b.dat[0];
}
use "ponytest"
actor Main is TestList
new create(env: Env) =>
PonyTest(env, this)
new make() =>
None
fun tag tests(test: PonyTest) =>