Thursday, February 11, 2010

How to make a good Website..

Answering the question "how" to make a Website is an easy task for many of us but the question which really puzzles us is "what" makes a good Website. We all visit many sites daily while surfing the net but there are a very few of them which leave an impression in our mind. Many sites are technically fine but fail on aesthetic grounds.

What makes a good WEBSITE:

Content:
The most important element of a website is its content. An interesting, informative and dynamic (updated frequently) content makes people visit the site again and again. The flashy colours or animated images look good at first but they never compell us to visit a site again and again. Only good content can do that.
Web is primarily a visual medium and its quite cumbersome to read text screen after screen. Try to keep the content to the point. Never elaborate.

Visuals:
Try not to Bold and Italicise the text too much, it gives an ameturish touch to your website. Sometimes underlined text get users confused with a hyperlink. Try avoiding it too. Make sure that the font size is even throughout. Do not wildly vary the size unless required.
Leave lots of blank spaces. Text on computer screens is hard to read, so don't cram up your text. Start lots of new paragraphs, and leave plenty of spaces between words and objects. Headings or horizontal rules are a good way to do this.
Do not use flashy colours as explained above. Try to select a good and readable combination of colour scheme. White text on black background may look classy but its difficult to read specially when text size is small.

Technicalities:
There are many things that make your web page look a bit different as what you expected:
  • Different browsers may show your web page differently. Try using a javascript available on net that kills this variation.
  • Sometimes web page view gets distorted on lower resolutions. Give a message on your website as "Website is best viewed in 1024X768" or anything like that.
  • The person viewing the web page may have certain settings different from yours.

Some tips:
  • To prevent your sites to look weird on text-only browsers you can add 'ALT' tags to ALL your images. If there is no alternative text that makes sense, use alt="" - this will help text-only browsers more than you will believe.
  • You can add a site search to your site. This will allow users to search your entire site easily and quickly.
  • Make sure that wherever your visitor is in your site, they can get to any other area. Also make sure they know where they are!!
As earlier said making a website is not a difficult task, it is designing and making people visit it again and again that makes it difficult. You need to make your website pretty different from all the other billions, floating on the internet.

* * * * *

Thursday, February 4, 2010

My way of writing a Quine

Here I m presenting a Quine written by me few days before. A Quine is a program that prints its own source code. In my source code user has an option of printing the source code n number of times.

Here is the code written in c:

#include < stdio.h >
int main()
{
int n;
char c;
FILE *f;
f=fopen(__FILE__,"r");
scanf("%d",&n);
while(n--)
{
while((c=getc(f))!=EOF)
putchar(c);
fseek(f,0,0);
}
return 0;
}



Here is the code written in c++:

#include <fstream>
#include<iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
string a;
cin>>n;
while(n--)
{
ifstream fin(__FILE__);
while(!fin.eof())
{
getline(fin,a,'\n');
cout<<a><<"\n";
}
}
return 0;
}

Wednesday, January 27, 2010

Configuring IIS Web Server



The ASP .NET pages can also be hosted through apache but it requires a hell lot of configurations and changes. An alternate version is IIS web server that comes already installed with your windows OS.
Vista OS has an already installed IIS web sever. One just needs to turn the feature on, through control panel. In XP OS you need to install it through XP CD.

Never try to configure IIS on Vista Basic you will land no where in the end. The OS is not provided with the complete package. ISAPI filters cannot be installed correctly on Vista Basic. Certain features of ISAPI filters need to be checked while hosting the website. The safest option is to configure the server on XP.

The steps for configuring it are:
  • Turn the IIS feature on through control panel.
  • Check installation by typing 'http://localhost:80/' in your browser. IIS page will appear.
  • Goto run and type inetmgr. This makes a window pop up. Window is that of IIS Manager.
  • The next step would be to create a virtual directory for an existing physical directory. For this you need to expand the Web Sites item in the IIS tree, right-click the Default WebSite item and choose New -> Virtual Directory from the menu.
  • Then comes the virtual directory creation wizard. The first step in the wizard is to choose an alias. The alias is the name, a user will use, in his URL to access the files in this virtual directory.
  • The next step in the wizard is to provide an existing physical directory to which the virtual directory will point to. So, this physical directory will be exposed as a virtual directory through its alias.
  • The final step in this wizard is to choose your permissions for the virtual directory. Usually, to host an ASP.NET application, read and execute permissions are enough. Of course, in order to fulfill your needs you can choose other permissions too.

