Hibernate mapping for decimal scale is wrong

When mapping a SQL table to a model using Hibernate or NHibernate, if you configure the mapping like following

<property name=”MyDecCol” type=”Decimal” precision=”28″ scale=”15″>
<column name=”MyDecCol” sql-type=”decimal” not-null=”false” />
</property>

For some reason, Hibernate/NHibernate will treat the field as a decimal with scale = 5 (5 decimal digits on the right side of the decimal separator). So if you save a value to this column with more decimal digits, it will be truncated to only 5 decimal digits.

I’m not sure why, but if you move the attributes to the inner column element, Hibernate and NHibernate will map the values correctly.

<property name=”MyDecCol” type=”Decimal”>
<column name=”MyDecCol” sql-type=”decimal” not-null=”false” precision=”28″ scale=”15″ />
</property>

Cannot run Python application after installing using pip

I was trying to install qark, an android security program, through pip.

After installation, the readme say to run qark –help. However the system cannot find this command.

After trying python -m quark.py, python quark.py, etc with no result. I managed to solve by finding out that the Script folder of the Python installation contains the .exe file for qark, qark.exe.

Adding this folder to my PATH environment variable allows running this command in the command prompt.

This should be something to be mentioned in the readme at least.

Cannot connect to SQL server using SQL server authentication

The server may have been configured for integrated security only.

Change it to allow both SQL authentication and Windows Authentication by logging in using Windows user, then right click the server => Properties => Security, then change authentication mode to allow SQL authentication.

Then restart SQL server services.

Source: https://dba.stackexchange.com/questions/87390/sql-server-authentication-login-failed

Web Service Host for WCF doesn’t work

If you open a WCF Solution that uses a web site to host the WCF services and the services cannot be browsed when opening using a web browser (showing HTTP error 403.1 not found), try turning on HTTP Activation feature.

On Windows server, go through server manager.

On Windows desktop, search for turn Windows features on or off, Under .NET Framework Advanced Services -> WCF Services -> HTTP Activation. Check HTTP Activation to enable it, and click OK.

This really wasn’t apparent at first and I thought there was some issues with the config files.