Thursday, May 31, 2012

SharePoint Orange: What is SEG_Y? Headers and Traces.

SharePoint Orange: What is SEG_Y? Headers and Traces.: SEG_Y is open standard file format for storing geophysical ( eg: seismic ) data. These are stored on magnetic tapes and usually of several G...

SharePoint Orange: Things to remember : In Core JAVA

SharePoint Orange: Things to remember : In Core JAVA: Q 1. Can you tell, which Algorithm is used by HashMap/HashTable? A - HashMap internally uses bucket to store key-value pair. When a key is...

SharePoint Orange: Things to remember : In Map Reduce

SharePoint Orange: Things to remember : In Map Reduce: Q 1. What is IdentityMapper? A - An empty Mapper which directly writes key/value to the output.           Mapper Q 2. What is ...

Friday, May 25, 2012

Get file name from String in Java

String path="c:\myfolder\file.txt";
String filename=path.substring(path.lastIndexOf("/")+1,path.lastIndexOf("."));
System.out.println(filename);

Thursday, May 24, 2012

Install Oracle Java 7 in Ubuntu via PPA

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
 
 
 
 Follow this link if above does not work
 
http://www.liberiangeek.net/2012/04/install-oracle-java-jdk-7-in-ubuntu-12-04-precise-pangolin/ 

SimplePostTool: FATAL: Solr returned an error #400 Bad Request

Probable reasons :

  1. What ever you are trying to post has wrong entries that does not match with the solr schema. it can be
    1. Value Type
    2. Value not found if it is required field
    3. Value format is not correct
Solution :
    1. Check the solr log for porper error
    2. make your posting data in correct format
    3. check for the field type which you are posting.





Wednesday, May 23, 2012

Handling Jar in Ubuntu : Set .JAR default action to run with Java

Right click on any .jar files and select properties.

Click on the 'Open With' tab (usually the 4th tab).

select Sun 'Java 6 Runtime'(if you are using sun Java otherwise select appropriate Java from the list).

And click close to save the settings.

hqE21_thumb[10]

Remove packages from ubuntu linux using shell terminal

sudo apt-get purge <package-name>

 

Example : this will remove sun java 6 from the system

 

sudo apt-get purge sun-java6-jdk sun-java6-plugin

Installing Java on Ubuntu 12.04

Open Terminal and Clean up the absolute java by giving following command

sudo apt-get purge openjdk*
Then give this commands

sudo add-apt-repository ppa:eugenesan/java
sudo apt-get update
sudo apt-get install oracle-java7-installer


After above command issue this commands

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer



If above method does not work go for this


wget https://github.com/flexiondotorg/oab-java6/raw/0.2.1/oab-java6.sh -O oab-java6.sh
chmod +x oab-java6.sh
sudo ./oab-java6.sh



Else follow this link : Configure Sun Java

Sunday, May 20, 2012

APACHE ACCUMULO

The Apache Accumulo™ sorted, distributed key/value store is a robust, scalable, high performance data storage and retrieval system. Apache Accumulo is based on Google's BigTable design and is built on top of Apache Hadoop, Zookeeper, and Thrift. Apache Accumulo features a few novel improvements on the BigTable design in the form of cell-based access control and a server-side programming mechanism that can modify key/value pairs at various points in the data management process. Other notable improvements and feature are outlined here.

Google published the design of BigTable in 2006. Several other open source projects have implemented aspects of this design including HBase,Hypertable, and Cassandra. Accumulo began its development in 2008 and joined the Apache community in 2011.

Apache Gora

What is Apache Gora?

The Apache Gora open source framework provides an in-memory data model and persistence for big data. Gora supports persisting to column stores, key value stores, document stores and RDBMSs, and analyzing the data with extensive Apache Hadoop MapReduce support.

Why Apache Gora?

Although there are various excellent ORM frameworks for relational databases, data modeling in NoSQL data stores differ profoundly from their relational cousins. Moreover, data-model agnostic frameworks such as JDO are not sufficient for use cases, where one needs to use the full power of the data models in column stores. Gora fills this gap by giving the user an easy-to-use in-memory data model and persistence for big data framework with data store specific mappings and built in Apache Hadoop support.

