Posts

Why Java!?

Java is an Object Oriented Programming Language. This means that everything in Java is an Object, whose template is given by the Class. Object Oriented Programming Features in Java: 1. Encapsulation Keep variables private and methods public ie just capsule all the data in java 2. Polymorphism Showing many forms. In java this is achieved by overriding and overloading 3. Abstraction Hide the complex implementation hidden from the user and show only the required information 4. Inheritance In java inheritance can be achieved by either extending a class or implementing an interface Features of Java Purely OOPs based Simple to learn Robust - Exception handling and Garbage collection make life easy for a Java Developer Secure - No pointers and high security as it doesnot allow a web applet to read and write from to a file easily High Performance Multi-threading Platform independent and Architecture neutral - java is compile once and run anywhere

Restarting Oracle DB amd OEM

Ever wanted to restart your oracle database instance? Here are some basic steps that will help you restart your oracle db on linux. Firstly, login to your database as oracle You can keep a check on ora processes like this - > ps - ef | grep ora Check that ORACLE_HOME, ORACLE_SID is properly set. Login as sysdba using sqlplus sqlplus / as sysdba >shutdown abort; This will abort all the running processes and immediately shutdown your oracle db. Once this is done, >startup; This will start and mount your db and your db is ready to use. In case your listener is down, start it using the following commands: Set the proper ORACLE_SID. lsnrctl start Db is ready to use. Starting and stopping OEM There is a very powerful oracle monitoring tool called the oracle enterprise manager. I totally love using it. It gives entire performance matrix of your db and also make oracle administration easy. Use it to believe its power. Start emctl. Useful command...

My Book-et list

This is a list of books i want to read before I die ;) . I will also mention books i am currently reading and books which have i have loved. If you come across this list and know some really great worth - reading books, please mention in the comments below. Thanks already!!! :D Books i want to read: Autobiography of Napolean Hill Ramayana The Hobits Ignited minds Mein Kampf Shantaram I want to read any travelogue(please suggest)  ... Will keep adding to this list. Books I have read and loved: To kill a mocking bird :  This book is a must read for everyone if you have already not read it. This is one of the only two books by Harper Lee. (PS. Can be an excellent gift for anyone)  Wings of fire :  A beautiful book. Its about struggle and endurance to achieve your goal. It is about the efforts and vision of a great visionary - A P J Abdul Kalma The Lord of the Rings :  Masterpiece by J R R Tolkien. I have heard a lot about his other work and do...

Process Communication in Erlang

Image
Hi there! In erlang, no process talks directly to each other. You can think of it as a process in erlang has locked itself up in a room. And it is very workaholic. It loves doing its own work. What about Concurrency and inter process communication? Your one process can mail other process with required details and ask it to work on the data. (Erlang processes are workaholic). You just need the address of the process (the Process ID or the PID for this). Lets take a very simple example, where in the erlang process prints the sound of the animal. ==================== -module(animal_sound). -compile(export_all). sound()-> receive dog -> io:format("bhuw bhuw"); cat -> io:format("Meow"); _ -> io:format("Whisperings!") end. ==================== Save as animal_sound.erl, compile and run. Note : compile(export_all) can be used when you want all your functions to be visible to the outside world. Else you can export onl...

PLSQL Procedure in Erlang

Image
Functions/Procedures from Erlang: Prepare your DB: drop table employee; CREATE TABLE EMPLOYEE ( "NR" NUMBER, "FIRSTNAME" VARCHAR2(20), "LASTNAME" VARCHAR2(20), "GENDER" CHAR(1), "EXPERIENCE" NUMBER ) ; ALTER TABLE EMPLOYEE ADD PRIMARY KEY ("NR"); DROP SEQUENCE EMPLOYEE_SEQ; CREATE SEQUENCE EMPLOYEE_SEQ INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 CACHE 20; create or replace TRIGGER EMPLOYEE_SEQ_TRG BEFORE INSERT ON EMPLOYEE FOR EACH ROW BEGIN <<COLUMN_SEQUENCES>> BEGIN IF INSERTING AND :NEW.NR IS NULL THEN SELECT EMPLOYEE_SEQ.NEXTVAL INTO :NEW.NR FROM SYS.DUAL; END IF; END COLUMN_SEQUENCES; END; insert into EMPLOYEE(FIRSTNAME, LASTNAME, GENDER, EXPERIENCE) values ('Richa','Vaidya','F',4); select * from EMPLOYEE; and check the output. Lets create a procedure for inserting: ...

Learning PHP Now ;)

Image
I am learning PHP now. Here is a basic tutorial on PHP. What all do you need to learn PHP? 1.        I am using XAMPP server : https://www.apachefriends.org/index.html Check the video on how to install XAMPP from the site. 2.        That’s it! Yes. If you install XAMPP Server for development, that’s all you need. It allows you to select all that you want to install : PHP, Perl, MySql etc. Easy to install and use. Assumptions for the tutorial: 1.        The installation directory for XAMPP is C:\xampp 2.        You have basic HTML Knowledge 3.        Other assumptions will be added as I come across them :D Starting you XAMPP: If you have checked the video on XAMPP Site, you probably have already started XAMPP and MySql Server. If you get error like: www.example.com:443:0 server certificate does NOT include...

PL/SQL Procedure

Image
Creating a procedure in PL-SQL: Firstly, we create a table, a sequence for the primary keys and a trigger to handle the value of primary key. =========================== DROP TABLE DUMMY_TABLE; CREATE TABLE DUMMY_TABLE( DUMMY_ID INTEGER, TIME_DELAY INTEGER ); ALTER TABLE DUMMY_TABLE ADD( CONSTRAINT DUMMY_PK PRIMARY KEY(DUMMY_ID) ); DROP SEQUENCE DUMMY_SEQUENCE ; CREATE SEQUENCE DUMMY_SEQUENCE INCREMENT BY 1 START WITH 1 MAXVALUE 9999999999999999999999999999 MINVALUE 1 CACHE 20; CREATE OR REPLACE TRIGGER DUMMY_SEQUENCE_TRIGGER BEFORE INSERT ON DUMMY_TABLE FOR EACH ROW BEGIN < > BEGIN IF INSERTING AND :NEW.DUMMY_ID IS NULL THEN SELECT DUMMY_SEQUENCE.NEXTVAL INTO :NEW.DUMMY_ID FROM SYS.DUAL; END IF; END COLUMN_SEQUENCES; END; Here we have created a dummy table, a sequence and a trigger. On every insert on the table, the trigger will be called and next value of oour sequence will be the ID/Primary key of our table. Let us now se...