Programming Projects

List of Quirks when using Spring Framework and Kotlin

I’m not used to the JVM environment. Usually I use NodeJS, Ruby with Rails or PHP with Laravel. But after awhile, I find these dynamic programming environment quite problematic, especially on a large project. Rails is simply too magical, it is dark magic. Sure, it have a nice syntax, but debugging them is quite a hell and no type safety means you really need to unit test your software. PHP and Laravel is not that bad actually, but when the things that makes it nice came from statically typed language, like type hints and IoC container, why not just use a true statically typed language? NodeJS have quite a lot of things. You can have type safety with typescript. You probably can get an IoC container… if you want to use them. But the whole NodeJS environment is way too immature and changes too quickly making it feels quite brittle. Update a package and the whole thing could collapse. Not too mention typescript support really depends on the library maintainer. Its the same case for flowtype too. Except I had worse luck with it.

So, when you want to use a statically typed programming language to make a web application, two things came to mind: C# and Java. Other languages are too not-mainstream enough. With C#, you have .NET MVC and with Java, you have Spring, Jersey and Play framework. The open source version of .NET which is .NET Core is simply too immature. So whats left is Java. Java is quite tedious, but luckily, we have Kotlin, which is another programming language running on top of the JVM with very high interoperability with Java. In the choice of framework, Play framework utilize Akka which is way too different than conventional application. Jersey is actually quite nice, but it does not have a built in integration with other things. Spring is the most famous of them all, so its not that hard to choose, its just that it could be overwhelming.

First of all, what is Spring framework? You need to get this right real quick, because the libraries built around it is quite a lot. At its core, the Spring framework by itself is only an IoC container. Spring MVC is a web framework that have the Model-View-Controller architecture that we want. Spring Data is an umbrella project for data access related things and among those is Spring Data JPA which provides integration with JPA (Java Persistence API) which is a java specification for ORM (Object Relational Model). Spring Data JPA utilizes Hibernate which is a JPA implementation.

Now do you see what I mean by overwhelming? All of these libraries are configured by declaring a Configurer bean. A bean is basically a fancy way of saying class/object with specific structure. You can also configure through XML, but that is old school technique which result is a huge mess of XML. The new way is too declare a Configurer class and configure it with code. In general you’ll probably use a ConfigurerAdapter instead, because Configurer is an interface and you don’t want to configure everything. But still, that is a lot of configuration. Which is why they created Spring Boot, another project which is basically a collection of configurations of these libraries. Spring Boot will detect if you include these library and will automatically apply a default reasonable configuration. ‘reasonable’ does not mean convenient, or in some sense even reasonable. I guess a better word is ‘compatible’ or ‘safe’. Still, it is too invaluable that you probably should google ‘Spring Boot’ instead of ‘Spring Framework’. But what if you want to adjust some parameters of some library? Well, it could be that Spring Boot have already enabled the use of configuration files. Which by default is usually But you can also use YAML. I’m not exactly sure the file name for that. But what are the settings? Here comes the problem with Spring framework in general: the only documentation is its user guide/reference and those references are very long. That, or you go through the source code of Spring Boot or the respective library, which are Java code, which are very long.

Once you get through those long and tedious readings, assuming nothing goes wrong, you get the ability to:

  • Create an MVC controller by annotating arbitrary class, with the base path and so on.
  • Declare a a bean which is an interface that extends CrudRepository<Model, Int> where Model is your arbitrary POJO (Plain Old Java Object) that have certain annotations that declare it as a model. And inject it to your arbitrary other bean (like your controller), gaining a free implementation of your interface that interface with your database.
  • Include liquibase in your gradle, then just declare your migration in resources/db.changelog/db.changelog-master.yaml.
  • Ability to map http body to arbitrary object, effectively parsing JSON request to a POJO, with a single annotation.
  • Return a POJO from your controller method, and it will automatically convert it to JSON.
  • Annotate your POJO with java.validation annotations and annotate your POJO controller parameters with @Valid and it will throw error if the JSON send does not validate.
  • Ability to annotate your bean method with a security expression, and it will throw error if it does not pass.
  • Java’s plain simple and conventional generic and inheritance model.
  • Probably other things too.

If that sounds quite magical, well it is. Maybe too magical, that if somethings goes wrong, you don’t know what happen. Good thing its all mainly Java code, so you got nice IDE support for debugging. But its a whole lot of Java code. A whole lot.

Of course, its not all good. Some of it is quite bad actually. The template is JSP which I’m not a big fan off. You can’t easily rollback your database. I use it mainly for a rest controller. Unfortunately in that regard, Jersey brings more things out of the box. When a validation error happen, it does not report it as a nice JSON. Jersey does that nicely. When a resource is not found and so it fails to bind the resource as parameter, it simply pass an empty resource. Jersey return a nice 404. And of course, when something goes wrong, I’ll take a day or two to find the problem. So here is a list of problem/quicks I found so far. I’ll probably update it as I found more issues.

It is asking for a password, some csrf validation error? And CORS issues.

By default, the spring boot configured spring security will ask for password, which is randomly generated. CSRF protection is enabled, not really useful for REST. Also, CORS will need to be allowed. So I used these config to overcome those issues.

