Pazar, Aralık 31, 2006

stand-cg 2007



Stand-cg'den herkese selamlar,

Bu sene diğer senelerden farklı olarak bayramı ve yılbaşını bir arada kutluyoruz. Bu çoğu çalışan için daha az tatil daha fazla iş gücü demek. Bu durumdan feyz alan stand-cg her yılın mayıs ayında düzenlenen Linux ve Özgür Yazılım Şenliği çalışmalarına bir mevsim önceden başladı. Yenilikleri ve atılımcı fikirleri ile önümüzdeki seneleride etkileyecek dinamik uygulamaları ile stand-cg olarak geliyoruz. Bu kış başka geçecek.

PS: Tema yeniyıl olsa da, mübarek kurban bayramınızı da kutlarız.

Çarşamba, Aralık 20, 2006

Sağır Oda, Süperman, Flooding...

...->üzerine, hakkında, vs vs.

Maç seyrederken bazı takım oyuncularına bireysel oynuyorlar diye kızarız. Muhtemelen, kızıyorsak,bu yıldız oyuncu olmadığındandır. Ama hepimiz biliriz yeni yıldızlar böyle çıkar. Kimi zaman cesaretle, kimi zaman takım arkadaşına inat bir metanetle...

Özgürlük, sahip olduğun kudreti tutsak etmemek demektir.

Cumartesi, Aralık 16, 2006

Pardus Seminerleri Dizisi

İYTE Hazırlık sınıfı öğrencilerine verdiğimiz Pardus semineri...



Pardus kurulumu yaptık. Özgür yazılım nedir, Pardus'ta ne farklıdır neden farklıdır bunlardan bahsettik. Pardus denemiş bir kaç arkadaşa Pardus'ta ne yeni onu anlattık. Eskisini de bilince bu pek zor olmadı ;).

