Click here to Skip to main content
15,888,733 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionHelp decoding a friendly message Pin
BillyTed24-Aug-09 13:33
BillyTed24-Aug-09 13:33 
AnswerRe: Help decoding a friendly message Pin
Tim Craig24-Aug-09 15:09
Tim Craig24-Aug-09 15:09 
AnswerRe: Help decoding a friendly message Pin
Ian Shlasko25-Aug-09 7:41
Ian Shlasko25-Aug-09 7:41 
AnswerRe: Help decoding a friendly message Pin
supercat926-Aug-09 12:26
supercat926-Aug-09 12:26 
GeneralRe: Help decoding a friendly message Pin
Ian Shlasko27-Aug-09 8:38
Ian Shlasko27-Aug-09 8:38 
GeneralRe: Help decoding a friendly message Pin
BillyTed27-Aug-09 12:23
BillyTed27-Aug-09 12:23 
Questiondata formatting Pin
benjamin yap24-Aug-09 5:39
benjamin yap24-Aug-09 5:39 
AnswerRe: data formatting Pin
N a v a n e e t h24-Aug-09 7:05
N a v a n e e t h24-Aug-09 7:05 
Assuming NRIC stands for National Registration identity[^].

Do you want to allow users to send SMS in any format or a fixed format? I'd suggest to stick with a specific format something like <Name> space <NRIC> space <Message>. In such case, the following algorithm can be used.
ProcessMessage(Message)
  Tokens = Split message with space
  name = Token 0
  nric = Token 1
  message = Token 2
  if ValidateName(name) = true and ValidateNric(nric) = true and ValidateMessage(message) = true then
     do processing
  else
     inform user or do other actions
end
If you want to have messages in any format, then algorithm like the below will work.
ProcessMessage(Message)
  Tokens = Split message with space
  for each token in tokens
     if token is name then
        name = token
     else if token is nric then
        nric = token
     else
        message = token
  do processing
You may need to modify this to handle exceptional situations.

Smile | :)


GeneralRe: data formatting Pin
benjamin yap24-Aug-09 16:18
benjamin yap24-Aug-09 16:18 
GeneralRe: data formatting Pin
N a v a n e e t h24-Aug-09 16:47
N a v a n e e t h24-Aug-09 16:47 
GeneralRe: data formatting Pin
benjamin yap24-Aug-09 17:05
benjamin yap24-Aug-09 17:05 
GeneralRe: data formatting Pin
N a v a n e e t h24-Aug-09 17:37
N a v a n e e t h24-Aug-09 17:37 
QuestionImplementing Fax Protocol Pin
ran923-Aug-09 1:33
ran923-Aug-09 1:33 
AnswerRe: Implementing Fax Protocol Pin
Roger Wright24-Aug-09 12:04
professionalRoger Wright24-Aug-09 12:04 
QuestionRe: Implementing Fax Protocol Pin
ran924-Aug-09 23:30
ran924-Aug-09 23:30 
AnswerRe: Implementing Fax Protocol Pin
ran925-Aug-09 6:43
ran925-Aug-09 6:43 
AnswerRe: Implementing Fax Protocol Pin
LezWilliams6-Sep-09 15:56
LezWilliams6-Sep-09 15:56 
QuestionHashtable with two tables (Cuckoo Hashing) Pin
Quake2Player22-Aug-09 16:55
Quake2Player22-Aug-09 16:55 
AnswerRe: Hashtable with two tables (Cuckoo Hashing) Pin
Moreno Airoldi23-Aug-09 1:17
Moreno Airoldi23-Aug-09 1:17 
AnswerRe: Hashtable with two tables (Cuckoo Hashing) Pin
Nagy Vilmos25-Aug-09 5:19
professionalNagy Vilmos25-Aug-09 5:19 
AnswerRe: Hashtable with two tables (Cuckoo Hashing) Pin
supercat927-Aug-09 7:57
supercat927-Aug-09 7:57 
QuestionSpace complexity Pin
kirancgi22-Aug-09 6:45
kirancgi22-Aug-09 6:45 
AnswerRe: Space complexity Pin
kabirbdboy22-Aug-09 20:43
kabirbdboy22-Aug-09 20:43 
QuestionSkin color detection help me Pin
kabirbdboy19-Aug-09 6:56
kabirbdboy19-Aug-09 6:56 
AnswerRe: Skin color detection help me Pin
Tim Craig19-Aug-09 13:58
Tim Craig19-Aug-09 13:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.