This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use osqp::{CscMatrix, Problem, Settings}; | |
fn main() { | |
// Define problem data | |
let P = &[[4.0]]; | |
let P = CscMatrix::from(P).into_upper_tri(); | |
let q = &[1.0]; | |
let A = &[[1.0]]; | |
let settings = Settings::default().verbose(true); | |
// This works: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This hook is for fixing busybox-initramfs issue while unlocking a luks | |
# encrypted rootfs. The problem is that the included busybox version | |
# is stripped down to the point that it breaks cryptroot-unlock script: | |
# https://bugs.launchpad.net/ubuntu/+source/busybox/+bug/1651818 | |
# This is a non-aggressive fix based on the original busybox-initramfs hook | |
# until the bug is fixed. | |
# busybox or busybox-static package must be present for this to work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate test; | |
#[derive(Debug)] | |
struct Mat4 { | |
dat: [[f64; 4]; 4] | |
} | |
macro_rules! dot{ | |
($A:expr, $B:expr, $I:expr, $J:expr) => { | |
$A.dat[0][$I] * $B.dat[$J][0] + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RPROMPT="%F{yellow}[%D{%H:%M:%S}]%f" | |
strlen () { | |
FOO=$1 | |
local zero='%([BSUbfksu]|([FB]|){*})' | |
LEN=${#${(S%%)FOO//$~zero/}} | |
echo $LEN | |
} | |
# show right prompt with date ONLY when command is executed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Text.Printf | |
import Data.List | |
import Data.Packed.Vector | |
import qualified Data.Packed.Vector as P | |
import qualified Data.Vector as V | |
import qualified Data.Vector.Unboxed as U | |
import qualified Data.Vector.Storable as S | |
import Numeric.LinearAlgebra.HMatrix hiding (udot) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% cabal install hmatrix --reinstall | |
Resolving dependencies... | |
In order, the following will be installed: | |
hmatrix-0.16.1.0 (new version) | |
hmatrix-gsl-0.16.0.2 (reinstall) changes: hmatrix-0.16.0.6 -> 0.16.1.0 | |
Warning: Note that reinstalls are always dangerous. Continuing anyway... | |
Configuring hmatrix-0.16.1.0... | |
Building hmatrix-0.16.1.0... | |
Preprocessing library hmatrix-0.16.1.0... | |
[ 1 of 33] Compiling Data.Packed.Internal.Signatures ( src/Data/Packed/Internal/Signatures.hs, dist/dist-sandbox-e264f01/build/Data/Packed/Internal/Signatures.o ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Data.Random | |
import Control.Applicative | |
import Text.Printf | |
import Data.List | |
import Data.Packed.Vector | |
import qualified Data.Packed.Vector as P | |
import qualified Data.Vector as V | |
import qualified Data.Vector.Unboxed as U |