yeah. It clarifies some…

so you each have your own frame — unless you’ve arranged for pages to be in two frames at once, then you can’t affect another process’s memory.

I’m going to read up on that when I get the book C Primer Plus, that I ordered.

this is a posix/unix thing — it has nothing to do with C.

ok gonna read some Unix memory management then

good luck

tnx. I’ll need it

just remember that if it were difficult than most unix people couldn’t do it. bbl

anyway, thanks for the primer Zhivago

have you figured out the alternative, so you can obtain stderr even though popen “r” only connects to stdout?

what the -1 in signed int -32768 - 32767 (2^15)-1 what isnt signed int -32768 to 32768 s/what/why i mean why not what

2’s complement systems have 1 additional negative value than their 1’s complement or sign-and-magnitude brethren.

2’s complement systems ?

twkm, not yet

yes.

what are 2’s complement systems

where’s your book?

i was just reading about binary numbers and stumbled across Negative Binary Numbers Bitwise Not (~)

-32768 to +32768 is 2**16+1; how do you expect to fit that many values in 16 bits? i mean, the set of integers from -32768 to 32768 inclusive is 2**16+1 values.

and from -32768 to 32767 is 2**16 ?

yes but the standard says int must be capable of holding -32767 to 32767 inclusive

in 1’s complement and sign-and-magnitude systems there are two 0 values.

sorry i dont know what you are talking about sign-and-magnitude ?

open a book. or even a search engine.

ofcoursee a book

hey guys.. i486-linux-gnu here.. I found out now about #pragma ident. I see from the hexdump that the text i put there goes in the .comment section of the ELF, but what use is it?

hi are u there

it is customary to mention the nick you are talking too, rudhi Do you have a question, rudhi ?

ya so many man!

Perhaps a programmer can put special developer/user info in there, Bucciarati

(i mean, i can hexdump the section and look for myself, but has it any practical use beyond this??)

or a unique serial number to trace the software! That’s what I’d do.

ihey i need some code for examinition of V x works

does unneeded #include’s bring extra overhead, or does the compiler just ignore them?

i see

you accomplished this with gcc? which version, Bucciarati

hi Radsurfer I am into C,Embedded

but i hope you’re not updating the string by hand each time.. do you have some vcs tool that does it for you?

need some exposure to Vx Works

I’m sure thats possible, Bucciarati

yes gcc, i’ll tell you the version now 4.2.1

Sorry, I can’t help you, rudhi, please ask PoppaVic CentOS 5 is on 4.1.1 http://docs.sun.com/source/806-3571/Pragmas.html

ok

i tested, works with all gccs i have (back to 2.95)

Well one more can I run two slightly different kernel in one pc ?

yes i already saw that page, thank you

I’ve already scribbled in my notebook :-) thanks.

I tried RHEL5 and Suse 10.2 n it was nt working. any body has ans hi brad see my Qs

where’s PoppaVic when we really need him?

rudhi, I do not understand how your question relates to C ?

tell me i can help

I was in the bathroom, if you /must/ know

can I dual boot RHEL5 and Suse 10.2 ?

welcome back, but i didn’t really need to know… a simple AKF would have sufficed

both having same kernel

those are not C-related questions.

please ?

Talk to the REDHAT and SUSE guys about hardware compatibility issues.

Its all C

And it seems English is not your native language.

u denied embedded C,now linux ? tell me any link

redhat.com

Xgc, do you have any idea what he’s asking?

too bad i seem unable to use __DATE__ and __FILE__ there that would have made it really userful

The problems certainly have much to do with C, but also have a great deal to do with complex design issues that result in incompatibilities. Trying to find the right combination of hardware and firmware and drivers to run an os isn’t a trivial issue, unless you’ve found a combination that has been pretested for you.

Umm…. probably with some trickery, %% operator or whatever its called?

He’s whining about not being able to install/run redhat and suse on his specific hardware.

to string together elements of a #define

pasting

And then apply that to a #pragma, which should be subject to the same preprocessor “games”

what specific hardware, its most general intel architecture and i386

or that e can run those, but not some other os.

If you see my point. #pragma ident ’string1′##’string2′

btw it’s #ident and not #pragma ident (maybe that’s sun-compiler-related) i’ll try ## now

Just brain-storming, mind you.

nah, ‘extra tokens at end of #ident directive’

It’s technically possible to run many oses on your hardware. There are techniques that would allow multiple versions to run “in a loose sense” at once. See companies like vmware.

Nice try. I wouldn’t doubt some little trick exists.

i’d suggest.. don’t feed him you are in the wrong place

But if you have a problem with one or more of them, that’s not really a direct issue we can handle in the C channel… apart from noticing that C isn’t a very good language for implementing these more complex systems.

mh is there a way to eval a preprocessor directive twice? i mean, to have the preprocessor eval the result of the expansion of another directive ? that way i could say #ident “built on ” ## __DATE__ ## ” from ” ## __FILE__ #define ID_STRING #ident “built on ” ## __DATE__ ## ” from ” ## __FILE__

Yes. Try it.

I got it! Place that many “dummy characters” into that space, 2) obtain address of that space 3) write whatever you want there! lol.

i have tried but gcc doesn’t like it

#define ID_STRING #ident “built on ” ## __DATE__ ## ” from ” ## __FILE__, followed by #expand ID_STRING

that dummy characters go up in the .comment section, i doubt i could get its address at runtime

Ah. Sorry. Why not just build the string at runtime.

#expand, i’ll try

somethng that would force the preprocessor to see ID_STRING as intended?

because i’m interested in compile-time environment such as __DATE__ and __FILE__

“#expand” is bogus, sorry, I meant “if something like that existed”, it would be nice

is there a book for topics below? idioms, good web design & code organization.

ah

