Saturday, December 22, 2007

Joomla problem with incorrect SQL export

Today I had experienced a weird problem with my Joomla upload. After uploading to live server, my mod_smoothgallery from OsCandy was not displaying and StopPress Module that should be appear on top all other content was not displaying but was blocking all other so they can not be clicked. When I enter administration site, the menu was not displaying either. Because of that, I thought the problem was only effecting JavaScript related components and also related to files/folder permission mode. I tried to change mode the files and folders, but still there was no effect. And then I installed another instance of Joomla using Elefante Installer, an automated script installer provided by the hosting provider.

After installing fresh copy of Joomla, I check the administration menu bar, and there it was. And when I check the files permission are the same with the one I had. So, I tried to copy all the files to overwrite my site with no good result. Finally I found the problem was with the SQL export-import. I export SQL from my localhost development server by using HeidiSQL and apparently it gives incompatible format so when I import to the live server it was not importing properly. Thank goodness I was using Apace2Triad which comes with PhpMyAdmin so I just re-export from there and re-import from the live server's PhpMyAdmin. Voila! it worked perfectly again. So, the site can run smoothly from now.
Please visit the site at www.chinese-studies.org. We will updating more content in the future, so please visit often for you guys who interested in chinese cultures ;)

Saturday, November 24, 2007

Pivot Table with Multiply Key Columns in C#

I needed a pivot table to display a report to the user in my company, so I tried googling the best and practical way to do that. At first, I was interested in using MS Office components and just pass the data to the component and refresh the template so it will display the data I need. But, the thing is I will need the component also to be installed in the server, and this is not a really high priority apps to put the server in risk to not working for some time if there is anything wrong with the installation or the components it self. So, I decided using the data table manipulation and I found a good example on how to do that in weblogs of sql team here.

However, there is small modification I need to do since the function written there only accommodate single key column. After modified it, I was planning to put the update in comments of the page so I can contribute somehow. Unfortunately the comments is already closed, so I decided to put it here. Find it below. This pivot function is placed in a web service which is going to return a dataset containing the pivot table. After receiving it in the web app, I format the datagrid so it will display as the user need. Yay! Alhamdulillah. Hope it will be useful for other people who need it.



/// <summary>
/// Transform a table to a pivot table based on the given information.
/// </summary>
/// <param name="dataValues">The table which is going to be transformed to pivot table. The table should be sorted by the key colums, starting from most left part.</param>
/// <param name="keyColumn">Array of String which contains the columns in dataValues that is going to be used as a keyColumn for display</param>
/// <param name="pivotNameColumn">The Column name of the dataValues which is going to be displayed as pivot table's column</param>
/// <param name="pivotValueColumn">The Column name of the dataValues which is going to be used to fill the value for the pivot table's column</param>
/// <returns></returns>
public static DataTable Pivot( DataTable dataValues, string[] keyColumn, string pivotNameColumn, string pivotValueColumn)
{
try
{
DataTable tmp = new DataTable();
DataRow r;
string[] LastKey = new string[keyColumn.Length];
int i,keyColumnIndex, pValIndex, pNameIndex;
string s;
bool FirstRow = true;
bool keyChanged = false;

// Add non-pivot columns to the data table:
pValIndex = dataValues.Columns.IndexOf(pivotValueColumn);
pNameIndex = dataValues.Columns.IndexOf(pivotNameColumn);

for (i = 0; i <= dataValues.Columns.Count - 1; i++)
if (i != pValIndex && i != pNameIndex)
{
tmp.Columns.Add(dataValues.Columns[i].ColumnName.ToString(), dataValues.Columns[i].DataType);
}
r = tmp.NewRow();

// now, fill up the table with the data:
foreach (DataRow row in dataValues.Rows)
{
// see if we need to start a new row
keyColumnIndex = 0;
keyChanged = false;
if (!FirstRow)
{
while (!keyChanged && keyColumnIndex < keyColumn.Length)
{
if (row[keyColumn[keyColumnIndex]].ToString() != LastKey[keyColumnIndex])
{
keyChanged = true;
}
keyColumnIndex++;
}
}
else
{
for (keyColumnIndex = 0;keyColumnIndex<keyColumn.Length;keyColumnIndex++)
{
LastKey[keyColumnIndex] = row[keyColumn[keyColumnIndex]].ToString();
}
}

if (keyChanged || FirstRow)
{
// if this isn't the very first row, we need to add the last one to the table
if (!FirstRow)
{
tmp.Rows.Add(r);
}
r = tmp.NewRow();

// Add all non-pivot column values to the new row:
for (i = 0; i <= dataValues.Columns.Count - 3; i++)
{
r[i] = row[tmp.Columns[i].ColumnName];
}
FirstRow = false;

for (keyColumnIndex = 0;keyColumnIndex<keyColumn.Length;keyColumnIndex++)
{
LastKey[keyColumnIndex] = row[keyColumn[keyColumnIndex]].ToString();
}
}

// assign the pivot values to the proper column; add new columns if needed:
s = row[pNameIndex].ToString();
if (s.Length > 0)
{
if (!tmp.Columns.Contains(s) && s != null)
{
tmp.Columns.Add(s, dataValues.Columns[pValIndex].DataType);
}
r[s] = row[pValIndex];
}
}
// add that final row to the datatable:
tmp.Rows.Add(r);

// and that's it!
return tmp;
}
catch (Exception)
{
return null;
}
}

