Comment by Winny on How to reload an emacs major mode?
Another cool feature is you can script with unload-feature in conjunction with feature-file and load to reload the feature's file from one command.
View ArticleComment by Winny on Visual Studio - Fixing the error "A file of that name is...
I noticed sometimes a devenv.exe lingers after VS exits, killing it resolved this issue in my particular case (YMMV).
View ArticleComment by Winny on Should I commit my `.idea/` folder?
It seems like this is informed in the spirit of FOSS projects where one will have a lot of heterogeneous developer workflows. Should this advice apply to teams that all use the same tooling?
View ArticleComment by Winny on How to display list of running processes Python?
ps -ef | grep [p]ython
View ArticleComment by Winny on How do I create an empty file in emacs?
This seems like the best answer for emacs 26.
View ArticleComment by Winny on How do I get a text of all the cells of the table using...
Should an answer be accepted?
View ArticleComment by Winny on 'Git: gpg failed to sign the data' in visual studio code
Just a note for the impatient - this error message can also manifest if your key has expired.
View ArticleComment by Winny on 'Git: gpg failed to sign the data' in visual studio code
This is an excellent way to test if your gpg key is usable without using git.
View ArticleComment by Winny on parser-tools: case insensitive lexer?
define-lex-trans worked well, thanks!
View ArticleComment by Winny on Capturing a variable number of arguments via an ellipsis...
Can confirm this works, but was unable to find it in documentation. Anybody know where this usage of ... exists in the docs?
View ArticleComment by Winny on Generate Swagger documentation as JSON/YAML in NestJS
Are you sure about that? It seems the linked webpage references /api-json.
View ArticleComment by Winny on Permanently summing a column in an Org-mode table
C-c C-c with point on the formula on the TBLFM line worked for me.
View ArticleComment by Winny on pg_restore: Its not restoring my db
Here's how data-only behavior is determined: (1) if you specify --data-only or (2) your dump is missing a schema or (3) you requested that no schema be restored....
View ArticleComment by Winny on How to calculate "SLAs" with blackbox-exporter metrics
If you found this answer helpful, why not show the love?
View ArticleAnswer by Winny for Shortening a list comprehension that taps into a nested...
From help(dict.values):values(...) D.values() -> list of D's valuesKnowing dict.values() returns a list (and not a tuple) you can simplify your list comprehension to this:myList = sorted([k] +...
View ArticleAnswer by Winny for When reading from line returns newline - Python
Call the .strip() method on line.with open('continent.txt') as fp: for line in fp: print "text ", line.strip('\r\n') ," here"Note the argument to strip specifies what characters to remove. By default...
View ArticleAnswer by Winny for API Misuse (Apple): Trying to free data which has not...
SecKeychainItemRef variables are CoreFoundation reference counted. From the static code analyzer's point of view, calling SecKeychainItemFreeContent() on a SecKeychainItemRef amounts to freeing...
View ArticleAPI Misuse (Apple): Trying to free data which has not been allocated
An app I'm working on works with simple password items in the Login Keychain. I noticed there is a SecKeychainItemRef that is never freed. The official documentation on SecKeychainFindGenericPassword()...
View ArticleConnect to HTTPS servers using Racket
When I try to connect to a webserver over HTTPS using Racket's net/http-client package, the following happens:With #t➜ code racket Welcome to Racket v6.2.> (require net/http-client)>...
View ArticleDocumenting Mutually Exclusive Query Parameters in API Blueprint
I'm documenting a public API that has a method named /findGuild that takes a mandatory key parameter and one of the following parameters:byPlayerbyNameIt must have either byPlayer or byName; My...
View ArticleGet a struct's field names
In Racket, I want to use a struct's field names for metaprogramming.For example:(struct pt [x y])(struct-fields pt) ;; -> '(x y)
View ArticleAnswer by Winny for Unit-testing in Racket with multiple outputs
A simple macro approach@Gibstick's answer is right on, but I wanted to illustrate a more general approach that somebody on the #racket irc channel gave to me many months ago:(define-syntax...
View ArticleGet Image Type and Metadata in Racket
How do I get a file's type and if it's an image, get its dimensions?I want to read files from disk, determine if these files are indeed images, and get their dimensions to determine if they meet my...
View ArticleHow to get the current time?
I looked at the TIME signature for Standard ML and tried the following:- Time.now;val it = fn : unit -> Time.timeSo it gives me back a function - how do I get the current time in Standard ML?
View ArticleWhat is the usecase of add1 and sub1?
In Racket, there are two Generic Number procedures named add1 and sub1, equivalent to (curry + 1) and (curryr - 1) respectively.Are these procedures for stylistic use or do they have some sort of...
View ArticleAnswer by Winny for How does one retrieve an arbritrary user's ssh public...
GitHub style ssh public key access was added in GitLab 6.6.0 using the following scheme: http://__HOST__/__USERNAME__.keys (thanks @bastelflp).Currently we are running 6.2.3, and we will upgrade.
View Articledb: Run sql schema (contains multiple statements)
My project has a schema.sql which contains the CREATE TABLE statements to set up my sqlite3 database, but I can't seem to figure out how to run this file from Racket. I get the following error...
View ArticleAnswer by Winny for racket: add a number to each element of nested list
I think this problem can be generalized to "How do I map over nested lists?".I am working off the assumption the procedure should also add numbers to top level elements, e.g.: (add-to-all 1 '(1 2 (3 4)...
View ArticleWhy is this Fizz Buzz generator significantly faster than this Fizz Buzz...
After learning about iterator class methods and generators, I tested the performance characteristics of simple Fizz Buzz solutions utilizing each idiom:>>> from timeit import...
View ArticleAnswer by Winny for raco: docs failure query-exec: unable to open the...
This issue is caused by docindex.sqlite missing from your system-scope documentation directory. You can check what directory this is via: (require setup/dirs) (find-user-doc-dir). On Archlinux this is...
View ArticleAnswer by Winny for How can I delete the current line in Emacs?
Install package whole-line-or-region and then run (whole-line-or-region-global-mode). This will make C-w kill the whole line if no region (selection) is active.See the Package's GitHub page...
View ArticleHow does one retrieve an arbritrary user's ssh public keys from GitLab?
How does one retrieve an arbritrary user's ssh public keys from GitLab?GitHub provides this feature. For example: https://github.com/winny-.keysThe GitLab API exposes public keys, however it looks like...
View Articleparser-tools: case insensitive lexer?
I'm writing a parser using parser-tools. The language is case-insensitive. Is there a way to make case-insensitive lexers with this library?What I tried:#lang racket(require parser-tools/lex (prefix-in...
View ArticleIs there any purpose to `bind()` unix domain socket client processes?
When using AF_UNIX (unix domain sockets), is there any application to calling bind() in a process that never calls listen()?In my systems programming lecture and lab, we are instructed to callbind() on...
View Article