A Not So Short Description Of My Undergraduate Projects Hareesh Nagarajan Graduate Applicant Fall 2004 SOC87927

Contents 1 ionicChat: An Instant Messenger (IM) protocol 1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . 1.2 Introducing ionicChat . . . . . . . . . . . . . . . . 1.3 The Crux of ionicChat . . . . . . . . . . . . . . . . 1.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . 2 Graphical Modeling using the Discrete Element 2.1 Preprocessing . . . . . . . . . . . . . . . . . . . . 2.2 Postprocessing . . . . . . . . . . . . . . . . . . . 2.3 What is this model all about? . . . . . . . . . . .

. . . .

2 2 2 2 3

Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 4 4 4

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

3 miASMa: A 2 Pass Macro Assembler

6

4 libmiASMaELF

8

5 Kidwai Clinical Laboratory Management System 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . 5.2 What was the earlier system like? . . . . . . . . . . 5.3 E-Poster . . . . . . . . . . . . . . . . . . . . . . . . 5.4 Has the system been put to use? . . . . . . . . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

10 10 10 10 10

6 MAELSTROM

11

7 SaveTrees Text Editor 7.1 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12 12

8 Time Consistent Database

13

SOC87927 - Hareesh Nagarajan

1

Graduate Applicant Fall 2004

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 Systems Limited Updates: 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 random surfers or arrange a rendezvous. They provide for networking on the Internet. It could be rooms that cater to specialized topics such as ‘Linux installation for newbies’ or general rooms that cater to teens such as ‘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 room has been set up in the first place. For example: We might have Anita in #linuxnewbies chatting with Rita on a private window on the wonderful Kashmiri carpets she bought for herself on her trip to India. As we can see, Anita seems to be talking about things that have barely any relevance to Linux. Now at the same time if Seth, a Kashmiri carpet aficionado, was desperately foraging the various IRC (Internet Relay Chat), Web Chat-servers and Internet Messaging Services to find people to recount their recent carpet splurges to him, would not once think about logging onto #linuxnewbies (running on an obscure IRC server) and expect to start a conversation with a nondescript Anita on Kashmiri carpets.

1.2

Introducing ionicChat

Firstly, there aren’t any chat rooms in ionicChat. Secondly, when a user logs into the system he specifies a set of interests which we will call Static Interests. Assuming the system starts as an inchoate state with no user knowing the other, users perform a query on these static interests, and only then start chatting with each other. Assuming Anita and Rita have no idea about each other, they each log into the system having specified their 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 words and the relevant words are then stored in a transient database at the server. For example:

Undergraduate Projects

2

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! I’ve 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 as Buzz 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 to discover that users Anita and Rita are currently involved in a chat in which the buzz words ‘Kashmiri’ and ‘Carpets’ were uttered sometime in the recent past in the chat involving Anita and Rita. Seth then requests Anita and Rita to let him join their chat, or otherwise he makes formal requests to add the two onto his friend list. Thus Seth is left a happy man, having discovered a lady somewhere in cyberspace who can satiate his information for carpets.

1.4

Conclusion

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

Undergraduate Projects

3

SOC87927 - Hareesh Nagarajan

2

Graduate Applicant Fall 2004

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 Science Updates: 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 been given by TRUBAL (A discrete element modeling program). I am writing programs that take care of the preprocessing and postprocessing activities.

2.1

Preprocessing

The preprocessing activity is involved with providing an interface to allow the user to specify the number of 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 various facilities 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. The specifications for the particles are read from a large data file generated by TRUBAL. My program (for this particular model) reads the file, applies the necessary transformations for the entire system, sorts the particles such that the ones deepest inside are drawn first and then generates a post script of the resulting model.

Undergraduate Projects

4

SOC87927 - Hareesh Nagarajan

Graduate Applicant Fall 2004

Figure 1: Sample particle model as a postscript

Undergraduate Projects

5

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/miasma Operating 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 information or miasma -h to view help -c -o -v -r

-e -s

$cat ncr.asm

Creates outfile which is a Relocatable Object File that conforms to ELF specification. (Basically the .o file) Creates an executable outfile. miasma internally invokes ld verbose output for every instruction that has been assembled Retain intermediate .mac file. This file is the source file with the macro’s (if present) expanded. Default action is to delete this file Redirect Error to file Redirect Error to stdout. This is the default action

