Tampilkan postingan dengan label Pemograman. Tampilkan semua postingan
Tampilkan postingan dengan label Pemograman. Tampilkan semua postingan

Sabtu, 02 Juli 2011

Python







Python is a remarkably powerful dynamic programming language that is used in a wide variety of application domains. Python is often compared to Tcl, Perl, Ruby, Scheme or Java. Some of its key distinguishing features include:
  • very clear, readable syntax
  • strong introspection capabilities
  • intuitive object orientation
  • natural expression of procedural code
  • full modularity, supporting hierarchical packages
  • exception-based error handling
  • very high level dynamic data types
  • extensive standard libraries and third party modules for virtually every task
  • extensions and modules easily written in C, C++ (or Java for Jython, or .NET languages for IronPython)
  • embeddable within applications as a scripting interface

Python is powerful... and fast

Fans of Python use the phrase "batteries included" to describe the standard library, which covers everything from asynchronous processing to zip files. The language itself is a flexible powerhouse that can handle practically any problem domain. Build your own web server in three lines of code. Build flexible data-driven code using Python's powerful and dynamic introspection capabilities and advanced language features such as meta-classes, duck typing and decorators.
Python lets you write the code you need, quickly. And, thanks to a highly optimized byte compiler and support libraries, Python code runs more than fast enough for most applications. The traditional implementation of CPython uses a bytecode virtual machine; PyPy supports just-in-time (JIT) compilation to machine code. Also, Jython and IronPython (see below) support JIT compilation on their respective virtual machine implementations.

Python plays well with others

Python can integrate with COM, .NET, and CORBA objects.
For Java libraries, use Jython, an implementation of Python for the Java Virtual Machine.
For .NET, try IronPython , Microsoft's new implementation of Python for .NET, or Python for .NET.
Python is also supported for the Internet Communications Engine (ICE) and many other integration technologies.
If you find something that Python cannot do, or if you need the performance advantage of low-level code, you can write extension modules in C or C++, or wrap existing code with SWIG or Boost.Python. Wrapped modules appear to your program exactly like native Python code. That's language integration made easy. You can also go the opposite route and embed Python in your own application, providing your users with a language they'll enjoy using.

Python runs everywhere

Python is available for all major operating systems: Windows, Linux/Unix, OS/2, Mac, Amiga, among others. There are even versions that run on .NET, the Java virtual machine, and Nokia Series 60 cell phones. You'll be pleased to know that the same source code will run unchanged across all implementations.
Your favorite system isn't listed here? It may still support Python if there's a C compiler for it. Ask around on news:comp.lang.python - or just try compiling Python yourself.

Python is friendly... and easy to learn

The Python newsgroup is known as one of the friendliest around. The avid developer and user community maintains a wiki, hosts international and local conferences, runs development sprints, and contributes to online code repositories.
Python also comes with complete documentation, both integrated into the language and as separate web pages. Online tutorials target both the seasoned programmer and the newcomer. All are designed to make you productive quickly. The availability of first-rate books completes the learning package.

Python is Open

The Python implementation is under an open source license that makes it freely usable and distributable, even for commercial use. The Python license is administered by the Python Software Foundation.

Take a look at application domains where Python is used, or try the current download for yourself.


 

 

Jumat, 01 Juli 2011

Sistem Bilangan Biner

           Sistem bilangan biner atau sistem bilangan basis dua adalah sebuah sistem penulisan angka dengan menggunakan dua simbol yaitu 0 dan 1. Sistem bilangan biner modern ditemukan oleh Gottfried Wilhelm Leibniz pada abad ke-17. Sistem bilangan ini merupakan dasar dari semua sistem bilangan berbasis digital. Dari sistem biner, kita dapat mengkonversinya ke sistem bilangan Oktal atau Hexadesimal. Sistem ini juga dapat kita sebut dengan istilah bit, atau Binary Digit. Pengelompokan biner dalam komputer selalu berjumlah 8, dengan istilah 1 Byte/bita. Dalam istilah komputer, 1 Byte = 8 bit. Kode-kode rancang bangun komputer, seperti ASCII, American Standard Code for Information Interchange menggunakan sistem peng-kode-an 1 Byte.

20=1
21=2
22=4
23=8
24=16
25=32
26=64
dst

Perhitungan

Desimal  Biner (8 bit)
0  0000 0000
1  0000 0001
2  0000 0010
3  0000 0011
4  0000 0100
5  0000 0101
6  0000 0110
7  0000 0111
8  0000 1000
9  0000 1001
10  0000 1010
11  0000 1011
12  0000 1100
13  0000 1101
14  0000 1110
15  0000 1111
16  0001 0000

 

Perhitungan dalam biner mirip dengan menghitung dalam sistem bilangan lain. Dimulai dengan angka pertama, dan angka selanjutnya. Dalam sistem bilangan desimal, perhitungan mnggunakan angka 0 hingga 9, sedangkan dalam biner hanya menggunakan angka 0 dan 1.
contoh: mengubah bilangan desimal menjadi biner
desimal = 10.
berdasarkan referensi diatas yang mendekati bilangan 10 adalah 8 (23), selanjutnya hasil pengurangan 10-8 = 2 (21). sehingga dapat di jabarkan seperti berikut

10 = (1 x 23) + (0 x 22) + (1 x 21) + (0 x 20).
dari perhitungan di atas bilangan biner dari 10 adalah 1010
dapat juga dengan cara lain yaitu 10 : 2 = 5 sisa 0 (0 akan menjadi angka terakhir dalam bilangan biner), 5(hasil pembagian pertama) : 2 = 2 sisa 1 (1 akan menjadi angka kedua terakhir dalam bilangan biner), 2(hasil pembagian kedua): 2 = 1 sisa 0(0 akan menjadi angka ketiga terakhir dalam bilangan biner), 1 (hasil pembagian ketiga): 2 = 0 sisa 1 (0 akan menjadi angka pertama dalam bilangan biner) karena hasil bagi sudah 0 atau habis, sehingga bilangan biner dari 10 = 1010
atau dengan cara yang singkat

10:2=5(0),
5:2=2(1),
2:2=1(0),
1:2=0(1) sisa hasil bagi dibaca dari belakang menjadi 1010

      

 


Loading

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites