IMG-LOGO

Tutorial

IMG
$http In AngularJS
07 Mar-2020

$http is an AngularJS service for reading data from remote servers.

The AngularJS $http service makes a request to the server, and returns a response.

Example

Create  a simple request to the server, and display the result in a header:

<div ng-app="FirstApp" ng-controller="FirstCtrl">
<p>Today's welcome message is:</p>
<h1>{{WelcomeGrettings}}</h1>
</div>
<script>
var app = angular.module('FirstApp', []);
app.controller('FirstCtrl', function($scope, $http) {
  $http.get("welcome.htm")
  .then(function(response) {
    $scope.WelcomeGrettings = response.data;
  });
});
</script>
 

Methods

The example uses the .get method of the $http service.

The .get method is a shortcut method. Many of shortcut methods below:

.delete()

.get()

.head()

.jsonp()

.patch()

.post()

.put()

These are all shortcuts of calling the $http service:

 

Example 2

var app = angular.module('FirstApp', []);
app.controller('FirstCtrl', function($scope, $http) {
  $http({
    method : "GET",
      url : "welcome.htm"
  }).then(function mySuccess(response) {
    $scope.WelcomeGrettings = response.data;
  }, function myError(response) {
    $scope.WelcomeGrettings = response.statusText;
  });
});

This example executes the $http service with an object as an argument. The object is specifying the HTTP method, url, what to do on success, and what to do on failure.

 

Properties

The server is an object with these properties:

.config the object used to generate the request.

.data a string, or an object, carrying the response from the server.

.headers a function to use to get header information.

.status a number defining the HTTP status.

.statusText a string defining the HTTP status.

Example

var app = angular.module('FirstApp', []);
app.controller('FirstCtrl', function($scope, $http) {
  $http.get("welcome.htm")
  .then(function(response) {
    $scope.content = response.data;
    $scope.statuscode = response.status;
    $scope.statustext = response.statusText;
  });
});

To handle errors, add one more functions to the .then method:

 

Example

var app = angular.module('FirstApp', []);
app.controller('FirstCtrl', function($scope, $http) {
  $http.get("wrongfilename.htm")
  .then(function(response) {
    // First function handles success
    $scope.content = response.data;
  }, function(response) {
    // Second function handles error
    $scope.content = "Something went wrong";
  });
});
 

 

Example

The ng-repeat directive for looping through an array:

 

<div ng-app="FirstApp" ng-controller="customersCtrl">
 
<ul>
  <li ng-repeat="x in myData">
    {{ x.Name + ', ' + x.Country }}
  </li>
</ul>
</div>
 
<script>
var app = angular.module('FirstApp', []);
app.controller('customersCtrl', function($scope, $http) {
  $http.get("customers.php").then(function(response) {
    $scope.myData = response.data.records;
  });
});
</script>

News

IMG
OnePlus Launch Android 11
News 27 Sep-2020

OnePlus has updated the meditation-focussed Zen Mode app for its smartphones running on Android 10 that brings a set of features that all were previously set to arrive through OxygenOS 11 based on Android 11. The new offerings had made their way to the OnePlus 8 and OnePlus 8 Pro through a recent developer preview of OxygenOS 11. Nevertheless, OnePlus has now brought the updated Zen Mode app that gives a similar experience on all its smartphones that yet to receive the Android 11-based update.

As per the changelog, which was initially posted by XDA Developers, the updated Zen Mode app enables the option to create a virtual room and invite friends to join and start a focus challenge together. The update also brings a variety of themes to enhance your immersive meditation experience.

The updated Zen Mode app additionally comes with the ability to let you record your daily Zen moments and review your progress towards concentration and focus.

Last month, OnePlus gave a glimpse of all these features while announcing HydrogenOS 11, which is a Chinese version of OxygenOS 11. Users testing the OxygenOS 11 also got the updated Zen Mode experience recently. However, you can now experience them simply by updating the Zen Mode app on your Android 10-running OnePlus smartphone

 

 

