Wednesday, July 21, 2010

Send SMS from your PC or write your own program in Java, .NET, PHP etc to do it

Came across this link today with detailed info on a whole bunch of programs and SDKs that will help you to send and receive SMS from your PC using a connected mobile phone:
http://www.developershome.com/sms/freeLibForSMS.asp

I have personally used Skype to send out SMS from Java although setting it with a Windows Service was not easy.

Some other solutions are listed below:

Thursday, April 8, 2010

Use JSP to get list of running processes or tasklist

I have spent more than 3 hours on this and know there will be more out there experiencing the same problem. There are various pages on the net outlining how to get the tasklist on Windows in Java using the Runtime and Process classes and executing "cmd /c tasklist".

The above mentioned code runs perfectly when executed as a Java app via a main method but when executed through JSP or servlet, it fails to execute.

Here is the problem. When you run a commandline program using JSP, the PATH environment
variable is not the same as when you execute a regular Java app or batch
file. So when you call "cmd /c tasklist" using Runtime.getRuntime().exec it executes with the PATH variable as empty, which means that dll files needed by tasklist are not found.

Long story short, want to get a list of running processes in JSP, use the following code:

Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("cmd /c set PATH=C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem& tasklist");
InputStream inputstream = proc.getInputStream();
InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
BufferedReader bufferedreader = new BufferedReader(inputstreamreader);

String line;
while ((line = bufferedreader.readLine()) != null) {
out.print( line.toLowerCase() + "
" );
}

bufferedreader.close();

You will have to modify the PATH to match your own environment.

If you are having problems executing other commandline programs using JSP or Servlets, chances are that you are experiencing the same problem.

Monday, December 7, 2009

PHP Development on Windows for Beginners

First thing is to set up a Development Environment fast. Download XAMPP from:
http://www.apachefriends.org/

Download the PHP Manual in CHM format from:
http://www.php.net/get/php_manual_en.chm/from/a/mirror

For writing code, there are loads of editors:
PDT (download this for easy installation)
PHP Eclipse (download this for easy installation)
Notepad++ (basic editor, what I use)
Dreamweaver (Commercial, but good to use if you already use it)
NetBeans


Install XAMPP on the root of any of your drives, e.g. C:\ or D:\
This will prevent most of the problems that we come across during development.
Make sure Port 80 is free (e.g. stop IIS) and you do not have MySQL installed or running from before.

Once extracted, go to the folder and double click "xampp-control.exe". Start Apache and MySQL and then go to http://localhost/xampp

To start developing, create your files/sub-folders in the folder C:\xampp\htdocs (assuming you installed on C: root)

The PHP Manual CHM file is probably the best resource I have come across when starting with PHP development. It has loads of tutorials and examples.

Sunday, August 2, 2009

History of Operating Systems GUIs

Came across this awesome list of operating system GUIs today. Just had to share it on my blog. It shows the evolution of GUI design.

Monday, May 25, 2009

Business Intelligence for the Layman

I came across a very simple explanation of what a Business Intelligence solution does for the end user that other existing solutions cannot do. Read it here.

Tuesday, May 12, 2009

How to Evaluate / Audit someone else's source code

Its very normal in a developer's life to be handed over someone else's source code and asked to work on it. The first thing you notice is the fact that the previous developer(s) have not put enough (or any) comments in the code. Then you realize there is no documentation left by the developer(s) regarding the code. You sit there thinking "Where do I start??"

Being faced with this dilemma yet once again I realized that the best thing to do would be to convert the code to UML diagrams so I can get an eye view of the mess.. uh, I mean the code.

I cam across a nice list of UML tools on Wikipedia where I found BOUML.



Its a free UML tool that can reverse engineer C++, Java and PHP (plus some others) code to UML diagrams.

Even if you are not a coder, you could use it to Audit the code. If the diagrams that are generated do not make sense to you, chances are that they will not make any sense to another developer either.

Of course there are many other metrics for evaluation of code quality and performance. But this is where I would start if I had no documentation at all for the code in front of me.

Monday, April 13, 2009

Joomla 1.5 has XML-RPC built-in

Working on a new site using Joomla 1.5 today under the Plugin Manager I found out that it has plugins for XML-RPC built right into its core. What does this mean?? Creating third party software to integrate with Joomla CMS is now going to be a piece of cake.



There are already a lot of 3rd party programs that support XML-RPC. An example is ScribeFire (which I am using to write this blog article). You could use any of these off the shelf tools to easily add articles to Joomla or edit/delete an existing article.

Something I am going to make in the near future is an iPhone app + a J2ME app that will use XML-RPC to easily add new articles to a Joomla site.