Skip to main content

Posts

Showing posts with the label fundamentals

Hello World in MongDB.

On 15th January 2016, Divin , one of my best friends sent me a message in Whatsapp. Greetings from ICT Academy of Kerala, We are pleased to invite your college to participate in the ICT Academy of Kerala’s Student Magazine to be released in 2016. Students may submit articles related to technology(all engineering disciplines), social innovation, individual and  group projects. The submitted articles which will be reviewed by ICT Academy of Kerala’s editorial board before incorporating it to Student’s Magazine . The ICTAK Students Magazine will be a unique blend of articles by students from your college and the industry. The best student article will be rewarded by ICT Academy of Kerala.  Articles to be send to this email id: <divin's email>  Please ensure the following steps to submit the articles.  1)      Articles should be related to technology(all engineering discipline), social innovation, individual and group projects. 2)   ...

Save a lot by modularizing your CSS.

I recently published an article on facebook discussing a good practice in CSS that we should follow. At my baby steps in designing  (mm may be 3 yrs ago) I wrote a new class for each element and styled them. The funniest thing was most elements had the same style. First styled a class, then copy-pasted to a dozen times. Finally I used to look at them and think "God! I wrote this much!", in which most of them are repetitions which are ctrl+v d. Those days were the funniest.. When I learned Bootstrap, I really liked the way they modularized their CSS. Then I started doing that modularization my own. Now here is a note for kids who are getting started.

Missed you Angular

In a phase when I was developing Formia (our acadamic mini project), I needed to add a dynamic heading. hmm.., that means: I have an <input type="text" name="title"> and a <p>...</p> tag. I wanted to display the content of text box on <p> as I type on text box. At that point, I was unaware of AngularJS . I implemented that in pure JS. wired... For the record, this feature could be implemented easily by Angular, as follows: When you type on the box below, the content will dynamically display next to it. {{message}} (for best results use Chrome / Firefox) Well, how's this happening? Add the Angular CDN script to top of the HTML. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> Add this 4 line to have that magic. <div ng-app=""> <input type="text" ng-model="message"> ...

How to install Node.js

Installing Node in Windows Installing node in Windows is pretty easy. To install Node you should be aware of your Windows bit version(32-bit / 64-bit). To know that, right click 'computer'>Properties. There you will find the bit version of the OS you are using. Now you know about the version of the OS you are using. - Head to nodes official website ( nodejs.org ) and download the msi for your version. - I recommend opting the LTS version of node. (if you have any suggestions, let me know.) - Install node with default recommended configuration. Installing Node in Linux/ Ubuntu This article will help you :  https://nodejs.org/en/download/package-manager/ If you don't have curl in your system, use terminal to: sudo apt-get update sudo apt-get install curl Source:  http://askubuntu.com/questions/259681/the-program-curl-is-currently-not-installed

How to optimize web pages across the browser.

Google Chrome is my favourite browser. It has given immense developer features. When I opened my first web page on Firefox for the first time, it disappointed me. I found some length, padding, margin, font etc. mismatches. The pages which correctly rendered in Chrome were not that much accurate on any other browser. It was because of the default values stored in them. Different browsers may have different default values for them. I used Google Chrome to develop my website - thus chose values for margin, padding etc. in a way that it balances the default values. Those chosen values cannot balance the default values stored in other browsers. Mainly there are 2 solutions. You should use one of these solutions while developing a website. 1. Use a css reset. The simplest method is to use a CSS reset. here is one.. --- 2. Use a framework. Using frameworks are one of the best choices. They offer fast development and responsiveness. Most popular frameworks are Boots...

Market Segmentation

Merge sort algorithm

This video show how merge sort works out: ----------------------------------------

Java Program using constructors

Simple Java Program using constructors. Here the constructor is “Cars”. //constructors public class Cars                 {                 public Cars(String name)                                 {                                 System.out.println("super "+name);                                 }               ...

Java: Another Simple Example of Displaying a Text

