Twitter Centric Social Network Personal Status Synchronisation

Posted by Sitt Sen Chok | Filed under , , ,

During the last few years, internet-based social networking has experienced exponential growth in popularity and become a current trend.  It takes the form of social networking web sites or tools which provide convenient facilities for connecting people and maintaining communications.  Every popular trend bring great promises, and often than not, also great chaos.  The chaos comes from the springing up of enormous social networking web sites that are sparsely adopted by the very people whom we want to be connected with.  With friends opting to use different social networking sites or tools, it becomes impractical and often difficult to maintain consistent personal status updates.  A integration solution that spans across them is required.  The solution should should aim to minimise efforts by eliminating possible need for duplicated efforts.

Looking at the recent adoption of social networking tools based on friends I know, Facebook, Twitter and Windows Live Messenger are the common ones.  With this in mind, I have settled (for the time being) with using these three social networking tools.  The solution in this article looks at personal status synchronisation between Facebook, Twitter and Windows Live Messenger "Personal Status Message" (PSM).  Personal status update is a way to communicate to friends what we are doing, and hence promoting "fresh" communication.  This feature is available in the tools under consideration by this article.

There are many solution combinations out there which tackle the problem from different perspectives and different usage scenarios.  The solution described in this article adopts Twitter as “coordinator” of personal status updates.  Twitter is a good choice for this role as it provides numerous options or methods or channels for updating personal status, such as SMS, web, API, gtalk and others.  More recently, Microsoft’s Bing search engine also index into personal statuses of Twitter’s accounts.  The solution scope is limited to solving the following information flow in term of status synchronisation:

  • Twitter to Facebook
  • Twitter to Windows Live Messenger PSM
  • Windows Live Messenger PSM to Twitter
  • Windows Live Messenger PSM to Windows Live

The rest of this article takes a look at each of the above personal status information flow.  Note that Windows Live personal status update from Windows Live Messenger PSM to Windows Live is a feature of the product.  No action is required for this case. 

Twitter to Facebook
Personal status synchronisation from Twitter to Facebook is achieved by adding the Facebook’s Twitter application and setting it up to point to your Twitter account.  The following link should lead directly the application addition page for the Twitter application in Facebook:

     http://www.facebook.com/apps/application.php?id=2231777543

For detailed tutorial of setting up Twitter application in Facebook, please refer to article "How To Sync Your Twitter and Facebook Status Updates".

Twitter to Windows Live Messenger PSM
In order to update the Windows Live Messenger PSM, additional software is required to be installed on the computer where Windows Live Messenger is running on.  The following are required:

  • Windows Live Plus! – this is a Windows Live Messenger plug-in that allows custom scripts to be run.
  • Twit2MSN – this is a Windows Live Plus! script that actually update your Windows Live Messenger PSM from your most recent Twitter's status.

For detailed on how to setup Twit2MSN, please refer to the Matt Dyson's site. Matt Dyson is the author of the Twit2MSN script.

Windows Live Messenger PSM to Twitter
If you are using Windows Live Messenger, it is common to update personal status through Windows Live Messenger PSM directly.  This calls for personal status update to flow from Windows Live Messenger PSM to Twitter, which in turn will update the status on your Facebook account.  To achieve this, the following are required:

  • Windows Live Plus! – this is a Windows Live Messenger plug-in that allows custom scripts to be run.  This is only required if it is not previously installed.
  • Twitter Psm Pusher – this is a Windows Live Plus! script that update your Twitter’s status from your Windows Live Messenger PSM.

For detailed on how to setup "Twitter Psm Pusher', please refer to Elias's site.  Elias is the author of the "Twitter Psm Pusher" script.

As a close to this article, the following presents a diagrammatic overview of the described solution:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Handling System.DBNull graciously

Posted by Sitt Sen Chok | Filed under

Data fetched from database may contain null values.  This can happen either by design or the enforcing constrain unintentionally missed in the database schema.  The latter case calls for special care at the data access layer of the application code.  Null value fetched from database is represented as System.DBNull in .NET.  In order to handle this graciously, a simple check for DBNull should suffice.  The following is an example of a utility function to perform such a check:

public static object DBNullDefault(object objectValue, object defaultValue)
{
   if (!DBNull.Value.Equals(objectValue))
      return objectValue;
   return defaultValue;
}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Windows XP SP3 modifies wlanapi.dll

Posted by Sitt Sen Chok | Filed under ,

The D-Link AirPlus Utility relies on a dynamic link library (DLL) wlanapi.dll that has a certain expected procedures/functions/interfaces.  As part of the installation of Windows XP SP3, a new version of the DLL is put in place of the older one that previously works well with the AirPlue Utility.  The new DLL causes the AirPlus Utility to encounter the error "AirGCFG.exe - Entry Point Not Found.  The procedure entry point apsGetInterfaceCount could not be located in the dynamic link library wlanapi.dll".

The root cause of the issue is the absent of the expected procedures in the new version of the DLL.  To resolve the issue, a copy of the older DLL should be copied to the same directory where the AirPlus Utility lives.  This makes the AirPlus Utility use the older version of the DLL instead of the new one.  The following are two commands which should resolve the issue:

   xcopy %Windir%\$NtServicePackUninstall$\wlanapi.dll "%ProgramFiles%\D-Link\AirPlus G"

   xcopy %Windir%\$NtServicePackUninstall$\wlanapi.dll "%ProgramFiles%\ANI\ANIWZCS2 Service"

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Resolving iPhone code signing error

Posted by Sitt Sen Chok | Filed under , ,

During the deployment of an iPhone application to the device from xcode, issue may be encountered during the code signing stage which prevents the completion of the deployment task. The specific error message I encountered was “object file format invalid or unsuitable”. The issue may be due to installation of the iPhone SDK on an unsupported environment which in this case is PowerPC machine. I cannot be totally sure that this is the real cause of the problem.

