Render Bootstrap 3 forms with WTForms and Jinja

November 10th, 2013 14 comments

We all know amazing libraries Jinja and WTForms which simplify our life in rendering web pages for user. By default, they don’t provide any advanced formatting or styling. One of the ways to solve this is to use Bootstrap library. This post will show how to integrate this three libraries all together using forms as example.

NOTE: Code for this post is embed at the end of the post or you can jump directly to gist in the new tab (recommended): https://gist.github.com/bearz/7394681

Read more…

Categories: Python, Web Tags: , ,

Implementing postMessage technology in GWT

April 8th, 2013 No comments

It was long time since I wrote last blog post here. I’ll do this more often now.

Today’s post will be about postMessage and how to use postMessage and GWT. In two words, postMessage is a html5 technology that allow you to exchange messages between iframe and parent and even between tabs (IE has some limitations on messages between tabs). If you want to know more about postMessage here is the few articles about:

The last one is extremely good in explanation what is postMessage and how to implement it. I used it when adopting this technology to use in GWT.

Read more…

Categories: GWT Tags: , , ,

Sort hash map keys in revert order in GWT

December 8th, 2011 No comments

This short post will be about sorting. In GWT, unfortunately, there are no descending iterator. Eclipse allow you to add it, but on compile time it just crashed. Solution is simple but not obvious, so I decided to post about this.

Task: Sort hash map with some keys in descending order. For simplicity we will take an integer keys.

Solution:

Let’s assume we have a hashMapForSort – as hash map that we need to sort. Following code below will return all your keys in descending order

List<Integer> tmp = new ArrayList<Integer>(hashMapForSort.keySet());
 
Collections.sort(tmp, new Comparator<Integer>() {
 
    @Override
    public int compare(Integer arg0, Integer arg1) {
        return -arg0.compareTo(arg1); // a little trick to have numbers in descending order
    }
 
});
 
Iterator<Integer> iter = tmp.iterator(); // create an iterator by sorted collection
while (iter.hasNext()) {
    Log.warn(iter.next() + "");
}

Actually, you can sort any objects in this way, just defining a comparator you need.

Categories: GWT Tags: ,

Why Google Web Toolkit (GWT)?

October 1st, 2011 No comments

In this article I’m going to describe my point of view on such great technology as GWT and try to explain when and why you must choose it. Because GWT adding a lot of complexity while developing applications you need to know exactly why you add this complexity to your development process and where you will receive benefits from it.  Read more…

Categories: GWT Tags: , , , ,

Easy running nose tests with two and more named attribute

September 30th, 2011 No comments

For running tests there are a lot of different tools. One of them is nose-python. You can easily split tests by groups using “attr” annotation. More info in the doc . But doc don’t say how to run tests when you must choose more than one attribute. It is easy:

nose -A "type=='unit' or type=='apitest'"

 

Disabling cache in Shindig

July 22nd, 2011 No comments

This post will be short by may be useful for someone who want to start developing gadgets with OpenSocial platform.

Read more…

Categories: General Tags: , ,

Patching Google Web Toolkit for compiling chrome permutation

July 17th, 2011 3 comments

Google Web Toolkit is awesome tool for creating Rich Internet Applications (RIA). It has a lot of different features to simplify work of developer and create a really reliable and fast internet application. One of the features that widely used in gwt is Deferred binding. In few words, this feature doing next thing: it provide a possibility to create browser related code and avoid any runtime checks for what is current browser. By default permutations is created for this browsers: opera, ie6, ie8, ie9 (from gwt2.3), webkits (chrome, safari), firefox. Because of very fast chrome growth sometimes renders for chrome and webkit are different. From my experience I have following problems for chrome: while parsing JSON chrome don’t save the order of keys from server (it puts keys starts with numbers on the first place), sometimes some paddings different from safari (especially when you use a lot of wrapper divs)

Read more…

Categories: GWT Tags: , , , ,

Setting up slave machine for Hudson/Jenkins

July 14th, 2011 3 comments

Jenkins (renamed version of Hudson) is very powerful automation tool that enables you to create continuos integration or even continuos development on your project. If you plan to work on project in team and expected that time of project will be more than 1-2 month than you must spend some time and setup automation builds. Jenkins is one of the tools that provide with good quality web-interface for  automatic build. In this article I’ll talk about setup of remote build of your project. Read more…

Updating macbook pro with SSD and RAM

July 13th, 2011 No comments

So, you are already happy user of macbook pro, but for your tasks basic configuration is not enough? The most easy way to update your macbook is to upgrade RAM and put SSD instead of HDD. If you want to do this upgrade here are some tricks how to do this and have the same system as you have before in 3 hours or so.

Read more…

Categories: MacOS Tags: , , , ,