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

Algorithms

 
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 
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 
Hi Navaneeth,

once again thanks for your reply.

In such cases you may need ask senders to prefix an identifier string with the SMS. So if it is recruitment SMS, format will be REC <RECRUIT> space <NRIC> space <Name> space <PositionInterested>. Here, REC is the identifier. You can look at the starting of message and this identifier will help you to determine the type of message. You can have a valid set of identifiers and validate against it.

Currently this is what i have. I have a database table called "userapp". Below is the schema and the sample data

Userapp
userid(int)
keyword(varchar(50))

103 | Temp
132 | Quiz
150 | Lucky

For each keyword, i have a seperate for them called app_KEYWORD. So it will be app_Temp, app_Quiz, app_Lucky.

try {
    ArrayList<String> array = new ArrayList<String>();
    String firstword = null;
    ResultSet rs1 = null;
    ResultSet rs2 = null;
    int id = 0;
    String sql1 = "SELECT * from userapp";
    String sql3 = null;

    rs1 = db.SelectDB(sql1);
    while (rs1.next()) {
        array.add(rs1.getString("keyword"));
    }

    for (String i : array) {
        sql3 = "SELECT * FROM SMSSERVER_IN WHERE TEXT LIKE '" + i + "%'";
        ResultSet rs3 = db.SelectDB(sql3);
        //out.print(i);
        while (rs3.next()) {
            out.print(i);
            String sql4 = "Insert into app_" + i + "(originator,text)values(" + rs3.getString("originator") + ",'" + rs3.getString("text") + "')";
            db.InsertDB(sql4);
        }
        String sql5 = "DELETE FROM SMSSERVER_IN WHERE TEXT LIKE'" + i + "%'";
        db.DeleteDB(sql5);
    }
} catch (Exception ex) {
}


Above is my code to check the identifier and then store it into the correct database.

So instead of storing just 1 keyword, I have to store the whole sms format in it as well?

Also, u mention building a regular expression, how can i create an interface that allows the user who define the format to have their own expression? What kind of form or fields should i display in order to build it.

Thanks Big Grin | :-D
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 
GeneralRe: Skin color detection help me Pin
kabirbdboy19-Aug-09 14:03
kabirbdboy19-Aug-09 14:03 
GeneralRe: Skin color detection help me Pin
Tim Craig19-Aug-09 20:43
Tim Craig19-Aug-09 20:43 
GeneralRe: Skin color detection help me Pin
Tim Craig21-Aug-09 14:28
Tim Craig21-Aug-09 14:28 

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.