what is the C function to send a GLX 3D init message from my computers graphics card to my brain assuming that
ok
Hrm; there’s a linux weather forecast
well, hangeul is inspired by a bunch of writing systems, including chinese, mongolian, indian, etc.
vorpal, We’re drier than usual, except for the occasional flash floods.
it doesn’t contain many sloping lines
do i recall correctly that there were major fires in CO this year?
vorpal, yes, pines beetles kill off the thirsty trees, then they catch fire.
vorpal, it was worse a couple years ago though.
ah, yes, we’ve had problems with those little bastards, too
apparently they attack during a drought. Usually there’s enough pine sap to keep the bugs at bay.
I have fired up wikipedia (german) on hangeul and I have problems even comparing the characters from there with the one at your site
http://zhongwen.com/d/176/x103.htm
how long did it take you to even recognize them?
what do they feed on, if not sap?
a couple of hours.
they’re made up of a fairly small alphabet
so, a default of 8 for FOPEN_MAX doesnt seem to be that much to me
yeah, just read that
vorpal, no sure, really. But enough sap seems to immobilize them.
could be that they feed on sap, and normally there is enough to keep them sated
10 vowels and 14 consonants + 27 more based on the former – if that information is correct here
Meh.
What’re you up to?
http://zhongwen.com/d/179/d116.gif
it’s a bit simpler than that.
working on my memoizer function
Zhivago, I’d have translated it as “lost road” then
http://paste.lisp.org/display/46421#2
consider s, j, and ch
j is formed by a horizontal bar above s, and ch by a mark above that.
ah cool
likewise, n, d and th
hi
b, p, and ph, etc
so there’s a deeper regularity within the consonant forms.
it’s for my bot. so it only reads a web site once, just uses the cached value afterwards
with the vowels, you have the vertical line, horizontal and circle
an upward vertical or a leftward horizontal are bright, and the reverse are dark
ae, etc
oh, sounds like simple rules
can you speak hangeul?
yeah, although some parts have disappeared.
can you speak ‘latin alphabet’?
so, is it best to avoid fputc and just use putc for file manipulation?
I can speak korean relatively well.
uh, why would you avoid fputc?
backwards compatibility? im reading the shildt book and that is what he says but i dont trust the guy
ah, your first mistake
just say no to shildt
well, lets see what k and r say
Throw out the bloody Schildt
you say bloody a lot, are you from the UK?
backward compatibility with.. what
Cin, shut your bloody pie hole
schildt is an idiot.
his books contain many lies.
huh huh huh
k and r refer to fputs so…
don’t make me use the “wanker” word!
oh, as I just read, the corean language is also agglutinative and vowel harmonic
Cin, early childhood influences; Canadian now
oh right ;]
yeah, i think i am gonna burn that shildt book
Would you? He’s an idiot.
you should make use of it
use it as a coaster
I guess you can see there that hungarian is coming from the same area
beats having it sit on top of my borland c++ for OS/2 collecting dust
Cin, or kindling, or toilet paper, or…
well, there’s an argument that altaic languages span japanese, korean, mongolian, across though turkish.
anybody ever use borland c++ for os/2?
vorpal
well, korean is only weakly vowel harmonic — mongolian is much stronger.
Who wants to adopt a baby goriila from rwanda?
the turks were of mongolian origin, so that makes sense
yeah. and hungarian has many influences from the turkish lang
s/goriila/gorilla
I won’t mind learning serbian
that region of asia produced a number of juggernauts throughout history
what means `weakly’ in that context? are the rules not enforced that strictly?
well, in mongolian, a given word can only have one harmony.
so even vowels of different harmony may not occur in the same word?
in korean, a word can switch to dark harmony at the suffix
and chinese words are exempt from harmony rules.
yes, so you’ll have a bright word, or a dark word.
ok
korean is much weaker in that regard.
what is harmony in terms of linguistics?
there are also some exceptions in hungarian
well, it means that you have constraints about which vowel groups can occur together.
for example a and o are bright, and eo and u are dark.
Blah
interesting
so you might say bamo or eobul, but not bamu.
Can anyone think of a fun project for me? And/or tell me a unix shell with very legible sources? I hear zsh is pretty good.
you can think of it as a disambiguation mechanism, perhaps
hmm, I guess it depends on what you find interesting …
try zsh if you never have before
i’ll read on it. thank you
depending on your knowledge you might want to subscribe to the zsh mailing list and help developing
I just wanna make something simple from scratch, for fun, learn how it works, etc etc.
why not write a shell?
http://img2.travelblog.org/Photos/7051/35415/f/181404-Macaca-monkey-1.jpg
looking for more.
Deformative, if you haven’t done it before, write a program which produces its own source code as output – without looking up how it’s done.
Deformative, you want a shell make a shell
nice. that word, macaca, was instrumental in american politics, recently
more? Sounds like you have already written one?
I want to read shell sources to know the basics.
Deformative, learning doesn’t work that way
Deformative, coding isn’t a spectator sport
writing a very simple shell will teach you the most.
it shouldn’t take very long.
that is why I wanted to read some sources, I won’t learn anything without seeing how it is done.
without opening files or using macros?
hmm, perhaps you should take up plumbing.
you will learn the most without seing it done
what will you do if someone asks you to code somthing that doesn’t exist?
what problem does a shell solve?
Cin, the rules are the file must be non-empty and no regard to input. Macros are fine, but they are part of the source code.
then I don’t have any standards to follow.
exactly
you will have no idea whether you are doing well or not
But shells have standards unless I am mistaken.
what standards?
then break them… who cares?
Does it just print, read, and exec?
even the pro’s don’t follow the standards
should Deformative be using a parser generator like bison?
to what end?
it does whatever you want it to
Zhivago, to parse shell input
again, who cares? especially if it’s just a test program
sounds like overkill.
I suggest that you write a shell which can run programs
later add the ability to set up pipelines.
the_plumber could teach him the art
pros
and pipes
if you don’t follow any standards, then your app will not conform with the rest of the operating system. I am going to make my own syntax, but I don’t know what else shells do in the background.
so the program can’t open a file containing its own source code?
exactly…
Cin, reading from the file would be input.
Deformative, a shell needn’t conform wiht any standards at all…
shells don’t do anything in the background.
Deformative, it can be a pure expressin of what you want in a shell
Cin, you can do it, but the results can’t affect the output.
and by “produce”, you mean print out to stdout or a file?
think about what you expect from the shell and then try to implement it
if you make it depend on libc, it’ll run… but that’s not the point, thats standard for all programs
Cin, whatever is prudent.
I’ll give it a go
and, seriously, if you want to call raw sys calls instead of using standard functions, i still think you’d learn the same amount
what did you expect me to do, write all the syscalls?
yes, for a price though
not writing them, using them directly
no, i want you to just use whatever functions you want to
anyways, i must go to bed…
What do you want to do?
Well how does the program get called via shebang line?
that’s not a shell issue.
It is if I want to make a script using my sell.
no, it isn’t.
your shell doesn’t read that.
that’s handled by the binary loader behind exec*()
Meh.
#!/bin/deformedshell bla bla, how does my shell see blabla? Is it an arg? Or what?
http://www.thescripts.com/forum/thread215994.html
That is what I am asking.
Deformative, # frequently introduces a comment.
write a program to test this …
Deformative, anytime the shell starts a program it does something like fork and then call execcve (but i’m likely wrong on the details)
I am not asking that!
arc and argv?
argc
you appear to have learned how to be helpless.
i’m not that interested in shells because mainly sysadmins are the ones who write shell scripts
I am asking how my executable gets the data when exec calls a file with a shebang pointing to my executable.
via … argv …
Alright.
is returning struct:s proper C89/C99?
if you write an app if y ou write them write you can avoid starting them with shells by setting AM_CPPFLAGS and setting macros appropriately in Makefile.am with automake
yes
almost no reason now to have programs that have to be started with scripts
holst, it is legal.
ok, thanks
Hrumph, your previous sentence did not appear to be coherent.
i meant shell scripts
you don’t have to set all kinds of environment vairables pointing out certain paths and things
if you have these things set via macros and that can be done via automake
i wonder how many people still us “frontdoor”
I have a perfectly functional front door on my house, and I still use it.
stop talking shit
i’m not
Christ.
how long did it take you to program that?
the_plumber, an indeterminate amount of time, since I did not program it.
it is “built-in”
it “functions” well
What the fuck
ok uqmsucker what do i put in automake to have it such that when a program compiles the macro DATA_DIR is set to the data dir set by configure?
Alright, bye.
poor kid, i think he was getting an anxiety attack
i mean what do i put in Makefile.am
uqmsucker, you are acccusing me of talking shit at least prove that you know yours
i dont use such crap.
a baseless shit-talking accusation, it seems
Draconx, forget it
i don’t wish to talk about this any more
what’s the gcc param to link object files + libs together?
lib2
orly? don’t the libs have to be prefixed with -l?
only if you want the semantics implied by -l.
no
sec, trying
works great.
thanks.
every now and then, some punk feels the need to establish his niche in the hierarchy by demeaning someone else. don’t take it personally.
hierarchy?
vorpal, np i know i shouldn’t have lost my cool which i did a little bit but not much…..i’m not in this chan to get involved in dicksizing competitions or trashtalking anyone.
what, then? trashsizing and dicktalking?
I hear people’s voices
well, he’s a recycling pimp
not a unicycling pimp?
no, that would not have to do with his dick fetish.
Dick Fetish, private eye.
i should have said verbal wimbledons back and forths flame wars i’m not into any of that
nice
heh
http://www.gaffer.org.uk/images/pink_bike_ride/PINK%20BMX.jpg — bike pimp
that is scary
okay, i have taken a liking to the new mac keyboards
even for C coding
which ones?
like the iMac keyboard?
the wired one, yes
i am not big on wireless mice and keyboards
neither am i
http://www.ncix.com/products/index.php?sku=21206&vpn=967973-0403&manufacture=Logitech
do you find the wires useful?
pretty nice
at first, i thought that it was too mushy, then i started using it for a bit and started liking it
i tend to lose things on my desk…
how’s it going? what you been up to?
i had a small wireless microsoft mouse at some point, and it got buried and i found it a few days later after plugging a regular mouse in
i don’t really like how the wireless mice i’ve seen are heavier than normal mice
i have a wireless gyro mouse and keyboard for my xbox360. they work nice
learning to unicycle.
Heavier? Do you lift them often?
but i don’t have the stacks of paper in my living room
I’ve been using a compaq compact usb keyboard lately — it’s quite good.
you don’t?
what do you think of the happy hacker keyboard?
they’ve gotten rid of all of the stupid keys, and they have a decent action to them.
over trivially small distances.
i remember there was a lot of buzz about it years back in #C
unicycle, eh? that sounds like a lot of work!
dunno — is it one of those stupid ones designed by landscape gardeners?
a bit more than I was expecting.
have you faceplanted a few times?
how do you faceplant off a unicycle?
it’s supposed to resemble compact keyboards used on older machines that ran old unices
i almost did the first three times i tried
sounds reasonably good.
like having escape closer to homerow
hmm, weird.
i gave up shortly after
I have 3 identical old KeyTronic PS/2 keyboards. No extra crap and the keys are all normal size with some weight to them.
I just step off it if I’m going to fall.
hey, is this the room that is not about talking C?
so, it’s hard to imagine how you manage to fall on your head.
but still does coding stuff?
please stay on topic.
that’s a reflex that i acquired with time
well, I’ve found a unicycle a lot safer to fall off than a bike, so far
so it is about C, ok.
i’m a tall guy and the unicycle i was given was rather small
it is generally about not asking stupid questions.
biking is fun, make sure you wear a decent helmet though
to increase my chance of death?
unfortunately helmets seem to make biking more dangerous.
why would you say that?
i thought they were supposed to protect the head and brain
pretty well
Hi all. According to this page ( http://www.twinsun.com/tz/tz-link.htm ) there is timezone information included in C. What functions can I use regarding timezone and daylight savings?
so… the topic is unicycles and helmets…ok.
well, if you were to land on top of your head, perhaps.
people try different things when they have a helmet on
but they don’t protect your face, back of the head or neck.
they tend to think that they are “safe(r)” with them on
oh, are you talking about regular bike helmets?
zxcv; and they give a false sense of security to drivers, so they driver closer to you.
wear a fullface helmet.
you’re just as vulnerable
i was referring to a more general helmet
also, they disrupt your senses.
you’d have to be insane to wear a motorbike helmet on a bike.
they make fulflace helmets for downhill mountain biking.
and BMX.
maybe a military helmet would work better
yeah, but that’s for running into trees.
you really want to be able to hear properly so that you can avoid being run over by idiot drivers.
solves your problem for facial protection, though…
are you talking about riding on the street?
My brother swears by his bike helmet – he says he’d be dead twice over by now if he didn’t wear one.
http://rafb.net/p/ul72cL34.html
sure.
what did it protect him from?
when you fall, your instinct is to put your hands out in the direction you’re falling.
please stay on topic.
please don’t talk to me
hopefully your hands will take the beating, and not your face, if you fall from your bike.
whatever happened to 80 or 120 columns?
try it at your end
on a bike, you don’t fall like that unless you’re in a head-on collision — say with a door.
or if you do an endo.
Zhivago, one case was due to pedestrian walking when the “don’t walk” sign was lit at the bottom of a hill, I think, rolling over forwards.
yikes!
unfortunate for the pedestrian, but generally they come off worse than the cyclist.
the bike provides little in the way of safety, though
you end up with scrapes and bruises, still
anyhow, in my case, I feel a lot safer without the helmet — but I try to avoid roads with traffic.
well, we’re talking about helmets.
does that satisfy the criteria?
safer without a helment?
helmet?
ah, right. i should stay on-topic
i’m curious, what do you believe was the real cause of the WTC collapse?
yes.
structural failure.
you don’t think it had anything to do with explosives?
have you ever seen those videos of guys jumping stairs, and they don’t make it, and land on their head, and get concussions?
i agree with you when it comes to the muffling of sound. i like being able to hear if something is coming
how did WTC 7 collapse with no plane crash into it?
crashing*
Cin, yep, it works for me.
woots do you have a solution to it? I’m interested to see
since this room isn’t realyl dealing with C, are there any rooms that deal with pseudocode?
EVIL!
that regex looks like poop
andy, yes, but very fun.
andy, oh for sure.
I think it boils down to the language being able to “quote” itself, or parse itself in some way. for example in Lisp it you can do ((» (x) `(,x ‘,x)) ‘(» (x) `(,x ‘,x))) which, when evaluated, outputs itself
oh cool, I’ll check it out
cute. the key point in mine is the %s in the string, hehe
stylistically, should a ‘break;’ match the same level of indentation as the ‘case…’?
Anyone know of a function or library that takes a longitude and latitude of a location and gives the timezone information?
i guess i need to read up on sed… what do the h p and g commands do?
quines?
yeah
Cin, It outputs itself once for each line of input you give it. If you give it more than one line, it obviously doesn’t output its own source code, but the resulting program is also a quine with the same property
andy, h = copy the pattern space to the hold space, p = print the pattern space, g = copy the hold space to the pattern space.
aye
that’s cool
ahhhh… nice
k
oops
i only really use the s command with sed
it’s by far the most useful one.
there’s flow control mechanisms too, which can quickly turn sed programs into monsters.
ha, the example of a quine in Wikipedia is quite similar to mine, essentially simulating escape characters
ooooo. I like this one: int main() { char *s = “int main() { char* s = %c%s%c; printf(s, 34, s, 34); }”; printf(s, 34, s, 34); }
I was trying to think of something as pure as that
I actually haven’t been able to find another quine written in sed to compare mine too
that example doesn’t include stdio.h, though
heh, it took me nearly an hour to figure out
did you see that video yet?
I was impressed by the guy leaping between rotated pallet edges
no, I’m re-downloading it sadly. my browser crashed mid-way through
Cin, I hope it was an enjoyable hour
hehe
qwq
erm
q.q
I don’t usually succumb to coding challenges but I’ve often thought about that one but never considered implementing it
hmm, it’s very annoying that you can’t use poll/epoll/etc on semaphores.
I’ve been forced to use the old trick of using a pipe with bytes as tokens.
I demonstrated my knot-making capability to him in /privmsg and that scared him off
with what library/lang are you using semaphores?
just sysv semaphores in C
I knew it! I was considering whether “I always lie” is a real paradox, but the statement itself could be a lie and the person stating it could sometimes tell the truth, so it’s not contradictory
yes, the solution to that constraint is “I sometimes lie.”
so “I always lie” is an oxymoron.
ah, indeed
Hey guys, why doesn’t this compile correctly? http://rafb.net/p/p1whMy65.html its giving me test.c:18: error: incompatible type for argument 1 of ‘ParseUserData’
also, test.c:25: error: request for member ‘uid’ in something not a structure or union
for each member of u
z, have you ever seen combinatory logic used in propositional logic? I saw a web site about it ages ago but lost the URL and now I can’t think of what query to form in order to search for it
frankr, start with line 18. What type does ParseUserData expect for its first argument?
Pointer to a struct udata?
frankr, correct. Now, what type is userdata?
a struct udata?
right.
is a ’struct udata’ a ‘pointer to a struct udata’ ?
But I’ve done this before – with a struct called conf, only 2 members, had a function defined the same way – f(struct conf *config) and I just did it like f(config) where it was struct conf config
z, hrm, disregard that question
it did seem odd at the time but I kinda ignored it beacuse I was happy it worked
frankr, you must have done something different from what you just described.
well it was an array of that struct
but anyway I put a & and that error is gone but the other ones are still there
frankr, what does the . operator expect for its left operand?
you there?
ah, sorry.
a struct or union?
my understanding is that debris from the other towers ate into the structure of it.
frankr, right. What type is u?
a struct?
or more specifically a struct udata
it is not.
but there were other building that had tons of debris hit them, and they still stood
or a poitner to one
poitner
buildings*
.. dammit
frankr, right.
they had some damage, but they still stood
So, how do I call that member if it is a pointer?
when you shoot people, many different possibilities happen.
some die, some fall over, some can ignore it for a while.
anyways, i was going to ask you some other question
these are complex interactions — it’s dangerous to expect uniform behaviour.
do you know a lot about adrenal hormones and their interactions with the rest of the body?
this guy brings up an interesting hypothesis, http://charles_w.tripod.com/cortisol.html
personally, I suspect that organizing the destruction of the towers would demand too much competence of bush and co.
no.
operator.
for some odd reason.. I can’t get gethostbyname() to work, will someone look at my code? http://rafb.net/p/sI8xgJ19.html
yes.. I am new to sockets programming
Ah, thanks for leading me through that without calling me an idiot, I got it to work
bush, sure…
Also, is there any other better way to parse a simple string by a delimiter, other then using strtok a few times?
are they finally building something at ground zero?
Hey
If I am having a programming issue, and the program crashes but doesn’t generate a core dump, how can I make it do so?
try man ulimit
thank you
where can I find an md5 function?
It works, thank you Chris.
A language that is like C, but without functions.
what would the point of that be?
C doesn’t have functions.
It requires the function main() to write anything.
main() is not a function.
I mean procedure.
Requiring int main() is a bad idea.
why?
printf(“Hello World”); exit(1);
just write a preprocessor that puts unbracketed code into void main
how do you resolve that with linkage of separate translation units?
use basic if you want that kind of crap
Good idea.
a pre-processor can’t do that.
because you have multiple translation units which can be compiled separately.
I like everything else about C.
you could require the linker to specify some ordering.
I’ve been reading ASM lately and that is how it does it.. it just keeps going down the list and jumps back/forth with JMP and CALL
Exactly.
Quite a mess, honestly
Not really.
It is KISS.
i don’t get it, why is requiring main() a problem?
not quite, you can define functions in assembly, though with assembly it just considers them labels
Because it requires too much organization of code.
not having a main would resolve some issues
Labels would replace functions in C.
yup, and you can jump to them.. so really, they aren’t function
but you haven’t answered the problems that I’ve raised above.
so, you want to go back to gotos and crap?
Yeah.
they’re still functions, whether you jump to them or call them
Even now I use goto with labels a lot.
I would just like to get rid of int main() because no where else in my code do I have a function.
i can think of few legitimate reasons for using goto, i doubt you have any of those behind your code
perhaps you should consider a different language.
Okay.
sounds like you’re attempting to force the language into your mental image of how it should be, rather than using the features of the language to your advantage
you’re pretty dumb.
or write your own language
I suppose it depends on how one sees it. I see it as one big code, separated by labels that can be jumped to. But I suppose they are functions because you can go ‘back’ to the line after CALL once it returns. What do I know, I just like making programs and disassembling them.
you might as well use assembly if you’re not going to have any more functions than main()
The problem is that is then my code needs more than a recompile to run on different platforms.
a function written in c can still be jmp’d to, yet it’s still a function
I thought C had no functions?
such as main()
for a particular implementation of C, perhaps
Every piece of code you write in any language requires some sort of variable/procedure; Programming really isn’t for you if you don’t want to include ‘int main(void)’ because you don’t want to make use of functions.
i said no such thing, as it most certainly does have functions
Functions really are central to C programming; I’m not sure what sort of code you have..
Well, most programmers hate my code. I was fired over it.
ah, correct. I read the line under yours as yours.
with good reason no doubt
I call bullshit.
i think pascal had nice syntax for some things
begin end. for the main program begin end; for functions
i think you don’t play well with others
er, main function i mean
Okay.
after all, what separates functions from methods or procedures? I usually call methods that return something a function.
I don’t think your going to get much sympathy in ##c if you want to talk about how much you don’t like some of the basic architectural features of C.
time separates them.
i call them all functions, procedures are just functions with a void return value, methods are just functions with an implicit first argument
frasha is particularly confused.
well, at least we agree on functions/procedures, not sure about methods though.
I failed most of my CS classes once they got into programming in Java/C++/C.
huh? i thought methods were functions operating within a class object
the difference between a function and a procedure is fairly simple
Anyways, same thing. Some say the glass is half full, some say it’s empty, and I say it’s twice as big as it needs to be, but that doesn’t change the fact that we’re all talking about the same glass
dangit
a function is a relationship that exists outside of time.
^W instead of shift-w
Teachers always complain that I write weird code. I got lower grades than other students when my program did MUCH MORE!
a procedure is a sequence of operations that are executed over time.
return values have nothing to do with it — likewise methods are orthogonal to this.
a function is a relationship that exists outside of time. – kind of vague though
much more? didn’t you just say KISS?
argg x.
Hahaha.
That really doesn’t make any sense.
Go figure.
There’s a difference between functional code; and stupidly written functional code.
i tend to think of pascal when someone mentions procedure, but i really don’t care either way, they’re all functions
ya, that is the pascal terminology
procedures don’t return values in pascal
My program would have all the features the teacher would want to see for an A+. I would get a lower grade than someone whose program has fewer features than mine because my code was “difficult to interpret.”
are you writing code for only yourself or for others? do you ever intend to maintain your own code?
no, they’re not all functions.
Why would a return value define a procedure?
My code is easy to maintain.
functions can’t change or be changed.
ask the creator of pascal
b.
In fact, easier because I don’t have any stupid style. Just one line after the other.
being invariant over time allows you to do all sorts of things that you can’t do with procedures.
All my code is in main ().
hey, I need a simple md5 function, the one in openssh is returning a whole lot of odd characters that I have to print individually with %02x for them to be normal characters, where can I find one
By the way, according to wikipedia, a ‘method’ is a subroutine belonging to a class, as opposed to a ‘function’ being a subroutine not belonging anywhere, and accessible all the time.
or, how can I easily convert this string, without doing a little for loop
is it easy to maintain for just you or for others as well?
but what about parts of code that are called frequently? Do you store your state in variables and then jump around?
yes.
he probably avoids code which does any form of recursion
I usually malloc() some memory to use for that, MooingLemur.
are all functions said to be procedures?
I have recursion using goto and labels. Just goto to the start to keep a loop. It is fast.
It seems programming these days is about how it is done, not what is done.
that’s what the stack is for, and that’s what functions do for you.
i really don’t care about pedantic definitions, they don’t matter here, you write code, you use it, who cares whether it’s a function or procedure
I was the only person in my Java class that knew the difference between a function and a procedure. And I hate them!
there’s a lot of value in writing code that is generally understood.
and adheres to some widely-accepted best web hosting practices
Bullshit, but I will stop.
i’d like to see you write something really huge using your method of coding, and maintain it too
Then why have you been responding, thus far?
why do you care? do you just want to prove how much more pedantic you are?
what university?
University of Maine.
frankr, what’s wrong with a loop?
I failed out by the way.
Large projects are easier to debug if you have a backtrace. Tools such as gdb work well for that purpose. They will not peer into your heap to tell you what is wrong.
The professors refused my work after a while and I quit.
that should tell you something
Your scrupulous molds had fault; and they were corrected. Now you sit as a child, offended.
Fucking student loans mean I am going to have to look for another job and suck up to them and code the same as they do.
my definitions may not be entirely accurate, but i don’t care, i’ll continue to just call them all functions and pedantism be damned
Being pedantic in school got me nowhere.
You pretty much called all animals horses; and think you’re cool
It doesn’t matter much.
function seems to be the most used word on C’s wikipedia page.
in general pedantism gets you nowhere, you just look like an asshole and get nothing done
I always sucked up and learned all the definitions. But still got bad marks because I didn’t feel like applying concepts that didn’t feel natural.
Then I’m afraid you missed the point of the education.
I guess I could do opensource programming as a hobby and look for another kind of job.
Auris-: I’m a little confused as to how to do it..
was just gonna use snprintf but its giving me errors and I’m not sure why
frankr, do we get to guess what the errors are?
auth.h:19: warning: passing argument 1 of ’snprintf’ makes pointer from integer without a cast
snprintf (digest2[i], 1,”%02x”, digest[i]);
probably something really stupid
sounds like you mean that you couldn’t be bothered to learn.
your definitions are harmful to understanding these things properly.
I didn’t go to learn. I went to get my papers and get the fuck out.
frankr, well, that function call is pretty stupid. first of all you are printint 2 hexnumbers but you are limiting output to 1. what’s the point?
Just like 99% of the other people there, I didn’t actually want to learn.
But, when attempting to appear intelligent, do so with facts.
Good luck in your attempts.
You weren’t born using a toilet..
Auris-: well first Iw as usuing sizeof but it wasn’t working so I just changed it to 1 to try and make it do something
it still has the same error, which I dont’ really get, because its not supposed to be an integer
Then fall asleep.
The fact that they push learning down your throat to get the papers when it is MY MONEY is just stupid.
no need to shout
No body forces anything down your throat.
Universities don’t treat students like me as customers.
You’re free to sleep.
heheheh
I can’t sleep.
Then die.
frankr, what’s the type of digest2?
draichis:
Auris-: char digest[16]
zvrbafdsgsg!!
so, what do those papers mean?
test case
frankr, so what’s the type of digest2[i]?
bwg; that you paid some money?
I think it is somewhere after line 222.
or that you have achieved a certain level of competence?
That I can get a job.
you’re an idiot.
Auris-: ah, char, which is really an int, I see what you are saying.. but I’m still not getting why it throws that error
You’re apparently far too lazy to learn simplistic things, and apparently too arrogant to care about why coding isn’t as natural as taking a leak.
Hi zvrba
China Airlines blew up.
You probably also think the world is wrong; and you’re right
Usually.
Auris-: never mind haha
if you think that buying a piece of paper makes it worthwhile to employ you, that is.
at best it makes you a paper merchant.
That you’re some sort of perfect model of mankind.
Do you really think most students are after anything more than that?
only the intelligent ones.
frankr, but your approach is not good. try doing the actual dec2hex conversion yourself.
It isn’t perfect, but it is reality.
and the reality is that due to your attitude you have remained incompetent.
You really should just sleep..
Nomatter how much you study, your future really doesn’t look bright.
Well, back to debugging seg faults with vi, printf(), and valgrind.
Auris-: How would I do this?
At least everything is in main ()
Auris-: also, with this approach it’s only getting every other character
do you feel it’s a good idea to maybe make use of nullity?
I’ve never met such a dense person..
I changed it to just sprintf same problem
Okay.
I am nullity.
well, it would be nice if you were.
then you wouldn’t talk.
frankr, of course it is, since you can’t fit 2 characters into 1.
I think I might have a slight idea why..
yeah
I was gonna guess that, I wasn’t sure though
hey BWG
but what is the other method you were talking about
Do you realize malloc() is a function?
Hey, what do you guys think about function overloading?
frankr, consider “0123456789abcdef”[i & 0x4]
Sure, I use other functions. I just don’t write any of my own.
a bad idea — use proper generic operators instead.
You really should spend some time reading a book.
I don’t think there are self-help books for that problem.
Read the SICP before you ever write code.
It should expand your thought pattern a little.
Auris-: His problem isn’t one of implementation; it’s of mental reasoning.
I avoid most books.
why?
problem, BWG
you should probably go read a lot of books
I have a really low IQ and have never really been that great reading more than a paragraph.
bI have a really low IQ and have never really been that great reading more than a paragraph./b
I’m thinking about OCR so I can read books.
IQs mean nothing.
You’re simply lazy.
very
The C Programming Language book looks like something I could handle.
how do I use limits.h?
I got high honor roll only once in high school. But other than that, I consider myself motivation challenged.
I don’t like for/while loops
Do you know what limits.h holds?
They are like cheating
I use goto
..
That’s why I use goto instead.
hardcore programmers use goto
Really?
all the pros use goto
I guess I am quite the pro.
most weenies just suck at programming
Linus Torvalds thinks goto is uncool.
I’ve got a question about inline assembly
so they use unreadable to excuse their own incompetence
I hate when books do not mention goto
My programs have hundreds of goto statements!
hot!
?
Yes I’m in the man page
I’m porting some code from visual c++ to gcc
i’m not so hot on commenting either
That is hard to do.
you mean g++?
good luck, phire
I mean your code speaks for itself
but how do get the {CHAR_MAX} in the program? I don’t see that it uses function
opps, well, its c code
It simply defines symbolic names which represent limits on resources that the implementation may/may not impose on applications.
I had to rewrite my whole program just switching to a newer GCC. Forget Visual C++.
I really need to shower this week
you make out like C is good at writing abstract code
morning
You should also take a look at stdint.h/inttypes.h
morning buli
its got this line here “__asm pusha ” would the gcc equvelent be asm(“push %eax”)?
weren’t you starting chapter one of the k&r on friday?
How did you skid to limits.h
hey nimrodicus23
Please.
phire, maybe you should look up what pusha does.
goto is easily abused.
use it where it is the least horrible opiotn.
er, option.
maybe I should
heh, I like it.
Yes But I’ve been taking a brake, I had to fix my OS :p
Yes.
yes, but that’s because you haven’t understood.
I learned BASIC first and goto has been something I love having in C.
it sounds like you never learned anything other than basci.
er, basic.
oh, Push All General-Purpose Registers
That’s possible.
break
Yes, but it doesn’t really define how you got to limits.h
My mother said I was a good programmer, though.
I’ve never done x86 assembly before, just arm and z80
phire, I’d say you use pusha with gcc as well.
zhivago, don’t worry about your typography; orbitz was here before
Your mother probably doesn’t program.
So, her opinion of your code wouldn’t really matter.
I suggest, that you go back to reading the k&r.
but the dos nonreentrancy was really annoying
what’s K&R
!k&r
k&r is The C Programming Language, 2nd edition, by Kernighan and Ritchie, http://cm.bell-labs.com/cm/cs/cbook/ – be sure to see the errata as well, at http://cm.bell-labs.com/cm/cs/cbook/2ediffs.html
its annoying how I can’t test any of the assembly untill I finish the lot
Sweet
Once I figured out how to execute shell commands from QBASIC I was making cool programs that delete files and stuff like that.
I was grounded for installing it on library computers.
contain symbolic constans for all of these sizes, …”
pusha isn’t win32 specific ..
My mother said I was an “untapped genius”.
asm(“pusha”
And then after it, I had to make a program that determimes the range of char, int etc.
have
that’s what your mam said to me
So I finished my account software.
what does your account software do?
Uh..
asm(… “pusha”; … ); would work on gcc or anything else really..
If you’re playing with inline, that is.
Only problem is DEBITS are off by about 70 cents to a dollar sometimes and I can’t figure out why.
let me guess.. trying to round floats
except when it fails, that is.
not just anything, it would have to have the same inline assembly syntax
good to go, then. just market aggressively. make sure that the buggy roundings go to your account
I use floats.
maybe you should use rationals
Yeah.
using floats for exact decimals is a bad idea.
yes, considering a float is by definition not exact
I guess that is what I get for partying through college.
i used longs for a program that divides polynomials
I was plowed when the teacher talked about floats. In fact, I only know about floats from wikipedia
(86x^2 + 32x + 15)/(8x + 6) = 10.75x + -5.41667
that app was quite fun to write
I think I failed that assignment.
Damn it, my nick is messed up. Can’t fscking type my nick in IRC.
There.
you should seriously consider — no, not only consider — reading programming literature
Yeah.
Err.
I am consideirng reading The C Programming Language if it is easy to follow for my reading level.
are you very new to programming?
No, I am a veteran actually.
then that book would be the one to get
I got started with qbasic in 1995.
he hasn’t figured out how to use functions, yet.
except i doubt he’ll be able to read it.
so, he’s not much of a veteran.
otherwise, i’d suggest a book like “practical c programming” (the oreilly book)
you know, reading skills aren’t something you are born with. they get better the more you read
which is very programming newbie friendly
I learned how to not write my own functions. I just use other people’s functions and keep all my code in main(). It has worked for me since 1997.
that may work for very simple programs
those who read a lot (and are good at it) aren’t like that because they’re born good at it. they’re good because they’ve had the motivation to read, and have gotten better by reading
but as you approach complex and very complex programs, you’ll need functions
so, what non-trivial code have you written?
Accounting software that is Web 2.0
or want rather, would you want to be repeating tons of code in main()?
thb, i’d never hire someone like you to do any programming work
Web 2.0 meaning my program is an executable run by Apache in cgi-bin.
I like porting code from languages I don’t even know, to C.
Oh, is that what Web 2.0 means? Finally!
?
isn’t that what web 1.0 meant?
Web 1.0 == Static HTML Web 2.0 == Dynamic content
no, usually web 2 means ajax, etc.
yes, another web 2.0 definition
that must be like the 9081039801394810938th
Therefore, I call it Web 2.0 Accounting 4.7
web 3.0 == people waving cyber-gloves inside 3D scenes
Only problem is debits are off.
web 4.0 == people injected with stimulus in their brain
Somehere in the code after where I goto debit:
web 4.0 == a network becomes self-aware and people realize it’s a dumb fuck like everyone else
well, they already do that with monkeys.
Web 2.0 is dynamic content via CGI, okay?
CGI is ancient.
web 5.0 == internet porn is undistinguishable from the real thing, society collapses
i thought web 2.0 is what you sell ads with
I thought web 2.0 was a buzzword retarded PHBs used
I wish I could have long nicks on EFnet.
alternatively, i thought web 2.0 is about, you know, social networkinhg
just wait until the semantic web kicks off
Then I could GeorgeWBush2008
you win the prize
ah, well, that would make your degree of mental retardation clearer.
yay!
what do I win?
The web has always been semantic though hyperlinks.
the prize
oh
Don’t diss Bushie.
uh
why not?
Bush has only further corrupted our government
Bush is my idol.
so i will most certainly diss Bush
why?
you aren’t on efnet, so those limits hardly matter.
I relate to Bush.
err
FreeNode, heheh
There.
and I kind of think this guy is a troll
really?
of course he is.
:B
there, now i said it
because i want to go to sleep
night Tatsh
Dubya FTW
You have been trolled.
I’m Canadian, and even I know that a US president can serve at most 2 terms.
Now go wash your eyeballs out with soap.
GWB has only been in term 2 times
Fuck FDR.
FDR was before the amendment/law that only allowed 2 terms
sigh.
If FDR didn’t come up with that stupid amendment, we could have Bush for a third term.
#politics is elsewhere.
why would we want gwb again
actually, they should re-write the constitution so that the terms that a similarily named president served earlier would also count. did daddy Bush serve once or twice?
once
you see?
that would be nice, iuso
No!
boy Bush could’ve only served once if the law was more humane
Then we would have no Dubya!
i want to have campaign contributions banned and contributions in general
banned
harder to do that in real life, banning
i know it would be hard to enforce but it is the root of all problems of our government, imo
other than religious freaks
ideological mouth-foamers are always a minus
if #politics doesn’t seem right, #jibberingidiots might be better.
but it’s actually funny to think that lobbying is considered corruption in some parts of the world (i think?)
oh, sorry
lobbying should be legal, just not “donations”, what I call bribes
I think #politics moved to #jibberingidiots yesterday
George W. Bush is sooooooooooooooooo SEXY. Too bad he isn’t gay.
isn’t that nick breaking the “no offensive nicknames” rule?
+b is a fun flag.
err mode
err whatever
+b ftw
No
Hello, what is the C function to send a GLX 3D init message from my computer’s graphics card to my brain, assuming that my tongue is securely seated on the DVI output port?
how can I convert some hex data in a char to a string of hex pairs?
I have all the GLX libraries installed, both on my C compiler and on my brain’s operating system
What I’m trying to do is create an interactive HUD without the need of anything external
what OS does your brain run?
failed humorist or boring troll. hmm.
iuso, MarcoOS
I thought it was funny, twkm
hmm
not supported
iuso, all MarcoOS really is, is linux
iuso, with just a few tweaks and patches to run on the brain’s IO system
i read that as “MacOS” the first time through
andy, If my brain was running MacOS, I’d probably be having fits by now
at least you’d look good doing it
haha!
did you borrow from the dead badger howto?
hey now, i am typing this on 10.4.10
SSH’ed into a FreeBSD machine, mind you, but still!
No seriously, can someone just give me the GLX init function? I can figure out the rest
if you say so, though i’ll retain my estimate of it being a dud.
you’re just looking for a sample usage?
twkm, I tried asking the CIA, and they told me off for talking aloud about secret technology. The bastards. I am the one who created it
andy, yeah
andy, but it has to be able to be sent along my tongue
you are looking to use GLX w/X11?
who’s worse, me or him?
that presumes i pay attention to you anymore.
yes it does, and so?
i don’t.
come to think of it, I don’t usually pay attention to you either
excellent.
Hello, what is the C function to send a GLX 3D init message from my computer’s graphics card to my brain, assuming that my tongue is securely seated on the DVI output port
twkm, Cin, oh snap.
twkm, BAN HIM
there is no function in c for it. i take it you want someone here to look at the documentation for you?
there really isn’t a glx_init function that i know of. you’re probably looking for gl_init
http://tinyurl.com/2w8yya this is an example for X11
i am sure that you could google a few up with ease
don’t click it, it crashed my browser
works fine for me
http://www.ldc.usb.ve/~vtheok/cursos/ci4321/proy3/navigation/main.c is that better?
sigh
anyway, I do not have an operating system installed on my brain, I do not use C, and I do not intend to ever use C.
excellent.
wtf was that about?
i feel like his part message should have read “YHBT”
troll.
well deduced
i am always looking to help though
andy, troll feeding is not help.
No more than bird feeding is wildlife preservation.
Auris-: well, for a second i thought that the guy was just quirky
may i quote?
I suppose it depends on what you are desiring to quote.
I generally have no opinion.
i was thinking of feeding that last bit to bash.org
well, iKernel seems a singularly sensible fellow.
Bash has low standards, but not that low.
i found it humorous!
his questions were technical enough in nature that he could have been serious
ok so I made a little function which does the md5 hash, then uses a little temp var and strcat to create the hash string. But it’s off by a single hex pair every time, the second one, and I don’t know why
I was not being sarcastic.
not sure how easy it is to be a programmer and not use C at some point
you did something wrong.
consider making a test case available for folks to look at.
doing so now
I’m having trouble translating line 9 of this pseudocode for a Binary Search function for arcsine. http://rafb.net/p/ixk4rZ26.html
I think it’s shorthand if-then, but I can’t tell.
you mean the ? operator?
operator
http://www.phim.unibe.ch/comp_doc/c_manual/C/SYNTAX/conditional.html
the whole. (higher_value = 90 && sin(higher_value) = sine) ? higher_result : result, line.
ah, thank you sir.
It’s a conversion from the Mathematica language.
which makes no sense at all.
imho
if the higher value isn’t greater than 90 and the sine of it is also greater than sine, mouthful
“if these two things are true, return Higher_result, otherwse, return result?
ok, I made a test case – http://rafb.net/p/XogvcN61.html
my problem is that I made a function to automate making an md5 hash and giving me a string of 16 hex pairs, but the second pair is always wrong and I don’t know why
rest of it is fine though
that hurts my head.
why not use the openssl lib or whatever?
I did, just, I wanted to automate making it itno a string of hex pairs, otherwise it just puts the hex into an unsigned char array
not really something I can work with
the sprintf is pretty wasteful
snprintf (t3, sizeof(t3), “”); wth are you doing there?
and strcat wtf
strcat is a terribly slow operation
I dunno. for some reason when I started putting data in t3, there was already some crap in it
it’d be quicker to just do sprintf(buf, “%ud”, md5_sum);
he likes pain.
%ud?!?
made it up
ofc, it’s not initialized…
bah.
using my custom version of sprintf that’d work fine!
not initialized?
is there a way for me to just snprintf the whole thing at once w/o using a for loop? tjhat would make thigns a lot easier
initializing is the thing _you_ never do… apparently
sprintf(buffer,”%02x%02x%02x…
you probably don’t know how to count.
t3[0] = 0 was written snprintf(t3, sizeof(t3), “”) — weird, but whatever, at least that does something useful.
but t2 has room for only 1 character, yet you try to put at least 3 in it.
sprintf(t3, “0x%X”, (unsigned char *)MD5(“hello”));
sigh.
I win!
I thought there was not just an MD5 function
it would make things much easier if there was
I meant to cast that to unsigned int
that would have been MUCH better
openssl provides such a function.
now, you iterate 16 times each of which (tries to) append 2 characters to the string, so the resulting string would have a length of 32, which is the space you allocate but you allocate no room for the string terminator so you have a buffer overflow there too, eventually.
I thought 0 counted
32 + 1 = 33
yes, 0 to 31 is 32 elements.
(not that you need either t2 or t3)
so 0 to 32 is 33 elements, leaving space for 32 characters an a ?
yes.
ah, so that isn’t a problem then right
I wonder if I can build openssl for mingw
when i throw away t2 and t3 and write directly to dest (which i resize to 33) i get the expected hash.
yes it is.
on the 16th iteration of the loop you write outside of t3.
every iteration of the loop writes outside of t2.
I changed t2 to have 5 elements, now, that should not be a problem, and t3 to 34
now you show lack of knowledge of what is happening.
re
moin
I know what is happening, but if I have more elements then needed, it should eliminate any room for error
okay found a static host lib
the last time I found a static lib I had to rewrite a few unix functions though :/
I might not understand it fully but what I get is that the md5 I am using creates 16 hex values.. my little for loop there converts those hex values to pairs of ascii characters and writes them into a var
*shrug*
thats enough coding for tonight, yawn.
thanks for your help, twkm, and others
oh wow, it works
hi
um
this code has a lot of “naked” functions
purchase clothing.
gcc doen’t like naked functions
must’ve been outsourced
perhaps they were on the aletsch glacier too.
Copyright 2005 Nullsoft, Inc.
what do you envision is a naked function?
whee
http://rafb.net/p/GD0UNm82.html
my version
__declspec ( naked ) void _asm_simpleValue(void)
ahh, msvc-ism.
not too surprising that some other compile host doesn’t grok it.
is my version terrible?
I’m attempting to port from msvc to gcc
then work out what it means to msvc and find something similar in gcc.
or code around it
or recode the whole thing and make it portable
the better way would be to use ifdefs and make it work for both
its basically a section of asm code, with none of the normal function code, but mixed in with normal c code
find a way to make it work for both _without_ ifdefs :p
sounds horrible.
the program grabs the functions, modifies them, and runs it
probably that’s why they call it nullsoft
ahh — it is horrible.
its a compiler
how is that significant?
not completly sure what it compiles
you have source you whose purpose is unknown?
so why do you want to port it?
twkm, scandir () function, have the last parameter alphasort, does it work with _XOPEN_SOURCE, or only with _BSD_SOURCE ?
I just haven’t check what this part does
Expression evaluation library
what does your scandir documentation say?
` operators are limited to :
+ – / * % & |
` functions are limited to :
sin, cos, tan,
asin, acos, atan,
twkm, None of these functions is in POSIX.1-2001, but alphasort() and scan-
dir() are under consideration for a future revision to POSIX.1.
there you go, not posix thus not x/open either.
then it’s not portable?
duh.
prehaps I should replace it with something interperted, instead of something compiled
did you make fun of my rafb’d code yet?
no.
you should, although I missed an ‘unsigned’
pedantic picked it up
thrilling.
lol
zid, why don’t you try doing the hex conversion yourself and not using sprintf.
sure thing boss
sum[i]&0xff
an unsigned char gets promoted to int when being passed via varargs?
anything narrower (technicaly with lesser rank) than int is promoted to int.
okay
can I do arithmetic on it without it being promoted?
arithmetic seems pointless, but sure the result of the expression is promoted, not the object itself.
but just make sure I’m setting a char with the result and i’m fine?
depends what you do. perhaps it’ll be fine.
I’ll show you when i’m done
oops, I keep making my speaker bleep, think i’ve got a BEL in there somewhere
it very nearly works _
I’ve written this in asm a handful of times in very elegent ways, can I get the C version to work? can I fuck
can’t answer the second question i’m afraid
it really shouldn’t be that hard.
aha, off by one
http://rafb.net/p/m7STWs84.html
at least it is horrible.
thank you
“0123456789ABCDEF”[sum[i] & 0×4]
heh
heh, that’s quicker, uses more mem
but fuck is that sexy
so you think.
can I get away with mine using less memory as a reason to not do that?
oops, 0×4 is wrong of course.
only if you prove that as being the case.
that one is probably smaller overall if you account for the extra instructions mine uses :/
I bet x86 has an opcode somewhere to do it automatically
it has bcd
Still here?
hi need a little help….when i call system(SIGCHLD,handler) how do i send the pid of child to handler ?
you don’t.
i need to print it that this process has ended…
a signal can come from anywhere
Would it be apt to say that pointers in C follow the linked-list datastructure?
wait
no.
i need to do it for background processes.. how do i print their pid on completion if i don’t send it to handler
though it is true of many implementations of malloc.
”man wait”!
Would they come within any linear datastructure category?
twkm, i can’t use wait because i need to display shell prompt after that
you know that a child has died — why can’t you call wait?
(at least one child, perhaps more)
twkm, child may die after a long time.. how can i go on waiting?
i wouldn’t try stuffing them into any particular one. an implementation / platform might use almost anything.
sigh.
you receive a signal that a child has died. why is calling wait to retrieve the child’s exit status worrying to you?
twkm, you are confusing me !
get a good book.
Just talking about the nature of a ‘pointer’, not its specific use.
okay, let me put it another way … “i wouldn’t try stuffing them into any particular category”.
twkm, can’t i do it using signal system call
no? why not?
twkm,like for background processes..if in parent i do signal(SIGCHLD,handler) what exactly will happen
nothing special.
when a child dies handler will (eventually) be called.
and unless you like having zombies you will have to use one of the wait functions, either in handler or somewhere else.
ok i use wait in handler…but i also want to print the pid of child who has died on screen…where should i put that print statement
if you don’t want to call printf … don’t call it.
twkm, i want to call printf to print the pid of child..where should i put it
somewhere else. e.g., put the value into a queue.
twkm, but when do i do that…
gee, i wish i could …
is fwrite guaranteed to save a struct in a way such that anybody can fread it correctly?
i.e., is that somewhat implementation dependant?
no.
it’s implementation dependant, then?
right.
ok, any hint then for writing binary data in a “portable” way?
Yes. Don’t.
guess the only way is to write() directly
Define a serialization format and use it…
write helps not at all.
libpack will be nice
(at least, no more so than fwrite)
some year.
Don’t try to throw raw structs around the place
That’s the main thing libpack is for
if you can stand perl-pack-notation.
http://www.leonerd.org.uk/code/libpack/
Umm.. It’s not perl. It’s loosely-inspired-by-perl
It’s own format though
still single character, appears to be a cat walking on the keyboard?
hmm, thanks… gusing what overhead produces libpack in terms of extra bytes written…
I didn’t want to make anything too verbose-looking
It doesn’t
It packs exactly what you asked for. It’s the mechanism by which you can implement your own serialisation scheme
“extra”. is bandwidth that dear?
It’s not like ASN.1 or Sun RPC or XMLRPC… It doesn’t define its own way of doing things.
It isn’t exactly trivial and unimportant, you know.
It simply provides the lowlevel primatives for you to implement the scheme of your chosing
which?
just trying to store a can-be-huge sparse matrix…
Would you suggest a longer notation format then..? “please-pack-an-int-into-a-32-bit-big-endian-unsigned-field”.. or something like that..?
In which case, my advice is revised to 1) Define a serialization format 2) Implement it with LibPack
printf(“I have %integer %string.\n”, 2, “cows”);
what’s your point?
*blink* Umm… %integer… might look amusing when printed
ok, thanks, will try your library
Bear in mind I’ve built it from no particular spec, no particular request, other than things I needed at the time. Likely there’s things you might want that it doesn’t do – feel free to ask about them
i’m looking for a code exploartion tool
Permalink Comments off