Monday, May 26, 2014

5/25/14

An HTML page with equal height columns

It's almost 2 months since I stopped adding content to my blog. Did I learn anything but haven't mentioned here? I don't think so. So the most I post to this blog, the better my learning curve would be!

Building equal height columns using simple CSS is a challenging task. I came across this page http://matthewjamestaylor.com/blog/equal-height-columns-cross-browser-css-no-hacks where it was explained in an artistic way. Also found the other web sites on the same topic:


Sunday, March 23, 2014

3/22/14

Learning about Angular JS

Well, today I wanted to know about Angular JS and as usual, I know almost nothing about Angular JS other than things like Angular JS is supported by Google and there are plenty of job opportunities for an Angular JS developer. I started looking for a good tutorial that gives the basic idea about Angular JS and at the same time won't scare me away from it.

I came across this tutorial (http://www.revillweb.com/tutorials/angularjs-in-30-minutes-angularjs-tutorial/) that sure helped me to take my baby steps in learning Angular JS.

And also now I know where I can find the Angular JS API: http://docs.angularjs.org/api

I am all excited to know more about Angular JS now!!

More references:

http://dotnetlearners.com/tutorial/angularjs/17/angularjs-tutorial-introuduction-to-angularjs

https://docs.angularjs.org/guide/introduction

http://viralpatel.net/blogs/angularjs-controller-tutorial/

https://www.youtube.com/watch?v=i9MHigUZKEM

http://theprofessionalspoint.blogspot.com/2014/02/basic-angularjs-interview-questions-and.html


Saturday, March 1, 2014

3/1/2014

Building your own web server with nodejs in 5 minutes

Well, it took me almost a week to get back to my blog :)

Couple of things I want to add to my blog before I forget! I mentioned about NPM, the node package manager that helps you to get the new modules. So how do I request for a new module using npm?

Psst! I stumbled upon this blog http://blog.modulus.io/absolute-beginners-guide-to-nodejs which got cool things that you can do with node.js. And I am installing express module (of course, using npm) to build my own web server.

I have my web project 'npj' created under: C:\Development. So basically 'npj' is a folder under C:\Development that has all my JavaScript, CSS, images folders and files.

Now request for the module you are looking for:

C:\Development>npm install express

npm is going to install the express module in there, that's it!

Now, let's go ahead and create a web site and browse it using your own web server that you can build with node. Create a file nodeWebServer.js under C:\Development.

           var express = require('express');

           var app = express();

           app.use(express.static(__dirname + '/npj'));

           app.listen(8080);

Four lines of code and my server is ready! Run my server as below:

C:\Development>node nodeWebServer.js

Note: Now you are using node.js to run your newly created web server. So node.js is busy running it so you CAN NOT access it from command prompt any more unless you stop your web server.




Sunday, February 23, 2014

2/23/2014


More on nodejs

Well, I thought of jumping right into tuts+ tutorial on node.js but before that I wanted to know more details about node.js. Things like why should I use node.js, and how is it going to help me and where? And following is what I found:
  • Node.js is a command line tool (or some people call it as a JavaScript environment) that helps to run JavaScript programs.
  • You can build a regular web server with node.js in no time (rather surprising as I remember the days when I was looking to set up a local web server like IIS, Apache tomcat, etc. to help me develop some html stuff on my local PC).
  • V8 is Google's open source JavaScript engine and node.js is built on top of V8.
  • When you build a web server with node.js, you can share code between browser and backend
  • You can even connect to a database like mysql
  • Node.js uses a module architecture and this helps to build complex applications easily.
  • To effectively run a company (either a micro company or a major corporation), you need a manager to manage the show. Node.js is no less. It has a package manager, called Node Package Manager (NPM) that helps you to install new modules.
  • You want to write a JavaScript program and run it using Node.js, you basically need the modules that are provided by node.js. You can check for any new modules available on Github. How to install new modules using the node package manager?
  • npm install new_module



Saturday, February 22, 2014

2/22/2014

2/22/2014

About node.js

These days everybody talks about node.js. Some of them boast about what cool things they did with node.js. Well, I need to catch up with these guys but I don't want to spend too much time learning node.js. So I set out a challenge myself to find out more about node.js in a short period of time.

So I downloaded node.js and all ready to go!

My first experiment with node

  1. On my windows PC, I created a file test.js under C:\node-examples folder
  2. I added the following line in test.js:
  3. console.log("testing node");
  4. From command prompt, I ran the command "node test.js" and "testing node" came up.
  5. C:\node-examples>node test.js
  6. Viola! I was able to run my JavaScript file from command prompt using node.
My second experiment with node
  1. I modified test.js so that now it has the following content:
  2. function printLine(){
           console.log("printing from node");
    }
    console.log(printLine());
  3. From command prompt, I ran the command "node test.js" and "printing from node" came up. Nice!!
  4. C:\node-examples>node test.js
Notes:
There is this site http://code.tutsplus.com/tutorials/nodejs-for-beginners--net-26314 where they have a simple but good tutorial on node.js! I am going to dive into that right away!