Wednesday, May 20, 2015

Comparison - Elasticsearch vs MongoDB

Elasticsearch MongoDB
Description A modern enterprise search engine based on Apache Lucene One of the most popular document stores
DB-Engines Ranking Rank - 14, Score - 64.83 Rank - 4, Score - 277.32
Database model Search engine Document store
Developer Apache Software Foundation MongoDB, Inc
Initial release 2010 2009
License Open Source Open Source
Database as a Service No No
Implementation language Java C++
Server operating systems All OS with a Java VM Linux, OS X, Solaris, Windows
Data scheme schema-free schema-free
APIs and other access methods Java API, RESTful HTTP/JSON API proprietary protocol using JSON
Server-side scripts No JavaScript
Triggers Yes No
Partitioning methods Sharding Sharding
Replication methods Yes Master-slave replication
MapReduce No Yes
Consistency concepts Eventual Consistency Eventual Consistency, Immediate Consistency
Foreign keys No No
Transaction concepts No No
Durability Yes Yes

Tuesday, May 19, 2015

NoSQL Database

NoSQL encompasses a wide variety of different database technologies that were developed in response to a rise in the volume of data stored about users, objects and products, the frequency in which this data is accessed, and performance and processing needs. Relational databases, on the other hand, were not designed to cope with the scale and agility challenges that face modern applications, nor were they built to take advantage of the cheap storage and processing power available today.
NoSQL DEFINITION: Next Generation Databases mostly addressing some of the points: being non-relational, distributed, open-source and horizontally scalable.
A NoSQL (often interpreted as Not only SQL) database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Motivations for this approach include simplicity of design, horizontal scaling, and finer control over availability. The data structures used by NoSQL databases (e.g. key-value, graph, or document) differ from those used in relational databases, making some operations faster in NoSQL and others faster in relational databases. The particular suitability of a given NoSQL database depends on the problem it must solve.
NoSQL Database Types
  • Document databases pair each key with a complex data structure known as a document. Documents can contain many different key-value pairs, or key-array pairs, or even nested documents.
  • Graph stores are used to store information about networks, such as social connections. Graph stores include Neo4J and HyperGraphDB.
  • Key-value stores are the simplest NoSQL databases. Every single item in the database is stored as an attribute name (or "key"), together with its value. Examples of key-value stores are Riak and Voldemort. Some key-value stores, such as Redis, allow each value to have a type, such as "integer", which adds functionality.
  • Wide-column stores such as Cassandra and HBase are optimized for queries over large datasets, and store columns of data together, instead of rows.

The Benefits of NoSQL
When compared to relational databases, NoSQL databases are more scalable and provide superior performance, and their data model addresses several issues that the relational model is not designed to address:
  • Large volumes of structured, semi-structured, and unstructured data
  • Agile sprints, quick iteration, and frequent code pushes
  • Object-oriented programming that is easy to use and flexible
  • Efficient, scale-out architecture instead of expensive, monolithic architecture

Saturday, April 25, 2015

Elasticsearch

Elasticsearch is a great open source search engine built on top of Apache Lucene. Its features and upgrades allow it to basically function just like a schema-less JSON datastore that can be accessed using both search-specific methods and regular database CRUD-like commands. It is a real-time distributed search and analytics engine. It allows you to explore your data at a speed and at a scale never before possible. It is used for full-text search, structured search, analytics, and all three in combination:
  • Wikipedia uses Elasticsearch to provide full-text search with highlighted search snippets, and search-as-you-type and did-you-mean suggestions.
  • The Guardian uses Elasticsearch to combine visitor logs with social -network data to provide real-time feedback to its editors about the public’s response to new articles.
  • Stack Overflow combines full-text search with geolocation queries and uses more-like-this to find related questions and answers.
  • GitHub uses Elasticsearch to query 130 billion lines of code.
Elasticsearch is much more than just Lucene and much more than “just” full-text search. It can also be described as follows:
  • A distributed real-time document store where every field is indexed and searchable
  • A distributed search engine with real-time analytics
  • Capable of scaling to hundreds of servers and petabytes of structured and unstructured data
