Linked Questions

3 votes
1 answer
3k views

I'm using php to create a USSD page. I've done this before and it was quite the time-constrained hack-job; basically one huge file with a switch statement for all the possible states that the ...
vandiedakaf's user avatar
205 votes
26 answers
107k views

I am crafting a small project in mixed C and C++. I am building one small-ish state-machine at the heart of one of my worker thread. I was wondering if you gurus on SO would share your state-machine ...
jldupont's user avatar
  • 97.5k
19 votes
9 answers
24k views

What is the best way to write a state machine in C? I usually write a big switch-case statement in a for(;;), with callbacks to re-enter the state machine when an external operation is finished. Do ...
Maurizio Reginelli's user avatar
7 votes
4 answers
2k views

I am looking for a way to obfuscate (in the object code) a test - something like what might be done to check that a license key is valid. What I am trying to prevent is someone searching through an ...
Dubron's user avatar
  • 8,681
3 votes
5 answers
2k views

I came up with the following options: Using the goto statement: Start: goto Data Data: goto Finish Finish: ; using the switch statement: switch(m_state) { case State.Start: ...
Niek H.'s user avatar
  • 595
0 votes
3 answers
3k views

I'm attempting to define a state machine for a Java application using Apache SCXML. However, I've run into a problem and I'm not sure if this is due to the SCXML framework or me doing something wrong. ...
user avatar
2 votes
4 answers
964 views

I'm writing a function that is supposed to read a string of numbers, separated by commas. The format of the string is as following: "1, 2, 3" The only "rule" is that the function ...
fishamit's user avatar
  • 265
1 vote
1 answer
945 views

I apologize if my terminology is not perfect, I am a self taught programmer :) My automatic machine has different moving parts, and for each one I have a C file handling its own state machine. Each C ...
Val's user avatar
  • 335
1 vote
2 answers
1k views

I am currently writing a generic statemachine. But I have a couple of understanding problems. Say I have a state A. A transitions to B if a condition is met. A also has a substate A1. A1 transitions ...
Yamira's user avatar
  • 35
3 votes
2 answers
1k views

In a classic version of states, each state implementing some interface. So we can pass execution to any current state class Context { private State _state; public void MethodA() { ...
pavdan's user avatar
  • 51
1 vote
1 answer
1k views

Clearly, states of a machine will be abstracted into tasks, but how are transitions controlled? The functionality I'm looking for is that only one of the state tasks is active at a time, while the ...
Mitch Ostler's user avatar
0 votes
3 answers
288 views

I am trying to create a state machine but am a little lost. Please go easy on me, i've only been coding 4 months. Im using a pic16f18325 and coding in mplab So i think im pretty much there, i know ...
Chronic's user avatar
  • 19
0 votes
1 answer
373 views

I have a sequence of N boolean values. Some of them are dependent on others. For example, if N[0] is false, all the others must also be false. If N[0] is true, then N[1] can be true or false. If N[1] ...
tmoore82's user avatar
  • 1,875
0 votes
2 answers
309 views

I am a bit of a novice with pthreads, and I was hoping someone could help with a problem I've been having. Say you have a collection of threads, all being passed the same function, which looks ...
Max's user avatar
  • 1
0 votes
0 answers
289 views

I work on data processing which works with layered data. The best analogy to my current work is that of network processing. Packets are layered and each layers is processed individually by a ...
flowit's user avatar
  • 1,482

15 30 50 per page