MP3 Player for the Pocket PC

Pocket PC and Windows Mobile No Comments »

Certainly there are several options, some commercial and some freeware/regware. However, after installing some of the available choices which didn’t really cut it for different reasons I realized that I have a great player for MP3 files already installed on my PPC. I have used TCPMP (formerly BetaPlayer) for about three years as a reliable player of video files for the Pocket PC, mainly for checking my golf swing (swapping SD cards with .avi files from a digital camera). As it turns out, TCMP is also a great player for MP3 with excellent sound, playlists in several formats, equalizer (latest versions) etc. It’s very easy to customize with an exemplary GUI. So if you can go without bloated skins and themes this is the player for you. It plays AC3, HE-AAC, AMR, DivX, FLAC, H.263, H.264, JPEG, Monkey’s Audio, MJPEG, MPEG-1, MP2, MP3, Musepack, MS-MPEG4-v3, PNG, Speex, TIFF, TTA, Vorbis, WAV, WavPack and XviD and the following container formats: 3GP, ASF, AVI, Matroska, MPEG, OGG, OGM and QuickTime. Truly one player to rule them all for the Pocket PC (both Windows CE and Windows Mobile) and also for Windows, Windows Smartphone, Palm OS and Symbian OS with Linux and Mac OS X versions being planned.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Synchronizing Local Data with a Remote Web Hosting Database

Programming No Comments »

Many webmasters of smaller web sites use the services of web hosting companies located in locations around the globe. Here in Thailand running your own web server is not feasible, as connections from the important markets of Europe, the Americas and even other parts of Asia might be too slow and unreliable. Using the services of a web hosting company usually involves running a local development database and an identical database running on the web hosting company’s servers.

To keep the contents in sync, it is desirable to have an easy-to-use system of uploading refreshed data to the remote database, ideally from the desk of every employee on the floor via an ASP.NET web app on the local intranet. There are several options available to achieve this:

Programming against SQL Server 2005 Integration Services (SSIS)

The successor of DTS is far more flexible and powerful than its predecessor, with great enhancements of the programming model in terms of extensibility and flexibility. How to call SSIS from C# is detailed in this article. However, SSIS are only installed with advanced versions (Standard upwards) of SQL Server and are not included with the free Express Edition nor the Workgroup edition (with the latter you apparently can open and save SSIS packages). I found this option not feasible, mainly because debugging is almost impossible and the Dts.Runtime.Package.Execute () method only returns very terse result code.

Using SQL

Of course you can issue INSERT queries that transfer your data to a remote database. If your remote server is a linked server you can simply issue a query like the following:

INSERT INTO [my.linked.server].myremotedb.user.mytable

SELECT * FROM localdb.user.mytable WHERE id = @ID

GO

However, if id is an identity column (as the name suggests), you’re out of luck as you have trouble with this query:

SET IDENTITY_INSERT [my.linked.server].myremotedb.user.mytable ON

This query issued to the linked server from your local db will usually fail in a hosting environment due to a lack of pertinent permissions.

An OPENROWSET ad-hoc connection won’t help you either because the KEEPIDENTITY table hint provided by an OPENROWSET query can only be used when inserting from a data file, while reading data from an OLEDB data source also might fail due to permission restraints.

SqlBulkCopy to the Rescue

ADO.NET 2.0 offers a fast and efficient way to transfer data to a remote database with the SqlBulkCopy class.

The following code illustrates this feature:

