XSLT snippet to convert string from hyphens to CamelCase

Here is a snippet to convert string in XSLT template from hyphenized text to CamelCase. (Developed today while creating new import/export templates for Doctrine2 YAML support).

Usage:

First:
		<xsl:call-template name="ConvertXmlStyleToCamelCase">
			<xsl:with-param name="text">orm-designer</xsl:with-param>
		</xsl:call-template>

Second:
		<xsl:call-template name="ConvertXmlStyleToCamelCase">
			<xsl:with-param name="text">orm-designer</xsl:with-param>
			<xsl:with-param name="firstLower" select="false()"/>
		</xsl:call-template>

Result:

First: ormDesigner
Second: OrmDesinger

XSLT Template:

	<!-- =========================================================================== -->
	<!-- === Convert camel-case-text to CameCaseText                             === -->
	<!-- === (c) Inventic s.r.o. ORM Designer team (http://www.orm-designer.com) === -->
	<!-- =========================================================================== -->
	<xsl:template name="ConvertXmlStyleToCamelCase">
		<xsl:param name="text"/>
		<xsl:param name="firstLower" select="true()"/>

		<xsl:variable name="Upper">ABCDEFGHIJKLMNOPQRSTUVQXYZ</xsl:variable>
		<xsl:variable name="Lower">abcdefghijklmnopqrstuvwxyz</xsl:variable>

		<xsl:for-each select="str:split($text,'-')">
			<xsl:choose>
				<xsl:when test="position()=1 and $firstLower = true()">
					<xsl:value-of select="substring(node(),1,1)"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="translate(substring(node(),1,1),$Lower,$Upper)"/>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:value-of select="substring(node(),2,string-length(node()))"/>
		</xsl:for-each>
	</xsl:template>

Feel free to use in whatever way you find it useful.

Problem with msdia80.dll

One of tool we’re using requires msdia80.dll file. Unfortunately this DLL is available only inside the VS2005 installation / redistributable pack. When you execute dump_syms.exe without this file, you will receive following message:

CoCreateInstance CLSID_DiaSource failed (msdia80.dll unregistered?)

One solution is to install Visual C++ 2005 Redistributable Package. Another way is download only msdia80.dll file and register it manually by using:

regsrv32 msdia80.dll

How to sign your Qt Mac OS X App for Gatekeeper

Starting from Mac os 10.8 apple applications requires certificate. Without that certificate (or without additional system tweaks described here on our product support page: http://support.orm-designer.com/5/macos-mountain-lion-10-8-unidentified-developer ) user will se following message:

"OrmDesigner2" can't be opened because it is from an unidentified developer.
MacOS unidentified developer in ORM Designer

Solution

To solve this error message it’s necessary to do following steps:

  1. Register in Apple developer program and pay $99 per year
  2. Download and install developer certificate
  3. Sign whole application
  4. Test it!

1) Register on Developer.apple.com

You need to create registration here: https://developer.apple.com/. It’s necessary to fill info about contact person and company. After that, your registration will be reviewed by apple team and if everything will be OK, your registration will be approved.

2) Use Apple site to generate certificates

Open https://developer.apple.com/account/overview.action ,choose Certificates,  Click Add. Than select certificate parameters suitable for your need. In my case it was Mac Development and  Developer ID.

Now you need to install this certificate to your developer machine. Simply double-click on certificate and let system to import it. You can check that certificate is imported in Go->Utilities->Keychain Access->login. Now search for “Developer ID Application: XXXX”

MacOS certificate

Note: In my case when I transfer certificate to several developer machines I need to migrate also other Apple certificates. Without that my certificate wasn’t a valid.

3) Sign your application

Now you need to sign your application including all plugins and frameworks inside app bundle. After you sing your app, you can’t do any changes in the bundle. So as first run your deploy as usual and as last step do app singing.

For ORM Designer sign script looks like this:

#go to deploy directory
cd $StarkDeploy.directory$/deploy

#sign app
codesign --force --verify --verbose --sign "Developer ID Application: Inventic s.r.o." ./OrmDesigner2.app

#sign all *.dylib files
find OrmDesigner2.app -name *.dylib | xargs -I $ codesign --force --verify --verbose --sign "Developer ID Application: Inventic s.r.o." $

#sign all Qt* frameworks
find OrmDesigner2.app -name Qt* -type f | xargs -I $ codesign --force --verify --verbose --sign "Developer ID Application: Inventic s.r.o." $

4) Test it!

As last step it’s necessary to test that sign process was successful. As first you can try following command line to validate  it:

