Pages

Saturday, June 06, 2020

Python / Speech recognition / Google recognition

Install dependencies:
pip3 install SpeechRecognition pip3 install pyaudio
Test installation:
python3 -m speech_recognition
Try:
import speech_recognition recognizer = speech_recognition.Recognizer() exitRequested = False while True: with speech_recognition.Microphone() as source: recognizer.adjust_for_ambient_noise(source, duration = 1) print("Speak: ") audio = recognizer.listen(source) try: text = recognizer.recognize_google(audio, None, "en-US") print("Said: " + text) if (text is not None and text == "exit"): break except: print("Error on trying to recognize audio.")

Sunday, May 17, 2020

TensorFlow - Fedora 32

packages="absl absl-py astunparse gast google google-api-python-client google-cloud-translate \ class="source">google-pasta keras keras_preprocessing matplotlib numpy opt_einsum protobuf tensorboard \ termcolor wrapt tenssorboard tensorflow" for package in $packages; do sudo pip install $package done

Wednesday, February 26, 2020

Apache Tomcat - Administration configuration

In config/tomcat-users.xml add:
<role rolename="admin-gui"/> <role rolename="manager-gui"/> <role rolename="manager-script"/> <user username="tomcat" password="<PASSWORD>" roles="admin-gui, manager-gui, manager-script"/>
Replace <PASSWORD> with your Tomcat appropriate password.

Tuesday, January 07, 2020

Python - Return array from array iteration

def x(): return [[i, j] for i in [1, 2, 3] for j in [3, 4, 5]] y = x() for i in y: print(i[0], i[1])
Output:
1 3 1 4 1 5 2 3 2 4 2 5 3 3 3 4 3 5