Thursday, July 10, 2008

What Does It Take to be a Gold Record in the Philippines

With dwindling physical record/CD sales, the local recording industry has long been adjusting (or perhaps the more appropriate word is "lowering") their standards for awarding gold or platinum status to music albums. Well, as of July 2008, the exact figures are as follows:
Local albums only have to sell 12,500 copies (from 15,000) to achieve gold status, and 25,000 (from 30,000) to go platinum. Foreign albums are now certified gold with sales of 7,500 copies (from 10,000) and platinum with sales of 15,000 copies (from 20,000).
Source: http://showbizandstyle.inquirer.net/entertainment/entertainment/view/20080709-147435/Rico-B-bumps-into-his-past

For now, I believe this is based on physical sales through record bars. I don't think they include digital purchases -- whether through web/PC with digital music stores like Fliptunes, or through mobile phone over-the-air download.

Wednesday, July 9, 2008

Hot Meatballs on My Pants

It was pretty hot outside today during lunch hour. I decided to skip my new favorite lunchtime place (RCBC food court) in favor of the more convenient LKG Tower Food Court. I decided to go for the usual Sizzler since I haven't had that for some time.

Diners have been few in the LKG and PBCom food courts (both operated by Raintree) lately. Maybe most of them are trying out new places to eat (or maybe they're all going to RCBC's food court). A lot of the food stalls have closed. And a lot of space previously reserved for diners have been converted to kiosks selling clothes (ala ukay-ukay).

The Sizzler stall is quite big as they also serve local food under another brand name. I noticed there was nobody in the counter. The entire length of the very long counter was just manned by one lady. And inside the kitchen (behind the counter separated by a glass), you can see there's only 2 cooks. Hmm... business must be really slow. I went for the usual meatballs with sweet-and-sour sauce. It took some time to be served because the lone lady/cashier was tending to other customers at the same time.

The meatballs are served on a black sizzling plate. But by the time I got it onto a table, it was no longer sizzling. I tried slicing a meatball in the center, but it was hard already (probably because it cooled down?), so it popped out of my plate and landed between my legs -- with sweet-and-sour sauce and all! Grrrr... now my pants' left and right leg has orange blotches. And I still have to give a presentation this afternoon to the Friendster Philippines people. :(

The Makati E-Jeep

Gasoline prices continue to go up by PHP1.50 every week. The Makati central business district (CBD) has at least taken some actions. While driving around Legaspi Village this morning, I came across this E-Jeep. Its an electric-powered public utility jeepney plying the CBD routes.



At first look, its just like any other jeepney except a bit smaller. But what caught my attention was the banner on the side saying, of course, "E-Jeep" and that they were offering FREE rides. I think they are still on a trial run and the free ride offer is valid only for 1 month.

The banner also says that it is powered by Motolite. It would be very interesting if the world-wide web business model where services are offered for free in exchange for ads/promotions by big companies, can be adapted to this situation. Would electric car battery companies be interested to operate these free public service in exchange for promoting their brands?

Well, if there's anything good that came out of this gasoline price increases, its that traffic has been reduced in Metro Manila (by 10% as of this month according to MMDA statistics), and that carbon emission has lessened because more people are taking public transport. The government still has to improve its mass transport systems like the MRT and LRT though. The jeepneys and buses do not really contribute much to the lessening of pollution. If Metro Manila only had an efficient public mass transport system like those found in Hong Kong or Tokyo, there would really not be much need to drive around the city.

Monday, July 7, 2008

Using Crystal Reports with C# and ASP.NET

I've been using Crystal Reports for more than 3 to 4 years now, but I've never bothered to use it for Web-based applications. I've always just used it for standalone Windows executable applications. Recently, I've been thinking on how I can generate PDF reports for directly downloading over the web just like the ones available at Citibank Online. Writing web-based reports using traditional HTML is pretty cumbersome. And with more and more NetSecure clients asking for report customizations, I've been dreading having to touch the NetSecureWeb code for new reports.

Since I seem to recall reading somewhere that the Crystal Reports that comes with Visual Studio can be used for making web reports, I decided to do some R&D today. First stop, of course, is Google. Doing a search on "crystal reports for .net", the first three links returned gave me all the answers I needed.

Armed with the first article at the top of the search, I started off with my POS Solution. I created a new test web application, and added a Crystal Reports item onto it. Doing some quick copy-and-pasting from the main POS source code, I got a report running in record time (well, it took me several minutes because I got stumped with something that turned out to be an error on my part).

Next, I wanted to implement an export-to-PDF or view-as-PDF-on-the-web feature. The 3rd article from the search shows just how simple it is. Its basically the same as the code to do the one above, except you just add something like:

MemoryStream oStream = (MemoryStream)userReport.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.Clear();
Response.Buffer= true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();


And voila! The Acrobat plug-in opens the PDF on your IE and the report is displayed as PDF. And, of course, it follows that the user can print the PDF report by using the Acrobat plug-in's (or the browser's) capability to send its output to the printer.

