Categories
Article ICPC Personal

ACM ICPC Singapore Regional 2015

Assalamualaikum everyone.

So, last week, me together with IIUM ICPC Regional Team went to Singapore to participate in the ACM ICPC Singapore Regional competition. In light of that, we were thinking of making a blog post as a documentation for the event. The strategy for making the blog post is that, each member will author their own point of view and we’ll combine them later. So this is my point of view. By the way, mine is more like a series of pictures rather than a long article. So expect some loading times.

Categories
Personal Projects

Thank you for using SemiAutomatic IIUM Schedule Maker

Assalamualaikum everyone. How are you guys? First of all I would like to say thank you very much for using my newest application SemiAutomatic IIUM Schedule Maker. I expect it to get significant traffic, but not this much. For the record, between 19 April 2014 to today 27 April 2014, the application got 9089 visit or 16928 pageviews, 80% of that is from schedulemaker, 10% from scheduleformatter. In comparison, from january 2012 (the start of the application) to 19 April 2014, it received 9335 visits or 19128 pageviews. Within one week, schedulemaker almost surpassed the amount of traffic generated by scheduleformatter for two whole years. 

Selection_017

It is THAT significant. In fact in the first hour after my friend share it, the server’s cpu peaked at 100% for almost half hour. The traffic steadily decreases after that. One interesting fact is that for every day on prereg, the traffic peaked at 11 PM. Assuming that IIUM Student start sorting their schedule at 11 PM is one thing, but actually having the data to say so is a totally different feel.

Frankly I never though that the tools I make because I’m too lazy sort my schedule or make a timetable would get this much traffic, let alone my website with the highest reception. I mean, the number of IIUM student is approximately 20000, google analytic say that there are 5240 users. Lets assume some of them also use their phone/tablet, so the actual number of user is about 4000. So one every five student in IIUM use this application. Someone actually use this. 

One again I would like to say thank you very much for using the application. This will look brilliantly in my CV. And thank you to all my friends who share the application. Like usual,  if I’m the one who share it, it does not work, but for some reason, if someone else share it, it get hundreds of like. It happened with schedule formatter , it happened with this one and it will happen again in the future. That’s it for now, good bye and Assalamualaikum. 

Categories
Article Personal

Why I apply for this scholarship.

