Showing posts with label crosspublished. Show all posts
Showing posts with label crosspublished. Show all posts

9 Feb 2015

Installing an Alternate OS

Why most programmers need an alternate operating system and how you should go about getting one


A few (of the many) Linux Distros


If you are reading this on a laptop or a desktop computer, I can say with 98.98 percent (Courtesy : netmarketshare.com) surety that you are using a version of either the Windows or Mac Operating System

Generally, a single operating system is sufficient for most computer users. But when you are developing software for multiple operating systems, or using your computer for things like making a web server, or running very specific development environments, often one operating system ceases to be enough.

Running more than one operating system on a computer or dual-booting as it is usually called ( or triple-boot, quad-boot, etc, although the word usage is not as common as dual-boot) is actually very simple and easy, but if you fail to follow some basic procedures, you could end up losing your data, or being unable to use even one OS. Even more terrible things, depending on how bad you mess up.

However operating systems need not always be installed. More on virtualization later.
Here are some questions you will most probably have if you are new to installing operating systems :

1) Which OS should I install?

You should install whatever operating system best suits your particular programming requirements. Windows and OSX are generally best suited for app and software development for those platforms.
For most other things, Linux flavours are popular. If you simply want to install a Linux OS, I would personally recommend either Ubuntu or Debian. Both have easy installations, great support bases, lots of software and applications, and a modern UI.

In the end it comes down simply to what best fits your comfort zone. The Mac OS is better suited for programming than Windows. But neither of these are as popular as open-source Linux distros.

2) Is it compulsory to install an OS to use it?

First of all, it is not required for you to actually install an OS on your hard disk to use one. Lots of Linux operating systems let you run operating systems on flash drives and cd’s. Usually this is to let you demo the OS before installing, but with this method you can actually use an entire OS without it installing on your hard drive.

Virtualbox
Almost all operating systems out there can be run by virtualization. What this means is that you use an OS within another OS. There are several great software for doing this, for both Windows and Mac (Also Linux). Virtualbox and VMware (Virtualbox is free) come on the very top of the list.
You can run pretty much any operating system - Android, iOS, Windows, OSX, (Xu/Ku/Edu/Lu/U)buntu, Debian, Fedora, Red Hat - anything as long as your processor supports (hardware) virtualization technology or VT.


Virtualbox can, to a large extent manage on older processors which do not have `VT` enabled, however performance might be low. VMware requires some bypassing commands to do the same.

Anything newer than Intel Pentium or AMD Athlon would probably support VT, but check your processor specifications before trying to run a virtual OS.

3) Are there any precautions I should take before trying to install a new OS.

Yes! As I mentioned before, you might murder your computer by accident when installing an OS, so always take a backup of all you data onto ANOTHER COMPUTER or a HARD DISK.
Before installing any OS, always read the specifications fully, including the version you are planning to install. Check on forums for any complaints people have had when they have tried to install that particular version of that OS on your computer model.

Also its always better to partition your hard drive when you start the installation process. Most Operating Systems allow you to partition your hard drive before installation, but its always better to do it beforehand to ensure nothing goes wrong. It's usually easiest if you use your current OS to partition. If you're on Windows use the Disk Management tool, Disk Utility on Mac, and GParted on Linux.


Never,ever,ever install an OS onto the same partition as another OS. Always take care you select an empty partition during installation.

4) Which installation method should I use?

When you ‘download an OS’ in most cases you are actually downloading an ISO file, or a compressed ISO file. This ISO file can either be burnt to a CD, or to a USB. Its up to you, to choose which. Some old computers may not be able to boot from USB.


Its not just enough MOVING the ISO file to a CD or USB. It must be burnt, so as to make it BOOTABLE.

There are plenty of software for burning ISO files. Here are two free ones, for the lazy and the uninitiated (Disclaimer : Don’t blame me if this causes your computer to explode, or transform into a killer robot)



Boot devices menu in the BIOS 

After you burn the ISO image, insert the USB/Disc. Run the autorun if it has one - it most likely will - or directly proceed to restart your computer. Before your OS loads, on the BIOS screen, hit the key for the boot option menu (Usually f9 on PC’s) and select either USB or CD depending on which your OS is loaded. I bid you smooth sailing.