The updated Zen Mode app is available for download through Google Play. Alternatively, you can download its APK file from APK Mirror and sideload it on your phone.

Zen Mode was originally introduced with the OnePlus 7 Pro to bring the company's proprietary digital detox and meditation solution — an alternative to Google's Digital Wellbeing initiative. It reached other OnePlus phones through later software updates.

OnePlus hasn't yet provided any exact details about the Android 11 rollout for its smartphones. However, it recently announced the OxygenOS 11 beta release for the OnePlus 8 and OnePlus 8 Pro that brought the latest Android along with a series of new features and enhancements.

IMG
Why choose PHP for WEB ?
News

PHP has gained huge popularity in the present times by being  customizable yet easy to maintain web designing and development platform. Being an extremely favored server-side scripting language, PHP is being used for developing feature-rich websites having top-notch functionality. The creation of dynamic, interactive, reliable, secure and efficient web pages provides multifarious benefits.

A well-designed and maintained website is the need of the hour. In order to develop websites that boost visibility and help achieve business goals, PHP is the first word that strikes the mind of a proficient web developer. The clean coding structure and compelling codes have made PHP the favored language for web applications that run successfully on the web.

PHP comes with an ample number of benefits which not only save the overall web development time and money but also offer an ease. Let’s discover the top 5 reasons which suggest that choosing PHP for the web development is the right approach.

 

  1. Flexible and Dynamic:

image-2

 

Being an encrypted language which is easy to secure and full of dynamic yet flexible features, PHP programmed web applications, offer the greatest flexibility compared to any other programming language. Its flexible features can be customized to meet the present day web development needs. Also, an open source language like PHP can be used to write code and combine with different libraries for incorporating other special effects. It can be combined easily with dynamic libraries as XML and graphics.

 

When it comes to measuring its aspects in terms of compatibility and scalability, PHP is considered the best technology as it can flawlessly be deployed on almost all web servers including Apache, Caudium, Microsoft Internet Information Service (IIS) and so on. For all those businesses, who are looking forward to applying custom business requirements, PHP is the most favored choice to rely upon.

 

 

  1. Accessible to different Content Management Systems (CMS):

image-3

 

PHP is completely accessible to all CMS programs and can help assist web developers to match the needs of clients. In order to deliver best-in-class user experience, PHP developed websites are highly personalized in all aspects. This is because, CMS like WordPress, Drupal and Joomla are based on this framework. If you are looking for responsive and world class premium themes, try the ones from D5 creation which is an award-wining WordPress theme provider appreciated all over the world. Designed with the latest coding standards, WordPress themes can adjust automatically on all visual devices.

 

  1. High Performing:

image-4

 

PHP is a robust programming language and it has an extensive list of core functionality which includes cross-platform adaptability, multi-browser compatibility, secure web apps and so on. Compared to other web languages, PHP is an efficient language which supports all major web servers to deliver high performance consistently. Additionally, it is one of the secure ways of developing a website with an extra layer of security to protect against viruses and threats.

 

While working with PHP, you get maximum control over the website as it allows you to edit and modify the layout as per the requirements. One of the important reasons to choose PHP for the web development is that it takes less time in loading web pages. The faster loading time helps boost speed. Another major reason is countless and easy to use extensions which make PHP a preferred solution for developing websites with high performance.

 

 

  1. Open Source:

image-5

 

Available for free, PHP is controlled by a great community of users who offer technical support. Since it is licensed under general public, the cost of development is highly reduced and most of its related applications like MySQL and Apache Servers are available for free. All you need to do is to hire a PHP developer who can help you redefine your online presence by involving the use of this technology.

 

 

  1. Effective Frameworks:

image-6

 

