Tuesday, December 29, 2009

BlackBerry Security Permissions

If you are eager to find out about BlackBerry security permissions and ways to handle prompts following video from BlackBerry will help you in understanding the basics of it.

http://www.blackberry.com/DevMediaLibrary/view.do?name=SecurityPrompts

Further more if you are seeking ways to change application permissions using code, following link will help you to get more details of the Application Permissions class from RIM device API.

http://docs.blackberry.com/en/developers/deliverables/6022/net/rim/device/api/applicationcontrol/ApplicationPermissions.html#PERMISSION_INPUT_SIMULATION

Monday, December 28, 2009

Disabling Date-Time Changes

Do you know that you can programmatically stop the user changing the date and time of a Pocket PC device?

This is useful if your applications need to take time accurately for some reason from the device.

The following code will disable the user from accessing the date time changing settings using his Windows Mobile powered device.





  1. private void btnDisableClock_Click(object sender, EventArgs e)
  2. {
  3.     RegistryKey hklm = Registry.LocalMachine;
  4.     hklm = hklm.OpenSubKey(@"\Software\Microsoft\Clock\", true);
  5.     System.Byte[] offValue = new byte[1];
  6.     offValue[0] = 0x30;
  7.     hklm.SetValue("AppState", offValue);
  8.     lblTitle.Text = "Change Clock Status - Disabled";
  9. }




 

If you want to re-enable the setting, to make the user able to change the data and time use the below code.





  1. private void btnEnableClock_Click(object sender, EventArgs e)
  2. {
  3.     RegistryKey hklm = Registry.LocalMachine;
  4.     hklm = hklm.OpenSubKey(@"\Software\Microsoft\Clock\", true);
  5.     System.Byte[] offValue = new byte[1];
  6.     offValue[0] = 0x11;
  7.     hklm.SetValue("AppState", offValue);
  8.     lblTitle.Text = "Change Clock Status - Enabled";
  9. }




Saturday, December 19, 2009

Boeing 787 - DreamLiner

Boeing's newest plane 787 DreamLiner had made its first flight. As of Boeing this is a great achievement and a history changer.
View the video and lots of other details at New Air Plane and Boeing.

Sunday, December 13, 2009

Disabling Right Click

To disable right click context menu you can use one of the following methods.


Method 1 – Using attribute oncontextmenu attribute of the body tag.
By using this you can block the right click action and the context menu without using JavaScript.





  1. <body oncontextmenu="return false">




This will be useless if you need to do some action on the click. In such a case use the Method 2.

 

Method 2 – Using JavaScript.

Place the following JavaScript and modify the script as you need. This will just show a popup window to the user saying that Right clicking is disabled.





  1. <script language="javascript">
  2.     document.onmousedown = disableRightClick;
  3.     function disableRightClick(e) {
  4.         if (event.button == 2) {
  5.             alert("Right click is disabled.");
  6.             return false;
  7.         }
  8.     }
  9. </script>




Tuesday, December 08, 2009

Finding the Image Format

Here is a small code that I wrote to find the image format of an image.

This code will check for the raw image format of the image you select and will display in a pop up window.

Hope this helps.





  1. using System.Drawing.Imaging;








  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3.     openFileDialog1.ShowDialog();
  4.     Image img = Image.FromFile(openFileDialog1.FileName);
  5.     ImageFormat imgfmt = img.RawFormat;
  6.     if (imgfmt.Equals(ImageFormat.Bmp))
  7.         MessageBox.Show(ImageFormat.Bmp.ToString());
  8.     else if (imgfmt.Equals(ImageFormat.Jpeg))
  9.         MessageBox.Show(ImageFormat.Jpeg.ToString());
  10.     else if (imgfmt.Equals(ImageFormat.Tiff))
  11.         MessageBox.Show(ImageFormat.Tiff.ToString());
  12.     else if (imgfmt.Equals(ImageFormat.Wmf))
  13.         MessageBox.Show(ImageFormat.Wmf.ToString());
  14.     else if (imgfmt.Equals(ImageFormat.Icon))
  15.         MessageBox.Show(ImageFormat.Icon.ToString());
  16.     else if (imgfmt.Equals(ImageFormat.Png))
  17.         MessageBox.Show(ImageFormat.Png.ToString());
  18.     else if (imgfmt.Equals(ImageFormat.Gif))
  19.         MessageBox.Show(ImageFormat.Gif.ToString());
  20. }




Saturday, December 05, 2009

Rapping Flight Attendant

If you have flown in aircraft's you may definitely have heard of the in flight safety announcements made by the flight attendants. But have you paid enough attention to it?
Anyway I bet that you have never listened to anything like this before.

This is David Holmes, a flight attendant of Southwest Airlines who is known as rapping flight attendant who came up with a nice idea.
Enjoy.
http://www.youtube.com/watch?v=rhMOnr0GxU8&feature=related
http://www.youtube.com/watch?v=yiXGm_TiRVQ&feature=related
http://www.youtube.com/watch?v=7P2-vEtXSug&feature=related

Tuesday, December 01, 2009

Remember the Old Days

Thought to add the following photos in remembrance of AirLanka which was Sri Lankas national carrier before being renamed to SriLankan.



Monday, November 30, 2009

Open a Port in Windows Firewall

If you tried to open a port in Windows Firewall which comes with Windows Server 2008 R2 you will find that Microsoft had given Windows Firewall a new look and feel.

At first you may feel that you are lost with the new interface, so thought to show how to open a port.

I will be creating an inbound rule opening the port 1443, which normally SQL Server is using for communications (Yes this machine is having SQL Server installed).

Go to Start -> Control Panel -> Windows Firewall.

Click Advance Settings from the left pane to bring up the Windows Firewall main screen.

Click on Inbound Rules and then right click on the same. If you only right click on this you will only see the options Refresh and Help. First click on it and then right click, now click on New Rule ….

This will bring the New Inbound Rule Wizard.

Select Port since we are going to open a port, if you need to open an application you can select the Program radio button, to create a rule based on an existing rule use Predefined radio button, use Custom to create a custom rule. Press Next to proceed.

Make sure TCP is selected and type in 1433 in the Specific local ports textbox then press Next.

Select the Allow Connection action and press next.Select all the available profiles, since I need this rule applicable to all the profiles. Otherwise you can select only the ones you need. Then click Next.

Give a name for the rule and click Finish.

This will add your rule to the firewall.

Wednesday, November 25, 2009

Installing SharePoint 2007 on Windows Server 2008 R2

At the beginning when you try to install Microsoft Office SharePoint Server (MOSS) 2007 on Windows Server 2008 R2 it will hesitate a little. So I thought to put the steps in.

Step 1 - Download the correct Setup.

You will not be able to use your normal SharePoint Setup to install MOSS on Windows 2008 R2, if you try you will see the following message appearing continuously.

image

Download the required version from the following Microsoft URLs.

Windows SharePoint Services 3.0 with SP2 (x86)
http://www.microsoft.com/downloads/details.aspx?FamilyId=EF93E453-75F1-45DF-8C6F-4565E8549C2A&displaylang=en

Windows SharePoint Services 3.0 with SP2 (x64)
http://www.microsoft.com/downloads/details.aspx?familyid=9FB41E51-CB03-4B47-B89A-396786492CBA&displaylang=en

Step 2 – Install MOSS using the setup.

Installation will not have any hiccups if you downloaded the correct version.

Step 3 – Configure MOSS.

When trying to configure MOSS and if your SQL Server is running in another machine which has Windows Server 2008 R2 then you will sometimes get an error saying the SQL Server is not present.

Mainly the reason for this would be that, in your SQL Server machine the Windows Firewall is turned on. Easiest step is to turn it off, but if you are worried about your security then read the other article I have on enabling a port in Windows Server 2008 R2.

After correcting the SQL related issue then you will be able to complete the MOSS configuration wizard successfully.

If you get into any more issues contact me, I will try to help you out as I can.

VixML

Now you can create iPhone and iPod content without being a Objective C developer by using VixML engine.
With this you will be able to create world class iPhone content which use iPhone features with minimal coding.
The best thing is you don't need a MAC, since there is a version which works in Windows.

Read more at,
http://vixml.com/
http://vixml.viximo.com/wiki/tiki-index.php?page=What is VixML?

Tuesday, November 24, 2009

Airbus A380 - Singapore to Melbourne

Following are some nice views I captured of the Airbus A380 I flew from Singapore Changi airport to Melbourne Tullamarine airport.

Amazing Planes

If you are interested in planes like me you may enjoy the video series at YouTube on mega structures.
Following will be on Airbus A380 which is the worlds biggest aircraft.
http://www.youtube.com/watch?v=-Wr7moZuGOw&feature=related

This one is on the Boeing 747 which was an engineering marvel on 1970.
http://www.youtube.com/watch?v=sKb5ZghQSK0

Tuesday, November 17, 2009

Improving SharePoint Look and Feel

If you are thinking whether we can improve the look and feel of the SharePoint site a perfect example is the Glu Mobile site. If you visit them at http://www.glu.com you will hardly believe that it is done by SharePoint. But the truth is it is SharePoint.
If you would like to know how they did it read the following 3 articles discussing on its design and development.
http://blogs.msdn.com/sharepoint/archive/2007/06/14/moss-has-got-game-glu-mobile-s-website-www-glu-com-how-we-did-it-part-1-of-3.aspx
http://blogs.msdn.com/sharepoint/archive/2007/06/14/moss-has-got-game-glu-mobile-s-website-www-glu-com-how-we-did-it-part-2-of-3.aspx
http://blogs.msdn.com/sharepoint/archive/2007/06/14/moss-has-got-game-glu-mobile-s-website-www-glu-com-how-we-did-it-part-3-of-3.aspx

SharePoint Mobile Development

If you need to create a mobile view for a SharePoint site you will soon realise that the default mobile site created by SharePoint will not take you anywhere.
With its plain look and limited features you will not be able to do anything with the default view, so to give some thing valuable to your customer you need to do some development on the default mobile site.
To get more information on getting this done visit Microsoft.
http://msdn.microsoft.com/en-us/library/ms464268.aspx

Enabling Mobile View in a SharePoint Site

Microsoft SharePoint Server has a facility to render the site content into mobile devices as well.
In default this feature will be turned off. To enable mobile access execute the following command.

STSADM.EXE -o activatefeature -name mobilityredirect -url http://ms-sharepoint-site01/m

This will create a site under the given URL without any fancy items. It will be a plain site with only basic HTML. Whenever a mobile browser tries to access the site it will be redirected to the new mobile site.
You will be able to access the mobile sites using the URL.
http://ms-sharepoint-site01/_layouts/mobile/default.aspx
or
http://ms-sharepoint-site01/m

Friday, November 13, 2009

iPhone / iPod Worm

There is a worm spreading on iPhones/iPods which are using the default password "alpine" for SSH.
SSH is a software which allows you to connect to your device and make changes to the file system. SSH is required by some software.
This worm is created by an Australian hacker and it will search for iPhones or iPod touches in reach of the affected iPhone or touch (It will search on available networks such as mobile, wireless, etc). If it finds a device which has the default password of SSH, set to alpine it will get installed into the device, change the home screen background image and will do the same again using that device.
  • Good thing is it will not cause any harm to your device but will just change the background of the home page.
  • Bad thing is the source code of the worm is out and many other varieties of worms might appear soon. Some might be dangerous.
As a security measure change your SSH password today. You will be able to change your password using the Mobile Terminal package. Mobile Terminal can be found in Cydia under Sections. If you need help follow the link.
http://cydia.saurik.com/password.html

Wednesday, November 11, 2009

Backup a SharePoint Site

There are two methods to take a backup of a SharePoint site.
1.) Using SharePoint Central Administration
To take a site backup follow the steps below.
a. Go to the SharePoint Central Administration site by clicking,
Start -> All Programs -> Administrative Tools -> SharePoint Central Administration
b. Click on Operations.
c. Click on Perform a backup under Backup and Restore.
d. Select the site or the farm to backup the entire SharePoint farm.
e. Click on the Continue to Backup Options button on the top of the list.
f. Select the type and the location of the backup and click Ok.