5) Precautions to take DURING installation

Stating the obvious here - Whenever you are installing a new OS, make sure to keep your computer fully charged and plugged in.

Keep your Internet easily accessible. Always. WiFi is recommended, but Cable will also work. If you use a dongle, try to convert it’s network into a hotspot as the OS you just install maybe unable to use it. Have another computer standing as backup, in case your installation goes boink.

Ensure you have all the files you may need, already downloaded and ready to be booted if required. I personally would recommend downloading the boot repair disk and putting it on either a bootable CD or USB, especially if you are installing Linux.

The boot repair disk can be downloaded here.

The boot repair disk can be booted from directly. It’s main function is to fix GRUB, but it also contains very useful tools, such as GParted the partition editor, as well as an OS-Uninstaller. It can also be used to access the Internet, in case you need some urgent help.

6) What should I do if something goes wrong during the install

Odds are, the install will not go ferpectly the ristf eimt. Maybe there were driver problems. Maybe your computer was not fully compatible with the OS version you tried to install. Maybe you made some other mistakes. Whatever happens, it’s always best if you try the whole install afresh. If you think the operating system has not installed completely or with some defects, use the boot repair disk to uninstall the operating system, format the partition that you installed the OS on, and try again.
In case of a failed install, Purge, Cleanse and Start over!

7) The OS has been installed. Now what?

So all the installation is done. Check if everything is functioning as it should. The only tests you need to run, are with the hardware. Just make sure all your hardware components - speakers, keyboard, touchpad/mouse, camera, ports - are all functioning correctly. If there is a problem with anything, try looking on forums if you're experiencing a known issue with the OS. More likely than not, the drivers will need to be updated, and once this is done, your new OS will be ready.

Also ensure your multi-boot screen is functioning correctly. ( This will be GRUB if you have any linux versions installed ) The boot repair disk can fix most issues with GRUB. If you have installed Windows freshly, GRUB may not be accessible during startup and you will directly boot Windows. Again, the boot repair disk can fix this issue.

The Grand Unified Bootloader
Aah, the satisfaction of using a freshly installed OS
Some General tips for Linux : Start using the terminal for even basic things. That way you'll get the hang of it. Install updates, as soon as you get your system up and running.

General tips for Ubuntu : Click Here for a quick list of things to do immediately after you install Ubuntu.

This post is crosspublished on my blog, The New Age Tech Connoisseur
Go forth and conquer!

14 Dec 2014

The Future of Web Development




The stuff that dreams of are made of ” ~ The Maltese Falcon
Web Development is a fast paced, highly competitive and creative field. Commonly, there are two big parts to any web-based thingy. The front end, where the pretty stuff is. This falls under web design. Then we have the back end, where all the heavy machinery nestle. Technically only the back end falls under web development, but one cannot describe a house, without showing where the front door is. In this article I have tried to collect the views of the people working behind in the concepts discussed, from many web posts. At the bottom, are a few resources you can look at if you are interested.

Going a little into the annals of computer history, we find that the Internet, despite growing rapidly, did not grow in chaos. It was developed layer by layer, each step taken in a logical sequence. The development of the Internet, began with the creation of efficient data transfer systems. With the creation of the World Wide Web, came the key components of our present Internet - the web browser and the web page.

Sir Tim Berners Lee (All Hail!) also created the Hypertext Markup Language - HTML - along with the web. The first few versions of HTML were, to put it in a nice way, severely lacking. If it weren't for CSS, the Internet would be ugly.


Web Apps will dominate the market

Across the world, there is great belief that web based applications will be the future - of not just the web - but also smartphone and desktop apps. The arguments put forth for proclaiming web apps as the next conquerors are quite simple. Web-browser based applications are easy to create - they primarily use the languages and technologies used to build regular websites - and will run on a multitude of platforms with just some minor adjustments. Today, with the rise of several mobile and desktop operating systems, each with their own system type, each with their own specific set of programming languages to develop with, more and more people (developers to be precise) are clamoring for a unified technology that allows one to build an app once, and get it to work everywhere. Putting it all together, the general idea, is that why not make applications which are run by a web browser as opposed to them being run directly by an operating system - To create what is quintessentially an operating system which is run on top of another operating system.