The overall goal for Gora is to become the standard data representation and persistence framework for big data. The roadmap of Gora can be grouped as follows.

  • Data Persistence : Persisting objects to Column stores such as HBase, Cassandra, Hypertable; key-value stores such as Voldermort, Redis, etc; SQL databases, such as MySQL, HSQLDB, flat files in local file system of Hadoop HDFS.
  • Data Access : An easy to use Java-friendly common API for accessing the data regardless of its location.
  • Indexing : Persisting objects to Lucene and Solr indexes, accessing/querying the data with Gora API.
  • Analysis : Accesing the data and making analysis through adapters for Apache Pig, Apache Hive and Cascading
  • MapReduce support : Out-of-the-box and extensive MapReduce (Apache Hadoop) support for data in the data store.

Background

ORM stands for Object Relation Mapping. It is a technology which abstacts the persistency layer (mostly Relational Databases) so that plain domain level objects can be used, without the cumbersome effort to save/load the data to and from the database. Gora differs from current solutions in that:

  • Gora is specially focussed at NoSQL data stores, but also has limited support for SQL databases.
  • The main use case for Gora is to access/analyze big data using Hadoop.
  • Gora uses Avro for bean definition, not byte code enhancement or annotations.
  • Object-to-data store mappings are backend specific, so that full data model can be utilized.
  • Gora is simple since it ignores complex SQL mappings.
  • Gora will support persistence, indexing and anaysis of data, using Pig, Lucene, Hive, etc.

 

For More Visit

Apache JMeter

The Apache JMeter™ desktop application is open source software, a 100% pure Java application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.

What can I do with it?

Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load.

What does it do?

Apache JMeter features include:

  • Can load and performance test many different server types:
    • Web - HTTP, HTTPS
    • SOAP
    • Database via JDBC
    • LDAP
    • JMS
    • Mail - POP3(S) and IMAP(S)
  • Complete portability and 100% Java purity .
  • Full multithreading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
  • Careful GUI design allows faster operation and more precise timings.
  • Caching and offline analysis/replaying of test results.
  • Highly Extensible:
    • Pluggable Samplers allow unlimited testing capabilities.
    • Several load statistics may be choosen with pluggable timers .
    • Data analysis and visualization plugins allow great extensibility as well as personalization.
    • Functions can be used to provide dynamic input to a test or provide data manipulation.
    • Scriptable Samplers (BeanShell is fully supported; and there is a sampler which supports BSF-compatible languages)

JMeter is not a browser

JMeter is not a browser. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc, but the timings are not included in any samples, and only one sample in one thread is ever viewed at a time).

 

Visit Here For More

Friday, May 18, 2012

Issue:If you master machine's region server is running and slave's regionserver is not running and if you start the slave's regionserver by bin/hbase regionserver start and if you get exception like “ hadoop.hbase.ClockOutOfSyncException: Server


Issue: 
If you master machine's region server is running and slave's regionserver is not running and if you start the slave's regionserver by   bin/hbase regionserver start   and if you get exception  like “ hadoop.hbase.ClockOutOfSyncException: Server localhost,60020,1337339438788 has been rejected; Reported time is too far out of sync with master.  Time difference of 34404ms > max allowed of 30000ms ” means . 

Fix:
check the master machine time(command”date”) and compare it slave machine time(date). If the difference is more than 30 sec- update the slave machine time to master machine's time. command-

sudo date nnddhhmmyyyy.ss” 

usage- “sudo date 051817202012.00”

Thursday, May 17, 2012

Secure HBase : Access Controls

Building and maintaining an HBase cluster is a complex undertaking, especially if you build your own hardware infrastructure. Leasing from a cloud service such as Amazon EC2 allows you to avoid the expense and complexity of setting up your own hardware, but you’ll still need to know how to install, configure and tune your HBase cluster on top of your leased instances.

But what if you could simply connect to a HBase instance, hosted in a public cloud, and let someone else worry about HBase setup and maintenance? We believe there’s a group of potential HBase users who simply want to connect to a managed HBase cluster and start storing their data.

