Wednesday, 7 December 2016

Complexity: What is the most complicated thing ever?

Do you think a Rubik’s cube is the most complicated mechanical puzzle ever invented? You have no idea how complicated mechanical puzzles can be.

A Standard 3x3x3 Rubik’s cube can have 43,252,003,274,489,856,000 combinations, but only 1 solution.






To put this into perspective, if we have one Rubik’s cube for each possible combination, then all the cubes will cover the whole surface of 275 earth-sized planets. and among all of them, only 1 cube will be in perfectly solved state.

But for some people, this was not complicated enough. they created 4x4x4 cubes, and also 5x5x5 cubes.

A 4x4x4 cube has 7401196841564901869874093974498574336000000000 combinations. If you have that many teaspoons of sugar, it will fill a sphere the size of the solar system 3.5 times over.

a 5x5x5 Rubik’s cube has 282870942277741856536180333107150328293127731985672134721536000000000000000 combinations, this is close to number of atoms in the known universe. and yet, people can solve it within few minutes.

So, some people though it was not complicated enough, they created this monster:

Say hello to 11x11x11 cube.




Is it world’s most complicated cube? Nope. The largest cube ever made is 17x17x17. Having a total combination of 66.9 * 10^1053. This number is so huge it’s digits can not even be written in here.

Yet, someone solved this thing in 7.5 hours. (reference link below).

Are Rubik’s cubes are the most complicated puzzle ever? Nope! Lets meet Minxes.

Minxes are like Rubik’s cube, but with more than 6 sides. Having more sides also makes them more complicated.

This is a 3x3x3 Megaminx. It has 12 faces and total 50 moving parts, whereas the Rubik’s cube has only 6 faces and 20 moving parts.




A 3x3x3 megaminx has 100669616553523347122516032313645505168688116411019768627200000000000 combinations, i.e. 1000 billion billion (yes there are two billions) more times than a 4x4x4 rubics cube.

The world record for fastest megaminx solving is 37.58 seconds.

Still not complex enough? meet the Gigaminx, with a 5x5x5 structure, the Teraminx with 7x7x7 structure and the Examinx, with 9x9x9 structure.
And this is how it looks when scrambled.




The combinations possible with a Examinx is not worth calculating…

But wait.

Someone has made a Yotaminx, a minx with 15x15x15 structure.

Not sure if anyone was able to solve it or not.




And for people with nerve of steel, here is a Tuttaminx (Thanks Shrey Gadiya for the reference) with 32 faces and 150 movable parts.



If you scramble this, it looks like this




After seeing all these, if you think a puzzle can not be more complicated than a Tuttaminx, you are wrong!

Multiple Minxes can be fused together to form a combined minx. Here is a triple fused Petaminx



These puzzles have no practical use for mortals. Although in Hell, they may ask you to solve one.

Update: as mentioned by Digvijay Pr , there are Shape shifting puzzles with non-linear movements as well, like the Ghost cube.



This is how it looks when scrambled, Goodbye brain



Due to each piece being of a different shape, this puzzle is notoriously difficult to solve. Unlike a Rubik’s cube the movements of the pieces are restricted due to their shape, so it’s very difficult to mathematically calculate the number of possible moves with this one.

Update 2: If your brain is still not fried, let’s meet Sudoku cube, as suggested by Gourab Chowdhury.

The Sudoku Cube or is a variation on a Rubik's Cube in which the faces have numbers one to nine on the sides instead of colours. The aim is to solve Sudoku puzzles on one or more of the sides.

In the Sudoku Cube, the player must place the numbers one to nine on each side with no repetition.

This cube is one of the most difficult of all the cubes, because as well as having to know the basic cubes concepts you also have to know basic sudoku concepts, and unlike normal sudoku any turn of the cube can wipe out work you just did.



What makes this more complicated than a normal Rubik’s cube is unlike a normal colored Rubik’s cube, there is no way to identify which piece originally belonged to which side !!!

Look how confusing a Sudoku cube can make you when it is scrambled. Not only you have no idea to which side the numbers actually belong, but they are also tilted, rotated and can become completely upside down.



So, this must be the most complicated puzzle right? because it has the combined evil nature of both Rubik’s cube and Sudoku…

I also thought so, until I saw this guy… which has 81 numbers each side compared to just 9 of a regular Sudoku cube