PS: Sol köşenin fotoğraflarını bulamadım :(...

Cuma, Kasım 24, 2006

PARDUS Semineri - Compotek

Compotek'ten Notlar: İzmir'in bilişim fuarı olan Compotek her geçen yılla küçülmeyi ve ziyaretçi kapasitesini düşürmeyi başarabildi. Sunumlar tek bir markanın sunumlarından ibaret olmakla beraber, İzmir Yüksek Teknoloji Enstitüsü tanıtımları olarak kaldı. 1'i hariç...

Compotek her senenin aksine; okullara sunum çağrısında bulunmayınca, iş kişisel teşebbüslere kaldı. Programın boşluğundan yararlanarak bir sunum talebinde bulundum. Zaten misafir etmeye niyetli olduğum Pardus geliştiricileri; Onur Küçük ve Koray Löker'i fuara yönlendirdim. Fuara katılım olmayınca ve sunum saati meraklı penguenlerin sınav saatleri ile çakışınca çok çok az bir seyirci ile bir "sohbet" gerçekleştirdik.

İyte'ye ve aklımıza özgür yazılım, açık kaynak kod tohumlarını atan, gönlümüzün "çalışkan pengueni" ve İyteli penguenlerin abisi Onur Küçük'ü tekrar ağırlamanın sevinci ve geç bulup, hiç kaybetmek istemediğimiz, tanışmaktan şeref duyduğumuz Koray Löker ile tanışmanın memnuniyeti ile bir buluşmayı gerçekleştirmiş olduk.

Gönül isterdi, bir organizasyon gözümüzün önünde erimesin, her sene artan heyecanınızı sizinle beraber paylaşan birileri olsun. Compotek için harcanan emek gerek katılımcı gerek ziyaretçi bazında yerini bulsun.

Durdukları sunucu platformuna beni de kabul eden, beklentisiz en içten halleri ile küçüçük salonda yüzlercesine cevap verircesine bizimle sohbet eden, en önemlisi ricamızı kırmayıp misafirimiz olan PARDUS projesi geliştiricisi arkadaşlarıma-üstadlarıma çok teşekkür etmek istiyorum. Bu camianın sizin gibi mütevazı insanlardan öğreneceği çok şey var.

D&G

Özgür Yazılım camiasına ilk adımlarımda, hatta devamında, her zaman yanımda bulunun Devrim Gündüz'ün, ve bir başkasına bir kelam dahi öğretebilmiş herkesin; 24 Kasım Öğretmenler Günü'nü kutluyorum.

Cuma, Kasım 10, 2006

Implementation of a Distributed Data Partitioning Algorithm

Topic is the title of my thesis project. This thesis project is an implementation of a distributed data partioning algorithm, called APDES(Adaptive Parallel Discrete Event Simulator). APDES is a simulation platform for non-deterministic applications. I am going to implement the project with c++ on Fedora core 6 platform, and test the algorithm's performance with 4 pc environment. This environment is funded by Tubitak.
This algorithm developed from a hybrid approach of data partitioning. This approaches performance calculated at the Beowulf cluster of the High Performance Computing Center ULAKBIM, of the Turkish Scientific and Technical Research Council TUBITAK and the local cluster of the International Compuetr Institute at EGE University by my intsructor work, and performance incerement observed.

Çarşamba, Kasım 01, 2006

Sensei Splinter


Bu aralar çoğu ttnet ADSL kullanıcısının başına geldiği üzere düzenli olarak bağlantımız kopuyor. Ben de hazır şifremi hatırlamak için bağlandığım operatöre bunun nedenini sorayım dedim. Bilgilendirme yapılcak dedi ve ağrıza kaydımı girdi. Bu sabah bir amcam aradı;

-Ağrıza gaydı vermişin, gopuyomuşun, splinter'in var mı senin?
-Splitter, yok kullanamıyorum.
-Olmaaazzz, gullancan..
-Beyfendi ben telefon çalmadan da netten düşüyorum.
-Splinter diom, splinteeerrrrrr!
-Tamam bağırmayın da...
-Splinteeer! Splinter,splinter, splinter...
-Üff.

Yani splinter iyi bir şeymiş. Kullanın!

Bu yazıyı yazarken iki Telekom yetkilisi daha aradı. Bu sefer splitter dediler. Elimiz mahkum, takıcaz. Dedim; bende de ondan var :P

PS: Telekom data ve telefon sinyallerini bakır kablo üzerinden yollarken dagıtıyormuş. Ama yolda karışabilir bir de sen dağıtacaksın dedi. Asrın icadı canım şu splitter. Bakalım onu da takınca düzenli netten düşme problememiz düzelecek mi?

Perşembe, Temmuz 20, 2006

wsop-first screen-shot of evince-mozilla plugin!



Evince version : 0.5.3 source version
O.S. : Ubuntu - Dapper 6.0.6

Project steps;
-apt-remove evince
-compiled evince, form source, installed dependent packages.
-apply, plugin-patch recompiled evince with mozilla option, solve some autotool, and plugin dependent problems
-after successful installation, firefox crashes because of plugin dependent error, fixed it!

All projects published in planet-gnome/wsop2006

p.s. (for turkish community) sth happened but we will learn later, alltogether...

Pazartesi, Temmuz 03, 2006

db2dart komutu ve silemedigim kolonlarim..

Raporlama yaparken kimi zaman veritabani baglantisini gerceklestiremiyoruz. Sanirim deneme yanilma ile otomatik olsuturulan sistem tablolarinin bozulmasindan kaynaklandigi bulunmus. Veri tabaninin backup'ini alip tekrardan restore islemini uygularsak sorunumuz cozuluyor.
db2dart ile veritabanini kontol edebiliyoruz. En basit hali ile komu su sekilde calisiyor;
-db2dart
Bir rapor hazirliyor (databasename.rpt).

Hatayi cozemesekte nerde olduguna dair simdilik bir fikrimiz var. Amacimiz tekrar restore'a gerek kalmadan problemi cozmek.

Bir de;
-alter table drop column yapamamak. Sanirim db2 buna izin veriyor. droptan sonra beklenen degere ornek olarak "constraint" veriyor ama bunu da basarabilmis degilim.

Pazar, Temmuz 02, 2006

WSOP/Kesinlikle cok mutluyum..

Umran,

We're delighted to tell you that your application has been accepted for
our Women's Summer Outreach Program. Congratulations!

Just to give you an idea of how fierce the competition was, we received
around 100 applications for 6 places -- you should be proud of
yourself. :-)

We'll be in touch over the next day or so to start chatting about money,
how to get in touch with your mentor and getting started with your
project. In the meantime, congratulations on your acceptance, and please
let us know ASAP if you can't be part of the program for some reason.

Thanks!

- The WSOP coordinators.

Perşembe, Haziran 29, 2006

db2 schemas/views/indexes/triggers

