Categories
Uncategorized

Asus Z170 Deluxe for Gaming

The Asus Z170 Deluxe Motherboard supports 2-way SLI technology for Gamers. Like most other motherboards, the Z170 also comes with a free SLI-bridge. As of the time this post was written, this is one of the best Motherboards for Personal Computing. Also this is one of the very few motherboards, that offer on board NVMe support through an m.2 slot and Hyperkit. The amazingly fast Intel 750 series SSDs can be interfaced with the Asus Z170 using the U.2 connector and the Hyperkit (needs to be connected to your m.2 slot on-board). You can also program function keys to switch to UEFI BIOS. This beats the Asus X99 Deluxe as it cannot support 6th Generation Intel i7 Processors. The audio section on this board, has shielding and also an amplifier.

Asus Z170 Deluxe

  • Supports Intel Skylake Processors (Intel LGA Socket 1151, 6th Generation 14nm)
  • Supports upto 64GB of DDR4 memory with Over Clocking (O.C.) upto 3733 Mhz
  •  2.5-in NVMe support through U.2 (previously SFF-8639) connector and Hyperkit + m.2 slot .
  • PCI Express to m.2 adapter for an extra m.2 slot.
  • 3 x PCle 3.0 (GEN3)
  • 6 X SATA 6Gb/s
  • SLI (2-Way) & 3-WAY CFX Support
  • 2-way SLI bridge
  • 6 USB 3.1 (1 Type C 5 Type A) ports and 4 USB 3.0 ports.
  • 3×3 Dual – Band Wi- Fi 802.11ac + BT 4.0 and Wireless Antenna Adapters (External)

Note: The Asus Z170-Deluxe only supports one Titan Z as it already a Dual GPU in SLI and the z170-Deluxe only supports 2-way SLI. However, to achieve similar or even better results at times, you can have 2 nvidia Titan Xs in SLI mode using the 2-way SLI bridge.

Categories
Uncategorized

Handling CORS and API

CORS

Handling CORS (Cross-Origin Resource Sharing) can be quite tricky at times.  Browsers restrict Cross-Origin HTTP requests due to security reasons. For example, the XMLHttpRequest doesn’t work for external domains. With CORS, XMLHttpRequest 2 allows that.

To handle the Cross-Origin requests on modern browsers, there is an easy workaround. A backend technology like PHP, nodejs, .NET, Java or Ruby on Rails can be used to route externals API calls through them, instead of directly calling the API from the frontend technologies like jQuery and AngularJS.

For example I have written a simple program using PHP 5.6 in the backend and AngularJS on the front end to initiate the CORS.

DEMO

Code

If you are having trouble handling the COR’s on the API side and have access to the Apache config file(ex: apache2.conf) on your API server, then you can enable the settings by adding this line in your Directory or Virtual Hosts tag.

Header set Access-Control-Allow-Origin "*"

To allow only a particular domain,

Header set Access-Control-Allow-Origin "your-domain.com"

If you do not have access to the apache config file, then you need to include the following header in your API service file, to allow Cross-Origin requests made to it. Not initiating this may lead to 403 errors as response. To allow any domain to request the API, you can use the following piece of code in your php file.

 <?php
     header("Access-Control-Allow-Origin: *");
     ...
  ?>

To allow only a certain domain to make requests to your API, you can use the following line of code.

 <?php
     header("Access-Control-Allow-Origin: your-domain.com");
     ...
  ?>

If you have any other ideas regarding CORS, you can add a comment below.

Categories
Uncategorized

Temp Files in Windows

Regularly clearing the temporary files on your Windows system can save you a lot of space on your Hard Drive. To start a quick clean up process, open up the Run dialogue box in Windows using the Windows+R key. Enter the following commands and click on Ok. Then delete the files permanently (Shift+Del).

  1. temp [admin privileges]
  2. %temp% [user privileges]
  3. prefetch [admin privileges]temporary
    You might want to view and delete the hidden files as well in these folders.
    Note that the prefetch folder is used as a caching storage to speed up loading your programs, so clearing it to refresh or to save space would mean that your programs will take longer to open the next time you turn on your computer.Some of the more common tasks to clear up even more space would to,

->  Clear Internet Browsing history on all your browsers
-> Empty the Recycle Bin
-> Perform Disk Cleanup on all drives.

If you think that you do not use Recycle Bin’s storage to it’s full extent, then you can reduce it’s quota by right clicking and selecting properties and choosing the right percentage for your Hard Drive.

You can use CCleaner to do  regular cleanup tasks and tasks like fixing your Windows Registry errors for free. Scanning and fixing the registry errors takes care of all the broken links in the windows registry after running a program setup or uninstalling it, or for missing files, etc. You can also speed up your system startup process, by choosing which applications run on system startup.

If you have anymore ways to cleanup temp files and speed up the PC, then you can leave a comment below.

 

Categories
Uncategorized

Simple Date Picker using AngularJS Directives

Download this file. Extract it’s contents onto your web root folder (or your directory). Open the directory in a web browser and you will see something similar to this.

Birth Date Form

To use this directive (Angular’s very own HTML 5 web components), you can use the following HTML tag in any forms after initializing the Angular Application.

<body ng-app="bdayApp">
  ....
  <bday-form/>
  ...
</body>

Few browsers do not handle the self closing tags all that well, so using the following syntax might help in that case.

<body ng-app="bdayApp">
  ....
  <bday-form></bday-form>
  ...
</body>

Also make sure you include the following lines anywhere on the page where you want to use the date picker. Note that it is not necessary to include the Javascript files before you use the date tag, it works even if the code is loaded after the contact tag is loaded. Bootstrap 3 is also being used to render the UI, so it has to be included before the tag is placed in the web page.

 <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
<script src="Angular/bdayApp.js"></script>

Demo

Usage:

<!DOCTYPE html>
<html lang="en">
<head>
 <title>Bootstrap Example</title>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body ng-app="bdayApp">
 <bday-form/>
</div>
</body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script>
<script src="Angular/bdayApp.js"></script>
</html>