Friday 25 May 2018

Design pattern ppt

https://drive.google.com/open?id=1FSFflkmS0ZWdIS8tewmxJ5tXC3vZPLEX

Saturday 12 May 2018

The Difference Between Artificial Intelligence, Machine Learning, and Deep Learning

Simple explanations of Artificial Intelligence, Machine Learning, and Deep Learning and how they’re all different. Plus, how AI and IoT are inextricably connected.







We’re all familiar with the term “Artificial Intelligence.” After all, it’s been a popular focus in movies such as The Terminator, The Matrix, and Ex Machina (a personal favorite of mine). But you may have recently been hearing about other terms like “Machine Learning” and “Deep Learning,” sometimes used interchangeably with artificial intelligence. As a result, the difference between artificial intelligence, machine learning, and deep learning can be very unclear.
I’ll begin by giving a quick explanation of what Artificial Intelligence (AI), Machine Learning (ML), and Deep Learning (DL) actually mean and how they’re different. Then, I’ll share how AI and the Internet of Things are inextricably intertwined, with several technological advances all converging at once to set the foundation for an AI and IoT explosion.

So what’s the difference between AI, ML, and DL?

Artificial Intelligence
First coined in 1956 by John McCarthy, AI involves machines that can perform tasks that are characteristic of human intelligence. While this is rather general, it includes things like planning, understanding language, recognizing objects and sounds, learning, and problem solving.
We can put AI in two categories, general and narrow. General AI would have all of the characteristics of human intelligence, including the capacities mentioned above. Narrow AI exhibits some facet(s) of human intelligence, and can do that facet extremely well, but is lacking in other areas. A machine that’s great at recognizing images, but nothing else, would be an example of narrow AI.
Machine learning
At its core, machine learning is simply a way of achieving AI.
Arthur Samuel coined the phrase not too long after AI, in 1959, defining it as, “the ability to learn without being explicitly programmed.” You see, you can get AI without using machine learning, but this would require building millions of lines of codes with complex rules and decision-trees.
So instead of hard coding software routines with specific instructions to accomplish a particular task, machine learning is a way of “training” an algorithm so that it can learnhow. “Training” involves feeding huge amounts of data to the algorithm and allowing the algorithm to adjust itself and improve.
To give an example, machine learning has been used to make drastic improvements to computer vision (the ability of a machine to recognize an object in an image or video). You gather hundreds of thousands or even millions of pictures and then have humans tag them. For example, the humans might tag pictures that have a cat in them versus those that do not. Then, the algorithm tries to build a model that can accurately tag a picture as containing a cat or not as well as a human. Once the accuracy level is high enough, the machine has now “learned” what a cat looks like.
Deep learning
Deep learning is one of many approaches to machine learning. Other approaches include decision tree learning, inductive logic programming, clustering, reinforcement learning, and Bayesian networks, among others.
Deep learning was inspired by the structure and function of the brain, namely the interconnecting of many neurons. Artificial Neural Networks (ANNs) are algorithms that mimic the biological structure of the brain.
In ANNs, there are “neurons” which have discrete layers and connections to other “neurons”. Each layer picks out a specific feature to learn, such as curves/edges in image recognition. It’s this layering that gives deep learning its name, depth is created by using multiple layers as opposed to a single layer.


AI and IoT are Inextricably Intertwined

I think of the relationship between AI and IoT much like the relationship between the human brain and body.
Our bodies collect sensory input such as sight, sound, and touch. Our brains take that data and makes sense of it, turning light into recognizable objects and turning sounds into understandable speech. Our brains then make decisions, sending signals back out to the body to command movements like picking up an object or speaking.
All of the connected sensors that make up the Internet of Things are like our bodies, they provide the raw data of what’s going on in the world. Artificial intelligence is like our brain, making sense of that data and deciding what actions to perform. And the connected devices of IoT are again like our bodies, carrying out physical actions or communicating to others.

Unleashing Each Other’s Potential