And it packages up all this functionality into a standalone server that your application can talk to via a simple RESTful API, using a web client from your favorite programming language, or even from the command line.
Elasticsearch can be used to search all kinds of documents. It provides scalable search, has near real-time search, and supports multitenancy. Elasticsearch is distributed, which means that indices can be divided into shards and each shard can have zero or more replicas. Each node hosts one or more shards, and acts as a coordinator to delegate operations to the correct shard(s). Rebalancing and routing are done automatically.
Another feature is called "gateway" and handles the long term persistence of the index; for example, an index can be recovered from the gateway in a case of a server crash. Elasticsearch supports real-time GET requests, which makes it suitable as a NoSQL solution, but it lacks distributed transactions.

website: https://www.elastic.co/products/elasticsearch

HTML5 Canvas

Canvas element
The canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D shapes and bitmap images. It is a low level, procedural model that updates a bitmap and does not have a built-in scene graph. Canvas was initially introduced by Apple for use inside their own Mac OS X WebKit component in 2004, powering applications like Dashboard widgets and the Safari browser. Later, in 2005 it was adopted in version 1.8 of Gecko browsers, and Opera in 2006, and standardized by the Web Hypertext Application Technology Working Group (WHATWG) on new proposed specifications for next generation web technologies.
Canvas consists of a drawable region defined in HTML code with height and width attributes. JavaScript code may access the area through a full set of drawing functions similar to those of other common 2D APIs, thus allowing for dynamically generated graphics. Some anticipated uses of canvas include building graphs, animations, games, and image composition.
What is HTML Canvas?
The HTML <canvas> element is used to draw graphics, on the fly, via scripting (usually JavaScript).
The <canvas> element is only a container for graphics, it has no drawing abilities of its own. User must use a script to actually draw the graphics.
The getContext() method returns an object that provides methods and properties for drawing on the canvas. Canvas has several methods for drawing paths, boxes, circles, text, and adding images. A canvas is a rectangular area on an HTML page. By default, a canvas has no border and no content.
Internet Explorer 9, Firefox, Opera, Chrome, and Safari support <canvas> and its properties and methods.
Canvas vs SVG (Scalable Vector Graphics)
SVG is an earlier standard for drawing shapes in browsers. However, unlike canvas, which is raster-based, SVG is vector-based, i.e., each drawn shape is remembered as an object in a scene graph or Document Object Model, which is subsequently rendered to a bitmap. This means that if attributes of an SVG object are changed, the browser can automatically re-render the scene.
How to use Canvas
The following code creates a Canvas element in an HTML page:
<canvas id="canvasSample" width="200" height="200">
This text is displayed if your browser does not support HTML5 Canvas.
</canvas>
Using JavaScript, we can draw on the canvas:
var element = document.getElementById('canvasSample');
var context = element.getContext('2d');
context.fillStyle = 'red';
context.fillRect(30, 30, 50, 50);

Sunday, March 15, 2015

What's New in Visual Studio 2015

The following are the new features of the Visual Studio 2015

UI debugging tools for XAML
Two new tools — the Live Visual Tree and the Live Property Explorer — that can use to inspect the visual tree of your running WPF application, as well as the properties on any element in the tree. In short, these tools will allow to select any element in your running app and show the final, computed and rendered properties.

Single sign-in
The new release, reduces the authentication prompts required to access many integrated cloud services in Visual Studio. Now, when user authenticate to the first cloud service in Visual Studio, we will automatically sign in, or reduce the authentication prompts for other integrated cloud services.

CodeLens
With CodeLens, user can find out more about code while staying focused on work in the editor. User can now see the history of C++, SQL, or JavaScript files versioned in Git repositories by using CodeLens file-level indicators. When working with source control in Git and work items in TFS, user can also can get information about the work items associated with C++, SQL, or JavaScript files by using CodeLens file-level work items indicators.

Code Maps
When you user to understand specific dependencies in thier code, visualize them by creating Code Maps. User can then navigate these relationships by using the map, which appears next to code.

Diagnostics Tools
The Diagnostic Tools debugger window has the following improvements:
 1. Supports 64-bit Windows Store apps
 2. The timeline zooms as necessary so the most recent break event is always visible

Exception Settings
User can configure debugger exception settings by using the Exception Settings tool window. The new window is non-modal and includes improved performance, search, and filter capabilities.

JavaScript Editor
The JavaScript editor now provides you with IntelliSense suggestions when passing an object literal to functions documented using JSDoc. User can use the Task List feature to review task comments, such as // TODO, in JavaScript code.

Unit Tests
In Visual Studio 2015 preview, introduced Smart Unit Tests, which explores developer's .NET code to generate test data and a suite of unit tests. Smart Unit Tests enables support for an API that can use to guide test data generation, specify correctness properties of the code under test, and direct the exploration of the code under test.

