MESSAGE
DATE | 2005-02-12 |
FROM | From: "Martin, Jared"
|
SUBJECT | Re: [hangout] Monitoring input in simple chat exercise.
|
The proprietary programming environment (libraries, IDE's) I'm using is a very high- level program called kwrite and gcc. :-) The rest of what you've said is very true, however. I feel I I've a good grasp of the fundamentals. I started studing on a version of pascal that ran in dos (can't remember the version) I realize that's nothing for lots of you guys, and c is definitly a more mature lang. But there were none of these programming environs when I started. What is more, although I could be studing how to do 3d graphics with libs I don't begin to understand, you'll notice I'm instead studing the ins and out of working with sockets and streams using nothing more than the standard lib.
I do have a LOT to learn though, but as I whined many times already, nobody will provide me with info about the pricing of the classes! PLEASE ANYONE! Excuse my outburst. Thanks.
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: Steve Milo To: Martin, Jared ; ruben-at-mrbrklyn.com ; billy-at-dadadada.net CC: hangout-at-nylxs.com Sent: Sat Feb 12 11:25:03 2005 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
|
|