* * * * *

Thursday, January 21, 2010

My submissions to SPOJ problem- TEST

My interest lies in programming languages. Actually, I have a bad habit of trying every type of weird thing and this time I came up with the idea of trying a simple problem in every possible programming language I know. I tried to solve the first problem of SPOJ named Test. Here are my codes:

C:

#include < stdio.h >

int main()
{
int n;
scanf("%d",&n);
while (n!= 42) {
printf(""%d", n);
scanf("%d",&n);
}
return 0;
}

C++:

#include < iostream >
using namespace std;

int main()
{
int n;
cin>>n;
while (n!= 42) {
cout<>n;
}
return 0;
}

C#:

using System;
public class Test
{
public static void Main()
{
int n;
while ((n = int.Parse(Console.ReadLine()))!=42)
Console.WriteLine(n);
}
}

Java:

public class Main
{
public static void main (String[] args) throws java.lang.Exception
{
java.io.BufferedReader r = new java.io.BufferedReader (new java.io.InputStreamReader (System.in));
String s;
while (!(s=r.readLine()).startsWith("42"))
System.out.println(s);
}
}

Python:

n = input()
  while n != 42:
  print n
  n = input()

PHP:

< ? php while(1) { fscanf(STDIN,"%d",$n); if ($n == 42) break; print "$n\n"; } ? >


BrainF*ck:

>+[>>,----------[>,----------]+++++[<-------->-]<[>>-<]>+[
-<+++++++[<------>-]<[>>-<]>+[
-<<[>>-<]>+[<<->>->]>
]<+++++++[<++++++>-]>>
]<++++++++[<+++++>-]< [<]<[>>[++++++++++.>]++++++++++.[[-]<]]<]
* * * * *

Friday, January 15, 2010

Introduction to various programming languages

Hey folks, I recently researched about various Programming Languages. Here I m going to discuss certain attributes of each language.

Basic

Year Introduced: 1964
Paradigm: Imperative, Procedural
Standardization: Yes, ANSI, ISO
Type Strength: Varies by dialect
Intended Use: Application, Education

C
Year Introduced: 1972
Paradigm: Imperative
Standardization: Yes, ANSI C89, ISO C90/C99
Type Strength: Weak
Intended Use: System


C++
Year Introduced: 1979
Paradigm: Imperative, Procedural, Object-oriented, Generic
Standardization: Yes, ISO
Type Strength: Strong
Intended Use: Application, System

C#
Year Introduced: 2000
Paradigm: Imperative, Object-oriented, Functional, Generic, Reflective
Standardization: Yes, ECMA, ISO
Type Strength: Strong
Intended Use: Application, Web

Haskell
Year Introduced: 1990
Paradigm: Functional, Generic, Lazy evaluation
Standardization: Yes, Haskell 98
Type Strength: Strong
Intended Use: Application

Java
Year Introduced: 1995
Paradigm: Imperative, Object-oriented, Generic, Reflective
Standardization: No
Type Strength: Strong
Intended Use: Application, Web

Perl
Year Introduced: 1987
Paradigm: Imperative, Procedural, Reflective, Functional, Object-oriented, Generic
Standardization: No
Type Strength: Weak
Intended Use: Application, Text processing, Scripting, Web

PHP
Year Introduced: 1995
Paradigm: Imperative, Procedural, Object-oriented, Reflective
Standardization: No
Type Strength: Weak
Intended Use: Web, Server-side

Python
Year Introduced: 1989
Paradigm: Imperative, Object-oriented, Functional, Aspect-oriented, Reflective
Standardization: No
Type Strength: Strong
Intended Use: Application, Scripting, Web


Scala
Year Introduced: 2003
Paradigm: Object-oriented, Functional, Generic, Lazy evaluation, Imperative
Standardization: No
Type Strength: Strong
Intended Use: Application, distributed computing

* * * * *

Wednesday, January 6, 2010

Why, what n how to Blog..


Why to Blog?

My Blogging habit commenced from January 2009 and I still love it a lot..!! I have a second blog running parallely. Here is its URL.
Blog is something that displays your thoughts to the outer world. Whatever is in your mind, you can deploy that on your blog, as its all yours. Many use blog for helping others, many use it for storing memoirs, many use them for technical discussions and many for fun and money. If you are addicted to writing.. blogging is your domain for sure.

What to Blog?
Its Important to know where your interest spans. A personal blog may contain all the happenings in your life and pictures to display them. A technical blog may contain certain useful information which you found out recently or which is the latest trend. A news blog may contain all recent updates about world, movies, sports, music etc. The thing that matters is your interest.
The second most important aspect of blogging is the content of your posts. The content must be precise, interesting and informative. For attracting more traffic to your blog you need to get a nice title to your posts. These titles get Googled frequently and increase the page rank of your post.

How to Blog?
There are many sites that offer you space to make your own blog. Some famous ones are Blogger, Wordpress, Tumblr, Procetours. I chose Blogger just because I was not having any idea about the others at that time!! I dont want to shift my blog now because then I will have to compromise with my page rank. Certain pre-built tools and gadgets are provided to the bloggers free from these sites. Javascripts may be used to build own tools.
Now, here are some tips from my side that can help bloggers in monitoring their blog and see who visits them.

Google Analytics: Its Google again :).. The analytics gives you a huge amount of information about the visitors of the blog viz the page they visit, amount of time they spend, the area from where they belong, the site from where they refer, how often they visit, even the operating system they use and the browser too..!! :p Visit Google Analytics, register yourself and your blog and enjoy tracing back your visitors. It will ask to add certain Javascrpit onto your home page and some other operations which can easily be done.