Oh if it were only so simple ~ Aleksandr Solzhenitsyn

Unfortunately, the world functions in mysterious ways. Or in this case, in very clearly defined, but still mind-numbing ways. There are a host of problems in such a model. If one were to make a list, of all the hurdles we would need to cross to implement this idea fully, topping that list would be Performance.

Native apps (Normal apps run by the operating system directly) are able change a variety of system settings in order to fit in exactly, so as to utilise as less system resources as possible, and yet function smoothly and give a rich user experience. Currently while it is possible to some degree to create an app that can run on a particular browser, with some effort on all browsers, and maybe with a lot more effort on all browsers on all mobile and desktop OS’s (The time, human drudgery and expertise required will be high), such an app, will not be able to run nearly as well as a native app.


Google is spearheading the effort to integrate web and system apps, into a hybrid environment where BOTH native and web apps are treated on an equal level. It has designed an entire javascript based framework called Polymer (Explained later in this article) for the development of web apps, as well as another javascript based framework, Angular.js for the front end of web applications.

Here is a more detailed and well explained article regarding Google and Web applications : The future of the web according to Google


Flash of Death

RIP Flash

One thing anyone can say for sure, looking at the present scenario, is that Flash will be driven to extinction. In 2010, Apple sounded the death knell for Flash by making iPads and iPhones incompatible with Flash. Google followed, and all versions of Android past ICS, do not offer any native Flash support. However HTML 5 is not replacing Flash at a rate which would be expected. Presently most browsers offer only limited compatibility with HTML 5, despite it being having more performance benefits. The vast majority of video streaming sites use Flash player, rather than HTML5 based solutions. Even Youtube, still uses Flash Player, although it’s rapidly going HTML. It looks like Flash is not going to go down without a fight.


Javascript is the Future - JQuery, Node.js, Angular.js, Polymer.js

It looks like Javascript will be the Most-Wanted-Language of the next phase of the Internet. Javascript is currently the most used client-side scripting language. JQuery, a javascript library, is widely used for interaction and animation. Now, with the rise of several pioneer projects all based on javascript, javascript is set to be the true programming language of the web.

I will go a bit into scripting languages here. All interactive, motile parts of a website or web app (barring hyperlinks and css effects) are powered by scripts. There is more than one way to skin the proverbial cat, and web-developers use mainly two different techniques to run scripts.

<Warning> Textbook definitions up ahead!

Scripts can be run client-side, meaning your device takes instructions from a piece of code, and processes data accordingly. Client-side scripting languages mainly include javascript, VBscript, and flash - Honestly flash is just for games - a measly 12% according to w3techs. The other way of running scripts is from the server, where everything you feed to a website or app (location, clicks, hovers, text-entry) is sent to a server, where a server-side language, such as php or asp.net (by Microsoft) or python processes it, and sends data back to your device. The vast majority of websites use client-side and server-side scripts in tandem for maximum efficiency, security and speed.

Node.js

In 2009, we witnessed the birth of Node.js, a server side scripting language based on Javascript. Node.js is being showcased as the successor the world’s most widely used server side language PHP. It is possible to dismiss this as an absurd notion if we consider the vastness of php in terms of market-share, but we must keep in mind that Node.js is a very new language, and very efficient and light as compared to php. Linkedin does the back end of it’s mobile apps using Node.js. Paypal (Gasp!) uses Node.js, and so do all these guys. What is most important of all, is that Node.js is getting developers hooked.

Node.js

Angular.js

Let me start off the introduction to Angular.js with this picture :


That’s the story, in a nutshell. Angular is designed for dynamic views, the way HTML was designed for static pages. Angular is already insanely popular. Just head over to the homepage to start a simple tutorial right within your browser (Link below). Angular depends completely on your knowledge of javascript and HTML, and it allows for the creation of remarkable interfaces and functions for web apps. Angular provides pretty much the best framework for developing web apps right now, be it interfaces, services or communication with servers.

Polymer.js

Polymer is another project by Google, and it is, I have mentioned before, made for building web aplication components. Polymer is a new language that is still very much in development - I forgot to mention earlier, that it was launched in 2013. Polymer basically helps in building components, which together work to form a web app, or can directly be used in websites as modules for extra functionality. While Polymer is a great concept, it is still looks like it’s way ahead of it’s time.
An article sounding alarm bells for Polymer : Is Polymer.js the future of web application development?