import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.web.cors.CorsConfiguration
import org.springframework.web.cors.CorsConfigurationSource
import org.springframework.web.cors.UrlBasedCorsConfigurationSource
import javax.inject.Named

 * Created by amirul on 31/05/2017.
class WebSecurityConfig: WebSecurityConfigurerAdapter() {
	override fun configure(http: HttpSecurity) {

	fun corsConfigurationSource(): CorsConfigurationSource {
		val configuration = CorsConfiguration();
		configuration.allowedOrigins = listOf("*");
		configuration.allowedMethods = listOf("GET","POST" ,"PATCH");
		configuration.allowedHeaders = listOf("*");
		val source = UrlBasedCorsConfigurationSource();
		source.registerCorsConfiguration("/**", configuration);
		return source;

Model Validation does not work with kotlin.

If you use a data class with the constructor arguments, make sure you annotate the field instead of the getter/setter with something like @field:NotBlank.

In a one to many column relationship, on save, the child’s foreign key is not set, and I’ve specify it in database as non-null, so it will crash.

In a a JoinColumn annotation, make sure you specify nullable = false, like this @JoinColumn(name= "parent_id", nullable = false)

In a one to many relationship, if I remove the child item from the array from the parent object and save the parent, the removed child is not removed in the database.

In the @OneToMany annotation, make sure to set orphanRemoval to true.

I’m getting `org.hibernate.HibernateException: A collection with cascade=”all-delete-orphan” was no longer referenced by the owning entity instance:`.

Yea… the collection in the entity is pretty special. So you can’t just assign them and hope the complex datamapper technique to work. So don’t replace the collection object itself. Call clear and addAll instead.

I’m getting `org.hibernate.AnnotationException: Collection has neither generic type or OneToMany.targetEntity()`.

Try not using Kotlin’s immutable List. Which is the default list. Use MutableList instead. Yeah, I know Hibernate does not play well with immutable data types at all.


Automatic IIUM Schedule Formatter/Maker : End of life announcement

The Automatic IIUM Schedule Formatter/Semi-Automatic IIUM Schedule Maker is probably the most used application that I’ve ever made. That is impressive or disappointing depending on how you look at it. For some reason (probably because there is a problem to be fixed and hence, a demand) quite a lot of people use it. However, because I’m no longer studying in IIUM, I’m no longer one of the people who use it. And because of that, there is effectively no reason for me to support it anymore. Therefore, I’m declaring it life as effectively ending. I make no guarantee that it will stay online.

Here, we see a very ‘seasonal’ usage pattern.

For your information, the application itself did not earn me any money. It does, get me some nice portfolio. Quite a lot of people asked me “Why don’t you sell it to IIUM?”or “Why don’t you put ads on it?”. Well, the short answer is, “That sounds complicated, I’m too lazy for that.”. The long answer is, I don’t want it to ‘matters’ too much and I don’t want to get some ‘feature request’ from some guy, and I don’t want to get into trouble if someone found a bug. It is really, a ‘pet’ project, and I prefer to keep it that way. Plus, asking money from IIUM for something that should do in the first place does not sounds like a very good idea. I sense a lot of bureaucratic issues on that path.

Because it is running on my private server which also host other applications, like this blog, it does not really have a hosting cost. I kinda ‘piggyback’ it on other application. Plus, it DOES automatically scrape data from IIUM server every Sunday (But it turns out, sometimes IIUM change it last minute… after Sunday). Therefore, I don’t really need to do anything for it to function normally. However, every year, I do need to set which year is available, which involve editing about… 2-4 line of code.

This is its original purpose

As I’m too lazy to put any further significant improvement, I’ve open-sourced it several years ago. It seems that not many people know that you can get the source code and see how it works. Probably because I did not put a “Fork me on Github” banner before, which I just did yesterday. I hope that some other geeks can learn from its source code, and create their own version, or better yet, create a totally new one, as the code is quite ugly. The code originated nearly 5 years ago when I was still in CFS. Back then, the popular ‘schedule maker’ part did not exist, only the ‘schedule formatter’ which works on CFS’s slip exist. It was originally designed to run on Google App Engine as I don’t have money for my own server back then. Because of that, the code is pretty much some hacks over some other hacks. Therefore, I recommend that those who want to make a similar system to build one from ground up. You can also, just host it yourself. In fact, when the new I-Maalum system was announced, I was expecting them to also integrate a similar solution, or even just straight up copy-paste it. That did not happen.

So when will it go down? Who knows. The thing is, removing it from the server also take some work, and I’m too lazy for that. I’ll probably just leave it there. If my server crash, I may forget to start the application manually (which happened a few month ago). Once it is up, It does not really need much maintenance, so it will probably stay up for some time. However, for the 2017/2018 session, I’ll need to add that to the server’s config and I can’t guarantee that. Chances are, I’ll forget about it. In fact, I did forget about the 2016/2017 session until someone mentioned it to me. That is assuming no major changes in the IIUM system. If IIUM decided to change the format of their course list page, the scraper will not longer work and it will no longer give you updated course list.

Fork me!

In conclusion, tell your geek friend to make a similar system. I’m graduating, I don’t even know when is the prereg, start of semester and such. I thank you all for your kind support and encouragement throughout these years, I appreciate it. It is truly a satisfying feeling to know that your work helps a lot of people, even if it does not get you money, and the code is very ugly. Also, if you need to contact me, email me directly at Please do not PM me through facebook, as facebook have the ‘message request’ filter. Sorry, if I did not reply to your facebook message if you messaged me a few month ago because I did not realize it, and replying now would be very awkward. That is all from me. Goodbye and Assalamualaikum.

ps: Try reading this article again, but everytime you find the word ‘lazy’, change it to ‘busy’. Its interesting how changing the meaning of a single word can change a lot of perspective. Also its not far from the truth too. 

Programming Projects

Thru Earth Position

Assalamualaikum everyone,

People in US usually said that “China is halfway around the world”, which means that, (given that the earth is round) if you want to point where where is China, you would point it straight underground. I wonder, what about other part of the world? Do North pole also go down? How far down? So I made an app for it called “Thru Earth Position”.

A poor man’s logo.

Why “Thru Earth Position”? The answer is mainly because I can’t figure out a better name. It was originally an augmented reality experiment on how to map location on earth to the screen. Or in another word, I want to move around the screen and the screen will show what location is in front of me. It work, and I thought it was cool, so I made another one, with a 3D globe-like interface. For some reason, the addition of 3D globe visual kinda reduce the feel of AR-ness. 

Something feels off…

That, or mainly because I’m generally a bad designer. The app also shows the distance from your current position. It is relatively simple, with some settings do show or hide elements. It does not use the internet aside from google maps and geocoding to fetch the location name.

The app is actually my first ‘kinda-proper’ mobile application. It is made using libgdx(an OpenGL game framework) and Kotlin(a Java compatible programming language). So, it is kinda an experiment on “making an android app using Kotlin and libgdx with some OpenGL stuff”. It is available on google play store. Which means, it is also another experiment on “what happen when you make a relatively simple app and publish it”. You can find it here. Try it out, and let me know what you think about it.


What’s special about IIUM?

This article was never finished. I publish it in relation to this article, because it shows the environment of IIUM. Some part of this post was cut and some part was added to better reflect the changes.

Assalamualaikum everyone. One of the most read article from this blog is the Past, Present and Future of IIUM. In that article which is actually an assignment for one of my class, I wrote about what I think about IIUM. Two years has passed and I’ve just ended my final studying semester from IIUM. So today I’m going to write an update regarding that in the perspective of a graduating student. I’m going to talk about IIUM Gombak specifically, not CFS or IIUM Kuantan or any other IIUM campus. I’m also going to refrain from talking about Kuliyyah of Information and Communication Technology (KICT). That will come later as a separate post. This post is more of a general review without considering a specific Kuliyyah. Although admittedly, my perspective is influenced by KICT.

The original article have a general critical tone towards IIUM. Somewhere in the article I said that IIUM is not very international, not very islamic, not as “university” as it should, but it is in Malaysia. This is, (although there are some truth to it) not a very comprehensive assessment. There are certain characteristic that makes IIUM special, and I think that article does not do it justice. 

Lets starts with the general physical inspection of IIUM Gombak. Generally, other public university in Malaysia is characterized by a large area with distinct discrete buildings forming the individual faculties, residential area and other facilities.You would definitely need a vehicle to travel between these buildings. These university are generally several kilometer square wide. Some university are effectively a town with faculties scattered throughout it. IIUM Gombak is not like that. IIUM Gombak is characterized by a large circle (not really a circle) of one way road. Most of the faculty (called kuliyyah in IIUM) and facilities is located within this circle. At the center of the circle, lies the main mosque and administration offices. Around it are the various kuliyyah except KICT as KICT is a new building outside the circle, on a hill. Surrounding this circle is the student residential area and some recreational area. Because of this, the university is quite compact. There is no distinct physical separation between kuliyyah. Most kuliyyah are effectively connected to each other. The good thing is, you can walk around the campus without a vehicle. In fact, there are dedicated tunnels under the main one way road between the residential area and the center of the university. However, it would still take about 30 minutes to walk from one end of the circle to the other end. So a motorcycle is recommended. A car however, is not so recommended because you would have trouble finding a place to park your car. That is, unless you study in KICT because there is a lot of empty parking space in KICT.

The climate in IIUM is relatively cold. Some foreign student said that IIUM is quite hot. I’m guessing they never stayed outside IIUM, because its a lot hotter outside of IIUM. The cold climate is because IIUM is surrounded by hills and forest. IIUM Gombak is located at the edge of Selangor. In some way, it is a bit remote. However, there are bus shuttle to the Gombak LRT station and its connected to a highway. This makes IIUM feels like it is somewhat in an urban area. Because it is surrounded by forests, you may stumble upon various form of wildlife. Sometimes you may stumble upon the biggest butterfly you have ever seen. Sometimes a group of monkeys visits you room. Other types of wildlife includes lizard, snake and wild boars. The geographical nature of IIUM, coupled with a not-so-modern building design feels a bit like a garden. There are two rivers flowing through the central complex. Unfortunately they often looks murky. There is a lake at the north of IIUM. Unfortunately it is now a field due to sediment accumulation due to the logging north of IIUM. It was still a lake when I was in my first year.

All buildings in IIUM follows a similar design. I’m not exactly sure why. The KICT building is a bit different, probably because it is relatively new. The design is a bit brownish with blue roof. It is not modern looking. I would describe it as ‘conservative’. Only Kuliyyah of Architecture and Environmental Design (KAED) is a bit different with its main building partially having a wooden structure. One unique thing I found in IIUM is the strange toilet design. Yes, I’m talking about toilet, as strange as it is. There is always an empty space at the side of the toilet where the pipe is hanging at about 1 meter from the floor. This is consistent on every building including KICT. This means that the pipe will never touch the floor. An ingenious design that I hope every toilet would follow. IIUM is a class based university. That means, you don’t see many lecture hall. The lecture is generally conducted in class of no more than 40 student. I generally expect a university to have a large lecture hall. That is not the case with IIUM. The conservative looks, with many classes makes IIUM looks less like a university and more like a really fancy high school.

Physical appearance is only one aspect of a university. Lets talk about the people. In the previous post, I said that there are less than 30% of international student here. And that Malay and foreign student don’t mingle much with each other. That still holds true. However, as low as the ratio may actually be, I don’t think there is a lack of it. Not anymore at least. That is because, I don’t feel the presence of a foreign student as strange. When I see an African, my mind probably says, “That is an African. Ok.”. The lack of international student is not an issue, its the barrier between them. There is a large number of nationality in IIUM. If you asked me from which country that guy is from, I would say I don’t know. Even the one that looks like a Malay (and is a Malay) may actually came from Indonesia or Singapore. The diversity brings a strange sense of non-traditional feel. This is very apparent in the practice of Islam here, which I would describe as lack of Malay-nes. For example, all (most) of the mosque in Malaysia would recite ‘dua’ together after congregational prayer. That is the practice of Mazhab Shafie. However, with the introduction of other culture with different Mazhab, most of the musolla here no longer do so, with the exception of the main mosque. This is probably because most of the time, the imam of the musolla is not a local student. But even with local student, the congregational ‘dua’ may not be recited. Another example would be loud zikr. Throughout my studies in IIUM I can’t recall hearing zikr from the musolla’s loudspeaker. Where as that is very common in Malaysia. So does the readings of ‘yasin’ on friday night. Almost nonexistence. In IIUM ‘songkok’ and ‘kain pelekat’ does not represent that someone is pious. And righfully so, there is no way to know the iman of someone based on his clothing. I also don’t see much ‘serban’ around here. If you are expecting the environment here to be like a religious school in Malaysia, where most student would wear white dressing and ‘serban’ you are severely wrong. The flavor of Islam here is quite different.

Because of the diversity, the Friday khutbah here is conducted in either English, Arabic or Malay. You heard that right, khutbah in English. The Arabic khutbah here is ‘unscripted’ compared to in normal Malaysian mosque.If the khutbah is conducted fully in arabic, someone would give the summary in english after the Friday prayer. Even if is scripted, the script changes. Sometimes they bring some mufti from arabic country to give khutbah. Sometimes big international Islamic celebrity would give khutbah in IIUM, like Mufti Menk, or some western preacher. This means the khutbah here can be quite interesting. Listening to a normal Malaysian khutbah feels like a significant downgrade. Very significant. However, that really depends on the week. Sometimes the khutbah can be as dull as a normal Malaysian khutbah. The ‘unconventionality’ of IIUM is best exhibited by the fact that IIUM is the first place I see that the khatib uses a powerpoint slideshow during his khutbah. 

Unsurprisingly, this unconventionality can be opposed by the largely conservative Malay population. It is not surprising to see people to remind future student to be careful of the various ‘teachings’ of IIUM. Whether these ‘teachings’ is correct or not, I’m not the right person to answer that question. But consider this, these people speak Arabic, the language of the Quran. Which is one of the reason why the Imam of the musollah is usually an international student. They memorize and recite the Quran very well. In (Ishak usually) congregational prayers, the Imam would recite surah which I did not recognize likely because it is somewhere in the middle of Quran. What’s amazing is that, if the Imam forgot the verse (and stutter), several of the ma’mum would remind him (by reciting it loudly). That means, there are several other who remember the surah. This is in the musolla, not the mosque. The ‘level’ of Islam can especially be felt during the month of Ramadhan. Like most Malaysian mosque, IIUM’s mosque conduct 20 rakaat of tarawih prayer. However, 8 rakaat here is as long as 20 rakaat in most mosque. It turns out, it is harder to do 8 long rakaat than 20 short rakaat. Things get even more serious at the last 10 night where dozens of people bring pillows and mattress to spend the night at the mosque. I don’t know about other area in Malaysia, but from the perspective of someone from Meru, Klang, which I would consider a bit religious, seeing people bringing mattress to the mosque is quite strange. Of course, there are a couple of people who spend the night near the end of Ramadhan, but rarely up to a point where they bring matress, and in IIUM there are dozens of them. This is up to a point where the mosque management have to ask the people to stop hanging their clothes on the second floor (there are better area for that on the lower floor). Perhaps such activity is normal in the more religious state such as Kelantan or Terengganu, but not in Klang, not up to that extent. 

IIUM student are also quite charitable. A few months (or year?) ago a viral post in Facebook tells a story of IIUM student who can’t afford to pay for his/her food. That resulted in multiple campaigns around the campus that attempt to seek and help these people. In KICT for example, the welfare committee of ICTSS decided that they would give out free food to whomever needs them. They just bought dozens of food packages and just left them out in the open. So you don’t need to register or anything, just take it. The funds for the food is provided by the student and also the lecturers. In multiple Mahallah, the student launched various coupon system where those in need can take the coupon and use it as a currency to buy food. However, I personally have never seen anyone using it and I probably wont. I do doubt the implementation of the campaign, but it is better than nothing. Occasionally, I found myself in a situation where the cafe’s cashier said that someone paid RM 1 for my food. Who did? Who knows. All I can say is, may Allah bless that guy.

All of this contributes to the relatively safe environment of the University. At least it feels so bit so compared to the outside world. Maybe deceivingly so. This safeness is especially true for a Muslim. In a world where “Muslim are terrorist”, IIUM turns out to be a place where a Muslim don’t have to worry about praying during lecture time, as the lecture time already take that into account. You don’t need to worry about ‘where is the musolla’, as every kuliyyah here have one. And the musolla here is not some kind of extra room re-purposed as a musollah like in some shopping mall. It is a musolla built as a musolla. There is no such thing as ‘awkwardly pious’ in this place, as you can expect everyone here to be at least a bit religious. Islam is not a trend nor a culture here. It is the norm. If you came from a place where being a Muslim is not a problem at all, this probably isn’t a bit problem to you. But the urban area, even in Malaysia is not built to specially to accommodate Muslim. If you are a devoted Muslim, looking for higher education in a non-religious field, there are not many places like IIUM. This is especially true if you think of Universities outside Malaysia.


Article Politics

Review of IIUM

Assalamualaikum everyone,

It has been about 3 month since I left IIUM (International Islamic University Malaysia). Technically, I’m still a student because I have not graduated yet, but my time in IIUM is practically over. So I figure I want to make a review of IIUM as a follow up to a popular article in this blog which is The Past, Present and Future of IIUM .

I’ve tried to make this article a few time actually, starting before Ramadhan. But, I never got to finish it. I went so much into details, I can’t properly put into words what I thought about IIUM. But the more I delay this article, the more the memories become blurry.

To make this article simple, I won’t describe much about IIUM. I’ve describe it quite well on a draft before which I probably would publish on another article. This one is a summary of an introverted KICT (Kuliyyah of Information and Communication Technology) student towards IIUM. I won’t be discussing much on KICT as it deserve its own post. Additionally, it is mostly a criticism rather than a more positive outlook, which I’ve described quite well on the draft.

Feels of IIUM

In summary, the feels of IIUM is quite ‘garden-like’ and very safe. However, I think the safe part is not a very good thing because the world is not safe. Of course, there would still be theft or other crimes in IIUM, but you get the feeling that almost all people here is nice. The ‘safeness’ can be shown by the fact that IIUM provides residential place for all 4 years of study. Even through internship, you can request a room. This is in contrast to other university which sometimes do not provide a hostel for the older student. Because of this, I feel like there is a significant ‘gap’ between before IIUM and after IIUM. I feel like this is not very good towards the growth of the student.

Not only that, but the environment here is quite comfortable for a devoted Muslim. Too comfortable if you ask me. You can find musolla almost everywhere and the time of the course matches prayer time. Additionally, being pious here is not a very strange or contrasting characteristic. In some way, it is the norm. Because of this, it is quite easy to be a devoted Muslim here. However, the outside world is not so forgiving. Of course, that really depends on the place where you work, but if you are unlucky, finding time and place to pray can be a problem. Heck, I could see a situation where even praying five time a day can be seen as bordering extremism. If you have a daughter that you want to keep safe, I could see the point of sending her to IIUM. But if you want her to be independent and can handle the world and all it throws at her, she will need to work more.

It is quite strange that the criticism that I have towards IIUM is that ‘it is too comfortable for a devoted Muslim’. I sound like a ridiculous person. What are the other options? Reduce the number of surau? Make a course during prayer time? Of course not! IIUM did a great job of making it a comfortable university. From the perspective of the university, in this regard IIUM did a great job. But you have to keep in mind that the world can be a dangerous place and I don’t think IIUM did much to prepare the students for it. Of course, you could just find a job in a Muslim company. But in that sense, just being an employee seems to be the limit of an IIUM graduate.

Islamization – Synergy or Compromise

By the looks of it, IIUM aims to integrate Islam with worldly knowledge. I’m sure most, if not all of IIUM student would understand what this means. Basically, we have additional Islamic subjects. All of the student is required to take some Arabic class. And in our non-Islamic subject, additional mark is given if we could relate what we learn with Islam. By the looks of it, ‘general good’ is not considered Islamic enough.

The idea is that, by such integration, the university could create people who can contribute to the Ummah. People who have high education and at the same time, a devout Muslim. But for me, it seems like a compromise. The student are not really an Islamic scholar, and at the same time, the education is not particularly excellent. And sometimes, the course desperately try to integrate Islam up to a point where we have to wonder does this ‘adjustment’ violates Islam itself. Student who took the course IT and Islam would know what I mean. We could see how this forced integration work with the library opening hours. While other university open the library 24 hours a day, IIUM struggles to keep the library open throughout office hours as it will be closed during prayer time.

Of course, to some point, I’m exaggerating. IIUM student are more Islamic than other university student, and the education is kinda up to standard, up to some point. But it does not look like it is going any further. It looks like it struggle to strive for higher standard. For example, I have to take Arabic class, but it is so basic that I can’t speak Arabic. And most student can’t too. With that, I wonder should I even bother taking the Arabic class? Of course, there are one or two student who could fulfill this high standard, but one or two outlier does not represent IIUM as a whole. Of course, it is somewhat unrealistically high expectation to expect most of the student the be such angelic scholars, but right now, I can’t say that we are either angelic nor innovator.

Administration and Finance

The administration of IIUM have a bad reputation among IIUM students. I guess it is mainly for political reason. In case you did not know, IIUM is largely funded by the Malaysian government. It probably used to be different. In short, don’t say bad things to the government, or the administration would figure-out a way to filter out the ‘negative elements’. But in some way, it is due to the ‘alleged’ corruption. Or that is actually mainly because of its inefficiency. Or perhaps, all of it.

Among the most recent questionable decision is the 5 million ringgit fountain. Which is said to be a donation by the President of IIUM. The students are not very supportive of the change of the fountain because there are other things that should be replaced. For example, the notorious chairs of CAC hall. Or they could fund the covered walkway project that cost about 0.653 million ringgit, which is proposed by the SRC(Student Representative Council), which right now, is asking for donations from the student. Or they could replaced faulty air-conditionings throughout the university. Or, they could divide it by 5 and roughly double the budget given to SRC for 10 years. Or, they could divide it by 5 and distribute it to all kuliyyah’s student society which would (significantly?) increase their budget for 10 years. Or, all of them.. except the fountain.

There are other horror stories of course, but I’m not sure about those. The administration have such bad reputation that there are ‘advice’ among the student society saying that if you manage to get sponsorship from external party, do not pass the money to the financial department (that is the official way if I’m not mistaken) because you may never see the money again.

The name

There are some upsides in IIUM. The name of the university attract certain types of people who are passionate in their cause. I know one of the lecturer in KICT used to work in NSU in Singapore, but choose to work here because of Islam. There are other lecturers too that you can see that they care about the future of Islam. And there are various other students and staff that came here for a similar reason. More often that not, these individual forms the backbone of whatever that is amazing here. However, you get the feel that the administration is holding them back through various bureaucratic issues. Throughout my studies I feel like these people in particular is what keeping IIUM alive. Of course, in any University, it is the people who make up what it is. But a University should act as an enabler that helps the students and staff. But for some reason, I see it as the other way around. Regardless of the ‘penalty’, the asset is here. The name continues to attract such individuals and among the limited reasons to choose IIUM over other Malaysian university, this should be on the top list. But then again.. there is also USIM…


In some way, I think half of the criticism I have for IIUM (aside from the administration) is simply because it is just different. There are sayings in Islam that “They (the non-muslim) will never be pleased with you until you follow their way” (It is probably from the Quran, but I don’t remember exactly where and the translation is probably wrong). I guess this is probably the biggest argument towards my criticism. “Ignore the non-muslim and just follow our way”. But for some reason, people don’t think about inviting the non-muslim to follow our way. We are always looking for new enemies instead of new friends. This is especially critical in our times because working with non-muslim is inevitable. Instead of finding new ways to differentiate us from them, we should let them in to our worlds and see from our perspective. I believe that is the direction that IIUM should go. But then again, I could be wrong.

Another thing I want to point out is to not be afraid of something which is not Islamic. I’m not talking about things which are clearly haraam such as alcohol, I’m talking about things like Computers. Like I said before, sometimes the university desperately wants to integrate Islam with something that simply cannot be directly connected. It is as if, if you can’t Islamicize it, it is haraam. This is again, in a similar theme that we seems to look for things to be branded as illegal, as our enemy. If they are not us, they are our enemy. Personally, I think this is among the things that is holding IIUM back. We are too restricted, too terrified by such mindset.

For me, right now, IIUM is not the great education center that Muslim is looking for. It is simply playing catch up to other universities. Although I have to give it some credits for making an appealing environment for Muslim… to catch up.

Article ICPC Linux

How to make a quick and dirty custom Ubuntu-based ISO

Assalamualaikum guys, Last year, for the first IIUM Code Jam, I made a custom made Ubuntu-based linux ISO so that all team are using the same/similar environment. For this year, the contest will be using a different contest system, so I need to change it a bit. I only have one problem, I forgot how to.

So I made this post to remind myself when I forgot about it in the future, or other people, on how to make a quick and dirty custom ubuntu live ISO. The key here is ‘quick and dirty’. That means, I’m going to do a hacky distribution. That means, modifying files that is not meant to be modified due to reasons such as, if the package get updated, it will be overridden, or there would be scattered files, and it probably will fail signature check. Also, bare in mind that I am not familiar with linux application packaging methodology/convention, etc, so what I’m doing here is likely the wrong way, but quick, and it get the job done. I only expect the ISO to be used once, during the contest.

Screenshot from 2016-03-08 23-59-34
But why?

So the easiest way to make a custom ubuntu-based ISO is to use the ubuntu-customization-kit (UCK) software. By default, it have a GUI utility, but it seems to have errors when I tried to run it. So I’m going to use other CLI utility bundled with the ubuntu-customization-kit. A brief summary of what (in general) are we doing. In general, we are taking another Ubuntu ISO as a ‘base’, extract the contest, modify it then create another ISO from the modified files. I’m probably going to skip some (a lot?) of steps that the gui tools do, because I don’t know how to, and it seems to work fine without it. So… bare minimum setup. The ‘base’ ISO I’m using is not the stock ubuntu ISO, but last year IIUM Code Jam ISO which is based on ubuntu 14.04. So lets get started, first you need to install the ‘uck‘ package. I assume, you are currently running an ubuntu based linux to create the ISO. Then, you run:

  • uck-remaster-unpack-iso <the iso file>
  • uck-remaster-unpack-rootfs
Screenshot from 2016-03-09 00-04-25
Step 1

Both of this command (and all other command in this post) need to be run as root. After you run both of this command, some new folders are created at the path ‘~/tmp‘, and the ‘~/tmp/remaster-root‘ seems to be the root of the linux distribution that you are making. You basically now have access to modify anything by modifying the files in this directory.

Screenshot from 2016-03-09 00-07-10
We have it all!

For example, to edit the default background:

  • Copy the new background you want into the directory, preferebly in ‘/usr/share/background‘ (This is in the ‘~/tmp/remaster-root‘, not your running OS root). It can be anywhere, but all the default background seems to be there, so I prefer to just keep it there.
  • Edit ‘/usr/share/glib-2.0/schemas/10_ubuntu-settings.gschema.override‘. Somewhere in the file, you can point to the new background.
Screenshot from 2016-03-09 00-26-21
Just to change the background…

To enter chroot (Basically create an environment as if you are running from the image):

  • Run ‘uck-remaster-chroot-rootfs‘.
  • You now can run as if you are running from the live installation. This is a good place if you want to install any package. For example, I can install the compiler for the contest by running ‘apt-get update‘ and then ‘apt-get install g++‘.

To add item to Unity’s launcher:

  • This is a bit tricky. First, you need to add a new application entry description to ‘/usr/share/applications‘. For example, I made a file called ‘pc2team.desktop‘ which points to a PC^2 binary I copied before. I don’t exactly knows the syntax/format/keys of the file, but modifying existing file seems to work. For those who are curious on the actual file specification, I suggest you look at this link for an introduction.
Screenshot from 2016-03-09 00-31-59
Minimal description
  • The specification also allow to specify link to a website, but for some reason I specify it as an application and run the browser on click. Likely I can’t seem to make it work last year, so I just do it like this. In this example, the link will open the contest page, which is the new web-based online system we are going to use. It’s basically nothing right now, but on the day of contest, I could modify it to point to some IP through the DNS settings.
Screenshot from 2016-03-09 00-46-29
“gnome-www-browser” ? What is this barbaric hack!?
  • To make the entry, shown by default in the unity side launcher, edit ‘/usr/share/glib-2.0/schemas/com.canonical.Unity.gschema.xml‘. Somewhere in the file, there is a list of item that will be shown by default in the launcher. Edit the list to modify the default list.
Screenshot from 2016-03-09 00-49-57
So the contestant should not need to go to the menu at all. Just click the big button.

To remove the ‘install ubuntu’ desktop icon.

  • Simply remove the file ‘/usr/share/applications/ubiquity.desktop‘.
  • There should be a better way to do this, but I can’t seems to find it. So this will have to do.

To add default files in a new user home folder:

  • Add any file you want to be copied to a new user’s home directory in ‘/etc/skel‘.
  • For example, I added a file called ‘pc2v9.ini‘ that has configuration settings for last year’s code jam so that we don’t need to modify the pc^2 settings on each teams.
Screenshot from 2016-03-09 01-00-47
Why port 42002? There is a good reason for that….

Saving your changes.

One you are happy with your changes, run these command in sequences:

  • uck-remaster-pack-rootfs
  • uck-remaster-pack-iso

A new file at ‘~/tmp/remaster-new-files/livecd.iso‘ is ready to be used. You can now start a virtualbox to run it, or create a startup usb drive.   

Screenshot from 2016-03-09 01-11-58

That is all I know. Hopefully this post will be a good reference next time I do this. Bye!

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.

Article Politics

Paris Attack, november 2015

Assalamualaikum everyone. How are you.

Just now, my Facebook friends shared news about what happen in Paris. Another attack happened.

Ah great (sarcastically)… Another attack…

That is among my first sigh. Of course, I googled to make sure that the news is true. Unfortunately it is. Here comes the headache. Some may not realize this, but every time such attack happen, Muslim will be a victim. Hundreds of non-muslim died in Paris. But because of this, when thousands of Muslim dies, deep inside non-muslim will say “serve them right”.

Its not their fault of course. After all, people did die. I would agree that the media do tend to downplay non-terrorist attack, and emphasize on terrorist attack, but the reality is, such attack did happen. Focusing on the media won’t change it. In a few days, there will be anti-Islam rallies all over the world. And I’m going to receive some post in Facebook saying “Such-such country is so anti-islam as they are hosting anti-islam rally”. I don’t think these people understand the issue.

When a terrorist attack, anti-islam sentiment will increase.

Of course it will. What do you expect? Are you going to blame the families of the dead for participating or organizing the rally?

In several days, there will be posts about “Muslim are not terrorist”. I personally believe such thing is merely a ‘damage control’. Several month later, a suicide bomber screaming “AllahuAkbar” will detonate himself, killing more non-muslim. And then what are you going to say? Serve them right for having anti-islam rally? Or Muslim are not terrorist… again?

Various conspiracy theory will emerge, “It’s all hoax! Those terrorist are actually CIA Agent!”, “9/11 was an inner job”, “Its the US who instill extremism to these people!”. Who cares? It happened. As as far as majority of the people on the planet concern, terrorist did it, and terrorist as Muslim. “Terrorist are not Muslim. They are deviant”. Again, who cares? They scream “AllahuAkbar”. They claim they are Muslim.

For me, Muslim should stop focusing on non-muslim, and start focusing on the Terrorist. Non-muslim post an anti-islam post? Ignore it. It is not their fault. The environment make them like this. Instead, we should figure out how do these terrorist emerge? I’ve read somewhere that some ‘Mufti’ permitted ISIS fighter to have sex with their sister. Muslim would recognize this as a clear violation of Sharia law. I mean, clear as black and white. This is not something which is said by one of the Khalifa Arrashidin (like lashing those who drink alcohol). This is something clearly specified in Al-Quran. Why do these people claim the serve Allah when they clearly violate the rules of Allah. Do they even know? That is one. Why do people says that those who migrated to ISIS were former criminals? Drug dealers and such. If so, why do ISIS even take them? Do they even pray five times a day? Are these information even correct? Does it even matter if it is correct or not?

Personally I can only see one solution for this problem.

A country whose sovereignty is not doubt, and whose Islam is not doubt, to eliminate terrorist.

No other situation will fully work. If the sovereignty of the country is in doubt, then the country itself could be labelled as terrorist. If the Islam of the country is in doubt, then a new terrorist group will form, saying that ‘Islam’ is being attacked. If other, non-muslim country attack, then more terrorist will emerge. So which country fulfill this condition? I don’t know. None perhaps. Impossible perhaps. For a country to be considered fully sovereign, the world may demand that it adopt democracy. But if it is a democracy, then most hard-line Muslim would doubt it’s Islam.

Most hard-line Muslim would say, a truly Muslim country must be a caliphate. Well, ISIS is caliphate. Is it a Muslim country? Hisbut Tahrir, an organization who advocate caliphate rule said no, because they do not follow the sharia law. Is that so? Not according to ISIS. But it does have a leader with the title ‘caliph’. What they should be looking for is not caliphate, but sharia law. But what is considered sharia law? I guess, I’m not the guy to define that. But consider this, if you say that scholars are the one who define what is sharia law, ISIS have their own ‘scholar’. Regardless, what matter is that people do not doubt that the law is indeed sharia law.

People would argue, its impossible to have sharia law without a caliphate, let alone in a democracy. But I don’t see why not. If the country parliament voted to cut the hands of thief, would the thief’s hand suddenly be immune to cutting? No, the hand would still be cut. But again, people would argue, that it is impossible that the majority of the parliament would vote for it. My answer is that, that is not the kind of country we are looking for. We want a country in which, not a king nor a caliph, but the people themselves fully, enact sharia law upon themselves. That is the country whose sovereign is not doubt, and Islam is not doubt.

And that, brothers and sisters is what we are looking for.


PROMED 2012 Questions and Answer

Assalamualaikum everyone. A couple of weeks ago, I got a copy of PROMED 2012 questions and dataset. I’m not exactly sure what is PROMED, but it seems that it is like ACM ICPC national level, but not the official national level for Malaysia. Anyway, I got hold of it, and after some time, I manage to answer them all.

Generally, I would put this kind of problem analysis in . However, considering that this have almost nothing to do with IIUM, I don’t think it is proper for me to put this in that blog. Otherwise, would be like my personal blog. That is why you are reading this on my personal blog. Also, regarding the question and the dataset, I was told to put a citation for UITM Perak. So thank you UITM Perak for releasing the dataset. There are 9 question in total. Here are the dataset and question:

PROMED 2012 Questions and Dataset


IIUM Schedule V7

Assalamualaikum everyone. 

Something amazing happened in the past few days. I actually have some spare time. And in those spare time, I’ve manage to update the IIUM Schedule suite of tools with some fixes. For Automatic IIUM Schedule Formatter, the changes are mostly internal and therefore the changes are not so visible. Actually I made the changes several month ago, but for most people, nothing changed. 

The SemiAutomatic IIUM Schedule Maker one the other hand, have one fix and its an important one. Previously the way it scrape IIUM’s schedule data, it assume that for each section, there is only one row. I made it that way because I thought all section is like that. Later on it become apparent that some section data are contained on more than one row. So it originally will only consider the first row. 

Screenshot from 2015-04-14 23:32:50

In another word, previously a significant majority of user did not see the whole section’s schedule. And now it has been fixed. I planned to do a bigger update regarding things like navigation, but it seems that the prereg date is very near. So I just do the fix and declare it V7. Another useful update is now it can consider tutorial classes. It can now prompt you if a tutorial class clash with another section. 

Screenshot from 2015-04-14 23:20:34

That is all regarding IIUM Schedule. On an unrelated matter, for those of you who are interested in programming competition, specifically ACM ICPC, or want to know more about it, I’ve made a post on another site that introduce you to the world of competitive programming. So please check it out and tell your friends about it. That is all for now. Thank you for reading.