Monday, February 11, 2013

Install Hadoop on windows 7

Hadoop distribution is not available for windows so we have to tweak few things to get our work done.

Moreover this was more on personal learning so we don't have luxury to have multiple machines, so we'll have single node cluster (not fair to call it cluster though)

If everything goes fine which is not always that straight though, we should see below ui successfully  which would be like aaha moment !!

Name Node UI once successfully installed





Prerequisite :

Eclipse 3.3.2 Europa 
Hadoop 0.19.1 
Jdk 1.6 
Cygwin
Dell Latitude Win 7 i586, 2 GB
.sh file editor like EditRocket

Please note lot of people facing problems in different versions (Europa/Hadoop etc), above combination is tested successfully, so if you are like one of those who want to test latest, do it @ your own risk.

Tuesday, January 29, 2013

Introduction to Big Data

Big data are high volume, high velocity, and/or high variety information assets that require new forms of processing to enable enhanced decision making, insight discovery and process optimization.


Basically it has 3 main features which differentiate it from traditional data :
1. Velocity
2. Volume
3. Variety

Examples of Big Data includes web logs, sensor networks (RFID tags), social networks, big social data analysis, Internet text and documents, Internet search indexing, call detail records, astronomy, atmospheric science, genomics, bio geochemical  biological, and other complex and often interdisciplinary scientific research, military surveillance, forecasting drive times for new home buyers, medical records, photography archives, video archives, and large-scale e-commerce.


To be continued ..


Sunday, December 11, 2011

Location based service using Google maps api

After lot of procrastination i thought lets do it and publish first post on Android.

Environment :
Android API 8(Froyo 2.2)
Maps.jar (can be downloded from Android SDK manager)
Preferably eclipse with ADT plugin

Steps :
1. Create New>Android Project>Project Name>Target - Google API's>Package Name>Min SDK(8)
2. Open AndroidManifest.xml
Grant following permissions:

        <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Third one is optional(not required on real device)
Add following library
<uses-library android:name="com.google.android.maps" android:required="true"/>
3. Open Main.xml

Add following layout in Relative layout

<com.google.android.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="XXXXXX"/>
You can get map key by following this link
http://code.google.com/android/add-ons/google-apis/mapkey.html

3. Open your Activity file
Extend MapActivity instead of Activity class
In onCreate method get mapView
     mapView = (MapView) findViewById(R.id.mapView);
get LocationManager using
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
MINIMUM_TIME_BETWEEN_UPDATES,
MINIMUM_DISTANCE_CHANGE_FOR_UPDATES, new cLocationListener());
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
GeoPoint geoPoint = new GeoPoint((int)(l.getLatitude()* 1E6), (int)(l.getLongitude()* 1E6));
Get MapController
MapContoller mc = mapView.getController();
mc.animateTo(geoPoint);

Now here is our listener class, after all someone has to listen for change

private class cLocationListener implements LocationListener {
public void onLocationChanged(Location location) {
String message = String.format(
"New Location \n Longitude: %1$s \n Latitude: %2$s",
location.getLongitude(), location.getLatitude());
Toast.makeText(MapTestActivity.this, message, Toast.LENGTH_LONG)
.show();
Toast.makeText(MapTestActivity.this, message, Toast.LENGTH_LONG).show();
}

public void onStatusChanged(String s, int i, Bundle b) {
Toast.makeText(MapTestActivity.this, "Provider status changed",
Toast.LENGTH_LONG).show();
}
//GPS related toast
public void onProviderDisabled(String s) {
Toast.makeText(MapTestActivity.this,
"Provider disabled by the user. GPS turned off",
Toast.LENGTH_LONG).show();
}

public void onProviderEnabled(String s) {
Toast.makeText(MapTestActivity.this,
"Provider enabled by the user. GPS turned on",
Toast.LENGTH_LONG).show();
}
}


You can use NETWORK_PROVIDER to get location, just need a real device but GPS_PROVIDER can be used in AVD also.

Switch to DDMS perspective>Emulator Control>Scroll down to Location Control>click on send



