Mobile Number Pattern matches In Java



A regular expression, specified as a string, must first be compiled into an instance of this class. The resulting pattern can then be used to create a Matcher object that can match arbitrary character sequences against the regular expression. All of the state involved in performing a match resides in the matcher, so many matchers can share the same pattern.
A typical invocation sequence is thus

 Pattern p = Pattern.compile("a*b");
 Matcher m = p.matcher("aaaaab");
 boolean b = m.matches();



 Example

import java.util.regex.*;  
class Demo
{
 public static void main(String[] args)
 {
  String  p1="[7-9]{1}[0-9]{9}";
  Pattern p = Pattern.compile(p1);
  Matcher m = p.matcher("9909556848");
  
  if( m.matches())
  {
   System.out.println("Match");
  }
  else
  {
   System.out.println("Not Match");
  }
 }
}


Out Put


Write a script that deletes all leading and trailing spaces in all lines in a file. Also remove blank lines from a file. Locate lines containing only printf but not fprintf.



#Write a script that deletes all leading and trailing spaces in all lines in a file. Also remove blank lines
#from a file. Locate lines containing only printf but not fprintf.
# Save  New.sh


clear

echo -n "Enter name of the file :"
read filename

    if [ ! -f $filename ]
    then
        echo "File does not exist"
    else
        str=$(cat $filename)
        #remove leading and trailing spaces
        str=$(echo "$str" | sed 's/^[ \t]*//;s/[ \t]*$//')
        #remove blank line
        str=$(echo "$str" | sed '/^$/d')
        echo "$str" > $filename
        cat "$filename"
        echo "File transformed successfully"
        echo "PRINTF STATEMENT IS AT LINE "
        echo $(cat $filename | grep -v "fprintf" | grep -iwn "printf")
    fi




new.txt


Hello   MAC    Welcome


Good Morning


OutPut


Write a script that behaves both in interactive and non-interactive mode. When no arguments are supplied, it picks up each C program from current directory and lists the first 10 lines. It then prompts for deletion of the file. If the user supplies arguments with the script, then it works on those files only.

Write a script that behaves both in interactive and non-interactive mode. When no arguments are supplied, it picks up each C program from current directory and lists the first 10 lines. It then prompts for deletion of the file. If the user supplies arguments with the script, then it works on those files only.



# Test.sh
#Run In terminal In linux
# bash Test.sh
# Example

cfile=`find -name "*.c"`
for i in $cfile
do
    echo "File : $i"
    echo "First 10 Row of File Read"
    head -10 $i
    echo "Do You Want to Remove"
    read ch
    if [ $ch="Y" -0 $ch="y" ]
    then#
        rm -i $i
    else
        echo "User not want to Deleted the file"
    fi
done




// Demo.c File Creating
#include <stdio.h>
int main()
{
  
   printf("Hello, India!");
   printf("Good Morning");
   printf("Hi.. I'm Hietsh");
   printf("What is Your Name?");
   printf("My Name Is Hit");
   printf("How Are You Hit");
   printf("I'm Fine and You");
   printf("me Good");
   printf("Where Are You");
   printf("Nice To meet Hit");
   printf("ok bye");
   return 0;


Run Test.sh File


 Deleted Demo.c File

 

 

Create a Smiley Face using PHP GD Library PHP



Create a Smiley Face using PHP GD Library




Create a Smiley Face using PHP GD Library PHP
Example..



<?php

header ('Content-type:image/png');

$c=imagecreate(500,500);

$bc=imagecolorallocate($c,204, 0, 153);
$fc=imagecolorallocate($c,255, 255, 26);
$lc=imagecolorallocate($c,200,20,30);

imagefilledellipse($c,250,250,400,400,$fc);
imagefilledellipse($c,150,150,50,50,$lc);
imagefilledellipse($c,350,150,50,50,$lc);

imageline($c,250,275,280,275,$lc);
imageline($c,250,200,280,275,$lc);

imagearc($c,250,300,250,180,0,180,$lc);

imagepng($c);

imagedestroy($c);
?>

Out Put





Identifying Current Server Statistics Software and Gaining Access For SEO


Identifying Current Server Statistics Software and Gaining Access PART-2




Search Analytics


Determining Top Competitors
  • Understanding the competition should be a key component of planning your SEO.
  • The first step is to understand who your competitors in the search results really are.

Seeking the Best
  • Are your competitor’s websites fully indexed by Google and Yahoo!? In other words, are all their web pages, including product pages, making it into the search engines’ databases? You can use the free tool at http://www.netconcepts.com/urlcheck to find out, or you can go to each search engine and type in site:theirdomain.com.

Uncovering Their Secrets
  • What keywords are they targeting?
  • Who’s linking to their home page, or to their top-selling product pages and category pages? A link popularity checker can be quite helpful in analyzing this.
  •  E.g. Amazon.com


Identifying Current Server Statistics Software and Gaining Access

Identifying Current Server Statistics Software and Gaining Access PART-1




Web Analytics
  • Analytics software can provide you with a rich array of valuable data about what is taking place on the site. It can answer questions such as:
  • How many unique visitors did you receive yesterday?
  • Is traffic trending up or down?
  • What are the most popular search terms with which people find you?


Web Analytics
  • What are the most popular pages on your site?
  • What are the best converting pages on the site?

High-quality, free analytics tools are available, such as Yahoo! Web Analytics and Google Analytics.



Logfile Tracking

  • Logfiles contain a detailed click-by-click history of all requests to your web server. Make sure you have access to the logfiles and some method for analyzing them. If you use a third-party hosting company for your site, chances are it provides some sort of free logfile analyzer, such as AWStats, Webalizer, or something similar. Obtain access to whatever tool is in use as soon as you can.

Google and Bing Webmaster Tools

  • Both tools provide valuable insight into how the search engines see your site. This includes things such as external link data, internal link data, crawl errors, high-volume search terms, and much, much more.




Auditing an Existing Site to Identify SEO Problems PART 4

Auditing an Existing Site to 
Identify SEO Problems PART 4




Elements of Audit:
  • Imagine that each of the tiny pages represents between 5,000 and 100,000 pages in an enterprise site. Some areas, such as blogs, articles, tools, popular news stories, and so on, might be receiving more than their fair share of internal link attention. Other areas often business-centric and sales-centric content—tend to fall by the wayside.




  • Server and Hosting Issues
  • Various server related and hosting related issues which affects the impact of SEO.
  1. Server timeouts
  2. Slow response times
  3. Shared IP addresses (Example of google with http://www.site24x7.com)
  4. Blocked IP addresses

  • Elements of Audit:
  • Server and Hosting Issues
  1. Bot detection and handling
  2. Bandwidth and transfer limitations
  3. Server geography