Questions tagged [strings]
A string is a sequence of characters. It is commonly used to represent text or a sequence of bytes. Use this tag along with the appropriate programming language being used.
2,973 questions
4
votes
1
answer
107
views
Simple random password generator in c#
A simple random password generator in C#. Looking for any improvements around speed or design. Any char[] can be passed to choose random chars from. The array I ...
2
votes
2
answers
96
views
Checking for weak string isomorphism in Java
Intro
I call two \$n\$-strings \$s\$ and \$z\$ over the alphabet \$\Sigma\$ weakly isomorphic if their character frequency multisets are equal. In other words, for an input strings \$s\$, we derive a ...
10
votes
3
answers
918
views
Checking for string isomorphism in C++
Intro
This snippet is a translation of the Java version.
Code
string_util.hpp:
...
4
votes
1
answer
149
views
Checking for string isomorphism in Java
Intro
Two \$n\$-strings \$s = \langle s_1 \ldots s_n \rangle \$ and \$z = \langle z_z \ldots z_n \rangle\$ are considered isomorphic if and only if there exists a bijection \$f\$ such that for all \$...
6
votes
1
answer
289
views
Splitting a long introduction into collapsible elements easier to read and translate
Before I started, we had a few long introductory texts that were shown to users in different part of the editor window, depending on what type of object they are editing. The texts describe how to add ...
2
votes
0
answers
57
views
Funny time with DNA: a \$k\$-mer index data structure in Java, Take II
(See the previous and initial iteration.)
Intro
This time, I decided to pack the genomic data such that 4 nucleotide bases are encoded into a single byte. In other words, ...
4
votes
1
answer
99
views
Funny time with DNA: a \$k\$-mer index data structure in Java
(See the next iteration.)
This time I have programmed a simple data structure called \$k\$-mer index. The actual word \$k\$-mer is a synonym of substring of length \$k\$. This data structure is built ...
5
votes
1
answer
376
views
JavaScript Text Summarizer
I wrote this both to help read (and edit/summarize) my own work, but mainly to be able to get through the mounds of papers I was asked to read as a graduate student.
This is a summarization algorithm ...
3
votes
1
answer
116
views
Informal Text HTML & JavaScript Scorer
This is something I've been writing for a paper I'm working on. There is a debate about what is formal text and what is not, but what I know about myself and my writing is that I use certain words (...
5
votes
1
answer
332
views
Multiplying two large numbers whose digits you have in a string, in AEC compiled to WebAssembly
You can see it live here: https://flatassembler.github.io/multiplying-strings-aec.html
...
2
votes
1
answer
195
views
Attempt at a Different Variation of the strstr(...) Function
I decided to work on an idea I had to 'optimize' the classic C function strstr.
Most of the implementations I had seen that did not make use of advanced ...
6
votes
1
answer
572
views
Substring = Permutation of a given pattern
I am working on a problem on LeetCode.
Considering only lowercase characters from 'a' to 'z', I have written some Java code to check if a permutation of a given pattern is a substring of a given ...
4
votes
3
answers
559
views
Finding Special Parts in a Word
Task description:
Imagine you have a long word made up of small letters like "a", "b", "c", ancd so on. Let’s call this word a puzzle word.
We want to look at all the ...
9
votes
2
answers
1k
views
A simple C++ function converting the environment variables in main() to an unordered_map
I had this program:
...
2
votes
2
answers
173
views
Convert binary string to text base64 [closed]
I have a dictionary with a lot of symbols, each of which is encoded in a huffman binary string.
Example:
Symbol
Huffman Code
you
010
shall
0111
not
00111
pass
00001
...
...
Therefore I encode the ...