RSS
 

Install Java Communication API dan Java RxTx API di Ubuntu

03 Feb

Serial Parallel

Java Communication API dan Java RxTx API adalah library java yang digunakan untuk melakukan komunikasi dengan port-port yang ada di komputer, seperti serial, COM, USB, dll. Dengan adanya library tersebut, kita dapat membuat aplikasi yang melibatkan port-port tersebut, misalnya membuat aplikasi smsgateway, aplikasi untuk barcode scanner, dll. OK, langsung saja kita mulai pelajarannya.. :) Read the rest of this entry »

 
No Comments

Posted in Java

 

Twin Towers (Soal pre-warming up Gemastik 2010)

24 Aug

Once upon a time, in an ancient Empire, there were two towers of dissimilar shapes in two different cities. The towers were built by putting circular tiles one upon another. Each of the tiles was of the same height and had integral radius. It is no wonder that though the two towers were of dissimilar shape, they had many tiles in common.

However, more than thousand years after they were built, the Emperor ordered his architects to remove some of the tiles from the two towers so that they have exactly the same shape and size, and at the same time remain as high as possible. The order of the tiles in the new towers must remain the same as they were in the original towers. The Emperor thought that, in this way the two towers might be able to stand as the symbol of harmony and equality between the two cities. He decided to name them the Twin Towers.

Now, about two thousand years later, you are challenged with an even simpler problem: given the descriptions of two dissimilar towers you are asked only to find out the number of tiles in the highest twin towers that can be built from them.

INPUT

The input consists of several data blocks. Each data block describes a pair of towers. The first line of a data block contains two integers N1 and N2 (1 <= N1, N2 <= 100) indicating the number of tiles respectively in the two towers. The next line contains N1 positive integers giving the radii of the tiles (from top to bottom) in the first tower. Then follows another line containing N2 integers giving the radii of the tiles (from top to bottom) in the second tower. The input terminates with two zeros for N1 and N2. \

OUTPUT

For each pair of towers in the input first output the twin tower number followed by the number of tiles (in one tower) in the highest possible twin towers that can be built from them. Print a blank line after the output of each data set.

SAMPLE INPUT

7 6

20 15 10 15 25 20 15

15 25 10 20 15 20

8 9

10 20 20 10 20 10 20 10

20 10 20 10 10 20 10 10 20

0 0

SAMPLE OUTPUT

Twin Towers #1

Number of Tiles : 4

Twin Towers #2

Number of Tiles : 6

______________________________________________________________________________________________________

Problem Requirement

Runtime Limit : 1 seconds

Memory Limit : 8192 bytes

Once upon a time, in an ancient Empire, there were two towers of dissimilar shapes in two different cities. The towers were built by putting circular tiles one upon another. Each of the tiles was of the same height and had integral radius. It is no wonder that though the two towers were of dissimilar shape, they had many tiles in common.

However, more than thousand years after they were built, the Emperor ordered his architects to remove some of the tiles from the two towers so that they have exactly the same shape and size, and at the same time remain as high as possible. The order of the tiles in the new towers must remain the same as they were in the original towers. The Emperor thought that, in this way the two towers might be able to stand as the symbol of harmony and equality between the two cities. He decided to name them the Twin Towers.

Now, about two thousand years later, you are challenged with an even simpler problem: given the descriptions of two dissimilar towers you are asked only to find out the number of tiles in the highest twin towers that can be built from them.

INPUT

The input consists of several data blocks. Each data block describes a pair of towers. The first line of a data block contains two integers N1 and N2 (1 <= N1, N2 <= 100) indicating the number of tiles respectively in the two towers. The next line contains N1 positive integers giving the radii of the tiles (from top to bottom) in the first tower. Then follows another line containing N2 integers giving the radii of the tiles (from top to bottom) in the second tower. The input terminates with two zeros for N1 and N2. \

OUTPUT

For each pair of towers in the input first output the twin tower number followed by the number of tiles (in one tower) in the highest possible twin towers that can be built from them. Print a blank line after the output of each data set.

SAMPLE INPUT

7 6

20 15 10 15 25 20 15

15 25 10 20 15 20

8 9

10 20 20 10 20 10 20 10

20 10 20 10 10 20 10 10 20

0 0

SAMPLE OUTPUT

Twin Towers #1

Number of Tiles : 4

Twin Towers #2

Number of Tiles : 6


Problem Requirement

Runtime Limit : 1 seconds

Memory Limit : 8192 bytes

Ini solusi yang coba dikerjakan : Read the rest of this entry »

 
73 Comments

Posted in Java

 

Divisors (Soal pre-warming up Gemastik 2010)

23 Aug

The proper divisors of a positive integer n are those integers, excluding n itself, that divide n exactly. For example, the proper divisors of 12 are 1, 2, 3, 4 and 6.

INPUT
First line (X) is the number of test cases (1 <= X <= 100). And X lines after that is the number (n) which must be searched it’s divisors (1 <= n <= 100).

OUTPUT
Each line is the answer of each n

SAMPLE INPUT

5
23
38
26
44
13

SAMPLE OUTPUT

1
1 2 19
1 2 13
1 2 4 11 22
1


Problem Requirement
Runtime Limit : 1 seconds
Memory Limit : 16384 bytes

Ini solusi yang saya buat : Read the rest of this entry »

 
138 Comments

Posted in Java

 

Stacked Triangle (Soal pre-warming up Gemastik 2010)

23 Aug