R.I.P brain :-(

Update 3: Some friends have asked how to calculate the total number of combinations possible with a cube. Here is the mathematical formula as taken from Welcome to speedcubing.com! [see reference 3]. In the below formula, n is the number of pieces each side. for a 3x3x3 cube, n = 3



Thanks for reading don't forget to follow.

Tuesday, 1 November 2016

C Programming Tutorials

10 Reasons : Why should we use Linux?


Bored using windows or any other server in your computing experience? Linux has been designed to offer you smooth and effective experience. Whether you want to use it for business or any other home operations, Linux offers the most reliable system to adopt. Linux has become one of the most adopted systems by many users in and around the world. Most of the world’s largest data centers across the globe use Linux. There are various reasons that answer why should we use Linux, keep on reading.

Why Should we use Linux?

 1. Linux is free of charge and in case you still doubt, then know that it is.

In case you want to get rid of all the restrictions in terms of patents of any other form of restriction, then this would be the best switch for you. Linux can be edited in terms of the source code by most of the innovative business owners. It is, therefore, the best system to be adopted by a large number of business owners who want to simplify their business operations.


2. Linux is more secure than any other server

Linux is a dependable server that offers excellent security to the user. Linux community offers the security fixes for any technical or security threat that encounters. Moreover, Linux users also offer regular kernel updates and regular security patches. In this regard, it is not mandatory for you to have an anti-virus program for your system. With Linux, you can save a lot of dollars you could have spent buying an antivirus program.

3. It has a wide compatibility to several hardware.

 Most of the other servers do constraint you with a lot of features. Take for instance windows 7 and 8 do require at least 1GB RAM for your system to operate well. However, Linux is such a lightweight operating system and hence does not constrain you in terms of a memory capacity of your system. It can thus be used by any of your systems. It is designed for everyone and can be used by anyone.

 4. Easy to Operate

Ideally, one does not have to go for intensive training for them to know how to operate Linux operating system. Besides, it comes with all the necessary functionality that is included in windows OS. If you are looking for a system that is reliable and can be used by anyone in your business, then this could be the best system to adopt.

5. It comes inclusive of drivers

Ever experienced some difficulties when using windows only to be told that some of the drivers are missing in your system? Linux saves you a time you have to spend moving from one shop to another for drivers. It saves you money as well. Most of the drivers are included in Linux operating system. No need to hassle and stress for drivers.

6. Smooth and easy Updating Process

Updating windows can be very challenging and stressful. Linux updates both the OS and the applications that are installed in your system. Besides, when compared to windows that need your system to shut down Linux updates are just a matter of click.

7. Linux is speedy

Since Linux is lightweight, it is therefore far much speedy compared to any other operating system. Windows has a bloated software and therefore huge to operate. In any business operation or gaming experience, time is the most crucial factor. Linux is the best system to adopt as windows get slower days after days.

8. Linux has a community support

One of the best things about Linux is the fact that you have a sense of belonging. You have a platform where you can share everything with fellow users. You get to know more through the frequently asked questions. Moreover, any question that you have can be dropped and get the answers that you need.

9. Linux features a powerful word processing program

Libre Office is a powerful word processing program that comes with Linux. You can use it for free in editing, opening and send Microsoft documents. You, therefore, save more and more dollars you could spend buying such a program.

10. Linux offers you a chance to download a lot of free tools

By just a click of a button, you can get access to thousands of tools and programs. This is a big added advantage over the windows operating system. It is the best way to transform your serving experience.


Monday, 31 October 2016

C Programming Tutorial 9 for loop

C Programming Tutorial 1 Introduction

Top 5 Programming Languages thats gives you fat salaries.



C Language

C (/ˈsiː/, as in the letter c) is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, including operating systems, as well as various application software for computers ranging from supercomputers to embedded systems.

C was originally developed by Dennis Ritchie between 1969 and 1973 at Bell Labs,[5] and used to re-implement the Unix operating system.[6] It has since become one of the most widely used programming languages of all time,[7][8] with C compilers from various vendors available for the majority of existing computer architectures and operating systems. C has been standardized by the American National Standards Institute (ANSI) since 1989 (see ANSI C) and subsequently by the International Organization for Standardization (ISO).

Java

"Java language" redirects here. For the natural language from the Indonesian island of Java, see Javanese language.
This article is about a programming language. For the software package downloaded from java.com, see Java SE.
Not to be confused with JavaScript.
Java Java programming language logo.svg
Paradigm     Multi-paradigm: Object-oriented (class-based), structured, imperative, generic, reflective, concurrent
Designed by     James Gosling
Developer     Sun Microsystems (now owned by Oracle Corporation)
First appeared     May 23, 1995; 21 years ago[1]
Typing discipline     Static, strong, safe, nominative, manifest
License     GNU General Public License, Java Community Process
Filename extensions     .java , .class, .jar
Website     www.oracle.com/java/
Major implementations
OpenJDK, GNU Compiler for Java (GCJ), many others
Dialects
Generic Java, Pizza
Influenced by
Ada 83, C++,[2] C#,[3] Eiffel,[4] Generic Java, Mesa,[5] Modula-3,[6] Oberon,[7] Objective-C,[8] UCSD Pascal,[9][10] Object Pascal[11]
Influenced
Ada 2005, BeanShell, C#, Chapel,[12] Clojure, ECMAScript, Fantom, Groovy, Hack,[13] Haxe, J#, JavaScript, Kotlin, PHP, Python, Scala, Seed7, Vala

    Java Programming at Wikibooks

Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented,[14] and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA),[15] meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.[16] Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. As of 2016, Java is one of the most popular programming languages in use,[17][18][19][20] particularly for client-server web applications, with a reported 9 million developers.[21] Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.

