hareesh undergraduate projects

Upload: m422975

Post on 30-May-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 Hareesh Undergraduate Projects

    1/13

    A Not So Short Description Of My Undergraduate Projects

    Hareesh Nagarajan

    Graduate Applicant Fall 2004

    SOC87927

    Contents

    1 ionicChat: An Instant Messenger (IM) protocol 21.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.2 Introducing ionicChat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 The Crux of ionicChat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

    2 Graphical Modeling using the Discrete Element Method 42.1 Preprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.2 Postprocessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 What is this model all about? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

    3 miASMa: A 2 Pass Macro Assembler 6

    4 libmiASMaELF 8

    5 Kidwai Clinical Laboratory Management System 105.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105.2 What was the earlier system like? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105.3 E-Poster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105.4 Has the system been put to use? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    6 MAELSTROM 11

    7 SaveTrees Text Editor 127.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

    8 Time Consistent Database 13

  • 8/14/2019 Hareesh Undergraduate Projects

    2/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    1 ionicChat: An Instant Messenger (IM) protocol

    Status: Will be completed by January 2004.

    Project Guide: Dr. Sudarsh V. Kailas General Manager - Technology at Siemens Information SystemsLimitedUpdates: http://puggy.symonds.net/hareesh/ionic-chat/Implementation: In Linux using sockets.

    1.1 Introduction

    Chat rooms are special web sites or applications that contain rooms in which you can chat with randomsurfers or arrange a rendezvous. They provide for networking on the Internet. It could be rooms thatcater to specialized topics such as Linux installation for newbies or general rooms that cater to teens suchas Teenchat. There are different requirements for business networking as opposed to social networking.Now, when one does enter such chat rooms there is a high probability that the occupants of the chat

    room may be talking about issues that have barely any relevance to the topic for which the chat roomhas been set up in the first place.For example: We might have Anita in #linuxnewbies chatting with Rita on a private window on thewonderful Kashmiri carpets she bought for herself on her trip to India. As we can see, Anita seems to betalking about things that have barely any relevance to Linux. Now at the same time if Seth, a Kashmiricarpet aficionado, was desperately foraging the various IRC (Internet Relay Chat), Web Chat-serversand Internet Messaging Services to find people to recount their recent carpet splurges to him, would notonce think about logging onto #linuxnewbies (running on an obscure IRC server) and expect to start aconversation with a nondescript Anita on Kashmiri carpets.

    1.2 Introducing ionicChat

    Firstly, there arent any chat rooms in ionicChat. Secondly, when a user logs into the system he specifiesa set of interests which we will call Static Interests. Assuming the system starts as an inchoate state withno user knowing the other, users perform a query on these static interests, and only then start chattingwith each other.Assuming Anita and Rita have no idea about each other, they each log into the system having specifiedtheir static interests which are as follows:

    Static Interests for Anita: Fishing, Linux installation for newbies, Day care

    Static Interests for Rita: Day care, Go-karting, Blink-182

    Rita queries the system for the interest Day care and voila she gets a hit which links to user Anita.Anita and Rita then start chatting away.

    It is from this point on that ionicChat is different from other IM protocols.

    1.3 The Crux of ionicChat

    Every message that keeps shuttling across Anita and Rita is broken down into their constituent wordsand the relevant words are then stored in a transient database at the server.For example:

    Undergraduate Projects 2

  • 8/14/2019 Hareesh Undergraduate Projects

    3/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    Rita: Hi Anita, Wow! Your interests include Day Care too

    Anita: Yes infact they do.

    Rita: I have a naughty 4 year old who needs to be placed in Day Care and

    it must be in and around Nariman Point. Do you know of any such place?Anita: ... ...

    ... And they chat ...

    ... ...

    Anita: Kashmir is such a beautiful place.

    Rita: Really?

    Anita: I managed to visit Ladakh earlier this year and bought myself

    2 stunning Kashmiri carpets.

    Rita: Nifty! Ive heard they are really pretty.

    Anita: ... ...

    ... And they chat ...

    ... ...

    Two assumptions are made here:

    1. The users are well aware that their chat is being overheard by our friendly ionicChat Server.

    2. There exists an intelligent filter at the client end that identifies important words also known asBuzz words and subsequently sends them to the server.

    So now the ionicChat server is aware of two things:Firstly, two of its users (Anita and Rita) are chatting away to glory.Secondly, the buzz words that are floating around in their chat are:

    Anita, include, Day, Care, naughty, Nariman, Point, ...Ladakh, Nifty, stunning, Kashmiri, carpets, heard, pretty, ...

    So using this simplistic mechanism the server maintains a state of every users chat content.Our affable Seth now logs into the system with his static interests setup as follows:

    Static Interests for Seth: Rush, Tom Sawyer, Psychedelic Carpets

    Now Seth queries the system for Kashmiri Carpets. The server then searches its transient database todiscover that users Anita and Rita are currently involved in a chat in which the buzz words Kashmiriand Carpets were uttered sometime in the recent past in the chat involving Anita and Rita. Seth thenrequests Anita and Rita to let him join their chat, or otherwise he makes formal requests to add the twoonto his friend list.

    Thus Seth is left a happy man, having discovered a lady somewhere in cyberspace who can satiate hisinformation for carpets.

    1.4 Conclusion

    The primary design of ionicChat has been established and around fifty percent of the implementationusing the Qt library has be done. Only time will tell if it can achieve the goals it initially set out toaddress.

    Undergraduate Projects 3

  • 8/14/2019 Hareesh Undergraduate Projects

    4/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    2 Graphical Modeling using the Discrete Element Method

    Status: Will be completed by January 2004.

    Project Guide: Dr. T.J. Sitharam, Department of Civil Engineering, Indian Institute of ScienceUpdates: http://puggy.symonds.net/hareesh/iisc-civil/Implementation: In Java using 2-Dimensional drawing primitives.

    In this project my task is to develop 3-Dimensional models for particles whose specification have beengiven by TRUBAL (A discrete element modeling program). I am writing programs that take care of thepreprocessing and postprocessing activities.

    2.1 Preprocessing

    The preprocessing activity is involved with providing an interface to allow the user to specify the numberof particles, the orientation of the particles, the kind of model that needs to be generated etc.

    2.2 Postprocessing

    The postprocessing activity is involved with the actual plot. Here the user is provided with variousfacilities to manipulate the model generated on the screen.

    2.3 What is this model all about?

    We have around 10,000 particles placed inside a parellopiped which can be rotated about 2 planes. Thespecifications for the particles are read from a large data file generated by TRUBAL. My program (forthis particular model) reads the file, applies the necessary transformations for the entire system, sortsthe particles such that the ones deepest inside are drawn first and then generates a post script of the

    resulting model.

    Undergraduate Projects 4

  • 8/14/2019 Hareesh Undergraduate Projects

    5/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    Figure 1: Sample particle model as a postscript

    Undergraduate Projects 5

  • 8/14/2019 Hareesh Undergraduate Projects

    6/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    Figure 2: miASMa Block Diagram

    3 miASMa: A 2 Pass Macro Assembler

    Is a 2 Pass Macro Assembler that generates object files conforming to the ELF Object File Format.WEB: http://freshmeat.net/projects/miasmaOperating System: Can be compiled on most LINUX distributions with g++ 2.9x Only

    usage: miasma infile [-c outfile | -o outfile] [-v] [-r][-e outfile] [-s]

    or miasma --version for version informationor miasma -h to view help

    -c Creates outfile which is a Relocatable Object File thatconforms to ELF specification. (Basically the .o file)

    -o Creates an executable outfile. miasma internally invokes ld-v verbose output for every instruction that has been assembled-r Retain intermediate .mac file. This file is the source file

    with the macros (if present) expanded.Default action is to delete this file

    -e Redirect Error to file-s Redirect Error to stdout. This is the default action

    $cat ncr.asm -- n!/(r!*(n-r)! A combination program written for miASMa

    MACRO SYSCALL A B C DMOV AX,A;Syscall numberMOV BX,B;File descriptorMOV ECX,C;32 bit relocation address

    MOV DX,D;No of bytesINT 80H;InterruptENDMSEGMENT .DATA

    N DB 06HR DB 04HRES DB 00HRESA DB 00H,0AH,0DHTXT DB NCR -

    SEGMENT .TEXTMOV AL,[N]MOV BL,[R]CALL NCRMOV AL,[RES]

    Undergraduate Projects 6

  • 8/14/2019 Hareesh Undergraduate Projects

    7/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    Figure 3: A limited comparison: miASMa v/s NASM

    AAMADD AX,3030HMOV [RES],AHMOV [RESA],ALSYSCALL 4 1 TXT 6SYSCALL 4 1 RES 4MOV AX,1MOV BX,0INT 80H

    NCR:CMP AL,BLJE INCACMP BL,0JE INCACMP BL,1JE ADDN

    PUSH AXDEC ALCMP AL,BLPOP AXJE ADDNDEC ALPUSH AXPUSH BXCALL NCRPOP BXPOP AXDEC BLPUSH AXPUSH BXCALL NCRPOP BXPOP AXRET

    INCA:

    INC BYTE[RES]RET

    ADDN:ADD [RES],ALRET

    $m iasma ncr.asm -c < -- Assemble N ow! with miASM a$ld ncr.o -o ncr$./ncrNCR - 15$

    Undergraduate Projects 7

  • 8/14/2019 Hareesh Undergraduate Projects

    8/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    Figure 4: The memory map of the hello.o file written by libmiASMa byte-by-byte

    4 libmiASMaELF

    This simple library can be used to write relocatable object files conforming to the ELF Format.Let us have a look at a sample C++ program which makes use of the libmiASMaELF library to writean object file (hello.o) which on linking will print Hello, World! onto the standard output.

    simple Hello, World! program written using libmiASMaELF.WEB: http://freshmeat.net/projects/libmiasmaelfOperating System: Can be compiled on most LINUX distributions with g++ 2.9x Only

    #include

    #include

    #include "libmiasmaelf.h"

    int main(void )

    {

    char text[] = {

    \xB8, \x04, \x00, \x00, \x00, // mov eax, 4

    Undergraduate Projects 8

  • 8/14/2019 Hareesh Undergraduate Projects

    9/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    \xBB, \x01, \x00, \x00, \x00, // mov ebx, 1

    \xB9, \x00, \x00, \x00, \x00, // mov ecx, msg

    \xBA, \x0E, \x00, \x00, \x00, // mov edx, 14

    \xCD, \x80, // int 0x80

    \xB8, \x01, \x00, \x00, \x00, // mov eax, 1

    \xCD, \x80 // int 0x80

    };

    char data[] = {

    \x48, \x65, \x6C, \x6C, \x6F, // Hello, World! written in Hexadecimal

    \x2C, \x20, \x57, \x6F, \x72,

    \x6C, \x64, \x21, \x0A

    };

    vector vtext(&text[0], &text[29]);

    vector vdata(&data[0], &data[14]);

    miasmaELF obj;

    obj.InitializeELFHeader();

    obj.InitializeSymbolTable();

    obj.AddNewSection(".shstrtab",SHT_STRTAB, 0,0,0,0,0,0);

    obj.AddNewSection(".text", SHT_PROGBITS,6,0,0,0,16,0);

    obj.AddNewSection(".data", SHT_PROGBITS,3,0,0,0,16,0);

    obj.AddNewSection(".symtab", SHT_SYMTAB, 0,0, obj.GetSectionIndexOfType(SHT_STRTAB, ".strtab"),

    0, 4,sizeof(Elf32_Sym));

    obj.AddNewSection(".rel.text",SHT_REL,0,0, obj.GetSectionIndexOfType(SHT_SYMTAB),

    obj.GetSectionIndexOfType(SHT_PROGBITS, ".text"),

    4,sizeof(Elf32_Rel));

    obj.AddContents(vtext, obj.GetSectionIndexOfType(SHT_PROGBITS,".text"));obj.AddContents(vdata, obj.GetSectionIndexOfType(SHT_PROGBITS,".data"));

    obj.AddSymbol("_start",0,0, STB_WEAK, STT_FUNC,

    obj.GetSectionIndexOfType(SHT_PROGBITS, ".text"));

    obj.AddSymbol("msg",0,0, STB_GLOBAL, STT_OBJECT,

    obj.GetSectionIndexOfType(SHT_PROGBITS, ".data"));

    obj.AddRelocationEntry(11, obj.ReturnSymbolIndex("msg"),

    R_386_RELATIVE,

    obj.GetSectionIndexOfType(SHT_REL, ".rel.text"));

    obj.PrepareFile();

    obj.WriteFile("hello.o"); //Yippie! libmiASMaELF has created hello.o}

    Undergraduate Projects 9

  • 8/14/2019 Hareesh Undergraduate Projects

    10/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    5 Kidwai Clinical Laboratory Management System

    WEB: http://www.gnu.org/directory/Business and Productivity/special/kidwai.html

    Operating System: Windows.Software: Apache, MySQL, PHPScreen Shots: A number of them are posted on this link http://puggy.symonds.net/hareesh/kidwai/

    5.1 Introduction

    This system is one of the first of its kind in India to be built using open source components to automate asingle, yet critical component of a Hospitals existing (non-computerized) system. KCLMS was developedfor the Kidwai Institute of Oncology (the largest federal Cancer Hospital in India) to automate the entireprocess of a patients laboratory-test requisition details.

    That means, right from the registration of a patient for a specific test, upto a doctor viewing the patientstest results from her terminal. The entire chain of Patients, Receptionists, Central Lab RegistrationTechnicians, Individual Laboratory Technicians, Doctors and System Administrators are assigned rolesand have been made active entities in the system. The schema was built by mapping an ER Diagramto a schema. A number of deficiencies encountered with MySQL have been documented (namely lackof composite foreign keys). Finally, KCLMS can be used as a prototype to develop a similar Patient-LabTest-Registration system that is highly robust, secure and based on rigorous normalization principles.

    5.2 What was the earlier system like?

    The earlier manual system imposed upon the patient to physically report at the various individual labo-ratories to register for tests as prescribed by the consulting doctor. The laboratory staff at the specifiedlaboratory would then perform the test immediately after the registration or at a point later in time.There were occurrences of inconsistencies cropping up in the patient data across laboratories because ofthe lack of a centralized repository. Typically, once the results of the tests were obtained the manuallywritten test reports were forwarded to the concerned Doctors office. This meant the system did notprovide a mechanism for a doctor to query on the status of a test at any point in between. It also did notprovide a facility to evaluate the efficiency of a laboratory on the basis of the number of pending tests.

    5.3 E-Poster

    To read more on the e-poster that was selected at the 8th Advancing Practice, Instruction & Innovationthrough Informatics conference organized by the University of Pittsburgh Medical Center visithttp://apiii.upmc.edu/abstracts/posterarchive/2003/nagarajan.html

    5.4 Has the system been put to use?

    Yes it has! The results have been documented in the eposter above.

    Undergraduate Projects 10

  • 8/14/2019 Hareesh Undergraduate Projects

    11/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    Figure 5: MAELSTROMs Design

    Figure 6: MAELSTROMs Features

    6 MAELSTROM

    Is a 2-Dimensional Vector Graphics package written in Turbo C++.WEB: http://puggy.symonds.net/hareesh/maelstromOperating System: Can be compiled only with the horrible Turbo C++ compiler on DOS.

    Undergraduate Projects 11

  • 8/14/2019 Hareesh Undergraduate Projects

    12/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    Figure 7: SaveTrees Text Editor - Class Hierarchy

    Figure 8: SaveTrees Text Editor - Screen Shot

    7 SaveTrees Text Editor

    Is a full screen, real time text editor written using the NCURSES library. It is written entirely in C++with roughly 2800 lines of code. Figure 7 shows the editors class hierarchy. The services of the StandardTemplate Library have been used extensively. Multiple editing windows were provided by creating avector of pointers to objects of Class Type. The editor also supports the usual editing operations suchas cut, copy, paste.WEB: http://freshmeat.net/savetreesOperating System: Can be compiled on most LINUX distributions with g++ 2.9x Only.

    7.1 Limitations

    One cannot perform EDIT operations across files. This was because of lack of foresight on my partwhile designing the Class BlockEdit.

    The real TAB has not been implemented.

    SaveTrees is extremely phlegmatic when a really large file opened.

    Undergraduate Projects 12

  • 8/14/2019 Hareesh Undergraduate Projects

    13/13

    SOC87927 - Hareesh Nagarajan Graduate Applicant Fall 2004

    Figure 9: Design of the Time consistent Database

    8 Time Consistent Database

    I designed and wrote a Time Consistent Database, a module used in Remote Telemetry Units at theCenter for the Development of Advanced Computing, Bangalore (C-DAC) on the QNX RTOS. For acomprehensive treatment of the system visit the link below.WEB: http://puggy.symonds.net/hareesh/cdac/cdac-paper.pdfOperating System: QNX RTOS. Snippets of the source are reproduced in the documentation.

    Undergraduate Projects 13