Sunday, August 21, 2016

Trying out ReactJS

This week I tried ReactJS. I was super exited to learn React with it's one way data-bindings. As I learned from couple of videos, React can be used with or without Babel ( a compiler) .

 I chose to use Babel as it gives a cleaner syntax.I found that much to my dismay, setting up Babel with Webpack was hard. I copied configs from over the net and finally succeed in setting up Babel + Webpack + React.

Finally I tried a sample project(link) to learn react. I ended up with hitting on obstacles after obstacles. One which I found very annoying was that when React failed it gave no errors, no display. Maybe chrome does provide errors but Firefox certainly didn't. Another snag was that Firefox react-Dev tools add-on has a memory leak which I found out after Firefox consumed 2GB ram and system got stuck.

I foolishly stumbled upon the dark because of ajax. Ajax requests updated the state objects after rendering but because I used mutable objects, React didn't recognize the change and re-render. I had to use jquery because I didn't want to try too many things at once .

Anyway I finished my project at last and I am satisfied with it. The code is a jumbled mess certainly but it works well enough. I haven't learned flux or redux or router or other things related to react, so I have a lot to learn. I think the React syntax is easy to learn and because it's javascript easy to implement. In my opinion I like React better than Angular from the looks of it.

Yesterday I tried for a SASS+Babel + React + Dev-server webpack config. And it was worse than just trying for react. As webpack only recognize javascript entry files I have to include a require statement in js to import css or sass. Though I got it to work after a couple of hours.

Friday, August 19, 2016

Text Editors vs familiarity

As I was trying Vim, I was frustrated to figure out that Vim has lousy keyboard bindings.

    1. Vim doesn't support some keybindings such as Ctrl + /

    2. Vim doesn't offer Tab completion for autocompletion + emmet like Sublime or Atom.

Which I think is because the plugins conflict with each other. Therefor I was interested to find if Vim competitor Emacs offered it. I spend the last day and a half trying to wrestle Emacs but alas Emacs also fails.

Though it was futile in the end I learned something profound about text-editors.
Even though I disliked the theme I used for emacs at first, when I went back to Vim, Vim suddenly looked strange.

Vim                       ---------------                Emacs

 Many have debated about merits of text editors, Vim and emacs being the most heated argument. They claim that some editors are more efficient and powerful.
While I agree that some may be more powerful ( more than Notepad :-) ), I don't think they have a huge impact on efficiency.
The familiarity is the key here. The more familiar you are with a particular editor, more efficient you become.
 And in the context of web development I think Atom,Sublime Text, Brackets have the same practical capabilities as Vim or Emacs. In other situations they may have a slight or huge advantages but not in Web development.

PS: I was a utter failure at figuring out emacs. It was more harder than Vim configuration. I was surprised as I thought emacs would be easier.
And yes emacs have better keybinding support than Vim.


Monday, August 15, 2016

Vim - A old school text editor

I have been using Atom as my editor for the last 6 months. It was easy and it has lots of plugins for lots of functionality. And it is open source. But I have found it takes a lot of memory , so the computer becomes sluggish when opening a couple of browsers.

So I tried Vim as a replacement for Atom. I had heard it was lightweight and fast. And it is. But it don't have much functionality out of the box. Installing themes and correcting colors was frustratingly difficult. The shortcuts are different from Atom. And you need to spend literally days to optimize Vim to your standards.

Still, yesterday I wanted to create a new snippet, but found that it didn't work with emmet for whatever reason. So I installed snipmate.vim and tried to create a new snippet. "Tried" being the keyword here. After spending an hour trying this I finally realized you have to use hard tabs instead of spaces in the snippets file. I know , I should have read the manual first. But it was very easy in Atom and keybindings were more streamlined, not a jumbled mess as with my Vim setup.

So here is my Vim setup.
It looks cool and now I am addicted to the new interface. I use a bunch of different plugins : -
                Vim-plug , Emmet, lightline, Nerdtree , ctrlp , CSExactColors , And bunch of themes.

