Recent content by frankfjf

  1. F

    Java Trying to come up with simple algorithm of significant time complexity in Java

    Hi PF, I'm working on a program that requires measuring how long it takes a given computer to process a certain task, but am having trouble coming up with algorithms that won't take most computers a trivial amount of time to perform. The only one I've got so far is recursively computing...
  2. F

    Java Timing a Task in Java – Find Out How!

    Oh yeah, I figured I would need threading but wasn't sure how to go about getting started on it. This could work well, thank you.
  3. F

    Java Timing a Task in Java – Find Out How!

    Hi PF, I am trying to write a program that utilizes a for loop that skips the current iteration (via continue) if it takes too long (for instance, longer than 20 seconds, else it finishes the current iteration as per normal), but am not sure how to best do this. Does anyone know of a way...
  4. F

    How to properly use pointers and structs in C?

    Ah-ha. I figured it was something like that based on the behavior. Thank you Mark.
  5. F

    How to properly use pointers and structs in C?

    Will do. Thanks. Playing around with pointers and memory seems to be my stumbling block in C.
  6. F

    How to properly use pointers and structs in C?

    Ooh, I think that fixed it! Thank you so much. Now hopefully I can actually get to the multi-threading part and actually get to the intended practice. :P
  7. F

    How to properly use pointers and structs in C?

    Fair enough, but even implementing that fix causes the problem to persist.
  8. F

    How to properly use pointers and structs in C?

    Hello all, I am experiencing some odd output behavior from a program that I am working on: Header file #include <pthread.h> struct ringbuf_t { pthread_mutex_t mutex; pthread_cond_t cond_full; pthread_cond_t cond_empty; int bufsiz; int front; int back; char* buf...
  9. F

    Multi-threading/Structs in C assignment

    Thanks for your help. Oh wow, I had overlooked forgetting to fix the pointer return. Thank you for pointing that out especially!
  10. F

    Multi-threading/Structs in C assignment

    Hi all, Although my homework assignment centers around practicing multi-threading type stuff (by implementing a ring buffer), my question is more centered on trying to figure something out that has nothing to do with multi-threading but nevertheless has me stumped on the assignment itself...
  11. F

    Help with coding my own shell in C, Unix environment

    Homework Statement Need to write my own shell in C for a Programming assignment. It must also support piping, redirection, and appending. Homework Equations The professor provided a preliminary version of the program that supports piping, but not redirection of either input or...
  12. F

    Comp Sci The Longest Increasing Sequence in a Two-Dimensional Grid of Numbers

    Well, after quite a bit of trial-and-error and brainstorming, I've solved the assignment more or less on my own, though I did get a friend's advice on one or two finer points. Thanks to everyone who helped me along on here.
  13. F

    Comp Sci The Longest Increasing Sequence in a Two-Dimensional Grid of Numbers

    But due to the code as-is checking if a potential move would result in hopping to a number that is greater than the one at the current position, the program does not wind up visiting the same cell twice, nor does infinite recursion take place as-is. My problem remains how to change it to go...
  14. F

    Comp Sci The Longest Increasing Sequence in a Two-Dimensional Grid of Numbers

    I understand the proposed fix in theory but am a little uncertain as to how to implement it codewise.
  15. F

    Comp Sci The Longest Increasing Sequence in a Two-Dimensional Grid of Numbers

    Also, I understand about checking all starting positions and streamlining and so forth, but for the moment I'd like to test using the starting position of the posted solution. I can always modify the code to check all possible starting positions later. All it does for me as-written is give a...
Back
Top