Sunday, February 26, 2017

Hello world asp.net core mvc (RESTful service) (Create Service,Build,Host,Test)

Here is very easy step by step process to create a complete(Create Service,Build,Host,Test) simple \ hello world equivalent REST ful service using asp.net core mvc.

Audience: Beginners\Intermediate

Environment :
VS 2015 SP 3
.Net core sdk (https://www.microsoft.com/net/download/core)
Windows 7
IIS 6.1


 Open new project, select asp.net core, give a name to project


 Select Web Api( this actually means RESTful service)


Next you will see solution like this


Click on valuecontroller.cs. You will see code like below, this is the default code you will see. We will modify slightly REST services in next screen shot.



Basically controller is the module which receives the client\web browser http request and processes it. Internally Routing middleware is the responsible for routing call to this valuescontroller and all http requests. Notice attribute routing [Route("api/[controller]")], so client have to invoke like www.name.com/../api/values . Next is [HTTPGet], like HTTP verb, which returns a collection or single entity
Click on Program.cs, you will see code like below. asp.net core has built up from scratch so it has new fast web server, its built into asp.net core, and its called Kestrel (async web server, platform independent, written using c libraries). Notice, iisintegration that is basically reverse proxy. IIS all it does is passes client http request to kestrel and vice versa.

Now lets build it

Select custom

 File system , select the output folder


Open IIS manager, Add new application, enter alias, select app pool.


Create a new app pool, notice its no manage code (its .net core)

 Go to the output folder, make sure iis_iusrs exist or have appropriate rights
That’s it.
Goto your favorite browser, type http://localhost/hellorestful/api/values/1


http://localhost/hellorestful/api/values

Friday, February 24, 2017

my part time scientific research projects

Genetics -
  • Why so many people are look like (I have started collecting photos of people look like)
  •  How sex ratio is maintained (we see male and female ratio are around 50 : 50 in most of the animals, including humans )
  • What determines the sex of a baby, whether it is mothers body or father sperm quality or unknown force like that day weather, food, drinks, physical activities.
  • How do food habits and weather changes look and behavior  of humans gradually (changes skin color, their behavior ...)
  • How do DNA updates its stored information by sensing weather, food, physical activities of animal or plant 

Life 
  • What is life? What is the purpose of life? For ex:  like when star collapses and throws out it ashes into cosmos that will become ingredients of life. So is there a purpose of life?
  • How a single Cell created plants and animal kingdom.
  • Is it life universal property? It just needs a right temperature/heat, ingredients carbon, hydrogen, nitrogen, oxygen, phosphorus and sulfur (CHNOPS). We are not alone!
  • Why life is sequential for ex: first single cell that lead to multi cell and that helped multi cell to create lifelike from microbes to blue whales in between humans, domestic and wild animals. single cell, multicell, life evolved inside ocean, life moved/jumped from ocean to land...?

Behavioral Science - Why a certain group of people achieve higher success.

  • How Jew's are able to get around 40% of noble prize even though they make less 1% of world’s population). What are their food habits, day to day routines, ...
  • How Jain's are able to achieve better progress and up bring good number of quality people (not all but majority, because nature doesn't allow all\every human to be successful).
  • Can physical properties of human (face structure, voice, hand, body shape...), tell who they are? like whether he\she is kind, romantic, angry, psycho, generous, introvert or extrovert, ...
  • Leaders, Genius, working class are by birth or developed gradually? 
  • Is there a single family house, without fighting, misunderstanding, unhappy... any where in this world? how can we expect a region\country\world to be happy place to live? What is the cause  of confusion, misunderstanding...
    
Light 
  • Why it is duality in nature (sometimes wave and sometimes particle)
  • Discover the hidden mysteries of light, because light is the language of matter.
  • Nothing can travel faster than Light, this law apply s only to Matter, for sub atomic particles and dark matter, dark energy their might be separate law or force which travels faster than speed of light. We have to figure out what it is, it is the ultimate speed of known universe. 
Cosmos's - 
  • Single or Multiverse 
  • Is it finite or Infinite (It looks like finite)
  • Is it entire universe works on wave pattern principles
  • How do quarks\sub atomic particles get the energy to vibrate at speed of light?

Quantum mechanics: "God doesn't play dice" - A Einstein. I think legend is correct. May be we are not able to understand the big picture of quantum mechanics. QM is weird, unpredictable but it must follow a defined law, we just need to figure it out. 


Dark Energy - How can we use dark energy for commercial, space exploration? Whopping 70% of the universe is filled with the dark energy. Imagine a world where Car doesn't need fuel (gas/petrol), no need of lithium batteries, no solar panels (sorry Elon Musk you will be out of business), house, and all the appliances can be powered wirelessly. 

Neutrinos: Whats the role of Neutrinos. Is it universal messenger?

Who are we? 


Theory of everything -