schema: -schema_name.object_name,
-eger schema belirtmezsek, yetkilendirmeye (authentication id'e) gore schema ismi veriyor. db2'ya baglandiginiz user-name misal.

views: -gercek veri icermiyorlar.
- "with check option" ifadesi ile tanimlanirlarsa, tanimlarinda ki kosullar insert ve update islemleri sirasinda kontrol ediliyor. Birbirine bagimli tanimladan view'lar da bir ust kosul miras aliniyor. Miras almak istemezsek "with local check option", tum usttekileri miras almak istersek "with cascaded check option" ifadelerini kullaniyoruz.
-view'lerin verilerine sadece SQL sorgulari ile referans tutabiliyoruz.
-db2'da view'lar ALTER VIEw statement i ile degistirilemiyorlar. Sadece 'foreign key' kolonuna bu uygulanabiliyor.

indexes: -verinin tekrar etmemesini ve sorgu hizlarinin artmasini saglar.
-ALTER INDEX ile index degistirilemez. DROP ve tekrardan CREATE ifadeleri ile silinip bastan yaratilmasi gerekir.

triggers:-before tirggers
-after triggers
-instead of triggers(always FOR EACH ROW)
-birbirini tetikleyen trigger'lar cascading triggers...

sunumun tamami=>http://arda.linuxmarket.org/umran/Presentation1.ppt

arda'yi sade mi seversiniz yogurtlu-soslu mu?

Çarşamba, Haziran 21, 2006

NetBeans 5.5 Beta/Pardus

Netbeans'i "http://www.netbeans.info/downloads/download.php?type=5.5b" adresinden indirdim. Kurulum icin sirasiyla;
-chmod +x netbeans-5_5-beta-linux.bin
-LC_ALL=en_US
-DISPLAY=:0
-./netbeans-5_5-beta-linux.bin
"installation wizard acildi (sanirim kurulum sihirbazi deniyor.)" Kurulumun ardindan;
-/install> netbeans-5.5beta/bin/netbeans'in icine export LANG=en_US
-/install> netbeans-5.5beta/etc/netbeans.conf'un icerisinde netbeans_default_options'a --locale en:US
ekledim.
special thanks to huygun,iacsi.metoikos..

>>Hic daha once yabancisi oldugum biryerde staj yapmamistim. Simdi 9 stajerimin de(3_IYTE,5_IEU, 1_COMU) yabancilik cekmemeleri icin elimden geleni yapiyorum. Daha staj var, edersem bulurum.Odev konusunda acimak yok ama...:))

Pazartesi, Haziran 19, 2006

Eclipse plugin'i yemezse!

Eclipse'e plugin kurmak icin eclipse klasorunun oldugu dizine acilan plugin eclipse'in yeniden baslatilmasina ragmen kurulmamissa(surum bagimliliklarinin saglandigi kabul edilirse);

1)eclipse klasorunun bulundugu dizinde 'features' ve 'plugin' dosyalarinin olusup olusmadigini kontrol edin! Olusmussa; 'features' klasorunun icindekileri /eclipse/features dizinine, plugin klasorunun icindekileri de /eclipse/plugin in icine kopyalayin. (Ustune yazma durumunu onaylayin.)

Hala kurulmuyorsa;

2)Bir terminalden ya da konsoldan ./eclipse -clear'i calistirin. (Bu sayede onceki konfigurasyondan olan build dosyalari silinmis oluyor.)

Cumartesi, Haziran 17, 2006

Dokuz Eylul Universitesi Bitirme Projeleri Sergisi & LKD



Standimizi kurduk kaldirdik, katilim beklenenin ustundeymis ama ben Dokuz Eylul ve TBD tayfasindan fazlasina rastlayamadik. Ogrenciler Linux'u ya hic kurmamislar ya da odevlerinin win'de yapilma zorunlulugundan dolayi kurduklari gibi kaldirmislar. Bir LKD uyesine rastladik, bir de ilgili yazilim muhendisi bir amcamizla fikirlerimizi paylastik.

Bir tanesi ozgur yazilim projesiydi. Visual UML diye bir proje, eclipse plugin olarak ekliyorsunuz, class diagraminizin uml ini bir tool ile ciizyorsunuz ve patternlar araciligi ile cikiyor size auto-generated code. Source-forge da 115. sira da yeralmis.

Bir guzel proje de Wireless Multifunctional Platform Project idi. Tekerlekli bir platform hazirlamislar, ve bilgisayardan belirlediginiz rota araca bluetooth ile iletiliyor ve arac bu rotada hareket ediyor. Bu platforma bagladiklari koca harddisk ve uzerine de kurulan koca(boyut olarak buyuk) isletim sistemini biraz yadirgadik.

Dokuz Eylul Univerisitesi Bilgisayar Muhendisligi Bolum Baskanligini ogrencileri icin hazirladigi bu etkinlik ve cv-katalogu icin takdir ettik.

Cuma, Haziran 16, 2006

Chris: Women's Summer Outreach Program 2006

Hi, Umran.

> Hi, I am Umran Kamar from Izmir, TURKEY(states written first in my
> country.) I am undergraduate student at Izmir Institute of
> Technology. Its my fourth year on the school. This year i am going
> to take my thesis on linux kernel development. I do not certainly
> decide on details but my major topic would be linux kernel. For
> nearly two years i use linux operating systems.

Excellent, great to hear from you.

> I want to develop an Evince Mozilla plugin, as competing.

Okay! That sounds really useful. So, here's a suggestion for a plan:

* I'll find a possible mentor for you, who you could chat with to
talk over how a mozilla plugin would work, what the specific goals
for the project would be, and what you're going to need to learn to
be able to work with the code.