There is also this interesting article about publishing the Crystal Report as a web service. Then when you drag-and-drop a Crystal Report control onto your form, you just point its report source to the URL of the web service. Very interesting concept. One can make the reports appear as a web service, and it can be extracted on runtime by standalone exe's or web-based applications. No need to embed the .rpt file directly onto the applications. Makes it easier to update also without having to recompile the code of your apps.

Friday, July 4, 2008

Programming Serial Port Communication with .NET

A local supplier recently lent me a unit of the Fargo Maestro 100 GSM Modem for testing. I'm looking at this unit to replace our Nokia phone that is used by Mozcommunicator. An industrialized GSM modem should be more stable, in theory, and offer better throughput. And it does not use a battery, but connects directly to the power outlet.

For more than a week now, I've been testing it with the 8-port serial card that I asked Mrs. Gan to buy from the US a couple of years back. I attached the modem to the first port (which maps to my PC's COM9) and just used the built-in Windows Hyperterminal to communicate with it. The results have been very erratic. More often than not, it would just hang when you start typing in the AT commands. And its very rare that I can leave it on overnight without seeing it hang the next day when I come in.

But today, the serial PCI card itself already fails to be detected properly by Windows. So I opened up my PC; unpluggged-and-replugged the card, and at the same time, I added a cable+backplate adapter for my motherboard's built-in COM1 onboard. The motherboard did not come with a visible COM port at the back. So I had to get a cable from Ric to make the onboard COM port accessible from the back of the PC chassis. Things have been working smoothly so far (maybe it was really the multiport serial board that was problematic all along?).

I experimented for the first time with the System.IO.Ports.SerialPort class library of .NET 2.0. Yeah, yeah, I'm very much behind. I think the latest .NET release is already 3.5. I'm usually a generation behind when it comes to adopting .NET technology. While everyone was already at .NET 2.0, I was still with .NET 1.1! In any case, the SerialPort class library makes life simpler for programming serial communication. Whereas I had to rely on accessing unmanaged code before with .NET 1.1, the .NET 2.0 SerialPort library makes opening a serial port as simple as declaring:

port = new SerialPort("COM1", 115200, Parity.None, 8, StopBits.One);

Then trapping data received events becomes as simple as overriding the DataReceived event handler:

port.ReadTimeout = 2000;
port.DataReceived += port_DataReceived;


While writing my test program for the GSM Modem, I also learned a couple of small items:
  1. The String.Trim() function apparently also trims out newline characters ('\n'). All along, I thought it just trims whitespaces.
  2. To send a Ctrl-Z (which is needed to inform the modem that you are finished typing the message to send), you just do port.Write(Convert.ToChar(26).ToString()).

Strangely, the System.IO.Ports namespace does not seem to support parallel ports, only serial. So for writing to parallel ports to control POS printers and cash drawers, I guess I still have to use unmanaged code.

Wednesday, July 2, 2008

Terminator Season 1 Ends?

I've been complaining that all the episodes of Sarah Connor Chronicles that my Philips DVDR Player has been recording for the past month are replays. It seems that Season 1 of the TV series has actually ended! I visited the official Fox Network website of Terminator, and based on the blogs and forum postings, Season 1 ended with Episode 9 way back in February of this year.

How many episodes are supposed to be in a season anyway? Isn't 9 a bit too few? Heroes Season 1 was kinda long, but I also felt that Season 2 was very short. Still, I'm sure it was longer than 9 episodes. Oh, well... looking forward to the next season.

Playing DivX Videos Over The Network

DivX's recent announcement of their DivX Connected initiative is pretty exciting. The client/server model now allows a remote DivX-capable player to get its video input stream from a "DivX Connected Server" over a TCP/IP network -- wired or wifi. The Connected Server is just a software that you would install on your Windows XP or Vista. It listens for incoming requests and streams data to the remote player. This is pretty convenient. That means when you download stuffs from BitTorrent; you can convert it to DivX; then start sharing it to your devices!

This is pretty cutting edge for now. Aside from their highlighted product -- the D-Link DSM-330 DivX Connected HD Media Player, there seems to be no other consumer electronic product available yet that supports this streaming protocol. The DSM-330 is very interesting though. It has a wired+wifi interface to the TCP/IP network, and a video out interface (S-Video, Component, Composite and HDMI) on the other end. It can playback in 720p HD.

The DSM-330 is available for pre-order at Amazon for US$280.99. A bit still pricey. Also, according to its specs, the DSM-330 only plays DivX (of course) and Windows Media Video (WMV). No support for MPEG4, Quicktime MOV, etc. At that price, I might still consider just buying several US$60 DivX Ultra-certified player like the Philips DVP5982, and just use DVD-RW discs to transfer the movies around the house.

I'm sure in the next several months, mainstream consumer electronics manufacturers like Philips will eventually embed network connections to their boxes. And if they get DivX Connected certified, there would be no need for intermediate/gateway devices like the DSM-330.