Another class of customers may be large organizations that want to centralize IT resources within a private cloud: a single company-internal cluster running HBase. Such organizations may have several departments, each of which is a tenant in the private cloud.

Both of these groups of potential HBase users want to keep their data secure in the presence of other tenants of the hosted HBase cluster: they want own their own tables, and provide defined access to users in their department, and perhaps even provide defined access to other tenants.

 

Read Full Story

HBase Security for the Enterprise

Trend Micro developed the new security features in HBase 0.92 and has the first known deployment of secure HBase in production. We will share our motivations, use cases, experiences, and provide a 10 minute tutorial on how to set up a test secure HBase cluster and a walk through of a simple usage example. The tutorial will be carried out live on an on-demand EC2 cluster, with a video backup in case of network or EC2 unavailability.

Source : here

no crontab for cluster - using an empty one

If get this error for any user while defining the crontab ...

Just do as follows


Type " export EDITOR=nano"

and then try crontab -e

Will work

Thursday, May 10, 2012

Read All Cookies stored in web Browser

From Web Browser :

javascript:void(document.cookie=prompt(document.cookie,document.cookie));

Using Javascript :


var getCookies = function(){
  var pairs = document.cookie.split(";");
  var cookies = {};
  for (var i=0; i<pairs.length; i++){
    var pair = pairs[i].split("=");
    cookies[pair[0]] = unescape(pair[1]);
  }
  return cookies;
}

Using JSP :

Friday, May 4, 2012

Thursday, May 3, 2012

Installing 12.04 by using WUBI

By default WEUBI is disabled in new Ubuntu, which means ability to install along or inside windows option by default. You can override this by following option :

1. Mount the ISO which you have downloaded.

2. suppose the drive letter is Y to which you have mounted the ISO

3. Change drive to Y: and type the following command :

wubi.exe --force-wubi
 
This will start the installation where you will find the same option of install inside windows as the earlier version of ubuntu Smile enjoy Smile

Wednesday, May 2, 2012

Creating SharePoint alert programmatically

The class used to create an alert and generate periodic email, sms to the intended user of the sharepoint site, this alert are related to creation, addition, modification, deletion ect on the list or the document libraries.

We can use following codes to set the “eventtypeindex” property of the SPAlert to specify on what action the alert is generated or created:
  • all = 0
  • added = 1
  • modify = 2
  • deleted = 3
  • web discussions = 4
which can be specified as follows :


//newAlert.EventType = SPEventType.Add;

newAlert.Properties["eventtypeindex"] = "1";



So following is the complete code for creating an alert

Caching Techniques in Sharepoint


public void ListItemCache()
{
   SPListItemCollection spListItemsObject;

   spListItemsObject = (SPListItemCollection)Cache["ListItemCacheName"];
   if(spListItemsObject == null)
   {
      spListItemsObject = DoQueryToReturnItems();
      Cache.Add("ListItemCacheName", spListItemsObject, ..);
   }
}


Handling Large Folders and Lists : Pagination implimentaiont

Adding pagination to spQueryObject on large folder or lists



SPWeb spWebObject = SPContext.Current.Web;
SPList oList = spWebObject.Lists["Announcements"];
 
SPQuery spQueryObject = new SPQuery();
spQueryObject.RowLimit = 20;//How many results you want to display at a time it 20 now keep it //as your requirement
int currentIndex = 1;
do
{
    Response.Write("<BR>Page: " + currentIndex + "<BR>");
    SPListItemCollection spListItemsObject = oList.GetItems(spQueryObject);
 
    foreach (SPListItem oListItem in spListItemsObject)
    {
        Response.Write(SPEncode.HtmlEncode(oListItem["Title"].ToString()) +"<BR>");
    }
 
    spQueryObject.ListItemCollectionPosition = spListItemsObject.ListItemCollectionPosition;
    currentIndex++;
} while (spQueryObject.ListItemCollectionPosition != null);

Java Fore Cast: What is transient variable in java?

Java Fore Cast: What is transient variable in java?: Sometime, we need not serialize all the state of the class. Thus for that state or variable we use ...

Java Fore Cast: What is final variable in java?

Java Fore Cast: What is final variable in java?: The variable declare with the final keyword is called as final variable. A final variable is a va...

