Archive for March, 2009

h1

Membagi Koneksi Internet FastNet dengan 2 LAN

March 25, 2009

Kemarin-kemarin, gw baru mencoba suatu tutorial untuk membagi koneksi internet dengan 2 LAN. Hal-hal yang dibutuhkan antara lain :

  1. LAN dari komputer yang terhubung dengan internet, harus berjumlah minimal 2. Kita dapat menambahkan suatu LAN baru ataupun melalui USB LAN
  2. 1 buah kabel LAN untuk menghubungkan 2 komputer

Langkah-langkahnya dapat dibagi ke dalam 4 bagian :

1. Jaringan default dari kabel ISP

2. Setting windows agar bisa share koneksi

3. Setting IP pada tiap LAN card

4. Hubungkan LAN kedua dan silakan browsing

Setting windows agar bisa share koneksi

Start -> Programs -> accessories -> Communications -> Network Setup Wizard…next

defaultnya adalah LAN card yang konek ke internet. tinggal next saja sampai selesai. kalau minta di save ke disket di tolak jawab NO dan finish.

pastikan Internet Connection Sharing pada LAN properties pada komputer pertama yang terhubung ke cable modem terpilih.

cek “Allow other network users to connect through this computer’s Internet connection

Setting IP pada tiap LAN card
Setting LAN card yang ke internet (komputer 1) – default dari teknisinya.

· Obtain an iP address automatically

· Obtain DNS Server Address Automatically

Setting LAN card yang menuju Komputer Lain (komputer 1) :

IP Address : 192.168.0.5

Subnet Mask : 255.255.255.0

Default Gateway : Kosongin aja

DNS : Kosongin aja


Setting LAN card pada Komputer Lain (komputer 2,3,4,5,dsb):

IP Address : 192.168.0.10

Subnet Mask : 255.255.255.0

Default Gateway : 192.168.0.5

Prefered DNS server : Samakan dengan DNS pada LAN card yang konek ke internet

Alternate DNS server : Samakan dengan DNS pada LAN card yang konek ke internet


h1

NSURLDownload VS NSURLConnection

March 11, 2009

Nah kali ini, gw baru mau membahas mengenai 2 class di Cocoa Programming. NSURLDownload dan NSURLConnection. Dengan 2 class ini, kita dapat membuat suatu program yang dapat mendownload suatu file. Namun, walaupun keduanya terlihat sama, sebenarnya terdapat beberapa perbedaan dari kedua class tersebut. Perbedaan-perbedaan itu antara lain :

  1. Jangan pernah menggunakan class NSURLDownload untuk membuat suatu aplikasi untuk iPhone. Hal itu dikarenakan NSURLDownload tidak ada di device. (walaupun pada saat di-run di iPhone Simulator jalan). Solusinya : kita menggunakan NSURLConnection
  2. Untuk urusan coding, NSURLDownload lebih mudah untuk digunakan. Hal itu dikarenakan class ini hanya butuh 1 method untuk mengetahui apakah download telah selesai dilakukan atau tidak. Dibandingkan dengan NSURLConnection yang membutuhkan lebih dari 1 method.

Contoh Coding dengan NSURLDownload

NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:myurl] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];

NSURLDownload *theDownload=[[NSURLDownload alloc] initWithRequest:theRequest delegate:self];

if (!theDownload) {

NSLog(@"error");

}

NSString *destinationFilename;

NSString *homeDirectory=NSHomeDirectory();

NSArray *pecah = [myurl componentsSeparatedByString:@"/"];

NSString *namafile = [pecah objectAtIndex:[pecah count]-1];

destinationFilename=[[homeDirectory stringByAppendingPathComponent:@"Library"]

stringByAppendingPathComponent:namafile];

NSLog(destinationFilename);

[theDownload setDestination:destinationFilename allowOverwrite:NO];

//Jika download finish, maka fungsi ini akan dipanggil

- (void)downloadDidFinish:(NSURLDownload *)download

{

// release the connection

[download release];

// do something with the data

NSLog(@"%@",@"downloadDidFinish");

UIAlertView *baseAlert = [[UIAlertView alloc]

initWithTitle:@"Download Finished"message:@""

delegate:self cancelButtonTitle:nil

otherButtonTitles:@"OK", nil];

[baseAlert show];

[act stopAnimating];

}

Contoh Coding dengan NSURLConnection

NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:myurl] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];

receivedData = [[NSMutableData alloc] initWithLength:0];

DownloadConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self startImmediately:YES];

if(DownloadConnection == nil) {

NSLog(@"error");

}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {

[self.receivedData appendData:data];

NSInteger receivedLen = [data length];

NSLog(@"%d",receivedLen);

}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {

}

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {

}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {

[connection release];

NSString *namafile = @"video1.mp4";

destinationFilename=[[homeDirectory stringByAppendingPathComponent:@"Library"]

stringByAppendingPathComponent:namafile];

NSLog(destinationFilename);

[self.receivedData writeToFile:destinationFilename atomically:YES];

UIAlertView *baseAlert = [[UIAlertView alloc]

initWithTitle:@"Download Finished"message:@""

delegate:self cancelButtonTitle:nil

otherButtonTitles:@"OK", nil];

[baseAlert show];

[act stopAnimating];

}

h1

Sound di Mac OS Kalyway

March 8, 2009

Untuk install sound driver di mac, kita harus memperhatikan beberapa hal seperti : Merek Device sound dari komputer / laptop dan device id. Berikut ini saya sediakan suatu driver untuk driver bertipe Realtek dan dengan device ID : 0×10250133

Klik link disini untuk mendownload driver (reupload):

http://www.indowebster.com/Sound_Driver_Mac_Kalyway.html

apabila sound driver sukses di-install, maka akan muncul icon :

icon sound di mac

icon sound di mac

Selamat Mencoba :)