Tuesday, July 29, 2008
Monday, July 28, 2008
Thursday, July 24, 2008
Sunday, July 20, 2008
Monday, July 14, 2008
Zero Cost SEO!
How to do SEO for free?
- Use Google WebMaster tools.
- Make sure you explore all features of webmaster tools.
- Put some nice content.
- Use Google Analytics / FEEDJIT and see what content brings you greater traffic.
- Write/Research more on that topic.
- Result => improved quality & exclusivity of your content.
- So, the older contents too get indexed with more preference.
- join communities that relate to topics you write about
- find some problems that users have
- answer it in your web page, and offer links to solution
- leave signature links and comment on websites of common cause
Have a look -
click to enlarge!
Wednesday, July 09, 2008
SPOJ PALIN
#include <iostream>Don't start smiling at the code above, thinking that you've got the solution!
#include <vector>
using namespace std;
bool compare(vector<int> n1,vector<int> n2,int half){
// if n1>n2 for problem size(n1) == size(n2)
for (int i=n1.size()-1;i>=half;i--){
if (n1[i]!=n2[i])
return n1[i]>n2[i];
}
return false;
}
void work(vector<int>& num, int pos1, int pos2) {
if (pos1 < 0) {
num[num.size()-1] = 1;
num.insert(num.begin(), 1);
return;
} else
if (num[pos1] < 9) {
num[pos1] = num[pos2] = num[pos1] + 1;
return;
} else {
num[pos1] = num[pos2] = 0;
work(num, pos1-1, pos2+1);
return;
}
}
main (){
char n;
vector<int> num,old;
int half,ssize;
n=getc(stdin);
while (n!='\n'){
num.push_back(n-'0');
n=getc(stdin);
}
while (num.size()>=1 && num[0]!=0){
old = num;
ssize=num.size();
if (ssize%2==0){
//even
half=ssize/2;
//mirror into vector
for (int i=0;i<half;i++){
num[ssize-1-i]=num[i];
}
if (compare(num,old,half)){
for (int i=0;i<ssize;i++){
printf ("%d",num[i]);
}
printf ("\n");
} else {
work (num,half-1,half);
ssize=num.size();
for (int i=0;i<ssize;i++){
printf ("%d",num[i]);
}
printf ("\n");
}
} else {
//odd
half=ssize/2 ;
//mirror into vector
for (int i=0;i<half;i++){
num[ssize-1-i]=num[i];
}
if (compare(num,old,half)){
for (int i=0;i<ssize;i++){
printf ("%d",num[i]);
}
printf ("\n");
} else {
work (num,half,half);
ssize=num.size();
for (int i=0;i<ssize;i++){
printf ("%d",num[i]);
}
printf ("\n");
}
}
num.clear();
n=getc(stdin);
while (n!='\n'){
num.push_back(n-'0');
n=getc(stdin);
}
}
}
The problem with the above is that its a TLE for SPOJ. If you can spot or fix the problem with the code, the points are free for you to grab. And if you are a little benevolent then do consider hinting me too on the shortcomings of this problem.
Adios
Labels: programming, SPOJ
Shifted to GooglePages
I am a big fan for 100free.com. Why ? Because, they've got free basic hosting? No, because they have been hosting my website since 5 years now! Have a look - http://newman2001.100free.com/index.html
The only problem they've got is hosting big files properly, most of the cases downloads go incomplete. So, if you have any such big files to be hosted, make sure you do it on GooglePages, or my.opera.com as I have done for my two oldie projects -
Thats all for the random jottings of the day!

By the way has anyone noticed that there are no break-ups in Bollywood movies ?
Labels: rants
Saturday, July 05, 2008
TumTube's Logo Design


Just finished the design of TumTube's logo. TumTube is going to be a major Indian video sharing website. A lot of improvement is going to be implemented to add social features and engage users to its exclusive contents.
Click here to checkout this piece of work in action.
Labels: artwork, web design
Low hanging fruits
To busy with work, but SPOJ addiction hasn't yet died out completely. Only that BASE GOSSIPER and STPAR problems bugged me a lot. Still no solution for them. Who said spoj isn't good at surprises! Try sorting problem list with different parameters, you will find loads of engaging low hanging fruits. And one of them is TOANDFRO. Pretty easy with vectors in c++! Got me #1610 today. Have to find all such fruits. :-) Next stop... PALIN
#include <iostream>
#include <vector>
using namespace std;
main (){
string c;
int cols,sz,i,j,len,cindex,tsize;
vector<string> table;
scanf ("%d",&cols);
while (cols!=0){
cin>>c;
len=c.size();
sz=len/cols;
int toggle=0; string crow;
/* *************************************
Its really against the spirit
of sports to show solutions!
-anon.
**************************************** */
cindex=0; tsize=table.size();
for (j=0;j<cols;j++){
for (i=0;i<tsize;i++){
printf ("%c",table[i][cindex]);
}
cindex++;
}
printf ("\n");
table.clear();
scanf ("%d",&cols);
}
return 0;
}
// isn't this much enough ;P
Labels: programming contest, SPOJ