This is a simple Java program to display a text: This program enable you to understand: How to declare variable. Structure. Output statement. public class BeingAwesome                 {                 public static void main(String []args)                                 {                                 System.out.println("*****#####*****===+++@@@@&^%$#@!+_)(*&{}|");                           ...

The Simplest Java Program! - Displaying a Text

This is a simple Java program to display a text: 'i=100'. This program enable you to understand: How to declare variable. Structure. Output statement. class Awesome {                 static int i;                 public static void main(String[] args)                 {                                 i=100;                                 System.out.println("i="+i);                 } } Cl...

Instructions for Executing the Java Program.

If you don't have JDK in your system, then first you need to download and install Java Development Kit. Instructions to DOWNLOAD and INSTALL JDK. Instructions for Executing the Java Program. Locate the class in which the main() function is present. Save the program in the name of the class with an extension (* .java ). In this example the progm should be saved as ‘ Test.java ’. Open the cmd [Command Prompt] and set the address of the saved progm. Type ‘javac < file_name >’ –enter. [e.g.: javac Test.java] If any errors are there, that will be displayed here. After correcting all the errors, Save the progm again and compile. Now type ‘java <file_name_without_extention>’ [e.g.: java Test ]. Your program is now executed.

Simple Java Program That Display a Text

This is a simple java program that display a text (“I’m Vajahath” here). class Test {                 public static void main(String []args)                 {                                 System.out.println(“wow! It’s working..!”);                 } } Click here for instructions for executing the program.

Procedure for testing your JDK Installation

Test Your JDK Open Command Prompt, type ‘ java ’ – enter. à If it is working, do the following tip. Try this program: Open Notepad and type the following codes: class Awe {                 public static void main(String []args)                 {                                 System.out.println(“wow! It’s working..!”);                 } } Save the file as “ Awe.java ”. Open Command Prompt and set the corresponding file address. Type ‘ javac Awe.java ’ –enter. (Now the code is compiled) Type ‘ java Awe ’ –enter. (Now the program is executed) If you are getting an ...

Procedure to install the Java Development Kit (JDK)

Simple Easy Steps for Installation of JDK Download JDK (latest version recommended) from  http://www.oracle.com/technetwork/java/javase/downloads/index.html  . Install it. Go to control panel . Then move to “ Control Panel\System and Security\System ”. Click “ Advanced System Settings ” in the margin. In the “ Advanced ” tab, click “ Environment variables ” button. Then in “ system variables ” area, select “ path ” and click “ edit ”. (Use with care)  (Windows 10 has a different interface, but similar). Separate the current content with a “ ; ” and include just right after that, the file address of the ‘ bin ’ file in java folder. See the example:  [Example: ….; C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\Windows Live\Shared; C:\Program Files\Java\jdk1.7.0_45\bin; ] Then ‘OK’.

Cpp Simple Program For Finding Average

F inding average is one of the simplest programs. Here we input 5 variables, then added together for ‘sum’ and the ‘sum’ is divided by the 5 to produce the average. The Program //program to find average. #include<iostream.h> #include<conio.h> void main() { int i,x,sum=0,avg; clrscr(); cout<<"Enter the 5 elements\n"; for(i=0;i<5;i++)                 {                 cin>>x;                 sum=sum+x;                 } avg=sum/5; cout<<"sum="<<sum; cout<<"avg="<<avg; getch(); } Run the program after compilation. If any problems: post at here...

C++ Program to test whether a number is palindrome or not.

A number is called palindrome, if it reads the same on reading from both left and right. Thus, 121 is a palindrome, but 123 is not. Because, on reading from the right, it is 321 and not 123. The steps followed are, get the number to be checked. reverse the number. compare with the given number. conclude. The program would be as follows. The Program /palindrome 25/08/2013 #include<conio.h> #include<iostream.h> class dom { int dgt,dum; int flag; public: void get() { clrscr(); cout<<"enter the digit:"; cin>>dgt; dum=dgt; flag=0; } void check(); void disp() { if (flag==1) cout<<endl<<"palindrome"; else cout<<endl<<"not palindrome"; } }; void dom::check() { flag=0; int sum=0,w; while (dum!=0) { w=dum%10; sum=sum*10+w; dum=dum/10; } cout<<"reversed:"<<sum; if (sum==dgt) flag=1; }; void main() { clrscr(); dom obj; obj.get(); obj.check...

Dynamic initialization of variables.

T he below described is a program that shows how variables are declared in a dynamic manner. We can also initialize these variables dynamically. Hope this would be so simple for you. By trying some another examples, you can master on it.! The program // using simple dynamic initialization of variables #include<iostream.h> #include<conio.h> void main() { clrscr(); int b,c=sizeof("xloi");    //dynamic initialization for 'c' cout<<"\nvalue for b="; cin>>b; int q=b*1.3*c;  //dynamic initialization for 'q' cout<<"q="<<q; getch(); }

Using the key word "const" in cpp

T he const key word creates symbolic const ants in Cpp. The values declared as const cannot be modified by the program in any way. So it is a way of declaring const ants throughout the program. The program //using const data type #include<conio.h> #include<iostream.h> const int q=10;    // const are global in nature. void main() { const char w[q]="\nhello\n"; const char e='k'; clrscr(); cout<<q<<w<<e; getch(); }

Program to check weather a number is amstrong or not.

Hi guys, This is a simple cpp program to check weather a number is amstrong or not. A number is amstrong if the sum of the cubes of the digits of the number is the same number. Thus as a common example we use the number 153. Then, 1^3=1 5^3=125 3^3=27 the total will be 1+125+27=153 ,the same number. In the program, we: input the number to be checked. extract each digits from the number. take cubes. add up. check the result with the given number. display the result. Now try the program given below: //amstrong #include<conio.h> #include<iostream.h> class dom { int dgt,dum,flag; public: void get() { cout<<"Enter the digit:"; cin>>dgt; cout<<"done!"; dum=dgt; } void check(); void disp() { if(flag==1) cout<<"\n Awesome! Amstrong"; else cout<<"\noops! not *_* TRY AGAIN"; } }; void dom::check() { int q,sum=0; while (dum!=0) { q=dum%10; sum=sum+q*q*q; dum=dum/10; } ...