This is one of those essay where I write and suddenly I just spew everything out from my finger. Be careful, this articles maybe too frank.
Details of extra-curricular activities. And reason for applying.
Assalamulaikum, and hello. My name is Muhd Amirul Ashraf and this is my testimonial on my co-curriculum activities and also reason for applying for The Star Education Fund.
My primary school is SK Sungai Binjai. Needless to say, many of my activities there, is quite irrelevant right now. In my secondary school which is SK Meru, I do hold several position. Unfortunately I cannot say that that many of my position bring any meaning. Being a normal school instead of cluster or boarding school or MARA, many of the club there are simply just for “name”. Since I join the club in CFS IIUM I learn that the structure of (some) clubs in SMK Meru are simply wrong. In SMK Meru, most of the club advisor tend to just “veto” who get the position. Due to my academic standing which is quite good, teacher do tend to pick me especially since I’m quite active in volunteering on activities like the annual camping or cleaning up the mosque and also once become the access room prefect and later on my form 5 an actual prefect.
In form four, I was CEO of the young entrepreneur club. The young entrepreneur club is a little bit different that other club because it has a subclub called “Permata”. I was the CEO of that club. Under the program of “Permata” or “PUM”, a group of 25 student of each school (preferably form 4) will make a company, and do business. I won’t lie. My company went horribly wrong. That is why you don’t see the certificate of it. Because I do not want to put it in there. I could blame it on the Principal for being biased toward the Koperasi and Canteen, or the advisor for not allowing us to actually hold the money as the requirement of the program, making a real company. Or I could blame the economic downturn that year. But at the end it seems that it is actually my fault for not doing much to help it. The CEO next to me have the same problem (the implementation of program) and so do the CEO after him.
Also in my form four, I was the Director of the Theater team. That went quite well, as you could see on one of my certificate, my team won the Klang Theater competition in 2009. So the directing went well, everyone gave input, and I actually do something. Although the state competition was canceled do to H1N1 plaque, because it was the school’s first theater team, the accomplishment is quite appreciated. On the next year, we only get the third place in Klang’s Theater competition. The first place is won by Semetis, a new contender, which I agree they should win. The second place is won by Dato’ Hamzah, which I totally do not agree. Many competition, that I enter seems to have this strange attribute of “something is really wrong with the judge”.
Aside from that, I had also participated in numerous competition, like the Media Competition, Public Speaking, Chemistry Experiment, Biology Quiz, Forum and stuff like that. Notably the Physic Quiz, in which I received a national silver certificate which mean secondary level. Other than that, I cannot say I have any higher level certificate.
In CFS IIUM (Center for Foundation Studies IIUM), I mostly join a club called PEERS. PEERS is basically the club under the Counseling Unit, or in secondary school term, “pembimbing rakan sebaya”. There I volunteered and join many activities, like Mahabbah Visit to School to MATIQ, the syawal gathering, Counceling week, and others which I cannot recall. I did not accept any position as I fear things would get horribly wrong as in my secondary school. Other that that, I also volunteered on the IPTIM(Institut Pengajian Tinggi Islam Malaysia) Sport Festival 2012 as a committee of the Liason and Welfare biro.
Since I was young, computers has been very interesting for me. My secondary school is not really cooperating in allowing me to enter the IT class. And so, you see that I do not take ICT on my SPM. They say that I am too clever, “why would you want to be a programmer when you can be a doctor?”. So, when I get B+ in biology in SPM, I’m quite happy. Regardless of what people say, I started to learn programming on my own when I was form 3. At first I learn JAVA, and from there I’ve learn a lot as you can see in my resume. I’ve made several project of my own. None is really successful. I mean, if one of my project can generate some revenue, I won’t be applying for this scholarship right? Anyway, a project that I would like to point out here is the Automatic IIUM School Formatter. For me, that is my only project which people actually use. You can see it at http://iiumschedule.appspot.com/. At the start of a semester, I can say that at least 20-60 people use it. Not much, but these are people which is not in my social circle. Not to mention that it has only recently been ported for Main Campus user instead of CFS user. So, for me this project is noteworthy.
The reason I am applying for this scholarship is to get financial aid for my study. I did point out in my resume that I try to work as a freelancer. But frankly I am not good enough. And when I actually do have a client, I will have a hard time trying to manage my time. As an addition, because The Star Education Fund is actually funded by many corporate sector, a link for a starting career is really appreciated.
Categories
Article Personal Politics

Does it matter?

Assalamualaikum everybody. How are you guys? Today, I’m going to write about Sabah. As we all know, three week ago about 200 hundred Philippine who are members of Sultan Sulu’s army has landed on lahad datu in claiming that Sabah is theirs. Following that, 6 local policemen has died, said to be ambushed by the intruder, while more than 10 from the Sultan’s army also died. Then, Malaysian government has decided to end this by attacking the village where the sultan’s army reside. No known number of casualty has been reported until now. In another news, about 10000 militant supporter has been said to attempt to enter Sabah to aide the Sultan Sulu’s Army who is right now being attacked by the Malaysian force.

If you are a supporter for sultan sulu, you will probably say that the one who are intruding is not the Sultan, but Malaysian. As the sultan indeed has a legal binding saying that the Sabah is theirs although the document is almost 200 hundred years ago. My question is, does it matter?

If you say that it does not matter, that there is no point of me explaining this to you. But if you insist on saying that Sabah is the Sultan’s and the one who is living in Sabah is foreigner, let me at least, try to consult you on this. First of all, by foreigner do you mean they do not originate from Sabah? Unlike the Chinese and Indian who obviously migrate here by the British, the Sabah people are still Sabah people. They are the indigenous people of Sabah. In fact, if you say that their ancestor are the people of Sultan Sulu, I won’t denies that. They probably are. But again, does it matter?

After World War 2, communist has been a threat in Southeast Asia, so the British has decided that to make it easier to eradicate them and also to make it easier to give independence to Sarawak and Sabah, if they would merge with Malaya. As you already know, Singapore exclude itself from Malaya, Brunei said they do not want to do so and the merging of the remaining Malaya, Sarawak and Sabah is now called Malaysia. This is roughly 50 years ago. Now of course at that time, Philippine said that Sabah is theirs because it was owned by Sultan Sulu, similar to the Sultan’s claim today. Indonesia also claim Sarawak as their. The situation become even more intense when Indonesia decided to enter Malaysia forcefully. So to resolve the dispute, UN send some commissioner to do a vote among the people of Sabah and Sarawak to see whether they want to merge with Malaya or with Indonesia or Philippine. A very large majority of the people voted that they agree to merge with Malaysia with the condition that they can control their border ( or something like that, I don’t exactly remember ).