2.) Using the STSADM tool.

Even though Microsoft had provided a UI method to backup a SharePoint site the best way to get it done is by the STSADM tool. If you are unfamiliar with STSADM refer the following post http://arjunachith.blogspot.com/2009/11/stsadm.html.

You will be able to use the following command to get a backup of a site using STSADM.

STSADM.EXE -o backup -url http://MySharePoint:10000/ -filename E:\Folder_Name\SiteBackup.bkp -overwrite

o - Mentions that the backup is an operation.

url - URL for the site collection that you need to backup.

filename - Path to the backup file, even a network path such as \\Machine_Name\Folder_Name\File_Name.ext can be provided.

overwrite - Will overwrite an existing back file if found in the backup location.

Instead of giving the path in the filename you can use the directory parameter to mention the location as well it is shown below.

STSADM.EXE -o backup -url http://MySharePoint:10000/ -directory E:\Folder_Name -filename SiteBackup.bkp -overwrite

directory - Location for the backup, even a network path such as \\Machine_Name\Folder_Name can be provided.

filename -The name of the backup file.

The status will be shown in the command prompt.

If you would like to know the full set of available parameters for the backup operation visit the Microsoft at http://technet.microsoft.com/en-us/library/cc263441.aspx.

Google prOgramming language - GO

Google had released a new programming language named GO.
Their one goal behind this is to increase the developer productivity and efficiency by giving them a faster compiler.
As Google says this is even capable to be used in developing system software and it is powerful than C but not than C++.
Read more on this at http://mashable.com/2009/11/10/go-google-language/.
Get Going at http://golang.org/.

Wednesday, November 04, 2009

STSADM

STSADM is a command line tool which we can use to perform administrative tasks on SharePoint Server, this is very powerful since it provides features that are not available in the Central Administration site.
You will be able to find this executable at,
%COMMONPROGRAMFILES%\microsoft shared\web server extensions\12\
For example - C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN


To learn more visit the following TechNet link.
http://technet.microsoft.com/en-us/library/cc261956.aspx
Following link will have the list of operations and properties.
http://technet.microsoft.com/en-us/library/cc263384.aspx

STSADM Error

Recently I faced a curios error while using the STSADM.exe command line tool.
If anyone of you are not knowing wht STSADM is please refer my earlier post with links to get more information.
However powerful STSADM is, while using it suddenly Windows might tell you that STSADM is not a valid Win32 application.
If you check the file you will also notice that the Windows icon of that exe is disappeared and also the file size is 0.
The good thing is that you will be able to get the file from another SharePoint installation and replace, then everything will start working normally.

