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 nix::unistd::sleep; | |
use std::process; | |
use std::thread; | |
fn main() { | |
println!( | |
"From PID {} thread id {:?}", | |
process::id(), | |
thread::current().id() | |
); |
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
extern crate signal_hook; | |
use std::error::Error; | |
use std::time::Duration; | |
use nix::unistd::{pause, sleep}; | |
use signal_hook::{register, SIGINT}; | |
static mut I_CAN_RUN: bool = true; | |
fn main() -> Result<(), Box<dyn Error>> { |
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 nix::unistd::{close, dup2, fork, pipe, ForkResult}; | |
use std::io::{self, Read, Write}; | |
use std::process::{exit, id}; | |
use std::str; | |
use std::error::Error; | |
const MAX: usize = 1024; | |
fn main() -> Result<(),Box<dyn Error>> { |
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
// Be sure to link this program with the math library (-lm) | |
#include <stdio.h> | |
#include <math.h> | |
#include <errno.h> | |
int main() { | |
double x, z; | |
printf ("Enter a number: "); | |
scanf ("%lf", &x); |
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 nix::unistd::fork; | |
fn main() { | |
println!("Before fork()"); | |
fork(); | |
println!("After fork()"); | |
} |
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::env; | |
use nix::unistd::fork; | |
use std::process; | |
fn main() { | |
let args: Vec<String> = env::args().collect(); | |
if args.len() < 2 { | |
eprintln!("Not enough argument"); | |
return; | |
} |
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 gvfraction | |
import java.lang.IllegalStateException | |
import java.lang.reflect.InvocationTargetException | |
import kotlin.reflect.KClass | |
object FractionFactory { | |
var creator: KClass<FractionOperator>? | |
// var instance: FractionFactory |
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
cmake_minimum_required(VERSION 3.14) | |
project(Fraction) | |
set(CMAKE_CXX_COMPILER clang++) | |
set(CMAKE_CXX_STANDARD 17) | |
set(CMAKE_CXX_FLAGS "-g -Wall") | |
include_directories(.) |
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/python3 | |
""" | |
This program parses a zipped assignment downloaded from Bb, | |
creates a new subdirectory for the assignment, and unzip | |
all the files into subdirectories named after the student userids | |
""" | |
import zipfile | |
import sys |
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
#container { | |
background: lightblue; | |
} | |
section { | |
border: solid 2px black; | |
border-radius: 8px; | |
margin: 4px; | |
padding: 8px; | |
} |