Skip to content

Instantly share code, notes, and snippets.

View ChristopherRabotin's full-sized avatar
🚀

Chris ChristopherRabotin

🚀
View GitHub Profile
@ChristopherRabotin
ChristopherRabotin / HTMLResult.xsl
Created September 10, 2015 11:43
Stress Gauge XML stylesheet to simplify human reading
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
<xsl:template match="/Profile">
<html>
<head>
<title>
<xsl:value-of select="@name" />
\documentclass[11pt, oneside]{article} % use "amsart" instead of "article" for AMSLaTeX format
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx} % Use pdf, png, jpg, or eps§ with pdflatex; use eps in DVI mode
% TeX will automatically convert eps --> pdf in pdflatex
\usepackage{amssymb}
@ChristopherRabotin
ChristopherRabotin / main.c
Created May 22, 2017 02:34
Zephyr cpp demo
/*
* Copyright (c) 2012-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <misc/printk.h>
#include "test.hpp"
@ChristopherRabotin
ChristopherRabotin / halofunc.m
Created June 14, 2017 07:01
Single shooter Matlab code for finding Halo orbits (*not* validated!)
function state = halofunc(X)
% Parse state vector into variables
x = X(1);
y = X(2);
z = X(3);
vx = X(4);
vy = X(5);
vz = X(6);
Phi = reshape(X(7:end), 6,6);
@ChristopherRabotin
ChristopherRabotin / Cargo.toml
Created February 8, 2018 18:07
Rust Python FFI with Python function defintion called by Rust (broken)
[package]
name = "nyxbin"
version = "0.1.0"
authors = ["XX <YY@ZZ.com>"]
[dependencies]
nalgebra = "0.14.0"
[lib]
name = "nyxbin"

Keybase proof 

I hereby claim:    * I am christopherrabotin on github.   * I am topherbr (https://keybase.io/topherbr) on keybase.   * I have a public key ASCu5IXdUynw9xWspVTKB0joueNYa9VpMXtt4VeskSlLxAo  To claim this, I am signing this object: 

{   "body": {     "key": {       "eldest_kid": "0120aee485dd5329f0f715aca554ca0748e8b9e3586bd569317b6de157ac91294bc40a",       "host": "keybase.io",       "kid": "0120aee485dd5329f0f715aca554ca0748e8b9e3586bd569317b6de157ac91294bc40a",       "uid": "247f193394b629b32f29a66b4fd33219",       "username": "topherbr"     },     "merkle_root": {       "ctime": 1521738576,       "hash": "2a513088b83cd9de10072d1497ff9b0b364725fae88d7a630b6f3bbf8bbc1709a90d714a3d7c0cb45a89fefbd36c5da0fcdd64f49eb3cb71d4ad7c43892689f0",       "hash_meta": "f934da3ea3421e91bafb22a698635c6d2d8fce06c5ef3c16f8ab2096f2dc49e8",       "seqno": 2273431     },     "service": {       "name": "github",       "username": "christopherrabotin"     },     "type": "web_service_binding",     "version
@ChristopherRabotin
ChristopherRabotin / rslt.c
Created February 5, 2019 06:32
A result like type in C using a struct and a union
/*
Output:
$ gcc rslt.c -o rslt && ./rslt
[OK] kind=0 data=15.159000 errno=8389
[!!] kind=1 data=0.000000 errno=-3
size = 16
*/
#include <stdio.h>
@ChristopherRabotin
ChristopherRabotin / cosm.rs
Created February 14, 2019 06:12
Can I have a storage of a dynamically parametrized struct? Eg. `HashMap<Identifier, Box<Frame<dyn Body>>>`
// Defines Cosm, from the Greek word for "world" or "universe".
extern crate petgraph;
use crate::frames::*;
use nalgebra::UnitQuaternion;
use petgraph::Graph;
use std::collections::HashMap;
pub trait Cosm {}
@ChristopherRabotin
ChristopherRabotin / Makefile
Created February 21, 2019 23:57
dangerous lack of lifetimes
coffee:
rustc lib.rs --crate-type=cdylib -C opt-level=3 -C target-cpu=native
gcc main.c -o main.o -L. -llib -O3
LD_LIBRARY_PATH=. ./main.o
Input:
┌ ┐
│ -2436.45 │
│ -2436.45 │
│ 6891.037 │
│ 5.088611 │
│ -5.088611 │
│ 0 │
└ ┘
Solution: