Moderators: phlip, Moderators General, Prelates
SpitValve wrote:Often the markers are only a few years ahead of you, so if the mistakes you've made aren't the obvious ones you might get away with it
Rysto wrote:Don't they actually compile and run your code to mark it? That makes it pretty obvious whether you knew what you were doing or not.
Rysto wrote:Yeah, I can see them missing little bugs, but when the vast majority of your code just doesn't work? How do you miss that?
SpitValve wrote:Dammit, why won't you atoms go into the interstitual sites like you're supposed to?
SpitValve wrote:Out of interest, what do you code the microcontroller in? Assembly or C?
open("filename", O_CREAT|O_WRONLY, 0755)open("filename", O_WRONLY|O_CREAT, 0755)OmenPigeon wrote: Yes, thats right, changing the order in which I or-ed the flags was the problem. How does that make sense?
OmenPigeon wrote:Yes, thats right, changing the order in which I or-ed the flags was the problem. How does that make sense?
FiddleMath wrote:OmenPigeon wrote:Yes, thats right, changing the order in which I or-ed the flags was the problem. How does that make sense?
Well, O_RDONLY and O_WRONLY are macros; depending on the implementation, they could be more complicated expressions than just single-bit numbers. (On the other hand, if this is the GNU C libs, this should work fine.) For full POSIX-fitness, use O_RDWR instead.
iw wrote:Here's something that happens at bizarre times at work:
I'm using PHP and occasionally a page will return a completely blank page. When I go in and check each page for errors, I don't find anything. But for some unknown reason, if I go in and re-save an included file without changing the contents at all, it starts working. What the hell?

iw wrote:Here's something that happens at bizarre times at work:
I'm using PHP and occasionally a page will return a completely blank page. When I go in and check each page for errors, I don't find anything. But for some unknown reason, if I go in and re-save an included file without changing the contents at all, it starts working. What the hell?
ZoFreX wrote:Trying to revise a subject with insufficient lecture notes (and insufficient lecture attendance) and realising just how obscure it is... Googling the stuff I don't understand typically returns our lecture notes. Yay.
danderson wrote:Hey, I know the answer to that one! Your php interpreter is hitting its configured memory limit. When php runs into the memory limit, it helpfully sends back a completely blank page and hangs up. The fun thing is that depending on the memory organization and stuff that php feels like keeping around, the crapping out is non-deterministic.
switch(bytes) {
case 1:
return *(volatile u_int8_t*)ptr;
case 2:
return *(volatile u_int16_t*)ptr;
case 4:
return *(volatile u_int32_t*)ptr;
} critical_enter();
switch(bytes) {
case 1:
ret = *(volatile u_int8_t*)ptr;
case 2:
ret = *(volatile u_int16_t*)ptr;
case 4:
ret = *(volatile u_int32_t*)ptr;
}
critical_exit();
return ret;Users browsing this forum: Google [Bot] and 10 guests