Troubleshooting :
I got two issues
1. ClassNotFound because target SDK was 2.2, it should be Google API's
2. Because AVD target was again 2.2, changed to Google API's

Final result on Olive Pad(Froyo)..ya that's lat long of Gurgaon.





Interesting Fact : on a final thought do you know that Android naming convention is based on desserts, and this is big one  ..... they are in alphabetical order :)
A : Android
B : -------- no idea, Bug Bite may be
C : Cup Cake
D : Doughnut
E : Ã‰clair
F : Fro yo
G : Gingerbread
H : Honeycomb
I  : Ice cream sandwich (latest one 4.0 API level 14)
F : ???? Jelly, Jack fruit, Justin bieber whatever


In Android only limitation is your imagination, its a game changer.


Humble request to Big Shots(you know them right), pls spare Google from your lawsuits, its not XXXXXsoft, its more of a basic need to humanity, let them do the good work.


Mr. Kapil Sibbal i hope i haven't said anything wrong here to malign someone's image.


Cheers !!





Friday, May 22, 2009

Java 2 Pega

Tried to search a lot about PEGA but i think its too much hidden from outside world. Anyone having any idea or study material can mail me at rktakshak@gmail.com.
Thanks in advance
Ravinder

Friday, November 21, 2008

Intrenationalization in Jasper Reports

You need

1. Either compiled jrxml or jasper report

2. Add JRParameter locale parameter to desired one and populate the map.

3. Get the windows language pack installed in your system.

4. Publish report as html with api methods.

5. Now view report in desires languages by changing view-encoding- desired language in IE.

Still working with pdf, soon publish.
Cheers!
Ravinder

Tuesday, November 11, 2008

Developing JSF Custom Components

Well those of you who have used JSF components must be very happy with the reduction of UI efforts which were mostly struggling with html tags like , it was boring and it was like big pain.

But somewher some one is writing some piece of code so that we can use it...

Let's see what it take to write a custom component, in the example below we shall be writing a Look Up Component

Desc:

The Main Idea is to frame a Custom Component based on the existing Standard Components Input Text Field and Command Link. These two standard components look like a single component. The Functionality involved in this component is when you click the Command Link it should show a pop up window containing list of values. After selecting a value in the pop up window that selected value (or) values should come in to the Input Text Field.



1) LookupComponent.java

It provides the core functionality of the component. This class will implement the following method(s).
public String getFamily()
public Object saveState(FacesContext context)
public void restoreState(FacesContext context, Object state)



2) LookupComponentTag.java
It enables the execution of the UI Component from a JSP Page. This class will implement the following method(s).
public String getComponentType()
public String getRendererType()
public void setInputfield(String inputfield)
public void release()
protected void setProperties(UIComponent component)

3) LookupRenderer.java
It is used to add the existing standard components to a parent called component and renders them.
private void removeOldChildren(UIComponent component)
public void encodeBegin(FacesContext context, UIComponent component)
public void encodeChildren(FacesContext context, UIComponent component)
public boolean getRendersChildren()
public void encodeEnd()


4) faces-config.xml.
4.1) Specify elements in above xml with component name and corresponding class name.
4.2) Specify renderer elements


The getFamily() method of LookupComponent.java file associates the tag to give the control to the LookupRenderer.java file; it must be registered in faces-config.xml file. The getRendererType() method of LookupComponentTag.java file associates the tag which is used to identify the rendererType, so it must be registered in faces-config.xml file.


5) Lookup-taglib.tld
Specify component in tld with Tag name and correponding Tag class with attributes.

Now the component can be invoked in a JSP page like any other tag.


Thats all need to be done, n we r all set.

Cheers n Njoi!!!!

-R K Takshak

SOA India - 2008

SOA India 2008 is here again with the seminar with renowed techno evangelist like Paul Allen, Axel Angeli, Frank Mueller and Yasmine Limberger to name few.













contact anirbank@sda-asia.com or info@soaindia.com for Free Gate Pass*
website: http://www.soaindia.com/
*Only for individuals, for corporates fee ranges from 6K to 13K