<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Posts on Nick Spacek</title><link>https://spacek.ca/posts/</link><description>Recent content in Posts on Nick Spacek</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 26 Sep 2016 11:23:10 -0300</lastBuildDate><atom:link href="https://spacek.ca/posts/index.xml" rel="self" type="application/rss+xml"/><item><title>GeoNB Mobile</title><link>https://spacek.ca/post/geonb/</link><pubDate>Mon, 26 Sep 2016 11:23:10 -0300</pubDate><guid>https://spacek.ca/post/geonb/</guid><description>&lt;p&gt;I was messing around with &lt;a href="http://www.snb.ca/geonb1/"&gt;GeoNB&lt;/a&gt;, checking
out what it was built on top of with the hope that maybe there was a way
to get some data out of it programmatically. The underlying data is very
open, with the government of New Brunswick releasing it in a number of
different formats.&lt;/p&gt;
&lt;p&gt;Before going that route too far, I thought it would be neat to try using
&lt;a href="http://openlayers.org/"&gt;OpenLayers&lt;/a&gt; to display the data if possible. It
ended up being very easy to modify one of the existing examples to work
with the ArcGIS APIs that are supporting the GeoNB site. You can check
out the result below:&lt;/p&gt;</description></item><item><title>Hangouts Screen Share in Full Screen</title><link>https://spacek.ca/2015/03/20/hangouts-fullscreen/</link><pubDate>Fri, 20 Mar 2015 00:00:00 +0000</pubDate><guid>https://spacek.ca/2015/03/20/hangouts-fullscreen/</guid><description>&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I came across &lt;a href="https://chrome.google.com/webstore/detail/toggle-fullscreen-in-hang/eekfhcmpmchbhkdeplplcljcggddkffb?hl=en"&gt;this extension&lt;/a&gt;
which I assume accomplishes something similar, nice.&lt;/p&gt;
&lt;p&gt;So I was messing around in a Hangouts session today trying to increase the
other user&amp;rsquo;s screen share size, and I noticed a few HTML elements that
controlled the size. I discovered that you can easily resize the video feed.&lt;/p&gt;
&lt;p&gt;The best approach would be an extension to handle finding the proper elements
and also hooking into some events, but a simple PoC can be seen below:&lt;/p&gt;</description></item><item><title>Spring Boot web application</title><link>https://spacek.ca/2013/12/15/spring-boot-web-application/</link><pubDate>Sun, 15 Dec 2013 00:00:00 +0000</pubDate><guid>https://spacek.ca/2013/12/15/spring-boot-web-application/</guid><description>Some experiences with Spring Boot</description></item><item><title>Remove JSESSION ID cookie</title><link>https://spacek.ca/2013/12/03/remove-jsession-id-cookie/</link><pubDate>Tue, 03 Dec 2013 00:00:00 +0000</pubDate><guid>https://spacek.ca/2013/12/03/remove-jsession-id-cookie/</guid><description>&lt;p&gt;{% include JB/setup %}&lt;/p&gt;
&lt;p&gt;I made a simple little bookmarklet that will remove the JSESSIONID cookie (for
testing purposes). We are using it to test behavior of AJAX updates when the
session expires.&lt;/p&gt;
&lt;p&gt;Here it is, drag to your bookmarks: &lt;a href="javascript:!function(){function createCookie(name,value,days){if(days){var date=new Date;date.setTime(date.getTime()+24*days*60*60*1e3);var expires='; expires='+date.toGMTString()}else var expires='';document.cookie=name+'='+value+expires+'; path=/'}function readCookie(name){var nameEQ=name+'=';var ca=document.cookie.split(';');for(var i=0;i&amp;lt;ca.length;i++){var c=ca[i];while(' '==c.charAt(0))c=c.substring(1,c.length);if(0==c.indexOf(nameEQ))return c.substring(nameEQ.length,c.length)}return null}function eraseCookie(name){createCookie(name,'',-1)}var target='JSESSIONID';if(null==readCookie(target)){alert('No cookie named '+target+' found');return}if(confirm('Do you want to delete the cookie named '+target+'?'))eraseCookie(target)}();"&gt;-JSESSIONID&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;This makes use of &lt;a href="http://www.quirksmode.org/js/cookies.html"&gt;Peter-Paul Koch&amp;rsquo;s code from quirksmode.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>HSQLDB with Hibernate: addScalar</title><link>https://spacek.ca/2013/09/18/hsqldb-with-hibernate-addscalar/</link><pubDate>Wed, 18 Sep 2013 00:00:00 +0000</pubDate><guid>https://spacek.ca/2013/09/18/hsqldb-with-hibernate-addscalar/</guid><description>&lt;p&gt;{% include JB/setup %}&lt;/p&gt;
&lt;p&gt;To continue this series, I just have another little cautionary bit of advice
regarding using &lt;code&gt;addScalar&lt;/code&gt; with your &lt;code&gt;createSQLQuery(...)&lt;/code&gt; operations. In
MySQL, a query like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;SELECT&lt;/span&gt; obj.name, other.name, third.name
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;FROM&lt;/span&gt; obj, other, third&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Will give the full name of those columns in the &amp;ldquo;result set metadata&amp;rdquo; that
Hibernate accesses. So when you use &lt;code&gt;addScalar&lt;/code&gt;, you can just say:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-java" data-lang="java"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;.&lt;span style="color:#a6e22e"&gt;addScalar&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;obj.name&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;.&lt;span style="color:#a6e22e"&gt;addScalar&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;other.name&amp;#34;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;.&lt;span style="color:#a6e22e"&gt;addScalar&lt;/span&gt;(&lt;span style="color:#e6db74"&gt;&amp;#34;third.name&amp;#34;&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;However, in other database engines the columns might come back in the metadata
as &lt;code&gt;[ name, name, name ]&lt;/code&gt;; when you try to use &lt;code&gt;addScalar&lt;/code&gt; with the full path,
you will get an error. (I don&amp;rsquo;t believe that just calling &lt;code&gt;addScalar&lt;/code&gt; once with
&amp;ldquo;name&amp;rdquo; will apply to each of the three occurrences either, but I haven&amp;rsquo;t
checked).&lt;/p&gt;</description></item><item><title>HSQLDB with Hibernate: User lacks privilege or object not found</title><link>https://spacek.ca/2013/09/18/hsqldb-with-hibernate/</link><pubDate>Wed, 18 Sep 2013 00:00:00 +0000</pubDate><guid>https://spacek.ca/2013/09/18/hsqldb-with-hibernate/</guid><description>&lt;p&gt;{% include JB/setup %}&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m currently working to add unit tests to a project which currently has no
tests for its database query layer. Normally I wouldn&amp;rsquo;t worry too much, but
there are some nasty queries that have cropped up over the years that could
benefit from some testing.&lt;/p&gt;
&lt;p&gt;This project uses Hibernate and the custom queries are written mainly in some
MySQL-specific language. Part of the problem with adding tests has been that
the hbm2ddl tool hasn&amp;rsquo;t been able to reliably generate the database schema due
to some strange approaches to ID generation and other MySQL-specific code.&lt;/p&gt;</description></item><item><title>Another reason for 406 in Spring 3.2 and Jackson 2</title><link>https://spacek.ca/2013/09/06/another-reason-for-406-in-spring-32-and-jackson-2/</link><pubDate>Fri, 06 Sep 2013 00:00:00 +0000</pubDate><guid>https://spacek.ca/2013/09/06/another-reason-for-406-in-spring-32-and-jackson-2/</guid><description>&lt;p&gt;{% include JB/setup %}&lt;/p&gt;
&lt;p&gt;Just as a quick note, make sure your POJO actually has some fields. I was
racking my brain, examining my config, and Googling fiercely when I
discovered that the reason I kept getting a 406 in my Spring MVC 3.2 project
was because I had just created a placeholder POJO with no fields.&lt;/p&gt;
&lt;p&gt;Arg.&lt;/p&gt;</description></item><item><title>Google Cast: cast-receiver-list</title><link>https://spacek.ca/2013/08/16/google-cast-cast-receiver-list/</link><pubDate>Fri, 16 Aug 2013 00:00:00 +0000</pubDate><guid>https://spacek.ca/2013/08/16/google-cast-cast-receiver-list/</guid><description>&lt;p&gt;{% include JB/setup %}&lt;/p&gt;
&lt;h4 id="introducing-cast-receiver-list"&gt;Introducing cast-receiver-list&lt;/h4&gt;
&lt;p&gt;&lt;a href="https://github.com/nickspacek/cast-receiver-list"&gt;https://github.com/nickspacek/cast-receiver-list&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve been playing around with the &lt;a href="https://developers.google.com/cast/"&gt;Google Cast API&lt;/a&gt;
a little bit, specifically the
&lt;a href="https://developers.google.com/cast/chrome_sender"&gt;Chrome Sender API&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One thing any application will have in common is retrieving the list of
available senders and displaying them for the user to select from. As I
was playing with the API I decided to extract the code out into a module
and make it available for others to use.&lt;/p&gt;</description></item></channel></rss>