Tuesday, November 23, 2010

Spring Webflow and JSF: strange behaviour when triggering action which name is "back"

I used action named "back" which triggered transition to end-state:

View:

<h:commandbutton id="back" value="#{relLabels.back_btn}" action="back">
</h:commandbutton>

Flow chunk:

...
<transition on="back" to="return-back"/>
</view-state>
<end-state id="return-back" />

When I click this button the following exception occurs:

Exception thrown in state 'return-back' of flow 'entity-type-process-type-relationship-flow'; nested exception is java.util.NoSuchElementException

Caused by:
java.util.NoSuchElementException - Exception thrown in state 'return-back' of flow 'entity-type-process-type-relationship-flow'; nested exception is java.util.NoSuchElementException

When I change action name to something else, for example "return-back" - it works OK, without exceptions. Very strange.

Spring Webflow version: 2.0-m1
JSF: MyFaces 1.2.7

Monday, August 24, 2009

Synchronizing music between iPod and PC

My music on iPod is categorized by genres on higher level, so the most important thing for me when writing music on iPod is correct genre value. I use Mp3Tag utility to mass-edit mp3 file tags. It is free, simple and nice. Then I use iTunes to actually write a music to iPod.
Open question left - what the utility I can use to export music from iPod. Currently I have tried CopyTrans and Ephod - noone worked for my environment.

Wednesday, February 25, 2009

Living with Linux, #3

So, much time have passed from my previous post about Linux. I was mainly obsessed with neural networks (and I continue to work in this field, at least I plan to continue). I have chosen Microsoft Windows + Microsoft Visual Studio 2008 platform for neural network development, so no place for Linux.

Then the project at my job when I worked the last year ended, and I was asked to learn Ruby on Rails. Some time passed and I have realized that I can resurrect my Linux experiments, because Linux is nice platform for RoR development. Later I have realized that it is more clean and native to ride RoR development on *NIX platform.

So, now I use openSUSE at my job as RoR developer. I have decided not to use xUbuntu, because of some problems - sometimes xUbuntu restarted PC while watching movies (why??? I don't know. I had to check logs, but I was too lazy at the moment) and sometimes it refused to take input from keyboard - both cases lead to restart. It fucked up my impression about Linux very much, so I decided to try another distributive - openSUSE with Gnome (openSUSE was chosen absolutely in a dumb way - because friend of my friend, whom I even don't know, installed it one month ago - "openSUSE" was just a latest Linux distributive name I have heard). Also I have found that XFCE is too lightweight and I need something more functional and feature-rich.

So, now I am almost totally satisfied with openSUSE as Linux distributive and Gnome as desktop environment - system is stable, almost all the needed software of latest versions is on install DVD, YaST system manager is nice and functional and Gnome is much more better than XFCE.
I have realized how to access windows shares from Linux box today -
smbclient ...
or
sudo mount -t cifs -o username=%%USER_NAME%% //%%SERVER%% /mnt/share

Now I need to learn some more - how to access our network printer, how to connect to our enterprise Microsoft Windows domain (don't know if I really need this - just for fun), how to customize my PC and video adapter to run Quake3 with nice FPS (I plan to write separate article about this) :>

Have a nice day!

Friday, October 17, 2008

Living with Linux, #2

It was a lot of fun to customize theme, window manager, fonts, workspaces and other stuff that can be customized without using command line too much. Now I feel myself rather comfortable with XFCE environment and know how to setup basic look'n'feel.
The most fun was trying various p2p network clients (my favourite network type is Direct Connect). I have tried few clients that come as source distributions - not able to compile no-one. Some problems with library dependencies - need more experience to compile Linux software. Then I have taken a look into Synaptic Package Manager, and the first client I have found - Valknut. I don't like it at all - it somehow takes a lot space on the screen displaying a little info at the same time and the overall impression after using it isn't very optimistic. My favourite RevConnect was much-much better :< The second one was MLDonkey which is absolute geek software - default way to use this piece of software is to execute this client as daemon, it runs a little web-server and you access it via your browser. It supports many p2p networks, and Direct Connect is amongst them, but I can't realize how to use it :<

Comments on todo's from #1:

-Add Cyrillic support
+it was very easy with XFCE Settings manager. However, I don't know how to add cyrillic outside of X Window system, but I don't need it.

-Learn how to install programs, the first candidate is Skype
+again, very easy - skype.com have skype .deb installation for Debian Linux derivatives (which xUbuntu is). Default way to install software here - via "apt" utility set or with GUI "apt" wrapper - Synaptic package manager. Some info about how you can install software in Linux

-Try to watch movies :> I'm watching House M.D. now
+Very easy, there is functionall poor but usable default multimedia app - Totem Movie Player, which downloaded all the needed codecs automatically.

-Install adequate Office program pack (Is it StarOffice?)
+OMG, forgot about this. It will be OpenOffice, I think no problem arise.

I'll continue to use xUbuntu, now time has come to do some programming stuff for my university (I'll need to setup Eclipse and all the Java-related stuff,Apache,MySQL etc.). Also I'll check what the opportunities exist to use my PC remotely. And of course - understand how can I use those geeky p2p clients.

