Sunday, 20 October 2013

Panoramio Javascript API Widget 2

This is Panoramio JavaScriptt API. Panoramio JavaScriptt API let you customize it.













This is complete Code for Panoramio JavaScriptt API widget.It does not show in composing mood.It show after publishing it.
<div dir="ltr" style="text-align: center;" trbidi="on">

<script src="https://ssl.panoramio.com/wapi/wapi.js?v=1&amp;hl=en"></script>



<div id="wapiblock" style="float: right; margin: 10px 15px"></div>


<script type="text/javascript">

var myRequest = {
  'tag': 'sunset',
  'rect': {'sw': {'lat': -30, 'lng': 10.5}, 'ne': {'lat': 50.5, 'lng': 30}}
};

  var myOptions = {
  'width': 300,
  'height': 200
};
var wapiblock = document.getElementById('wapiblock');

  var photo_widget = new panoramio.PhotoWidget('wapiblock', myRequest, myOptions);

  photo_widget.setPosition(0);

</script>

</div>

Panoramio Javascript API Widget example 1

this is Panoramio JavaScript API Widget example.



Panoramio JavaScript API Widget does not show by composing, it show when it will be published.It is full code just copy paste it.
<div dir="ltr" style="text-align: left;" trbidi="on">
this is&nbsp;Panoramio Javascript API Widget example.<br />
<div style="text-align: left;">
<script src="https://ssl.panoramio.com/wapi/wapi.js?v=1&amp;hl=en"></script>
   
<style type="text/css">


  
  #div_attr_ex .panoramio-wapi-images {
    background-color: transparent;
  }
  #div_attr_ex .pwanoramio-wapi-tos{
    background-color: transparent !important;
  }
</style>
</div>
<div id="div_attr_ex">
<div id="div_attr_ex_photo">
</div>
<div id="div_attr_ex_attr">
</div>
</div>
<script type="text/javascript">
function increase ()
{
var temp = parseInt (document . apple . banana . value);

 
 if (isNaN (temp))
  return; 

if (temp>=0 )
{
attr_ex_photo_widget.setPosition(temp);

}
else
{
attr_ex_photo_widget.setPosition(0);
document . apple . banana . value = 0;

}

}
var position;
var end;

function myfunction(no)
{

position =attr_ex_photo_widget.getPosition();

no=position+no;


end=attr_ex_photo_widget.getAtEnd();
 if (no>=0 && !end)
{
attr_ex_photo_widget.setPosition(no);
document . apple . banana . value = no;

}
 else  
{
no=0;
attr_ex_photo_widget.setPosition(no);
document . apple . banana . value = no;


}



}
var no=0;
  var label = {'tag': 'kahna'};
  var tagRequest = new panoramio.PhotoRequest(label);
  var attr_ex_photo_options = {
    'width': 600,
    'height': 500,
    'attributionStyle': panoramio.tos.Style.HIDDEN};
  var attr_ex_photo_widget = new panoramio.PhotoWidget(
      'div_attr_ex_photo', tagRequest, attr_ex_photo_options);


  var attr_ex_attr_options = {'width':600};
  var attr_ex_attr_widget = new panoramio.TermsOfServiceWidget(
    'div_attr_ex_attr', attr_ex_attr_options);


   
    
  attr_ex_photo_widget.enablePreviousArrow(true);
  attr_ex_photo_widget.enableNextArrow(true);

  attr_ex_photo_widget.setPosition(2);

  
</script>

<button onclick="myfunction(1)">next</button><button onclick="myfunction(-1)">previous</button>
<br />
<form name="apple">
<input min="0" name="banana" size="5" type="number" />
   <input onclick="increase ();" type="button" value="View" />
  </form>
</div>

Tuesday, 8 October 2013

insert at start and end in Link list by head and tale method with clases in c++

In this program user can insert data at start and end in link list by using head and tale method.user can also display and search data in link list.It is complete program with Menu.

 

#include<iostream>
using namespace std;

class Node{
public:
      int data;
      Node *nextptr;
};
      
class Linklist {
      Node *head;
      Node *tale;
              
      public:
              Linklist();
              Node* insertAtStart(int element);
              Node* insertAtEnd(int element);
             ~Linklist();
              void print();
              bool search(int element);
              Node* First_Record(int element);
               friend class Node;
};

Linklist::Linklist()
{
   head=NULL;
}



Node* Linklist::First_Record(int element)
{
    
    Node *ptr;
    ptr=new Node;
    ptr->data=element;
    ptr->nextptr=NULL;
    head=tale=ptr;
    return ptr;
}

Node* Linklist::insertAtStart(int element)
{
    if(head==NULL)
    {
        
        return First_Record(element);
    }
    Node *ptr;
    ptr=new Node;
    ptr->data=element;
    ptr->nextptr=head;
    head=ptr;
    return ptr;
    
}

Node* Linklist::insertAtEnd(int element)     
{
  Node *ptr;
    if(head==NULL)
        return First_Record(element);
    ptr=new Node;
    ptr->data=element;
    ptr->nextptr=NULL;
    tale->nextptr = ptr;
    tale= ptr;
    return ptr;
}

void Linklist::print()
{
     Node *temp=head;
  if(head!=NULL)
  {
    while(temp!=NULL)
    {
      cout<<temp->data<<" "<<endl;
        temp=temp->nextptr;                 
    }              
  } 
  else
  cout<<"Ther is no data in list\n"<<endl;    
}
 Linklist::~Linklist()
{
     Node *temp;
     
  if(head!=NULL)
  {
      
    while(head!=NULL)
    {
      temp=head;
        head=head->nextptr; 

        delete temp;
    }              
  }    
}
bool Linklist::search(int element)
{
     Node *temp;
   
     if(head!=NULL)
     {
         temp=head;
                   while( temp!=NULL)
                       {
                            if(temp->data==element)
                      return true;
                          temp=temp->nextptr;
                   
                   
                   }
                   return false;
                   }
                   else 
                   return false;
}

int main()
{
    int choice=0;
    int data;
    Linklist object;
 cout<<"enter your choice"<<endl; 
 while(1)
 {
cout<<"\nMenu:\n1: insert at start"<<endl; 
cout<<"2: insert at end"<<endl;
cout<<"3: print elements"<<endl;
cout<<"4: search a elelment"<<endl;
cout<<"5: delete linlist"<<endl;
cout<<"6: exit"<<endl;
cout<<"enter your choice"<<endl; 
cin>>choice;
switch(choice)
{
case 1:
    cout<<"enter number"<<endl;
    cin>>data;
    object.insertAtStart(data);
    break;
    case 2:
        cout<<"enter number"<<endl;
        cin>>data;
        object.insertAtEnd(data);

        break;
        
            case 3:
cout<<"element are"<<endl;

        object.print();
        break;
        case 4:
        cout<<"enter number"<<endl;
        cin>>data;
        if(object.search(data))
        {
            cout<<"number found in the list";
        }
        else
            cout<<"number not found in the list";

        break;
        case 5:
        
            object.~Linklist();
            break;
            
                case 6:
                exit(1);
                    break;
                default:
                    cout<<"invalid choice"<<endl;
                    break;
}

 }
system("pause");
}
                   

Thursday, 3 October 2013

print Array in C++

#include<iostream>
using namespace std;

void main()
{
 int aray[5]={1,2,3,4,5};

 cout<<"Array elements are \n"
<<aray[0]<<"\n"
<<aray[1]<<"\n"
<<aray[2]<<"\n"
<<aray[3]<<"\n"
<<aray[4]<<endl;

 system("pause");

}

Print Array in C Language

#include<stdio.h>
#include<stdlib.h>

void main()
{
 int aray[5]={1,2,3,4,5};

 printf("array element are =
 %d,%d,%d,%d,%d\n"
  ,aray[0],aray[1],aray[2], 
aray[3],aray[4]) ;

 system("pause");
  
}