private void transferWidgetData(int widgetID) { //tables in the local and remote database are identical string[] myTables = { "widgets", "widgetDetails", "widgetPrice" }; string connectionStringLocal = ""; string connectionStringRemote = ""; using (SqlConnection conLocal = new SqlConnection(connectionStringLocal)) { foreach (string s in myTables) { //create the source command SqlCommand commandSourceData = new SqlCommand( "SELECT * " + "FROM " + s + " WHERE WidgetID = " + widgetID, conSource); SqlDataReader reader; //connection has to be re-opened for each datareader conSource.Open(); reader = commandSourceData.ExecuteReader(); using (SqlBulkCopy bcp = new SqlBulkCopy( connectionStringRemote, SqlBulkCopyOptions.KeepIdentity)) { bcp.DestinationTableName = "dbo." + s; try // Write from the source to the destination. { bcp.WriteToServer(reader); } catch (Exception ex) { //handle error here } finally { conSource.Close(); } } } } }

Note here the extremely useful SqlBulkCopyOptions.KeepIdentity hint which enables inserting identity values into the remote table. This code can easily be called from ASP.NET, enabling fast and flexible content management and synchronization with the remote database from your local intranet.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Working with PTGui and IDimager

Panoramas No Comments »

How to make the best photo stitching tool (PTGui) and the best image archiving software (IDimager, incidentally both created by Dutchmen) work together? No need for any plug-ins. Simply tag your images with “panorama” or something similar using IDimager, load them with the IDimager Catalog Explorer into the IDimager Collection Viewer (the thumbnail view in the rightmost window), mark the relevant images and drag them into PTGui’s Project Assistant workspace (the window that opens when you start PTGui). This is how software should work.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Spirited Away (Twice)

Chiang Mai No Comments »

From The Nation:

Fountain being moved

Work began in Chiang Mai yesterday to remove a fountain at the Chang Pheuk Gate. The fountain, which has been the subject of a seven-year dispute between the Chiang Mai Municipality and the Fine Arts Department, will be re-installed at Suan Lanna Rama IX Park.

Published on July 13, 2007

A ritual to apologise to supernatural spirits was held at 8am yesterday before work began.

Astrologer Sukit Phutasin said the gate had served as a triumphal entranceway to the city for Lanna kings and the fountain had blocked the old path, thus bringing “suffocation” to the city and “creating discomfort to residents”. Removal of the fountain was the only solution.

Municipal clerk Ken Santitham said the order to remove the fountain was issued on February 5 to facilitate an inspection for artefacts underneath the site, believed to be on top of the ancient city’s wall.

“After the removal is complete, the Fine Arts Department will turn the area into a public space like the Tha Pae Gate,” he said.

Comment:

It’s a conflict between ancient and not so ancient history. The North of the city was historically seen as it’s “head” or “front” and therefore the northern Chang Pheuak (White Elephant) gate was the entrance point into the city not only for royalty, but also for its guardian spirits. The old fountain was constructed in the 1950s in the style of the day, clearly incorporating European style elements. In the early 1990s the fountain was removed, alleging the same “obstruction” as cited in the article above. It was rumoured at the time that the Lord-Mayor of Chiang Mai had moved the fountain to adorn his private garden although no proof of this allegation has ever been published. In 1999 the fountain was reconstructed exactly as it had been, drawing immediate complaints from the Fine Arts Department. A compromise was reached that the fountain itself could remain but that the water pumps had to be moved further form the old city wall. As long as the “old powers” (read: Thai Rak Thai Party members) held sway in Chiang Mai the situation did not change and it seemed that the fountain was used as a resting place for tourists wandering the city. Now here’s hoping that the municipality will decorate the gate in a environmentally friendly way and create a green resting place instead of leaving it to the torrents of ever increasing traffic.

Here are a few pictures of the “damage”:

IMG_5110     IMG_5113 IMG_5117

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Packaging and Deployment of Windows Mobile Applications (VS 2005)

Programming No Comments »

While the basic cab creation is outlined here, this article describes the entire rather involved process of packaging the cab with a windows installer. This procedure takes some practice to master. No fewer than 3 major steps have to be taken outlined in this little cheat sheet:

Step 1. Package the output of your project (project type: Smart Device Cab Project)

    • Add project output of your main project (which is usually a smart device app) and create a link to it for the mobile device’s programs menu.
    • Set registry values your new project will need to create on the mobile device. 

Step 2. Create a custom installer package (project type: Windows Class Library).

    • Put an .ini text file into the custom installer project, put the relevant info into this file and reference the file in the event handlers.

Step 3. Create the setup package (project type: Setup Project).

    • Add the cab file from the cab project and the .ini and  the dll created by the custom installer project.
    • Add a custom action (right click project, View>Custom Actions) with a reference to the custom installer dll.

There are several software packages that help you with this process. However, some practice will soon make you an expert and arguably give you more control than a prefab software package.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in