Monday, November 05, 2007

Flashing Windows Mobile 6 to my X01HT

Sometimes ago, I had my HTC unlocked, and it was already able to use other mobile operator connection, but I was still getting the locking screen when I inserted other SIM than Softbank. At first, I only research how to remove the annoying screen, but I found better thing, not only I can remove the annoying screen, I also should be able to upgrade to windows mobile 6, which is very cool. Thank you guys in XDA developers forum! Certainly I already put links to your pages/threads below.

I bought my X01HT on September 2006 so I do not have any problem with ROM and radio version. I will describe below how I made my Japanese Softbank X01HT to an English Unlocked Smartphone with Japanese input and proprietary MMS capability (MMS not fully worked, I will update again if I already solve the problem).
  1. Unlock the operator restriction so it can use all GSM SIM all over the world using Hermes unlocker by POF. Follow this link to find downloadable zip file, download, extract and follow the instructions found in the text file
  2. Flash WM6 mobile ROM cooked wonderfully by Schaps to have an English OS in your smartphone. Download the executable file and run it with active sync active. If you can not download from the link, try this page. Congratulations! Now you already have an unlocked english version windows mobile smartphone. Let's continue.
  3. Time to make your phone displays Japanese, download this Zip file, extract and copy the cab file to your device and run inside it.
  4. Download this MMS Lite, extract and run the CAB file in your device and enjoy Softbank's proprietary MMS.
  5. For the input, eventhough it is said that you can have other type of input, I prefer IME input which it had before. You can download from here, copy the cab to the phone and run it.
The phone is ready to go! You now have an English, Unlocked, Japanese capable Smartphone, with Softbank's proprietary MMS enabled. Congratulations!

Make sure you follow the instructions for each step in each manual found carefully. But, if not you can always start again from the beginning. Don't worry about breaking your phone since step 1 and 2 which is the most dangerous are already equipped with Hard-SPL/SSPL flashing which is said can protect from bricking the phone. That is my opinion, but for more cautious guy, you may want to check the XDA forum first. Furthermore, my X01HT is before Dec 2006 version, so I do not have too much obstacle.


Next step is installing softwares for my phone so I can be more productive and have fun with it. My choice of free powerful softwares to be first installed are :
  1. Mobipocket to read e-books - you can also easily make/convert ebooks from other formats using Mobipocket Creator as simple as drag and drop and synchronize with your device seamlessly.
  2. MS Reader - for ebook with lit format
  3. Pocket Islam - complete package so I can hear Quran while reading the meaning. The sound is linked with the text, it will highlight the ayat that is being played in reciter sound. Cool!
  4. TCPMP with divx, flv codecs - complete multimedia solution. You can play many format of videos and music

Credits:

Friday, August 12, 2005


Eh, ada siapa tuh moto-moto. Oh ayah ya. Ayah kok keliatannya sayang banget sama Kia ya..hehehe Ge eR Posted by Picasa

Hai om2 dan tante2,salam kenal. Aku diberi nama Annisa
Tazkya Azizah oleh ayah eko dan bunda dessi. Kia lahir
pagi ini di Midori Byouin Yokohama-shi Aoba-ku, jam
8.13 waktu Tokyo,GMT +09. Berat bdn Kia 2.2kg jadi
keluar dari bundanya gampang. panjang tbh kia 42cm.
Agak kecil sih,maklum ayah dan bunda imut2 sih.
Walaupun kecil,tp kia genki lho, hasil tes afgarnya
10,10 dari 11. Artinya semua organ tubuh Kia responnya
bagus. Pas baru lahir Kia langsung nangis
kenceng,soalnya dunia ini kurang nyaman dibanding dlm
perut mama sih. Tp mata kia lgsg melotot lihat sana
lht sini. Eh, pas lihat ada bunda...berhenti ah
nangisnya, diganti ama senyum dikulum aja. Sampe skrg
Kia blm mau nangis dulu lagi ah. Soalnya ngantuk mau
bobo dulu, ntar bgn lg jam 11 mlm spt biasa waktu di
dalam perut bunda, hehe. Eh, sblmnya mimi cucu dulu
dong,nyam nyam. Walaupun sayang, blm boleh mimi cucu
bunda ama tante2 susternya. Mereka baik-baik, tapi
ketat banget. Dan kyk tmn2 kia yg lain disini, baru
bobo brg bunda stlah 2 hari. Hiks bunda pasti sedih,
Kia jg sih,tp Kia kan ditemenin malaikat, jd ga
kesepian. oh iya,ini ada foto Kia, jgn naksir ya,ntar
dimarahin sama ayah lho. Ya udah gitu dulu om2 dan
tante2,doain Kia cpt gede ya,jd anak
sholihah,pinter,cantik,sehat,kuat kyk doanya ayah
bunda Kia. Sampai ketemu nanti, makaci ya.daaa.. Posted by Picasa

