RPUSH
,SADD
needs to support multiple values- Command names are case-insensitive, parameter and values are case-sensitive and must be all lowercase.
- If a command doesn't specify return value, please return
OK
if successful, or follow the error code. - Updated sample tests (see link in the sample tests section)
SET
will always overwrite the value for that key
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
function makeConstraint(code, characters) { | |
var ret = {}; | |
for (var i = 0; i < characters.length; i++) { | |
ret[characters[i]] = true; | |
} | |
for (var i = 0; i < code.length; i++) { | |
ret[code[i]] = false; | |
} | |
return ret; | |
} |
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 <pthread.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#define TOTAL_THREADS 2 | |
#define MAX 10 | |
int shared = 0; | |
int turn = 0; | |
int started = 0; |
I hereby claim:
- I am minhnhdo on github.
- I am minh (https://keybase.io/minh) on keybase.
- I have a public key whose fingerprint is 4515 ADD7 F018 6E3B D304 F3FD 7FC7 BA38 FDA7 1950
To claim this, I am signing this object:
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
\begin{titlepage} | |
\centering | |
\includegraphics[width=\linewidth]{Downloads/NTU-Logo.PNG}\\[5cm] | |
\textbf{\LARGE CSC401\\Advanced Topics in Algorithms\\} | |
{\LARGE Report for Assignment 1\\[3cm]} | |
{\large \textsl{Name:} Do Nhat Minh\\} | |
{\large \textsl{Matric No.:} U1020131A\\[2cm]} | |
{\large School of Computer Engineering\\} | |
{\large Nanyang Technological University\\} | |
\vfill |
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 std::{io, libc, os, rt, str}; | |
#[fixed_stack_segment] | |
pub fn waitpid(pid: libc::pid_t, status: &mut libc::c_int) -> libc::pid_t { | |
unsafe { libc::funcs::posix01::wait::waitpid(pid, status, 0) } | |
} | |
#[fixed_stack_segment] | |
fn single_threaded_main() { |
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 comm; | |
use hashmap; | |
use option::{Some, None}; | |
use ops::Drop; | |
use rt::rtio::IoFactoryObject; | |
use rt::uv; | |
use rt::uv::signal; | |
use rt::local::Local; | |
use task; | |
pub use rt::uv::{Signum, Break, HangUp, Interrupt, WindowSizeChange}; |
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
fn rand7() -> uint { | |
let r = 5 * (rand5() - 1) + rand5(); // r is uniformly distributed between 1 and 25 | |
if r > 21 { | |
return rand7(); // discard 22, 23, 24, 25 | |
} else { | |
return r % 7 + 1; | |
} | |
} |
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
#[link_name = "curl"] | |
mod ll { | |
use std::libc::{c_char}; | |
extern { | |
pub fn curl_version() -> *c_char; | |
} | |
} | |
fn main() { | |
let s = unsafe { ::std::str::raw::from_c_str(ll::curl_version()) }; |
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
#! /usr/local/bin/guile \ | |
-e main -s | |
!# | |
(use-modules (mro io) | |
(mro web client) | |
(mro lists) | |
(sxml simple) | |
(sxml xpath) | |
(web uri) |