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
| import be.tarsos.dsp.AudioEvent | |
| import be.tarsos.dsp.io.jvm.AudioDispatcherFactory | |
| import be.tarsos.dsp.pitch.PitchDetectionHandler | |
| import be.tarsos.dsp.pitch.PitchDetectionResult | |
| import be.tarsos.dsp.pitch.PitchProcessor | |
| import be.tarsos.dsp.pitch.PitchProcessor.PitchEstimationAlgorithm | |
| import java.awt.Robot | |
| import java.awt.event.InputEvent | |
| import java.util.concurrent.Executors | |
| import java.util.concurrent.TimeUnit |
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
| // The following data should be run in the console while viewing the page https://read.amazon.com/ | |
| // It will export a CSV file called "download" which can (and should) be renamed with a .csv extension | |
| var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024); | |
| getAmazonCsv = function() { | |
| // Set header for CSV export line - change this if you change the fields used | |
| var csvData = "ASIN,Title,Authors,PurchaseDate\n"; | |
| db.transaction(function(tx) { |
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
| def profile_func(filename=None): | |
| def proffunc(f): | |
| def profiled_func(*args, **kwargs): | |
| import cProfile | |
| import logging | |
| logging.info('Profiling function %s' % (f.__name__)) | |
| try: | |
| profiler = cProfile.Profile() | |
| retval = profiler.runcall(f, *args, **kwargs) | |
| profiler.dump_stats(filename or '%s_func.profile' % (f.__name__)) |