Menu

Difference between hear and listen

Do you know what's the difference between "hear" and "listen"? 
What's the difference between saying "I can't hear you" and "I can't listen to you"?

Hear


Hear = to receive sounds using your ears. 
This is a passive action, meaning you don't necessarily make a special effort to notice the sounds. 
Examples:
  • She can't hear very well.
  • He heard strange noise coming from the kitchen.
  • I could hear him snoring in the other room.
     

Listen


Listen = to give attention to something or someone because you want to hear them.
Examples:
  • The kids were listening to the story with great interest.
  • She is listening to music on her iPod.
  • Listen to me, you have to do exactly as I say. 
In conclusion, when you listen to something, it means you intend to receive the sounds. You are trying to hear it. 
So if you say, "I can't hear you," it means there is noise, or something else, that doesn't let the sounds reach you.
But when you say, "I can't listen to you," it means you don't want to put your attention on what the other person says. You don't want the sounds to reach you.

Reference: 
1.http://really-learn-english.us6.list-manage.com/
2. http://us6.campaign-archive2.com/?u=b578236440&id=eb739c2bb2&e=27e48a3c12

Auto email sender in ASP.NET with C#

In this blog we will learn: How to trigger email notification in ASP.NET with C# or automatically send email notification using gmail SMTP.
In this electronic era everyone wants a contact us page in their website and on that page people want a adaptive form where their users fill that form with required details and submit. Which may later use those details by admin of that website to contact that user. To create a adaptive form and on click on submit button admin will receive an email. 

first we will design our adaptive form in html, below is the sample.
<html>
<head>
    <title>Adaptive Form/Contact Us</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 247px; height: 105px">
            <tr>
                <td>
                    Name:</td>
                <td>
                    <asp:TextBox ID="txtname" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    Email:</td>
                <td>
                    <asp:TextBox ID="txtemail" runat="server" ></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    Message</td>
                <td>
                    <asp:TextBox ID="txtmes" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:Button ID="btnsend" runat="server" Text="Submit" Width="89px" OnClick="btnsend_Click" /></td>
            </tr>
        </table>
   
    </div>
    </form>
</body>
</html>

Now on the click event of submit button we will write the following C# code.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Net.Mail;
using System.Net;
using System.Text;
using System.Collections.Generic;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void btnsend_Click(object sender, EventArgs e)
    {
       
        SmtpClient smtpClient = new SmtpClient();
        MailMessage message = new MailMessage();
        try
        {
            // Gmail Address from where you send the mail
            string fromAddress = "from@gmail.com";
            // any address where the email will be sending
            string toAddress = "to@admin.com";
            //Password of your gmail address
            const string fromPassword = "Put your password here";
            // Passing the values and make a email formate to display
            string subject = "Request";
            string body = "From: " + txtname.Text + "\n";
            body += "Email: " + txtemail.Text + "\n";
            body += "Subject: " + txtmes.Text + "\n";
                        // smtp settings
            SmtpClient smtp = new System.Net.Mail.SmtpClient();
            {
                smtp.Host = "smtp.gmail.com";
                smtp.Port = 587;
                smtp.EnableSsl = true;
                smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
                smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);
                smtp.Timeout = 20000;
            }
            // Passing values to smtp object
            smtp.Send(fromAddress, toAddress, subject, body);
            Label1.Text = "Email successfully sent.";
        }
        catch (Exception ex)
        {
            Label1.Text = "Send Email Failed." + ex.Message;
        }
    }
}

Now debug the code and test the functionality 

Check at how many places a component is being used in your site in AEM?

Today I am going to tell you guys a very powerful out of box component or tool of AEM. 
Component report a useful report to know about a particular component, using this you can check in your author instance that at how many places you are using a particular component. This check is only possible in author instance not in publish.
Questions can be like this as well: How to customize component report? What is component report? What is the purpose of component report? How to use component report? Find the component being used on page? What is rule and reports? 

To check a component:

1. Goto URL http://localhost:4502/etc/reports/compreport.html from your browser. This will open a new window which have no reports and nothing as showing is the below screen.




2. Select the edit option from the top left of the page below the on/off button or component report text. When you clicked on edit button a new popup will appear which will create a new report. As shown in the below screen shot.




a. Title: Give a title to your report.
b. Description: Give detail description to your report. 
c. Root path: Select the path under which you wants to check the component being used. this will let you select a path from dropdown.
d. Report processing: In report processing we can see there are two options one is automatic refresh and another is manual. Select as per your need.
e. Snapshots: Report snapshot have three options.

  1. No Data snapshot
  2. Daily data snapshot
  3. Hourly data snapshot 
3. Click on the OK button from the bottom of the dialog to save and run the report.


4. Then you will see a lots of data will appear on the component report screen. as showing in the below image. 


5. From the list sort component type with group name. To do so put your cursor at the end or the column Component Type, then a dropdown will appear with the sorting options. Select the option "Group by this column"



This report contains the 
  1. Page: It will show the name of page of number of pages.
  2. Component Type: Path of the component or name of teh component.
  3. Component Path: Path of the component or number of places this component is being used.
  4. Author: Name of the Author who did the authoring for this component at that page.
  5. Last Modified: Date and time of last modified.
In the above report you can see a component formname (second row) is being used at two places under the given directory.