Wirawan Winarto

Microsoft Student Partner
See also: Other Geeks@INDC
Cara Menghaluskan Gunung

Cara menghaluskan gunung di dunia 3D.

Jika berkutat dengan XAML dan WPF, kita tentu tahu bahwa segala model 3D tersusun atas segitiga. Jadi mau membuat bentuk apapun, segalanya tersusun atas segitiga. Dari segitiga-segitiga itulah terbentuk berbagai macam model, mulai dari tank, mobil, pesawat, robot, orang, dan bahkan tanah. Kali ini saya mau kasih sedikit info soal cara menghaluskan pegunungan supaya nggak lancip-lancip.

Di dalam pembuatan suatu terrain, tanah dipetakan berdasarkan ketinggian seperti berikut :

Pertama yang kita lakukan adalah mengkopi grid tersebut menjadi dua, ini penting! Sebab hal ini bertujuan supaya grid yang sedang anda proses tidak memanipulasi grid yang asli.

Kita mulai saja dari titik (2,2) di mana kita temukan gunung setinggi 10. Maka kita mulai hitung seluruh titik yang mengelilingi gunung tersebut dan kita temukan rata-rata seluruh titik tersebut kemudian kita jumlahkan dengan ketinggian gunung dan kita bagi dua.

Tinggi gunung 10, sementara ketinggian sekitarnya = 0 + 0 + 0 + 0 + 10 + 0 + 3 + 5 = 18. Adapun ketinggian rata-ratanya 18/8 = 2.25. Kita jumlahkan 10 + 2.25 = 12.25 dan kita bagi dua menjadi 6.125. Nah itu akan menjadi ketinggian tanah berikutnya.

Lakukan langkah yang sama terhadap seluruh titik sebanyak masing-masing satu kali berdasarkan grid yang asli.

Setelah selesai, lakukan iterasi sejumlah yang cocok untuk menghasilkan 'gunung terbaik' yang anda inginkan. Apabila kebanyakan, tanahnya bakal rata. Namun apabila terlalu sedikit, tanahnya bakal curam. Trik yang serupa digunakan oleh image editor macam Photoshop untuk mengatur smoothness dan sharpness dari sebuah gambar.

Tanpa penghalusan :

Dengan sepuluh kali penghalusan :

Terlihat lebih natural, padahal justru nggak natural.

