Thursday, 2 December 2021

NodeJs - Node Http & Query String

Basic Conecpts For Creating server and response code

Its a inbuilt modul with help of this module we can perform meny operationsIt Handle - Request & Response beacause it is a Hypertext Text Transfer Protocol(get request from user and give response to server)

1) For creating server we need Http module..

2) Url Handling : For Handlng Url we can use

var http = require('http');  --> inbuild module it access via direct requre method can access

var server = http.createServer(function(req , res){       ///create server

//Request Status , Content Type

server.writeHead(200,{"content-type":"text/plain"})

var url = req.url;                 //Url Handling

res.write(url)

res.end('Response End')     //print message

}) .listen(3000);


Note : Query String = Send Variable in browser with url

Url Handling

var http = require('http');  --> inbuild module it access via dirct method

var url = require('url');             //Handling Querystring

var server = http.createServer(function(req , res){       ///create server

server.writeHead(200,{"content-type":"text/plain"})

var result = url.parse(www.google.com?id=10, true).query;

res.write(res.name);   //things whinch want to get like name


}) .listen(3000);



Run-> localhost://300

Monday, 22 November 2021

Kotlin - Functions

 function with two Int parameters and Int return type.

sum of 3 and 5 is 8

A function body can be an expression. Its return type is inferred.

sum of 19 and 23 is 42

Friday, 29 October 2021

Kotlin- When


NOTE :1) Whenever we have more then on condition that condition use "when" its a enhance version of switch condition


fun main(){

val userType = "admin"

when(userType){

"admin"->{

println("You'r admin")

}

"editor"->{

println("You'r editor")

}

"author"->{

println("You'r author")

}

else->{

println("You'r Other")

}

}

}


Output: You'r admin

Kotlin - Null Safty

 note : 1) Bydefault All variable non-null 

   2) For Accecpting this null value we have to put '?' with string. 

   3) If variable is null and want to access the properties of variable in that case use 'varible?.' 

   4) if confirm varible is not null then we can use '!!' but if not sure dont use it trow null pointer exception.


var name:String? = null

val Lname:String = "Nishad"

firstname

println("Hello${name?.length}")

Kotlin First Program 'Hello word'


  1. Kotlin code is usually defined in packages. Package specification is optional: If you don't specify a package in a source file, its content goes to the default package.
  2. An entry point to a Kotlin application is the main function. Since Kotlin 1.3, you can declare main without any parameters. The return type is not specified, which means that the function returns nothing.
  3. println writes a line to the standard output. It is imported implicitly. Also note that semicolons are optional.

Example:

val name:String="Kamal"

val Lname:String="Nishad"

fun main(){

println("Hello $name $Lname")

}


OUTPUT: Hello Kamal Nishad

Friday, 13 March 2020


React Native Login Screen





import React, { Component } from 'react';
import { StyleSheet,TextViewTextInputButton ,TouchableOpacityfrom 'react-native';
import { Image } from 'react-native';

export default class Bananas extends Component {
  render() {
    let pic = {
      uri: 'http://3.6.64.197/pluginfile.php?file=%2F1%2Ftheme_lambda%2Flogo%2F1584095532%2Fcoco.jpg'
    };
    return (   

        <View>
              <Image source={pic} style={{width: 140height: 50,marginTop:100,alignContent:"center",alignItems:"center",alignSelf:"center"}}/>

              <View>
                  <Text style={style.logo}>Login</Text>
              </View>

              <View>
                  <TextInput style={style.inputView}
                              placeholder="Username" 
                              placeholderTextColor="#000">
                  </TextInput>
              </View>

              <View>
                  <TextInput style={style.inputView}
                              secureTextEntry
                              placeholder="Password"
                              placeholderTextColor="#000"
                              onChangeText={text => this.setState({password:text})}>
                  </TextInput>
              </View>

              <View>

              <TouchableOpacity style={style.loginBtn}>
                  <Text style={style.loginText}>LOGIN</Text>
              </TouchableOpacity>

              </View>

        </View>
    );
  }
}

const style = StyleSheet.create({

  logo:{
    fontWeight:"bold",
    fontSize:20,
    alignSelf:"center",
    color:"#fb5b5a",
    marginTop:50,
  },
  inputView:{
    alignSelf:"center",
    width:"80%",
    backgroundColor:"#C0C0C0",
    borderRadius:5,
    height:50,
    marginTop:10,
    color:"#000",
    marginBottom:20,
    justifyContent:"center",
    padding:10
  },
  loginBtn:{
    width:"80%",
    backgroundColor:"#fb5b5a",
    borderRadius:5,
    height:50,
    alignSelf:"center",
    alignItems:"center",
    justifyContent:"center",
    marginTop:10,
    marginBottom:10
  },
  loginText:{
    color:"white"
  },
  inputIcon:{
    width:30,
    height:30,
    marginLeft:15,
    justifyContent: 'center'
  },

});

Monday, 14 August 2017

Xamarin Emulator Black Screen Problem




Hello,

            My another  blog is there, so today we are discussion about xamarin black screen problem. When I am a beginner that kinds of problems i am also faced. After searching the solution of an problem I get some solution which'r we discussion here so lets start now..


  >> Our Problem...



Step.1) Create a new project.





Step.2) Here the MainActivity where the actual solution this problem.





Step.3) Here is the actual problem. Now remove SetContentView from comment section. 



Step.4) Now Deploy the project.




Here Finally the problem is solved now run project efficiently.




If you Like my blogs please comment below.😉






Kotlin - Observer

 Rxjava -  Observer - Based on data view willl render (react) karega. trotling -> making stream for execution (Means clicks event fire kr...