-- n!/(r!*(n-r)!

A combination program written for miASMa

MACRO SYSCALL A B C D MOV AX,A;Syscall number MOV BX,B;File descriptor MOV ECX,C;32 bit relocation address MOV DX,D;No of bytes INT 80H;Interrupt ENDM SEGMENT .DATA N DB 06H R DB 04H RES DB 00H RESA DB 00H,0AH,0DH TXT DB ’NCR - ’ SEGMENT .TEXT MOV AL,[N] MOV BL,[R] CALL NCR MOV AL,[RES]

Undergraduate Projects

6

SOC87927 - Hareesh Nagarajan

Graduate Applicant Fall 2004

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

AAM ADD AX,3030H MOV [RES],AH MOV [RESA],AL SYSCALL 4 1 TXT 6 SYSCALL 4 1 RES 4 MOV AX,1 MOV BX,0 INT 80H NCR: CMP AL,BL JE INCA CMP BL,0 JE INCA CMP BL,1 JE ADDN PUSH AX DEC AL CMP AL,BL POP AX JE ADDN DEC AL PUSH AX PUSH BX CALL NCR POP BX POP AX DEC BL PUSH AX PUSH BX CALL NCR POP BX POP AX RET INCA: INC BYTE[RES] RET ADDN: ADD [RES],AL RET $miasma ncr.asm -c $ld ncr.o -o ncr $./ncr NCR - 15 $

Undergraduate Projects

< -- Assemble Now! with

miASMa

7

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 write an 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/libmiasmaelf Operating 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’,

Undergraduate Projects

// mov eax, 4

8

SOC87927 - Hareesh Nagarajan

’\xBB’, ’\xB9’, ’\xBA’, ’\xCD’, ’\xB8’, ’\xCD’, };

’\x01’, ’\x00’, ’\x0E’, ’\x80’, ’\x01’, ’\x80’

’\x00’, ’\x00’, ’\x00’, ’\x00’, ’\x00’, ’\x00’, ’\x00’, ’\x00’, ’\x00’, ’\x00’, ’\x00’, ’\x00’,

char data[] = { ’\x48’, ’\x65’, ’\x6C’, ’\x6C’, ’\x6F’, ’\x2C’, ’\x20’, ’\x57’, ’\x6F’, ’\x72’, ’\x6C’, ’\x64’, ’\x21’, ’\x0A’ };

Graduate Applicant Fall 2004

// // // // // //

mov mov mov int mov int

ebx, ecx, edx, 0x80 eax, 0x80

1 msg 14 1

// Hello, World! written in Hexadecimal

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

SOC87927 - Hareesh Nagarajan

5

Graduate Applicant Fall 2004

Kidwai Clinical Laboratory Management System

WEB: http://www.gnu.org/directory/Business and Productivity/special/kidwai.html Operating System: Windows. Software: Apache, MySQL, PHP Screen 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 a single, yet critical component of a Hospital’s existing (non-computerized) system. KCLMS was developed for the Kidwai Institute of Oncology (the largest federal Cancer Hospital in India) to automate the entire process of a patient’s laboratory-test requisition details. That means, right from the registration of a patient for a specific test, upto a doctor viewing the patients test results from her terminal. The entire chain of Patients, Receptionists, Central Lab Registration Technicians, Individual Laboratory Technicians, Doctors and System Administrators are assigned roles and have been made active entities in the system. The schema was built by mapping an ER Diagram to a schema. A number of deficiencies encountered with MySQL have been documented (namely lack of composite foreign keys). Finally, KCLMS can be used as a prototype to develop a similar PatientLabTest-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 laboratories to register for tests as prescribed by the consulting doctor. The laboratory staff at the specified laboratory 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 of the lack of a centralized repository. Typically, once the results of the tests were obtained the manually written test reports were forwarded to the concerned Doctor’s office. This meant the system did not provide a mechanism for a doctor to query on the status of a test at any point in between. It also did not provide 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 & Innovation through Informatics conference organized by the University of Pittsburgh Medical Center visit http://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

SOC87927 - Hareesh Nagarajan

Graduate Applicant Fall 2004

Figure 5: MAELSTROM’s Design

Figure 6: MAELSTROM’s Features

6

MAELSTROM

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

Undergraduate Projects

11

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 editor’s class hierarchy. The services of the Standard Template Library have been used extensively. Multiple editing windows were provided by creating a vector of pointers to objects of Class ‘Type’. The editor also supports the usual editing operations such as cut, copy, paste. WEB: http://freshmeat.net/savetrees Operating 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 part while designing the Class ‘BlockEdit’. • The real TAB has not been implemented. • SaveTrees is extremely phlegmatic when a really large file opened.

Undergraduate Projects

12

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 the Center for the Development of Advanced Computing, Bangalore (C-DAC) on the QNX RTOS. For a comprehensive treatment of the system visit the link below. WEB: http://puggy.symonds.net/˜hareesh/cdac/cdac-paper.pdf Operating System: QNX RTOS. Snippets of the source are reproduced in the documentation.

Undergraduate Projects

13

22087947-Hareesh-Undergraduate-Projects.pdf

Assuming the system starts as an inchoate state with. no user knowing the other, users perform a query on these static interests, and only then start chatting.

12MB Sizes 1 Downloads 41 Views

Recommend Documents

No documents