This file contains 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 asyncio | |
from random import randint | |
async def apiCallWorker(name, queue): | |
while True: | |
apiId = await queue.get() | |
sleepTimeInSec = randint(0, 3) | |
print(f"worker {name} apiId {apiId} sleeping for {sleepTimeInSec}") | |
await asyncio.sleep(sleepTimeInSec) |
This file contains 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
'use strict'; | |
/** | |
* Starts `nodemon` and `browser-sync` | |
*/ | |
const path = require('path'); | |
const fs = require('fs'); | |
const nodemon = require('nodemon'); | |
const browserSync = require('browser-sync').create(); |
This file contains 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 sg.edu.nus.comp.cs4218.impl.fileutils; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import org.junit.Test; | |
import sg.edu.nus.comp.cs4218.fileutils.ICatTool; | |
public class CATToolTest { |
This file contains 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 reservation; | |
public class Request { | |
public int terminalId; | |
public String function; | |
public Object args; | |
public Request(int terminalId, String function, Object args) { | |
this.terminalId = terminalId; |
This file contains 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
#include <mpi.h> | |
#include <iostream> | |
#include <cstdlib> | |
#include <vector> | |
using namespace std; | |
const int NUMPROCS = 12; | |
const int FIELD0 = 10; // (0,0) -> (64,64) | |
const int FIELD1 = 11; // (65,0) -> (128,64) |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <sys/time.h> | |
#include <assert.h> | |
#include <algorithm> | |
typedef struct | |
{ |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define KB 1024 | |
#define MB 1024 * 1024 | |
int main() { | |
unsigned int steps = 256 * 1024 * 1024; | |
static int arr[4 * 1024 * 1024]; |
This file contains 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 java.util.*; | |
// A0087884H | |
// Lim Jiew Meng | |
// Collaborators: | |
class HospitalTour { | |
private int V; // number of vertices in the graph (number of rooms in the hospital) | |
private ArrayList<HashSet<Integer>> AdjList; // the graph (the hospital) | |
private Vector < Integer > RatingScore; // the weight of each vertex (rating score of each room) |
This file contains 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 java.util.*; | |
// A0087884H | |
// Lim Jiew Meng | |
// Collaborators: | |
class SchedulingDeliveries { | |
protected ArrayMaxHeap mothersToBeQueue; // when we need to access by priority | |
protected HashMap<String, MotherToBe> mothersToBe; // when we need to access by mother's name |
This file contains 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 [ | |
"marked", | |
"jquery", | |
"mathjax" | |
], (marked, $, MathJax) -> | |
# see: http://cdn.mathjax.org/mathjax/latest/test/sample-dynamic-2.html | |
class MathJaxMarkdownEditor | |
inputName: "#editor" |
NewerOlder