Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 C


  What Can We Learn From Dennis Ritchie?

As we noted earlier this week, one of the founding fathers of UNIX and the creator of C, Dennis Ritchie, passed away last weekend. While I feel that many in computer science and related fields knew of Ritchie’s importance to the growth and development of, well, everything to do with computing, I think it’s valuable to look back at his accomplishments and place him high in the CS pantheon already populated by Lovelace, Turing, and (although this crowing will be controversial, at least until history has its say) the recently-departed Steve Jobs.UNIX was one of the first multi-user ...

2,639 0       C DEATH FATHER DENNIS RITCHIE FATHER OF C UNIX


  I've run out of adjectives

The news of Dennis Ritchie's passing hit hard. So much has been written in the past day. His impact was enormous, and outside the tech world, mostly unknown - but very much felt. C underpins everything. My whole career has grown out of C and Unix. Wow.For most engineers working today, it's hard to understand the euphoria I felt in the 70s when a programming language finally came along that I (and everyone else) could use to move up from writing in assembler to a real programming language. We could do everything we needed to do to write all the low-level bits of systems. Before C...

2,593 0       C DEATH JAMES GOSLING DENNIS RITCHIE PRAISE COMMENT


  Using C for a specialized data store

Pixenomics stores and transports 1.2 million pixels from the server to the client. During development we played with various methods to store and process this. Our ultimate goal was to send the entire board in under 1 second.During the stages of prototyping we used a MySQL database without thinking too much about performance. With a mere 2,000 pixels we quickly realised this wasn’t even usable as a demo. Changing the storage engine to memory was much better but still obviously unusable.The problem wasn’t to store the pixels but to retrieve all 1.2 million pixels quickly as well a...

2,589 0       C DATA STORE EFFICIENCY PERFORMANCE


  The most stupid C bug ever

I have been programming for a number of years already. I have seen others introduce bugs, and I have also introduced (and solved!) many bugs while coding. Off-by-one, buffer-overflow, treating pointers as pointees, different behaviors or the same function (this is specially true for cross-platform applications), race conditions, deadlocks, threading issues. I think I have seen quite a few of the typical issues.Yet recently I lost a lot of time to what I would call the most stupid C bug in my career so far, and probably ever.I am porting a Unix-only application which uses tmpfile() to create te...

2,553 0       C BUG COMMENT BACK SLASH


  How Many C Programs Are There?

If I choose a size S, can you tell me how many valid C programs exist that are no larger than that size? I’m actually interested in the answer — it’ll help me make a point in a paper I’m writing. Shockingly, the Internet (or at least, the part of it that I looked at based on a few searches) does not provide a good answer.Let’s start with a few premises:Since it would be exceedingly difficult to construct the exact answer, we’re looking for a respectably tight lower bound.S is measured in bytes.Since it seems obvious that there’s an exponential n...

2,322 0       NUMBER C PROGRA STATISTIC CALCULATION


  The most stupid C bug ever

I have been programming for a number of years already. I have seen others introduce bugs, and I have also introduced (and solved!) many bugs while coding. Off-by-one, buffer-overflow, treating pointers as pointees, different behaviors or the same function (this is specially true for cross-platform applications), race conditions, deadlocks, threading issues. I think I have seen quite a few of the typical issues.Yet recently I lost a lot of time to what I would call the most stupid C bug in my career so far, and probably ever.I am porting a Unix-only application which uses tmpfile() to create te...

2,202 0       C BUG STUPID BUG CODE ALL


  Notes on Programming in C

Introduction      Kernighan and Plauger'sThe Elements of Programming Stylewas an important and rightly influential book.  Butsometimes I feel its concise rules were taken as a cookbookapproach to good style instead of the succinct expression ofa philosophy they were meant to be.  If the book claims thatvariable names should be chosen meaningfully, doesn't itthen follow that variables whose names are small essays ontheir use are even better?  Isn't MaximumValueUntilOverflow a better name than maxval?  I don't think so.      What follows is a set...

2,001 0       TIPS C NOTES


  Exit main thread and keep other threads running in C

In C programming, if using return in main function, the whole process will terminate. To only let main thread gone, and keep other threads live, you can use thrd_exit in main function. Check following code:#include #include #include intprint_thread(void *s){ thrd_detach(thrd_current()); for (size_t i = 0; i < 5; i++) { sleep(1); printf("i=%zu\n", i); } thrd_exit(0);}intmain(void){ thrd_t tid; if (thrd_success != thrd_create(&tid, print_thread, NULL)) { fprintf(stderr, "Create thread err...

1,403 0       MAIN THREAD MULITHREAD C LANGUAGE