Archive

Author Archive

Blog movement…. GeeCON, TalentHacker.com and Dexterslab

Hey readers!

I do apologize for such long delay, it was caused by lot of things. If I should chose only three principals, it was my Ph.D.. The thesis is standing in the front line, the second was/are my GeeCON related activities and the third can be placed the project TalentHacker.com and related Dexterslab.cz .

The TalentHacker.com is very excited project, you can check our websites, blog to get better understanding. Maybe, it is more useful to visit and read down our Dexterslab.cz blog.

Next time you can reach my personal blog on following links:

www.miroslavkopecky.com, www.miroslavkopecky.eu and very soon www.miroslavkopecky.cz

It would be great to find a time to send couple of posts about technologies I’m currently dealing with (Playframework, AWS, NoSQL, Android, iPhone iOS,  Google App Script, Statistics, Sites, Blogger, jQuery, Javascript and etc. ).

I do believe it will be soon… stay in touch!

Cheers, miragemiko 

//

Categories: brief news

How to install db46 on Snow Leopard

April 30, 2011 Leave a comment

I hope it helps, but this is the way how to install db46 to the MacOSX Snow.  Before I’ve always received this:

--->  Configuring db46
--->  Building db46
Error: Target org.macports.build returned: shell command failed (see log for details)
Log for db46 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_db46/main.log
Error: Status 1 encountered during processing.
To report a bug, see <http://guide.macports.org/#project.tickets>

Just follow this steps and db46 installation pass The easiest fix is to install it without java (and you don't need java)
sudo port -v selfupdate 
port clean db46 
port install db46 +no_java

PS: I hope I'll start blogging again and very soon. I don't like my 
being under rush because of thesis. 
Categories: brief news, MacOS Snow

How to Change our MAC Address on Ubuntu ?

December 21, 2010 Leave a comment

Today I’ve received new Desktop computer for my office. It was nice until I realized I have to contact network admin. He was out already…  So simple solution was to do manual change of MAC address and use that one from previous desktop.  Here are steps

#sudo  vi /etc/network/interfaces

than when you are using dhcp a I do just change text in following manner:

auto eth0
iface eth0 inet dhcp
hwaddress ether 00:00:00:00:00:00

then close vi and run this command

#sudo /etc/init.d/networking restart

And you are connected back !

Categories: Ubuntu Geek

Stripes, Spring, Play on the scene

December 15, 2010 2 comments

Currently we are working on decision which one of framework (MVC) candidates to use … stripes, play or spring (or combination )…  We’ve worked on simple task. The authentication (security) methods on stripes and play. The Security controller in Play is quite simple in default.
googling  results…

The best performance is to be found with the action based frameworks (no paradigm mismatch as the component based frameworks have). The Shortlist would be Stripes first and Spring the  second.  So how to extend this about PlayFramework ?

Stripes Framework (Pro):

  1. Fast
  2. SEO friendly links
  3. Elegant easy to understand code (1 thread per action).
  4. Low learning curve, any Java web developer can quickly learn it.
  5. 100% open source, no chance of future license changes.
  6. Focused and small integrates with any stack.

Stripes Framework (Against):

  1. Less well known
  2. Not full stack

Spring MVC (Pro):

  1. Fast
  2. SEO friendly links
  3. Lots of developers have worked with Spring (but less with Spring MVC).
  4. Full stack, part of Spring framework.

Spring MVC (Against):

  1. Higher learning curve
  2. More complex code: because beans need to be programmed tread safe, result is procedural code.
  3. You might need to buy licenses from VM Ware in the future if you want to get all latest patches.
  4. License terms can and have changed for future versions.
  5. Full stack, you might get more than you need.
Categories: brief news, JAVA

Handle onClick event using XML

December 14, 2010 Leave a comment

This is simple example how to handle onClickButtonEvent().  Situation at the beginning is following.  You have defined  some_activity.xml stored inside project res/layout folder .  This code snipped is defined inside XML file:

<LinearLayout ….
<Button android:id=”@+id/home_btn_even”    style=”@style/EventButton”   android:onClick=”onClickButtonEvent”    android:text=”@string/btn_event”       android:drawableTop=”@drawable/home_btn_event”/>
…</LinearLayout>

Let’s aim at  android:onClick=”onClickButtonEvent”  … The button is displayed inside the main Activity where is defined the method

public class MainActivity extends Activity implements AsyncQueryListener, Receiver
……
/** Handle “on ClickEvent” action. */
public void onClickButtonEvent(View v) {
startActivity(new Intent(Intent.ACTION_VIEW, Object.CONTENT_URI));
}
…..

it’s better and more effective than following code snipped

btnSimple.setOnClickListener(
new OnClickListener(){
public void onClick(View v) {
Log.i(tag,”onClick Simple”);
……

Categories: Google Android

Stripes Framework: Why can it be useful for you ?

December 13, 2010 Leave a comment

These days I’m working with this framework and I’m reading about it also… so short comments I want to have noted as quick summary.  I’ll extend it latter:

  • Smart binding:  Stripes goes a long way to bind URLs, parameters,and events from HTTP to Java so that your code remains simple and straightforward. The names in your view templates match the names of your Java classes, methods, and properties, so theassociation between the two is very clear.
  • Auto loading:  Stripes automatically discovers and loads your Stripes-related classes, so you can add, rename, and remove classes without worrying about keeping any configuration files (XMLor otherwise) in sync.
  • Validation:  Stripes provides a powerful validation mechanism that is based on annotations.
  • Type conversion and formatting: Stripes gives you strong type support by automatically converting between Strings and common Java types and making it easy to add your own data types to its conversion system.
  • Layouts: With three tags from its tag library, Stripes gives you a simple and powerful reusable layout mechanism. You guess edit—no configuration files involved here either.
  • Localization:  Stripes tags have a default resource bundle lookup strategy so that localization is simple.
  • Exception handling: When an exception goes all the way up the stack without being handled, the servlet container shows a big ugly exception page. You don’t want your users to see that!  Stripes lets you show specific error pages for the exception types that youcare about and has a general “catch all” error page for all other exceptions.
  • Interceptors:  When handling a request,  Stripes goes through several life-cycle stages before providing a response. Interceptors letyou write code that is called before or after any of these stages, making it easy to alter the flow, change the data, and so on.  Interceptors are a great way of plugging in custom behavior.
  • Customizable URLs:  Stripes takes care of all the URL binding for you, so you can write your whole application without ever bothering with URLs.  However, if you need specific URL patterns,  Stripes lets you do that too.
  • Easy Ajax integration:  With the simple and transparent request response nature of Stripes, you can Ajaxify your applications by using your favorite Ajax framework as a front end and Stripes as a back end.
  • Testing:  Stripes comes with a built-in set of mock objects that help you write automated unit tests to make sure your application works as expected.
  • Easy extension and customization:  Stripes is designed in a modular fashion with many areas to hook into. You can plug in different behavior for any part of the framework. Extensibility is an are a where Stripes really shines, and if you’re not used to being able to easily insert custom code into a framework, you’re in for a real treat.
Categories: brief news, JAVA

discussionNotes: Google AppEngine and AmazonWeb Services as main actors

December 12, 2010 Leave a comment

It’s question which one choose for startUP project ? It’s fair to mention you want to run on Java Virtual Machine (JVM).  I guess you have three choices: Google AppEngine, Amazon Web Services or rent your own Server.  Which one is better ? Good question … I think it always good is to follow your knowledge base and your pocket ( money you have assigned for the project ) and comfort…

My Friend Fraktalek has published the new post “Google AppEngine vs. Amazon Web Service” so I don’t want to writing about similar things, you can read it.

Amazon has announced ONE YEAR free package to give you ability of using AWS Free Tier ( 613 MB of memory and 32-bit and 64-bit platform support). Management console allows you to set up your tier (t1.micro is that one for free).  You can choose op. system image to have installed there … and Amazon command line tools EC2 to connect to your new virtual system.  You can for example install Tomcat Server and use SimpleDB as main database …. What I want to note is that you have full administration rules. That means freedom.  In this way I’m very glad for Cloud Computing … You don’t have to care about hardware or something like this only choose what you want to use or install it.  I have also tested building small farm inside AWS  Cloud (IPs setups and firewalls etc. ).   I’m not able to say the economic payload (have to do calculation).  At the first look I think it’s good invest time to study AWS closer … example user could be WikiLeaks (no comment ) :)

Compare to GAE, which is the platform, AWS needs more time to read how it works. You are also forced to get better understanding around (Is it really bad ?). What you gain is the freedom.  GAE you could simply integrate to your IDE and don’t care how it’s working. Google engineers are too smart to make it works. You have to follow only restrictions which are everywhere especially in “FREE” cases ;)

The third choice is your own server… nice and cool but I think you need to have more money even for system upgrades …  it’s up to you!

Categories: Google, JAVA

How to find Text inside files in subdirectories

December 10, 2010 2 comments

I have to note it somewhere because my brain is always trying to exclude it.
# find . -name  “*.java ” | xargs grep  geecon

Categories: Ubuntu Geek

Stripes Framework (IntelliJ IDEA 9.04) : Calculator Example as the new project

November 24, 2010 Leave a comment

Project is described on the Stripes main site  as the Beginner guide.  I’m using IntelliJ as my IDE for such applications. Here are steps how to avoid to common mistakes in web.xml setup.

What I have:

  1. IntelliJ IDEA 9.04
  2. Apache Tomcat 6.0.29
  3. Stripes 1.5.4

Create new project from scratch ( example “StripesExample” ).  You obtain project directory structure.  I’ll go from the top of this structure and add or change appropriate files inside. Before we start just do import of all Stripes and other necessary libraries for this example (commons-logging.jar, cos.jar, jstl.jar, log4j-1.2.15.jar, mail.jar,standard.jar, stripes.jar). Don’t forget  libraries are located in /WEB-INF/lib directory.

1. create new package inside “src” directory  (example: “examples.stripes“)
2. in this directory create new “CalculatorActionBean.java” and copy the source code. Don’t forget to change package name !
3. time to configure *.properties files (commons-logging.properties, log4j.properties, StripesResources.properties) . You can follow the manual. These files are located in “/WEB-INF/classes” directory
4. web.xml file configuration. It seems to be key to run the example properly.  If you have followed me  only do change in web.xml :

….
<filter>
<display-name>Stripes Filter</display-name>
<filter-name>StripesFilter</filter-name>
<filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
<init-param>
<param-name>ActionResolver.Packages</param-name>
<param-value>examples.stripes</param-value>
</init-param>
</filter>
……

Now should be everything ready to deploy on Tomcat server directly from IDE…

Categories: JAVA, Ubuntu Geek

Google AppEngine and PlayFramework v1.1 the first experience

November 22, 2010 Leave a comment

This Blog post  is the brief  report how to easily deploy example GAE application “lists-with-gae“. I have spend couple of hours today playing with this cool new framework.   I decided to test Google AppEngine  deployment  of mine project as the last point today. This report will be focused only on the ”lists-with-gae” project.  This project is located in default gae plugin installation.  Check the GAE-version you want to install to you Play project.  I should point out I’m running under Ubuntu 10.04 !

# play install gae-1.1
# play install siena-1.3

Than you need to define your GAE plugin in the project in conf/application.conf

# Additional modules
# ~~~~~
# A module is another play! application. Add a line for each module you want
# to add to your application. Module paths are either absolutes or relative to
# the application root.
module.gae=${play.path}/modules/gae-1.1
module.siena=${play.path}/modules/siena-1.3


before you return back to your project directory you have to edit your .bashrc file.  Define variable GAE_SDK:

export GAE_PATH=~/eclipse_helios/plugins/com.google.appengine.eclipse.sdkbundle.1.3.8_1.3.8.v201010161055/appengine-java-sdk-1.3.8/bin

than you have to change permission to the appcfg.sh file

#chmod +x  ~/eclipse_helios/plugins/com.google.appengine.eclipse.sdkbundle.1.3.8_1.3.8.v201010161055/appengine-java-sdk-1.3.8/bin/appcfg.sh

Note: It works perfectly. I have also tested to define unziped GAE directory directly but I received deployment errors! I recommend you to use Eclipse Plugin (Based on forum discussion)!

Now it’s time to run following command in the project “lists-with-gae” directory:
#play gae:deploy

I don’t know why you still receive in log this warning but …

21:12:08,197 WARN  ~ Google App Engine module
21:12:08,197 WARN  ~ ~~~~~~~~~~~~~~~~~~~~~~~
21:12:08,197 WARN  ~ No Google App Engine environment found. Setting up a development environement

… don’t worry,  everything gonna be deployed to your GAE project.   Edit war/WEB-INF/appengine-web.xml  and define your project before you run command above

<appengine-web-app xmlns=”http://appengine.google.com/ns/1.0″&gt;
<application>YOURTEST_PROJECT</application>
<version>2</version>
</appengine-web-app>

And now check it out …. it works :)

Categories: JAVA, Ubuntu Geek
Follow

Get every new post delivered to your Inbox.