Immediately after switching the page, it will work with CSR.
Please reload your browser to see how it works.

Source:https://github.com/SoraKumo001/next-streaming

⬅️ ASCII Lookup Utility in Ada
illo 7 daysReload
Standard ML program. I fear it does not contribute much to the conversation but I cannot abstain from calling attention to my favourite pragmatic programming language that is presently on what seems to be a neverending life support.

  structure I = Int
  structure S = String
  structure SU = Substring
  structure SC = StringCvt
  
  infix 5 >>
  fun (x >> y) f = if x = y then () else (f x; ((x + 1) >> y) f)
  
  val printRow =
  let
      val p0 = SC.padLeft #"0" val ps = SC.padLeft #" "
      val td = I.fmt SC.DEC val tx = I.fmt SC.HEX
      val to = I.fmt SC.OCT val tb = I.fmt SC.BIN
      val desc = fn
            0 => "NUL" | 1 => "SOH" | 2 => "STX" | 3 => "ETX" | 4 => "EOT" | 5 => "ENQ"
          | 6 => "ACK" | 7 => "BEL" | 8 => "BS" | 9 => "HT" | 10 => "LF" | 11 => "VT"
          | 12 => "FF" | 13 => "CR" | 14 => "SO" | 15 => "SI" | 16 => "DLE" | 17 => "DC1"
          | 18 => "DC2" | 19 => "DC3" | 20 => "DC4" | 21 => "NAK" | 22 => "SYN" | 23 => "ETB"
          | 24 => "CAN" | 25 => "EM" | 26 => "SUB" | 27 => "ESC" | 28 => "FS" | 29 => "GS"
          | 30 => "RS" | 31 => "US" | 32 => "SPC" | 127 => "DEL" | n => str (chr n)
  in
      fn n => print (S.concatWith " " [ps 3 (td n), p0 2 (tx n), p0 7 (tb n), p0 3 (to n), desc n] ^ "\n")
  end
  
  val spec =
  let
      val scan = fn rad => fn sl => SC.scanString (I.scan rad) (implode sl)
  in
      fn str => valOf (case explode str of
        #"0" :: #"x" :: hex => scan SC.HEX hex
      | #"0" :: #"o" :: oct => scan SC.OCT oct
      | #"0" :: #"b" :: bin => scan SC.BIN bin
      | dec => scan SC.DEC dec)
  end
  
  val () = case CommandLine.arguments () of
        [] => (0 >> 128) printRow
      | [req] => printRow (spec req)
      | _ => raise Fail "arguments"

kqr 7 daysReload
> A full-scale Unicode lookup utility would be great, but I haven't found one, or even looked very hard for one.

Emacs! There's probably a quicker way but interactive insert-char takes codepoint numbers and then describe-char gets all sorts of useful information.


Mountain_Skies 7 daysReload
Happy to see Ada still gets some interest outside of MIC. When I went off to university, I was a Perl snob but my school used Ada as its primary teaching language. It was a great way of expanding my knowledge across the horizon to understand the value in strong typing.

After nearly half a century, I still don't have ASCII memorized either but usually just use asciitable.com to do a quick lookup. Having a system utility like this one would be handy in situation without internet access. Plus like he noted, it was a good way to learn more about Ada.


kazinator 7 daysReload
TXR Lisp program:

  (defvarl ch-name (relate (rlist 0..32 127)
                           '#"NUL SOH STX ETX EOT ENQ ACK BEL BS \
                              HT LF VT FF CR SO SI DLE DC1 DC2 DC3 \
                              DC4 NAK SYN ETB CAN EM SUB ESC FS GS \
                              RS US SPC DEL"
                           nil))

  (defun print-row (ch)
    (format t "~,3d ~,02x ~,07b ~,03o ~a\n"
            ch ch ch ch (or [ch-name ch] (chr-num ch))))

  (match-case *args*
    (@(require @(or @(with (`0x@{dig #/[\dA-Fa-f]+/}`) base 16)
                    @(with (`0b@{dig #/[01]+/}`) base 2)
                    @(with (`0o@{dig #/[0-7]+/}`) base 8)
                    @(with (`@{dig #/\d+/}`) base 10))
               (let ((val (toint dig base)))
                 (if (<= 0 val 127)
                   (print-row val)))))
    (() [mapdo print-row 0..128])
    (@else (put-line "error in argument") (exit nil)))

numerosix 5 daysReload
Ada version is more readable and faster... Thanks for sharing :)

You can find a good Ada setup with Alire for Linux googling 'github sowebio adel-doc'