XAML Language Service
The XAML language service has been rebuilt on top of .NET Compiler Platform so that it can provide you with a fast, reliable, and modern XAML editing experience that includes IntelliSense.

Timeline Tool
The new Timeline tool provides you with a scenario-centric view of the resources that your applications consume, which you can use to inspect, diagnose, and improve the performance of your WPF and Windows Store 8.1 applications.

What's New in .NET Framework 4.6

The following are the new features of the .NET Framework 4.6


64-bit JIT Compiler for managed code
The .NET Framework 4.6 features a new version of the 64-bit JIT compiler. This compiler provides significant performance improvements over the existing 64-bit JIT compiler.

Changes in Base Class Library
There are so many new APIs have been added to this new .NET Framework to enable key scenarios, especially for the Cross-Platform environment. The CultureInfo.CurrentCulture and CultureInfo.CurrentUICulture properties are now read-write rather than read-only. Additional collections implement ReadOnlyCollection<T> such as Queue<T> and Stack<T>. It implement System.Collections.ObjectModel.ReadOnlyCollection, including System.Collections.Generic.Queue and System.Collections.Generic.Stack.

Resizing in Windows Forms controls
The .NET Framework 4.6 expanded some namespaces that enable us to resize Windows Forms forms. This is an opt-in feature.
To enable it, set the EnableWindowsFormsHighDpiAutoResizing element to true in the application configuration (app.config) file.

Support for code page encodings
The core .NET Framework  primarily supports Unicode encodings and by default it provides limited support for code page encodings. We can add support for code page encodings that are available in the .NET Framework but unsupported in .NET Core by registering code page encodings with the Encoding.RegisterProvider method.

Open-source .NET Framework packages
Some great .NET packages such as the Immutable Collections and SIMD APIs are now available, open source, on GitHub. GitHub is a repository that contains the foundation libraries that make up the .NET Core development stack.

Improvements to event tracing
An EventSource object can now be constructed directly and you can call one of the Write() methods to emit a self-describing event.

.Net Native
It is a pre-compilation technology for building and deploying Windows Store apps. It compiles apps that are written in managed code (Like Visual C#) and that target the .NET Framework to native code. It is quite different from Just-In-Time (JIT) as well as the Native Image Generator (NGEN).

Friday, February 27, 2015

RASPBERRY PI

Did you know?
 The Raspberry Pi sprang out of a desire by colleagues at the University of Cambridge’s Computer Laboratory to see a return to the days of kids programming inexpensive computers. The rise of expensive PCs and games consoles put paid to the BBC B, Spectrum and C64 generation of home programmers, leading to applicants for computer studies courses lacking the necessary skills.
The basic concepts behind the Raspberry Pi were to make it as affordable as possible, supply only the basics and provide it with a programming environment and hardware connections for electronics projects. The Pi is a series of credit card-sized single-board computers, which runs a modified version of Linux called Raspian with Wheezy Raspian being the preferred option for newcomers to the device. Raspian runs directly on an SD card and provides a command-line interface for using the operating system.

The original Raspberry Pi and Raspberry Pi 2 are manufactured in several board configurations through licensed manufacturing agreements with Newark element14 (Premier Farnell), RS Components and Egoman.

Fig: Raspberry Pi (Model B)

Programming the Pi
There are two programming languages supplied by default with the Pi: Scratch v1.4 and Python. They both have shortcut icons on the graphical desktop. Scratch was designed by Lifelong Kindergarten Group at the MIT Media Lab as a firststep in programming. It uses tile-based language commands that can be strung together without having to worry about syntax. Commands are split up into easy-to-understand groups and dragged onto the scripting area. Sounds, graphics and animation can be added. Projects can be saved or uploaded to the Scratch website and shared for remixing by other users.
The other language is Python v3.2.3 which starts with a Python Shell. Python is an interpreted language, where commands are read and implemented one line at a time. The high level commands and data structures make it ideal for scripting. The previous version of Python is still quite popular and has more development aids, so is also supplied. The icons for these are IDLE 3 and IDLE, which stands for Integrated Development Language for Python.

The Pi Store
www.store.raspberrypi.com/projects
The Pi Store isn’t just home to apps and tools to help you use your Raspberry Pi. There’s also a selection of home-grown video games to get your teeth into, that are developed by the Raspberry Pi community.