So a little update,
I changed gets to fgets and it seems like it will take any amount of comannds piped together, but only if it ends with a redirection operator or else I get errors like:
<COMMAND>: invalid option -- '
where COMMAND is the last command in the sequence
Homework Statement
Hi there,
So I am working on this assignment where the user is supposed to input a variety of UNIX commands and they must behave as if one typed it into the terminal. My current problem lies with when a user tries to redirect the inputted commands to some file. Currently...
Hrmm I think I see what you're saying, basically do a left shift by a byte (x << 4, correct?) and then or it with what the original was? But nothing is being passed into the function, and I need a variable in order to do the left shift correct? I guess I'm still having trouble comprehending...
Homework Statement
/*
* evenBits - return word with all even-numbered bits set to 1
* Legal ops: ! ~ & ^ | + << >>
* Max ops: 8
* Rating: 2
*/
int evenBits(void) {
return ?;
}
The Attempt at a Solution
I have no idea! What I originally thought was that I would...
Okay so for the square root problem, my inductive step is basically that I can use the compass to create a circle, and since we assumed that we could draw sqrt(k) we can simply make two perpendicular lines that intersect at a 90 degree angle, and from the basis we can just mark off one from...
so i was talking to my TA again, and he basically said:
Which is basically dick has said, but my only question is does anyone think they know what he means by pick a point on the outside?
Also, exk, for number two, Since k would be the least element that could not be written as distinct powers...
Ahh I see what you're saying, because we proved P(1) in the basis, and for the P(K+1) case we can draw a diameter of k within the circle, we simply let the P(1) intersect P(k) since we assume we can draw these, and they form a 90 degree angle, and basically apply Pythagorean theorem to get the...
[SOLVED] Couple of Proofs (Regular Induction / Well Ordering)
Hi there everyone, I've been having a bit of trouble of solving these questions, so any help would be greatly appreciated:
Homework Statement
1: Prove, via regular induction, that it is possible to draw a line-segment of length...
I really don't get what you're trying to say. So if I take the elements of the Subset of A and map them to elements of B, making a new subset for B, how does help with the Powerset of A mapping to the powerset of B, as well as creating a bijective function? My only guess as to why you could do...
5'4" and 110 lbs. Yes I am horribly short and skinny. And I'm almost positive my Linear Algebra and Diff Eqn. Professor thinks I am 16 =/ (i'm actually 21).
Hi there, I'm having a lot of trouble understanding this particular problem, and I hope the fine people of this forum can help me out =)
Homework Statement
Let A and B be infinite sets with the same cardinality. Prove that P(A) and P(B) have the same cardinality. Do this by giving...
Do I have do consider the infiite case? I just thought since it stated within the problem that the sets were finite, that was what I should focus. In any case, I will give it some thought and get back to you.
I apologize for the title, I really don't know how to describe these problems, so I just listed the categories that they fall under. Anyways...
Homework Statement
Let f: A->B be a function, where A and B are finite sets and |A| =|B| (they have the same size I believe). Prove that f is...
So for the first one I know that if x = 2k, then I have ⌈x/2⌉ = ⌈2k / 2⌉ which is equal to k right? then (x + 1)/2 would equal (2k + 1) / 2, which can be written as (2k)/2 + 1/2 which can also be written as k + 1/2? so I would have ⌈k⌉ ≤ k + 1/2? Would that solve the even case?
Working the...