Hai, perkenalkan, saya Annisa Tazkya Azizah. Ayah Bunda memanggil saya Kia. Posted by Picasa

Monday, March 14, 2005

Just Blogging

Pulang kerja kali ini terasa sangat menyenangkan, besok akan bertemu kembali dengan istri tercinta. Sudah dua minggu ia berada di tanah air, berada bersama keluarga yang mencintainya. Senang rasanya mendengar suaranya semakin bertambah ceria. Dua minggu, perpisahan yang cukup membuatku sadar betapa berarti dirinya. Rindu hati ini ingin bertemu, walaupun setiap hari berbicara di telpon sambungan internasional, Jepang-Indonesia tidak bisa menggantikan kehadirannya. Belum lagi, rasa khawatir membiarkan ia pergi sendiri, melalui angkasa, melintasi samudra, bersama anak kami yang masih berumur 4 bulan dalam kandungan. Aku hanya bisa berdoa memohon perlindungan Allah SWT, dan Allah adalah sebaik-baik teman dalam perjalanan. Ashita wa Narita e tsuma o mukae ni ikimasu, ureshii yo. [ 明日は成田へ妻を迎えに行きます、嬉しいよ。]

Alhamdulillah, sudah sejak seminggu lalu aku mendapat suasana kerja yang baru, setelah menunggu lebih dari 4 bulan. Tidak seperti di tempat kerja yang lama, sekarang aku dapat berbicara dengan leluasa dan jari-jariku dapat mulai bekerja seperti biasa di keyboard komputer. Disini pula, aku dapat bertemu dengan teman-teman yang baik-baik di tempat kerja sehingga membuatku terhibur.

Hari Minggu kemarin, aku pergi bersilaturahim ke rumah seorang teman senior (Ahmad Rusdiansyah - Doddy) yang mengadakan pesta barbeque karena dia akan kembali ke Indonesia dua minggu lagi setelah menyelesaikan studi Doktor nya di bidang Teknik Industri. Selain teman-teman dari Indonesia, 4 brothers dari Mesir pun hadir, semuanya sekitar 20 orang. Suasana yang ramai dan hangat tercipta ketika kami mulai menyiapkan makanan bersama-sama. Obrolan-obrolan kecil dan lucu dilakukan dalam berbagai bahasa; Indonesia, Jawa, Sunda, Jepang, Arab (Mesir), dan Inggris. Lieur deh...

Walaupun kami semua merasa lapar ketika datang, semuanya saling mendahulukan saudaranya, dan alhamdulillah, makanan yang ada cukup berlimpah untuk semua, walaupun makannya harus dilakukan secara berkala, karena makanannya harus dimasak terlebih dahulu . Setiap masakan matang, langsung dibagi-bagi secara merata.

Alhamdulillah ya Allah, aku diperkenankan berkenalan dengan saudara-saudara seiman yang sholeh-sholeh disini. Pesta barbeque ini tidak hanya dilakukan untuk makan, setiap kali pertemuan harus dapat mengingatkan kita kepada Allah. Setelah makan selesai, kami mulai pembacaan Al-Quranul Qarim oleh brother Ismail dari Mesir yang membacakan surat-surat awal Al-Quran dan dilanjutkan dengan doa. Para malaikat pun turun menaungi kami, sejuk. Begitulah yang aku rasakan dalam hatiku, seperti yang disabdakan nabi SAW. Selesai pembacaan doa, para brothers yang sudah tiba saatnya untuk meninggalkan Jepang kembali ke tanah air masing-masing diminta untuk menyampaikan pesan dan kesannya hingga tiba saatnya sholat magrhrib. Alhamdulillah, karena berkahNya, ruangan berukuran 6 tatami dapat digunakan untuk sholat bersama-sama belasan orang. Beginilah indahnya silaturahim.

[Tuhan] Yang Maha Pemurah, Yang telah mengajarkan Al Quran. Dia menciptakan manusia, mengajarnya pandai berbicara. Matahari dan bulan beredar menurut perhitungan. Dan tumbuh-tumbuhan dan pohon-pohonan keduanya tunduk kepadaNya. Dan Allah meninggikan langit dan Dia meletakkan neraca keadilan. Supaya kamu jangan melampui batas tentang neraca itu. Dan tegakkanlah timbangan itu dengan adil dan jangan kamu mengurangi neraca itu. Dan Allah telah meratakan bumi untuk makhluknya, di bumi itu ada buah-buahan dan pohon kurma yang mempunyai kelopak mayang.Dan biji-bijian yang berkulit dan bunga-bungaan yang harum baunya. Maka nikmat Tuhan kamu manakah yang kamu dustakan?
(Surat Ar Rahman: 1-13)