Feedjit: FeedJit is a cool tool. It displays the visitor on your blog in a real time basis. The visitors' location will be displayed on the blog itself at whichever corner you wish to place the tool. On clicking the real time display, it shows every visitor location, the sites from where they referred your blog and the keyword they typed in if they Googled your blog and also to which page did they exit. Go for it.. its free.. at least for now..!! :p

Google Feedburner: Recently added to Google. It allows you to generate feeds and sends them to each of your blog's subscriber. RSS feeds or ATOM, anyone can be chosen to begin with.

If you are interested in money making and have a decent regular traffic, you can add Google Adsense onto your blog. Google provides you with some advertisements of other companies which when clicked by a visitor lets you make money. The advertisements are mostly related to the content of your blog.

All these may help you in forming and maintaining your blog. If you have more information.. comments are surely invited..!!
HAPPY BLOGGING..

* * * * *

Tuesday, December 15, 2009

Some more problems of SPOJ...

I recently breached into the top 1200 ranks in the world, but sad news is, soon I'll be thrown out too. The points keep on decreasing on a regular basis. Never mind this works as an incentive to work on more and more problems. :)
So, m writing this post for some more problems of SPOJ. The problems I m going to discuss are of an average level.

BISHOPS: Its an easy problem, if we try verbally. The answer is (2*n-2) i.e. equal to the number of diagonals. But the difficulty lies in the range of the inputs. N<=10^100..!! OMG!!.. :).. Try strings..

MINCOUNT: Actually what I did.. I tried it out for certain test cases and found that the answer is.. (n*(n+1)/2)/3.. i.e. the total number of coins in the triangle divided by 3. But why its so.. its still unanswered for me.. kindly post the explanation if you get one..!! :)

HUBULLU: Same mincount type problem here too.. seeing the discussion in the forum I got some hints that who so ever plays first wins.. So, it became a very very easy question for me to crack but why it happens is yet not understood by me..

TRICOUNT: Its another mathematics problem.. try it for sometime with all yours geometrical anlysis and at one time you will definitely come out with a solution that is much like (t*(t+2)*(2*t+1))/8.. where t is the level of triangle. Try it now yourself..!!

SAMER08F: Another age old problem of how many squares are there in a given bunch of squares?? Answer lies in the sum all squared numbers till the number of squares in each side of the grid i.e. if N=8 then answer= (1*1) + (2*2) + ... + (8*8).

Seeing my last three posts of SPOJ I think now its easy for any newbie to get started. So, no more discussing algorithms of SPOJ problems from my side. Keep practicing and who knows one day you beat [Trichromatic] XilinX..!! :p

* * * * *