codesign -vvv -d OrmDesigner2.app

#RESULT:
Executable=/OrmDesigner2/DeployFiles/macos64/deploy/OrmDesigner2.app/Contents/MacOS/OrmDesigner2
Identifier=com.orm-designer.OrmDesigner2
Format=bundle with Mach-O thin (x86_64)
CodeDirectory v=20100 size=174478 flags=0x0(none) hashes=8717+3 location=embedded
Hash type=sha1 size=20
CDHash=5a491e16f7dcca15b44af4XXXX1a2d2dcc786518
Signature size=4237
Authority=Developer ID Application: Inventic s.r.o. (6BYV46LH6T)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Signed Time=6 Jun 2013 23:16:08
Info.plist entries=10
Sealed Resources rules=4 files=27
Internal requirements count=1 size=212

Now when you checked that App is correctly signed, it’s time to try it on clean computer where no security policy changes was made. Upload your app and execute it.

If you don’t see annoying screen “Can’t execute application from unidentified developer”, you win ;-).

External links

How to transfer certificate: 

How to import:

Apple links

Qt stylesheet guidance

Style sheets

Layout Management

How to tips

How to recompute Qt style-sheet based on Q_PROPERTY:

void QControl::RedrawWidgetStylesheet()
{
	style()->unpolish(this);
	style()->polish(this);
	update();
}

Services for Heatmaps and Mouse move heatmaps

This is list of heatmap services I found and some of them also test:

Name Features Free plan Paid plan/1 Paid plan/2
ClickTale
(top secret pricing)
  • Heatmaps
  • record mouse
  • Scroll stats
  • funnels
  • Attention heatmaps
  • Keystrokes
  • 400 pageviews/month
  • heatmap only on most popular pages
  • only 2 pages to playback
  • $99/month base plan
  • still limited number of heatmaps
  • $200-300/month
  • full plan
MouseStats
(pricing)
  • Heatmaps
  • Record mouse
  • Scroll stats
  • Area stats
  • Attention heatmaps
  • 100+100 pageviews/month
  • 2 heatmap projects
  • 1 playback project
  • $10($16)/month
  • 10.000 pageviews/month
  • 15 heatmap projects
  • 1 website.
  • $20($30)/month
  • 25.000 pageviews/month
  • 30 projects
  • 1 website
Inspectlet
(pricing)
  • Heatmaps
  • Record mouse
  • Scroll stats
  • Funnels
  • 2500 pageviews/month
  • 500 sessions
  • no https
  • no funnels
  • $10/month
  • 10.000 pageviews
  • 5.000 sessions
  • Https support
  • no funnels
  • $20/month
  • 100.000 pageviews/month
  • 50.000 sessions
  • Https support
  • Funnels
luckyorange
(pricing)
  • Heatmaps
  • Record mouse
  • Scroll stats
  • on-site chat
  • realtime statistics
  • visitor pools
no free, trial only
  • $10/month
  • 50.000 pageviews
  • 10.000 move heatmaps, 5.000 click heatmaps
  • 3 sites
  • $20/month
  • 100.000 pageviews
  • 20.000 move heatmaps, 10.000 click heatmaps
  • 6 sites
mouseflow
(pricing)
  • Heatmaps
  • Record mouse
  • Scroll stats
  • In-page analytics
  • Keystrokes
  • 100 sessions/month
  • no https
  • €10/month
  • 1.000 sessions/month
  • Https support
  • €50/month
  • 10.000 sessions/month
  • Https support
  • 3 websites
SeeMyVisits
(pricing)
  • Heatmaps
  • Record mouse
  • Scroll stats
  • In-page analytics
  • Keystrokes
no free plan
  • $20/month
  • 2.000 pages/month
  • $35/month
  • 4.000 pages/month
sessioncam
(pricing)
  • Heatmaps
  • Record mouse
  • Funnels
  • 500 pages/month
  • $30/month
  • 10.000 pages/month

http://alternativeto.net/software/clicktale/

CRM system for our startup

We reached the point where we need some kind of CRM system. We have a lot of customers, oportunies and tasks we need to track and keep records. I tried several of them and read about much more. Here are summary of CRMs with short info about each.

Long term tested

Tested for few minutes

Found & Reviewed

Other

Other CRM lists

Screenshots

Insightly

Insightly

ZOHO CRM

ZOHO CRM

Streak crm

Streak CRM

HIGHRISE CRM

Highrise CRM

BASE CRM

BASE CRM

CapsuleCRM

CapsuleCRM

Ubuntu eth0: ERROR while getting interface flags: No such device

