Pages

Wednesday, March 30, 2011

[Song] Mariah Carey - Hero

I want to be a hero for my family and my self...




Lyrics

Tuesday, March 29, 2011

[Video] Scientific and parallel computing using IPython

Video how to use IPython for parallel computing made by unpingco in ShowMeDo http://showmedo.com/videotutorials/series?name=N49qyIFOh

Also appeared in Ohio SuperComputer Center, titled Python for Scientific and Large Scale Computing
https://www.osc.edu/cms/sip/

Even the video do it in windows xp, i tested in Ubuntu 10.04 Lucid 64bit also worked for me, with IPython ver 0.10 , python 2.6.5

Thursday, March 24, 2011

Basic Using Scite for editing source code and running program

Sebelum bermain-main(atau serius) dalam menggunakan python sebagai scientific/engineering programming
Sebaiknya kuasai dulu tools-nya, belajar scite(sebagai code editor) dulu aja ah.

## Scite ##
Astaga besar sekali font pada editornya saat ane mo coba nulis source code,
cara ganti->  Options > Open Global Options File
lalu edit bagian pada line 328, ubah size menjadi 10(atw bisa disesuaikan dengan mata masing2) seperti berikut
    font.monospace=font:Lucida Console,size:10

Oke mata udah nyaman saatny coding...
PENTING sebelum menulis kode, simpan file dulu dalam ekstensi .py misal kode gue ksh nama foo.py (Halah belom nulis dah ngesave dulu LOL). Tujuannya agar fitur indentasi dan syntax coloring(kodenya warna-warni oiy).

Selanjutnya silahkan coba kode berikut ditulis.
# ditulis setelah symbol '#' adalah comment, tdk di eksekusi oleh python
# classic test is print hello world in terminal/command prompt
print('Hello Python')

# membuat fungsi f(x) = x^2 + 4x + 2
def f(x):
    return (x**2 + 4*x + 2)
'''
identasi sangat penting di python
def f(x):
return (x**2 + 4*x + 2)
SALAH
'''
# memberikan nilai untuk y = f(x) dengan x = 9
x = 9
# cek nilai x
print('Nilai x ='), (x)

# hitung f(x) dgn x = 9, dan berikan hasilnya ke y
y = f(x)

# print hasil
print("Nilai y ="), (y)

# nilai x dari 0 - 10  
# walau sblmny sdh diberikan x = 9, maka x akan diganti dgn isi yg baru
x = range(11) # dapat jg dituliskan seperti -> x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

# hitung y dengan cara
y = [ f(i) for i in x]

# cek hasil x dan y yg baru
print('x yg baru'), (x)
print('y yg baru'), (y)

# plot hasil nya
# pertama import module pyplot dari matplotlib
from matplotlib import pyplot as plt 
# meng-import pyplot sekaligus mempersingkat nama module nya menjadi plt

# plot nilai y terhadap x, dan memberikan label utk legenda
plt.plot(x, y, label='x^2 + 4x + 2')

# meng-set label x
plt.xlabel('x')
# meng-set label y
plt.ylabel('f(x)')

# show label legend utk line y thd x
plt.legend()

# terakhir menampilkan
plt.show() # yeah show your plot babe!!

Untuk langsung nge-save  n me-running program, tekan F5...
It will be look like...

[Song] Katy Perry - Firework

Nice song Katy Perry!!!


Inspiring and motivated lyrics, i admire this song...

To see the lyrics..



Hope someone i loved out there, sing this song for me...


Do you ever feel like a plastic bag,
drifting through the wind
wanting to start again?
Do you ever feel, feel so paper thin
like a house of cards,
one blow from caving in?

Do you ever feel already buried deep?
6 feet under screams but no one seems to hear a thing
Do you know that there's still a chance for you
'Cause there's a spark in you

You just gotta ignite, the light, and let it shine
Just own the night like the 4th of July

'Cause baby you're a firework
Come on, show 'em what you're worth
Make 'em go "Oh, oh, oh"
As you shoot across the sky-y-y

Baby, you're a firework
Come on, let your colors burst
Make 'em go "Oh, oh, oh"
You're gonna leave 'em all in awe, awe, awe

You don't have to feel like a waste of space
You're original, cannot be replaced
If you only knew what the future holds
After a hurricane comes a rainbow

Maybe you're reason why all the doors are closed
So you could open one that leads you to the perfect road
Like a lightning bolt, your heart will GLOW
And when it's time, you'll know

You just gotta ignite, the light, and let it shine
Just own the night like the 4th of July

'Cause baby you're a firework
Come on, show 'em what you're worth
Make 'em go "Oh, oh, oh"
As you shoot across the sky-y-y

Baby, you're a firework
Come on, let your colors burst
Make 'em go "Oh, Oh, Oh"
You're gonna leave 'em all in awe, awe, awe

Boom, boom, boom
Even brighter than the moon, moon, moon
It's always been inside of you, you, you
And now it's time to let it through-ough-ough

'Cause baby you're a firework
Come on, show 'em what you're worth
Make 'em go "Oh, Oh, Oh"
As you shoot across the sky-y-y

