Tuesday, 4 October 2016

Software Companies to work in Magdeburg

Magdeburg is being the Capital city of Saxony-anhalt with two Universities namely  Otto-Von-Guericke Universitat and Magdeburg Stendal University of Applied science.
     Due to the presence of the universities, many companies located surrounded by University and other parts of the city. Two major research Institutes SAP UCC and Fraunhofer.

Below are the few companies where students can get internships, student jobs and permanent jobs. But most of the companies ask for German proficiency so it is better to learn German language at least A2 .

Best places to visit in Croatia

Croatia  is one of the famous country in  Central Europe to visit because of its coast line , Zagreb is the Capital city of Croatia. Below are the wonderful places to visit, one who visits Europe should never miss these places. Split and Dubrovnik are the well known places in Game of Thrones.

  1. Zagreb
  2. Zadar
  3. Split
  4. Dubrovnik
  5. Splitvice national park
If you are visiting Zadar and if you are brave enough try for Bungy jump which is 65 Kilometers from Zadar and it cost 80 Euros.


Also, in Dubrovnik Scuba diving will be awesome experience if you are interested and it cost 67 Euros.


Frequently asked SQL Queries

1. Select the second largest salary from the employee table.

> select max(salary) from employee
 where salary <  (select max(salary) from employee);


Frequently asked Top 10 Unix interview questions

1. List 10 commands that you use daily in your work?
   1. ps -ef : To check the process status
   2. top -c : to check memory and CPU details
   3. df -h : To check the mount point details
   4. sed :  string editor
       options: n -> To edit particular line 'n'
                     'nq' -> To quit after reading 'n' number of lines.
                     'np' -> To display n lines
                       5. scp : Secured copy between two hosts
   6. grep : string matching
       options: i -> To ignore case
                     v -> To reverse the matching
                     e -> Extended grep, to give more options
                     n -> display line numbers
                     c -> Count lines containing pattern
                     l -> Display file name
                     f -> Taking pattern from file
   7. du -hs : To check the disk usage of files and directories.
   8. gzip/gunzip : Top zip the files or directories
   9. netstat : to check the network statistics
  10. iostat : To check disk usage

2. How run a job in the background and how to bring it to foreground?
    To run job in background:jobname &
    To list all the jobs running in background: jobs
    To bring job from background to foreground: fg job_name/job_number

3. How to kill a process?
    kill -9 job_id
4. How to search for a string in vi editor?
     /string and press 'n' for next
5. how to create a child process?
    fork(); it creates one child process so total two processes will be running, parent and child.

6.  How to create an empty file or a file with 0kb?
     touch file_name

7. How    

Silhouette Coefficient for K-means cluster using R Programming

1.   Import the dataset from file .csv or .txt into Data frame


           >(dataframe <-  read.csv("F:\\mydata\\data.csv"))

            Above command imports the dataset into data frame, which can be used for clustering or classification etc.

2. Ignore the first column if it contains the headings

    >s0  <- shipment1[-1,] 
    or while reading the file, we can choose an option to choose header or not by giving header option to true or false

    >read.csv(file, header = TRUE, sep = ",", quote = "\"",
             dec = ".", fill = TRUE, comment.char = "", ...)

3. Convert all the character data types into numeric data

         >library( taRifx )
        >s00 <- japply( s0, which(sapply(s0, class)=="character"), as.numeric )

4. Perform the K-Means clustering for K=2……n

        >library(“cluster”)
       >s0_cluster <- kmeans(s00,3,20)
Here, First argument is data frame, second if the number of clusters and third is the number of iterations.

5. Find the Silhouette Co-efficient

       >sil <- silhouette(s0_cluster$cluster, dist(s000))
Here, S0_cluster$cluster is the cluster label, and second argument dist(s00) is the distance matrix for the dataset.

6. Plot the graph using the plot function
      
      >plot(sil, main ="Silhouette plot - K-means")
      Below is the graph for the plot.






       

    

Thursday, 31 March 2016

how to open student block account for Germany

Opening the block account is very crucial for the Visa process and it is time consuming during peek times. There are three ways students can open the block account.

1. In Deutsche Bank in Germany through Embassy.
2. In Local Deutsche Bank
3. In Kotak Mahindra Bank.

Select the first option always, in worst case go for the other options.


1.In Deutsche Bank in Germany through Embassy.

Steps:
       1. Book an appointment in German consulate Click Here
       2. Carry filled application form and passport copy to embassy, they will attest both the copies.
       3. Send the attested copies to Deutsche bank address which is mentioned in the application                      form.
       4. You will get response with in 10 working days.

2. In Local Deutsche Bank.

Steps:
  1. Go to any nearest Deutsche bank along with passport copy,pan card and one cheque for 1 lack rupees.
  2. They will fill both savings account form and block account form and send the block account form to Germany.
  3. they open savings account within 7 working days and you need to maintain the minimum balance of 1 lack rupees.
  4. The wont be having any control on the block account opening once they send the application.You can save the courier charges and attestation charges. But you need one lack rupees.

3. In Kotak Mahindra bank.

Steps:
  1. You need to carry cheque for rupees equivalent to 8500EUROS to any nearest kotak mahindra bank, they will open block account with in 3 to 10 working fays.
  2. once you reach Germany you need to open an block account in Deutsche bank again.

Note: open the block account while you are applying for universities, during the peak times this is the time consuming process and it holds visa process. It does not require university admit letter.



Tuesday, 24 December 2013

shell script to check mount point size in linux/solaries

The following shell script notifies you if any mount point is greater than 90% full
#!/bin/bash
df -h |tr "%" " " |sed -n '2,$p'| awk '{

if ( $5 > 90 ) {print $6,echo "filesystem is greater than 90% full";}

}'

