<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fork&#039;s</title>
	<atom:link href="http://www.michalkavka.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.michalkavka.com</link>
	<description>Notes and thoughts mostly about software development</description>
	<lastBuildDate>Fri, 02 Dec 2011 11:26:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MSSQL Error: Could not resolve expression for schemabound object or constraint</title>
		<link>http://www.michalkavka.com/2011/07/could-not-resolve-expression-for-schemabound-object-or-constraint/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=could-not-resolve-expression-for-schemabound-object-or-constraint</link>
		<comments>http://www.michalkavka.com/2011/07/could-not-resolve-expression-for-schemabound-object-or-constraint/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 08:52:26 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[alter view]]></category>
		<category><![CDATA[collation]]></category>
		<category><![CDATA[create view]]></category>
		<category><![CDATA[mssql]]></category>

		<guid isPermaLink="false">http://www.michalkavka.com/?p=178</guid>
		<description><![CDATA[I&#8217;m using Microsoft SQL Server 2005 and the database on which I executed the ALTER VIEW query has compatibility level set to SQL Server 2000(80). The ALTER VIEW query returned this error: Could not resolve expression for schemabound object or constraint If you encounter this issue, check the collation of database and collation of MS [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using Microsoft SQL Server 2005 and the database on which I executed the ALTER VIEW query has compatibility level set to SQL Server 2000(80). The ALTER VIEW query returned this error:</p>
<p><span style="color: #ff0000;"><em><strong>Could not resolve expression for schemabound object or constraint</strong></em></span></p>
<p>If you encounter this issue, check the collation of database and collation of MS SQL Server.  In my case server collation was set to SQL_Latin1_General_CP1_CI_AS and database collation Latin1_General_CI_AS.</p>
<p>If you want to find out which columns have specified collation and you do not want to do it manually in SSMS, you can run this script:</p>
<div class="codecolorer-container sql geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">TABLE_NAME</span><span style="color: #66cc66;">,</span> column_name<span style="color: #66cc66;">,</span> collation_name<br />
<span style="color: #993333; font-weight: bold;">FROM</span> information_schema<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">COLUMNS</span><br />
<span style="color: #993333; font-weight: bold;">WHERE</span> collation_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'SQL_Latin1_General_CP1_CI_AS'</span></div></div>
<p>This query will return all columns in all tables/views with specified collation.</p>
<p>If you want to change the collation, following script will generate ALTER statements for you.</p>
<p><em>WARNING &#8211; The script is not absolutely correct, because it will generate ALTER statements for views as well and you cannot alter all types of columns (indexed, used as primary key&#8230;). For more details which columns cannot be altered see <a title="ALTER TABLE" href="http://msdn.microsoft.com/en-us/library/ms190273.aspx">MSDN ALTER TABLE</a>.</em></p>
<div class="codecolorer-container sql geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;height:300px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">DECLARE</span> @tableName nvarchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">128</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">DECLARE</span> @columnName nvarchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">128</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">DECLARE</span> @columnType nvarchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">128</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">DECLARE</span> @columnLength <span style="color: #993333; font-weight: bold;">INT</span><br />
<span style="color: #993333; font-weight: bold;">DECLARE</span> @isNullable <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span><br />
<br />
<span style="color: #993333; font-weight: bold;">DECLARE</span> @<span style="color: #993333; font-weight: bold;">SQL</span> nvarchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span><br />
<br />
<span style="color: #993333; font-weight: bold;">DECLARE</span> column_cursor CURSOR <span style="color: #993333; font-weight: bold;">FOR</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">TABLE_NAME</span><span style="color: #66cc66;">,</span> column_name<span style="color: #66cc66;">,</span> data_type<span style="color: #66cc66;">,</span> character_maximum_length<span style="color: #66cc66;">,</span> is_nullable<br />
<span style="color: #993333; font-weight: bold;">FROM</span> information_schema<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">COLUMNS</span><br />
<span style="color: #993333; font-weight: bold;">WHERE</span> collation_name <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'SQL_Latin1_General_CP1_CI_AS'</span><br />
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">TABLE_NAME</span><br />
<br />
<span style="color: #993333; font-weight: bold;">OPEN</span> column_cursor<br />
<br />
FETCH <span style="color: #993333; font-weight: bold;">NEXT</span> <span style="color: #993333; font-weight: bold;">FROM</span> column_cursor <span style="color: #993333; font-weight: bold;">INTO</span> @tableName<span style="color: #66cc66;">,</span> @columnName<span style="color: #66cc66;">,</span> @columnType<span style="color: #66cc66;">,</span> @columnLength<span style="color: #66cc66;">,</span> @isNullable<br />
<br />
WHILE @@FETCH_STATUS <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span><br />
<span style="color: #993333; font-weight: bold;">BEGIN</span><br />
<span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #66cc66;">&#40;</span>@isNullable<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'YES'</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">BEGIN</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> @<span style="color: #993333; font-weight: bold;">SQL</span> <span style="color: #66cc66;">=</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'ALTER TABLE '</span> <span style="color: #66cc66;">+</span> @tableName <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' ALTER COLUMN '</span> <span style="color: #66cc66;">+</span> @columnName <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' '</span> <span style="color: #66cc66;">+</span> @columnType <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">'('</span> <span style="color: #66cc66;">+</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span>@columnLength <span style="color: #993333; font-weight: bold;">AS</span> nvarchar<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">') COLLATE '</span> <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' Latin1_General_CI_AS'</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">END</span><br />
<span style="color: #993333; font-weight: bold;">ELSE</span><br />
<span style="color: #993333; font-weight: bold;">BEGIN</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> @<span style="color: #993333; font-weight: bold;">SQL</span> <span style="color: #66cc66;">=</span><span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'ALTER TABLE '</span> <span style="color: #66cc66;">+</span> @tableName <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' ALTER COLUMN '</span> <span style="color: #66cc66;">+</span> @columnName <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' '</span> <span style="color: #66cc66;">+</span> @columnType <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">'('</span> <span style="color: #66cc66;">+</span> <span style="color: #993333; font-weight: bold;">CAST</span><span style="color: #66cc66;">&#40;</span>@columnLength <span style="color: #993333; font-weight: bold;">AS</span> nvarchar<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">') COLLATE '</span> <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">' Latin1_General_CI_AS NOT NULL'</span><span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">END</span><br />
<br />
PRINT<span style="color: #66cc66;">&#40;</span>@<span style="color: #993333; font-weight: bold;">SQL</span><span style="color: #66cc66;">&#41;</span><br />
<br />
FETCH <span style="color: #993333; font-weight: bold;">NEXT</span> <span style="color: #993333; font-weight: bold;">FROM</span> column_cursor <span style="color: #993333; font-weight: bold;">INTO</span> @tableName<span style="color: #66cc66;">,</span> @columnName<span style="color: #66cc66;">,</span> @columnType<span style="color: #66cc66;">,</span> @columnLength<span style="color: #66cc66;">,</span> @isNullable<br />
<br />
<span style="color: #993333; font-weight: bold;">END</span><br />
CLOSE column_cursor<br />
DEALLOCATE column_cursor<br />
<br />
<span style="color: #993333; font-weight: bold;">GO</span></div></div>
<p>The other possibility would be to set COLLATE in ALTER VIEW, but I didn&#8217;t try that.</p>
<p>I realize, this is not the best solution, but I needed the quick solution. The better solution would be to change the MS SQL Server collation to same as DB and to recreate whole database with correct collation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michalkavka.com/2011/07/could-not-resolve-expression-for-schemabound-object-or-constraint/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Spring-data aspects not working in eclipse</title>
		<link>http://www.michalkavka.com/2011/07/spring-data-aspects-not-working-with-m2eclipse/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spring-data-aspects-not-working-with-m2eclipse</link>
		<comments>http://www.michalkavka.com/2011/07/spring-data-aspects-not-working-with-m2eclipse/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 22:50:54 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[aspect]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[neo4j]]></category>
		<category><![CDATA[spring-data]]></category>

		<guid isPermaLink="false">http://www.michalkavka.com/?p=109</guid>
		<description><![CDATA[&#160; Update: In Eclipse 3.7 Indigo with m2eclipse 1.0.1 everything works fine, all you need to do is to Import existing Maven project. I saw nice presentation about spring data project at Øredev 2010 conference web page, so I decided to give it a try. I followed the guide from spring data website and everything was [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><strong>Update: In Eclipse 3.7 Indigo with m2eclipse 1.0.1 everything works fine, all you need to do is to Import existing Maven project.</strong></p>
<p>I saw nice presentation about <a title="spring data presentation" href="http://oredev.org/2010/sessions/spring-andand-nosql-introducing-the-new-spring-data-project" target="_blank">spring data</a> project at Øredev 2010 conference web page, so I decided to give it a try. I followed the <a title="The Spring Data Graph Guide Book" href="http://static.springsource.org/spring-data/data-graph/snapshot-site/reference/html" target="_blank">guide</a> from spring data website and everything was working fine, till I tried to create repository (step 8 in guide).</p>
<p>Entity:</p>
<div class="codecolorer-container java geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@NodeEntity<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Movie <span style="color: #009900;">&#123;</span>...<span style="color: #009900;">&#125;</span></div></div>
<p>Repository:</p>
<div class="codecolorer-container java geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> MovieRepository <span style="color: #000000; font-weight: bold;">extends</span> GraphRepository <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span></div></div>
<p>After adding this line of code eclipse reported an error:<br />
<strong><em>Bound mismatch: The type Movie is not a valid substitute for the bounded parameter &lt;T extends GraphBacked&lt;?&gt;&gt; of the type GraphRepository&lt;T&gt;. </em></strong></p>
<p>This means that aspect used on movie entity <code class="codecolorer java geshi"><span class="java">@NodeEntity</span></code> was not recognized correctly. So I checked the <code class="codecolorer text geshi"><span class="text">pom.xml</span></code> if the <code class="codecolorer text geshi"><span class="text">aspectj-maven-plugin</span></code> is configured properly, but everything seemed fine.<br />
After few hours of frustration the solution which worked for me was to remove project from eclipse and run following in console:</p>
<div class="codecolorer-container bash geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mvn eclipse:clean<br />
mvn eclipse:eclipse</div></div>
<p>Then I imported project (using import &#8220;Existing projects into Workspace&#8221;) and aspects started to work correctly.</p>
<p>However, there is one catch in this solution. The command mvn eclipse:eclipse generates <code class="codecolorer text geshi"><span class="text">.classpath</span></code> file with all dependencies. After import into eclipse, maven dependency management is disabled and if you enable dependency management (Maven -&gt; Enable dependency management), the aspects will stop working again <img src='http://www.michalkavka.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.michalkavka.com/2011/07/spring-data-aspects-not-working-with-m2eclipse/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Finding database passwords with google</title>
		<link>http://www.michalkavka.com/2011/07/finding-database-passwords-with-google/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=finding-database-passwords-with-google</link>
		<comments>http://www.michalkavka.com/2011/07/finding-database-passwords-with-google/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 21:46:52 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[ghd]]></category>
		<category><![CDATA[google hacking]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.michalkavka.com/?p=78</guid>
		<description><![CDATA[Today I read about how simple google search can reveal your secrets (private pgp key), what reminded me one interesting error which I came across when I was trying to find lunch menu few weeks ago. Instead of lunch menu I got page with &#8220;Zend_Db_Statement_Exception Object&#8221; with some mysql syntax error. This is not big deal, [...]]]></description>
			<content:encoded><![CDATA[<p>Today I read about how simple <a title="Can simple Google searches reveal your secrets?" href="http://nakedsecurity.sophos.com/2011/07/05/can-simple-google-searches-reveal-your-secrets/" target="_blank">google search can reveal your secrets (private pgp key)</a>, what reminded me one interesting error which I came across when I was trying to find lunch menu few weeks ago. Instead of lunch menu I got page with &#8220;Zend_Db_Statement_Exception Object&#8221; with some mysql syntax error. This is not big deal, there is a lot of applications which do not work properly, but then I spotted one interesting section in error log called [_config:protected]. In this section you can find connection string to database with username and password. I notified the administrator of restaurant about the error on the web page (and I was very surprised by their quick and grateful response) and then I tried to google:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&quot;[_config:protected]&quot; zend password</div></div>
<p>I got 77000 results, pretty much, right? Some of these are questions in forums, others are gone, but there are plenty of error pages working or gone, but still in google cache. I hope that most of these DB servers are not accessible from outside at least. I will probably write(find) some small crawler to get some real numbers and submit this query to google hacking database.</p>
<p><em>Disclaimer: This post is for meant for educational purposes only. Anyone misusing this information is responsible for his own actions.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.michalkavka.com/2011/07/finding-database-passwords-with-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse crash while accessing marketplace</title>
		<link>http://www.michalkavka.com/2011/06/eclipse-crash-while-accessing-marketplace/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=eclipse-crash-while-accessing-marketplace</link>
		<comments>http://www.michalkavka.com/2011/06/eclipse-crash-while-accessing-marketplace/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 19:34:56 +0000</pubDate>
		<dc:creator>Michal</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[helios]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[marketplace]]></category>

		<guid isPermaLink="false">http://www.michalkavka.com/blog/?p=52</guid>
		<description><![CDATA[I&#8217;m using latest archlinux with eclipse 3.6.2 &#8211; Helios and openjdk 1.6.0_22. I wanted to manage my eclipse plugins with eclipse marketplace, however each time when I clicked on eclipse marketplace menu, eclipse suddenly crashed. The same thing happened when I navigated to Window-Preferences-General-Web Browser. To fix the issue you need to add one line into eclipse.ini [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using latest archlinux with eclipse 3.6.2 &#8211; Helios and openjdk 1.6.0_22. I wanted to manage my eclipse plugins with eclipse marketplace, however each time when I clicked on eclipse marketplace menu, eclipse suddenly crashed. The same thing happened when I navigated to Window-Preferences-General-Web Browser.</p>
<p>To fix the issue you need to add one line into <strong>eclipse.ini</strong> file (in archlinux located <strong>/usr/share/eclipse/eclipse.ini</strong>)</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/bin/</div></div>
<p>More information can be found here:<br />
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=343454">https://bugs.eclipse.org/bugs/show_bug.cgi?id=343454</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.michalkavka.com/2011/06/eclipse-crash-while-accessing-marketplace/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching using disk: basic
Object Caching 792/1026 objects using disk: basic

Served from: www.michalkavka.com @ 2012-05-21 16:04:03 -->