The value and the promises of both AI and IoT are being realized because of the other.
Machine learning and deep learning have led to huge leaps for AI in recent years. As mentioned above, machine learning and deep learning require massive amounts of data to work, and this data is being collected by the billions of sensors that are continuing to come online in the Internet of Things. IoT makes better AI.
Improving AI will also drive adoption of the Internet of Things, creating a virtuous cycle in which both areas will accelerate drastically. That’s because AI makes IoT useful.
On the industrial side, AI can be applied to predict when machines will need maintenance or analyze manufacturing processes to make big efficiency gains, saving millions of dollars.
On the consumer side, rather than having to adapt to technology, technology can adapt to us. Instead of clicking, typing, and searching, we can simply ask a machine for what we need. We might ask for information like the weather or for an action like preparing the house for bedtime (turning down the thermostat, locking the doors, turning off the lights, etc.).

Converging Technological Advancements Have Made this Possible

Shrinking computer chips and improved manufacturing techniques means cheaper, more powerful sensors.
Quickly improving battery technology means those sensors can last for years without needing to be connected to a power source.
Wireless connectivity, driven by the advent of smartphones, means that data can be sent in high volume at cheap rates, allowing all those sensors to send data to the cloud.
And the birth of the cloud has allowed for virtually unlimited storage of that data and virtually infinite computational ability to process it.
Of course, there are one or two concerns about the impact of AI on our society and our future. But as advancements and adoption of both AI and IoT continue to accelerate, one thing is certain; the impact is going to be profound.

Tuesday 8 May 2018

Solution- $.get ajax call does not work on the second time(IE)

Here’s the situation, you’re building a modern web application with all the AJAX-ey goodness users now expect, when suddenly you realize that some of your AJAX calls are not returning current data in Internet Explorer. If you’re like me, this usually dawns on you toward the end of a project while you’re testing because, well, what self respecting developer uses IE on a daily basis?
This can be a frustrating issue to debug. It’s possible though that this is a very common problem. In fact, it cropped up in my office three times over the past 2 weeks!

t.gif

The Symptoms

  • Requests work just fine the first time you try
  • As data is modified, you realize that you’re still seeing old results
  • Everything appears to work correctly in other browsers
  • You’re slowly going insane

Debugging

When an issue of this nature pops up I usually start the investigation by using FireBug in Firefox. Using this invaluable tool I check to make sure the requests are being made properly, check for any response issues, and so forth.
With Internet Explorer, the development tools are so poor you can barely debug CSS issues, let alone javascript problems. It’s then that I turn to Fiddler, the fantastic http traffic inspector. When you fire up Fiddler and start putting some requests through using a non IE browser you’ll see the request get made and the response come back without a problem. When you do the same with Internet Explorer you’ll notice something strange happen, or rather, not happening. The requests are not being made at all, they are being totally ignored by Internet Explorer.


The Issue

What is happening is that you’re likely making a GET request to a web service for your AJAX call. Internet Explorer, in its wisdom, will automatically cache responses from GET requests while other browsers will let you decide if you’d like to cache the result or not. Once IE has successfully made a GET request, it will no longer even make that AJAX call until the cache expires on that object.

The Solution(s)

Fortunately, fixing the issue is easier than identifying it. There are several ways to prevent AJAX requests from being cached.

POST

One option is to simply use POST requests instead of GET requests in your application. It’s usually a minor change to switch over from GET to POST on both the client and server side.


Cache Buster

Another option is to use a “Cache Buster” parameter in your request. A cache-buster is a dynamic parameter that you append to a request which makes each request unique, most commonly a random number or the current date/time ticks. This does not prevent the browser from caching the response however, it only prevents it from reusing the cached value. For example:
var myRequestURL = '/get/somefunction?buster='+new Date().getTime();

Response Headers

You can also prevent caching by sending additional headers along with your response. By specifying the “Cache-Control” header with a value of “no-cache,no-store” and returning it with the web service response you can instruct the browser not to cache the result. For example in C#:
HttpContext.Current.Response.AddHeader("Cache-Control","no-cache,no-store");

jQuery

Finally, if you’re using jQuery, you can specify that you don’t want to cache the response from your AJAX requests either across the board using the $.ajaxSetup() method or on a per request basis.
//Disbable cache for all jQuery AJAX requests $.ajaxSetup({ cache: false });
-OR-
//Disable cache for just this request $.ajax({ cache: false, //other options... });

Final Comments

There are reasons why you might want to cache the response for GET requests. For instance, a high traffic application which gets your profile name on each page load. That information doesn’t change very often so there is no need to make a fresh request every time. There are also some who will say you should not use a POST request for every AJAX call as I’ve suggested. As always, your specific application needs will dictate how you proceed and one solution does not fit all.

Recent Post

Parallel Task in .Net 4.0