Output will be something like below.
/orahome1 filesystem is greater than 90% full

Friday, 20 December 2013

Unix questions and answers.

1. creating zero lenght file.
$cat /dev/null >file.txt

2. to find teh file size greater than 1000bytes.
$find ./ -size +1000

3. switching a shell
csh -s /bin/csh

4. adding user in linux.
$useradd -d /root/user1 -g owner -s /usr/bin/csh -m user1
$passwd user1

5. delete user in linux.
$userdel -r username

6. check the network status.
$netstat -ef | grep 2000

7. to configure the network status.
$ifconfig

8. display al running jobs.
$top

9. bring job to the foreground
$fg %jobnumber

10. bring the job to background.
$bg %jobnumber.

12. convertin file from dos to unix.
$dos2unix filename

13. split command
$split -option sourcedfile destinationfile
         - b bytes
         - l number of lines

14. deleting empty lines.

$sed '/s/^$/d' inputfile >outputfilee

15. creating symbolic link.
$ln -s file link

16. locate all instnce of the file.
locate file

17. to check disk space.
$df -options
        -k  kilobytes
        -m meghabytes
        h human readable

18. to get all teh links.
$ls -lrt | grep"^l"

19. display the output to multiple files.
$data | tee file1 file2

Linux important commands.

1. Display the utilization of each CPU individually.
$mpstat -P all

2. display the top 10 process which consume CPU.
$ps -eo pcpu,pid,user,args | sort -k 1 -r | head -r

3. display hte memory details.
$cat /proc/meminfo

4. display the memory usage.
$free -m
$vmstat

5 display the number of cpu.
$cat /proc/cpuinfo | grep processor | wc -l
6. display the shared memory parameters.
$ipcs -m

7. display the share memory limits.
$ipcs -lm

8. display the disk activity.
$iostat

9. display the users logged on to the system.
$w

10. display how long the system is running.
$uptime

11. display which shell is using.
$ps -P $$
$echo $SHELL
$echo $$
12. display the awk version.
$awk --version

13. display the page size.
$getconf getsize

14. free the shared memory space.
$ipcs -m     -> it gives the shm id.
$ipcrm <shmid>
$15. memory mapping of the process.
pmap -d pid

16. list all the users.
$cat /etc/passwd

17. display the mounted file system
$cat //proc/mounts

18. to know the swap allocated.
$cat ./proc/swaps

19. display the version of teh kernel.
$cat /proc/version

20 to know whether 32 bit or 64 bit.
$arch
21. to check the available shells.
$cat /etc/shells

Java most asked interview questions

1. what is transient variable?

By default all the variables in the object get converted to a persistant state, in some case you may want to avoid passing some variables, so you can declare that variable as transient variable.
Transient variables are non-serializable.

2. what will happen if we don't initialize the local variables?
COmpilation error will come.

3. Instance variables are initialized to what values?

integer- 0
float 0.0.
boolean - false
string - null.
char -  nothing.

4. how to set locale for Canada?
Locale canada = new Locale("fr","CA");

5. if a exception thrown by a try statement but no catch what is the output?
Compilation error.

6. which variable is synchronizes?
a.static
b.public
c. private

Ans:static.

7. which is the default access specifier for class?

Package

8. JVM declare how many times of memory?

stack and the heap memory.

9. what is the deamon process and whether we can ceate the deamon process?
Deamon process is the thread which is the service provider for user threads.
which will terminate after all user threads terminated.

Yes, we can create the deamon process using
setDeamon() method.

and can check isDeamon().

we need to create the deamon thread before calling the start() method.

10. what is singleton class?
we can not initialize more than one instance.

11. why implementing the runnable interface preferable over extend the thread?
thread class
a. If we extend the thread class all the threads create their own objects and associated with them.
b. if we extend thread in future we can not extend any other thread.

runnable interface.

a. we can implemetn any number of interface.
b all threads created will share same object spce.

11. which algorithem used in java garbage collection?
mark and sweep algorithem.

12. stack is faster or heap?

stack.

13. what is run time polymorpison.?
binding happens during run time, this is because of method overriding.

14. how many public classes can be present in one java file?

one class.

16. how many main mehods can be present in single java file?

more than one.

17. difference between ennumaration and Iterator?

Ennumaration.
It is read only.
it does not have remove method.

Iterator.
It can modify the collection using remove method.
it does remove methd.

18. difference between hashmap and hashtable?
hashmap.
Allows null keys and null values.
hash map is not synchronized.

hashtable
It does not allow null keys and null values.
hash table is synchronized.

19. Advantages and disadvantages of static bllock?

 Advantages.
a. used while loading the device driver.
b. for initialize the variables which requires computation.
c. security related and leaking issues.

disadvantages.

a. static initialization block should not exceed 64k.
b. cn not through checked exceptions.
c. should not try to access super since there is no such thing for static block.
 d. can not return anything from static block.

20.why interface is better than abstract class?
 java will not support class multiple inheritance  so interface is usefull.

21. what is early binding?

the data and the method which will operate on the data are separately  defined in oops, and they bind data members during compilation time.

22. difference between multi threading and multi processing?
multi threading.
a. shares same address space.
b. thread is light weight.
c. cost of communicartion is low.
d. context switching cost is very less.


multi process.
a. each process have seperate address space.
b. heavy weight component.
c. coat of intercommunication is high.
d. context switching cost is very high.

23. why jvm is platform dependenant.
JVM is developed usig the platform dependent languages like c,c++ so it is platform depedent.

24. difference between classpath and path environmen variables?
classpath referes to the user clasess whre located.
c:/programs/
path refers to the executable where located.
c:/java/jdk/bin