PHP offers a large number of effective frameworks to design a flexible and powerful web portal. Laravel, CodeIgniter, Symfony, Zend and Phalcon are some of the ambiguous and high-performance frameworks built in with high modular characteristics, built-in support, strong community to help organizations create large-scale applications while maintaining high standards of quality and efficiency. These frameworks develop and deliver complex applications and websites in considerably less amount of time.

 

The major challenge lies in choosing the one that best suits the requirements of any business. These frameworks are suited for projects of varied shapes and sizes and develop applications with integrated support and migration system.

 

Collected

IMG
China Ban to sell 5G networks Kit in UK from Huawei
News

The U.K. announced Tuesday it will ban Huawei from its 5G networks, in a significant U-turn by the government that could significantly dent relations with China while appeasing the U.S.

Speaking in Parliament, U.K. Culture Secretary Oliver Dowden said mobile network operators in the country would be forced to stop buying equipment from Huawei by the end of the year. They will also be required to strip out Huawei gear from their infrastructure by 2027.

It’s a major reversal for the U.K., which in January gave Huawei restricted access to the country’s next-generation mobile networks. Under previous guidelines, mobile network operators were required to reduce the share of Huawei kit in noncore parts of their infrastructure to 35% by 2023.

But that decision was complicated by new sanctions imposed on Huawei by the U.S. in May. These restrictions mean the Chinese firm will no longer be able to source key chip equipment from trusted American suppliers. The U.K.’s National Cyber Security Center initiated an emergency review of Huawei shortly after the U.S. curbs were introduced.

Dowden said the move will delay the U.K.’s rollout of 5G mobile internet, which promises super-fast data speeds and increased network capacity. Banning procurement of new Huawei gear and reducing the Chinese vendor’s market share to zero by 2027 would result in an “accumulative delay” of up to three years and cost as much as £2 billion ($2.5 billion), he warned.

“This has not been an easy decision, but it is the right one for the U.K.’s telecoms networks, for our national security and our economy both now and indeed in the long run,” Dowden told lawmakers.

 

https://www.cnbc.com/video/2020/07/09/the-confrontational-uk-china-relationship-will-affect-investment-eiu.html

 

Collected From cnbc

Course

IMG
CSS Setting height and width
Course - 28 Jun-2020

The height and width properties are used to set the height and width of an element.

The height and width properties do not include padding, borders, or margins. It sets the height/width of the area inside the padding, border, and margin of the element.


CSS height and width Values

The height and width properties may have the following values:

  • auto - This is default. The browser calculates the height and width
  • length - Defines the height/width in px, cm etc.
  • % - Defines the height/width in percent of the containing block
  • initial - Sets the height/width to its default value
  • inherit - The height/width will be inherited from its parent value

CSS height and width Examples

This element has a height of 200 pixels and a width of 50%

Example

Set the height and width of a <div> element:

div {
  height: 200px;
  width: 50%;
  background-color: powderblue;
}

This element has a height of 100 pixels and a width of 500 pixels.

Example

Set the height and width of another <div> element:

div {
  height: 100px;
  width: 500px;
  background-color: powderblue;
}

Note: Remember that the height and width properties do not include padding, borders, or margins! They set the height/width of the area inside the padding, border, and margin of the element!


Setting max-width

The max-width property is used to set the maximum width of an element.

The max-width can be specified in length values, like px, cm, etc., or in percent (%) of the containing block, or set to none (this is default. Means that there is no maximum width).

The problem with the <div> above occurs when the browser window is smaller than the width of the element (500px). The browser then adds a horizontal scrollbar to the page.

Using max-width instead, in this situation, will improve the browser's handling of small windows.

Tip: Drag the browser window to smaller than 500px wide, to see the difference between the two divs!

This element has a height of 100 pixels and a max-width of 500 pixels.

Note: The value of the max-width property overrides width.

Example

This <div> element has a height of 100 pixels and a max-width of 500 pixels: 

div {
  max-width: 500px;
  height: 100px;
  background-color: powderblue;
}

Projects