So as you can see, Sabah and Sarawak choose to merge with Malaya and form Malaysia. The malayan people do not, just…. migrate to Sabah and repopulate quickly in order to gain dominance. I would guess that malayan simply… do not have the time or simply do not want to do so. I mean, what will they gain? Logs? What? The Chinese seems monopolized the economy there? Even in peninsular Malaysia the Malay do not gain control of the economy. The Chinese does. And if I’m not mistaken, the situation is much better in Sabah and Sarawak then in the peninsular. Is it the Chinese fault? They were here on the British age to operate shops. So its not something strange to see that they dominate the economic sector. And it is obviously not something that we will sacrifice peace in order to overcome. The Chinese and Indian are obviously not originated from the peninsular but still, they are here for more than 50 years. They are people too. What do you aspect us to do? Kill them like the Myanmar did at Rohinga? We are Muslim, we don’t do that.

What does the Sultan Sulu aspect to gain from this? Sabah? Even if they gain authority at Sabah, will the people cooperate? It is no longer the Sultan Sulu’s land. It is the land of Sabah people and they had already said that they want to stay. They do not migrate to sabah. They were born there and raised there. In Malaysia the land are not governed by the central government, It is governed by the State Government. In this case, the sabah people govern their own land. Sultan Sulu may say that the land is his, but what other claim can he give other that with the fact that his father or his grandfather owned the land but then lend it to the British. The people of Sabah has work their way to raise the state up to it current state. They have their own life. Do Sultan Sulu help? Just recently, a militant from the sultan sulu’s army was killed by 20 villager. If the villager support the sultan, why was the militant killed?

While I do agree that the Sultan’s Army should not enter Malaysia just like that, I also do not agree in the way Malaysian Force handle the manner. Just go bomb it? Now 10 000 more are coming. Are you going to bomb them to? People are still people. Regardless Philippine or Malaysian, we both do not want people to die. The current government will most probably not going to win an the election coming in a month of two because of this. The people need to think, where is their allegiance, at Sultan Sulu, Malaysian Goverment or God. If you are a member of the 10 000 people coming to Sabah, I beg you, do not use the name of Islam for your cause. You are not fighting for Islam, you are fighting for Sultan Sulu. And if you value Islam more than the Sultan, you will know in this case Islam loss the most. We loss people Muslim who were said to syahid, but in reality try to kill another Muslim who defend himself and his land regardless which side you are it does not matter, It happen because you came here. Because of this, the name of Islam had once again become associated with extremism, terrorism and irrational behavior. If the 10 000 people win, then the world will say they found another country build from tyranny associated with Islam, because obviously its a monarch and conquered forcefully. And if the 10 000 people died, the world will see again, the Muslim kill each other claiming “in the name of Islam”.

This whole thing will not solve a thing and will create more problem. Please open your mind. Sabah people has their own life. They were born there after sultan sulu’s reign, after the world war 2. If the sultan is indead a righteous and peace loving person, he would not came here with armed force in the first place. Regardless of his claim, It doesn’t matter anymore.

Categories
Personal Projects

Status update!

Assalamualaikum semua! Apa khabar!

Status update:
 Saya akan kembali ke CFS IIUM lusa nanti. Tada! Tak sabar nak balik. Bila dah sampai nak balik rumah pulak. Tak tetap pendirian.

YourAgregator mode:

So, semalam(kalau tak silap saya) saya dah upload YourAgregator update terkini. Untuk upload ini, saya telah update Styler, tambah kebolehan untuk PM walaupun buat masa ini, dashboard PM sangat tidak berfungsi, kebolehan Styler untuk mengubah setiap style telah ditambah so, moderator boleh ubah style Chatter dan agpages yang lain, sedikit perubahan dengan sanitize feed, ada thumbnail untuk post yang ada gambar (walaupun tak ada dalam gambar di atas), dan yang paling jelas, perubahan style asal seperti yang diatas. Somehow, saya rasa ianya tidak appropriate. But its nice to see a new face. Oh ya! Styler sekarang boleh upload gambar untuk dijadikan background.

