Wednesday 10 October 2018

Script To Prevent Data from coping. Just paste it on JavaScript plugin of layout

<script type='text/javascript'>
var isCtrl = false;
document.onkeyup=function(e)
{
if(e.which == 17)
isCtrl=false;
}
document.onkeydown=function(e)
{
if(e.which == 17)
isCtrl=true;
if((e.which == 85) || (e.which == 67) &amp;&amp; isCtrl == true)
{
// alert(&#8216;Keyboard shortcuts are cool!&#8217;);
return false;
}
}
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler(){
return false;
}
function mousehandler(e){
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)||(eventbutton==3)) return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
</script>




<script language=javascript>
<!--

//edit by unwanted


var message="HAVE SOME HUMANITY BUDDY";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("alert(message);return false")

// -->
</script>

<!doctype html>


    html2canvas example
 <script type="text/javascript" src="img/html2canvas.js"></script>
<script language=javascript>
function ieClicked() {
    if (document.all) {
        return false;
    }
}
function firefoxClicked(e) {
    if(document.layers||(document.getElementById&&!document.all)) {
        if (e.which==2||e.which==3) {
            return false;
        }
    }
}
if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=firefoxClicked;
}else{
    document.onmouseup=firefoxClicked;
    document.oncontextmenu=ieClicked;
}
document.oncontextmenu=new Function("return false")
function disableselect(e){
    return false
    }
    function reEnable(){
    return true
    }
    document.onselectstart=new Function ("return false")
    if (window.sidebar){
    document.onmousedown=disableselect
    document.onclick=reEnable
    }
</script>
    <style>
    canvas{border:1px solid #222}
    </style>   


   <a class="upload"  >Upload to Imgur</a> 
   <a href="#" download="canvasexport.pdf" onclick="window.print()" ><img src="images/print-icon.png" alt="Print" width="16" height="16" /></a>

   <a href="#" id="download" download="diversio.pdf" onclick="printImg();">
   <img src="images/print-icon.png" alt="Print" width="16" height="16" />
   </a>

    <h2>this is <b>bold</b> <span style="color:red">red</span></h2> 
    <p>  .
    </p>




</!doctype>

Monday 13 February 2017

Look at how My friend explained me DBMS


The theory discussed in this Post is the theory what told to me by my CS friend in short.So ,it is not verified ....it is suggested that kindly take it as an overview and rest study from some standard books related to DBMS




--DBMS is the work of back end work (of a website or some software) where as frontend is about GUI and linking links.
--Core skill which will be used in industry are mainly SQL commands 
--map out the meaning of Entity ,Attribute and value of a Table before learning SQL
--When comparing data of one table with another than we do normalisation
--Normalisation are of 3 Types
          --1NF (when comparing two tables )
          --2NF  (when comparing three tables let say A,B,C and A is related to B is related to C but A is                        not related to C)
          --3NF(when comparing three tables let say A,B,C and A is related to B is related to C and this                         time also A is  related to C)
--Primary Key
     the key of your first table/reference table or which you considered first which may be common in        another  upcoming tables too like your  name then name would be primary key and the same key       would be foreign key in another table.

This Post will be updated once i study from some standard books.

Saturday 14 May 2016

How Big is Java ?

Frankly Saying Nothing is Big it is just a opportunity given to programmers enabling many features.

The Main IDE software that you need to install is Netbeans

The Java Compromises of Various things .These things are as follow :-


1) JDBC

--for database management etc. For this there is whole complete subject in computer Science also.

--Anyway to implement its inbuilt function you use library

import.java.sql.*

--In this case beside netbeans you also need to download sql software which is a software that runs in cmd of window.

--Also you can say it is use to connect front end with backend

2)RMI-Remote Method Invocation
--This is use for eg you have two servers in e-commerce.if you want if in one server there is deduction of Rs 10/- then the same thing should be reflected back on another server.This synchronization is achieve by RMI

--This has a server like glassfish, appache tomcat

--you can design a calculator using a RMI

--here you use library
import.java.rmi.*

3)Servelets

--In this you do XML coding .
--This is use for
         --Cookies
         --Session tracking
         --URL rewriting

4)EJB-Enterpreneur Java Beans

5)JSP-Java Server Pages

6)MVC/validator framework

7)Android

8)Struts


Some More Things that are there in java

--In class also there is a concept of class and inheritance
  here you can saee class is HelloForm and HttpServlet is the inbuilt class from which function needs to be inheritate.Note while inheritance in java you have to use keyword extends

Anyway want to learn Java [Click Here]

Wednesday 6 April 2016

Art of Understanding an Algorithm

For Understanding the Algorithm. You first need to fascinate by its practical working.
After that Break that whole practical action into smallest step possible and Analyse each step that cause that whole magic
Try to come out from comfort zone and try till you not reach for success

Some Basic Algorithms from which you can start brushing up you skills
1) Bubble Sort
......other sorting techniques
stack
queue
circular queue
Make practical programs for all



Watch the Below Video in Silent Mode.It will give you the guidance How practically you should understand the algorithum


Sunday 3 April 2016

Inheritance


Pointer :C/C++ brush up

int a;
&a                                  address of a
int *p                              capable of storing address of a non pointer
int **p                            capable of storing address of a pointer .this is also known as double pointer