Buatlah suatu bentuk segitiga yang saling menumpuk dengan segitiga paling besar berada pada bagian paling bawah dan makin keatas segitiganya semakin kecil. Segitiga paling atas atau paling kecil memiliki bentuk 2 baris 3 kolom dengan karakter *(bintang) sebagai elemen penyusunnya.

*
***

Input baris pertama adalah jumlah test case yang diujikan N (0 < N < 1000), kemudian diikuti jumlah segitiga yang ditumpuk M (0 < M < 100). Output antar testcase tidak perlu dipisahkan baris kosong.

Input:

3
1
2
3

Output:

*
***
*
***
*
***
*****
*
***
*
***
*****
*
***
*****
*******


Problem Requirement

Runtime Limit : 2 seconds
Memory Limit : (tidak ada) bytes

Ini solusi yang saya kerjakan: Read the rest of this entry »

 
104 Comments

Posted in Java

 

Koneksi Internet dengan CDMA di Ubuntu 10.04

13 Aug

Akhirnya modemku kembali aktif di ubuntu, aku menggunakan modem SpeedUp 3G – SU-6350U, dengan menggunakan kartu Fren. Mari kita mulai pelajarannya….

  1. Install wvdial melalui synaptics Packages Manager (System – Administration – Synaptics Packages Manager)
  2. Setelah terinstall buka program andalan kita, “Terminal” (Application – Accesories – Terminal)
  3. Masuklah sebagai root, dengan mengetikan perintah
    hilal@hilal-laptop:~$sudo su

    kemudian masukkan password komputer anda

  4. Read the rest of this entry »

 

Segitiga (Soal pre-Warming up Gemastik 2010)

12 Aug

Buat sebuah segitiga siku-siku terbalik berdasarkan jumlah input.

Baris pertama adalah jumlah test case sebanyak N. N baris berikutnya adalah test casenya.

output:
bentuk segitiga terbalik yang tiap test case dipisahkan baris kosong

input:

3
4
2
1

output:

****
***
**
*

**
*

*


Problem Requirement

Runtime Limit : 1 seconds
Memory Limit : (tidak ada) bytes

Ini Solusi yang saya kerjakan… Read the rest of this entry »

 
56 Comments

Posted in Java

 

FiboPlinPlan (Soal pre-warming up Gemastik 2010)

12 Aug

Seorang profesor mengemukakan penemuannya terhadap modifikasi penjumlahan deret fibonaci yang dia sebut “Plin Plan”. Dalam metode ini elemen deret ganjil bernilai positif. Sedangkan untuk elemen deret genap bernilai negatif.

Buatlah program untuk membantu profesor menentukan jumlah dari deret fibo plin plan ini dengan input baris pertama merupakan jumlah testcase N (0 < N < 1000) dan input berikutnya adalah jumlah deret yang dicari M (0 < M < 1000).

input:

4
1
2
3
5

output:

1
0
2
4

penjelasan :

testcase 1 => 1 = 1
testcase 2 => 1 + (-1) = 0
testcase 3 => 1 + (-1) + 2 = 2
testcase 5 => 1 + (-1) + 2 + (-3) + 5 = 4

Ini Solusi yang coba saya buat.. Read the rest of this entry »

 
Comments Off

Posted in Java

 

Hal-hal yang Harus dilakukan Setelah Install Ubuntu 10.04

12 Aug

Setelah install ubuntu..?? bingung mo diapain..?? ok, ayo ikuti saya… :)

  1. Mengubah repository online inherent ke kambing.ui.ac.id
    Buka terminal : alt+f2 -> ketikkan “gnome-terminal” (tanpa tanda petik)
    Masuklah sebagai root, dengan cara mengetikkan perintah :

    hilal@hilal-laptop:~$sudo su

    kemudian ketikkan password komputer anda
    Setelah itu ketikkan perintah

    root@hilal-laptop:gedit /etc/apt/sources.list

    maka file sources.list akan terbuka, dan disitu terdapat banyak tulisan. hapus semua ja ndak papa.
    Kemudian ketikkan source berikut pada file tersebut Read the rest of this entry »

 
Comments Off

Posted in Ubuntu

 

Mengubah Menu Pilihan Grub ubuntu 10.04

26 Jul

Pada menu awal grub, kita akan menemukan banyak pilihan seperti di bawah ini :

Ubuntu, with Linux 2.6.32-21-generic
Ubuntu, with Linux 2.6.32-21-generic (recovery mode)
Memory test (memtest86+)
Memory test (memtest86+, serial console 115200)

sekarang kita akan belajar untuk mengedit tampilan menu tersebut… okey, lets go.. Read the rest of this entry »

 
69 Comments

Posted in Ubuntu

 

Domain Name Aksara Arab

26 Jun

Domain name non-latin pertama mulai diaktifkan. Tiga negara di Timur Tengah, yakni Mesir, Arab Saudi, dan Uni Emirat Arab, menjadi yang pertama menerapkan domain name beraksara non-latin ini. Domain name beraksara Arab telah ditambahkan ke dalam direktori master internet sejak minggu pertama Mei 2010, menyusul persetujuan akhir dari ICANN sebulan sebelumnya.

Penambahan aksara Arab ini merupakan perubahan besar pertama dalam sejarah domain name, sejak kali pertama dibentuk pada 1980-an. Mesir masih akan mempertahankan ccTLD “.eg” untuk domain latinnya, sekaligus menawarkan akhiran “.masr” yang ditulis dalam huruf Arab [Info : www.ap.org]

Read the rest of this entry »

 
60 Comments

Posted in news

 
 

Get Free Google Page Rank