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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"sync" | |
"time" | |
) | |
// Course struct |
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 sids = { | |
main: 0, | |
compsoc: 1, | |
comsoc: 2, | |
pes: 3, | |
aps: 4, | |
sps: 5, | |
ras: 6, | |
wie: 7, | |
sight: 8, |
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 json | |
# load the data from the JSON file | |
with open('execom.json') as f: | |
data = json.load(f) | |
# define the sids mapping | |
sids = { | |
'main': 0, | |
'compsoc': 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
controller.onabort = () => { window.alert('The network request was cancelled.')}; |
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
axios.get(`api.example.com/endpoint`,{ | |
signal: controller.signal, | |
}) | |
.then((response: any) => { | |
// handle data | |
}) | |
.catch(() => { | |
// handle failure | |
}); |
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
int fibbonacci(int n) | |
{ | |
if(n == 0) | |
return 0; | |
else if(n == 1) | |
return 1; | |
else | |
return (fibbonacci(n-1) + fibbonacci(n-2)); | |
} |
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
area reset,code | |
entry | |
mov r5,#10 | |
ldr r0,=0x40000000 | |
mov r1,#01 | |
mov r2,#00 | |
back add r3,r1,r2 | |
str r3,[r0],#04 | |
mov r2,r1 |
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 arr = [1, 2, 3, 4, 5]; | |
const newArr = arr | |
.map((element) => { | |
return element * 2; | |
}) | |
.filter((element) => { | |
return element > 5; | |
}); | |
console.log(newArr); |
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 arr = [1, 2, 3, 4, 5]; | |
const newArr = arr.map((element) => { | |
return element * 2; | |
}); | |
console.log(newArr); |
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 arr = [1, 2, 3, 4, 5]; | |
arr.forEach((element) => { | |
console.log(element * 2); | |
}); |