Skip to content

Instantly share code, notes, and snippets.

@detly
detly / lsp-diagnostics.md
Created October 5, 2021 08:46
LSP diagnostics

Troubleshooting: rust-analyzer

Version

  • LSP: 1.12.0
  • Sublime Text: 4113

Server Test Run

  • exit code: 0
  • output

error[E0599]: the method `context` exists for enum `std::result::Result<(), SendError<ZmqQMessage<'q>>>`, but its trait bounds were not satisfied
--> src/zsocket/callback_queue.rs:28:14
|
28 | .context("Enqueueing message in ZmqQ")
| ^^^^^^^ method cannot be called on `std::result::Result<(), SendError<ZmqQMessage<'q>>>` due to unsatisfied trait bounds
|
::: /home/jason/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync/mpsc/mod.rs:540:1
|
540 | pub struct SendError<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T);
| -----------------------------------------------------------------------------
@detly
detly / main.rs
Last active March 2, 2021 12:35
Nom example
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::character::complete;
use nom::sequence::preceded;
use nom::{error::ParseError, AsChar, IResult, InputIter, Parser, Slice};
use std::str::FromStr;
#[derive(Clone, Copy, PartialEq, Debug)]
enum Flip {
@detly
detly / weights.py
Created June 11, 2020 23:28
Gammatone weights
# Copyright 2014 Jason Heeris, [email protected]
#
# This file is part of the gammatone toolkit, and is licensed under the 3-clause
# BSD license: https://github.com/detly/gammatone/blob/master/COPYING
"""
This module contains functions for calculating weights to approximate a
gammatone filterbank-like "spectrogram" from a Fourier transform.
"""
from __future__ import division
import numpy as np
[2017-01-16 11:09:42] lb build
P: live-build 1:20161216
P: Building config tree for a debian/jessie/armhf system
[2017-01-16 11:09:43] lb bootstrap
P: Setting up cleanup function
[2017-01-16 11:09:43] lb bootstrap_cache restore
P: Restoring bootstrap stage from cache...
[2017-01-16 11:09:43] lb bootstrap_debootstrap
P: Begin bootstrapping system...
P: If the following stage fails, the most likely cause of the problem is with your mirror configuration or a caching proxy.
[2017-01-16 06:23:28] lb build
P: live-build 1:20161216
P: Building config tree for a debian/jessie/armhf system
[2017-01-16 06:23:28] lb bootstrap
P: Setting up cleanup function
[2017-01-16 06:23:28] lb bootstrap_cache restore
P: Restoring bootstrap stage from cache...
[2017-01-16 06:23:28] lb bootstrap_debootstrap
P: Begin bootstrapping system...
P: If the following stage fails, the most likely cause of the problem is with your mirror configuration or a caching proxy.

Things to try:

  • Copy DTB (device tree) to root of live media
  • Copy everything from /boot in chroot to root of live media (why not?)
  • Move kernel image to kernel.img instead of using config.txt entry
    • What about the initrd?

Notes:

  • live-build binary hooks are executed in build/binary
@detly
detly / config
Created February 14, 2016 01:55
#!/bin/sh
set -e
GENERAL_BUILD_OPTIONS="--gzip-options '-9 --rsyncable' --security false"
lb config noauto ${GENERAL_BUILD_OPTIONS} "${@}"
[2016-02-09 21:20:04] lb build
P: live-build 5.0~a11
P: Building config tree for a debian/wheezy/armhf system
[2016-02-09 21:20:04] lb bootstrap
P: Setting up cleanup function
[2016-02-09 21:20:05] lb bootstrap_cache restore
P: Restoring bootstrap stage from cache...
[2016-02-09 21:20:05] lb bootstrap_debootstrap
P: Begin bootstrapping system...
P: If the following stage fails, the most likely cause of the problem is with your mirror configuration or a caching proxy.