Baby, you're a firework
Come on, let your colors burst
Make 'em go "Oh, Oh, Oh"
You're gonna leave 'em all in awe, awe, awe

Boom, boom, boom
Even brighter than the moon, moon, moon
Boom, boom, boom
Even brighter than the moon, moon, moon



Instalasi Python untuk Engineering dan Science di Windows OS

Paket modul complete dari Enthought, Inc beserta tools pendukungnya bisa di download secara bebas dari
http://enthought.com/products/edudownload.php
ya tinggal isi first name, last name, email, institutional lalu klik download deh.. Ukuran sekitar 260 MB, saat nge-blog ini dah versi 7.0.2 , file yg di download epd-7.0-2-win-x86.msi

Untuk versi 64bit gunakan email akademik.

Jd gak perlu install manual utk python, numpy, scipy, matplotlib, sympy, ipython seperti  postingan yg utk install di ubuntu, info paket-paket yang ter-bundle ada di http://enthought.com/products/epdlibraries.php

Waktu nyoba ini ane pake Windows 7 Home edition 64 bit service pack 1, ori loh... Bawaan dari si fera, ferrari.

Yak untuk install di windows kayaknya gak perlu di share deh, secara bnyk yg pake windows daripada linux.. So sad.. Hiks..  : (
Tinggal klik sana sini acep ini itu, oh utk directory sebaiknya diganti jd C:\Python27epd\
Jaga-jaga barangkali nanti mo install python doang dari www.python.org

Jika sudah selesai maka akan ada shortcut kayak gini..

Engineering and Scientific using Python

Why Python and friends(numpy, scipy, matplotlib, SAGE, etc)?
Why not matlab, mathematica, mathcad, maple and all engineering/scientific non open source software?

Pendapat pribadi dari saya, it's too many benefits and power to learn and using it as scientific/engineering computing for engineering and science problem solving. Make me confused too tell how i must start from to telling.

Who used python?
NASA, Los Alamos, High Energy Physics Large Hadron Collider CERN, and many others engineering/scientific institutional. Google are using it, even python was mentioned by Mark at Social Network Movie. LOL OOT

Konrad Hinsen from Centre de Biophysique Moléculaire (CNRS Orléans) Synchrotron SOLEIL (Saint Aubin), at euroscipy 2010 conference said "Nobody uses Matlab in my research domain." (Apa karena gak mampu beli Matlab yah?? Ah gak mungkin!! LOL)

Engineer and scientist already have a lot of task/problem that need to be solved, and python as based for computation programming will make less effort than programming using C/C++, java(syntax-nya itu loh kagak nahan... bikin ndas pecah).
Eits tapi perlu utk menguasai C/C++, jika ada kalkulasi yg kelas berat sebaiknya ditulis dalam bahasa C/C++, tapi kita juga bisa mencari 'the real C/C++ programmer' untuk mengkonversi kode python yg sudah fix tapi lambat saat kalkulasi, kalo kita gak mampu coding C/C++ sendiri.

MIT already started to using it for teaching, see http://ocw.mit.edu/index.htm
and many others institute and university.
Argh kok di tempatku kagak sih... Kenapa masih pake matlab bajakan, dan bajakan2 lainnya, padahal yah ternyata gampang bahasa pemrogamannya, install gampang, gak bikin berat komputer kalo gak lagi dipake, coba matlab? Doh tuh proses yg namanya matlab sever dah jalan pas windows booting n makan RAM gede pula. Malah pascal di mata kuliah pemprogaman komputernya :(

I think Google will find the best answer. Just google it!
BTW a founder of Python programming language(Guido Van Rossum is employed by google.

Have fun with python for engineering problem solving and scientific research computing!!! :D

Instalasi Paket Sains(Scientific) dan Teknik(Engineering) di Ubuntu

Menginstal modul python untuk keperluan Sains(Scientific) dan Teknik(Engineering)
Spesifikasi saat artikel ini dibuat:
Ubuntu Lucid Lynx versi 10.04
numpy versi 1.3; scipy versi 0.7; matplotlib versi 0.99; sympy versi 0.6.6; ipython versi 0.10

Sebelumnya jangan lupa, harus ada koneksi internet...

Buka terminal aka command prompt
Login sebagai root (masukkan password anda)

sudo -i


lalu install dengan perintah

apt-get install python-numpy python-scipy python-sympy python-matplotlib python-matplotlib-data


dan tekan y untuk melanjutkan
lalu Ctrl-D utk logout sebagai root


Untuk menyesuaikan kompatibilitas dengan modul-modul versi EPD(Enthought Python Distribution) di windows, yah itu lah python ada di linux, and ada juga di windows, di N900 gue juga ada, huehehehe...
Jadi update python-numpy python-scipy python-sympy ke versi yg baru dengan cara memasukan perintah berikut(jgn lupa sebagai root)

easy_install -U numpy
easy_install -U scipy
easy_install -U sympy




saya mencoba mengupdate modul matplotlib dengan cara yg sama seperti diatas tapi gagal euy.. :(