2013-02-08

Persian question & answer service: "javabyab.com"

Today i am going to introduce a new general purpose Persian question & answer service called "javabyab (جواب یاب)".
This is a completely Persian question & answer site like stackoverflow and its facilities are look like it. People who work with stackoverflow will be familiar with this site.

Have a nice time.

2013-01-21

Design and implementation of a simple Twitter clone using Redis and Spring Data

There is a good case-study (Retwis) that describe how to use key-value stores like NoSQL databases as drop in replacement for a relational database for the development of web applications. This case-study uses as database and PHP as programming language and web application framework.
Retwis-J is a port of Retwis to Java, using the Spring Data Frmework. The source code can be found on GitHub and there is comprehensive documentation available at springsource.org.


This is a good start point for learning key-value NoSQL databases concepts and how to use them using Spring Data Frmework.
 
Have a nice time.

2013-01-02

Integration test for GWT + Spring web applications

Testing (unit or integration) GWT applications has several difficulties, recently i have meet a Java testing framework for GWT applications (gwt-test-utils), this library provides utilities for both unit test and integration test.
I like "GWT + Spring web application testing" feature of this library. Unfortunately the spring-sample of this project in github was not complete, I forked it in my github account. You can get it from this link and see how to integration test GWT + Spring web applications using gwt-test-utils.

Have a nice time.

2012-12-30

My favorite software stack in Linux

Finally  i decided to install Fedora 17 on my darling VAIO (about 2 month ago until now !!!). In this post i am going to describe about my favorite software in Linux world and why i like them.

Desktop Environment
I choose Gnome 3 with gnome shell, because of its active and rapid community and its feature like animation effects, text scaling factor and ...

Photo Viewer
I use Shotwell,  because i can easily see and edit (specially crop) my picture using it.

Music Player
I love Amarok, because of its capability to store my listening history in file or database (like MySQL).

Video Player
I use VLC, because it support almost all media format.

Text Editor
I love Kate (and also Geany), because it is not a text editor! it is a simple and fast IDE............

Web Browser
Firefox is my choose, because it renders almost all Persian sites easily and i would like its sync feature and without any doubt with Firefox i have a dozen useful plugins.

Messenger
I always select Pidgin, it is very handy.

Clipboard Manager
I have been using ClipIt, it is very lightweight.

File Manager
Nautilus,  it isn't the best but is enough for me.

Power Management
I do not believe power manager software but i think jupiter is good.

Have a nice time.

2012-12-21

GWT code splitting with activities and places

GWT activities and places do not work with gwt code splitting facility. Recently i have changed GWT activities and places sample so that it works with GWT code splitting feature and push the new sample into github.
In this sample, split points occur on getting activity by ActivityMapper, i write a new kind of ActivityMapper called AsyncActivityMapper which can get activities asynchronous, and also i write a new kind of ActivityManager called AsyncActivityManager (copy and paste gwt ActivityManager class with minor changes) that work with AsyncActivityMapper.

Have a nice time.

2012-12-10

How can we run the SWT Browser inside Eclipse on Fedora 17-64 bit

When you work with eclipse 64 bit on fedora 17-64 bit and JDK 64 bit, you can not use internal SWT web browser inside eclipse (and also some plugins features like GPE gwt uibinder designer or Vaadin visual user interface designer  which use this facility ) for solving this issue you can follow this steps:
  1. Run "sudo yum install webkitgtk" command from terminal.
  2. Go to "eclipse.ini" file (located in the root of eclipse installation directory) and add "-Dorg.eclipse.swt.browser.UseWebKitGTK=true" at the end of this file.
Have a nice time.

2012-12-08

Creating mobile web application using GWT without any third party library


Recently, i am working on a small project for producing a mobile web application using GWT. I have read lots of advises and subjects about this, there are several third party library (like mgwt, SmartGWT.mobile and ...) which can do this but for right to left considerations i would like to use pure GWT. After several days i find some useful tips:
  • Use MVP pattern for building Device-specific UIs.
  • Use formfactor property in Deferred binding or FormFactor module to select best UI for client device (tablets, phones and ..).
  • Use DockLayoutPanel as much as possible for better layouting.
  • Capture and respond to device orientation changes using ResizeHandlers.
  • Use GWT's Client Bundle to batch resource fetches for increase responsiveness.
  • Use Code Splitting to grab only the code you need to minimize startup time.
  • Use Application Cache (HTML5 feature) for Loading resources like HTML, CSS, and JS from disk.
  • Use HTML5 local storage feature for working without connection and reading/writing data into local database.