Automatic IIUM Schedule Formatter mode:
AIIUMSF punya save to facebook button sekarang akan bukak di tab yang baru. So, there is no need for Save dulu baru Save to FB. Dan beberapa bugfix, yang paling ketara ialah sekarang ianya boleh digunakan dengan Firefox (dulu tak boleh, masalah teknikal).

Categories
Personal Projects

About 32 day of holiday.

Assalamualaikum semua. Apa khabar? Mintak maaf, sejak kebelakangan ini, saya agak menyepi. Saya tahu kemungkinan besar kamu tak baca blog ini, dan entah macam mana terbaca pulak harini, yang membawa makna kamu tak perasan pun yang agak lama saya tak berblog, yang membawa makna tak ada gunanya saya mintak maaf tadi. But still, memang saya agak lama tak menulis apa-apa kat blog ini mahupun blog lain seperti rookiecode.blogspot.com dan apatah lagi pembentanganbaikasdacap.blogspot.com yang entah macam mana masih lagi boleh hidup.

So, dua hari lepas dengan rasminya saya telah mengambil kertas exam saya yang terakhir pada sem ini/lepas, maka dengan rasminya saya sekarang tengah cuti inter-semester. Tanggal pada hari ini, maka saya ada 32 hari lagi. So, apa yang boleh buat? Nak cari kerja kat tengah bulan, so macam biasalah jadilah saya macam katak bawah tempurung dengan komputer.

Objectif utama saya pada cuti ini adalah membuat sesuatu yang produktif, lebih produktif daripada main game, yang mana saya rasa tak produktif sangat. Jika kamu adalah pembaca setia blog ini (yang mana kemungkinan besar kamu tak), kamu pasti terfikir tentang youragregator kan? Apakah ceritanya YourAgregator? kenapa tak ada berita lagi? Sudah terbengkalaikah?

Jawapannya adalah…. belum lagi. YourAgregator masih lagi saya tampal-tampal walaupun saya tak cerita banyak. Itu pasal kebanyakan tampalan yang berlaku adalah ketika saya berada di CFS IIUM, so saya tak ada banyak masa dan internet untuk buat blog post.

Unfortunately, tak banyak perubahan yang saya buat kat YourAgregator. Mungkin saya akan blog tentang benda baru yang saya sudah tampal sejak kebelakangan ini kat post yang akan datang. Walaupun demikian, dukacita dimaklumkan, semakin hari saya rasa semakin sukar untuk menampal YourAgregator. Kode nya sudah menjadi agak terlalu komplex tetapi kalau kita lihat di agregatortest.youragregator.com, tidak banyak perubahan yang berlaku. Dan seperti biasa, masalah yang paling ketara adalah design dan artwork yang mana memang saya tak boleh buat. Saya ingat nak mintak tolong dari Iman atau Ammar, member lama saya yang specialize kat bidang ni. By the way, check out my first facebook app apps.facebook.com/howfastcanyoucount  designye ammar yang buat.

So, kat blog post ini, saya akan senaraikan apa yang saya nak buat sepanjang cuti ini.

Plan of 32 day.

  • Make revealer v3.
  • Make DeltaSync
  • YourAgregator artworks and stuff.
  • Blog on rookiecode on how to make a GUI c# app. Also translate to malay in sayaasdacap.
  • Blog on YourAgregator current plan.
Good luck for me, good bye and Assalamualaikum.
Categories
Personal Projects

I’m going bla-bla

Assalamualaikum semua. Apa khabar? Saya di sini migrain baik-baik sahaja.

So, our topic for today is bla-bla, that is, I’m going to say anything I want to say.

So, of course, perkara pertama yang saya akan katakan mestilah tentang perkembangan YourAgregator!. Sejak post yang lepas, ada dua perkara berubah yang dah online, yakni, penggunaan subdomain untuk mengenal pasti agregator anda dan kebolehan search. Dan hari ini, saya buat sedikit percubaan untuk sistem ‘comment’ yang membuatkan saya migrain giler nak mampos! agak keliru camne nak buat nie.

Tapi mari kita mulakan dengan perubahan yang dah online yang paling besar yakni penggunaan subdomain untuk mengenal pasti agregator. Untuk memudahkan penjelasan, mari kita lihat satu contoh yang mudah yakni agregator ‘agregatortest’:

dulu 
http://youragregator.appspot.com/agregatortest/home
sekarang
http://agregatortest.youragregator.appspot.com/home