You can use stringify (#). Here’s a small test you can use as a guide…

I’m a great brain-stormer

all in all i could just drop __DATE__ somewhere into the .data section, but i liked the idea of having this metadata apart

This is something from many years ago, just playing around. Some of it might not be completely correct, but it’ll show you some techniques: http://rafb.net/p/Rr1iZo12.html

if you could trick the pre-processor in re-processing symbols already in its symbol table, some interesting things could be tried

Just run it to see the result. It plays with ## and # preprocessor operators.

thanks, i’m looking at it

http://www.iso-9899.info/wiki/Snippets#Preprocessor

i didn’t know about #define a(x) #x

It compiles. It runs.

It’s under Appendix Z - Magic.

“It’s a-Live!”

Hey! I changed to __DATE__, and now it doesn’t compile?

It (#) is called stringify.

cool

Try this one: printf(”%s\n”, CAT1(bbb,__DATE__));

why using __DATE__ throughout fails? using the thing in main() does work neat thing to study and learn if the return value is a “string” this fails as written

Some of the macros try to create other tokens, the spaces in a __DATE__ cause problems.

but ASCII DIGITS works fine. oh. spaces. I can see that.

as in this macro: int ID(bbb) = 5; It tries to merge bbb and the date to form an identifier. Just comment out that line.

Ok. Glad you shared that.

hm. using just #ident __DATE__ works fine

LOL simply needed something that worked to perform what __DATE__ does (substitue its value for its actual string) except that string is now under our control. need to run. fun stuff.

but #ident __FILE__ ## __DATE__ (with and without ##) doesn’t

You’ll find compiler specific mechanisms (like #ident) all over. What I showed was part of the standard.

sure

and you’ll find these operators are defined within macros, but not other places. You may find the tokens to the right of #ident don’t qualify as being in a macro.

ahh that makes sense

You migth be able to do: #ident someMacro(…), but I wouldn’t count on it.

http://www.la.utexas.edu/lab/software/devtool/gnu/cpp/cpp_43.html

:O enlightening

here’s another - last para: http://www.delorie.com/gnu/docs/gcc/cpp_47.html

time_t is considered an opaque type, correct? You should not assume time_t is an integer type that holds the number of seconds since an epoch?

right for all we know it’s a homosexual-float

o_ô

Heh, thanks. That being said, is there a way (an easy way) to convert an instance of time_t to seconds?

How can I print the value of a define using the preprocessor?

seconds is vague.

there are about 3 or 4 forms of “time”

uh, expand it?

with stringify? (#)

time_t does represent seconds; seconds since the Epoch

sigh.

So I can do #error #variable? and it will print the value of variable?

and halt compilation, sure.

twkm thanks

you can try, good luck

Well, allow me to elaborate. I’m using gettimeofday() to get a high resolution time, which I’d like to convert to a granularity of -at least- milliseconds.

gettimeofday isn’t exactly portable, you can presume something about time_t as a result.

What can I assume?

convert it into what?

C has a handy-dandy / operator

that it also conforms to the unix and posix standards.

Most likely, a double, since C89/C90 doesn’t have an integer type that’s guaranteed to hold more than 32 bits.

arithmetic seconds since the epoch.

twkm #error #Q_MOC_OUTPUT_REVISION simply printed “#Q_MOC_OUTPUT_REVISION”

heh

Since you need posix to have gettimeofday /anyway/, you should probably use int64_t

It sounds like you’re saying that for my usage, it’s OK to assume time_t -is- some integer type, which holds the number of seconds since some epoch, since I’m using gettimeofday() anyway.

no, some arithmetic type. but yes, seconds since the epoch.

/that/ sounds sensible

why do you want to convert the results of gettimeofday() into a double?

static double { struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_sec * 1000000.0 + tv.tv_usec; } Oops, that should be “static double MicroTime(void)”.

might produce more precision than double has, though that’s fairly unlikely.

why are you multiplying tv_sec by 1 million?

Is it possible to output the value of a define using the preprocessor?

to convert it to microseconds?

so he can add usec.

total usec

he mentioned milliseconds before, which is why i ask

I was originally casting tv.tv_sec and tv.tv_usec to double, but you seemed to indicate in a previous conversion that it wasn’t necessary.

right, because of the multiplication.

double d=1.0E4; d*= sec; d+=usec; return d;

The multiplication will cause the lower precision size to be (at least temporarily) increased to the precision of the higher precision side?

the object certainly isn’t changed, just the value. but yes, that’s how that works.

I assume the compiler will make a temporary object if necessary. A temporary object of a higher precision. And it makes sense it should never modify the original object.

hmm, object. not as such. the values are converted if necessary.

Is it possible to output the value of a define using the preprocessor?

OK. Thanks a bunch.

oh, just the pre-processor. no.

twkm thanks

Do you mind if I ask one more stupid question?

see type promotion, if you want to get the exact picture.

Ah, that’s it. The word “promotion” was not coming to mind, for some reason. Thanks, I’ll research that to make sure I have a clear understanding. Now I’m wondering what happens when your function returns a smaller type than your return expression.

try it ouy

i.e., You return an “int”, even though the function is defined as returning a “char”. That is, whether or not you need to downcast.

*out, even

implicit conversion. if the types are signed and not in the range of the target type, then the value is undefined.

Ah, fantastic. That’s very convenient. The compiler will not give a warning or anything?

the compiler may give a warning if it feels like it.

Ah. That makes me wonder if a cast is desirable, if for not other reason than to quiet the compiler (assuming, of course, you know what you’re doing). Thanks Zhivago.

Sometimes you need a cast, like with printf-whimpers. For returns? not very often.

it may be.

hello

the other reason that a cast is a good idea is to indicate to the reader that you really did intend to do such a stupid thing hello libra

Heh.

yeah, sometimes that matters ;-)

could just add a comment…

/* Yes, I really meant to cast Dr.Suess as a double */

is it possible when i send a struct whithin struct point over an tcp connection via write() that bytes of integer variable get rotated??

I prefer code over comment, as it keeps in sync. only if you rotate them, and sending a raw struct is a bad idea.

well, I was thinking of your cast /plus/ comment

why do you expect the other end to have the same shape for the struct? well, nothing wrong with comments — I just prefer to use code elements where possible

understood

in the comment I would put the reason for it.

yup

when the integer i = 5 … and i print it with printf(”%08x\n”, i); i get 05 00 00 00

In the words of ol’ top “Iffin’ you do /not/, ‘Many Bad Things will happen to you’”

conso : you are mistaken. you might become american

I take offense to that.

one never tempts Fate by crossing First Sergeants w/ over 20 years in-service.

you’re a First Seargent?

you take offense at people becoming american?

no, I meant Top

chortle

ah

are you american?

Not only was he over 6′ tall, texan and such.. But, the service has so /many/ wonderful ways to ruin yer life.

fortunately not.

see? that’s what offends him

I’d hate to meet someone whos fortune was based on their nationality, how shallow.

not being american offends him?

no your condescending “fortunately,” at least that’s what offended me

please learn how to spell “whose”.

no, I’m used to it. To me it has a “hot topic” sense of humor.

lol

well, if I were american, then I couldn’t become american, could I?

i think you’re missing the point here…

no need for a debate on this though he was baiting anyway

true

he’s bitch-baiting ;-/

lol

I wish you -were- American, so you could help America suck less.

are you calling those two bitches? like osama?

z, you’re on a roll z, a unicyclic one :P

nope. It’s a term from the fun days of #2 sons first wife. Ahh, she was so /easy/ to bait.

I think America should concern itself less with Osama and more with dangerous morons like George W. Bush. But that’s just my opinion.

well, they’re both on the same team.

here we go :-)

(he’s saying they are gay)

I know. I agree.

well, that would be an improvement.

nothing improves government like the contradiction of irc politicians.

lol

hmm, that must be american wit.

you can tell by the “twang”.

Germany had a SOlution once.

you must be european

well, time to watch sex and the city must I?

yeah, it’s the snippy attitude

zhivago, there is only the US and europe; didn’t you know that?

well, I’ve never accused americans of geographical atitude.

aptitude?

I think Zhivago is Australian. Australia = Mini-America.

what about commi-nazi-islamofascististan?

titter

crikey mate

huh australian? well then my apologies

I promise I’ll do my part to hopefully make America suck less during the next American Presidential election, but I can’t promise anything. The oceans of morons here might elect another complete fuck-up. uI promise I’ll do my part to hopefully make America suck less during the next American Presidential election, but I can’t promise anything. The oceans of morons here might elect another complete fuck-up./u

and, of course, the wonderful Electoral College thing

just re-elect bush

america should assassinate more of its political leaders

actually, I’d prefer /all/ politicians to go that route.

cheers to that

..then, we start on lawyers

is that a political statement?

sweet

what is?

poppavic wants anarchy, big gates and bear traps

if only anarchy were stable

nah, just a lovely, reoccuring daydream

I think it might be if we could build a god.

an ai

Zhivago That’s me! I am Jesus!

isn’t that a dictatorship

Bow down

not if you do it by description rather than prescription.

theocracy has been done

theocracy doesn’t require a god.

Thankfully, American law prohibits Bush Jr. from being elected for a third term.

well, that’s just a piece of paper.

Teckla, we have already trampled the UN. what does that matter

I think a 3rd term would work wonders.

It doesn’t matter /what/ gets elected.

We should change the law so that Bush can be re-elected. Too bad Jeb isn’t running!

What do you think it would do?

heh

I’m all for the UN… Going elsewhere.

I’d vote Bush. All the way!

it might produce a situation where civilization might develop.

america’s big bang

Please elaborate

Teckla, you are a fool

go watch tv, yer giving me a headache

well, before you plant your beautiful roses, you need to plough a furrow and add manure.

icmp Don’t abuse him.

abuse–;

Zhivago you were saying the other day another election of Bush would destroy us or something.

Well, it’s very likely we’ll get another complete incompetent like Bush, during our next presidential election.

well, how else do you expect to develop civilization?

I commend you for dealing with such brash tactics for so long.

well, I suspect that the next president is going to be in a lot of trouble.

Why is that? I mean, I agree, but I’m wondering why -you- think so.

it’s the same shit all the time. I’m too old to care much anymore, but it fucks up the channel.

haha

well, the US has lost most of its soft and hard power, it’s out of money, and it’s annoyed a lot of people — the infrastructure is undermaintained, and critically vulnerable on oil price fluxuations. the income distribution resembles a third world country, and so on. it really needs some deep structural renovation — the only man who might do that is Gravel, and he, fortunately, doesn’t stand a chance.

Zhivago lies Zhivago We still have power. Zhivago We always can print more money.

OK. I agree with most of that.

you haven’t heard of inflation?

Zhivago Who cares if we annoy ppl. Fuck them.

You can whine about Bush (seems like an easy target when you don’t have solutions) all you want, but the world problems existed well before his time. This has been developing since well before the Iranians took hostages at the American embassy. Bush isn’t the cause of all this. But I supopse it’s fun to make fun of him instead of focusing on the longer running problems.

And there is nothing wrong with our infrastructure.

I don’t know who Gravel is, so I’m unable to agree with that part, heh.

absolutely, although I think he’s brought it forward 10-15 years.

Zhivago I wont tell if you don’t Zhivago didn’t you see that 207 Million we just got from the Drug dealers?

with a competent leader it might have gone through another cycle. 207 million is a drop in the bucket.

how do i test the type of a variable?

sure, but it helps

like check if it is an int or not

you don’t need to check, since you already know.

America had problems before Bush, but I think extra whining about Bush is justified. Bush and his republican dominated congress are responsible for a full 50% of the national debt. By themselves. In just a tiny handful of years.

you don’t

That deserves a little extra dislike of the man and his methods, in my opinion.

err, i mean i need to double check to see if the user entered a valid type

Bush has done the right thing. We will win the war in Irag. Then we will go after Iran.

how does the user enter a type?

It’s not that simple.

i.e., make sure they didnt enter a decimal value instead when the program is asking for an int

Xgc I agree with you.

thats what i mean

sounds like a parsing issue …

please explain

The indebtedness of our nation will play a large role in how quickly and painfully we fall from economic power.

The problem is the democrats want to raise taxes which will raise the debt even more instead of promoting spending.

please be more specific. that logic is fallacious.

Zhivago not really You lower taxes you get people to spend money.

historically speaking, raised taxes often increase wealth.

ok i need a program to promp the user for a positive integer gereater than 1… so i need to set up error checking to make sure they dont enter any decimals (i know how to check for negative numbers)

These forces have been in place for a long time. It’s a complex system that Bush certainly doesn’t control.

Zhivago Exactly becasue people save their money.

well, think about what strings you want to accept …

I’m glad you agree with me.

data values are different than type; sounds like you want to validate input

what are you babbling about? please include logic.

well pretty much any integer 1

Teckla is making the assumption that the president is anything more than a figurehead.

people tend to want to save money when they are insecure — which is why chinese people save so much.

so 2347239847298572128974912758978512957128957892347528947281934789 is valid?

_string_.

Nonsense. The Republican war on any and every tax, coupled with the Republican approach of not reducing spending, but insanely increasing it, is a deadly combination.

Economic power swings are beyond the control of the president, unless you want him to attack China.

Zhivago You lower taxes and people let go of more of their money, they spend it, thus increasing jobs, etc etc.

what goddamned strings are acceptable?

i think thats too large to store in an int… but otherwise it /could/ be

no, that doesn’t follow.

Zhivago right Zhivago sure it does

ah, so you want to allow the user to enter any integer between 2 and 32767?

Go ask an economist.

erhm, string? but its asking for a number

people save less when they feel more secure — tax rates have direct relationship with security.

yeah

kawfee is a moron. You’re arguing with a retarded child. Just so you know.

I think we can agree that spending is a problem. But don’t try to make that a republican-only issue. Be honest.

don’t abuse kawfee

maybe i will use a long int

er, I meant “have no direct relationship”

Zhivago Right, so when the mortgage rates were lowered and everyone bought houses they were saving? Yeah, you proved your point.

then you should read it into a string (probably with fgets) then use strtol to verify it’s a valid long.

It just so happens that history (finally) proved Republicans are the MOST fiscally irresponsible group, not that they’re the ONLY fiscally irresponsible group.

fgets + sscanf may help

no, they bought those houses because they were largely tricked into feeling secure enough not to save.

We are over taxing and over spending. I think we can agree.

I do agree with that.

pizza_: thanks… though we havent learned fgets or sscanf in this class yet so im not sure if we’re supposed to be using them

well what have you learned?

I guess my point is that America’s Republican party is no longer a Conservative party. And haven’t been, for a long, long time.

Both parties are dead set to continue that effort.

so far we have just been using scanf and printf and if statements, basic loops, etc

there should be lots and lots of parties :[

scanf can be made to work for the sake of your class, though i’m not a fan of it in general

I’d suggest that the fundamental problem is that the average american has a vastly exagerated estimation of their ability to compete with their colleagues.

If you’re going to spend far too much, though, you may as well -at least- try to pay the bill each month, rather than continuing to jack up your debt load.

you could maybe get away with using scanf, but it will take work to correctly deal with errors. look into the return value of scanf.

Correct. The democratic party used to be very conservative. It would be nice to return (both parties) to that mindset.

pizza_: got it… thanks

Teaching virgins scanf() is criminal. Damned fools. Some of those “teachers” need to get out of education.

hi all

s/some of those/most

which library is appropriate for rc2 encryption?

Right. I often tell a colleague of mine that I think both Republicans AND Democrats would ultimately destroy this country, it’s just that Republicans will do it FASTER.

folks are not even going into teaching anymore. teach/pitch

Zhivago Maybe. Zhivago A lot of idiots did buy houses. We are seeing that problem now.

do any of the standard linux web hosting libraries have an rc2 encryption implementation?

a lot of people were told lies about it being safe.

Zhivago Not really, it’s just that they saw a low rate and their montly payment was low so they thought they could afford it. They got into the house and then they mis-managed their money as usual.

It’s too bad the democrats don’t have fellows like Newt to keep them focused on proper priorities. I have to give them credit for fooling a good cross section of the country into thinking the conservatives are bad people who just want to take away lunch from your school kids. It’s too bad many people fall for that rather childish illogic.

http://www.mirrors.wiretapped.net/security/cryptography/algorithms/rc2/rc2.c

Gravel seems to be the old honest voice around

Heh heh. With all due respect, you must be a Christian.

excellent, icmp_, thank you

hmm, what does being christian have to do with that sentiment?

Am I correct?

I was brought up in a family was weent to church (a cristian church). I currently keep my distance from the church.

which flavour?

Sorry. That sentence was not edited properly. We went to church as a family. I currently don’t, for many reasons. I’m not talking about christian values here.

Zhivago Americans mis manage their money. The lower class even so more. Not all of them but they aren’t known for making wise decisions.

nope, but it shouldn’t be hard to find an example implementation

just assign them good european managers

I suppose. They just need to be educated.

I’m talking about constitutional issues more than anything else.

We have like a 30% HS drop out rate around here. Zhivago They need a good Jew to control their money for them. =] I could show them how to live on 10k a year and save the rest.

well, they’re too busy running the banks

I’m curious. Why would you think being christian has anything to do with my comments?

Xgc His logic does not make sense sometimes. He assumes quite a lot.

I’m not sure there’s a way I could explain it without sounding insulting.

way to side-step that landmine

He thinks pure capitalism will destroy the class system but he has no proof.

I’m curious, too

The question alone sounded insulting, to be honest. We weren’t talking about religion, just a bit about convervatism. Spelled correctly would be better.

I apologize.

No problem. It just seemed a strange transition.

haha On efnet they would say they are right and then threaten to ban you if you questioned them about it.

Over the years, I’ve just picked up on subtle clues that more often than not help me predict who is and who is not a Christian.

I love this place.

Your EFNet #c ban is NOT mine.

Why is efnet #C full of insanity? I mean, even more than freenode’s

it’s efnet.

Teckla hrm, I thought you had me on ignore. Teckla yes, I got banned for saying, “I fuck girls for a living.” we think Gambit- did ti because he can’t get any from his wife

In that case, I fully agree with Gambit-’s decision to ban you.

Got something againse Jigalos? I gotta have a job somehow.

Topic drift is one thing. Outright stupidity is another. You deserved the ban.

nope

that’s professional discrimination to ban you for describing your job

Nullo asked me what I did for a living. I HAVE LOGS! PoppaVic Shoot me please. Ok, I mis spelled. Gigalo.

The ops on EFNet #c have historically tolerated too much stupidity, in my opinion. It has somewhat snowballed over the years. Idiots tend to attract more idiots.

ah, right oops

I have questions about many things and very few answers. Much of religious history seems based on pure fear, misunderstanding and the need for power. I have trouble with much of that. I also have trouble with the scientific community who over the years have proven how badly they can get it wrong, while swearing to you that they are right. Politics often seems to follow a similar path. Personally, I think Newt is in the better direction. Shrink government/taxes and stop trying to fix everything for everyone. Government was not meant to be the solution to every problem, at least in the US.

#define str(x) #x , then str(2) returns “2″ right ?

Xgc Yeah that is the problem. People, especially poor people think gov should do everything for them.

move to New Hampshire

Dems side with the poor. Republicans side with rational.

 

Secure Domain Web Host!

 

s/rational/rich

not really, Middle class side with republicans too, some of them I am sure there are poor people who side with the Republicans too. The smart ones. The other ones just go “GIMMIE GIMMIE GIMMIE. YOU OWE ME!”

What we’ve now built is a system that has communities screaming about not getting enough government assistance and those same communities somehow find the need to build giant high school football stadiums. What’s wrong with this picture? The waste is extreme and it stems from the government having too much of our money to pump into these unnecessary projects, most of them we will never hear about.

Xgc Exactly Xgc They are building a multi million dollar stadium right down the road from here and this is a very small town. But then again this is Texas and everone and their mom loves football.

stadiums are cheap and look impressive.

if #define str(x) #x , then str(2) returns “2″ , right ?

I question Newt’s morals too much to trust him.

Zhivago I don’t call over a million dollars cheap. especailly when it is behind the school and you ca barely see it. can

that’s because you haven’t mastered basic arithmetic.

It’s apparently a basic human right to have a high school football stadium for every community.

Zhivago 2+2 = 5 right? For large values of 2.

let’s say you have 10,000 people — how much money do you need from each of them to get a million dollars?

Zhivago They don’t do that though. They pass bonds to build them.

answer the question.

And a lot of the people around here don’t have much money We have 17k ppl here

so, answer the question.

13% below poverty ok one second

can’t answer the question?

median income is 42k one second damm it

it shouldn’t take long to answer that very, very simple question …

$100 I know I can only do calculus in my head

:-/

so, it’s just $100 from 10,000 people each to get a million …

Had to use my fingers

what’s minimum wage?

5 something

$5? that’s 20 hours.

heh

so that’s 200,000 minimum hour wage-hours.

yeah, but the people who pay minimum wage wont be paying for it

a million dollars is peanuts.

The property owners pay for it. And it is more like 3 million or something. Let me look.

irrelevant — the problem is that your brain is warped if you think that a million dollars is a lot of money when you have even a relatively small urban region.

Zhivago, I think the point kawfee is trying to make is there are more worthwhile projects availible, in a round about way

depends on what you want to achieve. stadiums probably give you the most bang per buck — they’re large, obvious and cheap.

Zhivago Not really. $300 is a lot of money to me.

I suspect “the people in charge” in America want sports to play a big role in America, in order to keep us in a “competition mindset”.

see — your brain is broken.

Is not. I am Jewish! This is how we think.

$300 is a lot of money for you because you’re one poor person.

Shit. I have everything I want.

Odif, imho the whole point of the discussion was whether the government is just another social services bureau or a solution to all your problems, large or small..

I have a car, a house, the biggest pool in the area a pier going across it, I have a boat and I have an education from the best University in the area and one of the best in the State

so, why do you think that $300 is a lot of money?

On top of that stock and savings. Zhivago cause it is. That’s like a months worth of food or a months rent. I could buy an xbox with that.

why do you think that that’s a lot of money?

Why in the fuck would I want to pay for a stadium that I never go to? Zhivago It’s a waste. Any money wasted is expensive.

redrod__, the government isn’t an all round solution. Of course it’s in the nature of a democratic gov’t to sway to the sides of the majority, it’s tough luck if you fall in the minority. If you expect the gov’t to solve all your woes than you have a major problem

so you’re saying that $300 is a waste of money?

no

please try to be coherent.

$300 spent on a stadium is a waste of money. It will never bring that revenue into thge community.

depends how long and how much effort it takes to earn £300

and it isn’t $300

so, why do you think that $300 is a lot of money?

It comes out of my property tax.

Nothing that deep. It’s an inflation of what is necessary. A school that can afford to build anything beyond that which is necessary to provide a basic education should not receive any government support. We can’t keep using resources like this. It’s not just a football issue. These decisions have global impact.

Odif, me knows. I just wondered how the topic shifted from this question to the average income discussion..

Zhivago Why do you think it isn’t?

Zhivago, of course he is. Any money that doesn’t go to a cause he supports will be a waste of money. That’s acceptable, I think he’s just upset that other people are getting to spend his money

how long does it take to earn $300?

redrod__, not sure I fell in halfway through it seems

3 hours?

o.O

O_O

do you think that three hours is a long time?

Yes.

:-/

hi all

Don’t you? They just passed another bond for 100++ million.

no, I don’t think it’s a particularly long time.

fuckers

If I were forced to spend three hours building some stadium I’d never use or see again myself, I’d be quite upset

Zhivago What if you only lived 3 hours?

what if you were capable of forming a coherent argument?

Zhivago What is the most precious thing you own?

kawfee, the needs of the many outweigh the needs of the few. It boils down to that. You’ll fall into the many on some issues, some you won’t.

Zhivago Then you wouldn’t be able to understand me.

so, what’s your share of that 100 million?

no newline at end of file. That is my first program. Help

Odif Fuck everyone else.

kawfee, what country are you from?

USA

perhaps the problem is that there’s no newline at the end of the file.

Add a newline at the end of the file.

They don’t do anything for me, why would I do something for them?

ok i try

C source-file lines are newline-terminated, not newline-separated

Americans are assholes.

Some.

They don’t do anything for you? Ha. kawfee how seasoned are you at life?

They all think they are better than anyone else. You say hi to them on the street in the city and they look at you funny. You get a job at a corporation and they treat you like a slave. The only safe place is a small town and that is being ruined by all the cities around it.

ok! That was compiled, thank’s so much!!!!!11

Can you take it to #rants, please?

I’m curious, why did you not understand the error message?

All the peoples of the world would get along better if everyone would simply realize that being an a-hole is a universal thing, not specific to just one group or country of people.

Odif They have done _nothing_ for me. The only people who have done anything for me are friends and family.

maybe those people you said “hi” to (1) thought you were a fraud, conartist, thief (2) have issues (3) have poor social skills most probably all three

Zhivago I dunno, it depends on how many years.\

are you a darkie?

heh, a “painted man”

….”darkie”? This is getting out of hand.

Chris because when i read “newline” i wrote printf(”\n”) at end of file but dont work i’m a noob

kawfee, save your argument for somone who wants to listen to you rant about how life sucks because you don’t get what you want. I’ll half take Baughn’s advice and take myself elsewhere at this point.

ah, best read your book more

well, he’s in texas, iirc.

Odif I always get what I want. =]

uhuh

Odif I have everything I need to live life and then some.

uhuh

yes i know “rdfm”

Zhivago What’s that? black?

:P

Sometimes I think a course in macroeconomics should be obligatory at the high-school level

it is a place populated by queers and steers.

No.

that would be nice.

I am straight as an arrow. Baughn It is at Uni. We do have a lot of steers around here. Zhivago I thought you were suggesting I was black. hah

Not everyone goes to uni. (And it isn’t around here)

I wasn’t suggesting — I was asking.

Baughn Right. It’s quite sad.

A tiny understanding of macroeconomics would help *so much* in letting people understand what’s going on.

Well I am not, thank g-d.

What’s sad?

Baughn They everyone isn’t well educated.

Education != university. We do need trade schools, and not all humans are created equal.

If I were black I’d probably shoot myself.

christ…

oh wait, if I were black someone would shoot me around here

well, christ was kind of dark, I guess.

Zhivago I think you are right.

And now, it suddenly becomes clear to Freenode ##c exactly why EFNet #c banned kawfee. At least, I hope it’s clear.

Teckla Doubt it. Free speech. Teckla I said nothing wrong. I just wouldn’t want to be black and live in America. Too much racism.

Of course, attitudes like yours is probably /why/ america has such a vast deficit of tradesmen

And now you’ve also demonstrated you don’t understand free speech.

Baughn What attitudes? That everyone should be educated?

bloody hell

Teckla Sure sure. That’s why you shouldn’t be on the Supreme Court.

kawfee, actually, your open racism is off-topic. the fact no one has reported you, that you haven’t been banned or kicked, is luck

Free speech means I can say whatever I want and not be stoned to death for it.

That everyone should have a highly theoretical university education, regardless of whether they are well suited to it or not. Though I realize that’s not what you said - generalizing a bit here, I guess.

you can be banned for it.

Cin I am not racist. I have nothing against black people.

Is it just me that has kawfee pegged as kid taking enjoyment out of trying to wind people up?

bah just end it now I don’t feel like continuing this conversation.

kawfee is perhaps the opposite

Zhivago way to stay subtle.

Baughn, what macroeconomics ? keynessian, monetaristic, neo-austrian, neo-marxists, macroeconomics of french physiocrats or … ?

Baughn There is nothing wrong with being educated and being a tradesman. In fact I was educated and I am now doing carpentry work, on my house of course.

I prefer planned economy anarchy

oh planned economy is not very cool i have lived in something like that for long time

Practical. An oversight of how the economy is actually being run, and why decisions that have in fact been made were made.

but i am afraid pure market is the same shit

that’s just because the planners weren’t intelligent enough.

There wouldn’t be /time/ to go over theories other than mentioning that they exist, but that’s not as important eithr

to make a planned economy work, you need to build a god.

Zhivago, or veryu strong AI

I’m working on that

same thing.

treu

I’m not sure that we need an AI, exactly. but we do need to get some super-human intelligent happening. we’re just too stupid for anything particularly good in terms of economics.

We could use it to correct our spelling and grammar in real-time.

hardly, intelligence of average human if i properly read stuff hasn’t changed in centuries, maybe milleniums

do we actually know how to measure intelligence?

no we don’t we don’t even know what intelligence is

that’s why we need to build it.

let alone measure it

so assertions about how it has or hasn’t changed is kinda meaningless. :-/

especially in this context

ThunderChicken, well, that is true i should have said IQ hasn’t changed

well, you can measure intelligence in this context in terms of the size of the communities that we can personally interact in.

which could or could not be good measure for intelligence

difficult assertion to make.

IQ tests have only been around for a hundred years or so. And the average is *defined* to be 100.

IQ has changed significantly over the last decades.

zhivago, i wonder if the ethics of making an intelligence to do that would be a nonissue where engineering a child from birth for the purpose of controlling economy would be “immoral”

life may be defined by intervention/interaction. But intelligence surely isn’t.

why not depends on your morality, I guess.

kawfee.

e.g. children can be taught to do massive arithmetic calculations. perhaps it is possible to teach them to be very talented in economics

only kidding @ kawfee

What did I do now?

perhaps, but consider what economics really is … approximate methods for determining how resources should be directed

mhm

if you could manage to be sufficiently aware of a sufficiently large social group’s needs and resources, then you could deal with it directly

and what do you do when the group’s needs is not covered by the resources?

or the group’s need is illogical

get a larger group, or change it.

“The Great Computer Has Declared That We Are At War.”

Engineering a child to do that would be.. questionable. I’m not sure it’d be immoral, because I’m not sure what the best basis for morality is.

Zhivago, and that is problem, because you need at least define what is the most effective allocation of resources and that is - without free market spontaneous order blabla invisible hand bla - very very hard itself - and it is subject to moral judgements imo anyway so even definition is imo problem which can’t be solved “properly”

What if it really liked it?

what are you babbling about?

What if we engineered an intelligent, talkative cow that really looked forward to being eaten?

zhivago, are you thinking of some sort of omnipotent watcher that sees everything to do with the social group? akin to someone playing an RTS game, managing the resources because he knows all

that’s why you need to engineer something smart enough to do a decent job of it.

Classical problem of assigning broad decisions to an AI.

ideally one would just extend everyone’s awareness sufficiently.

Solved easily enough by using external reference semantics

otherwise, one might build a sufficiently smart machine which could give people advice.

Baughn, i have no concept of morals; maybe i lacked the indoctrination as a child or something. i don’t get how people define them so absolutely

There are some problems for which there are no optimal solutions.

there don’t need to be optimal solutions.

The problem is, if we make the computer want what we want, we might find out that what we want is distinctly suboptimal when carried through to perfection

morals have to do with sex, ethics deal with money.

Though then we wouldn’t want it, I guess. Eh.

Baughn,

hmm, is it possible to detect file holes in a posix environment in a filesystem independent manner without resorting to searching for sequences of zero bytes?

hi

Not generally. Why do you want to?

guys, do argument conversions occur even if I have a prototype?

you could measure the length of the file against how much blocks it uses … implicit conversions.

If the filesystem is done right, the answer should be “no, never”.

I want to rsync a bunch of files to another system, and don’t want all my sparse files taking up a lot of space on the target disk

you mean char to int?

You could always use a timing attack.

heh.

no.

which one then?

you’d have to ensure that it’s not a multi-user system, I guess.

Use the -S option to rsync

I believe that rsync does that by simply only writing non-empty blocks.

ah, cool I was searching the manpage for hole I should’ve searched for sparse thanks

No, it’d work pretty easily even on a multi-user system. A trivial application of statistics.

I wonder what the rationale is for not enabling that by default?

lots of little writes, potentially, I guess.

yes, true

Morals are *hard*, but I have to think about them. Even if there is no universal morality, even if the /definition/ of such a thing - what properties it would have - looks a lot like a computer virus (or a BLIT), the morals we implant into the first AI are going to be important to our future. I’d prefer to use mine, but.. first I have to figure out what mine /are/.

yeah

just have it help people do what they want to do

There’s no way for rsync to know the blocksize, so it has to fseek past /every/ run of zeros larger than some very small number

indeed; the “absolute control” thing tends to be a given when people talk about an AI, for some reason. it shouldn’t necessarily be so imo

Okay. I want to turn the moon into an ad for my university - is that okay?

hmm, fstatfs()? sure, why not?

What do you do about conflicts?

of course, it would also help people who didn’t want you to do that. well, those are between people.

There has to be some sort of conflict resolution, and I don’t think “whoever asks first” is a good one

no, there doesn’t. all that it needs to do is to be able to give advice. that advice might help you to know how to do that, but you still need to procure the resources.

No physical presence, then?

well, to keep it non-prescriptive, yeah.

Part of the reason I want AI is to stop crime

stopping crime is pretty easy.

i think some morals can be explained. like ones to do with torture; i think it is half-rooted in sympathy

Sure, if you don’t care who gets to define “crime”

it just requires some farsightedness.

As in, programming the AI with morality. There we are again.

no. you’ve left logic behind at some point — rethink it.

dear computer, how can we stop teens vandalising parks and property? introduce fines to the parents of those teens, … etc.

start by working out why they’re doing it

an AI could be put to much better use.

sure, introducing fines might be a good approach. such as?

engineering dna, etc.

because they are bored or lack interest/motivation in real hobbies, or lack real public resources or places to goet etc.

those aren’t particularly difficult problems — humans can manage that.

enslave teens in virtual world and give them own instance of parks.

it’s difficult to catch them in order to issue fines

not yet.

what humans don’t seem to be able to manage is dealing with more than 150 other humans directly.

so we should teach an AI how to party? if that’s what you are suggesting, this has a rather disney plot.

I don’t know what you’re babbling about?

I’m taking this conversation, and the past hour, as seriously as it needs to be.

zhivago, leading to separation/partitioning and introduction of hierarchies, i would say

what does ‘partying’ have to do with anything?

Now I’m going to code, ..

yes — we lack the intelligence for a stable anarchy.

hierarchy just reduces the number of humans that the ‘leader’ has to deal with directly.

but if we could figure out why those people wanted to vandalize things, maybe we’d agree with them. or maybe we’d give them what they want.

indeed

what about the lack of resources? a typical society doesn’t have enough resources to satisfy everyone’s needs

imo “clever” people are good at reducing and simplifying large problems into smaller problems. because most realistic problems can’t be tackled all at once

zvrba, what about it? it sounds like you’re making Zhivago accountable why societies break s/why/for why/

no it doesn’t

i’m not making him accountable. i just ask a practical question even if we had a perfect AI that could manage large groups of ppl, we’d still have to find resources to put its instructions to practice

dear computer, how do i let this girl know i like her?

i would assume the AI’s job would include giving advice about how to manage those resources effectively

kill Sarah Connor.

pizza_, ha

yeah, global optimization problem

a typical society has a huge surplus of resources.

but resources are not infinite they are just used very innefectively?

for example, we could easily feed everyone on the planet properly, right now.

yes, i know that

or owned by people who want to keep them

they’re not used effectively, or with long term goals in mind.

“Infinity Hold”, Barry B. Longyear, isbn 0-445-20952-6

(5% of the world’s population being richer than the rest or whatnot) oh 2% own half the wealth

there’s nothing particularly wrong with that — it drives investment, but the intelligence is still lacking.

indeed. i’m not saying there’s something wrong with the ownership, but what is done with it

the goal of human society is not to help everyone out, it is to control everyone else.

the goal is to reproduce

who decided that?

human capitalist society, i guess, sure

and to survive genetics

the problem with controlling people is that it’s expensive.

if we exterminate ourselves, we’re just another failed evolutionary experiment

if you can get what you want without controlling people, then you can do it more easily.

why expensive?

when i think of capitalism i think of an image of an eiffel tower-like shape, where all the resources are being sucked upwards from the bottom to the top

it’s the basic master-slave problem. a master needs to model the slave’s state. and synchronise the slave’s state when it drifts.

in order to be able to manipulate it?

sure.

those with the will to do so.

yeah, but they’ll lose out to those who don’t.

and modeling and synchronization takes resources. ok, i get it. why do some people want to be masters?

because it is a short term winning strategy.

“It’s Good to be the King”

but not so good long-term strategy

that’s why dynasties tend not to last very long.

slaves rebel sooner or later and then everyone is at loss

a couple hundred years is pretty good going.

this channel can be disastrous to productivity… too many interesting discussions i have to leave now.

bye bye

windows actually has an idle process?

pid 0, apparently

http://pastebin.com/m34472fc8 how do I write the sizeof statement?

sizeof (*var_name-first)

!don’t !dontcast damn

sizeof *var_name-first

how should I do it without casting?

!dontcastmalloc

There is no need to cast the result of library functions that return void *; it makes your code hard to read, adds no value, and can hide a bug if you don’t have a valid prototype in scope.; see http://www.cpax.org.uk/prg/writings/casting.php

i just added parens to emphasise it was code

thanks

you probably need to include stdlib.h

I think he’s got further issues shrug

tell me

where’s your book? @cdecl char (*first)[20]

about issues I may have

`char’

I suspect that is not what you want

no actually a pointer to a string an array of 20 characters

what lib is system() ?

how should I do it?

what does the manpage/docs say?

pizza_ cool guy you’re smart hehe do you know pizza_?

frozen Lidl pizza

Baltazaar, are you jermin?

cout “no” endl;

er, k

Is there anything anyone might be able to tell me about inherited file descriptors after fork(), specific to FreeBSD? I’m getting an odd error that might be accounted for by that For example - might it not inherit all FDs after a fork, but instead close some of them? uFor example - might it not inherit all FDs after a fork, but instead close some of them?/u

You mean, if you use the POSIX standard interface to mark them as close-on-exec?

i386-freebsd-thread-multi-64int 6.2-release for instance

yes. Some might be marked as close-on-fork

fork, not exec.

at least, I thought it was fork

Hmm.. Curious… Is there a close-on-fork flag?

It’s exec

ok.. my bad

Yes; I’ve only fork()ed, not exec()ed. Specifically, I’m doing some dup2()s after the fork, and before an exec, so as to put some FDs in the right places for the child

well, then - it should get them

I get “Bad file descriptor” But, this only happens on FreeBSD. Linux and Solaris work fine

what does POSIX say?

Try OS X?

hmm. weird

Oh, and OpenBSD

hi

hmm.. maybe you need to reorder the dup2’s?

As I said, the same code works on Linux and Solaris, so I’m pretty sure the general approach is OK The only thing I could think of is if the kernel has closed that FD for me without me looking

!testcase LeoNerd

A testcase is a minimal compilable example exhibiting your symptoms. Please paste a testcase at http://rafb.net/paste to help us assist you.

is it possible an earlier dup2 whacked it?

If it works in FreeBSD 6, it works in OS X 10.4.10

No

I dunno why a fork itself would wallop an fd

Well, it wouldn’t. There has to be something else..

Ah… Might be tricky to obtain such

The FD works /just before/ the fork and fails /just after/? Or?

dup2() fails in the child. That’s the limit of my knowledge here.

have you tried without?

Specifically, I don’t have this test box; this is a test failure report submitted to me by someone else I can’t make a new test script without just creating a new version of the library to test; which I’d rather not do

I see. You might ask for strace output - that should be sufficient to figure out what call dos it.

So I’m a bit stuck here.. :/

where is this code?

CPAN :P

9.9

guys, can you recommend a good C book?

!k&r nvictor

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

thanks

hmm.. LeoNerd I got a linux manpage that suggests “A careful programmer will not use dup2 without first closing newfd first”

Ahhhh… Maybe *BSD objects to my dup2()ing on top of an existing one, whereas linux hosting does not In dup2(), the value of the new descriptor newd is specified. If this descriptor is already in use, it is first deallocated as if a close(2) call had been done first. http://www.openbsd.org/cgi-bin/man.cgi?query=dup2&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html ^– Straight from the horse’s mouth

I know it’s supposed to, but…

I just ordered “C primer plus”… Any experience with that book?

!books

books is http://www.iso-9899.info/wiki/Books

http://osdir.com/ml/os.freebsd.devel.threading/2006-12/msg00007.html

Interesting, but doesn’t look relevant

well, it’s the best clue so far

http://www.amazon.co.uk/C-Primer-Plus-Stephen-Prata/dp/0672326965/ref=sr_11_1/202-6853112-4821467?ie=UTF8&qid=1190050566&sr=11-1

hello

Three more chores take a dirtnap

what is the default makefile action for linking? is it $(LD) -o $@ $(LDFLAGS) $^ ??

what’s the difference between rand() and random()?

OK… This is even more weird.. The test that fails wants to dup2(12 to 4)… The previous test was dup2(12 to 2), which worked fine.

telomerex, man rand && man random telomerex, the second paragraph under DESCRIPTION in random(3)

come again?

I’ve been having a careful look over the tests that fail All the ones that pass, do dup2() to 0, 1, or 2. They work fine The failing ones went to 3 or 4.

ok hmm.

I found this in the OpenBSD kernel source: 253 if ((u_int)new = p-p_rlimit[RLIMIT_NOFILE].rlim_cur || 254 (u_int)new = maxfiles) 255 return (EBADF); I wonder if I’m being hit by one of those?

it sure sounds like it.

whats the return value of the failed dup?

EBADF in my case Er.. or rather, -1 EBADF

it doesn’t like the value of newfd in dup2(oldfd,newfd) wait.. I thought you had issues with the /old/ fd?

Well, I don’t know what it has issue with…

is there a similar test in there for the oldfd?

I was guessing it might be to do with the old one being closed, but I have some other test cases, which pass, all using the same old fd 251 if ((fp = fd_getfile(fdp, old)) == NULL) 252 return (EBADF);

hmm

EBADF is returned when newfd is out of the range for fd’s or oldfd isnt open

I wonder if it’s really a ulimit thing after all…. Ya.. But given the other cases work, I suspect it’s the former problem, not the latter

is there a nice, safe, simple way to check both handles?

check the vlaue of OPEN_MAX *value, rather

Er.. isn’t that a compiletime constant?

either oldfd is not “alive”, or the newfd seems to be above the limit !man ulimit

ulimit.h - ulimit(int cmd, …); - ulimit () function will get and set process limits - http://www.iso-9899.info/man?ulimit

OPEN_MAX is the limit.

I’m doing a dup2(12, 4); here… I don’t think OPEN_MAX is in effect…

ahh.. getrlimit RLIMIT_NOFILE

As would be suggested by my first code fragment

man random ?

if ((u_int)new = p-p_rlimit[RLIMIT_NOFILE].rlim_cur …

yeah, but I had to puzzle out where to find the fooker ;-)

OK.. Well, Linux has a getrlimit which knows RLIMIT_NOFILE too…

simon, it says i don’t have man pages for those

I think what I may do is just skip these two tests, if the RLIMIT looks too low

I agree @ open_max is probably not in effect. That leaves another possibility.

I’ve got this nasty suspicion that the oldfd isn’t open

I’m pretty sure it’s fine… I do a sequence of several tests, all with the same oldfd… It’s just two test in the middle that fail Both those tests use fd’s above 2 as the newfd; all the others are 0, 1 or 2

hmm here’s a really twisted idea…

I wonder… How portable is `ulimit -n` for this?

dup2(2,12); /*works*/ dup2(4,12); /*fails, right?*/

Er.. possibly in the other order, but yes. Duping 12 _onto_ 2 works. onto 4 fails.

The Best Website Hosting!