Giter VIP home page Giter VIP logo

bgnet's Introduction

Beej's Guide to Network Programming

This is the source for Beej's Guide to Network Programming.

If you merely wish to read the guide, please visit the Beej's Guide to Network Programming website.

This is here so that Beej has everything in a repo and so translators can easily clone it.

Build Instructions

Dependencies

Mac dependencies install (reopen terminal after doing this):

xcode-select --install                  # installs make
brew install python                     # installs Python3
brew install pandoc
brew install mactex --cask              # installs XeLaTeX
brew tap homebrew/cask-fonts
brew install font-liberation            # installs sans, serif, and mono

Build

  1. Type make from the top-level directory.

    If you have Gnu Make, it should work fine. Other makes might work as well. Windows users might want to check out Cygwin.

  2. Type make stage to copy all the build products and website to the stage directory.

  3. There is no step three.

You can also cd to the src directory and make.

make clean cleans, and make pristine cleans to "original" state.

To embed your own fonts in the PDFs, see the src/Makefile for examples.

The upload target in the root Makefile demonstrates the build steps for a complete release. You'll need to change the UPLOADDIR macro in the top-level Makefile to point to your host if you want to use that. You're free to upload whatever versions you desire individually, as well.

Build via Docker

If you don't want to mess with a local setup, you can build via Docker.

  1. Run docker build -t beej-bgnet-builder . from the top-level directory.

  2. Run docker run --rm -v "$PWD":/guide -ti beej-bgnet-builder.

    This will mount the project where the image expects it, and run make pristine all stage, leaving your ./stage directory ready to be published.

Pull Requests

Please keep these on the scale of typo and bug fixes. That way I don't have to consider any copyright issues when merging changes.

TODO

Content

  • File transfer example maybe in son of data encapsulation
  • Multicast?
  • Event IO?

Bug fixes

  • When pandoc 2.8 comes up, switch all man page subheaders to h3 and supress them from the table of contents.

bgnet's People

Contributors

beejjorgensen avatar corollari avatar ehershey avatar gonzula avatar illyric avatar mgarciaisaia avatar pberry avatar rubo3 avatar tfidfwastaken avatar urbanogilson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bgnet's Issues

how to see input size

how can I set the input size,when the new image size is not euqal with training data size, using padding or crop ? it seems that crop or padding will influence the stereo matching result,is there any general ways ?

Dark Mode