On a final note, I would like to remind you that Polymer’s dependencies, although non-existent in the present, are already being made and standardized. Polymer uses several powerful features of HTML5 not yet approved by the W3C, but hopefully, Polymer will succeed.

Back to Javascript

So I just listed three amazing javascript-based projects, all of which seem set to play a big part in next-gen web development. Now javascript-based here means a keen background knowldege of javascript, along with HTML and CSS will be required to do anything serious.
One last thing about javascript - Khan Academy’s programming tracks are largely javascript-centred too. The Hour of Code movement teaches js (A skinned version) along with a few other languages.

CMS (Content-Management Systems) on the rise

A rather small, but interesting thing to note is that the use of content management systems is on the rise. A CMS is generally used when there are large amounts of data to be posted on a website, or a large number of users post data to a website. Most blogging platforms like Wordpress, Weebly and Blogger use CMS, along with e-commerce sites which use specialized CMS’s such as Magento. If you want to use a CMS for your website (not one that is on a blogging platform) Drupal is highly recommended, as it is open source.

Conclusion

The Web is now a shining beacon for all other fields of computer technology. Some of the greatest people in the field of technology and programming are developing for the web. There is a lot of room for ideas, and is a great area to point one’s computer skills at. If you are interested web development, now is a great time to get creative. Check out the resources page of the KHMD blog for some general resources pertaining to web development. Below are some resources specifically regarding the technologies discussed in this article.

This article is crosspublished on my super-duper blog, The New Age Tech Connoisseur. Check it out for some more articles.

Thanks to Gautam Padiyar for all the ideas.

Resources

Before you start anything, head over to the homepages of these great projects. They give links to great learning resources, as well as lots of info concerning how why that project is really useful




Enlightening posts


  • Rey Bango’s Post on how to create basic elements in Polymer.
  • Angular and Polymer are very very similar. Here’s a post laying out the differences : Polymer vs. Angular

Here are a few links to detailed lists of great goodies


  • Node Cloud This website contains all the possible resources you will ever need to get started with Node.js, including details of different frameworks and IDE’s.
  • Github list of Angular JS Resources From what I infer after opening a fraction of the links to resources provided here - and they are great ones too - is if you want to begin with Angular Js, visit this page.



10 Dec 2014

Negabinary

Thought you knew all there is to know about number systems? Well, here's something new to that list - Negabinary numbers. These are numbers that are written to the base -2 (negative two). What's so great about these numbers? There is no need to put any + or - to denote whether it is a positive number or not. Let's check these numbers out.

The normal way a number is defined, works here as well. There are "b" number of digits in a number system of base "b". Here, we just have to change the definition to: there are "|b|" number of digits in a number system of base "b". The definition works perfectly after that. Then, we can just use the following equation:


Using this we can thus generate the first few numbers (0, 1, 2, 3, 4, 5...) in negabinary: 0, 1, 110, 111, 100, 101... (Sequence A039724 on Online Encyclopedia of Integer Sequences (OEIS)) where 0 and 1 have usual face values.

How do we convert a number to this base then? Write the number down in binary first. Then, going from right to left, at every odd place (i.e. x1, x3, x5 ...), if the bit is one, propagate a carry to the next bit. Also, while moving from right to left, add all the carries.

For example:

To convert 15 to negabinary:
  1. Convert 15 to binary
    • 15decimal=1111binary
  2. Propagate from right to left
    • 1111
    • 1111
    • 1211
    • 2011
    • 2011
    • 10011
    • 10011
    • 10011negabinary
  3. Done! (This is correct since 16-0+0-2+1 = 15)
Conversion to decimal (or any other base) just uses the original formula.

Addition is kinda done the way conversion is done, except that carries are propagated (one bit extra to the left, since 2negabinary = 110).

We can similarly define the other operations as well.

Let's take this onto another level itself: how about a number system that takes care of complex numbers as well (as digit strings)? I leave that upto you to figure out and comment about.

PS: This post is cross published on my blog http://jaybosamiya.blogspot.in/2014/10/negabinary.html