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
| let ELEMENTQUERY = "a.clearfix" | |
| let links = document.querySelectorAll(ELEMENTQUERY); | |
| let linkUrls = ""; | |
| links.forEach((item)=>linkUrls +=item +="\n"); | |
| console.log(linkUrls); |
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
| 'permutation program' | |
| def permute(data, size, picked): | |
| 'recursive function' | |
| if not size: | |
| res = ''.join(picked) | |
| print(res) | |
| else: | |
| # print(data) | |
| for element in data: |
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 pprint | |
| def calc_tuple(x, t): | |
| x_twice = round(2 * x,1) | |
| t_times2 = round(t**2,2) | |
| a = round(x_twice/t_times2, 2) | |
| return (x,x_twice,t,t_times2,a) | |
| def calc_table(tuple_list): | |
| count = len(tuple_list) |
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
| cases = [ | |
| (0.4,0.49), | |
| (0.5,0.60), | |
| (0.6,0.73), | |
| (0.7,0.85) | |
| ] | |
| velocities = [(distance/duration) for (distance, duration) in cases] | |
| rounded_velocities = [round(v,3) for v in velocities] | |
| average_velocity = sum(rounded_velocities) / float(len(rounded_velocities)) | |
| rounded_average_velocity = round(average_velocity, 3) |
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
| var matches = [].slice.call(document.querySelectorAll('[id^=DropDownList]'));//Gets all dropdown selectors in an array | |
| for (var i=0;i<matches.length;i++){//iterate through dropdownlists | |
| //** random number generator part | |
| var min = Math.ceil(2); | |
| var max = Math.floor(6); | |
| var randscore=Math.floor(Math.random() * (max - min)) + min; | |
| //** random number generator part ends | |
| matches[i].selectedIndex=randscore.toString();// set scores | |
| }//we're done |