Worksheet Function – Create a number combination of letters in Excel

I am having trouble trying to output a number from a letter combination I have created, e.g. For example, if the cells A1: A10 contain the letters A – J and the cells B1: B10 contain the numbers 1-10. I want to be able to create a number from a combination of letters.

As an example, "ADJ" would become "149", "AAAA" would become "1111" and so on. I've tried a few functions, but to be honest, I do not know enough about Excel to even know what to look for.

Any help or a push in the right direction would be appreciated, cheers.

if statement that compares the first and last letters of the string except

I try to remove a double letter of the first or last letter, except for & # 39; a & # 39; as the first letter and & # 39; l & # 39; and & # 39; e & # 39; e & # 39; as the last letter. However, this code does not look efficient to me, because what if I had 20 exemptions? I do not want to compare every letter in an if statement. How could one better describe this code?

if (first name[0] ! = & # 39; a & # 39; && First given name[firstName.Length - 1] ! = & # 39; l & # 39; && First given name[firstName.Length - 1] ! = & # 39; e & # 39;
{
if (first name[0] == first name[1] && First given name[firstName.Length - 1] == first name[firstName.Length - 2])
{
return firstName.Remove (0, 1) .Remove (firstName.Length - 2, 1);
}
otherwise if (first name[0] == first name[1])
{
return firstName.Remove (0, 1);
}
otherwise if (first name[firstName.Length - 1] == first name[firstName.Length - 2])
{
return firstName.Remove (firstName.Length - 1);
}
}
return firstName;

python – How do I display the letters already used in the gallows game that are wrong? and leave the word on the strip in Maskula?

print ("######################")
print ("# game #)"
print ("######################")
def_force (x = 0):
if x == 0:
print ("_________")
print ("| |")
print ("|")
print ("|")
print ("|")
print ("|")
print ("|")
print ("(That
elif x == 1:
print ("__________")
print ("| |")
print ("| 0")
print ("|")
print ("|")
print ("|")
print ("|")
print ("
(That
elif x == 2:
print ("__________")
print ("| |")
print ("| 0")
print ("| |")
print ("|")
print ("|")
print ("|")
print ("(That
elif x == 3:
print ("__________")
print ("| |")
print ("| 0")
print ("| / |")
print ("| |")
print ("|")
print ("|")
print ("
(That
elif x == 4:
print ("__________")
print ("| |")
print ("| 0")
print ("| / | ")
print ("| |")
print ("|")
print ("|")
print ("(That
elif x == 5:
print ("__________")
print ("| |")
print ("| 0")
print ("| / | ")
print ("| |")
print ("| /")
print ("|")
print ("
(That
elif x == 6:
print ("__________")
print ("| |")
print ("| 0")
print ("| / | ")
print ("| |")
print ("| /")
print ("|")
print ("(That
elif x == 7:
print ("__________")
print ("| |")
print ("| 0")
print ("| / | ")
print ("| |")
print ("| /")
print ("|")
print ("
(That

Error = 0

Word = input (& # 39; enter a word: & # 39;);
temp =[]
for letter in word:
temp.append (& # 39; _ & # 39;

while true:
print (& # 39; * 20) # clears the screen
Forca # prints a gallows drawing
# Press the divination
word = ("The word is:")
word = str.upper ()
print (word, end = & # 39; & # 39;
for inlet temp .:
print (let, end = & # 39; & # 39;
Print (& # 39; * 2)
# Check for loss
if error == 6:
Pause #sai of the game (ends the while)
# Check if the player has won
ganogoGogo = true
for inlet temp .:
if let == & # 39; _ & # 39 ;:
wonJogo = False
If WonGame:
print ("PARABEN'S WINNER !!!")

# Record the user's handwriting
letterDig = input ("Enter a letter:")
#check if you hit a letter
errouLetra = true
for i let (word) enumerate:
if word[i]== letterDig:
temp[i]= Word[i]
errouLetra = False
if errouLetra:
Error = error + 1

Java – Replace letters of a string with *

I've been trying to solve an exercise for days … and am desperate now.

It's a typical hangman, so good so far, but the problem is that the word to be guessed is chosen randomly from a list in a TXT file within the project. That is also OK.

Once the word is selected, the same word must be displayed, replacing the letters with *. Then the game begins with the typical: Ask the user to enter letters over the console and bla bla bla … that's fine, too.

My problem comes up in the beginning, right after the random selection algorithm, since I can not predict which word that will be, I can not know which letters to use for * or how long the word is, so I can not do it either charAt () …

If you could help me, I would really appreciate it.

php – Find letters in the middle of the array with preg_grep

I'm really bad at doing this kind of research, and I do not have much idea how to do that. So I've been able to locate only the word, if it's all written, if it's in order (from start to finish), how can I only find letters instead of words by integers, are they somewhere in the subarray name?

    Array (
Hello
"Hello pt.stackoverflow",
Hello World
"Foo Bar Bas"
)
& # 39; you & # 39; => array (
& # 39; directory 1 & # 39 ;,
& # 39; directory 2 & # 39 ;,
& # 39; directory 3 & # 39 ;,
& # 39; directory 4 & # 39;
)
& # 39; type & # 39; => array (
"File",
"Folder"
"File",
"Folder"
)
);
$ matches = preg_grep (& # 39; / ^ & # 39;. $ find. & # 39; ( w +) / i & # 39 ;, $ directorys['names']);
$ keys = array_keys ($ equals);
if (count ($ keys)! = 0) {
Echo number ($ keys). & # 39; results found 
& # 39 ;; foreach ($ keys as $ index) { echo $ directories['names'][$index] , & # 39; | & # 39 ;. $ directories['dir'][$index] , & # 39; | & # 39 ;. $ directories['type'][$index] , & # 39;
& # 39 ;; } } else { Echo & # 39; No Find Results & # 39 ;. $ find. & # 39;
& # 39 ;; } ?>

A Java game in which the user remembers a list, receives letters, and has to find a word containing those letters

I've written this java game where the user has to memorize a list, get letters, and find a word containing those letters. The player has only a few seconds to enter the word.

Example:

Program expenditures: ON

Player can enter: ONTILIBERALISM, HUMONITARIONISM, NONOTECHNOLOGY, if included in the saved list file.

Other possible inputs for the player:

  • pause: Interrupts the game until the player enters something.
  • skip: Skips the current letters.
  • stop: Stops the game, prints the scores.

Code:

Import org.awaitility.Awaitility;
import org.awaitility.core.ConditionTimeoutException;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util. *;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

Class game {
private static final String F_NAME = "LIST.txt";
private static final int TIME_PER_ANSWER = 10;
private map <string, list> answersMap;
private volatile string answer;
private final map COMMANDS_OUTPUT_MAP = Collections.unmodifiableMap (Map.of ()
"STOP", "Game was stopped manually.",
"PAUSE", "game pauses.",
"ANSWER_DOESNT_CONTAIN_SYLL", "Contains no letters ...",
"WORDSLIST_DOESNT_CONTAIN_WORD", "The word is not in the list ...",
"ANSWER_ALREADY_TYPED", "Already submitted ..."
));
private final list STOP_WAITING_FOR_ANSWER_COMMANDS = Collections.unmodifiableList (List.of (
"STOP",
"PAUSE",
"SKIP"
));

Class ReaderThread implements Runnable {
@Override
public synchronized void run () {
Scanner on = new scanner (System.in);

while (! Thread.interrupted ()) {
answer = in.nextLine (). toUpperCase ();
}
}
}

public static void main (String[] Arguments) {
new game();
}

private game () {
System.out.println ("New Game. Input File:" + F_NAME + ". Time per Answer:" + TIME_PER_ANSWER + "Seconds.");
System.out.println ("Commands:" + STOP_WAITING_FOR_ANSWER_COMMANDS);

this.answersMap = new TreeMap <> ();
Random rand = new Random ();
int wordCounter = 0, lifeCounter = 0;

list syllsList = Objects.requireNonNull (getSyllsList ());
list wordsList = Objects.requireNonNull (getWordsList ());
Optional <list> newWordsListOptional = getNewWordsListOptional (wordsList);
newWordsListOptional.ifPresent ((list) -> System.out.println ("New words:" + list));

Optional <list> noSyllsMatchListOptional = getNoSyllsMatchListOptional (syllsList, wordsList);
noSyllsMatchListOptional.ifPresent (List -> {
System.out.println ("WARNING: THESE LETTERS DO NOT INCLUDE WORDS:" + list);
syllsList.removeAll (list);
});
Optional <list> noWordsMatchListOptional = getNoWordsMatchListOptional (syllsList, wordsList);
noWordsMatchListOptional.ifPresent (List -> {
System.out.println ("WARNING: THESE WORDS DO NOT INCLUDE INPUT LETTERS:" + list);
wordsList.removeAll (list);
});

Collections.shuffle (wordsList);
int syllsListTotal = syllsList.size ();
String behind;
new thread (new ReaderThread ()). begin ();

while (syllsList.size ()> 0) {
resetAnswer ();
String syll = syllsList.get (rand.nextInt (syllsList.size ()));
if (findMatchingWord (syll, wordsList) == null) {
syllsList.remove (syllable);
printSyllChangeMessage (syll, syllsListTotal, syllsList);
continue;
}
System.out.println (syllable);

To attempt {
do {
if (answer.equals ("PAUSE"))
Awaitility.await (). Forever (). Until (() ->! Answer.equals ("PAUSE"));
Awaitility.await (). AtMost (TIME_PER_ANSWER, TimeUnit.SECONDS) .bis (() -> checkAnswer (syll, wordsList, newWordsListOptional));
} while (answer.equals ("PAUSE"));
} catch (ConditionTimeoutException ignore) {}

if (answer.equals ("STOP")) break;
if (answer.equals ("") || answer.equals ("SKIP")) {
hint = findMatchingWord (syllable, word list);
System.out.println ("HINT:" + hint + ".");
lifeCounter ++;
} else {
answersMap.computeIfAbsent (syllable, list -> new ArrayList <> ()). add (answer);
wordCounter ++;
}
}

for (String key: answersMap.keySet ()) {
System.out.println (key + ":" + answersMap.get (key));
}
System.out.println ("number of words:" + wordCounter + "| number of lost lives:" + lifeCounter);
System.exit (0);
}

private LinkedList getSyllsList () {
To attempt {
Return New LinkedList <> (Arrays.asList (Files.lines (Paths.get (F_NAME))
.findFirst ()
.orElse ("")
.split ("\ |")));
} catch (IOException io) {
io.printStackTrace ();
return zero;
}
}

private list getWordsList () {
To attempt {
Return Files.lines (Paths.get (F_NAME))
.skip (1)
.flatMap (line -> Arrays.stream (line.split (" n")))
.collect (Collectors.toList ());
} catch (IOException io) {
io.printStackTrace ();
return zero;
}
}

private Optional <list> getNoSyllsMatchListOptional (List SyllsList, list Word list) {
final String wordsListString = wordsList.toString ();
list noSyllsMatchList = syllsList.stream ()
.filter (s ->! wordsListString.contains (s))
.collect (Collectors.toList ());
return Optional.ofNullable (noSyllsMatchList.isEmpty ()? null: noSyllsMatchList);
}

private Optional <list> getNoWordsMatchListOptional (List SyllsList, list Word list) {
list noWordsMatchList = wordsList.stream ()
.filter (word -> {
for (String syll: syllsList)
if (word.contains (syll)) returns false;
return true;
})
.collect (Collectors.toList ());
return Optional.ofNullable (noWordsMatchList.isEmpty ()? null: noWordsMatchList);
}

private boolean checkAnswer (String syll, List wordsList, Optional <list> newWordsListOptional) {
if (answer.equals ("")) returns false;
if (answer.equals ("NEW")) {
if (newWordsListOptional.isPresent ())
System.out.println ("New words:" + newWordsListOptional.get ());
otherwise
System.out.println ("No new words.");
resetAnswer ();
return it incorrectly;
}

String command = answer;
if (! STOP_WAITING_FOR_ANSWER_COMMANDS.contains (command)) {
if (! answer.contains (syll)) command = "ANSWER_DOESNT_CONTAIN_SYLL";
otherwise if (answerAlreadyTyped (answer)) command = "ANSWER_ALREADY_TYPED";
otherwise if (! wordsList.contains (answer)) command = "WORDSLIST_DOESNT_CONTAIN_WORD";
}

final Optional OUTPUT_MESSAGE = Optional.ofNullable (COMMANDS_OUTPUT_MAP.get (command));
if (OUTPUT_MESSAGE.isPresent ()) {
System.out.println (OUTPUT_MESSAGE.get ());

if (! STOP_WAITING_FOR_ANSWER_COMMANDS.contains (command)) {
resetAnswer ();
return it incorrectly;
}
}
return true;
}

private synchronized void resetAnswer () {
answer = "";
}

private boolean answerAlreadyTyped (String answer) {
return answersMap.values ​​()
.Electricity()
.flatMap (List :: Stream)
.collect (Collectors.toList ())
, contains (answer);
}

private string findMatchingWord (String syllable, List Word list) {
return wordsList.stream ()
.filter (word -> word.contains (syll))
.filter (word ->! answerAlreadyTyped (word))
.find any ()
.orElse (zero);
}

private Optional <list> getNewWordsListOptional (List Word list) {
Optional newWordsSeparator = wordsList.stream ()
.filter (word -> word.startsWith ("-"))
.findFirst ();

if (newWordsSeparator.isPresent ()) {
int index = wordsList.indexOf (newWordsSeparator.get ());
wordsList.remove (index);
return Optional.of (List.copyOf (wordsList.subList (index, wordsList.size ()));
}
return Optional.empty ();
}

private void printSyllChangeMessage (String syll, int syllsListTotal, List SyllsList) {
System.out.println ("ALL WORDS WERE SET FOR LETTERS:" + Syllable + ". LETTERS REMOVED." +
"ALL LETTERS PUT FOR:" + (syllsListTotal - syllsList.size ()) + "/" + (syllsListTotal));
}
}

Test with file list.txt:

BE | ON | IS | XY
BLESSING
BEAUTY
ANTI LIBERALISM
RADIOLABELLIERUNG
IMPRESSIONISTIC
INCOMPREHENSIBLE
humanity
AUTO TRANSFORMER
INTELLIGENT
-------------------------- MY NEW WORDS TO BE REMEMBERED ------------------- ------
FEDERBETTUNG
BIOGEOCHEMISTRY
FACT
NANOTECHNOLOGY
ANTIAPHRODISIAK
essentialism

A few questions:

  • I use Awaibility (there was no tag for it …) to wait for user input until its words are correct or time runs out, without which it will not work. If you want to test the code, download it expectability and expectation dependencies from there. Is there a simple alternative to this?
  • I do not think the code is optimized. How could I optimize it?

nginx – (404 errors) Why are hackers looking for directories with the name "/ najwutoanfga /" and other 10-12 strings of random letters?

I looked into the 404 bugs of my Nginx logs today for what the hackers on my site are trying to do.

I used this command:

cat access.log | grep & # 39; 404 & # 39;

I've seen the usual requests for directories like "/ admin.", "/ Backup /" or "/ private /", but I also see some requests like these:

"GET / yatjgmatiak / HTTP / 1.1"

"GET / gkjasdhytkaf / HTTP / 1.1"

"GET / ukaewlinfsda / HTTP / 1.1"

"GET / vankhasgeskl / HTTP / 1.1"

There are not that many of them (only about 50 requests in total). So if it's a violent attempt to find an admin panel, it would be a bad attempt.

What are these hackers looking for or trying to do?