Tuesday, November 03, 2009

Flight Simulation

After some pause I again started my flight simulation activities.
To celebrate I thought to put some nice screen captures I made on one of my flights.

Saturday, October 31, 2009

WSUS

Recently I had to install and configure WSUS (Windows Server Update Services) on our company.
I feel this is a very handy way to distribute the software updates through out the company.
In configuring it the following articles was helpful to me so thought to share them with you.
This is the main Microsoft site for WSUS,
This is the main TechNet site for WSUS,
Following pages show how to configure clients,

Monday, October 05, 2009

Editing NTFS Drive Contents on Mac OS

In Mac OS if you mount a disk formatted in NTFS file system, you will be able to view the contents and even to copy contents from that disk (Read) but you will not be able to save, delete or paste (Edit) anything.
To enable editing in the disk you will be needing to install the NTFS driver.
If you are searching for a driver, download NTFS-3G Stable Read/Write Driver from NTFS-3G.

Wednesday, September 30, 2009

How to Hard Reset i-mate JASJAM

Different phone has different key combinations to perform a hard (factory) reset.
In i-mate JASJAM you need to press the 2 soft keys together while pressing the reset whole.
Then it will show options, letting you proceed or cancel the reset. Remember hard resetting will wipe all the applications and data in your device, so remember to backup everything before performing a hard reset.

Wednesday, September 23, 2009

Distributing BlackBerry Applications Over Internet

BlackBerry applications that you develop can be distributed over the internet quite easily when you know what you need to do. In this method users need to browse to the web URL and click on it so the BlackBerry will download and install the file automatically.

Step 1 - Prepare the Files
When you compile the source code of the application you will be getting a .cod file.
Check the file size of it, if the cod file is less than 55KBs then you can use it without doing anything more.
If that is larger than you need to do the following trick to make the application distributable over the internet.
  • Change the extension of the cod file to zip.
  • Unzip the zip file.

You will now see a set of cod files with names like App-1.cod, App-2.cod, App-3.cod, etc.

Step 2 - Prepare the Server
To make BlackBerry devices correctly identify and download the files you need to add or update the Multipurpose Internet Mail Extension (MIME) types in your web server. The required MIME types are as follows.
File Name Extension - MIME Type
cod - application/vnd.rim.cod
jad - text/vnd.sun.j2me.app-descriptor
jar - application/java-archive

If you need more details on how to set MIME types in different web servers please contact me, I will try to provide you with more details.

Now place the cod files we prepared in Step1 in the server.

Thursday, September 17, 2009

BlackBerry Network Diagnostic Tool

