вторник, 5 февраля 2013 г.

How to connect Adium to Lotus Sametime

To fix "version mismatch" error in Adium, go to Adium Preferences -> Accounts -> Sametime -> Options tab, tick "Hide client identity" then open the Terminal.app and run the following command:
defaults write com.adiumX.adiumX AISametimeMinorVersion -integer 8511

среда, 20 июня 2012 г.

How to add iOS5.1 SDK to XCode 4.2

As you, probably, know, 4.2 is the latest suplied XCode for Snow Leopard. Mountain Lion coming in a month and there is no reason to pay extra $30 for mid-update to Lion. But 4.2 shipped with SDK 5.0... What's about 5.1?

Here is how to add 5.1 to XCode 4.2 manually...
1. Download XCode 4.3.1 or 4.3.2, it shipped with 5.1 SDK;
2. Mount XCode .dmg;
3. Open Terminal and execute following commands:
sudo cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
sudo cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
sudo cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/5.1\ \(9B176\) /Developer/Platforms/iPhoneOS.platform/DeviceSupport/
cd /Developer/Platforms/iPhoneOS.platform/DeviceSupport/
sudo rm -f ./Latest
sudo ln -s ./5.1\ \(9B176\) ./Latest
Now start XCode and you can install in iPhone with iOS 5.1

понедельник, 14 февраля 2011 г.

SVN on Mac OS X in 10 steps.

1. Download Subversion DMG from
2. Setup Subversion
3. $ sudo mkdir /usr/local/svn
$ sudo svnadmin create /usr/local/svn/[PROJECT_NAME]
$ sudo chown -R www /usr/local/svn
4. Create httpd.conf on the base of content of /etc/apache2/httpd.conf
5. Add to LoadModule section
LoadModule dav_svn_module libexec/apache2/mod_dav_svn.so
At end of the file, add this include
Include /private/etc/apache2/extra/httpd-svn.conf
Copy edited file to /etc/apache2/httpd.conf, overwrite
6. Create /etc/apache2/extra/httpd-svn.conf with following content:
<Location /svn>

DAV svn
SVNParentPath /usr/local/svn

# how to authenticate a user
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/apache2/subversion.auth
# only authenticated users may access the repository
Require valid-user
</Location>

7. $ sudo htpasswd -cm /etc/apache2/subversion.auth [USER_NAME] and create password for the user
8. Stop and start Apache server using apachectl or by un-checking and checking the Web Sharing checkbox in System Preferences > Sharing.
9. To access SVN, the URL is http://localhost/svn/[PROJECT_NAME]. The configuration is using SVN ParentPath configuration which means that you can have multiple repositories in /usr/local/svn (e.g. project1, project2, etc)
10. Setup SVN in Eclipse/STS, type following path: http://localhost/svn/[PROJECT_NAME], enter [USER_NAME] credentials.

четверг, 3 февраля 2011 г.

GWT + Roo + MySQL: Special & Cyrillic characters in UTF8

Defaut app generated by Roo persisting special & Cyrillic characters not correctly, as '???'. To fix that, update generated database.properties file:

database.url=jdbc\:mysql\://localhost\:3306/[YOUR_DB_NAME]?autoReconnect\=true&useUnicode\=true&characterEncoding\=UTF-8

GWT. Collection fields

For example, you have something like:

@Entity
public class Contact {
...
@OneToMany(mappedBy="contact", targetEntity=Tag.class, fetch=FetchType.EAGER)
private List tags;
...
}

On first look, when you fetching contacts, their 'tags' fields should be already prepopulated... as they annotated as eager... But then you'll try to execute something like:

requestFactory.contactRequest().findAllContacts().fire(lastDataReceiver);

all 'tags' will be NULL.

To fetch collection fields together with parent entity you have to use:
requestFactory.contactRequest().findAllContacts().with("tags").fire(lastDataReceiver);

Spring ROO + GWT. Back-end.

Playing with Spring Roo and GWT 2.1.1 plugin... Sometimes like it, sometimes - not. It's a long story, I'll concentrate on some tricky points...

It was not clear for me, how they implementing back-end stuff, as there are no any code in entity classes, as it usually appears in GWT examples. I found what Roo generates all back-end as AspectJ classes paced into same package as an entity. They are Roo-managed and not intended to be modified... If you need some special methods, you may create them in the entity class, Roo will not overwrite your code.

The tricky point - STS hide such files, .aj, by default. To show them, go to drop-down menu in Package Explorer in STS -> Filters... -> uncheck "Hide generated Spring Roo ITDs".