The original and reference implementation Java compilers, virtual machines, and class libraries were originally released by Sun under proprietary licences. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java (bytecode compiler), GNU Classpath (standard libraries), and IcedTea-Web (browser plugin for applets).

The latest version is Java 8, which is the only version currently supported for free by Oracle, although earlier versions are supported both by Oracle and other companies on a commercial basis.

 C++

C++ (pronounced cee plus plus, /ˈsiː plʌs plʌs/) is a general-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation.

It was designed with a bias toward system programming and embedded, resource-constrained and large systems, with performance, efficiency and flexibility of use as its design highlights.[5] C++ has also been found useful in many other contexts, with key strengths being software infrastructure and resource-constrained applications,[5] including desktop applications, servers (e.g. e-commerce, web search or SQL servers), and performance-critical applications (e.g. telephone switches or space probes).[6] C++ is a compiled language, with implementations of it available on many platforms and provided by various organizations, including the Free Software Foundation (FSF's GCC), LLVM, Microsoft, Intel and IBM.

C++ is standardized by the International Organization for Standardization (ISO), with the latest standard version ratified and published by ISO in December 2014 as ISO/IEC 14882:2014 (informally known as C++14).[7] The C++ programming language was initially standardized in 1998 as ISO/IEC 14882:1998, which was then amended by the C++03, ISO/IEC 14882:2003, standard. The current C++14 standard supersedes these and C++11, with new features and an enlarged standard library. Before the initial standardization in 1998, C++ was developed by Bjarne Stroustrup at Bell Labs since 1979, as an extension of the C language as he wanted an efficient and flexible language similar to C, which also provided high-level features for program organization.

Many other programming languages have been influenced by C++, including C#, D, Java, and newer versions of C (after 1998). 

Python

Python is a widely used high-level, general-purpose, interpreted, dynamic programming language.[24][25] Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than possible in languages such as C++ or Java.[26][27] The language provides constructs intended to enable writing clear programs on both a small and large scale.[28]

Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library.[29]

Python interpreters are available for many operating systems, allowing Python code to run on a wide variety of systems. Using third-party tools, such as Py2exe or Pyinstaller,[30] Python code can be packaged into stand-alone executable programs for some of the most popular operating systems, so Python-based software can be distributed to, and used on, those environments with no need to install a Python interpreter.

CPython, the reference implementation of Python, is free and open-source software and has a community-based development model, as do nearly all of its variant implementations. CPython is managed by the non-profit Python Software Foundation. 

Hadoop

Apache Hadoop (pronunciation: /həˈduːp/) is an open-source software framework for distributed storage and distributed processing of very large data sets on computer clusters built from commodity hardware. All the modules in Hadoop are designed with a fundamental assumption that hardware failures are common and should be automatically handled by the framework.[2]

The core of Apache Hadoop consists of a storage part, known as Hadoop Distributed File System (HDFS), and a processing part called MapReduce. Hadoop splits files into large blocks and distributes them across nodes in a cluster. To process data, Hadoop transfers packaged code for nodes to process in parallel based on the data that needs to be processed. This approach takes advantage of data locality[3] – nodes manipulating the data they have access to – to allow the dataset to be processed faster and more efficiently than it would be in a more conventional supercomputer architecture that relies on a parallel file system where computation and data are distributed via high-speed networking.[4]

The base Apache Hadoop framework is composed of the following modules:

    Hadoop Common – contains libraries and utilities needed by other Hadoop modules;
    Hadoop Distributed File System (HDFS) – a distributed file-system that stores data on commodity machines, providing very high aggregate bandwidth across the cluster;
    Hadoop YARN – a resource-management platform responsible for managing computing resources in clusters and using them for scheduling of users' applications;[5][6] and
    Hadoop MapReduce – an implementation of the MapReduce programming model for large scale data processing.

The term Hadoop has come to refer not just to the base modules above, but also to the ecosystem,[7] or collection of additional software packages that can be installed on top of or alongside Hadoop, such as Apache Pig, Apache Hive, Apache HBase, Apache Phoenix, Apache Spark, Apache ZooKeeper, Cloudera Impala, Apache Flume, Apache Sqoop, Apache Oozie, Apache Storm.[8]

Apache Hadoop's MapReduce and HDFS components were inspired by Google papers on their MapReduce and Google File System.[9]

The Hadoop framework itself is mostly written in the Java programming language, with some native code in C and command line utilities written as shell scripts. Though MapReduce Java code is common, any programming language can be used with "Hadoop Streaming" to implement the "map" and "reduce" parts of the user's program.[10] Other projects in the Hadoop ecosystem expose richer user interfaces.

 

Top 5 Programming Languages thats gives you fat salaries.



C Language

C (/ˈsiː/, as in the letter c) is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, including operating systems, as well as various application software for computers ranging from supercomputers to embedded systems.

C was originally developed by Dennis Ritchie between 1969 and 1973 at Bell Labs,[5] and used to re-implement the Unix operating system.[6] It has since become one of the most widely used programming languages of all time,[7][8] with C compilers from various vendors available for the majority of existing computer architectures and operating systems. C has been standardized by the American National Standards Institute (ANSI) since 1989 (see ANSI C) and subsequently by the International Organization for Standardization (ISO).

Java

"Java language" redirects here. For the natural language from the Indonesian island of Java, see Javanese language.
This article is about a programming language. For the software package downloaded from java.com, see Java SE.
Not to be confused with JavaScript.
Java Java programming language logo.svg
Paradigm     Multi-paradigm: Object-oriented (class-based), structured, imperative, generic, reflective, concurrent
Designed by     James Gosling
Developer     Sun Microsystems (now owned by Oracle Corporation)
First appeared     May 23, 1995; 21 years ago[1]
Typing discipline     Static, strong, safe, nominative, manifest
License     GNU General Public License, Java Community Process
Filename extensions     .java , .class, .jar
Website     www.oracle.com/java/
Major implementations
OpenJDK, GNU Compiler for Java (GCJ), many others
Dialects
Generic Java, Pizza
Influenced by
Ada 83, C++,[2] C#,[3] Eiffel,[4] Generic Java, Mesa,[5] Modula-3,[6] Oberon,[7] Objective-C,[8] UCSD Pascal,[9][10] Object Pascal[11]
Influenced
Ada 2005, BeanShell, C#, Chapel,[12] Clojure, ECMAScript, Fantom, Groovy, Hack,[13] Haxe, J#, JavaScript, Kotlin, PHP, Python, Scala, Seed7, Vala

    Java Programming at Wikibooks

Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented,[14] and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA),[15] meaning that compiled Java code can run on all platforms that support Java without the need for recompilation.[16] Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of computer architecture. As of 2016, Java is one of the most popular programming languages in use,[17][18][19][20] particularly for client-server web applications, with a reported 9 million developers.[21] Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.

