Recommended books for building a shell/BBS Server [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am working on a independent project for school, and I need a bit of guidance on possible resources. Basically, I am trying to build a Unix-style shell (possibly porting later to Windows) in C or C++. I will add shell commands in a modular fashion, adding functionality as I go. The final step will be to ad a "connect" command which will allow a user to connect to a telnet BBS that I have designed. The BBS will also only have basic, skeletal functionality. E.G., I am probably going to have news blurbs, maybe a basic application and a basic door game.
I don't really need help with the programming (at least, not yet), but I have been having trouble finding good resources to help me out. What I am looking for is a good book on shell programming (not writing scripts, but actually programming a shell from scratch, and its various interactions with the underlying system), and a good book on adding telnet functionality- what I mean by this is that I want to use my computer as a server, and allow a few other users to connect in order to test that my system works. I am currently reading the Sans "Teach Yourself TCP/IP in 24 hours" which has proved reasonably useful for someone with a good understanding of CS, algorithms, data structures, etc. I just need something a little more specific.
Just a little background- I am a second year Computer Science student at Purdue, and I am doing this independent study in order to tie together many of the concepts I have learned thus far. If anyone could point me toward some truly excellent resources, it would be very much appreciated.
Please let me know if you need more detail or clarification in order to point me toward the appropriate resource. Note that I am willing to buy any book available if it proves to be a valuable resource. Also, I did try a search for these resources on SO, but most questions seemed to be too specific (generally about issues that someone is having with their implementation of a shell, etc.); I would also prefer personal recommendations from experienced programmers in the field.
Thanks in advance.
-S
PS- To clarify "BBS" for younger programmers- this is what existed before the Internet. Old school, dial-up, text based bulletin board systems on a 2400 baud modem. I obviously can't recreate that exactly, but my hope was to synthesize the experience using telnet or SSH. See http://www.telnetbbsguide.com/ for more information on a telnet BBS. I need to be able to write my own software, though, that merely has a fraction of the functionality of a real BBS. But, I am not sure what I need to be searching for to learn more about this- should I be looking at server books, networking books, or something else entirely?
PPS- More clarification. Most of the books I have been seeing on BBS's are books about how to setup, run, and maintain a BBS as a sysop, using pre-existing software. What I need to do is write the software myself. I will likely use telnet, as it appears to be easier to use that SSH (at least, to program- please correct me if I am wrong about this). I friend of mine recommended that I get a book on patterns, and also a copy of "The Pragmatic Programmer". Please let me know if he is pointing me in the right direction for what I want to build. Also, just as a side note, I do have a pretty decent (if basic) knowledge of programming, algorithms, and data structures- but absolutely no knowledge of networking or servers and I am not really sure how much I actually need to know in order to start development on this project. Well, I know a little bit about networking, just not from a programmer's perspective. Thank you all again.

There is a book about programming unix shells! written by none other than Axel Tobias-Schreiner, illustrious author of ooc.pdf, The "Object-Oriented C" PDF (Google it, but don't forget his name!).
It's called "Using C with Curses, Lex and Yacc: Building a Window Shell for Unix System V", Prentice Hall, 1990; and it really should be considered Part 3 of the saga begun in K&R "The C Programming Language", and continued in the second half of K&P "The UNIX Programming Environment".
The shell the book describes is a rogue-style "window system" that works inside the terminal (using curses), it includes a text-file viewer, and a command-language interpreter that runs commands inside of these "windows". The command language uses lex and yacc to implement the lexer/parser. So the book serves as an introduction to doing such things, a large literate program in C, and goldmine of snippets for using curses, complicated options processing, and implementing a programming language using the much-touted standard unix tools.

I've never seen a book about programming of shells, although I'd be happy to find out that such a thing exists.
But really, isn't programming a shell basically a list of features that you'll implement AND the order of evaluation of how interpret the users input? You can see a good write-up on order of evaluation in 'Classic Shell Programming', Robbins and Beebe AND in 'C Shell Field Guide' (the Andersons) and possibly others.
Of course, you would learn a lot by digging in on the available source codes for shells, bash, z shell, ksh.
Sorry, I don't have any ideas about the BBS server part of your question. As you found the SAMS book helpful, I'd recommend looking at the W. Richard Stevens' Network Programming Series of books, which is 99% Unix network programming and maybe not what you want.
(Finally, consider changing out your recommendation tag for bash or zsh, as many regular contributors at S.O. check for new questions by searching on 'their' tags. The people that can answer your question better may not be reading it)
I hope this helps.

Related

Can I rely to ISE Eiffel as a programming language to offer web services through a DB connection [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I'm actually working for a little company of 10 people on the area of solar panels solutions in Chile. Am working on linux since 20 years now. When I studied programing I studied a lot with Eiffel which I found really a great language. Since, I'm frustrated from a language to another missing a lot of great concepts it offers like
real object (no string != String; ...)
multi-inheritance
polymorphism
genericity
contract.
Working now with Java because
its mostly free
the community for tutorials and helps is huge
its multi-platform
I'm looking for the pros & cons to convince the instances of my hierarchy (basically talking about justifying the price of the licences which are 1500$=>1y and 2000$=>2y) and to be a bit secured that I don't pretend I'll go with a solution I'll regret at term because it will be hard to get the support I need to get my solutions working. Is ISE Eiffel reliable for production use? Will I have to get hours of pain making work a solution?
What are the pros & cons?
Pros
Concepts helping me to write real good quality code (multi-inheritance, polymorphism, genericity, contract)
Pleasure to develop with such good tools
Quality and reliability of produced code
...
Cons
Poor community, meaning few tutorials
I'm not good in C so digging into the implementation of C libraries is something which will cost me (and to the company)
Price is high and has to be justified
My Curriculum will not be as well as if I have years of experience in Java
Formation of other programmers won't be easy if as most of them dont know these concepts
...
I also work in a small company and we have decided 2 years ago to make the move to Eiffel. We had the exact same questions as you are stating. We now have official licenses and support. I studied the Eiffel Web Framework a long time (from 2014) and knew that the only good way to be able to state that it can be used in production is to just do it.
So that is what we did and now the software is in production and working robust, safe and performs well. In production are web API's based on HAL+JSON and created with the EiffelWeb Framework and a self written framework extended with reusable domain components created for the companies goals.
So ISE Eiffel is certainly reliable for production use and the support is outstanding.
You won't have any hours of pain as you call it, but when you write software with EiffelStudio you get many hours of joy, but all the other aspects of software engineering will be as hard as ever ;-).
About your other cons, my two cents are:
For a curriculum, more important is who you are as a person and if you fit in the current team. In my opinion when someone is educated in a model driven approach and acts and thinks like that, can use that knowledge quickly on any environment. That for me personally is more important then being good at one specific programming language. Although I understand that in some cases we also need specialists to get a job done quickly. It all is a matter of personal choice, both are needed in the industry.
If you need other programmers that get in the team doing this, you can only work with people that want that. I know from experience, that some people want it and other people just won't. My advice is not to put energy into the people that do not want it. Work with the technology, show that it works and maybe they get convinced, else seek for others that do see this.
If the management is not behind the decision to work not only with Eiffel, but also with the ideas of Bertrand Meyer, then don't do it. You will find yourself always fighting against it, while it is very hard for others (not software related) to understand. It is a matter of trust, when there is no trust (at both sides) -> don't do it.
We now also get questions about how the Eiffel environment is handling vulnerabilities, which are compared to the way e.g. Linux and Java communities are handling that. Eiffel is not used as much as those technologies, but the Eiffel software itself is build on the strong quality core of the Eiffel method and language. This can simply not be compared with other environments. But again others do not understand this, so how is this going to be addressed? This is an example where you run into when you will be using the Eiffel technology.
A lot of words, but the plain answer to your question is just : YES it can!
It's certainly reliable enough for production use.
You may well have to write wrappers for C-libraries, depending upon exacly what you want to do.
You mention web services. There is a good web framework. But there is no support (that I know of) for W3C XML schemas, for instance.
I would suggest you try writing a small prototype using the GPL edition (you won't be distributing the prototype, so you will not be restricted by the GPL). Then you should be able to assess for yourself the suitability for your usage.

Introduction to driver programming [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Driver programming is one of those things that I wanted to at least have an idea about for quite some time, but whenever I had some time to spare at my hands and sat down for research, I almost exclusively found very special questions about the matter or very broad introductions.
Now I do understand that it is not a trivial topic, but I personally learn best from sitting down and doing stuff. Therefore, I hope that you can give me a few pointers where to start. So, for the sake of a hands-on approach, consider the following scenario: I have a Raspberry Pi at my hands and want to utilize the GPIO pins as a serial port. (I'd love to hear other suggestions if you believe this is to complex for a starter's project. It's really more for the sake of doing it, the result is secondary). So the Pi runs Debian wheezy, and that's where I start from.
Given this, what do I need (software-wise) to get started? Specifically I am asking for the following:
Which compiler do I use?
Apart from the compiler and a text editor, do I need more tools?
Is there a some kind of scheme that I could copy to get started?
Do you maybe know of a great introduction that I just haven't had the luck to come across? I found that recorded lectures can be extremely helpful, and I would absolutely be willing to sit through a full course if that gets me started.
Do you know of a project simple enough for a beginner to learn from it by reading the sources on e.g. github?
And finally, am I totally on the wrong track? I might well be; I have been programming for quite some time, but usually in the high abstraction levels that languages with runtimes provide. I do have some experience regarding C++ programming and pointers aren't black magic to me, but I am not on very familiar ground here.
Also, if a blatant lack of understanding of drivers speaks out of this post, please point it out to me.
I never wrote a full fledged driver for a specific hardware, but I've gone through some basics in driver programming.
If you're into linux, before getting into driver programming you need to know what are drivers..? types of drivers..? how are drivers inserted as modules in kernel..? Here is the link. There is a basic abstract how to insert a driver or how to remove a driver from kernel and lot more.
There are video tutorials in youtube.
After you get enough stuff here, go through the LDD Book(Very nice book for beginners) as suggested by Joe.
Here's some more..
character driver example.
you may also wanted to know about kernel compilation, which is an intresting and important topic before starting driver programming, understand static and dyanamic(loadable) drivers.
You're in Linux, so what you have already installed (or available to install) should be enough to build with - a modern C compiler and make system, along with a decent editor. You even get a debugger capable of debugging both user and kernel space code - gdb & kgdb. Depending on what hardware you're tinkering with you may need something to look at what it's doing.
As for an introduction to drivers, there's two aspects you're asking about here. 1) O/S specific driver models, for Linux - start here: Linux Device Drivers and if that makes no sense to you, you know you need to go back a step and get some more basics down! 2) General aspects of h/w and terminology. I'm not sure of a good general resource here.
One final thing, C++ is not C, which is also not assembler which is also not machine code. At the level of battling hardware into life, you start having to know about the dirty secrets below the abstractions you normally use. There's plenty of information around about this sort of stuff but that's sort of the problem, there is a LOT to know. You could try Ulrich Dreppers article about memory, What Every Programmer Should Know About Memory, or you could look into what goes on with pre-emption and multi-tasking. Or you could look at datasheets for the hardware you're looking to control. There's plenty out there.
You've asked an incredibly general question, I'm surprised it's not been closed, however come back here when you've got stuff going and you have some specific questions to ask!

MUD Programming language

I have been playing a MUD game now off and on for over a year. I have scoured the internet looking for the best computer language to learn to develop my own. So far, I have come up with nothing but C. Is C the best language to learn for this application, or is there something better?
I know SMAUG was written in C, but that was years ago. I am new to programming in general and have some experience with Python. I have been playing Aardwolf, which allows it users (after a certain level) to create their own area's. The user does this using Lua. This was interesting to me, because Lua is a "scripting" language. So this begs another question - Do you build the game's format in C (or something else) but create the world with a script?
Also, this would be a game with only my friends, so a direct connection would be required since I would not be hosting it online. So, once again, I would like to dive into this world and use this as a pet project to also help me learn a programming language... but which one would be the best that would also allow me to scale it uo in the funture
P.S. - Any open source code out there that I can look at and study?
So, once again, I would like to dive into this world and use this as a pet project to also help me learn a programming language... but which one would be the best that would also allow me to scale it uo in the future
Most MUD codebases tend to be in C, but this is mainly for historical reasons. MUDs were fairly popular a while back, and at the time, C was by far the best language for portability which was supported by most hosting options out there.
That being said, a MUD is really fairly simple, in many ways. You could easily write a MUD in any language, provided it supports sockets and text parsing. Using a language with a good string parsing and high level socket support would actually be far simpler than some of the classic MUD code bases.
There are a ton of available MUD engines available online : a quick look at MudConnector will give you a ton info of available servers, software and code bases.
As for your programming language of choice, if you intend on only making it available to you and your friends, Python would be fine - I made one entirely in Lua a few years ago and it was a breeze. It's a great learning experience !
perhaps you should look for a MUDOS
http://www.mudos.org/

Why there is not a comprehensive c archive network? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
There are websites as collections of python/perl/R libraries. Why there is not an equivalent one for c?
I searched the internet and only found a small website calling itself CCAN. There are only a few libraries in that website.
If I need extra libraries for c programming, where can I find them? Is there an well organized website of the c libraries?
Thanks.
If I need extra libraries for c programming, where can I find them? Is there an well organized website of the c libraries?
No known to me outside of CCAN.
The problem here is that C doesn't have any even loose specification for libraries. Compare that to e.g. packages in Java or Python or Perl.
And even then, C is quite bare bone itself leaving many things for libraries to implement themselves. I/O abstraction, memory management, multi-threading, OS integration - minor differences in how libraries work with any of the resources might make them incompatible, preventing them being used in the same project.
I have seen in past some 3rd party commercial libraries for C, covering quite a lot of functionality, but frankly I can't recommend them and honestly do not even remember their names - for they often were causing more problems than really helping. (OK, I'm lying: they were rarely causing unsolvable problems: it's the numerous workarounds which were causing often the problems later.)
Otherwise, for C you might want to check the Glib and (do not get me wrong) to also check the C standard as in my experience few actually know many of the utilities already in the standard library itself. And well, Google is your friend: lots of public domain code is there for you to simply throw as-is into your project.
I don't know of anybody who's studied this in detail, though I would be curious to see the studies. I'm sure it has to do with the nature of the C programming community itself.
I think a large (maybe the primary?) part of the answer is: before the WWW, there was no such thing as a single resource for obtaining libraries for a particular language. People obtained their libraries, and knowledge of libraries, via many different means: through BBSes, mailing lists, newsgroups, and periodicals. The C community dates from this time, of course, and I've noticed a similar difference in culture regarding other languages from this period and before.
I think another part of the answer has to do with the general decentralization of C culture itself. There's no one C compiler, no one C development community, that serves as a hub and a potential point for projects to attach themselves to. And the C development community is huge, which further drives this decentralization and splintering.
In the case of C libraries, OS distributions actually do a pretty good job of collecting useful C/C++ libraries out there. (With the unfortunate exception of Windows, I believe.) They do a better job in these languages than most others, probably since C and C++ are such important systems languages on these platforms.
As far as CCAN goes, I think what would make a more worthwhile project, given the number of different distributors of C code out there, is to have a single site that links to the various libraries on their own native sites, rather than trying to get them to upload straight to CCAN. I think there's a use for this in and apart from Google, which will give you a lot of noise if you try just browsing for libraries. The question is, would you and the bulk of the C communities out there embrace such a site if it existed?
You might be amused to see how CPAN got its start: http://www.brainbell.com/tutors/Perl/CPAN_History.htm
CPAN evolved just as its community did. So the same thing could happen in the C/C++ world if the leadership and interest is there. But it hasn't happened yet.
use http://www.google.com/codesearch?q=lang:%22C%22 variant of http://www.google.com/codesearch
=> i.e. add lang:"C" in the search query
Use these web-sites:
Debian "Testing": Subsection libs
The Free Country: Free C/C++ Libraries
Free Software Directory: Category/Library
SourceForge Software Map: Software Development/Libraries/C
Upstream Tracker: List of C/C++ Shared Libraries
There is a Maven-like repository and dependency management system called Biicode.
There isn't a huge collection of libraries on there yet, but you can add forks of open source projects yourself or inform original authors about it.
EDIT: the company behind biicode is dead
EDIT2: the spiritual successor seems to be conan.io
There is a C package manager which looks promising called CLib:
github:
https://github.com/clibs/clib
tutorial:
https://dev.to/noah11012/clibs-a-package-manager-for-c-4jmi
Why do you need a website for a collection of C libraries? Just use Google.

Useful Developer Resources in Second Life [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Second Life is fun to play with, and some developers are creating content there, but I was wondering what useful resources (if any) are available in Second Life for professional software developers.
Discussion groups
Education/training
Vendor support
Development-related presentations or demos
Professional contacts
To clarify: I'm not really looking for information on developing stuff for use in Second Life (although those answers are welcome). I am looking for pointers to stuff in SL that programmers would find useful for their real-life work.
They have a site about some of these uses: http://secondlifegrid.net/programs/api/
and some pages on the language they kind of grew: http://wiki.secondlife.com/wiki/LSL_Portal
Like you I find playing around with SL pretty interesting for recreational coding. One of the experiences that made me think there was something to it was trying to code a working clock in a sandbox (a general building area in SL). Other avatars would walk past and make suggestions and as there's a fair few coders around it soon turned into an interesting collaborative effort. If only it was that simple in RL. Some things just work really neatly in SL - I once implemented a swarming algorithm using a flock of 'birds' as the objects (which gives a whole new take on oops).
As to resources - assuming you're beyond basic coding level then you should be able to figure most things out from the LSL Wiki - http://wiki.secondlife.com/wiki/LSL_Portal.
There's an ebook - "Scripting Recipes for Second Life" by Jeff Heaton which covers the basics in a reasonably well laid out way. It's only a few dollars but probably only worth it if you've not done a great deal of coding elsewhere. There's also regular classes held in-world, but I believe most of these are at a pretty basic level.
For groups I've always found the Scripters of Second Life group very helpful with a lot of people generally on it. There's one called simply Scripts which is quite active too.
A couple of words of warning, LSL, whilst Turing-complete is pretty broken in several areas, lacks modern program constructs (and some older ones - like arrays!) and much of the 'black-art' of LSL is knowing how to work around the limitations, With the advent of Mono though this is likely to be a decreasing issue.
Also there does seem to be an assumption by the Lindens that if you want to do any 'heavy-lifting' code you'll do it on a server off-world and call and return results to/from SL. This isn't helped by the XMP-RPC implementation being very broken, although HTTP works fine (and generally better than might be expected).
I vaguely remember Dr Dobbs running some sort of ongoing "Programmer's Island" thingy in SL, but I can't find the reference right now.
Apparently some sort of "virtual conference" for software developers.
As far I'm concerned, I'm trying to contribute to the OpenSim project which is a OpenSource clone of the SecondLife server infrastructure, written in C# and Mono.
OpenSim is SL like, enhanced with many additional script commands, open grid protocols, with customized modules and plugins. It definitely worth a look if you dont already heard about it.
ControlBreak suggested this in a comment (I'm promoting it to an answer):
You can visit Microsoft Island. Presentations of new products are done regularly - http://www.kzero.co.uk/blog/?p=663#more-663
IBM, Microsoft and Sun are pretty active in Second Life and sometimes there are interesting presentations/demos to see. Some of those are great for networking and meeting people from those companies which work on products you're interested in.
There are several groups for Java, PHP and several other programming languages apart from LSL, however IMO they're not as good resource as other non-SL resources. You can get your questions answered more quickly on StackOverflow or IRC.
IBM held several interesting programming competitions - there was something with robots finding a way out of the maze by IBM, there are also robot wars and some other programming competitions in SL, however they are all LSL-oriented.
I think I saw a beginner PHP class once, so if you're interested in learning programming language from start, try searching events and you might find something; however those are pretty rare in my experience.
Look & Feel team Scripting, it's mine. Common 3D trouble is confusing camera center between camera or actor. A designer may think camera center is world when it should be actor.

Resources