Blogging for beginners




CHAPTER CONTENT
1. Introduction

The course starts off with the introduction of blogging in the late 1990s, details about the development of content and Panda updates, which significantly affected blogging, as well as the most relevant blogging statistics. All of this illustrates the importance of blogging and its influence on growing a business and reaching online users.

2. What Is Blogging?

In this chapter, you will learn how it all started, how blogging became mainstream with the introduction of WordPress, what a blog and blogosphere are. The chapter also includes a section on basic differences between blogs and websites, as well as types of blogs. The goal here is to provide a full definition of blogging which is later needed for understanding the rest of the course.

3. Blogging Platforms

The first step when creating a blog is choosing the platform. Here you can learn about commonly used platforms for creating a blog with main features highlighted for each of them. The final section of this chapter is focused on the process of choosing a platform, and things you need to consider in this process.

4. Blogging Essentials

The selection of blogging platform is only the first step, after which there is a series of essentials each blogger should take care of before it is time to publish content. The essentials help create an organized strategy to explore the full benefits of blogging.

5. Creating a Blogging Strategy

To ensure you succeed with blogging, regardless if that is your hobby or a full-time job, you will need a roadmap with clear goals, resources, and metrics used for evaluation. You need to create a blogging strategy that starts with the current situation and includes where you want your blogging activity to take you next.

6. Integrating Blogging into a Business Strategy

The statistics show that blogging can significantly boost your business, which is why you will discover ideas regarding integration of blogging into your business strategy. Starting from what business blogging is, how to create an online presence and how to blog as your business, this chapter will guide you through this process and show you how a blog can complement your website and your business promotion.

7. The Benefits of Blogging

This chapter focuses on the benefits of blogging, but it also shows why blogging is so popular as well as how to overcome obstacles most bloggers face.

8. Blogger Outreach and Guest Blogging

Some of the most used strategies for increasing blog visibility include blogger outreach and guest blogging. In this chapter, you will learn what those tactics are, what they include and how your blog can benefit from them.

9. What Is Vlogging?

The rise of video in online marketing has contributed to the increasing popularity of vlogging, a form of blogging which uses video as a content format. This section of the course will show you what a vlog is, commonly used types of vlogs, and how you can use vlogging in business.

10. Making a Living Through Blogging

Blogging reached massive popularity in the 2000s, after which numerous opportunities for earning money through a blog appeared. From affiliate marketing to banners and sponsored posts, this chapter shows the most commonly used methods to earn money from blogging. A special focus is on turning your blog into a business with ideas on how to do so.

11. Tips to Help You Run a Successful Blog

This chapter includes multiple strategies to help you increase the success of your blog, starting from responsive design, blog optimization, usage of social networks to share blog content, content optimization, etc.

12. Mistakes to Avoid When Blogging

Things that might negatively affect your blog performance are covered in this chapter. The most common mistakes such as not thinking about target group or neglecting online promotion and content distribution can reduce your blog visibility and success, so it is better to be aware of these mistakes. Each mistake comes with a practical solution on how to avoid or fix it.

13. The Most Popular Tools for Bloggers

Arranged into five groups, these tools are intended to help you optimize your workflow, improve your content and content promotion, and successfully monitor the performance of your content. You should choose the ones you find most useful in your daily work routine.

14. Blogging as a Part of Online Marketing

This chapter explores how blogging is integrated into online marketing and how together these represent a unified strategy. Content marketing, SEO, social media marketing, and lead generation are all sections which are analyzed in relation to blogging.

15. Blogging Glossary

The glossary chapter includes definitions for the terminology related to online marketing which is used in this course.

16. Questionnaire

This questionnaire is going to help you revise what you have learned throughout the course. It consists of 50 multiple-answer questions.

17. Conclusion

The summary of blogging is shown inside the conclusion, where you can see the key differences between three types of blogging depending on the type of business you run. Also, there is a list of things to learn from popular blogs, that actually summarizes the entire blogging strategy in the main takeaways.


Write a Socket program in java in which client accept a number, send it to the server, server calculates its factorial and sends result to the client.

factclient.java

        import java.io.*;
        import java.net.*;
class factclient{
    public static void main(String argv[]) throws Exception
    {
        String n;
        DatagramSocket clientSocket = new DatagramSocket();
        byte []send=new byte[102];
        byte []resive=new byte[102];
        BufferedReader inFromUser = new BufferedReader(new                InputStreamReader(System.in));
        System.out.println("\nEnter Number : ");
        n=inFromUser.readLine();
        InetAddress ipadd= InetAddress.getByName("localhost");
        send=n.getBytes();
        DatagramPacketsendPck=new DatagramPacket(send,send.length,ipadd,6870);
        clientSocket.send(sendPck);
        DatagramPacket resPck=new DatagramPacket(resive,resive.length);
        clientSocket.receive(resPck);
        String fact=new String(resPck.getData());
        System.out.println("FROM SERVER: " +n+"! = " +fact);
        clientSocket.close();
    }
}

       
 factserver.java

        import java.io.*;
        import java.net.*;
class factserver{
    public static void main(String argv[]) throws Exception
    {
        String num,res;
        int i,no;
        long fact;
        System.out.println("Server is ready");
        DatagramSocket serverSocket = new DatagramSocket(6870);
        byte []send=new byte[102];
        byte []resive=new byte[102];
        DatagramPacket resPck=new DatagramPacket(resive,resive.length);
        serverSocket.receive(resPck);
        num=new String(resPck.getData());
        num=num.trim();
        no=Integer.parseInt(num);
        fact=1;
        for(i=1;i<=no;i++)
            fact=fact*i;
        res=Long.toString(fact);
        send=res.getBytes();
        InetAddress ipadd= resPck.getAddress();
        int port=resPck.getPort();
        DatagramPacketsendPck=new DatagramPacket(send,send.length,ipadd,port);
        serverSocket.send(sendPck);
    }
}

Write a Socket program in java for chatting application. (Use AWT)

ClientChatForm.java

        import java.awt.event.ActionEvent;
        import java.awt.event.ActionListener;
        import java.awt.print.PrinterException;
        import java.io.DataInputStream;
        import java.io.DataOutputStream;
        import java.io.IOException;
        import java.net.InetAddress;
        import java.net.Socket;
        import java.net.UnknownHostException;
        import java.sql.Time;
        import javax.swing.JButton;
        import javax.swing.JFrame;
        import javax.swing.JPanel;
        import javax.swing.JTextArea;
        import javax.swing.JTextField;

public class ClientChatForm extends JFrame implements ActionListener {
    static Socket conn;
    JPanel panel;
    JTextField NewMsg;
    JTextArea ChatHistory;
    JButton Send;

    public ClientChatForm() throws UnknownHostException, IOException 
{
        panel = new JPanel();
        NewMsg = new JTextField();
        ChatHistory = new JTextArea();
        Send = new JButton("Send");
        this.setSize(500, 500);
        this.setVisible(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        panel.setLayout(null);
        this.add(panel);
        ChatHistory.setBounds(20, 20, 450, 360);
        panel.add(ChatHistory);
        NewMsg.setBounds(20, 400, 340, 30);
        panel.add(NewMsg);
        Send.setBounds(375, 400, 95, 30);
        panel.add(Send);
        56        Send.addActionListener(this);
        conn = new Socket(InetAddress.getLocalHost(), 2000);
/** for remote pc use ip address of server with function* InetAddress.getByName("Provide ip here")* ChatHistory.setText("Connected to Server");*/        ChatHistory.setText("Connected to Server");
        this.setTitle("Client");
        while (true) {
            try {
                DataInputStream dis = new DataInputStream(conn.getInputStream());
                String string = dis.readUTF();
                ChatHistory.setText(ChatHistory.getText() + '\n' + "Server:"                        + string);
            } catch (Exception e1) {
                ChatHistory.setText(ChatHistory.getText() + '\n'                        + "Message sending fail:Network Error");
                try {
                    Thread.sleep(3000);
                    System.exit(0);
                } catch (InterruptedException e) {
// TODO Auto-generated catch block                    e.printStackTrace();
                }
            }
        }
    }
    @Override    public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub        if ((e.getSource() == Send) && (NewMsg.getText() != "")) {
            ChatHistory.setText(ChatHistory.getText() + '\n' + "Me:"                    + NewMsg.getText());
            try {
                DataOutputStream dos = new DataOutputStream(
                        conn.getOutputStream());
                dos.writeUTF(NewMsg.getText());
            } catch (Exception e1) {
                ChatHistory.setText(ChatHistory.getText() + '\n'                        + "Message sending fail:Network Error");
                     try {
                    Thread.sleep(3000);
                    System.exit(0);
                } catch (InterruptedException e2) {
// TODO Auto-generated catch block                    e2.printStackTrace();
                }
            }
            NewMsg.setText("");
        }
    }
    public static void main(String[] args) throws UnknownHostException,
            IOException {
        ClientChatForm chatForm = new ClientChatForm();
    }
}


