This file contains 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
"""A program that encodes and decodes hidden messages in images through LSB steganography""" | |
from PIL import Image, ImageFont, ImageDraw | |
import textwrap | |
def decode_image(file_location="images/encoded_sample.png"): | |
"""Decodes the hidden message in an image | |
file_location: the location of the image file to decode. By default is the provided encoded image in the images folder | |
""" | |
encoded_image = Image.open(file_location) |
This file contains 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
from pocketsphinx.pocketsphinx import * | |
from sphinxbase.sphinxbase import * | |
import os | |
import pyaudio | |
import wave | |
import audioop | |
from collections import deque | |
import time | |
import math |
This file contains 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
(*This is the AppleScript component to the iTunes -> Spotify playlist sync program | |
Written by Sophie Li: 12/29/16*) | |
try | |
tell application "Finder" | |
delete (every item of folder (((path to home folder) as text) & "Scripts:playlist_sync:playlists") whose name ends with ".xml") | |
end tell | |
on error errMsg number errNum | |
display dialog "Error " & errNum & return & return & errMsg buttons {"Cancel"} default button 1 | |
end try |
This file contains 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
#!/usr/bin/env python | |
from pocketsphinx.pocketsphinx import * | |
from sphinxbase.sphinxbase import * | |
import os | |
import pyaudio | |
import wave | |
import audioop | |
from collections import deque |
This file contains 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
cmake_minimum_required(VERSION 3.9) | |
find_package(Threads) | |
find_package(LibXml2 REQUIRED) | |
if (MINGW) | |
add_definitions(-mno-ms-bitfields) | |
endif () | |
if (MSVC) | |
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS) |
This file contains 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
#!/usr/bin/env python | |
""" | |
This code generates the path required for a knight's tour | |
around a chessboard with user-specified dimensions | |
Written by Sophie Li, 2016 | |
http://blog.justsophie.com/algorithm-for-knights-tour-in-python/ | |
""" | |
import sys |
This file contains 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
import string | |
import random | |
from collections import Counter | |
""" | |
An easy implementation of the Caesar cipher | |
Written by Sophie Li, 2018 | |
http://blog.justsophie.com/caesar-cipher-generator/ | |
""" |
This file contains 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
#!/usr/bin/python | |
""" | |
This code is part of ros package that subscribes to an image topic | |
and detects smiles found in the image. Results are then republished to a ros | |
image topic. | |
This node is an example of how I prefer to write my ROS nodes, as a single | |
class with a run function. |
This file contains 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
def solve(self): | |
# Add starting cell to open heap queue | |
heapq.heappush(self.opened, (self.start.f, self.start)) | |
while len(self.opened): | |
# Pop cell from heap queue | |
f, cell = heapq.heappop(self.opened) | |
# Add cell to closed list so we don't process it twice | |
self.closed.add(cell) |
This file contains 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
#!/usr/bin/python | |
import heapq | |
class Cell(object): | |
def __init__(self, x, y, is_wall): | |
self.reachable = not is_wall | |
self.x = x | |
self.y = y | |
self.parent = None |
NewerOlder