The issue was resolved based on the solution provided in Apple Support forum. The following are the steps which will require administrator (may use sudo) privillage:

  1. Make a copy of the existing codesign executable.

    mv /usr/bin/codesign /usr/bin/codesign.orig

  2. Create a new codesign file with the following content

    #!/usr/bin/perl
    #
    $appDir=$ARGV[$#ARGV];
    @tmpAry=split(/\//,$appDir);
    $baseAppName=$tmpAry[$#tmpAry];
    $baseAppName=~s/\.app$//;
    $realAppName="$appDir"."/$baseAppName";
    $sign=0;

    for($b=0;$b<$#ARGV;$b++) { 
         if ($ARGV[$b] eq "-s") { 
              $sign=1;
         }
    }

    $mums=`file $realAppName`;

    if($sign==1 && $mums=~/executable arm/) {
         #print "Signing armv6..\n";
         $dev="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/";
         $tmp="$appDir"."/tmpbin";
         `$dev/lipo -create $realAppName -output $tmp`;
         `mv $tmp $realAppName`;
         system("/usr/bin/codesign.orig",@ARGV);
         `$dev/lipo -thin armv6 $realAppName -output $tmp`;
         `mv $tmp $realAppName`;
         system("rm $appDir"."/CodeResources");
         system("cp $appDir"."/_CodeSignature/CodeResources $appDir"."/CodeResources");
         exit 0;
    } else {
         exec '/usr/bin/codesign.orig',@ARGV;
    }

  3. Make the new codesign file executable.

    chmod 755 codesign

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Supporting sub-domains in IIS

Posted by Sitt Sen Chok | Filed under , ,

One of the common requirements for a site is to support sub-domains, such as one that represents a specific product site under the same company banner.  For example, http://msdn.microsoft.com  is a sub-domain of http://microsoft.com.  Quite often a sub-domain physically points to a separate website hosted either under the same web server instance or under a different instance altogether.

For support of sub-domain to occur, there are a number of things that need to be configured at the domain name hosting provider level and at IIS web server level.  The following are the necessary steps to setup sub-domain support.  For illrustration purposes, we assume the task of setting up a sub-domain product-name and the main domain company.com.

Hosting provider

  • Add a “A" record for the sub-domain product-name which points to a static IP address.  The IP address should be one served by the target IIS instance.  There should be a separate “A" record for the main domain name company.com, and a similar one for the sub-domain of www to cater for the URL of http://www.company.com.

IIS

  • Under IIS Manager, create a website for product-name.company.com.
  • Configure the identites for the website by:
    • Bring up the Properties sheet for the new website.
    • Select the “Web Site” tab.
    • Click on the “Advanced..” button.
    • Under the “Multiple identities for this Web site” section, change the default entry to have host header value of product-name.company.com.
  • Repeat the above steps in IIS for the main website company.com which should have two identities represented by host header values of www.company.com and company.com.

By performing the above steps, the IIS web server instance should know which website that an incoming web request should be served from. Note that only IIS version 6.0 and above supports multiple websites as described in the other post.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Location of iPhone databases

Posted by Sitt Sen Chok | Filed under , ,

iPhone uses SQLite databases for most of its key applications.  These databases are not protected by username/password, and can be queried using SQLite C/C++ API calls.  The following are the iPhone databases and their Root Folder location (/private/var/mobile/Library/) in the iPhone file system:

  • Call History - CallHistory/call_history.db
  • Address Book - AddressBok/AddressBook.sqlitedb
  • SMS - SMS/sms.db
  • Notes - Notes/notes.db
  • Voicemail - Voicemail/voicemail.db
  • Calendar - Calendar/Calendar.sqlitedb

To find out the schema for a SQLite database schema, issue the SQLite command ".schema message". Note that the databases cannot be accessed using standard SDK or API, but through some indirect methods on jailbroken iPhone suggested in here.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Makes iPhone SDK works on PPC Mac

Posted by Sitt Sen Chok | Filed under , , ,

The Apple iPhone SDK (Build 9M2621a under consideration) restricts installation on non-Intel Mac machine.  For those who have a PowerPC based Mac, the good news is that there is a workaround.  The following are steps that will make iPhone SDK works on a PowerPC based Mac:

  1. Download and install everything iPhone SDK installer allows to install.
  2. Manually install all the iPhone related packages (prefixed with “iphone”) under the installer Packages folder.
  3. Move all the folders under “/Platforms” to “/Developer/Platforms”.
  4. Modify the “iPhone Simulator Architectures.xcspec“ file (sample) under “/Developer/Platforms/iPhoneSimulator.platform/
    Developer/Library/Xcode/Specifications/
    ” to cater for compilation under a PowerPC architecture.
  5. Restart xcode.

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

iPhone: Retrieving call history

Posted by Sitt Sen Chok | Filed under , , , , ,

Apple seems to have deliberately imposed restriction for access to call history in its SDK design. The restriction maybe imposed for privacy proposes and for protecting such data from being misused by questionable iPhone applications. However, access to the call history data is possible on the computer in which the iPhone data is backup onto.  The call history can be accessed directly on the iPhone from a Mac or a PC using the DiskAid utility. The call history is physically located under the root folder on the iPhone.  The root folder is normally restricted.  So in order to access to this folder, the iPhone needs to be a jailbroken device. An iPhone can be jailbroken by following the instructions for Windows or Mac. Note that a jailbroken iPhone reverts back to normal when the firmware is upgraded using iTunes.

Another way to access to the call history by application running on the iPhone is to access to its call history database.  The iPhone call history data is stored in a SQLite database.  The database schema for the call history database can be found here.  There are some suggestions on how to access to the database using the SQLite C/C++ API. Note that the database cannot be accessed using standard SDK or API, but through some indirect methods on jailbroken iPhone suggested in here

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

iTunes: Synchronise from folders

Posted by Sitt Sen Chok | Filed under , ,

One of the weakness of iTunes (at least up to version 8) is the "missing" capability to monitor media files being added or removed from a folder.  This may be a design decision on the part of Apple to lock user down to use iTunes for media file library management. For people who are managing media files manually or uses multiple media file management software like Windows Media Player, the "missing" capability in iTunes causes great inconvenience.  Windows Media Player has this feature working very nicely.  There is no option other than to use external program to plug the hole in iTunes.  The iTunes Library Updater is one nice simple uility written for this purpose.  It has to be run separately from iTunes, either as a Windows application or command-line application.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

iPhone: Discover MAC address

Posted by Sitt Sen Chok | Filed under , , ,

Most wireless routers provide the facility to restrict access to its network by WiFi enabled devices.  A router identifies a WiFi enabled device by its WiFi adaptor MAC address.  For the case of iPhone, the WiFi MAC address can be found by following the path Settings > General > About.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5