This article is step-by-step tutorial how to fix a problem which occured after I restored my virtual machines from backup to my ESXI server.

ifconfig
ifconfig when eth0 is not available

when I used lspci, result was

lspci
lspci result

So network adapter is correctly available in my virtual machine. As next step I need to found out which alias is used for this adapter. I didn’t find any easily way than try et0,eth1,….

ifconfig eth0
eth0: error fetching interface information: Device not found

ifconfig eth1
eth1: error fetching interface information: Device not found

ifconfig eth2
eth2: Link encap: Ethernet HWaddr.....

So, I found my network adapter. Now as last step it’s necessary to update network interfaces to this adapter

sudo nano /etc/network/interfaces

#and change all eth0 to eth1 values
/etc/network/interfaces

As last step restart your machine and everything should work correctly.

External links:

  • http://www.cyberciti.biz/faq/show-ethernet-adapter-ubuntu-linux/

Problem with Qt application on MacOS Retina display

Standard Qt application on retina display looks ugly. Fuzzy fonts and images. This is how ORM Designer originaly looks on Retina:

ORM Designer on Retina before optimizations

Improve font autoscaling

First step how to improve Qt application on retina is by adding following definise to Info.plist

NSPrincipalClass
NSApplication
How to update Info.plist

If you’re updating existing application, it’s necessary to copy application to different location after Info.plist update. MacOS cache all .plist files and without that update will not be apply.

After applying this fix, this is how application looks:

How ORM Designer looks after fix

External sources

How to add new drive to ubuntu

Step one: install drive

It’s easy…. 😉

Step two, check if drive is connected

sudo fdisk -l

Create partitions

sudo fdisk /dev/sdb

#Create partition
#----------------
#press u (units to sectors)
#press n (create new partition)
#press p (primary partition)
#press 1 (first partition)
#press enter (default start at begin)
#press enter (default end at end)

#Format partition
#----------------
#press L (list of formats)
#?? need tye 83, don't know how to enter 😉

#press W (write changes to hdd and quit)

#update kernel with changes we have made
sudo partproble /dev/sdb

#format drive
sudo mkfs /dev/sdb1 -t ext4

#create directory mount point
sudo mkdir /home/dev/dev
sudo chmod 777 /home/dev/dev

#mount it
sudo mount /dev/sdb1 /home/dev/dev -t ext4

#try to write something
touch /home/dev/dev/test.txt
ls /home/dev/dev

#setup auto-mounting point
sudo nano /etc/fstab

#add line
/dev/sdb1 /home/dev/dev ext4 defaults 0 0

External ref:

How to solve problem “version `GLIBC_2.14′ not found”

Simpliest solution

There is a several ways how you can deal with this problem. I think the easiest (and solution I choose) is compile application on the most oldest version of OS you want support. Here is the reason:


For dynamic linking, Linux (and most other UNIXes) support backward compatibility: an old binary continues to work on newer systems. But they don’t support forward compatibility (a binary built on a newer system will generally not run on an older one).

External links:

Another solutions

Here is a nice list how can be this issue solved (source here):

  • You could copy ld-2.14.so (the target of /lib/ld-linux symlink) to the target system, and invoke it explicitly: /path/to/ld-2.14.so –library-path /path/to/your/executable. This generally works, but can confuse an application that looks at argv[0], and breaks for applications that re-exec themselves.
  • You could build on an older system.
  • You could use appgcc.
  • You could set up a chroot environment matching the target system, and build inside that chroot.
  • You could build yourself a Linux-to-olderLinux crosscompiler

One more solution

You can also try following way, but I don’t test it

#include <limits.h>
#include <stdlib.h>
#include <stdio.h>

__asm__(".symver realpath,[email protected]_2.2.5");
int main()
{
   char* unresolved = "/lib64";
   char  resolved[PATH_MAX+1];

   if(!realpath(unresolved, resolved))
      { return 1; }

   printf("%s\n", resolved);

   return 0;
}

Qt QtDBus compilation

To add DBUS to Qt compilation, add following switch

./configure -opensource -dbus ....

If you get following error:

The QtDBus module cannot be enabled because libdbus-1 version 0.93 was not found.
Turn on verbose messaging (-v) to ./configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to ./configure to continue.

It’s necessary to install libsbus:

sudo apt-get install libdbus-1-3
Reading package lists... Done
Building dependency tree
Reading state information... Done
libdbus-1-3 is already the newest version.

and also developer package:

sudo apt-get install libdbus-1-dev

Now everything should work correctly.