Friday, 29 July 2016

Understanding Node.js

Node.js is built on Google’s Chrome Javascript Engine and it’s a server side platform. In 2009, it was developed by Ryan Dahl. The latest version is v0.10.36. The definition of Node.js can be summed up as follows:
Chrome’s Javascript runtime is what Node.js is built off of. It allows you to build scalable and fast network applications.Node.js uses a non-blocking I/O model which is event-driven. It’s efficient and lightweight which makes it the right choice for real-time applications on distributed devices.

What is Node.js?
Node.js is a runtime environment which cross-platform and open source. It’s used for developing network applications and server-side applications. Node.js applications use Javascript as the code and they can be run on Microsoft Windows, OS X, and Linux through the Node.js runtime. There’s a rich library which holds many Javascript modules with Node.js. This makes development of web applications simple.
  • Event Driven and Asynchronous – The APIs which are a part of the Node.js library is considered asynchronous or non-blocking. This means that when a Node.js server is used it never waits for an API to return the data. The server will move onto the next API once it’s called and the notification mechanism of Events found in Node.js helps a server get a response from any previous API call.
  • Can be Built quickly on Chrome’s V8 JavaScript Engine – The library of Node.js offers fast code execution.
  • Highly Scalable even though Single Threaded – A Single threaded event looping model is used for Node.js. The event mechanisms help a server responding in a way which is non-blocking. The server is scalable where traditional server creates a limited number of threads to handle the requests. A single-threaded program is used with Node.js and the same program provides service to larger numbers of requests that regular serves such as the Apache HTTP Server.
  • There’s no Buffering – When you use Node.js applications data is never buffered. The applications use output data in chunks.
  • License – You get Node.js under the MIT license.
Who is Using Node.js?
There are many projects, companies, and applications which are using Node.js. You can fund this list on the github wiki. Some of the well-known ones are GoDaddy, General Electric, PayPal Microsoft, Uber, Yahoo!, Wikipins, Yammer, and others.
This diagram shows the important aspects of Node.js

Where is Node.js used?
Here are the areas where Node.js is perfect to use:
  • Data Streaming Applications
  • I/O bound Applications
  • JSON APIs based Applications
  • Data Intensive Real Time Applications (DIRT)
  • Single Page Applications
Where you Should Not Use Node.js
Don’t use Node.js for any applications which are CPU intensive.

PHP Check Server

This class can check if you can connect to a server.



It can take the network address of a server and the name of a protocol and it tries to establish a TCP connection to a given port of the server to see if it accepts the connection.

The server port to connect is configurable but it can also use the pre-defined ports for several known protocols like IMAP, POP3, SMTP, SMTP/TLS, SMTP/SSL, HTTP, HTTPS, FTP, CUPS, LDAP, LDAP/SSL, MYSQL, and PostreSQL.



 Download File

Wednesday, 27 July 2016

PHP Convert Text to Audio

Spell text as MP3 audio using Google Translate



This class can spell text as MP3 audio using Google Translate.

It can take a given text string in an idiom and generates a MP3 audio stream using Google translate.

The class generates HTML with JavaScript to play the converted text in a Web page.

 Download
Example :-

<!doctype html> 
<html> 
<body> 
<center> 
<form method="post"> 
<h1>Text Reader</h1> 
<textarea name="testo_da_leggere"></textarea><br /> 
<input type="text" name="lingua_testo" placeholder="Codice lingua" /><br /> 
<input type="submit" value="Leggi" /> 
</form> 
</center> 
<?php 
include "text-reader.php"; 
$testo_da_leggere = ((isset($_POST['testo_da_leggere'])) ? $_POST['testo_da_leggere'] : "Inserisci un testo da leggere"); 
$lingua_testo = ((isset($_POST['lingua_testo'])) ? $_POST['lingua_testo'] : "it"); 
$textReader->Read($testo_da_leggere,$lingua_testo); 
?> 
</body> 

</html> 

JData: Connect to MySQL using MySQLi and run SQL queries

Short description:

Connect to MySQL using MySQLi and run SQL queries.

Description

This class can connect to MySQL using MySQLi and run SQL queries.

It can establish a connection to a given MySQL server using MySQLi.

The class can execute either queries that return results or not. Queries that return results return them in arrays.

It can also generate log files of the executed queries when in development environment.

 Download

DigitalOcean India Hosting is available on Cloudways

Cloudways, a Managed Cloud Hosting Platform is growing in the web market at an agile rate. Recently, Cloudways has announced its integration of DigitalOcean data center located in Bangalore (Bengaluru), India. DigitalOcean, being one of the four cloud providers on Cloudways, has proved itself as an amazing cloud service for users across the world.

 Signup


