Skip to content

Instantly share code, notes, and snippets.

@bstaletic
bstaletic / gist:b79dd75bd34af6546d1232f5943f3c46
Created April 10, 2024 18:44
Trying to recall my automatic driving class
A A B C D D E E F
e ---->--->(1+k_1)--->+--->(z^-1/2)--->--->(1+k_2)--->+--->(z^-1/2)---> y
| /\ | /\ |
| | | | |
| | | | |
\/ (-k_1) \/ (-k_2) |
k_1 /\ k_2 /\ |
| | | | |
| | | | |
| | | | |
@bstaletic
bstaletic / tiny_wsgi_framework.py
Last active February 19, 2024 15:52
The bare minimum needed for supporting YouCompleteMe
# TODO: Handle headers that do not exist.
# TODO: Documentation.
# TODO: Type hints
import http.client
import json
import sys
import traceback
_MEMFILE_MAX = 10 * 1024 * 1024
@bstaletic
bstaletic / mwe_pypy.cpp
Last active January 10, 2024 22:25
WIP minimal reproducer for Yannick
#include <memory>
#include <pybind11/cast.h>
#include <pybind11/options.h>
#include <pybind11/pybind11.h>
#include <pybind11/pytypes.h>
class A {};
class B {};
namespace py = pybind11;
@bstaletic
bstaletic / preprocessed_file.i
Created December 6, 2023 15:29
clang segfault
This file has been truncated, but you can view the full file.
# 1 "foo.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 462 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "/usr/include/gentoo/fortify.h" 1
# 3 "/usr/include/gentoo/fortify.h" 3
# 2 "<built-in>" 2
# 1 "/usr/include/gentoo/maybe-stddefs.h" 1
@bstaletic
bstaletic / lama.md
Last active October 8, 2023 10:52
lama.md

Completers

  • String statement has no effect - but was a "docstring" for a global variable
  • Consider f-string instead of manual format...
  • Consider x not in {a, b} instead of x != a and x != b
  • Consider raise NewException( ... ) from OldException
  • NamedTemporaryFile/urlopen/subprocess.Popen() - consider context manager - NamedTemporaryFile should have been!
  • Catching too wide exception type - Exception - bleh...
  • Override changes number of args.
  • Tuple unpacking - unused variables should be _
@bstaletic
bstaletic / README.diff
Created October 3, 2023 18:49
YCM README.md proposal
diff --git a/README.md b/README.md
index 12fd01a1..b9c73b88 100644
--- a/README.md
+++ b/README.md
@@ -391,7 +391,7 @@ The following additional language support options are available:
and add `--cs-completer` when calling `install.py`.
- Go support: install [Go][go-install] and add `--go-completer` when calling
`install.py`.
-- JavaScript and TypeScript support: install [Node.js and npm][npm-install] and
+- JavaScript and TypeScript support: install [Node.js 18+ and npm][npm-install] and
clangd: /home/bstaletic/work/llvm-project-16.0.6.src/llvm/include/llvm/Support/Casting.h:663: decltype(auto) llvm::dyn_cast(From*) [with To = clang::TranslationUnitDecl; From = clang::Decl]: Assertion `detail::isPresent(Val) && "dyn_cast on a non-existent value"' failed.
#0 0x0000558e24f956e0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/bstaletic/work/llvm-project-16.0.6.src/llvm/lib/Support/Unix/Signals.inc:567:22
#1 0x0000558e24f95aa8 PrintStackTraceSignalHandler(void*) /home/bstaletic/work/llvm-project-16.0.6.src/llvm/lib/Support/Unix/Signals.inc:641:1
#2 0x0000558e24f93297 llvm::sys::RunSignalHandlers() /home/bstaletic/work/llvm-project-16.0.6.src/llvm/lib/Support/Signals.cpp:104:20
#3 0x0000558e24f95045 SignalHandler(int) /home/bstaletic/work/llvm-project-16.0.6.src/llvm/lib/Support/Unix/Signals.inc:412:1
#4 0x00007fb900964d20 (/lib64/libc.so.6+0x38d20)
#5 0x00007fb9009b241c __pthread_kill_implementation /var/tmp/portage/sys-libs/glibc-2.37-r4/work/glibc-2.37/nptl/pthread_kill.c:44:76
@bstaletic
bstaletic / log
Created August 17, 2023 17:40
ycmd build error
This file has been truncated, but you can view the full file.
[ 89%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierCompleter.cpp.o
In file included from /home/bstaletic/.vim/pack/bundle/start/YouCompleteMe/third_party/ycmd/cpp/ycm/CodePoint.cpp:51:
/home/bstaletic/.vim/pack/bundle/start/YouCompleteMe/third_party/ycmd/cpp/ycm/UnicodeTable.inc:16: warning: unpaired UTF-8 bidirectional control character detected [-Wbidi-chars=]
16 | {{"\x00","<U+0001>","<U+0002>","<U+0003>","<U+0004>","<U+0005>","<U+0006>","<U+0007>","<U+0008>"," ","\n","<U+000B>","<U+000C>","\r","<U+000E>","<U+000F>","<U+0010>","<U+0011>","<U+0012>","<U+0013>","<U+0014>","<U+0015>","<U+0016>","<U+0017>","<U+0018>","<U+0019>","\x1a","<U+001B>","<U+001C>","<U+001D>","<U+001E>","<U+001F>","!","\"","#","%","&","'","(",")","*",",","-",".","/",":",";","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","_","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","}","<U
FUNCTION traces#cmdl_leave()
Defined: ~/.vim/pack/bundle/start/traces/autoload/traces.vim:762
Called 3 times
Total time: 0.001451
Self time: 0.001219
count total (s) self (s)
3 0.000067 let s:nr = bufnr('%')
3 0.000066 if !exists('s:buf[s:nr]')
1 0.000001 return
@bstaletic
bstaletic / roslyn.log
Created October 31, 2021 16:18
Another Omnisharp-Roslyn update another broken mess...
............E.F
Stdout:
Test failed, retrying: No diagnostic
Logfile /tmp/omnisharp_44363_testy.sln_stdout_yehpf22m.log:
info: OmniSharp.Http.Middleware.LoggingMiddleware[0]
/checkalivestatus: 200 0ms
info: OmniSharp.OmniSharpWorkspace[0]
Miscellaneous file: /home/bstaletic/.vim/pack/bundle/start/YouCompleteMe/third_party/ycmd/ycmd/tests/cs/testdata/testy/DiagnosticRange.cs added to workspace
info: OmniSharp.Http.Middleware.LoggingMiddleware[0]