Anyway Vim works alright overall,  and I will try it until I would be fed up with it. :)

 

Tuesday, January 12, 2016

Arch Linux

What is Arch Linux?

arch_linux_wallpaper_by_wavering_radiant-d6ivbsy
Arch Linux is another member of the Linux distro family.  Today We will see what’s special about Arch Linux.
  • Installation
The installation process is fairly complex (relative to Ubuntu ) and without a GUI installer.  It also requires a live Internet connection which might be problematic to some people. If you use a Live CD to install Arch Linux you would get a simple command line with basic  tools to install Arch Linux . It is up to the user to manually install all the required applications, desktop environment etc.
  • Customization
Arch Linux is famous for it’s customization ability. It allows the user to customize nearly everything  in a relatively pain-free manner.
  • Rolling Release
Arch Linux is a rolling release distro. Which means Arch Linux uses the newest packages and  you can upgrade the packages easily through pacman ( Arch Linux Package manager).  Therefor you don’t have to reinstall every few months to obtain the newest version as in Ubuntu.
  • AUR
One of the main selling points of Arch Linux is the Arch User Repositories. They are user managed packages as the name implies. Arch uses a system which allows the end user to install these AUR packages easily without messing with make files or installation scripts.

The reason some people ( including me ) choose Arch Linux is that it allows the user to learn the intricacies of a Linux system such as bash , configuration files, networking etc.

You can find a good guide on how to install Arch Linux here.

Saturday, September 19, 2015

Android OS



Android OS has become the most popular mobile os in the past couple  of years.  Most of the mobiles in today's market have android installed on it.

Android apps

Android has the largest number of apps available for a mobile os.  It has over 1,400,0000 apps available.  You can download  them through google appstore in your device .

Customization

Android is an open source os (branched from linux kernel) . Thus it offers easy customization for  developers and users . It is the most customizable os with various themes,  launchers,  widgets.

Multi tasking

Latest Android os has multi threading and multi tasking built into it.  Android offers better support than IOS and Windows mobile.

Performance

With the introduction of android runtime and new technologies Android's performance is better than ever.  Though it is still a bit slower than windows or IOS you wouldn't find noticible differences in newer models.

Android OS is being used in various devices including phones,  tabs, pcs.


Friday, September 18, 2015

Public key encryption


What's public key encryption?
Public key encryption is a type of asymmetric cryptogrpahy.An asymetric cryptography or encryption requires different methods to encode and decode the data.
In public key encryption there are two keys to encrypt and decrypt data. Former is called oublic key and the latter is called private key. Public key is distributed for anyone to use and they can encrypt data using it. But only the reciever with the private key can decode the message.
In secure internet communications public, private key encryption is used by both server and client. Server sends it's public key to the client and client inturn sends it's public key to the server. Server then encrypt the data and sent it to the client with client's public key. And client does the same with server's.
In this system public key is available for the public. It means public key is not secured and anyone can request the public key from client/server computer. Because only people with private keys can decode this data this form of communication is secured.
The security of this encryption depends on the algorithm used.

posted from Bloggeroid

Thursday, September 17, 2015

Encryption and Security


What's Encryption?
Encryption is a method used to protect your data from outsiders. Encryption changes the data to make it difficult to read.
For an example:-
Happy Birthday can be encrypted in to "yadhtrib yppah"  or into "ibqqz Cjsuiebz". First is just reversed while the second one is encrypted using a caesar cipher which is just a fancy name for changing letters (like p for m, b for x).

So what's encryption used for?
Well encryption is used for many things but the main purpose is security. Your bank information, security credentials, sensitive information everything is encrypted to ensure security.

Why do we need encryption?
Data we use through Internet transfers through at least a couple of servers. If you use email, it's stored in your mail server, recipient's computer, recipient's mail server. Thus it will be easy for a hacker to access data scattered across the Internet. Therfore we need encryption to secure our information. Even more importantly in wireless communication data is broadcasted through radio waves therefor anyone can listen to them with proper equipment.

posted from Bloggeroid