Startups
India is a hubspot for new startups and observing how technology is empowering the market, India outshines as a gem within the IT industry. The new DigitalOcean data center aims to promote such startups and already existing IT businesses by allowing them to launch servers based on different web applications.
Cloudways is a recognized hosting platform that permit users to host and manage business websites, ecommerce stores, interactive blogs and different other web applications to design such websites for developers.
According to the CTO and co-founder at Cloudways, Pere Hospital, “The new data center from DigitalOcean in India on Cloudways will help a large number of startups and individuals in setting up their web applications with ease,” he further added, “With blazing fast performance and affordable plans, Cloudways Cloud Platform is a powerful app deployment solution for India and its neighboring regions.”
Blazingly Fast Performance

Cloudways is an amazing solution for developers and designed crafting websites for small and mid sized organizations. It is equipped with a unique optimization formula that amalgamates the strength of Nginx, Varnish, Apache, and Memcached. Due to this Thunderstack formula, Cloudways ensures that websites load 100 percent faster as compared to traditional hosting environment.
Special offer from Cloudways
Cloudways Indian Hosting comes with quite affordable plans as low as up to $5. The hosting platform is packed with a number of amazing features such as free SSL (Let’s Encrypt), free subdomain-based staging areas, free SMTP addon, and free WordPress automated migrations.
It comes with a free trial period through which users can test their websites and experience the hosting performance at Cloudways.
Today, information is a major commodity in the tech market. We are all aware that all the information stored within a cloud environment is safe and secure in servers organized in different data centers.
When your local internet service provider is also your local collocation solution, everything runs more efficiently and smoothly. Upload, download, and disaster recovery all becomes a far easier and faster enterprise when you’re on a dedicated network. India is the next big things when it comes to startups and we believe the IT market of India will hopefully be investing more in the coming future.

Saturday, 23 July 2016

Google I/O 2016 - a Roundup

io_banner.png

What was your favorite announcement from the Google I/O 2016 keynote? Here is a roundup of the biggest news coming out of Google I/O 2016 for you: 

Android N - smarter, faster, better:

Android-N-new-features.jpgGoogle released a new beta for Android N with features revolving around three key points - performance, securityand productivity - lots of new features for N.
    • Android N puts its biggest lead forward with ‘Volken’ - a modern 3D graphics API designed to give game controllers direct control over the GPU to produce incredible graphics and compute performance.
    • Next comes the all new Just in Time or ‘JIT compiler’ which ensures that the app installs are 75% much faster.
    • To capture security, N introduces File based encryption, strong media framework security and allows seamless updates.
The new operating system also improves productivity by adding new features into multitasking, multi window operations and enhanced notifications system and better emojis.
Android N is expected to release later this summer. The N could be for anything, our best guess Nougat orNutella!

google_io_android_wear_2-1.pngAndroid Wear 2.0:

Google announces a drastic overhaul to Android Wear. All updated to offer better battery life, phone-free operation, better fitness support and smarter, more predictive operation. Smart Reply, handwriting recognition and a new keyboard are some highlights. The developer preview launched last night, and it will be live in the fall.

 

The two all new communication apps:allo_duo_1.png

Allo, the smart messaging app: Google’s brings AI into messaging with Allo which smartens your text conversations. Allo’s best feature is Google Assistant integration, smart photo recognition and a better focus on emoji. The app also features an Incognito Mode, which includes end-to-end encryption, message expiration and private notifications.
Duo-video calling app: Duo is a video companion to Allo. A competitor of Facetime. Duo come with an interesting feature ‘ Knock-Knock’ that shows you a live video stream of the caller before you pick up the call.
Both Allo and duo will be available later this summer for iOS and Android.

google_daydream.png

Welcome to Android VR:

Android steps into mobile VR through DayDream, built on top of Android N. For the feature, Google has revamped the Play Store, so users can browse and download apps with the VR headset on. Movies will also be viewable in VR now, as well both regular and 360-degree YouTube videos. And while Google mentioned (but didn’t display) a new headset coming later this year, they did show off a new VR controller.

Google Home:google_home_1.png

Your new housemate from Google. Google Home is  a small white and grey speaker with always-listening microphones that integrates into a broad range of services.  It plays music and lets you control smart home devices. And yes of course, you can ask Google Home anything you want to know.

android_auto.png

 

Updates to Android Auto:

Google also announced a number of improvements for car drivers. The popular traffic-tracking app Waze is now built directly into Android Auto, letting drivers see speed trap warnings and accident alerts in real time.

Friday, 22 July 2016

Top 5 Things You Need To Know to Learn NoSQL


Experts say that the world’s data is doubling every two years. This epic increase in Big Data has highlighted the limitations of reliance on traditional forms of data storage and management while also focusing attention on new methods for addressing the volume and variety and veracity of structured and unstructured data. In these discussions, one of the terms you’ve undoubtedly heard lots of buzz around is the expression “NoSQL.”



NoSQL databases grew rapidly in popularity over the last several years and the market outlook is great. In fact, NoSQL has emerged as the preferred choice for mobile and web development. So let’s stop and consider the most important points you should be considering about NoSQL. What is most critical to know at the current stage in this exciting market? In the following we outline the top 5 things you should know about NoSQL as it stands today.