You can get this pdf and also see this link to see several useful tips, there is also a good chapter in this book about building mobile application using GWT.

Have a nice time.

2012-11-09

Focusing ...

I have decided to focus on some of important parts of my life and i do not want to know anything that i like in detail. Although this was a hard decision but i think it will help me to achieve better thing in my life.

2012-08-25

Install Kubuntu 12.04 on Sony VAIO Z Series VPC-Z213GX

Hi all,

I installed Kubuntu 12.04 on my Sony VAIO Z Series VPC-Z213GX without any problem. Almost everything works fine:
  • Bluetooth
  • Wifi
  • Blu-ray drive
  • Function keys 
  • Keyboard Backlight
  • Web cam (using Kopete)
  • ...
Although i can not use finger print module yet but its performance is great in Kubuntu.

have a nice time.

2012-08-13

Ctrl + F4 doesn't close current tab on Firefox in KDE

Hi all,

This is a common problem for KDE newcomers. This is because of default value in KDE Global Keyboard Shortcuts. By default "Ctrl + F4" keyboard shortcut assign to "Switch to Desktop 4" action in KDE Global Keyboard Shortcuts and then if you have 4 virtual desktop (or more) in your KDE desktop, "Ctrl + F4" bring you to 4th desktop and if not it does not do anything !
To solve this problem (if it is a real problem for you like me), you have to assign another keyboard shortcut to "Switch to Desktop 4" action:
  1. Open KDE Global Keyboard Shortcuts program.
  2. From KDE component combo box select "KWin".
  3. In the search text box type "switch to desktop".
  4. Finally, in the search result lest, reassign another keyboard shortcut to "Switch to Desktop 4" action.
have a nice time.

2012-08-10

KDE Plasma and Applications 4.9 is very stable

Hi all,
I have installed several Linux distributions based on KDE on my machines, but i always had problem with KDE bugs (and also the ugly window which want to report the bug :-D).
I upgraded my Kubuntu 12.04 to KDE Plasma and Applications 4.9. It is one of the best KDE i have ever seen. I have not seen any bug yet and its performance is better that past.
Congratulation to KDE team for this fantastic release.

have a nice time.

2012-08-04

How to download NetBeans plugins manually !

Hi,

Sometimes you want to download NetBeans plugins from outside of NetBeans IDE for example for offline installation. for this purpose :
  1. From menu, go to Tools -> Plugins.
  2. In the last tab (setting), you will see a update centers list (on left side) e.g. "Certified Plugins"
  3. You have to know your desire plugin is located in which update center.
  4. select that update center from list (e.g. Certified Plugins) and then from right side click on the "Edit" button.
  5. from the shown dialogue, copy text in URL text box (do not copy last part of URL, in this case "catalog.xml.gz", only copy the address of  xxx.gz file e.g. "http://updates.netbeans.org/netbeans/updates/7.2/uc/final/certified")
  6. Now you can paste the URL in your browser and find your plugin in folders.

have a nice time.

2012-07-31

Generate WSDL file and Web Service Client with jaxws-maven-plugin

Hi,

In this post i want to describe:
  1. how to generate a WSDL file from the JAX-WS annotated class using jaxws-maven-plugin (jaxws:wsgen)
  2. how to generate the Java client class files from the generated WSDL file using jaxws-maven-plugin (jaxws:wsimport)
     
Firstly you have to generate your WSDL file from JAX-WS annotated class (class that annotated with @WebService), for this purpose you can use jaxws-maven-plugin, this maven plugin has a goal with name "wsgen", you can configure your maven project so that generate WSDL file during build process:

    <build>
        <plugins>
                                .
                                .
                                .
            <plugin>
                <groupId>org.jvnet.jax-ws-commons</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <execution>
                        <id>SimpleWS</id>
                        <goals>
                            <goal>wsgen</goal>
                        </goals>
                        <configuration>
                            <sei>com.saeed.NewWebService</sei>
                            <genWsdl>true</genWsdl>
                            <encoding>UTF-8</encoding>
                            <inlineSchemas>true</inlineSchemas>
                            <verbose>true</verbose>
                        </configuration>
                    </execution>
                    
                    <execution>
                        <id>TestWS</id>
                        <goals>
                            <goal>wsgen</goal>
                        </goals>
                        <configuration>
                            <sei>com.saeed.TestWebService</sei>
                            <genWsdl>true</genWsdl>
                            <encoding>UTF-8</encoding>
                            <inlineSchemas>true</inlineSchemas>
                            <verbose>true</verbose>
                        </configuration>
                    </execution>

                </executions>

                <dependencies>
                    <dependency>
                        <groupId>org.glassfish.extras</groupId>
                        <artifactId>glassfish-embedded-all</artifactId>
                        <version>3.1.1</version>
                    </dependency>                    
                  
                    <dependency>
                        <groupId>com.sun.xml.ws</groupId>
                        <artifactId>jaxws-tools</artifactId>
                        <version>2.2.5</version>
                    </dependency>
                </dependencies>
            </plugin>

        </plugins>
    </build>

Note that you have to repeat "execution" tag for each jax-ws class with different id. The WSDL file will generate in "target/generated-sources/wsdl" directory (you can see other configuration tag from this).

Then you have to use generated WSDL file to generate Java client class files . for this purpose you can use "wsimport" goal :

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>1.10</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                        <configuration>
                            <wsdlDirectory>
                                ../saeed-web/target/generated-sources/wsdl
                            </wsdlDirectory>
                            <wsdlFiles>
                                <wsdlFile>NewWebService.wsdl</wsdlFile>
                            </wsdlFiles>
                            <wsdlLocation>http://saeed-linux:8080/saeed-web/NewWebService?wsdl</wsdlLocation>
                        </configuration>
                        <id>wsimport-generate-NewWebService</id>
                        <phase>generate-sources</phase>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>javax.xml</groupId>
                        <artifactId>webservices-api</artifactId>
                        <version>1.4</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
                    <xnocompile>false</xnocompile>
                    <verbose>true</verbose>
                    <extension>true</extension>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>webservices-rt</artifactId>
            <version>1.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

Now you can use codes which are generated into "sourceDestDir" to call web service method in your client application.

have a nice time.

2012-07-27

How to change window manager to OpenBox in Linux Mint 13 Mate

OpenBox is a light , stable and fast X window manager for X desktop environments.  and also it is default window manager for LXDE desktop environment. if you want to change Linux Mint 13 Mate window manager to OpenBox follow these steps:

  1. Install "openbox" package from package manager.
  2. In a terminal type "mateconf-editor"
  3. In configuration editor tree go to "/desktop/mate/session/required_components/windowmanager" and replace "marco" with "openbox".
  4. Open Startup Applications from mint menu, and add a new startup program "OpenBox" with command "openbox --replace".
  5. now restart your machine.
  6. in your first login you may face a session error dialogue, click on the "ok" button in the dialogue and then in the login page change your session to "mate"
  7. after login you can go to the "Openbox Configuration Manager" program for further configuration.
now you have OpenBox window manager with Mate desktop environment.

have a nice time.

2012-07-23

Sample chat application using NIO

Hi,
Programming with NIO API is very hard and complicate than traditional blocking IO (streams) in java.  I found a good sample in the web that easily demonstrate java NIO features using a chat application.

ChatterClient
ChatterServer

have a nice time.

2012-07-07

My first Erlang module !

Hi,

I have started to learn Erlang programming language but now i am trying to write program in functional manner and it is my first program in a functional approach (in whole my life). This program calculate sum of a list items.


-module(saeed).
-export([total/1]).

total([]) -> 0;
total([Item|Tail]) -> Item + total(Tail).


have a nice time.

2012-06-04

Install Linux Mint 13 mate edition on Eee PC T101MT

Hi,

I installed Linux Mint 13 mate edition on my Eee PC T101MT and now the result is fantastic , because touch screen functionality works prefect and i can use touch screen in Linux.


have a nice time.

 

Coming back

Hi everybody,

I come back to my old home in the web (from here). I will write here.

have a nice time.

2011-09-09

My new weblog !

Hi
I can not post in this weblog easily because of i live in Iran and the blogger is filtered (block by government). 

have a nice time.

2011-08-27

When is the end of the terrible days ?

When is the end of the terrible days ?
That day will come and I will be free.
...