$(document).bind("contextmenu", function(e) {
e.preventDefault();
});
If your are starting to develop your website or starting website development then you should consider user experience also. I am giving some tips to get started here. If you do not know anything about typography, but you care about readability, you should try this as a starting point.
function generateRandomNumber(minNum, maxNum) { return Math.floor(Math.random() * (maxNum- minNum+ 1)) + minNum; } generateRandomNumber(5, 15);
var listitems = document.querySelectorAll('li'); [].forEach.call(items, function(item) { //your code here })Above code does the same as the code below
for (i = 0; i < items.length; i++) { var item= items[i]; // your code here }Reversing a string:
var js = 'hello javascript'; var sj = [].reverse.call(hey.split('')).join(''); // "tpircsavaj olleh" console.log(sj);
var items = [12, 548 , 'a' , 2 , 5478 , 'foo' , 8852, , 'Doe' , 2145 , 119]; var random = items[Math.floor(Math.random() * items.length)];
function isNumber(n){ return !isNaN(parseFloat(n)) && isFinite(n); }
import java.util.Scanner; public class RecursionEx { //main public static void main(String args[]){ Scanner temp = new Scanner(System.in); System.out.println("Enter number to find its factorial: "); long x = temp.nextLong(); System.out.println(fact(x)); } //fact public static long fact(long n){ if(n<=1) return 1; else return n * fact(n-1); } }
class Sorting{ public static void main(String args[]){ int number[]={55,40,70,80,90,21}; int n = number.length; System.out.print("Given list:"); for (int i=0;i<n;i++) { System.out.print("\t"+number[i]); } System.out.println("\n"); //Sorting begins for(int i=0;i<n;i++){ for (int j=i+1;j<n;j++){ if (number[i]<number[j]){ //interchange values int temp=number[i]; number[i]=number[j]; number[j]=temp; } } } System.out.print("Sorted list:"); for(int i=0;i<n;i++){ System.out.print("\t"+number[i]); } }
It is the trend to write the program to print "Hello World" while starting with any language. We will also do the same. Below is the program and I will also explain useful things used in program.
class Hello{
public static void main(Strings[] args){
System.out.println("Hello World!!!");
}
}
There are some of the ground rules while you are programming in JAVA. Before we start on writing the first program we will talk about common rules you must follow, which you must mock up.
In the previous post i have mentioned about the software and hardware requirements to get started with java programming. Only having those requirements is not enough. We need to set path of the JDK as the environment variables. There are two ways for doing this.
This generation that we are living is the computer age. Everything in this today's world are somehow connected to the computer and the technology. Alright lets just talk about the computer. For those who want their future in the computer may be for engineers, programmers, designers and so on they have a very bright future if only they can struggle. Many people in this field have earned much more wealth and this is just in increasing trend. So in this blog i am writing about everything for a computer geek. If you are also a beginner in this field then every post are equally important. I will post the tutorials, codes, important steps and many more here. What you mist do is stay tuned.
We will soon meet in next post.
track by
expression that you can add to the end of the ng-repeat expression. This expression lets you define a property that uniquely identifies each item in the array. For arrays with primitive types, one approach is to use track by $index
which tracks each item in the array by the objects position within the array.
<div ng-repeat="num in [1, 2, 2, 3] track by $index">
{{num}}
</div>
$index
, you will not get the duplicate error.