Когда сидишь в PHP, а мысли — о Python: как я случайно написал свой pprint

Иногда маленькие вещи случаются не потому, что ты их планировал, а потому что... ну а кто ещё это сделает? Я пару месяцев подряд писал небольшие ML-прототипы на PHP (да, знаю, иногда судьба заносит в странные места), и каждый раз сталкивался с одним и тем же раздражением: массивы печатаются так, будто пытаются скрыть правду. Я смотрю на этот разъехавшийся print_r() , и думаю: а что, если я просто хочу увидеть аккуратную табличку? А если я хочу форматирование как у Python? А если я хочу имитировать пайторчевский tensor([...]) ? Спойлер: я таки написал маленький хелпер. И чем больше я его использовал, тем больше понимал - возможно, он не только про удобство, но и про какое-то внутреннее право на ясность. Этот хелпер - не "фреймворк", не "революция", не "супер-мегапринтер", просто очень маленькая утилитка, которая делает одну вещь и делает её хорошо.

https://habr.com/ru/articles/973396/

#php #prettyprint #pytorch #formatter #form_data #matrix #tensor

Когда сидишь в PHP, а мысли — о Python: как я случайно написал свой pprint

Иногда маленькие вещи случаются не потому, что ты их планировал, а потому что... ну а кто ещё это сделает? Я пару месяцев подряд писал небольшие ML-прототипы на PHP (да, знаю, иногда судьба заносит в...

Хабр

I've now published my first library on Packagist!

https://packagist.org/packages/edent/pretty-print-html

Feedback, suggestions, corrections, tips, tricks, and praise very much welcome!

#HTML #PrettyPrint #PHP

edent/pretty-print-html - Packagist

Pretty Print HTML using PHP.

Incomplete JSON Pretty Printer
"Format truncated or incomplete JSON into a readable structure."
Incomplete JSON Pretty Printer

Pretty Printing JSON on the Command Line with Ruby

Using Ruby's JSON module to pretty print JSON objects from the command line.

https://fed.brid.gy/r/https://www.jvt.me/posts/2018/06/18/pretty-printing-json-ruby-cli/

Pretty Printing JSON on the Command Line with Ruby · Jamie Tanna | Software Engineer

Using Ruby's JSON module to pretty print JSON objects from the command line.

Jamie Tanna | Software Engineer

Pretty Printing JSON on the Command Line with Python

Using Python's JSON module to pretty print JSON objects from the command line.

https://fed.brid.gy/r/https://www.jvt.me/posts/2017/06/05/pretty-printing-json-cli/

Pretty Printing JSON on the Command Line with Python · Jamie Tanna | Software Engineer

Using Python's JSON module to pretty print JSON objects from the command line.

Jamie Tanna | Software Engineer
@nilmethod `ruby -r json -e 'jj(JSON.parse(ARGF.read))'`, but there has to be a more succinct way to pretty-print JSON from STDIN.
#ruby #json #prettyprint
@thatgeoguy The #PrettyPrint dispatch table of #CommonLisp is conceptually a #GenericFunction with parametric dispatch, altough not formalized as such and not a formal part of the Common Lisp Object System (CLOS).

However, it is possibly to extend #CLOS for #ParametricDispatch using the #MetaObjectProtocol (#MOP).

The Metaobject Protocol is not part of the formal CL standard, but is respected as de-facto standard, since about every CL implementation will stick to it. The protocol is described in The Art of the Meta-Object Protocol by Gregor Kiczales, Jim des Rivieres and Daniel G. Bobrow.

🌺

🦎 https://t.me/FamilyOfLisp

🏷️ #Lisp #Scheme
CLHS: Section 22.2.1.4

Part of yesterday's coco adventures involved Ultra Edit, the best (imho) DECB text editor.

Problem is, ultra edit isn't emacs, or vi, or wordstar, or even edt. Completely its own thing. I can't ever remember the keys.

I wrote out a cheatsheet but yeah... my writing..

So today i hammered out the cheatsheet in Ovation under RISC OS! Now it's all pretty and readable, and in an 18 point font so I can read it!

#coco #RiscOs #ovation #prettyPrint

Dumbindent: When 93% of the Time was Spent in Clang-Format

Nigel Tao

Pretty Printing JSON Web Tokens (JWTs) on the Command Line using Ruby

How to easily introspect and pretty print a signed JWT (JWS) or an encrypted JWT (JWE) on the command line using Ruby's standard library, or using the ruby-jwt external library.

https://fed.brid.gy/r/https://www.jvt.me/posts/2018/08/31/pretty-printing-jwt-ruby/

Pretty Printing JSON Web Tokens (JWTs) on the Command Line using Ruby · Jamie Tanna | Software Engineer

How to easily introspect and pretty print a signed JWT (JWS) or an encrypted JWT (JWE) on the command line using Ruby's standard library, or using the ruby-jwt external library.

Jamie Tanna | Software Engineer