Let us consider and code to understand above concept better


  1. int *p;
  2. int **c;
  3. int a[ ]={1,2,3,4};
  4. *p=a;                      //*p gives value of a[0] i.e 1                                  
  5. **c=&p;                 //c gives value(pointer stores address in its value) of p pointer 2293552
  6.                                //**c gives address of p pointer
  7.                                //*c --check yourself ! I don't Know
  8. printf("%u",p);       //p gives address of a[0] 2293548  
  9. *(a+i) is same as a[i]              
  10. (a+i) is same as a or &a
Notations for 2-D array


  1. //  in 1-d array you write int*p=a; but if a is 2-d array then this statement will give error
  2. int b[2][3]={ {1,2,3} , {3,4,2} };  //here b[0] occupy 8 bytes as 2 x {[0],[1],[2],[4]}=2 x 4=8 

  3. int(*p)[3]=b;       <--correct statement
  4. printf("%d",*b); / printf("%d",b[0]); / printf("%d",&b[0][0]); / printf("%d",b);printf("%d",&b[0]); <--means an address of first element.first row b[0][0]
  5. .
  6. printf("%d",*(*b+1)); <--means value at b[0][1] which is 2
  7. .
  8. Concluded: b[i][j]=*(b[i]+j) / *(*(b+i)+j) 
  9. .
  10. .

  11. printf("%d",b+1);/printf("%d",*(b+1));/printf("%d",b[1]);/printf("%d",&b[1][0]);<--means 
  12.                                                 //address of first element second row b[1][0]

  13. printf("%d",*(b+1)+2);.  //means address of b[1][2]





Notations for 3-D array




  1. int c[3][2][2]={     {{2,5},{7,9}}  , {{3,4},{6,1}} , {{0,8},{11,13}}  };
  2.  c[i][j][k]
  3. printf("%d",*c)  / printf("%d",c[0])  / printf("%d",c[0][0]) <--addr of c[0][0][0]

  4.  printf("%d",*(c[1]+1))/ / printf("%d",c[1][1])/ / printf("%d",&c[1][1][0])<--addr of c[1][1][0]
  5.                                        printf("%d",*(c[0][1]+1)) <--value of c[0][1][1];
  6. i.e c[i][j][k]= / printf("%d",*(c[i][j]+k));/printf("%d",*(*(c[i]+j)+k));/printf("%d",*(*(*(c+i)+j)+k));





Do you Know ?


  • loop pointer move by size of data type
  • scanf has &a to take value
  • printf has just a to print value
  • in array no need to write & while passing address




type specifier for printing a address--%u



Ways of Passing Array from Function: C/C++ Brush up

In programming we make a call by two methods
1)call by value- Pass a value
2)call by reference - Pass a address and fun taking this address should have pointer.And also to                                            display result again pointer.

Array is passed to a function using Call be reference.

There is Two ways

1) Using &


  1. void main( )
  2. {
  3. int a[5]={1,2,3,4,5}
  4. for(int i=0 ; i<=4 ;i++)
  5.   {
  6. printarray(&a[0]);    //or printarray(&a);[NOT SURE]
  7.    }
  8. }
  9. .
  10. .
  11. .
  12. .
  13. void printarray(int *p)
  14. {
  15. printf("%d",*p);
  16. }

2) Without Using &


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

  4. printarray(a);  
  5.    
  6. }
  7. .
  8. .
  9. .
  10. .
  11. void printarray(int *p)
  12. {
  13. for(int i=0 ; i<=4 ;i++)
  14.   {
  15. printf("%d",*p);
  16.    }
  17. }
  18. }

Passing Character Array through a Function
STRING IS THE ARRAY OF CHARACTER WITH ONE NULL '\O' CHARACTER IN THE END

There is 4 ways of initilizing a character

1) 

  1. char c[4];
  2. c[0]='j'; c[1]='o'; c[2]='h'; c[3]='n'; c[4]='\0';
2)

  1. c[ ]={'j','o','h','n','\0'}
3)Using String Literal

  1. c[ ]="john";
4) Using Pointer
  1. char*c="Hellow";

  1. int main( )
  2. {
  3. char *c="Hellow";
  4. print( c)
  5. .
  6. return(0);
  7. .
  8. }
  9. .
  10. .
  11. .
  12. .
  13. ..
  14. .
  15. void print(char *c)
  16. {
  17. int i=0;
  18. while( *(c+i)!= '\0') )
  19. {
  20. printf("%c",c[i]);
  21. i++;
  22. }
  23. printf("\n");
  24. }
  25. .
  26. .//or
  27. .
  28. .
  29. .
  30. .
  31. .
  32. void print(char *c)
  33. {
  34. while( *(c)!= '\0') )
  35. {
  36. printf("%c",c[i]);
  37. c++;
  38. }
  39. printf("\n");




Passing a 2-Dimentional Array through a Function

while passing two dimensional array to function last dimension is compulsory

  1. int func (int a[ ][3])
  2. {
  3. .
  4. .
  5. .
  6. .
  7. .}
Passing a 3-Dimentional Array


  1. int func (int a[ ][2][2])  / (int (*a)[2][2])
  2. {
  3. .
  4. .
  5. .
  6. .
  7. .}