* We'll have our application form online in a few days; once you've
worked out the specific goals you can write and submit your
application with them in.

Sound good?

Thanks,

- Chris.
Basliyoruz...

Women's Summer Outreach Program 2006

Hi,
I am Umran Kamar from Izmir, TURKEY(states written first in my country.) I am undergraduate student at Izmir Institute of Technology. Its my fourth year on the school. This year i am going to take my thesis on linux kernel development. I do not certainly decide on details but my major topic would be linux kernel.
For nearly two years i use linux operating systems. First of all i use Suse 8.2, then Suse 9.1, Suse 9.2, Suse 9.3, OpenSuse10.0. And after PARDUS (Turkish national and powerfull distro) released, I began to use PARDUS on my pc. I also work at Computer Resarch and Application Department of my institute and use Debian-Sarge and Fedora-Core4 at work. I'm also familiar with Ubuntu.
I know c and java most properly, and also experienced programming with c++, php and scheme!(I do not like Lisp much!).
The other factor that encourages me with you is charity of Turkey's Linux community as is all over the world. Contrarily your assumption, all (incredible) men help me while i am studyin on Linux, and i know will help as they can if i attend this project.
There are many programmer women interested with linux in my country, but they are lack of courage to attending projects and leading women community. I am expecting this project will be landmark for the Turkish women community to be more confident on attending linux and linux based projects.
I want to develop an Evince Mozilla plugin, as competing.
yours faithfully , Umran..

Konuyu secmemde yardimci olan Arda'ya ve bu mail'in bu kadar duzgun yazilmasini saglayan Erdinc'e sesleniyorum; You are my incredibles!

Perşembe, Haziran 08, 2006

Client/Server 4

FTP uygulamasini bu sefer socketlerle yaptik..

Client'ta ki farklar;

