Should not be too difficult to do. Let's have a look at a very basic approach first.
You search Pirate Bay for the name/names in the porn category and sort by date. https://thepiratebay.org/"name one"%7C"name two"%7C"name three"/0/3/500
(0=first page, 3=by date descending, 500=porn)
Saved as a bookmark this would give you the list of the latest torrents with the porn stars you are looking for without even using a script.
You could of course use a script to maintain a list of names you are interested in and have that script generate the link so that you don't have to manually edit the bookmark every time you change something.
The script could also remove all the results older than the time you last checked to really only show new torrents.
Still no notifications. If you want to be notified (where? how? when?) the script would have to open the shortcut in the background, check if there are new entries, and then notify you about those.
Let's talk about something called a dictionary. In formal terms, it's an associative array that maps keys to values. It's called a dictionary because a dictionary is a good example of one - the words are the keys, and the respective definitions are the values.
You can make a dictionary that associates words with how many times they occur in a document.
A couple of things have to occur before you can do this, though.
Let's work on lines in a file.
def remove_punctuation(s): return ''.join(c for c in s if c.isalnum() or c.isspace())
def remove_case(s): return ''.join(c.lower() for c in s)
Next, we get the frequency dictionary for a line.
def get_freq_dict(s): result_dict = {} for word in s.split(): result_dict[word] = result_dict.get(word, 0) + 1 return result_dict
We define a function for combining frequency dictionaries.
def combine_dicts(*ds): result_dict = {} for d in ds: for k, v in d.items(): result_dict[k] = result_dict.get(k, 0) + v return result_dict
And now we proceed over all of the lines of a file.
def get_freqs_file(filename): result_dict = {} with open(filename) as f: for line in f: line = remove_punctuation(remove_case(line)) result_dict = combine_dicts(result_dict, get_freq_dict(line)) return result_dict
Working here.
AutoHotkey is a good scripting tool to do little automation tasks like this
here is a quick example script to make two hotkeys, press y make it type Yes + tab key and press n to auto type No + tab key
y:: Send Yes{tab} return
n:: Send No{tab} return
all the commands are well documented with a lot of examples in the reference docs
Just extract the file, run "setup.exe", then go into keyboard settings and change the layout from whatever it is to "SotaGuy Flipped". The exact settings menu will change depending on which version of Windows you're running, but it should work on anything newer than XP.
AutoHotKey is your solution.
Here is an old discussion with code already in place for the display portion. It's old code, but should still work. There may be even easier ways but in to do this now with AutoHotKey. https://autohotkey.com/board/topic/20084-secondary-monitor/
This should solve your audio switch portion. https://www.autohotkey.com/boards/viewtopic.php?t=68952
See here: https://repl.it/@pogtastic/CatFinder
Running
$ python3 cat_finder.py
will scrape the website and save the cats to cats.json
.
If cats.json
already exists, it will then look at the difference between the cats it just scraped and the existing cats in the file. It will then print any new cats that it hasn't seen before, based on the ID numbers.
Additional arguments can be used to load from different JSON files and save to a different JSON file.
Notifying yourself with the contents of the new cats is left as an exercise for the reader. At my work, I use email for this kind of notification, so I have some thoughts on using smtplib
. You can also send an email to your phone provider, which will then send you a text.
Consider a dictionary that associates names with a list of their capabilities. In Python:
workers = { "Adam" : [1, 3, 4] "Bob" : [2, 4], "Charlie" : [1, 4], "Dana" : [2, 3], "Ellie" : [1, 2, 3], "Felix" : [3, 4] }
We can now make a function to see if two people can combine together to support all products. I'm a jerk, so I make a general-case function.
def supports(lsts, target): # Python doesn't do foldl very well, so we'll do it imperatively. Eww. all_supported = set() for l in map(lambda tup : tup[1], lsts): all_supported.update(l) return all_supported == set(target)
We can now iterate through all possible 2-person permutations of the list and see if they support [1, 2, 3, 4]
.
import itertools
def fsts(tup_lst): return [tup[0] for tup in tup_lst]
def find_teams(worker_dict, target): return [fsts(tup_lst) for tup_lst in itertools.permutations(worker_dict.items(), 2) if supports(tup_lst, target)]
Unfortunately, this problem is equivalent to 3-SAT, so there's no fast way to determine the best way to divide up the teams so that the most teams are created. So, I'm just going to pick at random. If you don't like it, run the function again.
import random
def find_distinct_teams(worker_dict, target): teams = find_teams(worker_dict, target) random.shuffle(teams) chosen_set = set() chosen = [] for team in teams: if set(team).isdisjoint(chosen_set): chosen.append(team) chosen_set.update(team) return chosen
Working here: https://repl.it/@pogtastic/BonyDarkgrayEmulation
Note that sometimes it arrives on the 3-team solution, other times it's stuck with 2 teams. But it'll run very fast in the event that you have, like, 20 people.
The general idea should be the following:
Let's break this up into functions. First, we test for our 0 matrix.
int is_zero_line(size_t length, double eps, double line[length]) { for(size_t i = 0; i < length; i++) { if(fabs(line[i]) > eps) { return 0; } } return 1; }
int is_zero_matrix(size_t rows, size_t cols, double eps, double matrix[rows][cols]) { for(size_t i = 0; i < rows; i++) { if(!is_zero_line(cols, eps, matrix[i])) { return 0; } } return 1; }
Now, we define a function for subtracting matrices.
void subtract_matrix(size_t rows, size_t cols, double m1[rows][cols], double m2[rows][cols], double result[rows][cols]) { for(size_t i = 0; i < rows; i++) { for(size_t j = 0; j < cols; j++) { result[i][j] = m1[i][j] - m2[i][j]; } } }
Lastly, we define a function to subtract two matrices and see if the result is the 0 matrix.
int is_equal(size_t rows, size_t cols, double eps, double m1[rows][cols], double m2[rows][cols]) { double tmp[rows][cols]; subtract_matrix(rows, cols, m1, m2, tmp); return is_zero_matrix(rows, cols, eps, tmp); }
We can now do this to our three matrices.
int matrix_permutation(size_t rows, size_t cols, double eps, double A[rows][cols], double B[rows][cols], double C[rows][cols]) { return is_equal(rows, cols, eps, A, B) && is_equal(rows, cols, eps, A, C) && is_equal(rows, cols, eps, B, C); }
Working here: https://repl.it/@pogtastic/Matrices
Here's my attempt, written in Python.
import csv import sys
def get_fieldnames(filename): with open(filename) as f: return f.readline().strip().split(",")
def concat_and_append(target, filename_lst): with open(target, "w") as out: fieldnames = get_fieldnames(filename_lst[0]) fieldnames.append("Filename") out_writer = csv.DictWriter(out, fieldnames) out_writer.writeheader() for filename in filename_lst: with open(filename) as f: reader = csv.DictReader(f) for row in reader: unordered_dict = dict(row) unordered_dict["Filename"] = filename out_writer.writerow(unordered_dict)
def main(): target = sys.argv[1] filenames = sys.argv[2:] concat_and_append(target, filenames)
if name == "main": main()
Working here in a slightly modified form: https://repl.it/@pogtastic/concatcsvs
https://hastebin.com/egowumizav.xml
I have no idea what your tables look like, but here is the gist of it in the simplest way possible. It does require a bit of touch up. But its all one file and this would be a very 'broad strokes' approach on how to get it done.
In this zip file there is a python script called tally.py
and a text file called counter
.
At startup, it reads the saved number in the counter
file, although it displays 0 for whatever reason, then after the first time you hit +
it shows the correct number (the saved one + 1).
After each time you increased (or decreased) the number, it saves it again to the file.
You can also double-click the number and change it yourself by just typing whatever number you want, for example 0 to reset the counter.
You can assign a key to the script, for example T (or something you'd never press. Names of special keys can be found here) and have it bring up the chat for you:
#ifwinactive League of Legends (TM) Client ~t::sendinput {enter}/mute all{enter}/muteping all{enter} *Enter::return *NumpadEnter::return
This still works the same way; your enter key will be disabled from the start. When you press "T", it will send "{enter}/mute all{enter}/muteping all{enter}".
Another option would be to toggle the whole thing with "T":
#ifwinactive League of Legends (TM) Client suspend *Enter::return *NumpadEnter::return ~t:: suspend sendinput {enter}/mute all{enter}/muteping all{enter} Once you press "T", the same input will be sent and your enter key will be disabled. Pressing "T" again will do the same thing, i.e. send both mute commands and toggle (this time enable) your enter key.
The script still only applies to the League of Legends window, meaning that if you alt+tab out of the game, you can freely use all keys, toggled or not.
If you don't care about speed, this is super easy to do. Here's a bash function for it:
function does_user_exist { name="$1" resource_name="@${name}" wget -q "https://www.tiktok.com/${resource_name}" result=1 if grep -q '"following":' "${resource_name}"; then result=0 fi rm "${resource_name}" return $result }
Example usage:
if does_user_exist test33434; then echo "exists"; else echo "doesn't"; fi
Give Bandizip a try, It is actively maintained and i think it have all the context menu features you mentions, I also like delete after extract
I believe this does what you are looking for. It's written in Groovy. The list of names and number of lines are defined directly in the script and it outputs the result to the console. This could of course easily be changed to use txt files...
If you don't have Groovy installed you can try it out here: https://www.jdoodle.com/execute-groovy-online
def names = """bob tom jerry sam kyle james""".split(/\r?\n/) as List
def lines = 10
(lines-names.size()).times { names += "" } Collections.shuffle(names)
println names.join("\r\n")
You could use Svelte, a JavaScript framework with built-in animation capabilities
I made a small demo visualising Bubble Sort:
https://svelte.dev/repl/600e2a9aae6340e39135cce69a553dac?version=3.38.3
[http://www.pythontutor.com/](python tutor) is a good place to learn about python, and there's some free python courses on [https://www.codecademy.com/learn/learn-python](codeacademy) (although it's an old version of python, the concepts are mostly the same).
Anything specific you're wanting help with?
here (click off to the side to dismiss banner)
if you don't mind cutting and pasting, this should meet your expectations. if a list isn't "random enough" you can hit "go" again to re-run it.
assumptions:
Ah okay, that makes sense :) Once you extract the data from the written text, it should be easy to compile it into a spreadsheet. There's a few good online OCR tools, you could setup a script to automatically run the pdf's through those, might be easier (albeit slower probably) than setting up your own OCR tool.
I really like this one https://ocr.space/, and they even have a free OCR API listed that you can use for your own software, and instructions on how to use it! https://ocr.space/OCRAPI
uccw (ultimate custom clock widget) is an android widget and open source project that has every clock face and display imaginable.
I'm not familiar with sundowners, what are the requirements for such a clock?