Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Monday, December 14, 2009

IEC Christmas 2009 / Projector Calibration

We just finished with our church Christmas Celebration, it was tiring, but it was worth it. We had wonderful team working together to serve God in this event. Great job guys and gals!


GII Christmas 2009 Crew

I would like to share one challenge we encounter in the visual presentation team. The challenge actually starts last December, but I just write about it now. Last December, we are asked to utilize projector for helping audience to virtualize settings in the drama, since we do not have any physical stage decorations. So far so good, we just create the contents and display them using appropriate program. Ideally, we will have something like the following.


Ideal Projector Placement (credit to Martin for the illustration)

However, we could not implement the ideal projector placement. We have problem hanging the projector, as we do not have skill to build custom mounting bracket that could be hang on the curtain's rod (i.e. we rent the building, so we could not mount anything on the wall). Ehm...trouble, fortunately, I found an idea that we could use. If I could put the projector on the side and adjust the perspective, I could achieve larger projection size without obstructing drama/choir people and I do not have to hang the projector at the top center. In short, the program development is started right away and the first version is used last December, unfortunately, with a lot of bugs :(


Implemented Projector Placement (credit to Martin for the illustration)

In the initial release, the ideal perspective could not be achieved, because I only consider translation, scaling, and skewing. I miss rotation. Hence, on last December event, half of the projection image looks ok, the other half looks stretched :( Moreover, there are heavy memory leak on the program at that time as well, so video playing is pretty bad.


Image on the left side is ok, but it is stretched on the right side

Time passed, the program is still used on Easter, but this time we avoid placing projector at extreme angle to avoid rotation problem I mentioned above. We are ok this time since the building we rent has enough space that allow us to do rear projection, and we also put another projector on the balcony. In total, we used three projectors: two projectors for rear projection to form 2048x768 resolution, and one projector on the balcony, mainly used for subtitle and video (i.e. projector calibration is disabled on this projector).


GII Easter 2009 Celebration

This year, we are renting the same building as last year. Ehm...I am pretty scared when hearing about this. I suggest to the stage coordinator (ko Hendri) to find a way to mount the projector on top at the center of the stage.

In the mean time, I try to go through my program's code to perform various improvements, I also added rotation as one of the variable when adjusting the perspective. I fix most of memory leak, but I am sure there are still some that still exist. I do not have enough time to dig into this. However, we are able to handle video playing at 1024x768 without any problems.

So I notify ko Hendry and do demo to show that the program could be used again this time. He agreed and then we proceed with it. We do however need to rent a projector with 4000 ANSI Lumens, since our projector could not handle it (ie. 2500 ANSI Lumes).


2009 GII Christmas Celebration (Image Courtesy of pak Felix Teja)

That's it, I forgot to mention that everything is done in Flash, which could easily top up CPU usage. Machine on the left (gray machine) is used as controller for both audio and video. Machine on the right is running the projector calibration program only. It is being controlled via socket by the gray machine. I used my Android G1 to remote control the audio and WiiMote to remote control the projector calibration program. It is possible to control everything just with mouse and keyboard, but I am more comfortable with this setup.


The Machines

For the next version, I am planning to bring everthing to OPENGL, GPU could give better horse power especially when we want to play HD video.

That's it for now.

Monday, October 5, 2009

Automating inDesign for Repeating Content and QR Code

Our church is going to hold Bible Camp this coming week. We are all getting busy preparing for this event. I am responsible for creating publication materials, such as event booklet, brochure, name tag, etc.

Creating name tag might sound easy, but how about creating name tags for 50 persons. It will be painful to do it manually, copy and paste the layout plus typing names fifty times. So, I did some reading on Adobe inDesign documentation and found out that it's possible to create placeholders for repeating content using XML. Here is the article that I used. I just need to design the name tag, generate XML data for all attendees using Perl script, import XML to inDesign, and inDesign will do the rest of the work.

Generated Output by inDesign

Notice above figure, there is small box on the right of each name. It is QR Code containing information for each person. I was thinking that since I am going to automate the name tag creation process, why not adding some extra information. I decided to add QR Code and our team decided to add color coded group information (i.e. person with the same color belong to the same group).

Bible Camp GII 2009 Name Tag

I wrote a PERL script for grabbing contact information of each Bible Camp 2009 attendees from our church database and use GD-Barcode module to generate the QR Code associated to each individual.

Most people nowadays have phone with built-in camera, and most of them can decode QR Code. So, I think this as a good way for letting people to exchange their information with each other easily during our Bible Camp event. That's it for now. Following QR Code contains our church contact information.



Decoded Message on Android

Tuesday, September 29, 2009

Alkitab for Android Phone

Holy Bible in Indonesian is called "Alkitab". I am currently using Android Developer Phone 1 as my main phone, and I cannot find any "Alkitab" app yet on the market. I knew that Alkitab app exists for iPhone and J2ME platforms. Hence, I decided to develop one myself. Please keep in mind that the content of "Alkitab" is copyrighted by Lembaga Alkitab Indonesia (LAI).




You can download the apk file from here. For instruction on how to install .apk file into your Android phone, please go to this link. I am using Apps Installer from Android Market to install apk file from sdcard.

After application installation is done, please go here to download the database. You need the database to run the application. After you obtained "alkitab_db.zip", perform following steps:
  1. Connect your phone to your PC using USB cable and mount the sdcard
  2. Extract "alkitab_db.zip" to root folder of your sdcard. After extraction is done, you should see folder "alkitab_db" at your sdcard root folder
  3. Unmount your sdcard by clicking "Turn Off USB Storage" on your phone
  4. Start the application.
I will explain features available in this initial version.

Text Filter (on Android device with physical keyboard)

Type in the text using keyboard and the list will be filtered accordingly.



Gesture Motion

When you are in chapter or verse screen, you can swipe you finger on the screen to move between books/chapters. Swipe to left will bring you to the next book/chapter, swipe to the right will bring you to the previous book/chapter.


Search for Chapters/Verses

Clicking menu button will allow user to select this feature. This feature is used to search for chapters or versions in the bible, following are accepted input patterns:
  • [book] [chapter], Mazmur 3
  • [book] [chapter]:[verse], Matius 3:15
  • [book] [chapter]:[start_verse]-[end_verse], Kisah Para Rasul 1:3-5
  • [book] [start_chapter]:[start_verse]-[end_chapter]:[end_verse], Yohanes 10:5-11:3
  • [book] [start_chapter]-[end_chapter], Lukas 5-10
  • [book] [start_chapter]-[end_chapter]:[end_verse], Roma 3-5:13



Search For Word

If the search input does not match any of Search for Chapters/Verses patterns, the input will be used as keyword to search for match words in the bible. Searching using keyword feature will require the phone to send request to remote server instead of searching through local database. Local database is flat file database and it will take long time to find the match keyword. If you do not want the phone to connect to Internet, do not use the search for word feature.




That's it and I hope the app can be useful for everyone. Email me closari[at]gmail if you encounter bugs or have suggestions for improvement.

Android 1.6 Image for Android Developer Phone

HTC finally released Android 1.6 image for Android Developer Phone, available here.

I have upgraded my phone and now it's running Donut.


I haven't check all the features yet. One thing I noticed is that the camera/camcorder app has new user interface and it's faster compare to previous versions.


I also noticed in Settings, Speech Synthesis is added as part of the Settings items. However, it lacks of Indonesian language. So far I have been using Eyes-Free for performing TTS on my application. Their packs include Indonesian as one of the available languages. I am not sure why Google did not include Indonesian in 1.6, since the TTS service in 1.6 is basically derived from Eyes-Free project.

That's it, I will start playing with new gesture recognition feature added in 1.6.

Saturday, September 19, 2009

Android Developer

I found this in goodies section at android.com. It's pretty cool. It's almost one year now since I started writing applications for Android.

Tuesday, August 19, 2008

Can't Connect to MySQL Server: error 10061

I encounter this problem when trying to connect from my development machine to Coniques database server, which is hosted on different machine. I have setup all user permission to make sure that user can connect from remote host.

The database server is running Ubuntu Server Edition using MySQL as the database engine. The development machine is running Windows XP Pro and I utilize MySQL Connector/ODBC 3.51 to connect. I get following error message when trying to connect:
[MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'server_name' [10061]
I then try to connect using command line:
mysql -h server_name -u root -p
and get following error:
ERROR 2003 (HY00): Can't connect to MySQL server on 'server_name' (1111)
This must be some kind of stupid configuration error that I do not know about. I spend some time googling around and manage to find the solution:
  1. Edit the configuration file located at /etc/mysql/my.cnf
  2. Find the line bind-address = 127.0.0.1. The default value 127.0.0.1 means that it will only accept connection from local machine. I change the value to 0.0.0.0 and save it
  3. Restart MySQL by issuing /etc/init.d/mysql restart
Now, I can establish connection from the remote machine.

Monday, June 2, 2008

Adobe Air - Keyboard Event in Fullscreen Mode

Recently, I get error when launching my custom movie browser. It says:
“This application requires a version of the Adobe Integrated Runtime (AIR) which is no longer supported. Please contact the application author”
I go to Adobe site to download the latest AIR and also the latest AIR SDK for Flash. After I install everything, I open Flash and start generating the new AIR installer for my application.

I get error message when trying to install the application. The error says:
"The application could not be installed because the AIR file is damaged. Try obtaining a new AIR file from the publisher."
Ehm ... very weird, I am the publisher and I just generate the installer file. I try generating new installer several times but no luck. I uninstall AIR and reinstall it again, and it works !!! Weird ...

Next problem I encounter is that my program does not allow me to trigger KeyboardEvent while I am in fullscreen mode. The KeyboardEvent is working fine if I am not in fullscreen mode. This reminds me of restriction I encountered in Flash AS 3.0. It is very confusing, it still worked the last time I make changes to my application, which is about two months ago.

Then, after googling around, I find that Adobe changes the AIR API, I need to set display state to FULL_SCREEN_INTERACTIVE instead of FULL_SCREEN only to allow KeyboardEvent in fullscreen mode.
stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
Two hours wasted trying to solve this problem :)

Wednesday, February 28, 2007

File Sync'd App

Akhirnya selesai juga satu project saya, membuat file sinkronisasi applikasi buat kantor saya. Applikasi ini saya kira lumayan sederhana untuk dibuat, tetapi saya ternyata menemukan beberapa hambatan selama proses pembuatan.

Applikasi ini akan mengambil data tentang semua client dari database, terus melakukan sinkronisasi antara server dengan semua client yang ada. Terus saya juga membuat simple scheduler untuk mengatur banyaknya proses sinkronisasi yang bisa berjalan pada saat bersamaan. Jadi, semua client harus memalui queue list (antrian) sebelum memulai proses sinkronisasi dengan server.

Dari pengalaman ini, saya belajar menggunakan thread untuk menampikan sinkronisasi status di Windows Form TextBox. Pada awalnya, saya tidak menggunakan thread, dan alhasil, tidak ada text yg muncul di TextBox selama proses sinkronisasi berjalan. Textnya baru muncul setelah proses sinkronisasi selesai. Threads arefun if we can manage them :)

Project selanjutnya akan melibat penggunaan teknology nirkabel Bluetooth untuk file transfer. Yuhu :)

Monday, February 12, 2007

PHP in Nutshell

What a week ... I just finished coding my brother's company website. The site is developed using PHP which is totally new for me. I could just use some free e-commerce software, however, I want to get some experiences with PHP, as well as adding another ability to my programming skills.

I have experienced with ASP before, so it's actually not that bad to learn PHP. Previously, I learned ASP and finish my company content management system project in a week. This time, I also learned PHP and finish the website in a week.

Based on a week of experience :), I will say that I felt like I have more control with PHP compare to ASP. PHP is more tedious in some ways, because programming ASP in Visual Studio is really easy with all built-in controls. While for PHP, you need to understand more in order to start the programming. Anyway, I might be wrong since this is based on a week of experience.

One bad thing about PHP is that I still could not find an IDE that is as powerful and easy to use as Visual Studio. Following is the screen shot of the website. It's still simple, but it's very dynamic and easy to update. More features will be added in the next release, not sure when :)

Xtremespot Website