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
| class Participle: | |
| def __init__(self, ending): | |
| self.vowels = ['a', 'e', 'i', 'o', 'u'] | |
| self.doublingConsonants = ['b', 'd', 'g', 'k', 'l', 'm', 'n', | |
| 'p', 'r', 't', 'v', 'z'] | |
| self.vvgExceptions = { | |
| 'abhor': 'abhorring', | |
| 'aver': 'averring', | |
| 'ballot': 'balloting', |
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
| python -m cProfile c45.py b.txt T > profile.txt |
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
| static public string RemoveBadFileNameChars(this string strFileName) | |
| { | |
| char[] badPath = Path.GetInvalidPathChars(); | |
| char[] badFile = { '\\', '/', ':', '*', '?', '\"', '<', '>', '|', '' }; | |
| foreach (char c in badPath) | |
| strFileName = strFileName.Replace(c, '_'); | |
| foreach (char c in badFile) | |
| strFileName = strFileName.Replace(c, '_'); | |
| strFileName = strFileName.Replace("\0", ""); |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.ComponentModel.Composition; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using System.Linq; | |
| using Eastwind.Entities; | |
| using Esoteric; | |
| using Esoteric.DAL.Interfaces; |
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 bisect | |
| class NFA(object): | |
| EPSILON = object() | |
| ANY = object() | |
| def __init__(self, start_state): | |
| self.transitions = {} | |
| self.final_states = set() | |
| self._start_state = start_state |
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
| puts {obect}.inspect | |
| binding.pry |
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 similar_songs(): | |
| import csv | |
| vector = ['acousticness', 'danceability', 'energy', | |
| 'instrumentalness', 'liveness', 'speechiness', | |
| 'valence'] # minus 'bpm & 'key' | |
| underworld = 'underworld.txt' | |
| mbm = 'mbm.txt' | |
| orbital = 'orbital.txt' |
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 genGrayCode(n): | |
| if n == 1: | |
| return ['0', '1'] | |
| else: | |
| lastCode = genGrayCode(n - 1) | |
| rLastCode = lastCode[:] | |
| rLastCode.reverse() | |
| lastCode = ['0' + x for x in lastCode] | |
| rLastCode = ['1' + x for x in rLastCode] | |
| return lastCode + rLastCode |
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 traceback | |
| def parse_traceback(stack: traceback.StackSummary, start_found=False): | |
| ss = [] | |
| for frame in stack: | |
| filename, line_number, function_name, code = frame | |
| filename:str = filename.replace("/Users/jfarley/.pyenv/versions/3.9.18/envs/medusa/lib/python3.9/site-packages/", "lib/") | |
| filename = filename.replace("/Users/jfarley/dvp/csm/", "") |
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
| for(var p in scope) | |
| { | |
| if(typeof scope[p] !== "function") { | |
| console.log(p); | |
| } | |
| } |
OlderNewer