Giter VIP home page Giter VIP logo

coding-homework's Introduction

HOMEWORK

Reimplement the following programs:

  • cat
  • grep
  • cut
  • ls
  • head
  • tail

in the following languages:

  • Python
  • C
  • C++
  • Go
  • OCaml
  • Haskell
  • Rust
  • Elixer
  • Ruby
  • Node.js
  • Erlang
  • Swift
  • Lisp

and solve the following challenges:

  • How many files are on my computer?
  • What are the top 10 posts on reddit?

General Requirements

  • Do not use any third party libraries
  • Package an installer for each program in the language's native package manager (e.g. npm, pypi, etc) // SHOUT OUT @schep_

Language Requirements

Python

  • Must support python2 and python3

Program Requirements

cat

  • At minimum: Read a file to stdout
  • At minimum: Read multiple files to stdout
  • At minimum: Output errors to stderr

head

  • At minimum: Read the first 10 lines of a file
  • Extra credit: Read the first 10 lines of stdin
  • Extra credit: Implement an option to define how many lines to read
  • Extra credit: Implement an option to read bytes instead of lines
  • Extra credit: Don't read the entire file

tail

  • At minimum: Read the last 10 lines of a file
  • Extra credit: Read the last 10 lines of stdin
  • Extra credit: Implement an option to define how many lines to read
  • Extra credit: Implement an option to read bytes instead of lines
  • Extra credit: Don't read the entire file

ls

  • At minimum: Handle multiple paths or files
  • Extra credit: Include an option to show hidden files
  • Extra credit: Include an option to show exact file size
  • Extra credit: Include an option to show file size in human
  • Extra credit: Implement separate terminal colors for files and directories

grep

  • At minimum: Read lines from a file and return lines that include a keyword
  • Extra credit: Implement case-insensitivity flag
  • Extra credit: Implement -v (ignore) flag
  • Extra credit: Optionally apply keyword to stdin as well as a file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.