How execute spark Shell



execute in console spark-shell

Linux - curl command to call SOAP Web services




curl is a tool open source to transfer data through URL, support several protocols, in this case we will use for HTTP . curl it's a command in linux very simple to invoke soap web services from the console we can execute this command following the next steps,

As you can see the -H parameter is to specify the http-headers(Authorization, content-type,accept ,...) , -d parameter is to specify the the xml content and finally -K is to specify the http method in this case is POST
Curl command in linux Xml content inside of @request.xml
you can find more information in http://curl.haxx.se/

How install SBT(Buil Tool for Scala) in Linux




sbt is a build tool for Scala. It requires Java 1.6 or later. It tools is similar to make, Maven or Ant .

Here i will display the linux commands to install sbt.


Red Hat Enterprise Linux and other RPM-based distributions.

Ubuntu and other Debian-based distributions.






you can find more information in http://www.scala-sbt.org/

Android - Check if GPS is enabled



Here i want to share with you how check if GPS is enabled in android. This utilities is very common when you are developing with google maps.

The snipped code is very simple, if gps is not enabled so it will show a Alert asking you , if you want to enable gps, it's OK a panel of configuration will be opened.




Maven resources filtering - exclude application spring xml


In this new post i want to show you how use maven resources filtering exclude spring xml or images or some other resources static.



<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/application.properties</include>
</includes>
<excludes>
<exclude>**/applicationContext.xml</exclude>
</excludes>

</resource>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/applicationContext.xml</include>
</includes>
<excludes>
<exclude>**/application.properties</exclude>
</excludes>
</resource>


</resources>
<filters>
<filter>src/main/filters/${env}.properties</filter>
</filters>
</build>

Ubuntu - how execute windows application in ubuntu linux

Recently i installed ubuntu in my laptop. now i'm installing some applications previusly installed in windows 7.

I have some books in kindle, so to install kindle in ubuntu linux you have to follow the nexts steps ,


  • open ubuntu terminal 
  • execute sudo apt-add-repository ppa:ubuntu-wine/ppa
  • sudo apt-get update
  • sudo apt-get install wine
  • download kindle for pc http://www.amazon.com/gp/kindle/pc/download
  • finally execute on terminal, wine KindleForPc-installer.exe , that's all :)

JEE 6 easier than Spring


Java EE 6 was released 3 years ago. 
JEE 6 come with "Contexts and Dependecy Injection for the Java EE Platform" JSR-299. 
This specification was developed and lead by the Spring creatior, Rod Johnson.

JEE6 makes the EJB development easier.
Interfaces are no longer required for the implementation of business components.


 @Stateless  
 public class EJBEasier{  
  public void simple(){  
   System.out.println("Hello");  
 }  
 }  

It isn't necessary declare the EJBEasier class in deployment descriptor, any bean java class can be a EJB, only with the @Stateless annotation and without any interfaces.


The Hello POJO can be injected in stateless session bean 


 public class Hello{  
  public void say(){  
   System.out.println("Hello");  
 }  
 }  

@Inject annotation inject the Hello POJO in the EJB.
  @Stateless   
  public class EJBEasier{   
  @Inject  
   Hello hello;  
  public void simple(){   
    hello.say();  
  }   
  }   

There is no xml configuration !  easier couldn't be it. 

Currently you can choose between 14 compliant application server with JEE 6, with a variety of open source and commercial.