-->

Enable auto save feature in Sublime editor

Problem:- How to add auto-save functionality in Sublime-Text?

Solution:-

Using auto-save package.

How to install this?
1)Open package Control in sublime (Ctrl+Shift+p)

open install package control sublime
2)Search and select install option 

3)Search auto-save and select it 

4)Enable auto-save

Press Command + Shift + P again and search for AutoSave. Here, there are 3 options:(select the one that you want to enable)
  • Toggle AutoSave: all files
  • Toggle AutoSave: current file only
  • Toggle AutoSave Backup: current file only
    enable auto save in sublime editor

Install and Configure MySql on Linux?

Frank Herbert
Installation for mysql is similar to installing apache server and php on Ubuntu. 
Step1:- Open terminal window and type the below command(install mysql-server)

sudo apt-get install mysql-server


Note:-

Adding root password in installing mysql
  • Add root password in the dialog box after installation. 
  • Incase any pop up comes during installation just accept the default and continue the installation process.
Step2:- Install workbench(IDE) to work with MySql
sudo apt-get install mysql-workbench

Step3:- Start mysql workbench
a)Type the below command in terminal
mysql-workbench 
b)Open the default localhost instance and add "root" password.

Launch localhost in mysql

Note:- You can add workbench to launcher and open it from terminal as well from launcher.

Step4:- Create schema(database) in workbench.
a)Databases > New
b)Add schema name, select collation value say "utf8" > Apply > Close
Add new schema in workbench


c)Now we can create our tables inside the database.

So now we have Apache, MySQL, and PHP running on Linux, the complete LAMP stack. 

 

Install and configure PHP on ubuntu?

“Without new experiences, something inside of us sleeps. The sleeper must awaken.” Frank HerbertFrank Herbert t

Step1:- Open terminal window and type the below command(install php)

sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql


We have used extra parameters for configuring php to use apache server that we already installed and also to connect with mysql. So we dont do any configurations manually 

Step2:- Verify the installation of PHP
We need to create sample php script inside the root of apache server and open it in the apache server
a) cd to apache root path, cd /var/www/html/
b) Create test.php file, sudo nano test.php
c)Add the basic phpinfo function call into file, save and exit (ctrl+x > y > enter) the nano editor
create php script inside apache root folder

d) Start apache server (sudo apachectl start) and check the test.php file(open localhost/test.php) 
launch php file in server


Step3:- Configure php settings 
a)Lets say we want to enable php logs, we need to open php.ini file 
sudo nano /etc/php/7.0/php.ini
b)Search display_errors in php.ini file and turn it to on
ctrl+w(for searching in nano)

change php.ini file
c)Restart the apache server
sudo apachectl restart
d)Check that settings are changed by checking the browser


php.ini file configured in server






Install and configure Apache server on Ubuntu?

Quick recipe to install and configure apache server?
Step1:- Update the package manager and install apache2
Execute the below commands in terminal:- 

  • sudo apt-get update
  • sudo apt-get install apache2

sudo - super user
apt-get, for latest package


Step2:- Edit the apache configuration file

  • sudo nano /etc/apache2.conf

edit apache config file

Scroll to the end and add,  ServerName localhost
ctrl +x (for exiting the editor) , press y and enter

Step3:-Check that server is running or not
  • sudo apachectl stop

Step4:- Start the apache server

  • sudo apachectl start


Step5:- Open browser with localhost, and see our server is running and launch a index.html file(note, we have changed our port to 403)


index page on launching apache server

Note:- This index.html file which apache server showed above can be located in /etc/apache2/var/www/html


Errors:- Incase default port 80 is already used you will get the below error on starting apache server?
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

Solution:- Change the port value inside /etc/apache2/apache2.conf say to different port 403, now restart the apache server and open localhost:403, it will launch the server


Keep Learning and Keep Sharing :)

Install MySql
Install PHP 

Tips and Tricks for working with Robot Framework - Part-1

If you are still looking for that one person who will change your life, take a look in the mirror.

Problem1:- How i can generate random test data in Robot framework?

Solution:- Use FakerLibrary

Install :- 
pip install robotframework-faker

Note:- Include FakerLibrary in settings as "Library FakerLibary"

Example:- To generate random number we can use code as below:-

generate random value in robotframework



Problem2:- How to generate random value within given range?

Solution:- Using Random keyword

Example:-
${randomValue} Evaluate random.randint(0, 5000) modules=random


Generate random value in robot framework

Problem3:- How to take screenshot on failures in Robot Framework?

Solution:- Using Screenshot library
1. Include the library in settings like Library Screenshot path_of_Directory 
2. Capture the screenshot on failure


Screenshot in robot framework

Problem4:- How to refresh browser in Robot Framework?
Solution:- 
1. Use "Reload" keyword
2. Use "Execute JavaScript" 
Refresh in browser using robot framework








More ways to Refresh?

Learn Robot Framework
Learn Java

How to use/configure Google Maps API in your application?

Requirement:- We need to implement google maps in our application, how we can configure that.
Note:- We can use the below approach to generate API key(lat and lng values) and need to install dedependency for adding google api in Vue.js project.




Solution:-
Step1:-Generate maps Key to use Google API
 a) Click the "GET A KEY" button
 b) Create the project/or use existing project
create map api project
 c) Enable API and we are done with key creation

create new project in google map api



Step2: Using Google guide and copy the html code into index.html file

 a)Replace the API key generated in above steps as below
 b)Run the index.html file and we are done.
change map key in api
Note:- In run results of Step2, we got some random place in Australia but we don't want this.

Step3:- Generate co-ordinates for your map location that you want to show on maps
 a) Using Geocoder to generate our co-ordinates(lat, long)
 b)Enter address that you want your map should point to > click geocode it
generate lat and lng values

 c)Copy the latitude and longitude values 
 d)Change these values in your index.html > save > run
change lat and lng in map api of google

Step4:-Change the map type
 a)Change the MapTypeid
 mapTypeId :google.maps.MapTypeId.HYBRID
NOTE:- By default its RoadMap

Step5:- Change the zoom level of the map
a) we will use map.getZOom() method to define the zoom level.
Zoom the map and go to browser console and check the value of map.getZoom() 
Use the same value in index.html file
b)we'll change map.getCenter() method to align the map in center.


How to disable draggle and scroll properties for map?
 Use draggable:false and scrollwheel:false

How to create pop up for the marker on map?


How to add animation effect to marker?


Importance syntax rules when working with JAVA

Lets learn some of the basic and critical rules that we should know as JAVA developers.

Being aware of a single shortcoming within yourself is far more useful than being aware of a thousand in someone else.

1. Name of Class should start with uppercase letter.
Example:- 
MyFirstClass rather than myfirstclass

2.Methods and variables of class should start with lower case (camel case)
Example:-
myMethod is valid rather than MyMethod

3.Name of Class, variables and methods (all known as identifier) should always begin with alphabet or underscore.
Example:-
_myMethod is valid rather than 12myMethod

Note:- Java code will still work if we dont follow the above rules but its not recommended.

4.In built keywords of Java cannot be used as name of identifiers.
Example:-
while is invalid variable name as its defined keyword in java

5.All constant values should be defined in Uppercase letter.
Example:-
public static final String UFTHELP = "Learn Technology";

6.Each line of code should end with semicolon (;)
Example:-
MyClass obj = new MyClass();

7.Most important, JAVA is case sensitive.
Example all the below variables are different for java:-
firstName, FIRSTNAME, FirstName

Learn Java