Skip to content

Instantly share code, notes, and snippets.

@takuma7
takuma7 / opencv-fourcc-on-mac-os-x.md
Last active December 29, 2024 19:56
OpenCV Video Writer on Mac OS X
(* Sort list of polynomial functions (fs) based on degree of x in ascending order *)
SortByDegree[fs_, x_] := Module[{},
Comp[f1_,f2_] := Exponent[f1,x] < Exponent[f2,x];
Sort[fs,Comp]
];
(* Calculate pseud-remainder *)
Rem[f_, g_, x_] := Module[{q,r,u},
{q,r} = Together[#]&/@PolynomialQuotientRemainder[f,g,x];
u = PolynomialLCM[Denominator[q], Denominator[r]];
%%%% Preamble >>>
\usepackage{subcaption}
\newlength{\twosubht}
\newsavebox{\twosubbox}
%%%%% <<<
\begin{figure}[htp]
% preliminary
\sbox\twosubbox{%
\resizebox{\dimexpr.99\textwidth-1em}{!}{% {(num of image)-1}em
@takuma7
takuma7 / Wizard.tsx
Created August 24, 2020 04:12
react-final-form Wizard TypeScript (enhanced)
import React from 'react'
import { Form, FormRenderProps } from 'react-final-form'
interface Props<Values> {
initialValues?: Partial<Values>
onSubmit: (values: Values) => Promise<void>
pages: React.ReactElement<WizardPageProps<Values>>[]
children: (
props: FormRenderProps<Values> & {