Thursday, April 30, 2015

UX research - Label Placement in Forms

Read this article:
http://www.uxmatters.com/mt/archives/2006/07/label-placement-in-forms.php

Conclusions

Some interesting guidelines arose from this brief analysis of our test results. Coupling the following guidelines with Luke Wroblewski’s form design guidelines will help you to build the best form possible in each different situation.
  • Label position—Placing a label above an input field works better in most cases, because users aren’t forced to look separately at the label and the input field. Be careful to visually separate the label for the next input field from the previous input field.
  • Alignment of labels—In most cases, when placing labels to the left of input fields, using left-aligned labels imposes a heavy cognitive workload on users. Placing labels above input fields is preferable, but if you choose to place them to the left of input fields, at least make them right aligned.
  • Bold labels—Reading bold labels is a little bit more difficult for users, so it’s preferable to use plain text labels. However, when using bold labels, you might want to style the input fields not to have heavy borders.
  • Drop-down list boxes—Use them with care, because they’re so eye-catching. Either use them for important data or, when using them for less important data, place them well below more important input fields.
  • Label placement for drop-down list boxes—To ensure users are immediately aware of what you’re asking for, instead of using a separate label, make the default value for a drop-down list box the label. This will work for very long lists of items, because a user already has the purpose of the input field in mind before the default value disappears.

Tuesday, April 28, 2015

GWT facet configs



-Xmx1024m -XX:MaxPermSize=512m -Dgwt.codeserver.port=9876
-logLevel DEBUG -port 8082 -noserver

-Xss1024k
-XdisableCastChecking


Saturday, April 25, 2015

Install Tomcat on Ubuntu

sudo apt-get update
sudo apt-get install tomcat7

https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-7-on-ubuntu-14-04-via-apt-get

If Tomcat had been installed correctly you should be able to see the info below by url: http://localhost:8080

It works !

If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!
This is the default Tomcat home page. It can be found on the local filesystem at: /var/lib/tomcat7/webapps/ROOT/index.html
Tomcat7 veterans might be pleased to learn that this system instance of Tomcat is installed with CATALINA_HOME in /usr/share/tomcat7 and CATALINA_BASE in /var/lib/tomcat7, following the rules from /usr/share/doc/tomcat7-common/RUNNING.txt.gz.
You might consider installing the following packages, if you haven't already done so:
tomcat7-docs: This package installs a web application that allows to browse the Tomcat 7 documentation locally. Once installed, you can access it by clicking here.
tomcat7-examples: This package installs a web application that allows to access the Tomcat 7 Servlet and JSP examples. Once installed, you can access it by clicking here.
tomcat7-admin: This package installs two web applications that can help managing this Tomcat instance. Once installed, you can access the manager webapp and the host-manager webapp.

NOTE: For security reasons, using the manager webapp is restricted to users with role "manager-gui". The host-manager webapp is restricted to users with role "admin-gui". Users are defined in /etc/tomcat7/tomcat-users.xml.

Good source of pictures / images for desktop (link)

Friday, April 24, 2015

How to use TextResource in GWT ClientBundle (link)

interface Resources extends ClientBundle {
  Resources INSTANCE = GWT.create(Resources.class);

  @Source("a.txt")
  TextResource synchronous();

  @Source("b.txt")
  ExternalTextResource asynchronous();
}

// Using a TextResource
myTextArea.setInnerText(Resources.INSTANCE.synchronous().getText());

// Using an ExternalTextResource
Resources.INSTANCE.asynchronous().getText(new ResourceCallback<TextResource>() {
  public void onError(ResourceException e) { ... }
  public void onSuccess(TextResource r) {
    myTextArea.setInnerText(r.getText());
  }
});
 
http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#TextResource

Wednesday, April 22, 2015

Encoding configs of Maven pom.xml in GWT project

<properties>
        <java.version>1.7</java.version>
        <resources.encoding>UTF-8</resources.encoding>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        ...

Tuesday, April 21, 2015

SQL - good workbook in Russian, part 5

PART 1 - http://habrahabr.ru/post/255361/
PART 2 - http://habrahabr.ru/post/255523/
PART 3 - habrahabr.ru/post/255825
PART 4 - habrahabr.ru/post/256045

Часть пятая — habrahabr.ru/post/256169

В данной части мы рассмотрим


Здесь мы в общих чертах рассмотрим работу с операторами модификации данных:
  • INSERT – вставка новых данных
  • UPDATE – обновление данных
  • DELETE – удаление данных
  • SELECT … INTO … – сохранить результат запроса в новой таблице
  • MERGE – слияние данных
  • TRUNCATE TABLE – DDL-операция для быстрой очистки таблицы

SQL - good workbook in Russian - parts 3, 4


PART 1 - http://habrahabr.ru/post/255361/
PART 2 - http://habrahabr.ru/post/255523/
PART 3 - habrahabr.ru/post/255825
PART 4 - habrahabr.ru/post/256045
PART 5 - habrahabr.ru/post/256169
ЧАСТЬ ТРЕТЬЯ

О чем будет рассказано в этой части


В этой части мы познакомимся:
  1. с выражением CASE, которое позволяет включить условные выражения в запрос;
  2. с агрегатными функциями, которые позволяют получить разного рода итоги (агрегированные значения) рассчитанные на основании детальных данных, полученных оператором «SELECT … WHERE …»;
  3. с предложением GROUP BY, которое в скупе с агрегатными функциями позволяет получить итоги по детальным данным в разрезе групп;
  4. с предложением HAVING, которое позволяет произвести фильтрацию по сгруппированным данным.

