C,C++/JAVA/BASH/ASM ARENA

वह प्रदीप जो दीख रहा है झिलमिल दूर नही है थक कर बैठ गये क्या भाई मन्जिल दूर नही है चिन्गारी बन गयी लहू की बून्द गिरी जो पग से चमक रहे पीछे मुड देखो चरण-चिनह जगमग से बाकी होश तभी तक, जब तक जलता तूर नही है थक कर बैठ गये क्या भाई मन्जिल दूर नही है अपनी हड्डी की मशाल से हृदय चीरते तम का, सारी रात चले तुम दुख झेलते कुलिश का। एक खेय है शेष, किसी विध पार उसे कर जाओ; वह देखो, उस पार चमकता है मन्दिर प्रियतम का। आकर इतना पास फिरे, वह सच्चा शूर नहीं है; थककर बैठ गये क्या भाई! मंज़िल दूर नहीं है। दिशा दीप्त हो उठी प्राप्त कर पुण्य-प्रकाश तुम्हारा, लिखा जा चुका अनल-अक्षरों में इतिहास तुम्हारा। जिस मिट्टी ने लहू पिया, वह फूल खिलाएगी ही, अम्बर पर घन बन छाएगा ही उच्छ्वास तुम्हारा। और अधिक ले जाँच, देवता इतन क्रूर नहीं है। थककर बैठ गये क्या भाई! मंज़िल दूर नहीं है।

Power of 2 – check whether a given natural number is power of two September 21, 2012

Filed under: Uncategorized — whoami @ 10:10
Tags: ,

How will you check whether a given natural number is power of 2?

There may be many ways to check it, but i m posting a simple way:

PROCEDURE :

1. Perform “AND”(&) operation on the given natural number N and number N-1 i.e   N&(N-1)

2. If the result of the above operation is zero, then the given natural number is power of two,
 else the number is not power of 2.

3. end

 

bRoadBand, wEbSerVer, DataCentre, Lease Line, Ethernet, Fibre Cable ……. September 20, 2012

Filed under: Uncategorized — whoami @ 20:17
Tags: , , , , , ,

What do we want from a good broadband service? We expect many thing and almost everything from a broad band service, but we do not get that much. Also even if we are getting some good services from a broadband we need to spend money.

 

What if u want to start a business…say u need to set up a web server/ web application which is accessed by millions or billions of people…say u want to own the server on your end. You want to keep control of everything…just like setting your own data centre….thinking about these feels like you will have to invest much….its like purchasing fibre cable and taking lease lines from good telecommunication company..One day if your data centre becomes very big you may want be your own ISP(internet Service Provider).

I was going through these ideas when i came through this blog and understood the internals of setting good data centre….

I have learnt many things related to working of internet or setting big servers at your home or business.
Things like web hosting, dynamic dns mapping, reseller web accounts, submarines fibre cables, mapping port on router to LAN ip addresses ( for accessing your laptop web application from outside)….accessing the machine using SSH. 

Bandwidth – what it means, what bandwidth comprises when u get a broadband connection. Why you are paying money for broadband…why you pay more money when u need more bandwidth….what kind of connection does GOOGLE have ….because it serves web pages to billions of people…

 

Will put more Question ….
Will put more Answers…

 

 

 

Installing Solr and Nutch and Solr-Nutch Integration September 14, 2012

Hello,

As i have worked on using Apache Solr and Apache Nutch for one of my college projects, so thought to rewrite about the procedure so that it can help me or anyone in future.

I will discuss following things:-

1. Installing Apache Solr

2. Installing Apache Nutch

3. Integrating Solr and Nutch

1. Installing Apache Solr– Apache Solr has some important feature to develop a good search engine. One of the important role that Solr serves is Indexing.The other important feature of Solr is Serverization, i.e. it provides a good server feature for searching. This solr has been developed upon Lucene

