Wednesday, October 18, 2017

Ionic 3 Build Android App - Create apk file which can be installed in an android device

No comments:
Steps to create an apk file using ionic 3

Step1: Add Platform

$ ionic cordova add platform android

Step 2: Go to platforms/android

$ cd platforms/android

Note: Add the location of the bin folder of the JDK installation in the PATH Environment Variable

Step 3: Generate Keystore file 

$ keytool -genkey -v -keystore some_name.keystore -alias some_name-keyalg RSA -keysize 2048 -validity 10000

You should enter a password during the generation of some_name.keystore. Remember this passoword and keep some_name.keystore in a safe place.

Step 4: Open build.gradle file in platforms/android and search for the section signingConfigs. Make changes as shown below.

signingConfigs {
    release {
        // These must be set or Gradle will complain (even if they are overridden).
        keyAlias = "some_name"
        keyPassword = "your_password" // And these must be set to non-empty in order to have the signing step added to the task graph.
        storeFile = "some_name.keystore"
        storePassword = "your_password"

Step 5: Go to your root folder of the project

$ cd ../../

Step 6: Build

$ ionic cordova build android --release

If successful you will get the following message

Total time: 45.593 secs
Built the following apk(s):

Step 7: Sign the apk

$ jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore platforms\android\some_name.keystore platforms\android\build\outputs\apk\android-release-unsigned.apk some_name

Note: Add the location of the Android sdk build tools folder in the PATH Environment Variable.

Step 8: Zipalign

$ zipalign -v 4 platforms\android\build\outputs\apk\android-release-unsigned.apk Some_Name.apk

You will find the generated apk file in the root folder of your project. Generated apk file is now ready to be installed in your android phone.

Sunday, September 10, 2017

Kerala PSC HSST Computer Science Previous Questions - Set 3

No comments:
Answers given at the end.
Q1. For some page–replacement algorithms, the page-fault rate may increase as the number of allocated frames increases. This is known as:
(A) Thrashing
(B) Swapping
(C) Belady’s anomaly
(D) Fragmentation

Q2. The Unix inode contains ___________ pointers to data blocks and _________ pointers to indirect blocks.
(A) 10,3
(B) 10,5
(C) 12,3
(D) 15,5

Q3. Which of the following disk scheduling algorithms may result in starvation?
(B) Shortest-seek-time-first

Q4. An RPC uses ______________ to execute a routine on a remote system.

Q5.  'Location transparency' in distributed systems means that:
(A) Name of the file does not reveal any hint of its physical storage location
(B) Name of the file does not need to be changed when the storage location changes
(C) The storage location can be understood from the name of the file
(D) Name of the file will change if the storage location changes

Q6. The BSD version of UNIX was developed by:
(A) Bell Labs
(C) University of Berkeley
(D) Sun Microsystems

Q7.  An example of a file system whose contents are not actually stored anywhere, but are computed on demand is:
(C) proc
(D) ext3

Q8. Which among the following is a type of top-down parsing?
(A) Predictive parsing                                   
(B) Shift-reduce parsing
(C) Operator precedence parsing
(D) LR parsing

Q9.  If r and s are regular expressions denoting languages L(r) and L(s), then (r)|(s) is a regular expression denoting:
(A) L(r) U L(s)
(B) L(r) L(s)
(C) {E}
(D)  L(rs)

Q10. What will the following program fragment output?
Integer i=new integer (5);
Integer j=new Integer (5);
If (i==j)System.out.println(“Equal”);
else System.out.println(“Not equal”);
(A) Equal                     
(B) Not Equal
(C) Equal Not equal
(D) The program doesn’t compile= = can’t be used with references

Tuesday, September 5, 2017

Kerala PSC HSST Computer Science Previous Questions - Set 2

No comments:
Answers given at the end.

Q1. The solution to the count-to-infinity problem in which a router never advertises the cost of a destination to its neighbour N, if N is the next hop to that destination, is called:
(A) Triggered update
(B) Source tracing
(C) Split-horizon
(D) Path vector

Q2. A compiler which runs on one machine and produces target code for another is called a:
(A) Bootstrapping compiler
(B) Just-in-time compiler
(C) Cross compiler
(D) Optimizing compiler

Q3.Which among the following is an interior routing protocol?

Q4. The maximum length (in bytes) of an IP packet:
(A) 255
(B) 1023
(C) 32767
(D) 65535

Q5. Which among the following is not a type of HTTP request?

Q6. Which among the following is not a real time operating system?
(A) RT-Linux
(B) VxWorks
(C) Solaris
(D) Lynx

Q7. What is returned by a fork() call to the child process?
(A) 0
(B) Process-id-pf parent
(C) Process-id of child
(D) -1

Q8. The degree of multiprogramming is controlled primarily by?
(A) Short-term scheduler
(B) Medium-term scheduler
(C) Long-term scheduler
(D) Disk scheduler

Q9. Which of the following is a high-level synchronization concept?
(A) Interrupt
(B) Semaphore
(C) Mutex
(D) Monitor

Q10. Paging solves the problem of:
(A) Thrashing
(B) Page faults
(C) Internal fragmentation
(D) External Fragmentation

Kerala PSC HSST Computer Science Previous Questions - Set 1

1 comment:
Answers given at the end.

Q1. The size of an ATM cell is .............. bytes.
(A) 25
(B) 32
(C) 53
(D) 64

Q2. Stored program concept is attributed to:
(A) Ken Thompson
(B) Dennis Ritchie
(C) Von Neumann
(D) Edsger Dijkstra

Q3. In a UNIX system, the macro htons is used to:
(A) Convert a short number from host to network order
(B) Convert a long number from host to network order
(C) Convert a short number from network to host order
(D) Convert a long number from network to host order

Q4. The cache which is on the same chip as the processor is called :
(A) L1
(B) L2
(C) L3
(D) None of these

Q5. Which IEEE standard is refers to fast Ethernet?
(A) 802.1
(B) 802.3b                  
(C) 802.3u
(D) 802.12

Q6. Which level of RAID uses mirroring to achieve redundancy?
(A) 0
(B) 1
(C) 2
(D) 3

Q7. The new generation Intel processor with the IA-64 architecture is called
(A) Itanium
(B) Pentium 4
(C) Athlon
(D) Xeon

Q8. A MAC address is ............. bytes long:
(A) 4
(B) 6
(C) 8
(D) 12

Q9. RARP is used to convert:
(A) IP address to MAC address
(B) MAC address to IP address
(C) IP address to port number
(D) Port number to IP address

Q10. Which among the following is an NP-Complete problem?
(A) 3SAT Problem
(B) Travelling Salesman
(D) Graph 3-coloring
(D) All of the above

Monday, August 21, 2017

Installing Laravel in Ubuntu 16.04

No comments:
First install composer. Refer

Download Laravel:
$ composer global require "laravel/installer"

Edit environment config:
$ nano .bashrc
Note: If the above fails due to permissions, you may need to run it again with sudo.

Add the below line to the end of the file:
export PATH="$PATH:$HOME/.config/composer/vendor/bin"

Then reload the config:
$ source ~/.bashrc

To verify:
$ laravel

You will get a similar output as shown below:
Laravel Installer 1.3.3

  command [options] [arguments]

  -h, --help            Display this help message

  -q, --quiet           Do not output any message

Installing Composer globally in Ubuntu 16.04

No comments:
Run this in your terminal to get the latest Composer version:

$ php -r "copy('', 'composer-setup.php');"

$ php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"

$ php composer-setup.php

$ php -r "unlink('composer-setup.php');"

After running the installer run this:

$ mv composer.phar /usr/local/bin/composer 

Note: If the above fails due to permissions, you may need to run it again with sudo.

To verify installation type:

$ composer

You will get a similar output shown below:
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
Composer version 1.5.1 2017-08-09 16:07:22

  command [options] [arguments]

  -h, --help                     Display this help message
  -q, --quiet                    Do not output any message
  -V, --version                  Display this application version
      --ansi                     Force ANSI output

Tuesday, August 15, 2017

Install Oracle Java 8 or Oracle Java 9 in Ubuntu 16.04

1 comment:
Step 1: Open terminal (Ctrl+Alt+T) and run the command
$ sudo add-apt-repository ppa:webupd8team/java

Step 2: Update system package index
$ sudo apt update

Step 3: Install Java. Note: Replace oracle-java8-installer with oracle-java9-installer to install Java 9.
$ sudo apt install oracle-java8-installer

Step 4: Check whether installation is successful
$ javac -version

If successful the above command will give a similar output as below:
javac 1.8.0_144