serverChatForm.java

        import java.awt.event.ActionEvent;
        import java.awt.event.ActionListener;
        import java.io.DataInputStream;
        import java.io.DataOutputStream;
        import java.io.IOException;
        import java.net.InetAddress;
        import java.net.ServerSocket;
        import java.net.Socket;
        import java.net.UnknownHostException;
        import javax.swing.JButton;
        import javax.swing.JFrame;
        import javax.swing.JPanel;
        import javax.swing.JTextArea;
        import javax.swing.JTextField;
public class serverChatform extends JFrame implements ActionListener {
    static ServerSocket server;
    static Socket conn;
    JPanel panel;
    JTextField NewMsg;
    JTextArea ChatHistory;
    JButton Send;
    DataInputStream dis;
    DataOutputStream dos;
    public serverChatform() throws UnknownHostException, IOException {
        panel = new JPanel();
        NewMsg = new JTextField();
        ChatHistory = new JTextArea();
        Send = new JButton("Send");
        this.setSize(500, 500);
        this.setVisible(true);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        panel.setLayout(null);
        this.add(panel);
        ChatHistory.setBounds(20, 20, 450, 360);
        panel.add(ChatHistory);
        NewMsg.setBounds(20, 400, 340, 30);
        panel.add(NewMsg);
        Send.setBounds(375, 400, 95, 30);
        panel.add(Send);
        this.setTitle("Server");
        Send.addActionListener(this);
        server = new ServerSocket(2000, 1, InetAddress.getLocalHost());
        ChatHistory.setText("Waiting for Client");
        conn = server.accept();
        ChatHistory.setText(ChatHistory.getText() + '\n' + "Client Found");
        while (true) {
            try {
                DataInputStream dis = new DataInputStream(conn.getInputStream());
                String string = dis.readUTF();
                ChatHistory.setText(ChatHistory.getText() + '\n' + "Client:"                        + string);
            } catch (Exception e1) {
                ChatHistory.setText(ChatHistory.getText() + '\n'                        + "Message sending fail:Network Error");
                try {
                    Thread.sleep(3000);
                    System.exit(0);
                } catch (InterruptedException e) {
// TODO Auto-generated catch block                    e.printStackTrace();
                }
            }
        }
    }
    @Override    public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub        if ((e.getSource() == Send) && (NewMsg.getText() != "")) {
            ChatHistory.setText(ChatHistory.getText() + '\n' + "ME:"                    + NewMsg.getText());
            try {
                DataOutputStream dos = new DataOutputStream(
                        conn.getOutputStream());
                dos.writeUTF(NewMsg.getText());
            } catch (Exception e1) {
                try {
                    Thread.sleep(3000);
                    System.exit(0);
                } catch (InterruptedException e2) {
// TODO Auto-generated catch block                    e2.printStackTrace();
                }
            }
            NewMsg.setText("");
        }
    }
    public static void main(String[] args) throws UnknownHostException,
            IOException {
        new serverChatform();
    }
}

Create a JSP page to accept a number from an user and display it in words: Example: 123 – One Two Three. The output should be in red color.

NumberWord.html


<html>
<body>
<form method="get" action="NumberWord.jsp">
<fieldset>
<legend>Enter Any Number </legend>
<input type=text name=num><br><br>
</fieldset>
<div align=center>
<input type="submit" value="Display">
</div>
</form>
<body>
</html>
       

 NumberWord.jsp

<html>
<body>
<font color=red>
<%! int i,n;
        String s1;
        %>