Saturday, April 18, 2015

GWTBootstrap3 sample project structure

git clone https://github.com/gwtbootstrap3/gwtbootstrap3-sample-app.git 

Wednesday, April 15, 2015

Enable Maven to get dependency from custom repository by adding settings.xml file into .m2 directory

In order to enable Maven to get dependency from custom repository add settings.xml file into .m2 directory of current user.

GIT clone - how to deal with connection errors of https urls

Open for edit .gitconfig:
Add this property:

[http]
     sslVerify = false

Get horizontal scroll and enable maximazing of window of Command Prompt (cmd) on Windows 7

  1. Open a Command Prompt (cmd.exe) by typing cmd in Start menu e.g.
  2. From inside the Command Prompt window, run wmic
  3. Right-Click the title bar of the Command Prompt window and select Properties
  4. Check QuickEdit Mode
  5. Exit the Command Prompt
All subsequent launches of the command prompt will have a horizontal scroll bar and support maximizing the window.

Tuesday, April 14, 2015

Trigger the Volume Control on Windows with shortcut

Right click on a empty area on desktop, and click on New and Shortcut.

Paste the following in to the location of the item area:-


%windir%\System32\SndVol.exe -f 49825268
Click Next button and give a name to the Shortcut and click Finish.

Now You right click on it and select Properties.

Click Shortcut tab.

Assign your desired shortcut key like F8 or F9 in the Shortcut Key area.

Click OK/Apply.

Good workbook of SQL (Russian)


PART 1 - http://habrahabr.ru/post/255361/
PART 2 - http://habrahabr.ru/post/255523/

О чем данный учебник


Данный учебник представляет собой что-то типа «штампа моей памяти» по языку SQL (DDL, DML), т.е. это информация, которая накопилась по ходу профессиональной деятельности и постоянно хранится в моей голове. Это для меня достаточный минимум, который применяется при работе с базами данных наиболее часто. Если встает необходимость применять более полные конструкции SQL, то я обычно обращаюсь за помощью в библиотеку MSDN расположенную в интернет. На мой взгляд, удержать все в голове очень сложно, да и нет особой необходимости в этом. Но знать основные конструкции очень полезно, т.к. они применимы практически в таком же виде во многих реляционных базах данных, таких как Oracle, MySQL, Firebird. Отличия в основном состоят в типах данных, которые могут отличаться в деталях. Основных конструкций языка SQL не так много, и при постоянной практике они быстро запоминаются. Например, для создания объектов (таблиц, ограничений, индексов и т.п.) достаточно иметь под рукой текстовый редактор среды (IDE) для работы с базой данных, и нет надобности изучать визуальный инструментарий заточенный для работы с конкретным типом баз данных (MS SQL, Oracle, MySQL, Firebird, …). Это удобно и тем, что весь текст находится перед глазами, и не нужно бегать по многочисленным вкладкам для того чтобы создать, например, индекс или ограничение. При постоянной работе с базой данных, создать, изменить, а особенно пересоздать объект при помощи скриптов получается в разы быстрее, чем если это делать в визуальном режиме. Так же в скриптовом режиме (соответственно, при должной аккуратности), проще задавать и контролировать правила наименования объектов (мое субъективное мнение). К тому же скрипты удобно использовать в случае, когда изменения, делаемые в одной базе данных (например, тестовой), необходимо перенести в таком же виде в другую базу (продуктивную).

Monday, April 13, 2015

THE Java™ Programming Language, Fourth Edition - PDF

http://www-public.int-evry.fr/~gibson/Teaching/CSC7322/ReadingMaterial/ArnoldGoslingHolmes06.pdf

Thursday, April 9, 2015

GwtBootstrap3 how to implement collapse button for menu bar e.g. navbar


NavbarCollapseButton can have many targets that are collapsable components:

<b:NavbarCollapseButton dataTarget="#ab-toolbar-collapse,#other-toolbar-collapse"/>

     <b:NavbarCollapse ui:field="abToolbarCollapse"> 
               (#id for "abToolbarCollapse" should be set in corresponded UiBinder java class)
     </b:NavbarCollapse>

     <b:NavbarCollapse ui:field="other-toolbar-collapse"> 
               (#id for "otherToolbarCollapse" should be set in corresponded UiBinder java class)
     </b:NavbarCollapse>

Java: get key by value from map - GWT BiMap

public static <T, E> T getKeyByValue(BiMap<T, E> map, E value) {
        for (Map.Entry<T, E> entry : map.entrySet()) {
            if (value.equals(entry.getValue())) {
                return entry.getKey();
            }
        }
        return null;
    }

Wednesday, April 8, 2015

How to register event for GWT EventBus

injector.getEventBus().addHandler(PlaceChangeEvent.TYPE, new PlaceChangeEvent.Handler(){
        @Override
        public void onPlaceChange(PlaceChangeEvent placeChangeEvent) {
            getKeyByValue(itemsMap, placeChangeEvent.getNewPlace());
        }
    });

Saturday, April 4, 2015

GWT run configurations in Idea

-Xmx1024m -XX:MaxPermSize=512m

-Xmx1024m -XX:MaxPermSize=512m -Dgwt.codeserver.port=9876

How to install Idea on Ubuntu


If you want to install Idea on Ubuntu follow this instruction: