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
| define(['dep1', 'dep2'], function (dep1, dep2) { | |
| //Define the module value by returning a value. | |
| return { | |
| testMethod: function(){ | |
| console.log('testMethod') | |
| } | |
| } | |
| }) |
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
| const c = console.log.bind(console); | |
| c('cool!'); |
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
| # Given an integer, , print the following values for each integer from to : | |
| # Decimal | |
| # Octal | |
| # Hexadecimal (capitalized) | |
| # Binary | |
| hexa_digit = { | |
| 0: 0, | |
| 1: 1, |
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 matplotlib.pyplot as plt | |
| p1 = [1, 1] | |
| p2 = [5, 3] | |
| p3 = [2, 3] | |
| x_values = [p1[0], p2[0]] | |
| y_values = [p1[1], p2[1]] | |
| plt.plot(x_values, y_values, 'bo', linestyle="--") | |
| plt.xlim(0, 6), plt.ylim(0, 6) |
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
| # Read input from STDIN. Print output to STDOUT | |
| # Size: 7 x 21 | |
| # ---------.|.--------- | |
| # ------.|..|..|.------ | |
| # ---.|..|..|..|..|.--- | |
| # -------WELCOME------- | |
| # ---.|..|..|..|..|.--- | |
| # ------.|..|..|.------ | |
| # ---------.|.--------- |
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
| #this is complex | |
| thickness = 9 | |
| c = 'H' | |
| for i in range(thickness): | |
| print((c*i).rjust(thickness-1)+c+(c*i).ljust(thickness-1)) | |
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 cardano-serialization-lib | |
| const plutusList = CSL.PlutusList.new(); | |
| plutusList.add(CSL.PlutusData.new_bytes(Buffer.from('3f7826896a48c593598465a096d63606ceb8206', 'hex'))); | |
| plutusList.add(CSL.PlutusData.new_integer(CSL.BigInt.from_str('1888'))); | |
| plutusList.add(CSL.PlutusData.new_integer(CSL.BigInt.from_str('1'))); | |
| CSL.PlutusData.new_constr_plutus_data(CSL.ConstrPlutusData.new(CSL.Int.new_i32(0), plutusList)); | |
| ''' | |
| { | |
| "constructor":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
| const datums = this.S.PlutusList.new(); | |
| const datum = this.S.PlutusData.new_constr_plutus_data( | |
| this.S.ConstrPlutusData.new( | |
| this.S.Int.new_i32(1), | |
| this.S.PlutusList.new() | |
| ) | |
| ); | |
| datums.add(datum); | |
| console.log("datums", datums); |
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
| # 1 -> 2 -> 3 -> 5 -> 2 -> 1 | |
| sample_input_graph_dict_1={ | |
| "1":["2"], | |
| "2":["3","1"], | |
| "3":["5"], | |
| "4":[], | |
| "5":["2"], | |
| "6":[], | |
| } | |
| # 1 -> 3 -> 5 -> 6 -> 4 -> 5 -> 2 -> 6 |
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 timer = document.getElementById("timer"); | |
| var idealTimer = document.getElementById("ideal"); | |
| var runningId; | |
| var idealId; | |
| var value = "0:0"; | |
| var Idealvalue = "00:00"; | |
| function startTimer(m, s) { | |
| value = m + ":" + s; | |
| if (s == 60) { | |
| m = m + 1; |