Thank you for a fantastic resource. I wanted to add a pull request with <style> for a dark theme to activate if the user's platform requests one @media (prefers-color-scheme: dark), but I couldn't find the stylesheet used. Here it is in case you want to add it:

  <!-- Dark mode -->
  <style>
    @media (prefers-color-scheme: dark) {
    html {
      color: #abb2bf;
      background-color: #282c34;
    }
    a {
      color: #abb2bf;
    }
    a:visited {
      color: #abb2bf;
    }
    hr {
      background-color: #abb2bf;
    }
    table {
      border-top: 1px solid #abb2bf;
      border-bottom: 1px solid #abb2bf;
    }
    th {
      border-top: 1px solid #abb2bf;
    }
    tbody {
      border-top: 1px solid #abb2bf;
      border-bottom: 1px solid #abb2bf;
    }
    blockquote {
      border-left: 2px solid #282c34;
      color: #5c6370;
    }
    div.sourceCode {
      border: 1px solid #abb2bf;
      background-color: #282c34;
    }
    code:not(.sourceCode) {
      background: #4b5263;
    }
    pre.numberSource { border-left: 1px solid #282c34; }
    pre > code.sourceCode > span > a:first-child::before { color: #5c6370; }
    code span.al { color: #e06c75; font-weight: bold; } /* Alert */
    code span.an { color: #56b6c2; font-weight: bold; font-style: italic; } /* Annotation */
    code span.at { color: #d19a66; } /* Attribute */
    code span.bn { color: #98c379; } /* BaseN */
    code span.bu { color: #98c379; } /* BuiltIn */
    code span.cf { color: #98c379; font-weight: bold; } /* ControlFlow */
    code span.ch { color: #61afef; } /* Char */
    code span.cn { color: #be5046; } /* Constant */
    code span.co { color: #5c6370; font-style: italic; } /* Comment */
    code span.cv { color: #56b6c2; font-weight: bold; font-style: italic; } /* CommentVar */
    code span.do { color: #e5c07b; font-style: italic; } /* Documentation */
    code span.dt { color: #be5046; } /* DataType */
    code span.dv { color: #98c379; } /* DecVal */
    code span.er { color: #e06c75; font-weight: bold; } /* Error */
    code span.fl { color: #98c379; } /* Float */
    code span.fu { color: #61afef; } /* Function */
    code span.im { color: #98c379; font-weight: bold; } /* Import */
    code span.in { color: #56b6c2; font-weight: bold; font-style: italic; } /* Information */
    code span.kw { color: #98c379; font-weight: bold; } /* Keyword */
    code span.op { color: #abb2bf; } /* Operator */
    code span.ot { color: #98c379; } /* Other */
    code span.pp { color: #d19a66; } /* Preprocessor */
    code span.sc { color: #61afef; } /* SpecialChar */
    code span.ss { color: #c678dd; } /* SpecialString */
    code span.st { color: #61afef; } /* String */
    code span.va { color: #61afef; } /* Variable */
    code span.vs { color: #61afef; } /* VerbatimString */
    code span.wa { color: #56b6c2; font-weight: bold; font-style: italic; } /* Warning */
  }
  </style>

header mismatches

I noticed a couple items on the accept()—“Thank you for calling port 3490” example:

  • the netinet/in.h header is included but never used.

  • the netdb.h header needed for the AI_PASSIVE reference, the addrinfo declarations, and the getaddrinfo call is missing.

(From Kevin S)

fcntl-fcntlman rendering issue

Dear Beej

First of all, thank you for an excellent networking resource. I turn to my physical copy of the book whenever I turn my hand to networking and have done for many years.

An entry in the first column of the table in fcntl manpage section is not rendering correctly on the online copy I'm currently viewing.

I gather that:

i[O_ASYNC macro]i]O_ASYNC

should be

[i[O_ASYNC macro]i]O_ASYNC

Best regards

Daniel

License of the guide?

What is the license of the guide? We want to make it available as documentation package via the nixpkgs package repository, but since there is no explicit license, so far we had to mark it as unfree.

May have forgotten to freeaddrinfo in 6.1 A Simple Stream Server

I'm reading the example program of the section 6.1 of your very instructive guide. I'm not sure but I think that the *servinfo data may be leaked.

It's allocated here:

if ((rv = getaddrinfo(NULL, PORT, &hints, &servinfo)) != 0) {

And freed here:
freeaddrinfo(servinfo); // all done with this structure

But there is a possibility the program exits before the call to freeaddrinfo():

bgnet/examples/server.c

Lines 74 to 78 in cce225a

if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &yes,
sizeof(int)) == -1) {
perror("setsockopt");
exit(1);
}

Shouldn't the linked list be freed in that case too ? Or there is some magic happening that I don't understand/know ?
Another solution might be to continue instead of exit()ing. I don't understand why there is a need to exit().

Update brazilian translate

A few months ago the user cv8minix3 was updating this translation to the most recent version. However, later his github account is no longer available along with the repositories (one of them was the translation).

Before this happened (luckily) I ended up saving and converting to pdf and deleting the original content, because he was translating the html file.

Note: I tried to convert it to html but I don't know if it would help.

Files:
Beej Networking - cv8minix3[converted].tar.gz

Version: 3.1.2

EPUB support

My personal biggest use case for this would be reducing eye strain, since the format allows custom font families and weights, plus changing colors. I'd love it if we can get .epub files :)

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.