if((socketfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
perror("socket");
exit(-1);
}

memset(&server_addr, 0, sizeof(server_addr));
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(PORT);
inet_aton("127.0.0.1", &(server_addr.sin_addr));

if (connect(socketfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) == -1) {
perror("connect");
exit(1);
} //socket acilmasi, degerlerinin set edilmesi ve socket uzerinden baglanti kurulmasi
------------------------------------------------------------------------------------------
write(socketfd, readbuffer, strlen(readbuffer)); //socket'e yazma!
close(socketfd); //islemlerden sonra socket;i kapatma.
------------------------------------------------------------------------------------------

Server'daki farklar;

if((orgsocketfd = socket(AF_INET, SOCK_STREAM, 0)) == -1){
perror("socket");
exit(-1);
}
memset(&server_addr, 0, sizeof(server_addr));
server_addr.sin_family = AF_INET;
server_addr.sin_addr.s_addr = htonl(INADDR_ANY);
server_addr.sin_port = htons(PORT);

if(bind(orgsocketfd, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0){
perror("bind");
exit(-1);
}

if(listen(orgsocketfd, QUEUE_LENGTH) < 0){
perror("listen");
exit(-1);
}

client_len = sizeof(client_addr);
if((socketfd = accept(orgsocketfd, (struct sockaddr *)&client_addr, &client_len)) < 0){
perror("accept");
exit(-1);
}
//bind ve listen ve baglanti kabul (accept) islemleri...

Sinav sorusu: FTP uygulamasinin server-side kisminin yazilmasiydi. Server, socket acip bind ve listen islemlerini yapacak, client baglanti kurdugunda ise fork()'la yeni bir socket acip, veri alisverisini burdan gerceklestirmesini saglayacak..

Cevabi ozetlersek server;
sockfd = socket(...);
bind(sockfd, ...);
listen(sockfd,);
while(1){
new_fd = accept(sockfd,...);
if(!fork()){ //child process
close(sockfd); // child process kullanmayacak
send(new_fd); //veri transferi, ben bir message buffer ile yapiyorum.
close(new_fd); //socket ile isi biten child process socket'i kapatir
exit(0); //child process sonlaniyor.
}
close(new_fd); // parent process bu socketi kullanmayacak..
}
close(sockfd); //parent kullandigi socket'i kapatacak..

Bu odevin en eglenceli kismi hocamizin anlattiklariydi. Parayla odev yaptirilan bir siteye giren hocamiz, ogrencilerinden biriyle odev karsiliginda 10 dolara anlasir. Odev tarihi gelip odevini teslim alamayan ogrenci sinirlenir ve bir guzel sayar doker. Ardindan hoca ogrencisini odasina cagirir. 3 kisilik kahvalti masasinda anlatilan bu keyifli olayin ibreti alem olmasi icin nesilden nesile aktarilmasi uygun bulundu. O arkadas artik bir “IYTE” efsanesi!

Cumartesi, Haziran 03, 2006

Staj

Bu sene ki stajim buyuk bir firmada. Yuksek lisanstan lisans dersleri alan ve beraber calistigim bir arkadasim, eskiden staj yaptigi firmada beraber calistigi birinden bana referans olmasini istedi, ve ben bu sayede staja kabul edildim. (Bayagi torpil kokuyor.) Baslarda cok rahatsizdim bu durumdan ama TBD'nin Bilisizm'in de sagolsun bir firma gorevlisi bunun yukunun bir kismini uzerimden aldi. (Baska bir firma netten sinavla aliyormus, o da yapmak istedigim bir yer degildi ama sinavi kacirmasam o firmayi tercih edebilirdim.) Soyledigi sey "Mudurden gelen bir referansa kimse hayir demez idi." Hos hala vicdanim rahat degil. 'Benim onceden calistigimi soylemesi etkilidir' gibi cumlelerle kendimi kandiriyorum durmadan. Sanirim insan nefsi ile alakali birsey. Iyi olani ne sekilde olursa olsun hepimiz istiyoruz. Bir dolu kurumda da staj imkanini bu sekilde elde edebileceginizi ogrenince de kendimi kandirmakta hicbir sakinca gormemeye basladim. Acaba boyle mi sindiriliyoruz yoksa icimizdekileri boyle boyle kendimiz mi sindiriyoruz?

Pazartesi, Mayıs 29, 2006

Client/Server 3



Nihayet..
This project involves a very simple FTP application.
You are supposed to develop two programs, Client and Server, which have the above communication
scheme. Client program accepts the following user commands from the console:
get filename : requests a file. filename is the name of the requested file and it does not
include path information. This request is sent to the server through the
message queue. Upon this request, the server sends the file to the client
through the FIFO. If the requested file does not exist, the server does not
send anything.
put filename : requests uploading a file. After sending this request, the client
immediately sends the file to the server through the FIFO.
dir : request the list of the current directory (where server program is
executed).


--fullduplex.h file--
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "errno.h"
#include "ctype.h"
#include "sys/types.h"
#include "sys/stat.h"
#include "sys/msg.h"
#include "fcntl.h"
#include "unistd.h"

#define NP1 "/tmp/np1"
#define NP2 "/tmp/np2"
#define MAX_BUF_SIZE 1024

struct my_msgbuf {
long mtype;
char mtext[200];
};

--client.c--

#include "fullduplex.h"
int main(int argc, char *argv[]){

int msgqid;
struct my_msgbuf msgbuf;
char command[10], filename[50];
FILE *file;
int rdfd, wrfd;
char readbuffer[MAX_BUF_SIZE];
int numread;

printf("client starts : ");
printf("%s %s\n", argv[0], argv[1]);
msgqid = atoi(argv[1]);

msgbuf.mtype = 1;//neden bilmiyorum
printf("\n--> ");
gets(msgbuf.mtext);
fflush(stdin);
if(msgsnd(msgqid,(struct my_msgbuf*)&msgbuf, sizeof(msgbuf), 0) == -1){
perror("msgsnd");
exit(1);
}
while(strcmp(msgbuf.mtext, "exit") != 0){
if(strcmp(msgbuf.mtext, "dir") == 0){
rdfd = open(NP2, O_RDONLY);
while((numread = read(rdfd, readbuffer, sizeof(readbuffer))) > 0){
readbuffer[numread] = '\0';
printf("%s", readbuffer);
}
printf("\n");
close(rdfd);
}
else{
sscanf(msgbuf.mtext, "%s %s\n", command, filename);
if(strcmp(command, "putfile") == 0){
file = fopen(filename, "r");
wrfd = open(NP1, O_WRONLY);
while((numread = fread(readbuffer, 1, sizeof(readbuffer), file)) > 0){
write(wrfd, readbuffer, numread);
}
fclose(file);
close(wrfd);
}
else{
if(strcmp(command, "getfile") == 0){
file = fopen(filename, "w");
rdfd = open(NP2, O_RDONLY);
while((numread = read(rdfd, readbuffer, sizeof(readbuffer))) > 0){
fwrite(readbuffer, 1, numread, file);
}
fclose(file);
close(rdfd);
}
else{
printf("unknown command\n");
}
}
}
printf("\n--> ");
gets(msgbuf.mtext);
fflush(stdin);
if(msgsnd(msgqid,(struct my_msgbuf*)&msgbuf, sizeof(msgbuf), 0) == -1){
perror("msgsnd");
exit(1);
}
}
printf("client ends\n");

return 1;
}

--server.c--
#include "fullduplex.h"
int main(void){

int ret_val;
key_t key;
int msgqid;
struct my_msgbuf msgbuf;
char command[10], filename[50];
FILE *file;
int rdfd, wrfd;
char readbuffer[MAX_BUF_SIZE];
int numread;

printf("server starts\n");
ret_val = mkfifo(NP1, S_IFIFO | 0666);
if((ret_val == -1) && (errno != EEXIST)){
perror("mkfifo");
exit(1);
}
ret_val = mkfifo(NP2, S_IFIFO | 0666);
if((ret_val == -1) && (errno != EEXIST)){
unlink(NP1);
perror("mkfifo");
exit(1);
}
if((key = ftok(".",'A')) == -1){
unlink(NP1);
unlink(NP2);
perror("ftok");
exit(1);
}
if((msgqid = msgget(key, IPC_CREAT | 0666)) == -1){
unlink(NP1);
unlink(NP2);
perror("msgget");
exit(1);
}
printf("fifo 1 (server read) : %s\n", NP1);
printf("fifo 1 (server write) : %s\n", NP2);
printf("message queue id : %d\n", msgqid);

if(msgrcv(msgqid, (struct my_msgbuf*)&msgbuf, sizeof(msgbuf), 0, 0) == -1){
unlink(NP1);
unlink(NP2);
msgctl(msgqid, IPC_RMID, 0);
perror("msgrcv");
exit(1);
}
while(strcmp(msgbuf.mtext, "exit") != 0){
printf("received command : %s\n", msgbuf.mtext);
if(strcmp(msgbuf.mtext, "dir") == 0){
file = popen("dir", "r");
wrfd = open(NP2, O_WRONLY);
while((numread = fread(readbuffer, 1, sizeof(readbuffer), file)) > 0){
write(wrfd, readbuffer, numread);
}
pclose(file);
close(wrfd);
}
else{
sscanf(msgbuf.mtext, "%s %s\n", command, filename);
if(strcmp(command, "putfile") == 0){
file = fopen(filename, "w");
rdfd = open(NP1, O_RDONLY);
while((numread = read(rdfd, readbuffer, sizeof(readbuffer))) > 0){
fwrite(readbuffer, 1, numread, file);
}
fclose(file);
close(rdfd);
}
else{
if(strcmp(command, "getfile") == 0){
file = fopen(filename, "r");
wrfd = open(NP2, O_WRONLY);
while((numread = fread(readbuffer, 1, sizeof(readbuffer), file)) > 0){
write(wrfd, readbuffer, numread);
}
fclose(file);
close(wrfd);
}
else{
printf("unknown command\n");
}
}
}
if(msgrcv(msgqid, (struct my_msgbuf*)&msgbuf, sizeof(msgbuf), 0, 0) == -1){
unlink(NP1);
unlink(NP2);
msgctl(msgqid, IPC_RMID, 0);
perror("msgrcv");
exit(1);
}
}
printf("received command : %s\n", msgbuf.mtext);

unlink(NP1);
unlink(NP2);
msgctl(msgqid, IPC_RMID, 0);
printf("server ends\n");

return 0;
}

Pazar, Mayıs 28, 2006

GMail-Chat

Hayat kurtaran(?), kontak listesinizdekilerin Aninda Haberlesme(IM) adreslerine sahip olmadan aninda haberlesmeyi saglayan Gmail-Chat zor anlar geciriyora benziyor. Uptime'im sadece ->
Şu an 1:00ös, 1 gün 17:16, 6 kullanıcı çalışıyor, yük ortalaması: 1,60, 1,45, 1,41
ve bu surede gmail-chat servisi bana 3 kere;
"We're experiencing technical difficulties that may prevent your chats from being sent." dedi!
Peki nasil mi tekrar gmail-chat servisinize kavusuyorsunuz; her bilgisayarci gibi yeniden baslatarak(sign-out/sign-in). :) Insana koskoca Google bile sorun yasiyor dedirtiyor. Umarim insan elinin yaptigi her iste sorun olabilecegini unutanlarin da bu problem karsilarina cikar.

Perşembe, Mayıs 25, 2006

Proje Yonetimi ve Kamusal Musteri

Kamuyla calismanin proje yonetimi acisindan zorluklari;
-Ihale sisteminde sirket referanslarinin degil teklif degerinin goz onune alinmasi
-Kamu da ki bir takim terimlerin hem proje de calisan hem de projeyi kullanacak olan kullanicilar icin ayni anlami ifade etmesi
-Fiyat teklifinden once analiz suresinin olmamasi

Ve bu gun proje gelistirme de guzel bir ders aldim. Calistigim sirketin proje yoneticisi benden bir kagit aldi. Bu kagittan ucan bir cisim yapmanizi istesem ne yapardiniz diye sordu. Toplanti halindeydik ve mirin kirin ederken ucak yapariz dedik hepimiz. Peki hedefi vurabilir misiniz bu ucakla dedi ve burusturdugu kagidi firlatti.

Aldigimiz ikinci ders ise uzmanla muhendis kavramlarinin karistirilmasi uzerineydi. Tekstil muhendisi bir arkadas kuramadigi bir programi bir bilgisayar muhendisinden kurmasini istedigin de onun da tekstil muhendisi arkadasa sokuk coraplarini yamatmak istemesi eglenceli bir ornekti. Arkeologlar icin bir sey bulamadik umarim bu yaziyi okumazlar :).

