| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> have the select's pre-written <1> Ok. Lets look at the address pointer. <1> lets say you need to write a function that returns two ints. <1> I'm using return in a loose sense of the word. <1> How would you do it? <1> as in, what function prototype would you use? <0> ermm..., I think it'd be void myfunction(int &num1, int &num2); <1> Almost. <1> void myfunction(int *num1, int *num2); <0> ah crap, it's the calling that you p*** the address <1> then, when yo uwant to call myfunction, suppose you have two normal ints. <1> inta, and intb. <1> yeah. & as in a, as in address. ;) <1> so if you had int a, b; you'd call: <1> myfunction(&a, &b); <0> yea
<1> then, myfunction gets the address to the pointers, and can modify them. :) <0> been doing this web scripting too damn long :) <1> you probably wouldn't want to return void, btw. You'd likely use it for error handling. <2> bored: I just followed the instructions on that post, and then ran the xfree config and it still came up point to /dev/input/mice <2> which has no devices detected according to cat <1> can you show me a simple loop to iterate through a string? <1> say char * string; <0> lookingfordistro, sorry, but now I'm stuck. I don't have a linux box to refer to that has a mouse attached <2> shiite <0> jblack, I ***ume you mean with pointers <1> if you're not sure offhand, that's fine. <1> Yeah, with pointers. ;) <0> 2 secs, gotta think <1> No problem <0> ooh, C or C++? <1> Lets say C99 <2> isn't it something like, for (char; char < char_end; char ++) <2> <command> <1> that should make it easy for you. <2> next char; <0> jblack, easier <1> lookingfordistro: nope. :) <2> I tried. <1> Boredboy: Ok. I'm not teasing. <1> it should look something like: <0> for(i = 0; i < strlen(mystring); i++) { printf("char %d = %c", i, mystring+i); } <0> actually that might be &mystring+i <1> for (char * ptr = string; ptr =! NULL && * ptr != '\0'; ptr++) { something; } <2> heh, I'm not too sharp on C++ as I just started learning it. <2> I'm evolving from VB.**** <1> That's not an optimal expression mind you, but its bried enough for irc. <1> s/=!/!+ <0> jblack, heh, dunno if I've ever tried it like that before <1> lsd fl;kasd fjl; <1> != rather than =! <1> Ok. I understand where you're at. <1> You have a conceptual undersatnding of what pointers are, but you're lacking practice. <0> you're not kidding :) <1> Your C is also weak. <1> I suggest you not jump into threading in C. You've got to have a very comfortable understanding of working with memory before you start dealing with locking and contention. <1> bad things happen in a threaded program in which one thread reads and another thread writes the same variable on an smp system. <0> jblack, yea, need to get back into it properly before I start doing threading. Main reason for looking at threading is I'm working on a system at the moment that takes feeds from web. One thing is downloading of images. thought multiple threads might be useful so I could download multiple files at once instead of sequencial <1> Oh, for something like that, I'd use forking. <0> but then again, it's just a theory <1> Its a simpler model to deal with. <1> And you do have fork in languages such as python and perl. :) <1> hell, even bash <0> jblack, true. now that's definately something I'd have to read up on again. haven't done that in years <1> You won't have trouble with it. <1> fork(); <1> pardon. <1> child = fork(); <1> then, if the child is 0, then you're the child. if its not 0, you're the parent. <1> And they're two seperate processes. <1> the healing side to that is wait(child). <0> anyway, I don't think the project manager would go for it anyway, but we'll see <1> the parent's job will be to watch the children, keeping a certain number going at a time, and to reap them with wait when they're ready. <1> actually, its waitpid, not wait <0> heh, definitely need to re-read (learn) this stuff again <1> At least your honest that you need to learn it. <1> what chaffs my *** is when someone says "I knew it, but forgot".
<1> because they almost never have. They really need to go from the start, but won't admit it. So you have to pretend that you're teaching something advanced when its really a beginner thing. <1> Kind of like my ex-wife and algebra. She didn't know basic math very well. <1> so every time she hit a fraction, she fell apart. <0> unfortunately I haven't had a real requirement to do any decent sized C (or C++) apps in the past few years. In fact I think the last decent one was a backend email app that worked with oracle. that must have been 6-7 years ago <0> jblack, anyway, nice to know some of what I've forgotten. Better get back to work ... <1> yup. some other time. <1> i'll be happy to help you pick something back up once you can make the time investment and you promise to be serious about it <3> who wants some CADE ? <1> is it like lemonade? <3> apple juice actually <4> CADE -> Canadian ***ociation of Drilling Engineers <4> sounds relevant to linux! ey? <4> Al-Ashtar: what're you doing up late? <3> Cognition: I have to stay up so that I would go to work <0> jblack, thanks. Once I stop working 60+ hrs a week, I'll get back to you <1> What I'd raelly like is to find a mentee that would be interseted in working on bigsister. <3> Vista has been hacked by a girl <0> jblack, do I dare ask what bigsister is? <1> Is the gender germane? <4> mentee? usually people look for experts <1> Cognition: think intern. <3> alias update="sudo apt-get update;sudo apt-get dist-upgrade" <2> boredboy: I got it working! <3> is this a good idea ? <2> I had to reconfigure everything by hand <0> lookingfordistro, congrats <2> thanks for your help! <0> lookingfordistro, no problem <4> Al-Ashtar: hmm, aliases have better uses, but why not <4> Al-Ashtar: aliases are just conveniences, for lazy people :) <3> yeah I'm lazy <4> personally, i would write a full script <4> because what if you get a return value that is not zero <4> think robustness <4> Al-Ashtar: how good are you with scripting nowadays? <3> not good <5> okay now I have a handle I can stick with <3> but I can _maybe_ understand a script when I see one <4> Al-Ashtar: but you have the basics down i ***ume, functions and declarations and shells and subshells and stuff like that right? <3> Cognition: I'm fine, thanks for asking how about you ? <4> Al-Ashtar: oh comeon :) i'm sure you know that much <3> I really don't <4> Al-Ashtar: well then, why not start with tldp, they have a very good intro <4> Al-Ashtar: -> http://www.tldp.org/LDP/Bash-Beginners-Guide/html/index.html <3> this is very bad. <3> when you start reading about something <3> another interesting thing comes up <3> so you leave what you were reading before thinking it's less important <4> Al-Ashtar: i thought that was a good thing <3> and you start reading the new one <4> Al-Ashtar: actually, you read both things <3> I can't <4> Al-Ashtar: lazy lazy lazy <3> My brain is CoreSolo <3> no multi-threading <4> wow, you know about multi-threading now <3> I've read a small bit about it :/ <4> ok, let's see your skill <4> what's a thread? <3> it's a thin line that when put together you can make a T-shirt <4> LOL <4> Al-Ashtar: you never cease to surprise <4> Al-Ashtar: ok, here is a quick definition <3> a fine cord of twisted fibers (of cotton or silk or wool or nylon etc.) used in sewing and weaving <4> Al-Ashtar: a thread is an instance of a process <3> ali@Ubuntu:~$ wtf is thread <3> Gee... I don't know what thread means... <4> Al-Ashtar: depending on the operating system (which might differ) the usual implementation is that a process needs at least one thread <3> yeah I know this <3> a thread is a process <4> Al-Ashtar: so, when you are running a process that you can view with ps, you are actually viewing an instance, which is a thread <4> so, the next question becomes, what's the difference between a process and a thread? <3> a process is the command, and a threat is what the cpu uses to execute that command ? :/
Return to
#linux or Go to some related
logs:
#netcafe mysqldump: Error: Binlogging on server not active zhi sao hai you ni dj kukki
diasas teens my town.mp3 Glass Tiger #linux #chat-world Donna Kuti
#chat-world
|
|