The original and reference implementation Java compilers, virtual machines, and class libraries were originally released by Sun under proprietary licences. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java (bytecode compiler), GNU Classpath (standard libraries), and IcedTea-Web (browser plugin for applets).

The latest version is Java 8, which is the only version currently supported for free by Oracle, although earlier versions are supported both by Oracle and other companies on a commercial basis.

 C++

C++ (pronounced cee plus plus, /ˈsiː plʌs plʌs/) is a general-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation.

It was designed with a bias toward system programming and embedded, resource-constrained and large systems, with performance, efficiency and flexibility of use as its design highlights.[5] C++ has also been found useful in many other contexts, with key strengths being software infrastructure and resource-constrained applications,[5] including desktop applications, servers (e.g. e-commerce, web search or SQL servers), and performance-critical applications (e.g. telephone switches or space probes).[6] C++ is a compiled language, with implementations of it available on many platforms and provided by various organizations, including the Free Software Foundation (FSF's GCC), LLVM, Microsoft, Intel and IBM.

C++ is standardized by the International Organization for Standardization (ISO), with the latest standard version ratified and published by ISO in December 2014 as ISO/IEC 14882:2014 (informally known as C++14).[7] The C++ programming language was initially standardized in 1998 as ISO/IEC 14882:1998, which was then amended by the C++03, ISO/IEC 14882:2003, standard. The current C++14 standard supersedes these and C++11, with new features and an enlarged standard library. Before the initial standardization in 1998, C++ was developed by Bjarne Stroustrup at Bell Labs since 1979, as an extension of the C language as he wanted an efficient and flexible language similar to C, which also provided high-level features for program organization.

Many other programming languages have been influenced by C++, including C#, D, Java, and newer versions of C (after 1998). 

Python

Python is a widely used high-level, general-purpose, interpreted, dynamic programming language.[24][25] Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than possible in languages such as C++ or Java.[26][27] The language provides constructs intended to enable writing clear programs on both a small and large scale.[28]

Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library.[29]

Python interpreters are available for many operating systems, allowing Python code to run on a wide variety of systems. Using third-party tools, such as Py2exe or Pyinstaller,[30] Python code can be packaged into stand-alone executable programs for some of the most popular operating systems, so Python-based software can be distributed to, and used on, those environments with no need to install a Python interpreter.

CPython, the reference implementation of Python, is free and open-source software and has a community-based development model, as do nearly all of its variant implementations. CPython is managed by the non-profit Python Software Foundation. 

Hadoop

Apache Hadoop (pronunciation: /həˈduːp/) is an open-source software framework for distributed storage and distributed processing of very large data sets on computer clusters built from commodity hardware. All the modules in Hadoop are designed with a fundamental assumption that hardware failures are common and should be automatically handled by the framework.[2]

The core of Apache Hadoop consists of a storage part, known as Hadoop Distributed File System (HDFS), and a processing part called MapReduce. Hadoop splits files into large blocks and distributes them across nodes in a cluster. To process data, Hadoop transfers packaged code for nodes to process in parallel based on the data that needs to be processed. This approach takes advantage of data locality[3] – nodes manipulating the data they have access to – to allow the dataset to be processed faster and more efficiently than it would be in a more conventional supercomputer architecture that relies on a parallel file system where computation and data are distributed via high-speed networking.[4]

The base Apache Hadoop framework is composed of the following modules:

    Hadoop Common – contains libraries and utilities needed by other Hadoop modules;
    Hadoop Distributed File System (HDFS) – a distributed file-system that stores data on commodity machines, providing very high aggregate bandwidth across the cluster;
    Hadoop YARN – a resource-management platform responsible for managing computing resources in clusters and using them for scheduling of users' applications;[5][6] and
    Hadoop MapReduce – an implementation of the MapReduce programming model for large scale data processing.

The term Hadoop has come to refer not just to the base modules above, but also to the ecosystem,[7] or collection of additional software packages that can be installed on top of or alongside Hadoop, such as Apache Pig, Apache Hive, Apache HBase, Apache Phoenix, Apache Spark, Apache ZooKeeper, Cloudera Impala, Apache Flume, Apache Sqoop, Apache Oozie, Apache Storm.[8]

Apache Hadoop's MapReduce and HDFS components were inspired by Google papers on their MapReduce and Google File System.[9]

The Hadoop framework itself is mostly written in the Java programming language, with some native code in C and command line utilities written as shell scripts. Though MapReduce Java code is common, any programming language can be used with "Hadoop Streaming" to implement the "map" and "reduce" parts of the user's program.[10] Other projects in the Hadoop ecosystem expose richer user interfaces.