Nampak? Ya benar, perubahan ini agak besar sehingga hampir kesemua ‘view’ terpaksa di modify sedikit, kerja yang sangat leceh. Kenapa diubah? Sudah jelas, untuk memperlihatkan bahawa setiap agregator itu tidak mempunyai kaitan sangat dengan YourAgregator melainkan di host oleh YourAgregator yang dirinya di host di Google App Engine. Kenapa tak buat dari awal?…….sebab saya tak tau boleh buat camtu :-)…..Satu lagi perubahan di bawah laut, ialah setelah meneliti sistem subdomain ini, baru saya tahu yang subdomain takleh ada huruf besar… ya saya tahu, saya cuai sedikit. Dan disebabkan itu, saya terpaksa menambah satu db-indexer index untuk case insensitive comparison yang mana memerlukan agregator field tersebut diupdate yakni field nama agregator. Malang tidak berbau, saya dah set dari mula yang field nama agregator tersebut ialah primary key kepada entity tersebut yang menyebabkan anda tidak boleh ubahnya melainkan anda delete terus agregator tersebut dan kemudian buat balik dengan nama baru…. saya tahu saya cuai lagi. Dan memandangkan saya nak buat lagi satu option untuk membolehkan admin mengubah nama agregator di management interface, saya ubah primary key table agregator kepada field autonumber tambahan yang menyebabkan segala agregator yang sedia ada, fail to work….kasihan….so saya delete ajelah semua agregator dengan feed-feed yang takkan berguna kalau takde agregator tersebut. Alang-alang, saya delete aje semua database, lagipun ada 3 agregator aje, kesemuanya untuk testing purpose….

So disebabkan itu, saya buat balik agregatortest yang baru dan letak rss-rss macam biasa kecuali blog huda ziad, pasar rss tu dia sendiri yang letak. Hasilnya, apabila anda melawat aregatortest, anda tidak akan jumpa blog update huda ziad. Kalau dulu, pasal blog dia selalu update, kita boleh tengok banyak post dari blog dia…

Ok, selain daripada itu, saya juga tambah field kat table Feeds untuk link ke RSS. Hasilnya, saya boleh buat macam nie…. jap saya ambik screenshot….

yang kat kotak merah tu.

Itu aje? Well… we need to start from somewhere, right? Anehnya, untuk sesetengah rss (iium website), yang tak support link tersebut, hanya keluar perkataan ‘at’. Saya dah buat template tu supaya tak keluar langsung kalau takde link, tapi nampaknya ada sedikit bug di sini. Nanti saya betulkan ok?

Satu lagi perubahan yang dah online yang agak BESAR….. ok, mungkin hanya ‘besar’ ialah kebolehen untuk search.Mari kita lihat lagi screenshot:

Sebarang pertanyaan? Kenapa saya letak kat situ? Well… nak letak kat mana? Sebenarnya ia terletak kat bahagian header yang boleh diubah melalui manage. So konseptnye ialah admin boleh letak search input tu kat mana-mana yang dia suka, kat footer pun boleh. Apa yang ia buat ialah apabila tekan enter kat situ javascript akan meng-ajax semula senarai post-post, macam tekan butang kat atas senarai post, camtulah, benda same aje. Cuba bukak agregatortest, pastu submit korang punye blog, jadi tak? Saya tau saya punye jadi. Oh ya, search engine itu mungkin mengambil masa untuk index korang punye post. Dan lagi satu, perubahan kecil yang membawa kesan besar ialah, RSS yang baru diapprove akan di-scan serta merta, selepas ia diapprove. So, kalau korang submit kat agregatortest yang saya dah set untuk autoapprove, korang tak payah tunggu 6 jam lepas korang submit blog korang, refresh aje beberapa kali.

Ok, untuk (hampir) sepanjang hari ini, saya sedang cuba untuk buat sistem comment. Hasilnya adalah:

Ok, so what’s the problem? (1)st  Its ugly. (2)nd Yang mana satu comment? (3) Cam tak cukup ruang (4) It’s  slow. Jangan risau, comment tak online lagi, saya masih memikirkan macam mana nak letak comment ni. Cam mana nak menampakkan macam comment. Pasal, as you can see… It suck!… and in super early alpha state. Saya terpaksa berfikir macam mana nak buat comment ini pasal, you see, kita boleh comment kat comment yang lain. Itulah konseptnya. Tapi sekarang nak letak butang ‘reply’ pun saya tak tau nak letak kat mana, pasal ia terlalu mengambil ruang. Saya terfikir nak buat page khas untuk comment, tapi camne orang nak tau yang ada comment? Kan? Dan nampak macam sistem AJAX ini sedikit bermasalah, dan kalau nak tau, setiap satu comment itu mengambil masa dua saat untuk load. Dan satu comment memerlukan 3 request. Pertama, check kalau ada reply untuk comment ini. Kalau ada ada ambil reply. Kedua, check kalau ada comment yang seterusnya, kalau ada, Ketiga, ambil comment tersebut. Hah! camtuhah sistemnye. Yang tak siap lagi pasal masalah style.

So, ilham yang seterusnya ialah, esok, kita buat satu page khas untuk satu Feeds, dan kat page tu bolehlah buat banyak-banyak reply. Tapi kemudian macam mana nak buat back button? Macam mana nak update lepas orang post comment? Nak refresh? Amboi! Ambil jalan mudah!. Camne pulak kalau comment tu ialah reply kepada comment yang lain? Camne? Camne? Camne?

Anyhow, itulah masalah saya, bagi comment (kat blog ni bukan kat agregatortest) kalau korang ada cadangan yang bernas atau kurang bernas pun boleh. Sape-sape yang nak submit blog kat agregatortest boleh join, pastu submit blog korang. Saya dah set auto approve. Dan kalau korang tekan ‘nice’ kat post korang nanti keluar “Damn! an error occured” tu pasal korang cuba ‘nice’ post korang . Mane aci! So tak boleh! Pergi nice post orang lain. Error message yang proper sudah dibuat tapi belum upload. Dan sesiapa yang berminat untuk buat design untuk default agregator, boleh join agregatortest, comment saya (kat blog ni bukan kat agregatortest) nanti saya bagi ‘manage_style’ permission. Ataupun korang boleh buat agregator sendiri (login kat youragregator.appspot.com, kat home ada link untuk ‘Create your own agregator’), korang akan dapat ‘superuser’ permission, buatlah design korang. Siapa yang ada permission boleh manage agregator melalui hyperlink “Manage” kat userbar (kat atas kanan page). Kalau takde hyperlink ‘Manage’ maknenye korang tak cukup permission. Ok, bye bye! Assalamualaikum semua!

Categories
Personal

Belia Benci C++

Assalamualaikum, pembaca-pembaca sekelian.

Hari ini saya akan membincangkan tentang satu isu yang telah agak lapuk di dunia ini iaitu

Belia Benci C++

Ya benar tuan-tuan, Belia (sebenarnya saya) Benci C++.

Mari kita mulakan dengan status update saya pada hari ini, dan sebenarnya dari semalam lagi saya stuck kat benda ini. So harini saya telah menyambung project C++ saya yang ke…. saya tak ingat. Dalam pembikinan projek itu, yang sebenarnya agak besar sehinggakan saya terpaksa men-test dahulu bahagian kecil sebelum menyambung implimentasi yang seterusnya. Dalam pada itu, ini merupakan code test tersebut.

void test_gdserialization(){
   std::cout<<"\nDebugging DoubleArray Serialization";
   DoubleArray* thearr=new DoubleArray(10);
   for(int i=0;i<10;i++){
       thearr->data()[i]=(double)(rand()%100)/(double)(rand()%100);
   }
   std::cout<<"\nSerializing, data:";
   QString save=thearr->toString();
   std::cout<<"\n"<
   std::cout<<"\nEnd Save";
   std::cout<<"\nRetry Print";
   std::cout<<"\n"<
   std::cout<<"\nBegin load";
   DoubleArray* newarr=new DoubleArray(1092);
   newarr->fromString(save);
   std::cout<<"\nEnd load,Serializing,data:";
   QString newdata=newarr->toString();
   std::cout<<"\n"<
   if(newdata==save){
      std::cout<<"\nString match";
   }else{
      std::cout<<"\nString does not match";
   }
}

Long story, make short. Basically, apa yang code ini cuba buat ialah ia akan serialize DoubleArray yang pertama menggunakan 'toString()'. Dan ambil resultnya sebagai QString. QString sebahagian daripada Qt framework. Kenapa pakai QString? Kerana implicit sharing yang sangat memudahkan kerja. So dah dapat string daripada DoubleArray tu, kita buat satu lagi DoubleArray dan kemudian deserialize string yang tadi tu. Tapi disebabkan pelbagai masalah yang bermacam-macam dan setalah mengubah-ubah pelbagai code, akhirnya code fromString() menjadi sebegini:

void DoubleArray::fromString(QString data){
    std::cout<<"\nIn Double Array fromString()\nThe data is\n";
    std::cout<
    std::cout<<"Is it ok?";
    std::string buffer(data.toStdString());
    std::istringstream inputstream(buffer);
    boost::archive::xml_iarchive inputarchive(inputstream);
    DoubleArray* thenewone=this;
    inputarchive>>BOOST_SERIALIZATION_NVP(thenewone);
}

Ok, so basically ianya benda biasa. Lupakan perkara yang berserabut pada lima baris yang terakhir. Fokus kepada baris yang kedua. Apa yang ia buat ialah, ia print balik apa yang diberi di method argument yang pertama iaitu 'data' iaitu hasil daripada serialization yang lepas. Kalau kita tengok balik code sebelum ini di 'test_gdeserialization' baris yang ke 9 dan ke 12, ianya adalah arahan yang sama dan disebabkan 'fromString' yang di-call pada baris yang ke 15 menggunakan QString 'save', ia patut bertindak dengan cara yang sama betul? Tapi apa yang terjadi apabila kita jalankan test tersebut:

Haaa!? Ape kes!? Kok jadi begini-deh! Sabar-sabar,  kita gali sikit ape yang jadi...

Teng, teng, teng..... 'memory corruption'.

So apakah yang telah terjadi? Kalau kita cuba google perkara ini, kita akan mendapati yang 'malloc(): memory corruption(fast)' menandakan bahawa program tersebut telah cuba untuk mengakses data di luar range yang telah diminta daripada 'malloc()'. Tetapi ada beberapa kemushkilan, di sini. Iaitu, di function 'test_gdeserialization' baris yang ke 9 dan ke 12, telah mem-print seperti mana juga di 'fromString()'. Hal ini dapat dibuktikan apabila kita menggali lagi dalam error tadi:

Ada perkataan 'end save' dan 'retry print' iaitu std::cout di 'test_gdeserialization' pada baris yang ke 10 dan ke 11, itu menandakan bahawa 'std::cout' pada baris yang ke 9 telah berjaya di laksanakan. Begitu juga dengan 'std::cout' pada baris yang ke 12, dibuktikan dengan mesej:

Perkataan 'Begin Load' patut dikeluarkan pada baris yang ke 13, yang bermakna 'std::cout' pada baris yang ke 12 telah berfungsi.

So... Ape ke hehnye? And then entah kenapa, apabila kite try sekali lagi dalam debug mode, masalahni tak keluar, keluar masalah lain (biasa lah tu). Tapi yang kat release mode masih sama. So far lah.

Categories
Personal

Introduction.

Assalamualaikum, wahai pembaca-pembaca sekelian (kalau ada). Mari saya perkenalkan diri saya.

Kamu boleh panggil saya asdacap (sebutannya saya sendiri tak tau). Itu bukan nama sebenar. Umur saya 18 tahun, saya seorang lelaki (asdacap itu “asd” + “acap”, “acap” = lelaki). Saya sedang belajar di pusat asasi UIA Petaling Jaya, dalam course ICT. Saya tergolong dalam golongan yang kamu panggil ‘geek’ komputer, dan agak berkemahiran dalam bidang perkomputeran.

Tujuan post ini adalah untuk men-tujuankan blog ini dengan memberi introduction tentang ape-ke-heh-nye dengan blog ini. Blog ini adalah blog peribadi saya yang pertama dan saya akan secuba mungkin mengekalkan bahasa melayu dalam blog ini. Walaupun ini adalah blog peribadi saya yang pertama (yang sepenuhnya online … agaknya), ianya bukanlah blog/website yang pertama saya karang. Antara blog/website lain ialah:

By the way, saya sebenarnya lebih selesa kalau menulis dalam bahasa inggeris (pasal rookiecode.blogspot.com) so.. kalau saya campur BM+BI , tambah sambal sikit, tak pedas sangat kan? 
By the way (again), kalau korang perasan, bila korang google “bagaimana membentang dengan baik”, blog saya (pembentanganbaikasdacap.blogspot.com) akan dapat ranking yang pertama. Tak caye? Cuba try sekarang, bukak tab baru, bukak google (www.google.com), pastu taip “bagaimana membentang dengan baik”. Dah? Percaya tak? Ok,ok, saya tau korang tengah cakap “what the @#%& !?, ranking pertama siot!” atau lebih menakutkan lagi korang fikir “Eh, itu blog rujukan aku !”. Sebenarnya, ranking itu memang sepenuhnya nasib sahaja, dan pageview hanya dalam 300 sebulan dan ditambah lagi bounce rate 70%, so memang nasib (yang sebenarnya agak buruk) sahaja. Blog itu sebenarnya sebahagian daripada jurnal saya.
4 result yang pertama + show more result.

Dulu-dulu pada tahun 2009, fikiran saya sangat stress, jadi saya buat jurnal. Dalam jurnal tu, saya tulis macam-macam dalam pelbagai bahasa saje nak lepaskan stress. Lebih tepat lagi apa-apa yang saya rasa saya nak taip. Sesetengah daripadanya saya print, pastu saya bagi kat member-member saya, kenapa? Entah, saja nak lepaskan stress. Kebanyakan jurnal itu sebenarnya agak lawak, macam ada salah satu daripadanya bertajuk “polisi cinta saya”. Yang itu (bagi saya) antara yang agak smart. Dan ada juga yang bersifat sebagai rujukan atau panduan seperti “panduan membentang dengan baik”, jeng…jeng…jeeng… So, “panduan membentang dengan baik” adalah antara article yang saya letak kat internet dengan harapan mungkin ia dapat membantu orang lain. Sebenarnya saya letak jugak semua post-post 2009 yang lain, semuanya berjumlah lebih kurang 22000 perkataan (record whoa!), tapi post yang lain letak kat blog yang lain. Dan sebenarnya lepas 2009, saya dah tak stress sangat, lalu penulisan jurnal saya telah berkurangan dengan sangat drastik, sehinggakan hampir tiada lagi jurnal.
Ops, balik ke cerita, so, saya letak jurnal saya kat blogger pada hujung tahun 2009. Lepas tu, saya bertukar dari pakai yahoo mail kepada gmail, maka saya buat account blogger baru untuk projek-projek baru. Lama kelamaan dalam lepas SPM, saya terfikir nak jenguk balik account blogger lama, saja nak tengok-tengok. 
Blog pertama….pageview…0, cantik… 
Maksud saya, takkanlah google tiba-tiba berminat dengan jurnal saya kan? dengan SEO blogger yang teruk lagi tu… aku check lagi blog lain, 
Blog kedua…pageview 0, cantik…. 
standardlah blog copy-paste tak dapat pageview langsung kan?…
Blog ketiga… pageview 317….
Ehem… pardon me… lap-lap cermin mata, refresh, F5, F5,
 …pageview 318….
So waktu tu aku pun macam “What the ####?”, check-check keyword, try google, “bagaimana membentang dengan baik”….then, aku pun macam “what the @#%& !?, ranking pertama siot!”, macam korang jugak lah kan?
Dah perasan pasal tu, saya pun berasa ter-tanggungjawab terhadap 318++ penggoogle dari malaysia, singapore dan brunei itu, terhadap maklumat tersebut yang sebenarnya ialah jurnal saya. So saya update sana-sini, tukar design, bagi warning -“Ini diari aku la! Jangan percaya sangat kat aku nie!”-, tambah lagi sikit post, sampai kalau korang google “powerpoint berkesan”, blog tu ranking yang ke 3. Tapi setakat tambah sana-sini sahaja. Kalau diikutkan, rookiecode ada lagi banyak post, tapi mungkin pasal rookie code ada banyak competition, jadi pageview pembentanganbaikasdacap.blogspot lagi banyak, buat malu aje.
Post “Powerpoint Berkesan” sebenarnya tidak ada dalam jurnal, ia ditambah.

So, itulah sikit-sikit cerita pasal blog lama saya. Ada lagi blog lain yang takde pageview langsung, tapi pasal agak private sikit (dah diari aku, duh!), kemungkinan besar korang takkan jumpa jurnal lama aku, melainkan aku tiba-tiba lembut hati nak dedahkan segala rahsia yang ada di hati, yang mana probabilitinya agak rendah. 
Anyway, pasal ini post pertama aku, subscribe-lah blog ini supaya jiwa ini terasa lebih dihargai. Sekian terima kasih….Bye…