Skip to content

Instantly share code, notes, and snippets.

David Ojeda dojeda

  • Paris, France
Block or report user

Report or block dojeda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dojeda
dojeda / openapi.yaml
Created Feb 17, 2019
Example OpenAPI specification for inline model bug reproduction
View openapi.yaml
openapi: "3.0.0"
info:
version: 1.0.0
title: Swagger Petstore
license:
name: MIT
servers:
- url: http://petstore.swagger.io/v1
paths:
/pets:
@dojeda
dojeda / epoching.py
Last active Mar 22, 2018
Epoching of 2D array on its last dimension using a view (not a copy)
View epoching.py
""" Small proof of concept of an epoching function using NumPy strides
License: BSD-3-Clause
Copyright: David Ojeda <david.ojeda@gmail.com>, 2018
"""
import numpy as np
from numpy.lib import stride_tricks
View eigen_mwe.cpp
#include <iostream>
#include <vector>
#include <Eigen/Dense>
int main(int argc, char *argv[]) {
Eigen::MatrixXd X = Eigen::MatrixXd::Random(3, 3);
// PCA = EVD of the covariance matrix
Eigen::SelfAdjointEigenSolver < Eigen::MatrixXd > solver(X.selfadjointView<Eigen::Lower>());
@dojeda
dojeda / trigraphs-c++
Created Apr 15, 2015
TIL about trigraphs in C and C++. Wat the fk!
View trigraphs-c++
#include <iostream>
#include <vector>
#include <iterator>
using namespace std;
int main(int , char *[]) {
vector<int> v1 = {0,1,2};
View square root 2
#!/usr/bin/env python
def sqrt(x):
begin = 0
end = x
while begin <= end:
mid = begin + (end - begin) // 2
You can’t perform that action at this time.