Mostrando postagens com marcador English. Mostrar todas as postagens
Mostrando postagens com marcador English. Mostrar todas as postagens

07 abril 2009

Apache CouchDB on Fedora 10 64bit



CouchDB - Relax


I've been trying to install Apache CouchDB on my Fedora 10 and came to a few issues regardling libraries and other requirements to build it. If you are interested on CouchDB and/or how to install it on a Fedora system, this post might be useful for you.

The README file of Apache CouchDB doesn't list the equivalent packages for Fedora, so I had to dig a lot to finally get it right. First thing is to install all of these packages:
  • js-devel
  • libcurl-devel
  • libcurl
  • erlang
  • erlang-esdl-devel
  • erlang-pgsql-devel
  • compat-erlang
  • libicu
  • libicu-devel
  • libmozjs-dev
  • make
  • gcc
  • automake
  • gcc-c++
  • kernel-headers
  • glibc-devel
Then download Apache CouchDB, extract the file, and type:
[~/apache-couchdb-0.9.0]$ ./configure --with-erlang=/usr/lib64/erlang/usr/include/
The parameter above is needed because the script cannot find on Fedora, where the headers of Erlang are located. After this step, you should be ready to compile with make, and then install it as root with make install. But if you are NOT like me that likes to do things really fast - compile, install, run - you can create an RPM package. For this, you have to install rpmdevtools too. Follow this guide of How to create an RPM package.

Done. You can now type:
$ sudo couchdb
Open your web browser and point it to this URL: http://127.0.0.1:5984/.

Now relax and have fun!

21 abril 2008

wfx:// is the Web we need

Think of a Web where people get into it and see it not like online documents or feels-like-desktop applications. Think a little bit more and try to see it as an environment, a living environment full of effects, animation, integration and interaction. Is this what we want? Is this what we are looking for? Hell yeah! But look how people are trying to get this and you will probably conclude that they (us, the IT crowd) are going on the wrong way.

We are not trying to simplify how to get this task, of creating this online environment, easy to done. Every time, every day, every where there is somebody inventing a new way to publish, to implement, to provide, to integrate and to interact every single service. What is going on is that we are just getting this whole thing of online software development more complicated. Is there anyone out there looking at the root of the problem? Really...

Look at where we are now, right in the middle of a technology war, trying to decide which one to pick and fight against the others. Let's first list the core technologies before listing the web frameworks: .Net, Ruby, Java and PHP. These are the main ones, I'm pretty sure of that. Another thing I know is that, in this war, from the parts involved, the least worry about which technology we use, is the customer, the final user, as long as what they want it's delivered in HTML and Javascript. Because in this Online Environment, what we must deliver is this: HTML and Javascript, no matter what technology we have used to produce it. So, let's take a look now at this war's players: GWT, Ruby on Rails, .Net, Wicket, JSF, SpringMVC, Struts, Grails, and the new ones, Silverlight, Flex, JavaFX. Except the last three, all others have only one purpose: deliver HTML and Javascript. The difference between them is how this is done, how is developed.

I know this is a little bit confusing but now I will try to explain to you where I wanna get.

First, let me tell you something about these web frameworks that deliver HTML and Javascript: you will survive... for 5 to 10 years. Period. Your technology is old, dumb and slow. Yeah, you heard me: it's old. You have to be replaced with other options! The problem with HTML and Javascript is that we don't have other option so we are always trying to find an easy way to generate them and this is the root of the problem of so many frameworks living out there! And so many others being created! To evolve to a new Web we really have to forget about these two technologies. If you agree with me, follow to the next part: RIA technologies.

Yeah, the Internet is getting smarter. Now we develop online software with RIA frameworks. Looks like we have replaced "Web Frameworks" with "RIA Frameworks". This is good! Believe me. Now, instead of 3721863 options of web frameworks, there's only three options of RIA frameworks: Silverlight, Flex and JavaFX (does anybody know any other? please comment!). This reduction of options is good because if you know Java, go for JavaFX. If you prefer .Net, Silverlight is the answer and for old guys (Flash is out there for quite a while) Flex it!

Still, where is the root of the problem? RIA solves our problems? Can we develop online software quicker? Most important: can we deliver quicker? Let's put this in other words: can we satisfy our customer's needs quicker? Because this is what is really important for the reasons we have used to chose between this or that technology.

For this new war, the RIA war, I want to tell you another thing: if Silverlight really does not run (I mean for real, without cheats) cross-platform, it will stay out of this war soon or later. And to stay in the game, it must run everywhere: Windows, Linux, Solaris, BSD, OSX, etc.

Ok, let's think about the other two players: JavaFX and Flex. Which one has more chances to be the king of Web? I would put this way: Flex is going to be the prince and JavaFX its young brother (because for now, the kingdom is split between HTML and JS.) I'm sure that Flex will be the king in the short time. But with time JavaFX will grow up and become the Web King. And I'm not telling you this because I work with Java, but because I truly believe that JavaFX's proposal is better than Flex's, technically speaking of course; and this is because I believe the answer for a quicker delivery of customer's needs is in how we develop their problem's solutions.

You see, Flex has few disadvantagens over JavaFX: it is not that cross-platform. It relies over Flash, which is proprietary software. You have to know MXML and ActionScript, plus Java of course (for real applications).

Until I continue, I want to share with you something I have been thinking about for a couple of months: the best way for an easy development software process (logicaly giving you fast delivery) is to have the least amount of software languages and technologies as possible. This is why that I chose Wicket (pure HTML and pure Java) for my online softwares; this option gives me only two languages: HTML and Java, but just for now (remember, I told you that I believe in a Web without HTML... it will have its legacy, but is going to be over soon) while there's no better option of other online environment except the browser.

Now, if you followed me till here, first: thank you. If you understand what I'm talking about: thank you again. But to finish, I have to introduce you to the new Web, a web of effects, of quicker interaction, integration, animation and delivery. I give you the WebFX. It's the combination of only two languages... Yeah, I realized that it's impossible to have only one language; you have to separate logical code from the interface. One language for each side. Continuing... the combination of two languages with a new environment: the WebFX.

What is that? A new protocol, new way of delivering applications, RIFA is how I call the applications of WebFX. Rich Internet FX Applications. Web Browsers, HTTP, HTML and Javascript, we really want to evolve! And this is not possible if we continue to harp on. All these Web Frameworks, and now RIA, they just want to deliver you the same stuff, in a different form. For RIA applications, is just like desktop applications with remote connectivity. For Web Frameworks, is just HTML and Javascript.

Here we are... RIFA and WebFX. Applications and its environment. How would this be possible? Well, let's consider JavaFX for instance as the best option to implement this whole thing (this is my idea of how to implement this, technically speaking):

The customer installs a JWE (Java WebFX Environment), which comes with a JRE (of course) and a WebFX Browser (implemented in Java... of course!!). Then he/she opens the browser and types an URL:

wfx://ebay.com

What happens? The WebFX Server delivers the user a JavaFX file which represents a RIFA. This RIFA loads in a tab, over the same JVM, as an inner application (Sun, really... it's time to implement JSR 121 and give life back to Project Barcelona).

So, you have a Java application running in a Browser Tab. No back button, no Ajax cheats nor any other language except Java and JavaFX sintax. But wait, what if the customer asks the developer team to replace the application with a new interface? Well, change the application.fx file! Of course this can be implemented in any other technology, but what other technology is so cross-platform and open source as Java is?

Yeah, there are still some details to discuss about this whole new environment. But, this is now up to you. Comment, give some ideas. But I ask you: let's evolve this e-echo-system. Let's drop down old technologies.

Thank you for your attention... :-)

12 junho 2007

Wicket: Highlight current Menu with Generics!

Yeah! The title sounds weird, but it's something really cool. The idea is to do less if/else as possible to select the current menu.

This is what my Template.html looks like:
        <!-- menu -->   
<div id="menu">
<ul>
<li wicket:id="system">
<a wicket:id="link" href="System.html">System</a>
</li>
<li wicket:id="about">
<a wicket:id="link" href="About.html">About</a>
</li>
</ul>
</div>

So, yes there is some CSS behind to show a cool layout, but that is not the point. Just note that if a <li> has an id of "current" like this:
    <li id="current">...</li>

Imagine that the CSS setup will do the rest, throwing out some cool stuff to highlight the current/selected menu.

So, how any pages under System's menu tells Template that they belong to it? As simple as this:
class UsersCRUD extends Template<System> {
}

Done! How this works? Let's check what's happening inside Template's default constructor:
public abstract class Template<M> extends WebPage {
public Template() {
Class<M> clazz = (Class<M>) ((ParameterizedType) getClass()
.getGenericSuperclass()).getActualTypeArguments()[0];

add(new MenuItem("system", System.class, clazz));
add(new MenuItem("about", About.class, clazz));
}
}

And here goes the code for MenuItem:
public class MenuItem extends WebMarkupContainer {
/* Here the magic happens with CSS... */
public String getMarkupId() { return "current"; }

public MenuItem(String id, Class<? extends Template> linkTo,
Class<? extends Template> currentGeneric) {
super(id);

boolean isCurrentPage = currentGeneric.equals(linkTo);
setOutputMarkupId(isCurrentPage);
add(new BookmarkablePageLink("link", linkTo));
}
}

How about that? One simple equals and the conditional menu is done!

Oh, don't forget that Template is an abstract page and so, it has somewhere a <wicket:child/> so UserCRUD can be a subclass and do a composite page through inheritance.

Have fun Wicketers!!
Contato

Email:bruno.borges(at)gmail.com

LinkedIn: www.linkedin.com/in/brunocborges
Twitter: www.twitter.com/brunoborges
Comprei e Não Vou
Rio de Janeiro, RJ Brasil
Oracle
São Paulo, SP Brasil