This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # To run command: mesop main.py | |
| import mesop as me | |
| import google.generativeai as genai | |
| import json | |
| import typing_extensions | |
| @me.stateclass | |
| class Article: | |
| title: str |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # encoding: utf8 | |
| # vigenere cipher | |
| # https://stackoverflow.com/a/2490718/1675586 | |
| def encode(key, string): | |
| encoded_chars = [] | |
| for i in range(len(string)): | |
| key_c = key[i % len(key)] | |
| encoded_c = chr(ord(string[i]) + ord(key_c) % 256) | |
| encoded_chars.append(encoded_c) |