# string

Published articles for string.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Unsigned char std::basic\_string\<\> in C++

DevFeed: [Unsigned char std::basic\_string\<\> in C++](<https://devfeed.tech/articles/unsigned-char-std-basic-string-in-c-36572.md>)

Original publisher: [Read original article](<https://berthub.eu/articles/posts/unsigned-char-std-string-cpp/>)

Published: 2026-01-03T22:00:02Z

Content type: tutorial

Language: en

Sources: [Bert Hubert's writings](<https://devfeed.tech/sources/bert-hubert-s-writings.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [standard](<https://devfeed.tech/topics/standard.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [clang](<https://devfeed.tech/topics/clang.md>), [gcc](<https://devfeed.tech/topics/gcc.md>)

Tags: [bits](<https://devfeed.tech/tags/bits.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [clang](<https://devfeed.tech/tags/clang.md>), [concatenation](<https://devfeed.tech/tags/concatenation.md>), [cryptographic](<https://devfeed.tech/tags/cryptographic.md>), [freebsd](<https://devfeed.tech/tags/freebsd.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [openbsd](<https://devfeed.tech/tags/openbsd.md>), [standard](<https://devfeed.tech/tags/standard.md>), [string](<https://devfeed.tech/tags/string.md>)

### AI overview

A C++ post explains why code using std::basic_string<uint8_t> can fail on FreeBSD and OpenBSD. The issue involves std::char_traits: LLVM 19 removed its unconstrained base template because the C++ Standard does not require it for unsigned-character types. Code may need string concatenation and related operations replaced or a correct custom specialization provided.

### Source excerpt

Brief post on a somewhat vexing and irritating C++ problem I ran into some time ago. I hope that this page will help other people deal with this problem more quickly than I did. I've long used std::basic_string<uint8_t>, an unsigned char string, for fiddling with bits. You could use a regular char string, but especially when doing cryptographic or sub-byte operations, it is more convenient to not have to deal with sign bits.

## Advanced String Manipulation in Twig with Craft CMS

DevFeed: [Advanced String Manipulation in Twig with Craft CMS](<https://devfeed.tech/articles/advanced-string-manipulation-in-twig-with-craft-cms-31304.md>)

Original publisher: [Read original article](<https://nystudio107.com/blog/string-manipulation-in-twig-with-craft-cms>)

Author: andrew@nystudio107.com (Andrew Welch)

Published: 2024-05-01T17:39:00Z

Content type: tutorial

Language: en

Sources: [nystudio107 | Articles on modern web development.](<https://devfeed.tech/sources/nystudio107-articles-on-modern-web-development.md>)

Topics: [Content Management System](<https://devfeed.tech/topics/cms.md>), [PHP](<https://devfeed.tech/topics/php.md>), [Library](<https://devfeed.tech/topics/library.md>), [Code](<https://devfeed.tech/topics/code.md>), [phpstorm](<https://devfeed.tech/topics/phpstorm.md>)

Tags: [advanced](<https://devfeed.tech/tags/advanced.md>), [craft](<https://devfeed.tech/tags/craft.md>), [hidden](<https://devfeed.tech/tags/hidden.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [insights](<https://devfeed.tech/tags/insights.md>), [learn](<https://devfeed.tech/tags/learn.md>), [manipulation](<https://devfeed.tech/tags/manipulation.md>), [plugins](<https://devfeed.tech/tags/plugins.md>), [powers](<https://devfeed.tech/tags/powers.md>), [required](<https://devfeed.tech/tags/required.md>), [string](<https://devfeed.tech/tags/string.md>), [twig](<https://devfeed.tech/tags/twig.md>), [unleash](<https://devfeed.tech/tags/unleash.md>)

### AI overview

This tutorial explains how to perform advanced string manipulation in Twig with Craft CMS without additional plugins. It shows how to access the bundled Stringy PHP library through Twig's create() function and demonstrates several Stringy functions.

### Source excerpt

Learn how to unleash hidden string manipulation powers in Twig with Craft CMS 5, no plugins required!

## Extract a Number from a String with JavaScript

DevFeed: [Extract a Number from a String with JavaScript](<https://devfeed.tech/articles/extract-a-number-from-a-string-with-javascript-37487.md>)

Original publisher: [Read original article](<https://davidwalsh.name/javascript-extract-string>)

Author: David Walsh

Published: 2024-01-16T11:48:41Z

Content type: tutorial

Language: en

Sources: [David Walsh](<https://devfeed.tech/sources/david-walsh.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [Regular expression](<https://devfeed.tech/topics/regular-expression.md>), [Web Development](<https://devfeed.tech/topics/web-development.md>), [HTML](<https://devfeed.tech/topics/html.md>)

Tags: [html](<https://devfeed.tech/tags/html.md>), [input](<https://devfeed.tech/tags/input.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [javascript-quick-tips](<https://devfeed.tech/tags/javascript-quick-tips.md>), [numbers](<https://devfeed.tech/tags/numbers.md>), [quick-tips](<https://devfeed.tech/tags/quick-tips.md>), [regular-expressions](<https://devfeed.tech/tags/regular-expressions.md>), [string](<https://devfeed.tech/tags/string.md>)

### AI overview

This tutorial explains how to extract numbers from strings in JavaScript, particularly user input from HTML form fields, using regular expressions.

### Source excerpt

User input from HTML form fields is generally provided to JavaScript as a string. We've lived with that fact for decades but sometimes developers need to extract numbers from that string. There are multiple ways to get those numbers but let's rely on regular expressions to extract those numbers! To employ a regular expression to [...] The post Extract a Number from a String with JavaScript appeared first on David Walsh Blog.

## NodeJS 内存泄漏检测与定位

DevFeed: [NodeJS 内存泄漏检测与定位](<https://devfeed.tech/articles/nodejs-41005.md>)

Original publisher: [Read original article](<https://blog.joway.io/posts/nodejs-debug/>)

Author: Joway

Published: 2019-11-10T00:00:00Z

Content type: tutorial

Language: zh

Sources: [Random Thoughts](<https://devfeed.tech/sources/random-thoughts.md>)

Topics: [Node.js](<https://devfeed.tech/topics/node-js.md>), [developer tooling](<https://devfeed.tech/topics/developer-tooling.md>), [Chrome](<https://devfeed.tech/topics/chrome.md>), [bug](<https://devfeed.tech/topics/bug.md>)

Tags: [bug](<https://devfeed.tech/tags/bug.md>), [chrome](<https://devfeed.tech/tags/chrome.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [devtools](<https://devfeed.tech/tags/devtools.md>), [dump](<https://devfeed.tech/tags/dump.md>), [nodejs](<https://devfeed.tech/tags/nodejs.md>), [object](<https://devfeed.tech/tags/object.md>), [snapshot](<https://devfeed.tech/tags/snapshot.md>), [string](<https://devfeed.tech/tags/string.md>), [tech](<https://devfeed.tech/tags/tech.md>)

### AI overview

This Chinese tutorial documents diagnosing and locating a Node.js memory leak using heapdump files and Chrome DevTools. It explains how to obtain heap snapshots, compare snapshots over time, and inspect object references and retained size while noting that increased memory or retained size alone does not conclusively prove a leak.

### Source excerpt

最近解决了一个 Node.JS 应用内存泄漏 Bug，顺便学会了用 Chrome DevTools 去看 heapdump 文件。这里做一些简单的记录。 如何「优雅地」获得 heapdump 文件 由于我们所有应用都是以容器部署的，所以要去获得某个容器内的文件，并拷贝到本地难度还是比较大，也非常麻烦。考虑到调试时或许会需要下载非常多次的 snapshot 文件，建议可以包下 heapdump 库，做成一个接口，把文件 dump 之后再传输给客户端，这样一劳永逸。

## Multiline strings in ES6 JavaScript

DevFeed: [Multiline strings in ES6 JavaScript](<https://devfeed.tech/articles/multiline-strings-in-es6-javascript-32304.md>)

Original publisher: [Read original article](<https://jack.ofspades.com/multiline-strings-in-es6-javascript/>)

Author: Jack Tarantino

Published: 2015-11-29T23:59:53Z

Content type: tutorial

Language: en

Sources: [Jacopo Tarantino](<https://devfeed.tech/sources/jacopo-tarantino.md>)

Topics: [JavaScript](<https://devfeed.tech/topics/javascript.md>), [es6](<https://devfeed.tech/topics/es6.md>), [Template](<https://devfeed.tech/topics/template.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [es6](<https://devfeed.tech/tags/es6.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [string](<https://devfeed.tech/tags/string.md>), [template](<https://devfeed.tech/tags/template.md>), [template-strings](<https://devfeed.tech/tags/template-strings.md>), [templates](<https://devfeed.tech/tags/templates.md>)

### AI overview

A tutorial on ES6 Template Strings in JavaScript, covering multiline strings, interpolation, tagged template strings, and older ES5 techniques for writing multiline strings.

### Source excerpt

The new kid in town is called Template Strings. Template Strings are demarked by a backtick(`) on either end and can contain other backticks if they are escaped by a backslash(ie. let my_string = `some cool \`escaped\` thing`). This new kind of primitive in JavaScript is different from

## Python Helpers for String/Unicode Encoding, Decoding and Printing

DevFeed: [Python Helpers for String/Unicode Encoding, Decoding and Printing](<https://devfeed.tech/articles/python-helpers-for-string-unicode-encoding-decoding-and-printing-31831.md>)

Original publisher: [Read original article](<https://www.metachris.dev/2015/11/python-tools-for-string-unicode-encoding-decoding-printing/>)

Author: Chris Hager

Published: 2015-11-23T00:00:00Z

Content type: tutorial

Language: en

Sources: [Chris Hager](<https://devfeed.tech/sources/chris-hager.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Code](<https://devfeed.tech/topics/code.md>), [pdf](<https://devfeed.tech/topics/pdf.md>), [console](<https://devfeed.tech/topics/console.md>), [Windows](<https://devfeed.tech/topics/windows.md>)

Tags: [console](<https://devfeed.tech/tags/console.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [pdf](<https://devfeed.tech/tags/pdf.md>), [python](<https://devfeed.tech/tags/python.md>), [string](<https://devfeed.tech/tags/string.md>), [windows](<https://devfeed.tech/tags/windows.md>)

### AI overview

This tutorial presents two public-domain Python helpers: make_compat_str decodes bytes or strings into Unicode, while print_to_console prints Unicode safely across terminals and output encodings. The helpers are used in PDFx.

### Source excerpt

String encoding and decoding as well as encoding detection can be a headache, more so in Python 2 than in Python 3. Here are two little helpers which are used in PDFx, the PDF metadata and reference extractor: make_compat_str - decode any kind of bytes/str into an unicode object print_to_console - print (unicode) strings to any kind of console (even windows with cp437, etc.) All of this code is in the public domain via The Unlicense.

## Let's Build A Simple Interpreter. Part 2.

DevFeed: [Let's Build A Simple Interpreter. Part 2.](<https://devfeed.tech/articles/let-s-build-a-simple-interpreter-part-2-33323.md>)

Original publisher: [Read original article](<https://ruslanspivak.com/lsbasi-part2/>)

Author: Ruslan Spivak

Published: 2015-07-03T11:00:00Z

Content type: tutorial

Language: en

Sources: [Ruslan Spivak](<https://devfeed.tech/sources/ruslan-spivak.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [Software Engineering](<https://devfeed.tech/topics/software-engineering.md>), [Software](<https://devfeed.tech/topics/software.md>)

Tags: [blog](<https://devfeed.tech/tags/blog.md>), [code](<https://devfeed.tech/tags/code.md>), [compilers](<https://devfeed.tech/tags/compilers.md>), [development](<https://devfeed.tech/tags/development.md>), [source](<https://devfeed.tech/tags/source.md>), [string](<https://devfeed.tech/tags/string.md>)

### AI overview

This tutorial continues a series on building an interpreter by extending a calculator to handle whitespace, multi-digit integers, subtraction, and addition. It explains the code changes, including token handling and position advancement, and provides source code and a sample session.

### Source excerpt

In their amazing book "The 5 Elements of Effective Thinking" the authors Burger and Starbird share a story about how they observed Tony Plog, an internationally acclaimed trumpet virtuoso, conduct a master class for accomplished trumpet players. The students first played complex music phrases, which they played perfectly well. But ...

## Emacs Lisp: Toggle Between a Clojure String and Keyword

DevFeed: [Emacs Lisp: Toggle Between a Clojure String and Keyword](<https://devfeed.tech/articles/emacs-lisp-toggle-between-a-clojure-string-and-keyword-31901.md>)

Original publisher: [Read original article](<http://blog.jayfields.com/2013/05/emacs-lisp-toggle-between-clojure.html>)

Author: Jay (noreply@blogger.com)

Published: 2013-05-02T14:41:00Z

Content type: tutorial

Language: en

Sources: [Jay Fields](<https://devfeed.tech/sources/jay-fields.md>)

Topics: [Emacs](<https://devfeed.tech/topics/emacs.md>), [ClojureScript](<https://devfeed.tech/topics/clojurescript.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Lisp](<https://devfeed.tech/topics/lisp.md>)

Tags: [clojure](<https://devfeed.tech/tags/clojure.md>), [conversion](<https://devfeed.tech/tags/conversion.md>), [emacs](<https://devfeed.tech/tags/emacs.md>), [emacs-lisp](<https://devfeed.tech/tags/emacs-lisp.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [string](<https://devfeed.tech/tags/string.md>)

### AI overview

This article presents an Emacs Lisp solution for toggling between Clojure strings and keywords, motivated by a refactoring task that required converting multiple Clojure keywords to strings. It also references a video demonstrating the behavior.

### Source excerpt

When I was doing a fair bit of Ruby I often used the TextMate's shortcut (Ctrl+:) to convert a Ruby String to a Symbol or a Ruby Symbol to a String. It's something I've periodically missed while doing Clojure, and yesterday I found myself in the middle of a refactoring that was going to force the conversion of 5+ Clojure Keywords to Strings. The following emacs lisp is my solution for toggling between Clojure Strings and Keywords. The standard disclaimers apply - it works on my machine, and I've never claimed to know emacs lisp well. A quick video of the behavior: © Jay Fields - www.jayfields.com

## Metrics on Words

DevFeed: [Metrics on Words](<https://devfeed.tech/articles/metrics-on-words-40250.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2011/12/19/metrics-on-words/>)

Published: 2011-12-19T20:59:31Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Mathematics](<https://devfeed.tech/topics/mathematics.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [code](<https://devfeed.tech/tags/code.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [dynamic-programming](<https://devfeed.tech/tags/dynamic-programming.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [github](<https://devfeed.tech/tags/github.md>), [levenshtein-distance](<https://devfeed.tech/tags/levenshtein-distance.md>), [linguistics](<https://devfeed.tech/tags/linguistics.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [metric](<https://devfeed.tech/tags/metric.md>), [monoids](<https://devfeed.tech/tags/monoids.md>), [ngrams](<https://devfeed.tech/tags/ngrams.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [string](<https://devfeed.tech/tags/string.md>)

### AI overview

This introductory article defines finite strings over an alphabet and explains that they form a monoid under concatenation, with the empty string as the identity element. It introduces a series on probabilistic analysis of Google's ngrams for tasks including spelling correction, word segmentation, typing prediction, and cipher decoding.

### Source excerpt

We are about to begin a series where we analyze large corpora of English words. In particular, we will use a probabilistic analysis of Google's ngrams to solve various tasks such as spelling correction, word segmentation, on-line typing prediction, and decoding substitution ciphers. This will hopefully take us on a wonderful journey through elementary probability, dynamic programming algorithms, and optimization. As usual, the code implemented in this post is available from this blog's Github page, and we encourage the reader to use the code to implement our suggested exercises.

## Basic Computer Science

DevFeed: [Basic Computer Science](<https://devfeed.tech/articles/basic-computer-science-40653.md>)

Original publisher: [Read original article](<https://radek.io/posts/basic-computer-science/>)

Published: 2011-08-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Computer science](<https://devfeed.tech/topics/computer-science.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [coding](<https://devfeed.tech/topics/coding.md>)

Tags: [computer-science](<https://devfeed.tech/tags/computer-science.md>), [concatenation](<https://devfeed.tech/tags/concatenation.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>), [science](<https://devfeed.tech/tags/science.md>), [string](<https://devfeed.tech/tags/string.md>)

### AI overview

A beginner-oriented introduction to foundational computer science concepts, including alphabets, symbols, strings, and formal languages. It defines each concept and gives simple examples and formal rules.

### Source excerpt

I build software products and write on the Internet.

## Unicode in Python 2: Decode in, encode out

DevFeed: [Unicode in Python 2: Decode in, encode out](<https://devfeed.tech/articles/unicode-in-python-2-decode-in-encode-out-35482.md>)

Original publisher: [Read original article](<https://darkcoding.net/software/unicode-in-python-2-decode-in-encode-out/>)

Author: Graham King

Published: 2011-08-10T23:24:40Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Django](<https://devfeed.tech/topics/django.md>)

Tags: [decoding](<https://devfeed.tech/tags/decoding.md>), [encoding](<https://devfeed.tech/tags/encoding.md>), [guide](<https://devfeed.tech/tags/guide.md>), [practical](<https://devfeed.tech/tags/practical.md>), [python](<https://devfeed.tech/tags/python.md>), [software](<https://devfeed.tech/tags/software.md>), [string](<https://devfeed.tech/tags/string.md>), [unicode](<https://devfeed.tech/tags/unicode.md>), [utf8](<https://devfeed.tech/tags/utf8.md>)

### AI overview

A practical guide to handling Unicode in Python 2. It explains how to decode input strings into Unicode, work with Unicode internally, and encode Unicode when producing output, with examples of input sources and common encodings.

### Source excerpt

"Decoding the Python 2 Unicode puzzle: A practical guide."

## Determinism and Finite Automata--A Primer

DevFeed: [Determinism and Finite Automata--A Primer](<https://devfeed.tech/articles/determinism-and-finite-automata-a-primer-40217.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2011/07/02/determinism-and-finite-automata-a-primer/>)

Published: 2011-07-02T23:41:30Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Automaton](<https://devfeed.tech/topics/automaton.md>), [function](<https://devfeed.tech/topics/function.md>)

Tags: [computability-theory](<https://devfeed.tech/tags/computability-theory.md>), [computing](<https://devfeed.tech/tags/computing.md>), [context-free-languages](<https://devfeed.tech/tags/context-free-languages.md>), [deterministic-finite-automata](<https://devfeed.tech/tags/deterministic-finite-automata.md>), [finite-state-machines](<https://devfeed.tech/tags/finite-state-machines.md>), [function](<https://devfeed.tech/tags/function.md>), [input](<https://devfeed.tech/tags/input.md>), [language](<https://devfeed.tech/tags/language.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [nondeterministic-finite-automata](<https://devfeed.tech/tags/nondeterministic-finite-automata.md>), [primer](<https://devfeed.tech/tags/primer.md>), [pushdown-automata](<https://devfeed.tech/tags/pushdown-automata.md>), [regular-languages](<https://devfeed.tech/tags/regular-languages.md>), [string](<https://devfeed.tech/tags/string.md>), [turing-machines](<https://devfeed.tech/tags/turing-machines.md>)

### AI overview

This primer introduces computation as a function that maps input to output, then develops a more rigorous model based on finite alphabets and strings. It explains how a computational model recognizes a language by accepting or rejecting strings.

### Source excerpt

The first step in studying the sorts of possible computations (and more interestingly, those things which cannot be computed) is to define exactly what we mean by a "computation." At a high level, this is easy: a computation is simply a function. Given some input, produce the appropriate output. Unfortunately this is much too general. For instance, we could define almost anything we want in terms of functions. Let $ f$ be the function which accepts as input the date of California Super Lotto drawings, and returns the set of winning numbers for that date.

## switch-window reaches 0.8

DevFeed: [switch-window reaches 0.8](<https://devfeed.tech/articles/switch-window-reaches-0-8-34391.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2010/09/switch-window-reaches-0.8/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2010-09-13T15:45:00Z

Content type: article

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [coding](<https://devfeed.tech/topics/coding.md>), [Utility Software](<https://devfeed.tech/topics/utility.md>), [GUI](<https://devfeed.tech/topics/gui.md>)

Tags: [keyboard](<https://devfeed.tech/tags/keyboard.md>), [layout](<https://devfeed.tech/tags/layout.md>), [split](<https://devfeed.tech/tags/split.md>), [string](<https://devfeed.tech/tags/string.md>), [window](<https://devfeed.tech/tags/window.md>)

### AI overview

The author describes updating the switch-window utility to use the keyboard layout from quail-keyboard-layout, using the first ten letters as labels and direct-switch keys instead of hard-coded numbers. The change is intended to improve suitability for cssh users. The article also briefly mentions an upcoming el-get release and asks readers to test it and report problems.

### Source excerpt

I wanted to play with the idea of using the whole keyboard for my switch-window utility, but wondered how to get those keys in the right order and all. Finally found quail-keyboard-layout which seems to exists for such uses, as you can see: (loop with layout = (split-string quail-keyboard-layout "") for row from 1 to 4 collect (loop for col from 1 to 12 ("q" "w" "e" "r" "t" "y" "u" "i" "o" "p" "[" "]") ("a" "s" "d" "f" "g" "h" "j" "k" "l" ";" "'" "\\") ("z" "x" "c" "v" "b" "n" "m" "," "." "/" " " " ")) So now switch-window will use that (but only the first 10 letters) instead of hard-coding numbers from 1 to 9 as labels and direct switches. That makes it more suitable to cssh users too, I guess.