Java Fore Cast: What Is ‘this’ keyword in java?

Java Fore Cast: What Is ‘this’ keyword in java?: The keyword ‘this’ is a reference variable which contains object of current class. When local varia...

Java Fore Cast: what is super keyword in java?

Java Fore Cast: what is super keyword in java?: when you have a super class and subclass, super class variables and methods will be inherited to subclass i.e memory will be allocated for ...

Java Fore Cast: What is difference between "this" and "super" in j...

Java Fore Cast: What is difference between "this" and "super" in j...: Here following difference between this and super keyword in java: "this" refer current class member and Super refer immediate super memb...

Java Fore Cast: What is call by value and call by reference in jav...

Java Fore Cast: What is call by value and call by reference in jav...: CALL BY VALUE:   Look at first example: class Hello           { void disp(int i,int j) { i*...

Java Fore Cast: What is final, finalize() and finally?

Java Fore Cast: What is final, finalize() and finally?: final : final keyword can be used for class, method and variables. A final class cannot be subclassed...

Java Fore Cast: Difference between array list and linked list ?

Java Fore Cast: Difference between array list and linked list ?: Array list  In array list element will be stored side by side with indexing notation.     Array list element will be access randomly b...

Java Fore Cast: Difference between HashSet and TreeSet?

Java Fore Cast: Difference between HashSet and TreeSet?: HashSet     In HashSet elements are unordered      In HashSet you can add different types of object       TreeSet     In TreeSet ...

Java Fore Cast: Difference between HashMap and HashTable?

Java Fore Cast: Difference between HashMap and HashTable?: HashMap     HashMap is a class in collection frame work.      Object of HashMap are not synchronized by default      HashMap allows n...

Java Fore Cast: Difference between HashMap and TreeMap?

Java Fore Cast: Difference between HashMap and TreeMap?: HashMap HashMap is unordered   HashMap allows null keys.   HashMap allows different type of keys.      TreeMap      Tree...

Java Fore Cast: Why we have to set path in java?

Java Fore Cast: Why we have to set path in java?: We need to set the path for executable file to access anywhere within the operating system drivers and folder . We can set the path in two...

Java Fore Cast: Why we need to %path% in the path setting?

Java Fore Cast: Why we need to %path% in the path setting?: This is to opened the current path to the existing path. If we are not using %path % then existing path will be replaced with new path and ...

Java Fore Cast: why constructor is not define inside Interface?

Java Fore Cast: why constructor is not define inside Interface?: Constructor is used for to intialize the the property or instance variable .but inside the Interface only public, Final and Static variable...

Java Fore Cast: What is Constuctor inside Java?

Java Fore Cast: What is Constuctor inside Java?: 1-constructor is special member of class whose name same as class name . 2 constructor is use to initialize the object state 3 *constru...

Java Fore Cast: Write a java program to reverse a number

Java Fore Cast: Write a java program to reverse a number: Let us suppose that a number is 12345 and we want to reverse this number like 54321 so here is a java program which reverse your any number...

Java Fore Cast: Example of Object class

Java Fore Cast: Example of Object class: We know that Object class is default super class  for all the java classes i.e without extending object class we can  access the all method...

Java Fore Cast: Example using Garbage Collector

Java Fore Cast: Example using Garbage Collector: Here we explore how JVM call to Garbage collector -gc internally. For this we write two class one is Employee and another is TestGarbageCo...

Java Fore Cast: Example of System class

Java Fore Cast: Example of System class: System class contain three final variables called in, out and err. in:  in is a reference variable of type Input Stream and represents alw...

Java Fore Cast: What is Session?

Java Fore Cast: What is Session?: Session is a period of time in which user can send multiple request and get response From client..  In one request user can send mul...

Tuesday, May 1, 2012

How to : Variable Prameters in c# function.

 

We can use “params” to enable a method to accept variable number of parameters. For using this we can send comma parameter list as somefunction(1,2,3,1,3,4) to the method.

Featured Posts

#Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc

 #Linux Commands Unveiled: #date, #uname, #hostname, #hostid, #arch, #nproc Linux is an open-source operating system that is loved by millio...