Tuesday 9 March 2021

cmd useful commands

to rename all files in a folder from 11-42 


for /l %f in (10,1,42) do ren *.JPG  own.ll.exp%f.JPG

Tuesday 15 January 2019


Hosting wordpress using filezilla tutorial based on screenshot

STEP 1
First you want to create an Account
so go to http://000webhost.com/

STEP 2
Now give necessary information→THEN CREATE YOU ACCOUNT





















Thursday 3 January 2019

Kotlin Basics ,variables and data types Tutorial 2

String variable

var myVar="Hello world"  

var myVar:String
myVar="Hello World"

Integer variable

var MyVar=10

Decimal/Float variable

var myVar=1.0

For constant value variable

val myVar="Helloworld"
myVar="is not changed"

print(myVar)→output is Helloworld

Ranges
Using Double dots

val Myvar=1..10 // ranges from 1,2,3,4,.....9,10
val Myvar=1.rangesTo(10) // ranges from 1,2,3,4,.....9,10

Using downTo
val Myvar=10 downTo 1 //ranges from 10,9,8,7...3,2,1
val Myvar=10.downTo(1) //ranges from 10,9,8,7...3,2,1

Using steps
val Myvar=10 downTo 1 step 2 // ranges fro 10,8,6,4,2

Using alphabets
val Myvar="a"..."z" //ranges from a,b,c,d,.....z
val Myvar='a'...'z' //ranges from a,b,c,d,.....z
Checking a value in range variable
var MyvarinMyvar='a' in Myvar //checking a in Myvar 


If else expression
 val a=2
val b=3

if(a>b)
c=10
else
c=50
print(c)

or we can define same code in different way

 val a=2
val b=3

var c:int=if(a>b)
a
else
b
print(c)


When and case
when(a)
{
   1->print("a is 1")
   2->print("a is 2")
    else->print("a is unknown")
   }

FOR LOOP
java
for(i=0;i<10;i++)
{
System.out.println("Hello world");
}

Kotlin
for(initializer in ranges)

for(i in 1..10)
{
println("Hello world")
}

WHILE LOOP

while(i>5)
{
print("Hello world")
i++
}

DO WHILE LOOP

do
{
print("Hello world")
i++
}
while(i>5)

RETURN STATEMENT

fun max(a;int,b int):Int
{
if(a>b)
return a
else
return b
}

or you can define return statement using equal to simply by

fun max(a;int,b int):Int
{
=if(a>b)
 a
else
 b
}

printing variable
print("a is larger" $a)



Return statements using apply


fun main(args:Array<String>)
{
var man=man()

man.apply{  // Using apply we can avoid man.name="Ameen" and man.age=29
age=29
name="Ameen"
}. Startrun()  //here we can run function too in with we can't use this method


//we can also use with as like apply but dot function name can;t be applied at last for running function
man.apply{  // Using apply we can avoid man.name="Ameen" and man.age=29
age=29
name="Ameen"
}

}
class man{
var age:Int=1
var name:String="John"

fun Startrun(){
print("Now my name is $name")
}

}



Monday 5 November 2018

Kotlin Basics Tutorial 1

Creating a main function in Kotlin and Java

Java
we need to create class then want to add following function

 public static void main(String[] args){} 
Kotlin
we don't need to create class,just add function 

       
fun main(args: Array<String>){}


or we can add :Unit instead of void in java


fun main(args: Array<String>): Unit{}


For returning type int


fun main(args: Array<String>): Int{}


For printing just type

print("Hello World")




/***************************************************************/

For printing Hello World in java ,we need first create a class in java then followed my main class
Java


       
public class MyClass{
public static void main(String[] args){
System.out.println("Hello World");
}
}


In Kotlin we don't need to create class , just create function defining fun...and not need any semicolon for ending command, Kotlin compiler internally create class for function while running the program


fun main(args: Array<String>){
print("Hello World")
}




Facebook Twitter Delicious Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | coupon codes