NoSQL represents a deliberate shift away from relational DBs

NoSQL is a technical term that means either “No SQL” or “Not only SQL” and represents a paradigm shift away from sole reliance on relational databases. Relational databases (RDMS) emerged in the 1970s and were based on a set of data tables that could be queried and matched based on languages like SQL. These database architectures were ‘structured’ meaning that the data was organized in a uniform format and varied little over time.

NoSQL architecture has clear advantages

There are a number of types of NoSQL databases such as Key Value Pairs, Column Family Stores, Graph Databases, Document Databases. Key Value Pairs are the most popular and represent a fundamental method for representing data in computer systems and applications. In this schema a unique key exists for a particular object that needs to be returned; querying the database for that unique key will return results from whichever node has the object.
NoSQL is also much more scalable, data can be ingested without a predefined schema, and development is faster and code integration more reliable. This all translates into bigger and faster application changes in real-time.

NoSQL has a wide range of applications and use cases

There are any number of applications for NoSQL data storage and processing solutions today, ranging from user profile stores, to eCommerce sites, to mobile applications. Netflix is one high profile example of a major organization that migrated from Oracle to the NoSQL database Cassandra to help it better stream huge amounts of content to millions of customers worldwide each day. There are a growing number of possible use cases for how organizations today can leverage the benefits of NoSQL.


NoSQL is great for small businesses

The ability to deliver high-volume, high-variety online applications for a fraction of the cost that it took with traditional methods, is also one of the reasons why NoSQL technologies are an appealing solution for smaller organizations with limited budgets. Some of the top NoSQL databases on the market today include MongoDBMarkLogicCouchbaseCloudDB, and Amazon’s Dynamo DB. Each vendor has emerged with robust, scalable, cloud-based solutions that allow for rapid processing of real-time Big Data applications – all in ways that are affordable.

The NoSQL outlook is strong

The market is a formidable one with projected growth forecast to reach $3.4 Billion in 2020, representing a compound annual growth rate (CAGR) of 21% for the period 2015 – 2020. With the massive growth expected in the Internet of Things market and the enormous Big Data sets this will produce, small businesses would be well advised to start looking seriously at NoSQL and start taking measures to adopt the latest benefits of this technology.

Thursday, 21 July 2016

How to view webpage in fullscreen using jQuery and HTML5 API


Today I’m going to share how to view your webpage in fullscreen mode using jQuery and HTML5 API
Advantage of Full Screen Design is that it is equally functional both on desktop and mobile devices and across different browsers. This helps streamline programming while providing viewers with a polished, professional brand image that is consistent from big to small screen devices.
Other Benefits of Full Screen Design
  • Research shows that it helps boost conversion rates
  • Its clean formatting doesn’t distract with unnecessary page elements
  • Its imagery fuses intuitively with written content; and
  • Stunning full screen design imagery increases the likelihood that viewers will continue to explore the site instead of hitting the back button.

Step 1 : Include jQuery.js and Font Awesome Scripts in the Header

Include the below scripts in your header tag
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//use.fontawesome.com/aa03aaad2f.js"></script>

HTML code

<a href="javascript:;" class="fullscreen-toggle"><i class="fa fa-arrows-alt"></i> View Fullscreen</a>

jQuery and HTML4 API code to activate Fullscreen

$(".fullscreen-toggle").on("click", function() {
    document.fullScreenElement && null !== document.fullScreenElement || !document.mozFullScreen && !document.webkitIsFullScreen ? document.documentElement.requestFullScreen ? document.documentElement.requestFullScreen() : document.documentElement.mozRequestFullScreen ? document.documentElement.mozRequestFullScreen() : document.documentElement.webkitRequestFullScreen && document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT) : document.cancelFullScreen ? document.cancelFullScreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitCancelFullScreen && document.webkitCancelFullScreen()
});
The Document.fullscreenElement read-only property returns the Element that is currently being presented in full-screen mode in this document, or null if full-screen mode is not currently in use
  • document.fullScreenElement: the element which has been pushed to fullscreen.
  • document.fullScreenEnabled: notes if fullscreen is current enabled.

Resize images to a given width and height

This class can resize images to a given width and height.It can take a given GIF, JPEG and PNG image and resize it to a given width and height.The class can display the image as the current script output or save to a given file.The quality percentage of the resized image is a configurable parameter.


Example :


<?phprequire('../image_sizer.php');$img = new image_sizer();/**
 * setImage()
 * url : http://localhost/example1.php?img=https://upload.wikimedia.org/wikipedia/commons/c/c1/PHP_Logo.png
 *
 */
$img->setImage($_GET['img']);/**
 * setSize
 * New image size
 * $img->setSize(Width, Height)
 */
$img->setSize(10060);/**
 * show image
 *
 * $img->show(type, quality);
 * type : png, jpeg, jpg, gif
 * quality : image show quality 100 = 100%
 */
$img->show('png'100);



 Download