Installing Apache Solr requires that you have a latest Java(JDK) installed in your system and appropriate JAVA_HOME path is set. Though the current installation process means for Linux system. We can install Solr in windows with similar procedure. Download the latest Apache Solr package from the solr or Apache site. The package by default contains jettty server. Now unzip/untar the compressed solr package. If you have correct JAVA_HOME set, then you can start the Apahce Solr as

$cd <location_of_solr> e.g. $cd apache-solr-1.3

$cd example

$java -jar start.jar

this will display on the command prompt string like………………….

  Sep 11, 2012 11:38:35 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
  INFO: JNDI not configured for solr (NoInitialContextEx)
  Sep 11, 2012 11:38:35 PM org.apache.solr.core.SolrResourceLoader locateSolrHome
  INFO: solr home defaulted to ‘solr/’ (could not find system property or JNDI)
  Sep 11, 2012 11:38:35 PM org.apache.solr.servlet.SolrUpdateServlet init
  INFO: SolrUpdateServlet.init() done
  2012-09-11 23:38:35.683:INFO::Started SocketConnector@0.0.0.0:8983
  check for any error on the screen ….
  open the browser -> http://localhost:8983      ———> click the link and u can find the admin page of solr.
   This is    normal working of solr. For more customization you need to study in depth.
  Note: Solr configuration and index directory can find in     —– example/solr directory which contains
   i) bin  ii)conf  iii)data(initially it does not exist)  iv)README.txt  v)solr.xml
    2. Installing Apache Nutch –  Nutch is a good crawler which has also got developed from Apache Lucene.
     Proper installation and working of Nutch requires JAVA to be installed and its proper path set as
     discussed   above. To install the Apache Nutch, download latest Nutch from the Apache Site.
      extract the Nutch tar ball in home folder.

      $cd <location_of_nutch> e.g. $cd nutch-1.2

Nutch now available -> just check whether $bin/nutch is there.

Change the permission of nutch binary to executable file.

—————————–using Nutch for crawling ———————————-

Crawling several websites and fetching the data from each website can be performed as a   single  command or   step wise commands. The details can be found here. http://wiki.apache.org/nutch/NutchTutorial

3. Integrating Solr and Nutch 

Tutorial 

Will update more……………………..

Good night 🙂

 

Installing Tomcat7 on Fedora15/Linux through Command Line September 8, 2012

Filed under: Uncategorized — whoami @ 10:45
Tags: , , ,

Hello Friends,

Generally it happens we installing any  software , configure it and then make it running after much hard work. But we forget it when the next time, when we need to go through the installation on crashed machine or new computer. And there is no point in remembering each and every step of installation. We just need to know the overview to install it again. But yeah we need to get the document for step wise installation , otherwise we are again going to waste time by experimenting with new installation.

 

I am posting this because i was once having fedora , then tomcat was installed and configured well either using “Yum” or “command line installation” . At that time, i was beginner in installing Tomcat, so it took me time to keep things running. Now i know how things work in tomcat. This time i need to install tomcat fresh on the fedora, but i do not remember the steps, so i went through some articles and installed it. Also i converted the contents to pdf for further reference

will update the post on any new stuffs related to Tomcat installation and its uses.

 

Topcoder KawigiEdit C++ Template September 6, 2012

Filed under: Uncategorized — whoami @ 16:20
Tags: , , ,

KawigiEdit Plugin has a default template that we can edit. I saved the default template to some other name, and the it was to be used as default template. After that the previous template was overwritten. Thats why i am posting the template for further reference…

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>

#define F(i,n) for(int i=0;i<n;i++)

using namespace std;

class <%:class-name%> {
public:
<%:return-type%> <%:method-name%>(<%:param-type-list%>);
};

<%:return-type%> <%:class-name%>::<%:method-name%>(<%:param-list%>) {
<%:set-caret%>
}
<%:testing-code%>
//Powered by [KawigiEdit] 2.0!

 

——————————-OR————————————–

default cpp.ket

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class <%:class-name%> {
public:
<%:return-type%> <%:method-name%>(<%:param-list%>) {
<%:set-caret%>
}
};

<%:testing-code%>

The same can be found here