Latest BlackBerry smart phones are supporting many different network transports to enable reliable data communication between third-party applications and the Internet.

BlackBerry have provided a good tool named "Network Diagnostic Tool" which is essentially a role model that answers all these questions and is a functional diagnostic tool for testing a URL over various transports supported by the BlackBerry solutions, as well as for displaying the values of many network attributes during the test period.
You will be able to download it freely from BlackBerry knowledge base.
If you need to know more about the available transports and more in depth details on the network diagnostic tool, better visit the Article Number: DB-00684 at the BlackBerry knowledge base.

Setting APN Automatically

If you tried to create a BlackBerry application which uses internet through Direct TCP transport and needed to release it to a set of users who are using different mobile networks you may have had the problem of how you can release the application in a way that users don't have to make any setting changes to make your application get connected. The complexity here happens because different service providers (mobile networks) are using different settings (for example APN).
After some searching on the net I found one way to achieve this is by identifying the mobile network and then setting the connection properties appropriately.
The steps involved is as follows.

Step 1
Identify the network the phone is currently in.
If you need help on this go to this URL.

Step 2
Get the APN settings for your network.
The way here is to have a file with all the settings of different wireless service providers you intend to run your application on, and then compare the value returned from Step 1 and get to the particular APN.
I suggest you to keep a XML or text file with the following details of the service provider,
  • Country Name
  • MCC
  • Carrier Name
  • MNC
  • TCPAPN
  • TCPAPNUserName
  • TCPAPNPassword
  • WAPAPN
  • WAPIP
  • WAPPort
  • WAPUserName
  • WAPPassword
  • WAPSourceIP
  • WAPSourcePort
  • IsEnableWTLS
Step 3
Add the APN to the connection.
If you need help on this go to this URL.

Determining the Network

In the BlackBerry project that I am in now we are having the requirement to detect the mobile network the phone is currently in.
Basically in BlackBerry mobile network is uniquely identified by the Mobile Country Code (MCC) and the Mobile Network Code (MNC).
To get these details from your code what you have to do is to call

RadioInfo.getMCC()
and
RadioInfo.getMNC()

These will return the codes in decimal.
You can find a full list of MNC codes of the mobile phone operators and a list of country codes by following the following URLSs to Wikipedia.
http://en.wikipedia.org/wiki/Mobile_Network_Code
http://en.wikipedia.org/wiki/Mobile_Country_Code

If you need to access the BlackBerry knowledge base article describing the above process you can follow the following link.
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1467358/How_To_-_Determine_the_MCC_and_MNC_of_the_current_network.html?nodeid=1467359&vernum=0

Sunday, September 13, 2009

Setting APN

APN or Access Point Name is a setting which needs to be set on the mobile when we need to get connected to internet using the phone.

APN changes from one mobile service provider to the other. For example Dialog will have http://www.dialogsl.com/ Rogers will have internet.com set as their APN.

But letting users set the APN manually is always not the preferred way. Recently we developed an application for BlackBerry which the user needed to get to the internet without he manually setting the APN. The application was supposed to be delivered through BlackBerry App World so manually setting APN was not an option. In a case like this what you have to do is set the APN programmatically into the connection.

String URL = “www.SomeServer.com”;
StringBuffer bfURL;
bfURL = new StringBuffer ();
bfURL.append (URL);
bfURL.append ("
;deviceside=true ;apn=internet.com");
bfURL.append ("
;tunnelauthusername=UserName;tunnelauthpassword=Password");
String FinalURL = bfURL.toString ();

In the above code I have set the Rogers APN in to this connection.

If you need more details on the parameters used or need to know about the other parameters you are eligible to use such as WapGatewayIP, WapGatewayPort, WapGatewayAPN, etc visit the following link to view full details of the connector class.

http://www.blackberry.com/developers/docs/4.2api/javax/microedition/io/Connector.html

Tuesday, September 08, 2009

Benz Show 2009

Recently I managed a project which targeted iPhone and SharePoint server. This was a project for Dimo who are the dealers for Mercedes Benz in Sri Lanka. Total software services were provided by IronOne Technologies.

When we finalized the technologies I thought that this project will be an interesting one.
But the real interesting part was on the day when I saw all the Benz models present on the day. Even though I have seen international car shows before this, this is the first time I have seen this much of cars of the same manufacturer on the same place live.
You will agree after you see the photos.