A string is a sequence of zero or more characters. It is commonly used to represent text or a sequence of bytes. Use this tag along with the appropriate programming language being used.
-1
votes
0answers
17 views
Using for loop to get the Hamming distance between 2 strings [closed]
So i'm having some trouble with this code. i need to get the Hamming distance (the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols ...
-1
votes
0answers
30 views
Program gives to a word special numerical value. I need help to upgrade my code [closed]
Program checks each letter of the string one by one and calculates the sum of the numerical values of each letter i have applied. I need your help to not let program count value of "i" teller if it ...
1
vote
1answer
59 views
High School Java Class: Pong Project External Reviewer
Panelball class:
import java.awt.*;
import java.awt.event.KeyEvent;
import javax.swing.*;
public class Panelball extends JPanel implements Runnable {
private static final long ...
1
vote
1answer
26 views
Java - Is this the correct implementation of a timer/timertask to destroy a process that overruns a defined time limit
I was wondering if this is the correct implementation of a times task to destroy a thread after it overruns a predefined time period:
it works by creating a getting the thread from ...
1
vote
0answers
20 views
Generating random strings
I've created the following string manipulation function for randomizing my passed string in Lua:
require "string"
require "math"
math.randomseed( os.time() )
function string.random( self )
...
2
votes
1answer
31 views
LISP - Modify string
I have to write a program that changes a string's vowels, consonants and other symbols into C, V respectively 0. I've done this but I wonder if there is a more efficient and elegant way to do it. ...
1
vote
4answers
127 views
How could this postfix notation program be improved?
My postfix program allows the user two options one option for calculating a postfix equation:
* Confirmations after each input (after an input, the user is ask for another number, operator, or final ...
2
votes
2answers
106 views
string to integer (implement atoi)
Implement atoi to convert a string to an integer.
Requirements for atoi: The function first discards as many whitespace
characters as necessary until the first non-whitespace character is
...
1
vote
1answer
106 views
Faster JavaScript fuzzy string matching function?
I'm using the following function to fuzzy match strings:
function fuzzy_match(str,pattern){
pattern = pattern.split("").reduce(function(a,b){ return a+".*"+b; });
return (new ...
2
votes
1answer
115 views
JAVA, Twitter4j insert tags around entities in body
Because we're passing object to Spring Framework in which Jackson classes convert them into JSON as a reposnse we chose to Implement more simple Tweet class rather than the twitter4j provided Status ...
3
votes
3answers
109 views
Length of last word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is ...
3
votes
1answer
119 views
Dynamically allocated C strings in C++, concatenation, pointers, etc
I'm writing a small Win32 Console app that manipulates the contents of binary files. It accepts the filename as a command line parameter and writes to a file named filename.scramble
This is the first ...
3
votes
1answer
93 views
Crtitique my Haskell function 'capitalize'
I am a Haskell beginner. I wrote the following function that takes a string and returns a new string with each word capitalized: first letter uppercase, following letters lower-cased.
It works, but I ...
2
votes
1answer
139 views
Get metadata from an Icecast radio stream
I am new to Python and not very familiar with advanced Python data structures.
I have written a function to receive data from a socket in Python and perform string manipulations on it. The basic ...
2
votes
1answer
109 views
Too slow two strings comparer
I have 2 strings for example:
abcabc and bcabca
or
aaaabb and abaaba
I checked that second string is the same or not like first string but shifted.
bcabca = ..abca + bc...
Here is code it works ...