Crystal Reports - Basic Formula Generations

1) Comparing against a fixed quantity (e.g. 100)
-Choose Report->Select Expert
-Select the column that you are going to compare from the table
-Choose "is less than or equal to" from pull-down list and enter 100 in the comparison field.

2)Comparing against a quantity the varies
-Choose Report->Selection Formulas-> Record
-Write the formula into Formula-Field as;
ex: {Table.Column}+{Table.Column}={Table.Column}

3)Comparing against a quantity that initiated in the runtime.
-In the Field Explorer tree, right-click the Parameter Fileds option and choose "New" command.
-Enter name for the parameter field, some prompting text, and the user is tom make.
-Click the Select Expert
-Select the field you want to compare
-In the pull down list select "is greater than or equal to"
-Pull down the list and Select {?ParameterFieldName}

Pazartesi, Mayıs 22, 2006

Client/Server2 calisti!

Zaman duyarliligi icin sinyal kullanmamiz istenmisti, ilk baslarda senkronize calismasada bir sure sonra senkronize oluyor. Bu arada program calisirken (execution'da), "ctrl+c" ile programi kesersem processlerim ölmüyor, ama terminalden "kill pid" ile öldürebiliyorum! "ctrl+z" ile kesersem ise "kill pid" ise yaramiyor, fakat "kill -9 pid" ile "defunct" olan processler hepsi "defunct" statusune gectikten sonra ölüyorlar.

"A user request to interrupt or terminate the program. Most environments are set up to let a user suspend the program by typing C-z, or terminate it with C-c. Whatever key sequence is used, the operating system sends the proper signal to interrupt the process."

Ctrl+z suspend durumuna geciriyor, anladim da; Ctrl+c programi durdurdugu gibi parent (ne bu ebeveyn mi?) ve cocuk processlerin de ölmesi gerekmiyor mu? Iste buna cevap bulamadim!

Pazar, Mayıs 21, 2006

Client/Server2

Iyisin, hossun da sistemde bir kere calistiktan sonra neden calismiyorsun hic anlamadim!

You are supposed to create 3 periodic tasks (using thread or fork mechanism, it’s up to you).
The period of these tasks are 1, 5 and 10 seconds. The job of the first task is to write “I am task
1” on the screen, for the second task “I am task 2” and so on. Since these tasks are periodic, for
example, the first task will repeatedly say “I am task 1” each second, similarly the other tasks
will periodically run and print their messages on the screen.


#include "stdio.h"
#include"signal.h"

void handler1(int sig)
{
printf("I am task1");
signal(sig, handler1);
}

void handler2(int sig)
{
printf("I am task2");
signal(sig, handler2);
}

void handler3(int sig)
{
printf("I am task3");
signal(sig, handler3);
}

int processFork(void *sighandler){

int pid;

if((pid = fork())== -1){
printf("not forked!");
exit(-1);
}else if(pid == 0){
printf("forked!\n");
signal(SIGUSR1, sighandler);
printf("signalled!\n");
while(1)
{
sigpause(SIGUSR1);
printf("duut\n");
}
exit(0);
}

return pid;

}

int main(void)
{
int seconds;
int process1, process2, process3;

process1 = processFork(handler1);
process2 = processFork(handler2);
process3 = processFork(handler3);

printf("process 1 : %d\n", process1);
printf("process 2 : %d\n", process2);
printf("process 3 : %d\n", process3);
for(seconds = 0; seconds < 100; seconds++){
if(seconds % 1 == 0){
kill(process1, SIGUSR1);
}
if(seconds % 5 == 0){
kill(process2, SIGUSR1);
}
if(seconds % 10 == 0){
kill(process3, SIGUSR1);
}
sleep(1);
}

kill(process1, SIGKILL);
kill(process2, SIGKILL);
kill(process3, SIGKILL);

return 0;
}

Cuma, Mayıs 19, 2006

Client/Server1

Write a benchmark program to make a performance comparison of fork and thread
mechanisms. Your performance comparison will take into account only CPU overhead of
creating threads and child processes. The output of your program should be something like this:
“Creating a thread is %x faster than creating a child process using fork”.

#include "stdio.h"
#include "unistd.h"
#include "sys/types.h"
#include "pthread.h"
#include "sys/times.h"

#define THREADCYCLE 500000000
#define FORKCYCLE 500000000

void *print_message_function(void *ptr){
char *message;
message = (char *) ptr;

}

int main(){

struct tms endtime, starttime;
int iterator, return_pid;
pthread_t thread;
int iret;
char *message ="thread";

times(&starttime);
for( ; iterator < THREADCYCLE;){
while( iret == -1){
iret = pthread_create( &thread, NULL, print_message_function, (void*) message);
printf("error");
}
iterator ++;
}
times(&endtime);
printf("bu kadar %d\n",(endtime.tms_utime - starttime.tms_utime));

times(&starttime);
for(iterator =0; iterator < FORKCYCLE;){
while(return_pid == -1){
return_pid = fork();
}
iterator ++;
}
if(return_pid == 0){
exit(0);
}
times(&endtime);
printf("bu kadar %d\n", (endtime.tms_utime - starttime.tms_utime));
}

Çarşamba, Nisan 26, 2006

Understanding Object Orriented Programming with Java

Java konusunda bir kac arkadasa ders anlatmaya basliayacagim. Gecenlerde birisi 'polimorphism' ne diye sordugunda elime kalem kagit almadan ve unlu kutucuklarimi cizemeden tek kelime anlatamadim. Aslinda o kutucuklar iyi oluyor sonra kagidi eline alip dusunebilmesine firsat sagliyorum ama edecek bir kac affilli soz edinsem iyi olur. Bunun icin basliktaki kitabimi bastan okumaya basladim. Kitapta java'da ki datastructures (veriyapilari) ile ilgili bir alinti cok hosuma gitti.

"Ask not what you can do to your data structures, but what your data structures can do for you."..

Pazartesi, Nisan 24, 2006

DB2 Data Types


IBM DB2 Veri Tipleri..

Pazar, Nisan 16, 2006

How to Run DrScheme on Pardus?

Programming Languages dersinde Scheme ile kod yazmamiz istendi. Bende DrScheme'i Pardus'a yukledim. Yararlanmak isteyen arkadaslar icin buraya yaziyorum.

>>http://download.plt-scheme.org/drscheme/plt-301-bin-i386-linux-sh.html
download Drscheme self-installing shell script from one of the mirrors on page.

>>Open a terminal
-My suggestion is ->Pardus->Programs->System->Terminal

>>type this command as user
-chmod +x plt-301-bin-i386-linux.sh

>>type this command as root
-sh plt-301-bin-i386-linux.sh

If you want to install DrScheme under your user's home directory, you could also run this script with your user's permissions, but i can't achieve this.
-when you run this script, it is going to ask for directory to install DrScheme. I perefer /usr/local/bin

>>change diretory (with 'cd' command) to path where you install DrScheme

>>type this command as root
-setup-plt

Now DrScheme is installed. I dont understand why but, DrScheme does not give permission to run as root or as user. So type;
-sudo drscheme

Kullanmak isteyen arkadaslara afiyet olsun diyecegim ama sanirim pisi paketi de yapilmis. Artik baska Linux dagitimlarina uygulamak isteyenler kullanirlar.

Çarşamba, Nisan 12, 2006

Ruby's vs Python 's Inheritance

Ruby ogreniyorum. ruby-lang.org dan "What's Ruby?" kismini okuyup neymis ne degilmis bakarken Ruby'nin 'single inheritance' saglayan Object Oriented bir dil oldugunu ogrendim. Hazir multi-inherited bir dil olan Python'u da ogrenirken dedim ogreniyim aralarinda ki avantaj farki ne?

ruby-lan.org demis ki;
-Ruby features single inheritance only, *on purpose*. But Ruby knows the concept of modules.

But kismi aklima kurt dusurmustu ki, Tekin arkadasim ya felsefe yapmis, geciniz, takilmayiniz dedi. Soyle ki;
-A extends B
-B extends C
*So we see that A uses the methods of C freely! We can say that A extends C, and Java becomes multi-inherited, but it is not.

Ruby modulleri import ederek bu modullerin methodlarinin kullanabilecegini ve bunun karisik olan multi-inheritance'dan daha iyi oldugunu soylemis.

Bakip gorecegiz...

Salı, Nisan 11, 2006

Meet IBM db2

Calismaya basladim, ogrendiklerimi yazmak icin burayi actim. Sanirim yeterli bir giris konusmasi oldu :)

-DB2 Backup:


-Make a remote connection to db2 server machine if necesarry.
-Login

-Run db2 Control Center
-Make a command editor connection

->Before taking a backup we should be sure about that all connections to our database were blocked.
- force application all;

-backup db databasename to path



SImdilik Linux'a gecemedim. Kendi makinama yapacagim ram takviyesinden sonra, kurulumdan itibaren gectigim tum asamalari yazmayi planliyorum. Umarim bir gun birilerinin isine yarar!

Pazartesi, Nisan 10, 2006

Comin' up From Behind!

IBM db2....... Ruby..... Python....... Enterprise Java...... PHP........ PostgreSQL..........
Superman'im ya ben, hih!

Cheerleader

Acildik!