Monday, October 6, 2008

Living with Linux, #1

Hi all!

I have decided that I should try Linux seriously, as primary and only operating system. There is UNIX course in my current Latvian University studying program which encouraged me to switch my mind to another alternative to Windows.

I have experimented with UNIX/Linux earlier, some five or six years ago - it was FreeBSD 4.x. I remember that it have taken me some time to customize and run X-window system successfully (as I remember it was KDE 1.x). My display was damaged due to somehow-badly customized refresh rates :D It have taken me some time to successfully recompile kernel to get sound card working :> Then I have never returned to UNIX/Linux world after this experiments with FreeBSD. It was very valuable experience - I have understood that Windows is very nice and comfortable operating system, not "must die" as many can say about it (and continue to using it).

So, I have chosen to try xUbuntu - it's Ubuntu lightweight derivative with XFCE as X-Window system. As I heard Ubuntu is very user-friendly, so it should be nice alternative to person who was working with Windows almost all the time.

First impressions - nice and cute system, very friendly. No problems with installation. Some useful software installed by default - Gimp, Firefox. No serial number :>

TODO for first time:

-Add Cyrillic support
-Learn how to install programs, the first candidate is Skype
-Try to watch movies :> I'm watching House M.D. now
-Install adequate Office program pack (Is it StarOffice?)

That's it.

Tuesday, August 26, 2008

Creating CHM

Today I were investigating how to create CHM help.

There is original Microsoft "compiler" - hhc.exe and simple IDE - HTML Help Workshop. Using this IDE and compiler you can do all the CHM-related affairs but it is not very convenient.

I have looked to some shareware utils - there 2 approaches to create CHM:
1) Create all the content using this util and then compile it to CHM. Very ugly and non-professional approach (not flexible + I had problems with Russian encodings in almost every tool I tried)
2) Create all the content (HTML, CSS and images) using your favorite tools and then feed the directory containing your prepared content to the util, make some customizations, save project for later usage and then compile it to CHM. Personally I found the second approach much more useful and professional. The most adequate tool for this I have found at the moment is Pocket CHM 4.3.

Monday, April 7, 2008

Quick way to convert table (CSV or any other shit) to SQL INSERT batch

Imagine, you have the following unending list of data:


...
49826 447965543413
68428 447965595078
69731 447965596678
116149 447965640054
121889 447965644402
148077 447965666626
177127 447965696290
269990 447965791450
...


You need to insert this data in new temporary table, to use this data in queries for analysing database. Now the best solution I know is to take any smart text editor (I use Notepad++) which can replace text using regular expressions.

So, search string will be ^([0-9]*)[ \t]([0-9]*)$ and replace string will be INSERT INTO table_name (attribute1, attribute2) VALUES (\1, \2), where \1 and \2 means numbers of capturing group. That's all - nice and fast way to do such a work, don't need to programm anything. As the output you'll have something like this:


...
INSERT INTO table_name (attribute1, attribute2) VALUES (49826, 447965543413)
INSERT INTO table_name (attribute1, attribute2) VALUES (68428, 447965595078)
INSERT INTO table_name (attribute1, attribute2) VALUES (69731, 447965596678)
INSERT INTO table_name (attribute1, attribute2) VALUES (116149, 447965640054)
INSERT INTO table_name (attribute1, attribute2) VALUES (121889, 447965644402)
INSERT INTO table_name (attribute1, attribute2) VALUES (148077, 447965666626)
INSERT INTO table_name (attribute1, attribute2) VALUES (177127, 447965696290)
INSERT INTO table_name (attribute1, attribute2) VALUES (269990, 447965791450)
...