you have designed a successful product provided you have done your homework in the designing phase.
Popular Posts
-
The other day I was changing some data types in our schema script and thought of sharing it as it might becomes trickier for some us. I use...
-
One of the basic step before coding is creating the flowchart. A flowchart is a type of diagram, that represents an algorithm or process, sh...
Wednesday, November 19, 2008
Cell Phone E-Mails
How it works, simply write the e-mail message using your computer, cell phone or PDA’s and then look for the service providers email address format from the given below list and send it. That’s all. You don’t believe it then try it by yourself just remember one important thing that the character limit is 120 in this case. If your message contains more than 120 characters then some services providers will send them as two separate sms or they will not send any of it. So to be on the safer side write only 120 characters.
Providers Email Format List:
Alltel
number@message.alltel.com
Ameritech (ACSWireless)
number@paging.acswireless.com
AT&T
number@txt.att.net
Bell Mobility Canada
number@txt.bellmobility.ca (include the 1 prefix)
Bellsouth
number@bellsouth.cl
BellSouth Mobility
number@blsdcs.net
Boost
number@myboostmobile.com
Cellular South
number@csouth1.com
CellularOne (Dobson)
number@mobile.celloneusa.com
CellularOne West
number@mycellone.com
Cincinnati Bell
number@gocbw.com
Fido Canada
number@fido.ca
Golden Telecom
number@sms.goldentele.com
Manitoba Telecom Systems
10digitphonenumber@text.mtsmobility.com
Nextel
10digitphonenumber@messaging.nextel.com
Primtel
number@sms.primtel.ru
PSC Wireless
number@sms.pscel.com
Qwest
10digitphonenumber@qwestmp.com
Smart Telecom
number@mysmart.mymobile.ph
Sprint PCS
10digitphonenumber@messaging.sprintpcs.com
Sprint PCS - Short Mail (up to 1000 character message)
number@sprintpcs.com
T-Mobile Germany
number@T-D1-SMS.de
T-Mobile UK
number@t-mobile.uk.net
T-Mobile USA
number@tmomail.net
T-Mobile USA (Sidekick) (up to 10,000 char message)
username@tmail.com
Telenor
10digitphonenumber@mobilpost.no
US Cellular
10digitphonenumber@email.uscc.net
Verizon Wireless
10digitphonenumber@vtext.com
Virgin Mobile Canada
number@vmobile.ca
Virgin Mobile USA
number@vmobl.com
For this blog I have provided most of the US & Canadian service providers. Let me know if your service provider is not listed here, I can look it up for you. I hope this post will help you to stay in touch with your family and friends.
--Waqas Malik
Wednesday, November 5, 2008
GMU Email System Hacked!
I was surprised to see this message in my GMU's mail inbox with the subject line" Election Day Update" from office of the Provost. The original message is below:
To the Mason Community:
Please note that Election Day has been moved to November 5th. We apologize for any inconvenience this may cause you.
Peter N. Stearns Provost
Soon after that I received another message from the same source but this time this is the original guy from George Mason University stating:
Dear Colleagues, It has come to my attention early this morning that a message was hacked into the system fraudulently stating that Election Day has been moved. I am sure everybody realizes this is a hoax, it is also a serious offense and we are looking into it. Please be reminded that Election Day is today, November 4th.
Peter N. Stearns Provost
George Mason University official Daniel Walsch says "Not many people have that level of access, if we can find out who did it; we will do what we can to prosecute the individual. This is very serious."
I wonder he said "Not many" then what is taking long to figure out who did it.
Read more on Brian Krebs's Computer Security blog at washingtonpost.com
Monday, October 27, 2008
Java’s File Handling Mechanism
In general there are two types of activities that a user can perform on a file, he can read or write something to that file. In both cases he needs to have appropriate access permissions on that file. Some days ago I was completing an assignment in which I have to save some records in the file using java language. The basic task was to create a user account which includes his name and telephone number and then stores it in the text file then later on if he wants to delete his record, delete it and finally prints all the records of the text file. Summarizing the above
- Create a user account (including his name and number)
- Deleting a user account (by name or by telephone number)
- Print records.
You can perform above all three tasks very easily by using java collection arrays provided if you don't have to save these records for a long time. There are two approaches to this problem and I will discuss both of them in this article. Approach one is mine which I have used it for solving this problem which is not a good solution. Approach two is better than the first one and unfortunately I figured it out after submitting my assignment.
Approach One (not recommended):
I took the both the user name and password save it in the file after proper input validation. Everything went well until the user the wants to delete a record from the file which introduces the java file handling limitations.
- Deleting a record from file requires the file to be opened in append mode in my scenario.
- The first file handler has to be closed first (as I am already writing records to the file it is already opened in the write mode access, so I need to close it before continuing).
- In append mode the file pointer will always start writing to the end of file by default which works good as if you are adding more records to the file but not in deleting where the records exists anywhere in the file.
- Once you found the matching record you can't just simply delete it, you can over write it some other string (like replace the account name with "Deleted" and later on while printing just don't display the records with deleted account name.(creepy way but still works)
- Here's how I did it. I matched the user name with my records list and if it matches with my records list means user account exists in database then just save it in a another text file. Later on while printing all the records if the user account name exits in both the text files simply ignore it and don't display it on the screen. (works good for fewer number of records in both the text files)
Pros/cons of my approach: Once I opens the text file in write mode I have to close it before switching it to the another option like deleting or showing records and once I close then I am not able to open it again from the last point. If just opened it in a append mode then it will throws an exception of file not previously formed. So that's why I came up with this approach of having a text file one is the master one with all entries and the other I will create it in deleting mode in which I will save only those entries which the user wants to delete it so for the showing I will just compare these two file contents printing only non duplicate records. In append mode I can only move the file pointer to the opening and closing file only which doesn't help me if the desired deleting record exists in the middle of the file.
Approach Two (recommend):
Take both the username and telephone numbers from the users and after validating the input just add it to string. Java handles string very intelligently and it is easier to append strings in java just by using a "+" plus sign between two strings will concatenate both the strings. The user can anytime perform any function and as the records are still in the memory it will be much faster than fetching the record from the file. While existing the program you can simply save this whole one string of records in the file. You should consider some identifiers and place it in your string which will later on make it easy for record searching like in this example you can place an "=" (equal) sign between the account name and its telephone number and also you can place a ":" (colon) sign at the end of the string to mark the end of the record in the string. These token signs are helpful in searching for the specific records in the string. While searching for account name you know now that the account name starts with the index of that alphabet and it will ends with the index of = (equal) sign while telephone number starts with the index of = (equal) sign and goes until : (colon) sign. So deleting a record not a problem anymore as know you have only string and if that contains the deleting value just split the string until the index of matching string alphabet with the help of java substring function and split the original string once more on the matching string : (colon) sign (remember : marks the end of the string). Here is an example code for deleting a record provided you have both the user account name and telephone
String temp2 = user account name + "=" + telephone number + ":"; // creating the exact record format
String temp3 = original string.replace(temp2, "");// replacing it with null values
Original string = temp3;// swapping the values of original string with the new temporary original string
Now below is the example code in which you have only one value it can be a user account name or user telephone number but the below code is for user account name you have to play with to make it work for telephone number too. It is not hard just replace some values and you are done with it.
String temp2 = original string.substring(original string.indexOf(account name)); //splitting the string until account name. Original string part before the marked account name.
String temp1 = temp2.substring(temp2.indexOf(":")); //extracting the marked account name along with the telephone number.
String temp3 = original string.replace(temp2, temp1); // excluding the marked values in the original string.
Original string = temp3; // swapping the values of original string with the new temporary original string.
I hope I have explained everything correctly up to my knowledge and you have enjoyed reading it. Please let me know if you didn't understand any part and I will be happy to assist you. Let me know your feedbacks on this article.