MESSAGE
DATE | 2005-02-12 |
FROM | From: "Steve Milo"
|
SUBJECT | Re: [hangout] Monitoring input in simple chat exercise.
|
A better anology would be that lawyers, doctors, CPA's, engineers, (and by some accounts mechanics) do not just jump in to get their feet wet. You are probably using a proprietary programming environment (libraries, IDE's) to write your 'simple' chat program. You have been probably using the 'help' or 'more info' menu's that pop up to help you with your learning curve. But you do not have the fundamentals of CompSci down, the fact that you know other languages and not C proves that. C is the standard by which other languages are judged against.
I see this all the time at school, kids are taking advanced C programming and do not know the math or the fundamentals behind it. Discussing just syntax is the norm and leaves students shaky on being able to wrap their minds around what is going on in the background. In that advanced C programming class the professor was explaining some of the math theory behind basic computer science. I was taking copious notes during this lecutre, during the break a student laughingly asked me 'did you take notes?'. I simply replied with a yes. In the second part of the session the professor went on to a more advanced topic and I was able to frame what he was saying against the theory he explained previously. The student who asked me about the notes was forced to ask questions which by that time seemed basic to me. The professor replied in the way I would have expected him to, so I knew I was on the right track and had the advantage the other student did not.
Billy has the benefit of being an engineer and is able to grasp programming because he has the insight that comes with that kind of education.
There is a difference between computer programmers and software engineers. That fact you will not hear very often because for some strange reason people who have no direct benefit are trying to sell you on some proprietary solution. Sadly this contributes to the fracturing of the computer industry which results in poor products which is masked by the illusion of sound marketing.
Steve M
On Sat, 12 Feb 2005 01:10:20 -0500, Martin, Jared wrote > Well perhaps getting my feet wet isn't the best way to word it, but > I'm already familiar with other programming languages and I'm well > beyond hello world and scanf. This is the first program I've done in > c (besides hello world). I've gotten warmed up to the use of > pointers and strings even passing functions as parameters (nice!) > I've actually figured out this very question, I can just use the > stdin fd 0 in my select and then read with read. This wouldn't work > for some reason the first time, but I've got it now. I actually find > that I learn better by jumping in and trying to do what I've already > done in other languages in this one. That's the way I learned > spanish too, total immersion. > > I'd really love to taker one of the classes, but no one is willing > to tell me how much it costs! Well, thanks for your help. > > Sincerely, > ***************************** > Jared Martin > IT Desktop Support > Davis & Gilbert LLP > 1740 Broadway > New York, NY 10019 > Help Desk: 212-237-1500 > Office: 212-237-1504 > Cell: 646-773-4138 > Fax: (212) 974-7023 > ************************************* > > -----Original Message----- > From: Ruben Safir > To: Billy > CC: Martin, Jared ; hangout-at-nylxs.com > Sent: Fri Feb 11 22:12:10 2005 > Subject: Re: [hangout] Monitoring input in simple chat exercise. > > This is an INSANE WAY to get your "feet" wet in C... > > Maybe Hello Word and learning the ins and outs of scanf is a good start. > > When you go to a movie, do you always come in during the final 20 > minutes? > > Ruben > > On Fri, 2005-02-11 at 19:32, Billy wrote: > > Martin, Jared wrote: > > > I'm working on creating a simple chat program to get my feet wet in c. > > > > > > I've been told its better to avoid threads, so I'm using select to monitor > > > multiple connections from clients. > > > > > > How do I get the client to check for new data on both the network conn as > > > well as input from the user without having one block the other? > > > Should I use select on the client too or is there a better way of doing it. > > > > > > Perhaps recv with peek would work to check the socket, but I've not yet > > > figured out how to receive input from the user without blocking and without > > > checking for individual keystrokes. > > > > > > Suggestions/Links/Code would be very greatly appreciated. > > > > select will do it, but you probably also need to configure the terminal. > > You will have to use tcsetattr to setup. > > > > You need to clear the ICANON and ECHO cflag, > > You can to set c_cc[VMIN]=1 and c_cc[VTIME]=0. > > > > It's all explained here: > > http://www.delorie.com/gnu/docs/glibc/libc_372.html > > > > Your client program will probably work best as a loop > > doing select() on both the input terminal and the > > server connection socket. > > ____________________________ > > NYLXS: New Yorker Free Software Users Scene > > Fair Use - > > because it's either fair use or useless.... > > NYLXS is a trademark of NYLXS, Inc > > > > ____________________________ > NYLXS: New Yorker Free Software Users Scene > Fair Use - > because it's either fair use or useless.... > NYLXS is a trademark of NYLXS, Inc
-- Open WebMail Project (http://openwebmail.org)
____________________________ NYLXS: New Yorker Free Software Users Scene Fair Use - because it's either fair use or useless.... NYLXS is a trademark of NYLXS, Inc
|
|