Share this post: | | | |
Posted: Apr 15 2008, 02:14 AM by wirawan | with 1 comment(s)
Filed under: , ,
Not A Lecturer... :-(

About my previous post...

He has decided to take a Ph.D program instead. Sorry.

But of course after he is getting that degree he will be a lecturer... Duh!

Share this post: | | | |
The First Lecturer at Imagine Cup?

The submission deadline for Imagine Cup is tomorrow.

Yes! And today is the last chance to fix our solution. I will once again lead my team to the Microsoft Imagine Cup final on Jakarta and, also hopefully, Paris. Here is our team :

Our team consists of three students, one fresh lecturer, and one professor (as mentor). Now I want to inform you a little about the new lecturer. Mr.Chusnul has just graduated and will start his job as a lecturer. According to the rule this is still allowed, because at the time of Imagine Cup registration he was still a student. It means (maybe) he will be the first ever lecturer who competes in Imagine Cup Indonesia!

Mr.Chusnul will be teaching on Departement of Agricultural Engineering of Bogor Agricultural University. His expertises are on Greenhouse Technology, Greenhouse and Hydroponics, and also Strength of Materials. He knows a lot about sustainability (the theme for this year Imagine Cup) and once has published his research on "International Symposium on Ecological Service Functions for Sustainable Agriculture in Asia" at Ibaraki, Japan.

Now we still need to work hard, really hard, to win the Imagine Cup this year because other teams are just as good, if not better.

Um... about Mr.Chusnul... Yes, he knows how to code. On Visual Basic.

Share this post: | | | |
Bingo! This Is My (duh!) Room

Dude, my previous post is an April Fool's joke (peace!). Actually this is my room :

I am a bit surprised (really) that people think I was serious. Hehehe...

Update : People will ask whose room was that? Hm... that's my old room. My "kos-kosan" rent is over and I decided to move to another place instead of continue my stay there. But I have an idea to mess up with my room on my last day and took the picture of it. Hehehe... as an April Fool's joke.

Share this post: | | | |
Posted: Apr 03 2008, 02:58 AM by wirawan | with 15 comment(s)
Filed under:
Clean Room Means No Work!

I strongly agree with this one : "Clean Room Means No Work"

Because clean room means that we spend more time on cleaning than on working! That is why I never cleaned my room any single time since I moved to Bandung from Solo (almost three years). Look at these pictures of my bedroom :


after opening the door, you will see this...


that is my PC close to my bed... too close.


look at the floor, can you name those things?

See? My productivity increases (I can say almost 200%) because my mind focuses only on my job instead of doing useless things. I believe this condition enables me doing many great things, say : last year Cakrawala project for Imagine Cup 2007 (we won third place and I did all the code by myself). I never stop recommend my friends to do this and most of them said that their productivity has also increases greatly ever since.

How about yours?

Share this post: | | | |
Posted: Apr 01 2008, 12:27 PM by wirawan | with 15 comment(s)
Filed under:
Just Got eBox 4300 From Microsoft

Fifteen minutes ago, I have just received a packet from Microsoft.

Everytime Microsoft sends me something it must be something really 'big'. But this one is an exception. A small and lightweight device, but still... packed in a 'big' brown cardbox. Also, I am a bit furious that the delivery service taxed me for this.

It is an eBox 4300 (Yeah. eBox 4300. Not XBox 360) plus a Windows Embedded CE 6.0. Actually, they also came up with Visual Studio 2005 Professional Edition and SQL Server 2005 Developer Edition. Just in case you have never heard of it, eBox 4300 is a compact device designed for applications where physical space is limited, or in my case : car.

It can be mounted on any VESA standard fixture allowing it to be secured to desks and other surfaces. Also, it can be mounted to the back of any LCD monitor creating a mobile presentation system, saving space in a work environment. This device is still rare in Indonesia.

Wow! A mini-sized computer that runs Windows!

This is a part of Imagine Cup 2008 - Embedded Development Invitational. My team has passed the qualification round (round 1) and now we are competing with team from all over the world to grab 15 tickets available for the worldwide final in Paris. My team consists of four members from three different universities. They are Yudhis (IT Telkom), Adi (President University), Atmoko (Gunadarma University), and me (IT Telkom) as the project leader. For helping us continue our project, Microsoft provided us with devices and softwares we need. If we can pass this round, we will represent Indonesia in the worlwide final, of which will be very cool.

What if we failed?

For me there is no such thing as failure. Everything is part of learning. But just in case we cannot make it, I am planning to use this device for IT Telkom's research purpose and also for running a workshop about Windows Embedded on my campus. Anything will do.

Share this post: | | | |
Opera Gets No Silverlight Support

I am always in doubt that Silverlight will beat Flash.

Brad Abrams has posted Silverlight 2.0 Developer Poster here (it's 6.5 MB). It is great to see some new improvements on Silverlight. But one thing that shocks me is Microsoft cancelled Silverlight support for Opera.

Being a loyal Opera user for eight years, I find that Opera is simply irreplacable. But until now I have to use multiple web browsers just for viewing Silverlight content. Silverlight is cross-browser and cross platform? I don't think so.

On April 2007, Microsoft announced that Silverlight support will be available for Opera. It is also said that Silverlight team is working with Opera team on making sure the browser will support Silverlight. This is surely a good news for Opera users but it just never happens. I think if Microsoft really want to make Silverlight a truly cross-browser and cross-platform they should support more browsers. Else, more people like me will just stick to Adobe Flash.

Share this post: | | | |
MIX on Campus 08 - Day 1 Report

Today, IT Telkom is holding a great event named Microsoft MIX on Campus 08.

Judging from its name, it is true that MIX on Campus is a students version of Microsoft MIX. Six months ago, I watched videos about MIX 07 sessions on Las Vegas. The first thing came across my mind is : students never get any chance to attend such great event, but it is not impossible to imitate such event for students. Yes. Similar topics. Relatively the same sessions. But in a lighter and cheaper version.

Of course no Steve Balmer, no Scott Guthrie, and no Guy Kawasaki. But you can see the enthusiasm of students. Guess how many students are registered for this four-day event? Two thousands. Yes. I am not kidding. Two thousands students are about to watch the show of newest Microsoft technologies!

And the first day event itself is attended by six hundred students.

The event is openned at 09.30 and students are already lining up since 07.30.

I am delivering an opening speech about MIX on Campus 08

"Andeca... Andeci..." Ronald is talking about features in VSTS 2008

"My head is as big as this..." Leonardi is demonstrating his games

And Mr.Ari Fadyl from Microsoft Indonesia on the last session

And in the end, everyone is getting Visual Studio 2008 from MSDNAA

See? Now everyone knows about .NET and everyone seems to be having fun!

Share this post: | | | |
Three MCTS Books... What’s Next?

Other Microsoft Student Partners seem to be receiving books from Microsoft Indonesia. Like Ronald, Alex, and Fajar. I think I am not different except the fact that I have received more books. Hehehe...

Now I have received three books from Mr. Ari Fadyl, Microsoft Indonesia. These books is somewhat helpful for those who want to take Microsoft certification tests but, sadly, I am rather busy right now. Maybe I have to decide later what the heck should I do with these books.

Share this post: | | | |
ACM Student Membership Gratis!

Baru saja buka e-mail, ternyata aku dapet Free ACM Student Membership karena partisipasiku di acara-acara ACM selama ini (padahal yang bayarin kampus). Hehehe... I love gratisan. Gratis is my life.

Apa saja benefit dari ACM Student Membership? Berikut infonya :

  • Full and unlimited access to 2,500 online courses from SkillSoft.
  • Full and unlimited access to 500 online books powered by Books24x7®.
  • An online and digital format subscription to Communications of the ACM, ACM's flagship publication, with our Student Pointers email alert service
  • CareerNews, bi-weekly email digest providing career-related topics
  • TechNews, tri-weekly email digest delivers stories on the latest IT news
  • MemberNet, monthly e-newsletter covering ACM people and activities
  • Crossroads, ACM's Student Magazine, online
  • Full access to the Guide to Computing Literature with over one million bibliographic citations
  • A free email forwarding address with high-quality Postini spam filtering
  • Queuecasts, downloadable discussions with technology experts
  • Discounts at ACM conferences
  • Student Quick Takes, providing volunteer opportunities for conferences, submission dates for ACM's Student Programming Contest, and more student news
  • Plus, the option to subscribe to the ACM Digital Library, which includes more than 2 million pages of text
  • dan sebagainya...

Kalau pun mau join biaya-nya sangat murah kok. Kalau tidak salah, kurang dari Rp 250.000 per tahun. Nah lewat ACM ini kita bisa mendownload berbagai jurnal ilmiah dan laporan riset dari the first (and greatest) scientific and educational computing society.

Lumayan lah... buat bacaan minggu malam.

Share this post: | | | |
Posted: Mar 05 2008, 11:37 PM by wirawan | with 3 comment(s)
Filed under:
Gila! Software MCA Diobral Murah!

Bangsa ini nampaknya memang butuh edukasi untuk menghargai hak cipta.

Microsoft memberikan software murah untuk para insan akademis di seluruh dunia, termasuk Indonesia, dalam bentuk paket Campus Agreement dan MSDNAA (Academic Alliance). Pemberian itu dimaksudkan untuk menunjang proses belajar mengajar dan untuk kebutuhan pendidikan mahasiswa. Bahkan di dalam MSDNAA tiap mahasiswa berhak menggunakan software tersebut setelah dia lulus.

Namun ada saja oknum yang memanfaatkannya untuk kepentingan bisnis.

Kalau mau tahu yang saya maksud, coba numpang lewat di sini

Saya tidak tahu apakah Campus Agreement dari kampus yang bersangkutan sudah distop oleh Microsoft Indonesia atau belum. Kita berharap solusi yang terbaik saja buat mereka.

Share this post: | | | |
Antara Nilai dan Fungsi di dalam F#

Xi Nian Kuai Le! Gong Xi Fa Cai!

Nah. Ini posting pertama saya dalam Bahasa Indonesia. Ini adalah permintaan beberapa orang teman supaya tulisan saya lebih mudah dicerna. Kali ini saya mau membahas materi yang sederhana dulu, yaitu tentang dasar-dasar nilai dan fungsi pada F#.

Di dalam bahasa F#, fungsi dan nilai sebenarnya tidak terbedakan. Hal ini disebabkan bagi F# fungsi merupakan nilai. Untuk lebih jelasnya, perhatikan kesamaan sintaks pada kode berikut :

#light

let angka = 20

let jumlah a b = a + b

Dari contoh di atas terlihat bahwa nilai dan fungsi mendapat perlakuan yang sama. Identifier angka mendapat nilai 20 dan demikian pula dengan fungsi jumlah secara otomatis mendapatkan nilai dari a + b. Karena fungsi sama dengan nilai, maka hal ini memungkinkan kita : membuat suatu fungsi yang menerima parameter berupa fungsi lain, membuat fungsi yang return value-nya berupa fungsi juga, memasukkan fungsi di dalam struktur data, dan lain-lain.

Hal lain yang perlu dicatat adalah pada pendeklarasian suatu fungsi di F# anda tidak perlu mendeklarasikan return layaknya bahasa pemrograman imperatif umumnya.

Fitur lain dari F# adalah kita tidak harus memberikan seluruh argumen sekaligus. Contohnya :

#light

let hitung a b = a + b

let tambahSatu = hitung 1

let hasil = tambahSatu 10

Meskipun nampak jelas bahwa fungsi hitung meminta dua argumen, namun kita bisa memberi nilai tidak secara sekaligus. Pada waktu saya mendeklarasikan tambahSatu, maka nilai 1 akan mengisi parameter pertama atau a. Pada saat itu, fungsi akan menunggu nilai berikutnya untuk mengisi parameter kedua. Ini disebut currying, diambil dari nama Haskell Curry.

Namun bagaimana jika saya mengharuskan dua argumen dipenuhi sekaligus? F# mengenal suatu konsep yang disebut dengan  tuple. Tuple mungkin dapat didefinisikan sebagai gabungan beberapa data dalam satu paket. Mirip anonymous type pada C# namun tanpa perlu mendeklarasikan ID variabelnya. Contoh pendeklarasian-nya :

#light

let koordinat (a,b) = a + b

let hasil = koordinat (2,3)

Dengan demikian pemanggilan fungsi koordinat harus diikuti dengan nilai tuple (a,b). Suatu tuple dapat menampung berbagai data yang berbeda tipe. Namun tuple tidak mampu menerima nilai dari tuple dengan struktur yang berbeda. Misalnya tuple (a,b) tidak dapat menerima tuple yang bernilai (1,4,"Halo",5) karena struktur-nya berbeda.

Itu saja sedikit gambaran sederhana tentang nilai dan fungsi di dalam F#.

Share this post: | | | |
No STT Telkom at Imagine Cup 2008

I inform this early for all of you.

Following this post, I hope that in the forthcoming Microsoft Imagine Cup no one will ask "Hey, where are the guys from STT Telkom?". Of course, there will be no STT Telkom representatives this year.

It is because...

Yes. This year we will participate under the name Institut Teknologi Telkom or IT Telkom.

Our new institute is now preparing for her debut. Watch out!

Share this post: | | | |
Shuffling Is Not Just Randomizing !!

Exam is over. Now I have time to write again.

We learnt about sorting. We learnt about searching. But almost none of us have ever had class who taught us about shuffling. The story went back days ago when some my classmates were developing applications. Some require us to generate shuffled sequences, such as : generating random song playlists, creating list of winning lottery numbers, or shuffling a deck of cards.

What surprised me is : most of them did it wrong. I guess some of us also have already fallen into the same mistakes without realizing it. Here are some of mistakes we possibly made :

Mistake One : Forget to Randomize Seeds

Without randomize(seed), we will get the same random numbers everytime we run it.


Mistake Two : Wrong Number Range

Calling a random(x), in most languages today, will return a random number between 0 and x-1. Some of my friends forget this. If they want to get a random number between 0 and x, then they should use random(x+1) instead.


Mistake Three : Not So Good Modulus

How to retrieve random indices in array? Even my teacher once coded like this :

X = random(MAXINT) mod ARRAY.LENGTH()

This one is incorrect despite the fact that it will return random number between 0 and last indice. Why? Because MAXINT is not always able to be divided evenly by array.length.

In a small array, it seems not a big deal. But in a bigger array, it can lead into bias.

For example, we have an array of 15000 elements. Assuming we use Int16, then it generates random number between 0 and 32766. That means the number 0 to 2766 are having 50% more chance to be selected than the rest!

We must avoid this because the correct algorithms should assure that each member has equal chances to be put in any positions. In a case like generating list of winning lottery numbers, this can be considered as unfair (a.k.a cheating).


Mistake Four : The Wrong Knuth

Some friends also did this when shuffling a deck of cards. The misintepreted algorithm is derived from Donald Knuth’s book – The Art of Computer Programming Vol 2 :

First it looks okay since every element has chance to be swapped with any elements. But think about it, if we loop 0 to array.length-1 as many as array.length times. Assuming we are having four elements, then there are 4 x 4 x 4 x 4 = 256 possible outputs.

In reality, there should be only 4! or 4 x 3 x 2 x 1 = 24 possible results. And since 256 cannot be divided evenly with 24, then there are must be some biases.

The correct one is what is described by Donald Knuth himself in his book :

Compare this with what I have written earlier. I guess you know what is wrong.


Mistake Five : Easy Way Is Not Easy

For those who think shuffling by swapping is very mistake-prone might consider of using easier algorithm. Many friends of mine use this easy method : assign a random value for each member in array, then sort them accordingly. No possible mistake, right?

I don’t think so.

Mistake happens when some assigned random numbers are in the same value. This also can lead into bias because a normal sorting algorithm does not randomly put items with the same value. This will cause a shuffled list is not “well shuffled”.

What if we use unstable sorting algorithm?

Still incorrect. Even though the positions of same-valued data in an unstable sorted list cannot be predicted, does not mean that it is random.


Mistake Six : Shuffle Again and Again

Not really a mistake, but just useless. People think if we shuffle a sequence again and again then it will produce more randomness. It is not true. If your algorithm is correct, then it will not make any difference (in theory of probability) whether you shuffle it once, twice, or ten thousands times!


Lucky for us, there are two good news :

  1. No need to take this too seriously, because producing a purely random number itself is impossible. Even random function in .NET is just a pseudo-random generator. (usually on other systems it is based on system clock, but I am not sure yet about .NET)

  2. Because the algorithm is expected to produce random results, those flaws are hard to detect. So, the good news is : most of biased algorithm just go unnoticed.


Compared to sorting and searching, shuffling is more poorly implemented by students. Maybe we should begin to teach them how to shuffle correctly.

Share this post: | | | |
Posted: Jan 23 2008, 09:30 PM by wirawan | with no comments
Filed under:
Imagine Cup Algorithm : 4 Through

Imagine Cup - Algorithm Invitational Match 3 has ended today.

Fifty more contestants are through to the next round. The good news is there are four Indonesians among them. The highest scorer of this match is Fly from Russia with 45.206 points. Meanwhile the highest scorer from Indonesia is still arya_n_n with 30.164 points. The complete leaderboard can be seen here.

Here are the top 10 contestants from Indonesia :

the ones printed in blue are through to the next round

Yes. I failed. Although I need only 1.500 points more to get through.

But I think some guys from my campus, STT Telkom, have done their jobs very well. About six or seven students from my campus took part on this match and three of them through to the next round. I guess they have worked very hard during last Christmas and New Year holiday. Good luck for your next round journey!

Share this post: | | | |
More Posts Next page »