<%
        s1=request.getParameter("num");
        n=s1.length();
        i=0;
        do        {
        char ch=s1.charAt(i);
        switch(ch)
        {
        case '0': out.println("Zero ");
        break;
        case '1': out.println("One ");
        break;
        case '2': out.println("Two ");
        break;
        51        case '3': out.println("Three ");
        break;
        case '4': out.println("Four ");
        break;
        case '5': out.println("Five ");
        break;
        case '6': out.println("Six ");
        break;
        case '7': out.println("Seven ");
        break;
        case '8': out.println("Eight ");
        break;
        case '9': out.println("Nine ");
        break;
        }
        i++;
        }
        while(i<n);
        %>
</font>
</body>
</html>

Write a JSP script to check whether given mail ID is valid or not. (Mail ID should contain one @ symbol and atleast one Dot(.) symbol)

Email.html

<html>
<body>
<form name=f1 action="EmailCheck.jsp">
<fieldset>
<legend>Enter Email Id...!!!</legend>
        Enter Email Id:<input type="text" name="t1" >
</fieldset>
<div align=center>
<input type="submit" name="Submit" value="Submit">
</div>
</form>
</body>
</html>
        

Emailcheck.jsp
<html>
<body>
<%@ page language="java" %>
<%
        String email=request.getParameter("t1");
        if(email.contains("@") && email.contains("."))
        {
        out.println("Given Email Id is Valid");
        }
        else        {
        out.println("Given Email id is not Valid");
        }
        %>
</body>
</html>

Write a JSP script to accept the details of Student (RNo, SName, Gender, Computer_ Knowledge , Class) and display it on the browser. Use appropriate controls for accepting data.

student.html

<html>
<body>
<form method=get action="Student.jsp">
<fieldset>
<legend>Enter Student Details...!!!</legend>
        Enter Roll No :&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp <input type=text name=rno><br><br>
Enter Student Name:&nbsp <input type=text name=sname><br><br>
Enter Gender: &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp <input type=text name=gen><br><br>
Computer Knowledge:<input type=text name=ckn><br><br>
Enter Class: &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp<input type=text name=cl><br><br>
</fieldset>
<div align=center>
<input type=submit value="Save">
</div>
</form>
</body>
</html>


student.html
<html>
<body>
<%@ page import="java.io.*;" %>
<%! int rno;
        String name,gen,ckn,cl; %>
<%
        try        {
        rno=Integer.parseInt(request.getParameter("rno"));
        name=request.getParameter("sname");
        gen=request.getParameter("gen");
        ckn=request.getParameter("ckn");
        46        cl=request.getParameter("cl");
        out.println("Roll No: "+rno+"<br>");
        out.println("Name : "+name+"<br>");
        out.println("Gender :"+gen+"<br>");
        out.println("Comp Knowledge : "+ckn+"<br>");
        out.println("Class :"+cl+"<br>");
        }
        catch(Exception e)
        {
        out.println(e);
        }
        %>
</body>
</html>

Write a JSP script to accept username, store it into the session, compare it with password in another jsp file, if username matches with password then display appropriate message in html file.

index.html
<html>
<head>
<title>Login Page</title>
</head>
<body>
<form action="checkdetails.jsp">
<fieldset>
<legend>Enter User Id and Password...!!!</legend>
        UserId:&nbsp &nbsp &nbsp <input type="text" name="id" /> <br><br>
Password: <input type="text" name="pass" /> <br><br>
</fieldset>
<div align=center>
<input type="submit" value="Sign In!!"/>
</div>
</form>
</body>
</html>


checkdetails.jsp
<html>
<head>
<title>Check Credentials</title>
</head>
<body>
<%
        String uid=request.getParameter("id");
        String password=request.getParameter("pass");
        session.setAttribute("session-uid", uid);
        if(uid.equals("Sachin") && password.equals("Sachin"))
        {
        response.sendRedirect("success.jsp");
        }
        else        {
        43        response.sendRedirect("failed.jsp");
        }
        %>
</body>
</html>
 
success.jsp
<html>
<head><title>Success Page</title></head>
<body>
<%
        String data=(String)session.getAttribute("session-uid");
        out.println(" Login Successfully...!!!");
        %>
</body>
</html>
        

failed.jsp
<html>
<head><title>Sign-in Failed Page</title></head>
<body>
<%
        String data2=(String)session.getAttribute("session-uid");
        out.println(" User Id and Password are wrong. Please try Again.");
        %>
</body>
</html>