<?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>The Coding Journal ツ</title> <atom:link href="http://coding-journal.com/feed/" rel="self" type="application/rss+xml" /><link>http://coding-journal.com</link> <description>Notes taken on an epic coding journey</description> <lastBuildDate>Fri, 15 Mar 2013 14:50:59 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.5.1</generator> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2F&amp;language=en_US&amp;category=text&amp;title=The+Coding+Journal+%E3%83%84&amp;description=Notes+taken+on+an+epic+coding+journey&amp;tags=blog" type="text/html" /> <item><title>Programmatically adding PHP generated TypoScript to the backend configuration</title><link>http://coding-journal.com/programatically-adding-php-generated-typoscript-to-the-backend-configuration/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=programatically-adding-php-generated-typoscript-to-the-backend-configuration</link> <comments>http://coding-journal.com/programatically-adding-php-generated-typoscript-to-the-backend-configuration/#comments</comments> <pubDate>Thu, 21 Feb 2013 17:16:09 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Typo3]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=711</guid> <description><![CDATA[Today I&#8217;ve struggled with adding PHP generated TypoScript configuration to the backend. There doesn&#8217;t seem to be an API for this, unfortunately, so I had to dig a little bit into the TYPO3 source. Turns out that t3lib_befunc#getPagesTSconfig, which is &#8230; <a
href="http://coding-journal.com/programatically-adding-php-generated-typoscript-to-the-backend-configuration/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Today I&#8217;ve struggled with adding PHP generated TypoScript configuration to the backend. There doesn&#8217;t seem to be an API for this, unfortunately, so I had to dig a little bit into the TYPO3 source.</p><p>Turns out that <code>t3lib_befunc#getPagesTSconfig</code>, which is responsible for retrieving TypoScript configuration for the backend, makes use of the following global variable as the &#8220;default TypoScript configuration&#8221;:</p><div
class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$GLOBALS['TYPO3_CONF_VARS']['BE']['defaultPageTSconfig']</div></div><p>So, being short of a proper API, I ended up simply appending my generated configuration to the <code>defaultPageTSconfig</code> string (in my <code>ext_localconf.php</code> file).</p><p>Is there a better way to achieve the same thing? If so, let me know :)</p><p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=711&amp;md5=e2783e8fddb596030d371d331179ddd7" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/programatically-adding-php-generated-typoscript-to-the-backend-configuration/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Fprogramatically-adding-php-generated-typoscript-to-the-backend-configuration%2F&amp;language=en_GB&amp;category=text&amp;title=Programmatically+adding+PHP+generated+TypoScript+to+the+backend+configuration&amp;description=Today+I%26%238217%3Bve+struggled+with+adding+PHP+generated+TypoScript+configuration+to+the+backend.+There+doesn%26%238217%3Bt+seem+to+be+an+API+for+this%2C+unfortunately%2C+so+I+had+to+dig+a+little+bit...&amp;tags=blog" type="text/html" /> </item> <item><title>ArgumentError: Could not parse PKey: no start line</title><link>http://coding-journal.com/argumenterror-could-not-parse-pkey-no-start-line/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=argumenterror-could-not-parse-pkey-no-start-line</link> <comments>http://coding-journal.com/argumenterror-could-not-parse-pkey-no-start-line/#comments</comments> <pubDate>Thu, 24 Jan 2013 11:43:20 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[Deployment]]></category> <category><![CDATA[capistrano]]></category> <category><![CDATA[net-ssh]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=705</guid> <description><![CDATA[After updating my net-ssh gem to 2.6.x I started getting this error message from Capistrano: ArgumentError: Could not parse PKey: no start line The private key in question was completely fine though, given that it had been working in several &#8230; <a
href="http://coding-journal.com/argumenterror-could-not-parse-pkey-no-start-line/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>After updating my <code>net-ssh</code> gem to 2.6.x I started getting this error message from Capistrano:</p><blockquote><p><code>ArgumentError: Could not parse PKey: no start line</code></p></blockquote><p>The private key in question was completely fine though, given that it had been working in several other applications, including openssh itself, for quite some time. There seem to be <a
href="https://github.com/capistrano/capistrano/issues/286">some weird issues</a> with <code>net-ssh</code> 2.6.x and Capistrano at the moment, and so I simply downgraded to v2.5.2 and everything worked fine once again:</p><div
class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gem uninstall net-ssh<br
/> gem install net-ssh -v 2.5.2</div></div><p>Keep deploying :)</p><p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=705&amp;md5=b03df01e2798ad69e0f08fb0a03d536f" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/argumenterror-could-not-parse-pkey-no-start-line/feed/</wfw:commentRss> <slash:comments>5</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Fargumenterror-could-not-parse-pkey-no-start-line%2F&amp;language=en_GB&amp;category=text&amp;title=ArgumentError%3A+Could+not+parse+PKey%3A+no+start+line&amp;description=After+updating+my+net-ssh+gem+to+2.6.x+I+started+getting+this+error+message+from+Capistrano%3A+ArgumentError%3A+Could+not+parse+PKey%3A+no+start+line+The+private+key+in+question+was+completely...&amp;tags=capistrano%2Cnet-ssh%2Cblog" type="text/html" /> </item> <item><title>InstantiationException when creating Akka Actor</title><link>http://coding-journal.com/instantiationexception-when-creating-akka-actor/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=instantiationexception-when-creating-akka-actor</link> <comments>http://coding-journal.com/instantiationexception-when-creating-akka-actor/#comments</comments> <pubDate>Fri, 26 Oct 2012 14:04:50 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[Scala]]></category> <category><![CDATA[actor]]></category> <category><![CDATA[akka]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=675</guid> <description><![CDATA[This post might help you if you get an exception such as the following when creating an Akka Actor with actorOf(Props[SomeActor]): [ERROR] 15:32:44.249 :: akka://&#8230;/user/foo :: akka.actor.ActorCell :: error while creating actor &#160; &#160; java.lang.InstantiationException: package.of.SomeActor &#160; &#160; at java.lang.Class.newInstance0(Class.java:340) &#8230; <a
href="http://coding-journal.com/instantiationexception-when-creating-akka-actor/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>This post might help you if you get an exception such as the following when creating an Akka Actor with <code>actorOf(Props[SomeActor])</code>:</p><div
class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[ERROR] 15:32:44.249 :: akka://&#8230;/user/foo :: akka.actor.ActorCell :: error while creating actor<br
/> &nbsp; &nbsp; java.lang.InstantiationException: package.of.SomeActor<br
/> &nbsp; &nbsp; at java.lang.Class.newInstance0(Class.java:340)</div></div><p>The reason I got this error was simply because I didn&#8217;t have a constructor with zero arguments, that is, my Actor&#8217;s class signature looked like this:</p><div
class="codecolorer-container scala blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="scala codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">class</span></a> SomeActor<span
style="color: #F78811;">&#40;</span><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> attrs<span
style="color: #000080;">:</span>Map<span
style="color: #F78811;">&#91;</span>String, String<span
style="color: #F78811;">&#93;</span> <span
style="color: #000080;">=</span> Map<span
style="color: #F78811;">&#40;</span><span
style="color: #F78811;">&#41;</span><span
style="color: #F78811;">&#41;</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">extends</span></a> Actor</div></div><p>I assumed that, since map has a default value, it would work just like a no-argument constructor, but that was foolish, of course. Akka invokes <code>java.lang.Class.newInstance</code>, which in turn calls <code>java.lang.Class.newInstance0</code>, which (as far as I know) is a special case of <code>newInstance</code> for constructors with no arguments. Given that this special case is not applicable for our Actor class, an exception is thrown.</p><p>I worked around this problem like this:</p><div
class="codecolorer-container scala blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="scala codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">class</span></a> SomeActor<span
style="color: #F78811;">&#40;</span><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> attrs<span
style="color: #000080;">:</span>Map<span
style="color: #F78811;">&#91;</span>String, String<span
style="color: #F78811;">&#93;</span> <span
style="color: #000080;">=</span> Map<span
style="color: #F78811;">&#40;</span><span
style="color: #F78811;">&#41;</span><span
style="color: #F78811;">&#41;</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">extends</span></a> Actor <span
style="color: #F78811;">&#123;</span><br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">def</span></a> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">this</span></a><span
style="color: #F78811;">&#40;</span><span
style="color: #F78811;">&#41;</span> <span
style="color: #000080;">=</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">this</span></a><span
style="color: #F78811;">&#40;</span>Map<span
style="color: #F78811;">&#40;</span><span
style="color: #F78811;">&#41;</span><span
style="color: #F78811;">&#41;</span><br
/> <span
style="color: #F78811;">&#125;</span></div></div><p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=675&amp;md5=5956d8c507af5ea98c72089d8f2fca6d" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/instantiationexception-when-creating-akka-actor/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Finstantiationexception-when-creating-akka-actor%2F&amp;language=en_GB&amp;category=text&amp;title=InstantiationException+when+creating+Akka+Actor&amp;description=This+post+might+help+you+if+you+get+an+exception+such+as+the+following+when+creating+an+Akka+Actor+with+actorOf%28Props%5BSomeActor%5D%29%3A+%5BERROR%5D+15%3A32%3A44.249+%3A%3A+akka%3A%2F%2F%26%238230%3B%2Fuser%2Ffoo+%3A%3A+akka.actor.ActorCell+%3A%3A+error+while...&amp;tags=actor%2Cakka%2Cblog" type="text/html" /> </item> <item><title>Why is my Akka Actor getting &#8220;deadLetters&#8221; as sender?</title><link>http://coding-journal.com/why-is-my-akka-actor-getting-deadletters-as-sender/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-is-my-akka-actor-getting-deadletters-as-sender</link> <comments>http://coding-journal.com/why-is-my-akka-actor-getting-deadletters-as-sender/#comments</comments> <pubDate>Thu, 25 Oct 2012 14:45:12 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[Scala]]></category> <category><![CDATA[actor]]></category> <category><![CDATA[akka]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=666</guid> <description><![CDATA[That is a question that kept my busy for almost an hour&#8230; I had an Actor defined like this (simplified, of course): trait Foo &#123; self: Actor =&#62; &#160; &#160; &#91;&#8230;&#93; &#125; class Bar extends Actor with Foo &#123; &#160; &#8230; <a
href="http://coding-journal.com/why-is-my-akka-actor-getting-deadletters-as-sender/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>That is a question that kept my busy for almost an hour&#8230; I had an <code>Actor</code> defined like this (simplified, of course):</p><div
class="codecolorer-container scala blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="scala codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">trait</span></a> Foo <span
style="color: #F78811;">&#123;</span> self<span
style="color: #000080;">:</span> Actor <span
style="color: #000080;">=&gt;</span><br
/> &nbsp; &nbsp; <span
style="color: #F78811;">&#91;</span>&#8230;<span
style="color: #F78811;">&#93;</span><br
/> <span
style="color: #F78811;">&#125;</span><br
/> <br
/> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">class</span></a> Bar <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">extends</span></a> Actor <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">with</span></a> Foo <span
style="color: #F78811;">&#123;</span><br
/> &nbsp; &nbsp; <span
style="color: #F78811;">&#91;</span>&#8230;<span
style="color: #F78811;">&#93;</span><br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">def</span></a> receive <span
style="color: #000080;">=</span> <span
style="color: #F78811;">&#123;</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> x <span
style="color: #000080;">=&gt;</span> sender <span
style="color: #000080;">!</span> x<br
/> &nbsp; &nbsp; <span
style="color: #F78811;">&#125;</span><br
/> <span
style="color: #F78811;">&#125;</span></div></div><p>Weirdly enough, when I was sending messages to that actor, the responses always came from the <code>deadLetters</code> Actor belonging to my actor system. The reason for this behavior was the fact that I used <code>self</code> as the name for the <code>Foo</code> trait&#8217;s self-type, because <a
href="https://groups.google.com/forum/#!msg/akka-user/_Tx5lU6BOyA/QM8HD-y-82IJ">&#8220;There is already an implicit val self defined in Actor which refers to an actor&#8217;s own ActorRef&#8221;</a>, and if you override that, well, it breaks.</p><p>Therefore, if I change my trait to read something like this</p><div
class="codecolorer-container scala blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="scala codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">trait</span></a> Foo <span
style="color: #F78811;">&#123;</span> actor<span
style="color: #000080;">:</span> Actor <span
style="color: #000080;">=&gt;</span><br
/> &nbsp; &nbsp; <span
style="color: #F78811;">&#91;</span>&#8230;<span
style="color: #F78811;">&#93;</span><br
/> <span
style="color: #F78811;">&#125;</span></div></div><p>everything works as expected.</p><p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=666&amp;md5=213cadd798cc8df53d0a5a460240913b" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/why-is-my-akka-actor-getting-deadletters-as-sender/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Fwhy-is-my-akka-actor-getting-deadletters-as-sender%2F&amp;language=en_GB&amp;category=text&amp;title=Why+is+my+Akka+Actor+getting+%26%238220%3BdeadLetters%26%238221%3B+as+sender%3F&amp;description=That+is+a+question+that+kept+my+busy+for+almost+an+hour%26%238230%3B+I+had+an+Actor+defined+like+this+%28simplified%2C+of+course%29%3A+trait+Foo+%26%23123%3B+self%3A+Actor+%3D%26gt%3B+%26nbsp%3B+%26nbsp%3B...&amp;tags=actor%2Cakka%2Cblog" type="text/html" /> </item> <item><title>How to emulate a slow internet connection on Mac OS X</title><link>http://coding-journal.com/how-to-emulate-a-slow-internet-connection-on-mac-os-x/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-emulate-a-slow-internet-connection-on-mac-os-x</link> <comments>http://coding-journal.com/how-to-emulate-a-slow-internet-connection-on-mac-os-x/#comments</comments> <pubDate>Wed, 10 Oct 2012 11:14:55 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[Command-line]]></category> <category><![CDATA[Mac OS X]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=648</guid> <description><![CDATA[I found this note-to-self which explains how to do bandwidth and latency emulation on Mac OS X system wide, that is, independent of Chrome, Firefox, Safari or whatever browser you may be using. It can be done using a &#8220;network &#8230; <a
href="http://coding-journal.com/how-to-emulate-a-slow-internet-connection-on-mac-os-x/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I found <a
href="http://barkingiguana.com/2009/12/04/simulating-slow-or-laggy-network-connections-in-os-x/">this note-to-self</a> which explains how to do bandwidth and latency emulation on Mac OS X system wide, that is, independent of Chrome, Firefox, Safari or whatever browser you may be using.</p><p>It can be done using a &#8220;network pipe&#8221;, and it is relatively easy to find several detailed articles about its usage once you know the name. One of these articles is <a
href="http://titaniumninja.com/simulating-slow-network-links-on-os-x/">this one</a>, which, apart from explaining the basic usage of network pipes, also lets us know that there is a GUI tool called &#8220;Network Link Conditioner&#8221; bundled with Xcode 4.2 for this very purpose.</p><p>Now go and optimize your app/website for low bandwidth conditions :)</p><p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=648&amp;md5=83809018e0603f93d0bcd4bf416b1e36" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/how-to-emulate-a-slow-internet-connection-on-mac-os-x/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Fhow-to-emulate-a-slow-internet-connection-on-mac-os-x%2F&amp;language=en_GB&amp;category=text&amp;title=How+to+emulate+a+slow+internet+connection+on+Mac+OS+X&amp;description=I+found+this+note-to-self+which+explains+how+to+do+bandwidth+and+latency+emulation+on+Mac+OS+X+system+wide%2C+that+is%2C+independent+of+Chrome%2C+Firefox%2C+Safari+or+whatever+browser+you...&amp;tags=blog" type="text/html" /> </item> <item><title>Searching your Git history for a string or regular expression</title><link>http://coding-journal.com/searching-your-git-history-for-a-string-or-regular-expression/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=searching-your-git-history-for-a-string-or-regular-expression</link> <comments>http://coding-journal.com/searching-your-git-history-for-a-string-or-regular-expression/#comments</comments> <pubDate>Thu, 04 Oct 2012 22:56:55 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[Command-line]]></category> <category><![CDATA[Git]]></category> <category><![CDATA[git-log]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=634</guid> <description><![CDATA[Git seems to always have the feature I need, but often I&#8217;m not able to find it right away. While searching for a commit where a certain constant had been removed, I stumbled upon the deprecated git-diff-grep, which, in its &#8230; <a
href="http://coding-journal.com/searching-your-git-history-for-a-string-or-regular-expression/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>Git seems to always <em>have</em> the feature I need, but often I&#8217;m not able to <em>find</em> it right away. While searching for a commit where a certain constant had been removed, I stumbled upon the deprecated <a
href="https://github.com/oscardelben/git-diff-grep">git-diff-grep</a>, which, in its readme, led me to the solution I could have easily found by just reading the, you know, manual (i.e. <code>man git-log</code>) :)</p><div
class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">-S&lt;string&gt;<br
/> &nbsp; &nbsp; Look for differences that introduce or remove an instance of<br
/> &nbsp; &nbsp; &lt;string&gt;.Note that this is different than the string simply<br
/> &nbsp; &nbsp; appearing in diff output; see the pickaxe entry in gitdiffcore(7)<br
/> &nbsp; &nbsp; for more details.<br
/> <br
/> -G&lt;regex&gt;<br
/> &nbsp; &nbsp; Look for differences whose added or removed line matches the given<br
/> &nbsp; &nbsp; &lt;regex&gt;.</div></div><p>Knowing that, you can simply do the following:</p><div
class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span
style="color: #c20cb9; font-weight: bold;">git log</span> <span
style="color: #660033;">-S</span><span
style="color: #ff0000;">&quot;WHERE_DID_IT_GO&quot;</span><br
/> $ <span
style="color: #c20cb9; font-weight: bold;">git log</span> <span
style="color: #660033;">-G</span><span
style="color: #ff0000;">&quot;WHERE_DID.*&quot;</span></div></div><p>If you want to see the commit&#8217;s diff as well, just supply the <code>-p</code> option.</p><p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=634&amp;md5=e03a6d0a50dde8c0a44d6b7b983cb2c9" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/searching-your-git-history-for-a-string-or-regular-expression/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Fsearching-your-git-history-for-a-string-or-regular-expression%2F&amp;language=en_GB&amp;category=text&amp;title=Searching+your+Git+history+for+a+string+or+regular+expression&amp;description=Git+seems+to+always+have+the+feature+I+need%2C+but+often+I%26%238217%3Bm+not+able+to+find+it+right+away.+While+searching+for+a+commit+where+a+certain+constant+had+been...&amp;tags=git-log%2Cblog" type="text/html" /> </item> <item><title>Cisco VPN Client on Mac OS X 10.6+ &#8211; You don&#8217;t need it!</title><link>http://coding-journal.com/cisco-vpn-client-on-mac-os-x-10-6-you-dont-need-it/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cisco-vpn-client-on-mac-os-x-10-6-you-dont-need-it</link> <comments>http://coding-journal.com/cisco-vpn-client-on-mac-os-x-10-6-you-dont-need-it/#comments</comments> <pubDate>Wed, 03 Oct 2012 13:18:14 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[Mac OS X]]></category> <category><![CDATA[cisco vpn]]></category> <category><![CDATA[ipsec]]></category> <category><![CDATA[pcf]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=623</guid> <description><![CDATA[My university provides us with VPN access, and the only supported way to connect to it is the Cisco VPN Client, which doesn&#8217;t work on any 64-bit Mac OS system though. If you still try to use it, you will &#8230; <a
href="http://coding-journal.com/cisco-vpn-client-on-mac-os-x-10-6-you-dont-need-it/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>My university provides us with VPN access, and the only <em>supported</em> way to connect to it is the Cisco VPN Client, which doesn&#8217;t work on any 64-bit Mac OS system though. If you still try to use it, you will most certainly be presented the following error:</p><div
class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Error 51 &#8211; unable to communicate with the subsystem</div></div><p>The Cisco VPN Client support is discontinued for good reason, though. As of Mac OS X 10.6, there is a built-in IPSec VPN feature, so you really don&#8217;t need any third party software anymore. And here&#8217;s how you use it:</p><ol><li>Open <code>System Preferences &gt; Network</code><ul><li>You may need to click the &#8220;Unlock&#8221; button to make changes</li></ul></li><li>Click the plus sign above the lock button<ol><li>Select <strong>VPN</strong> in the <strong>Interface</strong> dropdown</li><li>Choose <strong>Cisco IPSec</strong> as the VPN Type.</li><li>Give it a descriptive &#8220;Service Name&#8221;</li><li>Click &#8220;Create&#8221;</li></ol></li></ol><p>Now you&#8217;ve created a new VPN connection, but you still need to configure it. If you know all the necessary configuration parameters just go ahead an configure away. More probably though, you have a <code>.pcf</code> file which contains all the configuration. But don&#8217;t worry. First of all, open the <code>.pcf</code> configuration file in your favorite text editor. It should at least contain the following configuration parameters:</p><ul><li>Host</li><li>GroupName</li><li>enc_GroupPwd</li></ul><p>You&#8217;ll also need to know your username and password for the IPSec VPN. Enter the configuration value for &#8220;Host&#8221; into the &#8220;Server Address&#8221; field, and you username below it. Mac OS automatically prompts you for your password when connecting to the VPN.</p><p><a
href="http://coding-journal.com/wp-content/uploads/2012/10/CiscoVPNInterface.png"><img
src="http://coding-journal.com/wp-content/uploads/2012/10/CiscoVPNInterface.png" alt="" title="CiscoVPNInterface" width="696" height="610" class="aligncenter size-full wp-image-624" /></a></p><p>Now click the <code>Authentication Settings...</code> button. Enter the &#8220;GroupName&#8221; found in the <code>.pcf</code> file into the &#8220;Group Name&#8221; field. Unfortunately you can&#8217;t directly copy the &#8220;enc_GroupPwd&#8221; into the &#8220;Shared Secret&#8221; field because it is &#8220;encrypted&#8221;. However, <a
href="http://www.unix-ag.uni-kl.de/~massar/bin/cisco-decode">certain ways and means</a> exist for getting the clear group password. Enter it into the &#8220;Shared Secret&#8221; field, and you&#8217;re done.</p><p><a
href="http://coding-journal.com/wp-content/uploads/2012/10/CiscoVPNInterface2.png"><img
src="http://coding-journal.com/wp-content/uploads/2012/10/CiscoVPNInterface2.png" alt="" title="CiscoVPNInterface2" width="696" height="610" class="aligncenter size-full wp-image-627" /></a></p><p>If I explained everything correctly, you should now be able to click the &#8220;Connect&#8221; button, to stop worrying about VPN configuration stuff and finally get back to work :)</p><p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=623&amp;md5=5a6fc0879bac6b197eb133d5b5c4f03a" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/cisco-vpn-client-on-mac-os-x-10-6-you-dont-need-it/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Fcisco-vpn-client-on-mac-os-x-10-6-you-dont-need-it%2F&amp;language=en_GB&amp;category=text&amp;title=Cisco+VPN+Client+on+Mac+OS+X+10.6%2B+%26%238211%3B+You+don%26%238217%3Bt+need+it%21&amp;description=My+university+provides+us+with+VPN+access%2C+and+the+only+supported+way+to+connect+to+it+is+the+Cisco+VPN+Client%2C+which+doesn%26%238217%3Bt+work+on+any+64-bit+Mac+OS+system...&amp;tags=cisco+vpn%2Cipsec%2Cpcf%2Cblog" type="text/html" /> </item> <item><title>Whenever Gem and Capistrano &#8211; Specifying the cronjob user</title><link>http://coding-journal.com/whenever-gem-and-capistrano-specifying-the-cronjob-user/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=whenever-gem-and-capistrano-specifying-the-cronjob-user</link> <comments>http://coding-journal.com/whenever-gem-and-capistrano-specifying-the-cronjob-user/#comments</comments> <pubDate>Thu, 27 Sep 2012 18:29:19 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[Deployment]]></category> <category><![CDATA[Rails]]></category> <category><![CDATA[Ruby]]></category> <category><![CDATA[capistrano]]></category> <category><![CDATA[cronjob]]></category> <category><![CDATA[whenever gem]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=605</guid> <description><![CDATA[If you are using Capistrano in a project that relies on the Whenever gem to manage your crontab, it will update the crontab of the user that you use for your Capistrano deploys. So if, for example, you&#8217;d deploy with &#8230; <a
href="http://coding-journal.com/whenever-gem-and-capistrano-specifying-the-cronjob-user/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>If you are using Capistrano in a project that relies on the <a
href="https://github.com/javan/whenever">Whenever gem</a> to manage your crontab, it will update the crontab of the user that you use for your Capistrano deploys. So if, for example, you&#8217;d deploy with the user <code>capistrano</code> and your app runs under the user <code>www-data</code>, you could run into all sorts of trouble, e.g. permissions in case your cronjob creates new files.</p><p>Specifying the user under whom the cronjob command should be executed is relatively easy though. <a
href="https://groups.google.com/forum/?fromgroups=#!topic/whenever-gem/_w_Iq_aYRjo">This mailing list entry</a> tells us that we should add <code>--user your_user</code> as a parameter to the <code>whenever</code> command. The problem with that is that you don&#8217;t execute the command yourself, but the <code>whenever</code> gem&#8217;s <a
href="https://github.com/javan/whenever/blob/11ba37888b4dea368d7cabb3cc4b1c13638465cc/lib/whenever/capistrano/recipes.rb#L8">Capistrano recipe</a> does. So all we need to do is change the <code>whenever_update_flags</code> variable to meet our wishes. First the original line, and after that our modification:</p><div
class="codecolorer-container ruby blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color:#008000; font-style:italic;"># Old</span><br
/> _cset<span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#ff3333; font-weight:bold;">:whenever_update_flags</span><span
style="color:#006600; font-weight:bold;">&#41;</span> <span
style="color:#006600; font-weight:bold;">&#123;</span> <span
style="color:#996600;">&quot;&#8211;update-crontab #{fetch :whenever_identifier} &#8211;set #{fetch :whenever_variables}&quot;</span> <span
style="color:#006600; font-weight:bold;">&#125;</span><br
/> <br
/> <span
style="color:#008000; font-style:italic;"># New</span><br
/> _cset<span
style="color:#006600; font-weight:bold;">&#40;</span><span
style="color:#ff3333; font-weight:bold;">:whenever_update_flags</span><span
style="color:#006600; font-weight:bold;">&#41;</span> <span
style="color:#006600; font-weight:bold;">&#123;</span> <span
style="color:#996600;">&quot;&#8211;update-crontab #{fetch :whenever_identifier} &#8211;set #{fetch :whenever_variables} &#8211;user www-data&quot;</span> <span
style="color:#006600; font-weight:bold;">&#125;</span></div></div><p>You probably don&#8217;t want to change the whenever gem directly, so placing that line anywhere in the <code>deploy.rb</code> file should work just fine.</p><p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=605&amp;md5=e8a680c2ec9add7413e771f522f46805" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/whenever-gem-and-capistrano-specifying-the-cronjob-user/feed/</wfw:commentRss> <slash:comments>0</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Fwhenever-gem-and-capistrano-specifying-the-cronjob-user%2F&amp;language=en_GB&amp;category=text&amp;title=Whenever+Gem+and+Capistrano+%26%238211%3B+Specifying+the+cronjob+user&amp;description=If+you+are+using+Capistrano+in+a+project+that+relies+on+the+Whenever+gem+to+manage+your+crontab%2C+it+will+update+the+crontab+of+the+user+that+you+use+for...&amp;tags=capistrano%2Ccronjob%2Cwhenever+gem%2Cblog" type="text/html" /> </item> <item><title>Multiple unapply methods for pattern matching in Scala</title><link>http://coding-journal.com/multiple-unapply-methods-for-pattern-matching-in-scala/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=multiple-unapply-methods-for-pattern-matching-in-scala</link> <comments>http://coding-journal.com/multiple-unapply-methods-for-pattern-matching-in-scala/#comments</comments> <pubDate>Fri, 21 Sep 2012 12:24:15 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[Scala]]></category> <category><![CDATA[pattern matching]]></category> <category><![CDATA[unapply]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=589</guid> <description><![CDATA[TLDR: Take my directly to the solution. I found this nice trick on the Scala forums. Lets imagine we have a case class such as the following: case class Foo&#40;a:String, b:String, c:String = null, d:String = null&#41; This case class, &#8230; <a
href="http://coding-journal.com/multiple-unapply-methods-for-pattern-matching-in-scala/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p><a
href="#tldr">TLDR: Take my directly to the solution.</a></p><p>I found this nice trick <a
href="http://www.scala-lang.org/node/11941">on the Scala forums</a>. Lets imagine we have a case class such as the following:</p><div
class="codecolorer-container scala blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="scala codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">class</span></a> Foo<span
style="color: #F78811;">&#40;</span>a<span
style="color: #000080;">:</span>String, b<span
style="color: #000080;">:</span>String, c<span
style="color: #000080;">:</span>String <span
style="color: #000080;">=</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">null</span></a>, d<span
style="color: #000080;">:</span>String <span
style="color: #000080;">=</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">null</span></a><span
style="color: #F78811;">&#41;</span></div></div><p>This case class, as you probably know, can now be &#8220;pattern matched&#8221; like this:</p><div
class="codecolorer-container scala blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="scala codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Foo<span
style="color: #F78811;">&#40;</span><span
style="color: #6666FF;">&quot;foo&quot;</span>, <span
style="color: #6666FF;">&quot;bar&quot;</span>, <span
style="color: #6666FF;">&quot;baz&quot;</span>, <span
style="color: #6666FF;">&quot;wobble&quot;</span><span
style="color: #F78811;">&#41;</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">match</span></a> <span
style="color: #F78811;">&#123;</span><br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> Foo<span
style="color: #F78811;">&#40;</span><span
style="color: #6666FF;">&quot;foo&quot;</span>, b, <span
style="color: #000080;">_</span>, <span
style="color: #000080;">_</span><span
style="color: #F78811;">&#41;</span> <span
style="color: #000080;">=&gt;</span> b<br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> <span
style="color: #000080;">_</span> <span
style="color: #000080;">=&gt;</span> <span
style="color: #6666FF;">&quot;What?&quot;</span><br
/> <span
style="color: #F78811;">&#125;</span></div></div><p>But what if, most of the time, you only need the first two arguments, and the others are mostly irrelevant for your pattern matching. You wouldn&#8217;t want to write <code>Foo(a, _, _ ,_)</code> all the time, right? One possibility would be to write the <code>unapply(x:Foo)</code> method yourself:</p><div
class="codecolorer-container scala blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="scala codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">class</span></a> Foo<span
style="color: #F78811;">&#40;</span><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> a<span
style="color: #000080;">:</span>String, <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> b<span
style="color: #000080;">:</span>String, <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> c<span
style="color: #000080;">:</span>String <span
style="color: #000080;">=</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">null</span></a>, <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> d<span
style="color: #000080;">:</span>String <span
style="color: #000080;">=</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">null</span></a><span
style="color: #F78811;">&#41;</span><br
/> <br
/> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">object</span></a> Foo <span
style="color: #F78811;">&#123;</span><br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">def</span></a> unapply<span
style="color: #F78811;">&#40;</span>x<span
style="color: #000080;">:</span>Foo<span
style="color: #F78811;">&#41;</span><span
style="color: #000080;">:</span> Option<span
style="color: #F78811;">&#91;</span><span
style="color: #F78811;">&#40;</span>String, String<span
style="color: #F78811;">&#41;</span><span
style="color: #F78811;">&#93;</span> <span
style="color: #000080;">=</span> Some<span
style="color: #F78811;">&#40;</span>x.<span
style="color: #000000;">a</span>, x.<span
style="color: #000000;">b</span><span
style="color: #F78811;">&#41;</span><br
/> <span
style="color: #F78811;">&#125;</span><br
/> <br
/> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">new</span></a> Foo<span
style="color: #F78811;">&#40;</span><span
style="color: #6666FF;">&quot;foo&quot;</span>, <span
style="color: #6666FF;">&quot;bar&quot;</span>, <span
style="color: #6666FF;">&quot;baz&quot;</span>, <span
style="color: #6666FF;">&quot;wobble&quot;</span><span
style="color: #F78811;">&#41;</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">match</span></a> <span
style="color: #F78811;">&#123;</span><br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> Foo<span
style="color: #F78811;">&#40;</span><span
style="color: #6666FF;">&quot;foo&quot;</span>, b<span
style="color: #F78811;">&#41;</span> <span
style="color: #000080;">=&gt;</span> b<br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> <span
style="color: #000080;">_</span> <span
style="color: #000080;">=&gt;</span> <span
style="color: #6666FF;">&quot;What?&quot;</span><br
/> <span
style="color: #F78811;">&#125;</span></div></div><p>But what if you would like to use <em>both</em> unapply methods at some point? In that case you have to define multiple objects with different unapply methods, because unfortunately, unlike <code>apply</code>, <code>unapply</code> can&#8217;t be overloaded (because it always takes the the same argument).</p><p><a
id="tldr"></a> So here is my approach to multiple <code>unapply</code> methods:</p><div
class="codecolorer-container scala blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="scala codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">class</span></a> Foo<span
style="color: #F78811;">&#40;</span><a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> a<span
style="color: #000080;">:</span>String, <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> b<span
style="color: #000080;">:</span>String, <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> c<span
style="color: #000080;">:</span>String <span
style="color: #000080;">=</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">null</span></a>, <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">val</span></a> d<span
style="color: #000080;">:</span>String <span
style="color: #000080;">=</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">null</span></a><span
style="color: #F78811;">&#41;</span><br
/> <br
/> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">object</span></a> Foo<span
style="color: #000080;">_</span> <span
style="color: #F78811;">&#123;</span><br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">def</span></a> unapply<span
style="color: #F78811;">&#40;</span>x<span
style="color: #000080;">:</span>Foo<span
style="color: #F78811;">&#41;</span><span
style="color: #000080;">:</span> Option<span
style="color: #F78811;">&#91;</span><span
style="color: #F78811;">&#40;</span>String, String<span
style="color: #F78811;">&#41;</span><span
style="color: #F78811;">&#93;</span> <span
style="color: #000080;">=</span> Some<span
style="color: #F78811;">&#40;</span>x.<span
style="color: #000000;">a</span>, x.<span
style="color: #000000;">b</span><span
style="color: #F78811;">&#41;</span><br
/> <span
style="color: #F78811;">&#125;</span><br
/> <br
/> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">new</span></a> Foo<span
style="color: #F78811;">&#40;</span><span
style="color: #6666FF;">&quot;foo&quot;</span>, <span
style="color: #6666FF;">&quot;bar&quot;</span>, <span
style="color: #6666FF;">&quot;baz&quot;</span>, <span
style="color: #6666FF;">&quot;wobble&quot;</span><span
style="color: #F78811;">&#41;</span> <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">match</span></a> <span
style="color: #F78811;">&#123;</span><br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> Foo<span
style="color: #000080;">_</span><span
style="color: #F78811;">&#40;</span><span
style="color: #6666FF;">&quot;foo&quot;</span>, b<span
style="color: #F78811;">&#41;</span> <span
style="color: #000080;">=&gt;</span> b<br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> Foo<span
style="color: #F78811;">&#40;</span>a, <span
style="color: #000080;">_</span>, <span
style="color: #000080;">_</span>, d<span
style="color: #F78811;">&#41;</span> <span
style="color: #000080;">=&gt;</span> <span
style="color: #F78811;">&#40;</span>a, d<span
style="color: #F78811;">&#41;</span><br
/> &nbsp; &nbsp; <a
href="http://scala-lang.org"><span
style="color: #0000ff; font-weight: bold;">case</span></a> <span
style="color: #000080;">_</span> <span
style="color: #000080;">=&gt;</span> <span
style="color: #6666FF;">&quot;What?&quot;</span><br
/> <span
style="color: #F78811;">&#125;</span></div></div><p>While it isn&#8217;t exactly awesome because you have to introduce a new object <code>Foo_</code>, I like it better than always having to write out all 4 (or more) parameters.</p><p>If you have a better approach to this problem, please let me know :)</p><p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=589&amp;md5=7f1a63247f60a67f2fc6c3ed45f6e548" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/multiple-unapply-methods-for-pattern-matching-in-scala/feed/</wfw:commentRss> <slash:comments>2</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Fmultiple-unapply-methods-for-pattern-matching-in-scala%2F&amp;language=en_GB&amp;category=text&amp;title=Multiple+unapply+methods+for+pattern+matching+in+Scala&amp;description=TLDR%3A+Take+my+directly+to+the+solution.+I+found+this+nice+trick+on+the+Scala+forums.+Lets+imagine+we+have+a+case+class+such+as+the+following%3A+case+class+Foo%26%2340%3Ba%3AString%2C...&amp;tags=pattern+matching%2Cunapply%2Cblog" type="text/html" /> </item> <item><title>Teamspeak 3 installation script for Debian/Ubuntu</title><link>http://coding-journal.com/teamspeak-3-installation-script-for-debianubuntu/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=teamspeak-3-installation-script-for-debianubuntu</link> <comments>http://coding-journal.com/teamspeak-3-installation-script-for-debianubuntu/#comments</comments> <pubDate>Sat, 15 Sep 2012 23:54:22 +0000</pubDate> <dc:creator>Lucas Jenß</dc:creator> <category><![CDATA[Shell Scripting]]></category> <category><![CDATA[automated]]></category> <category><![CDATA[teamspeak]]></category> <guid
isPermaLink="false">http://coding-journal.com/?p=553</guid> <description><![CDATA[I installed a Teamspeak server today, and because I had a little time and wanted to brush up my bash scripting skills anyway, I coded a Teamspeak 3 server installation script that should work on most Debian systems (such as &#8230; <a
href="http://coding-journal.com/teamspeak-3-installation-script-for-debianubuntu/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<p>I installed a Teamspeak server today, and because I had a little time and wanted to brush up my bash scripting skills anyway, I coded a Teamspeak 3 server installation script that should work on most Debian systems (such as Ubuntu). Because of possible legal issues I didn&#8217;t include the download of the installation files itself in the script, so you&#8217;ll have to <a
href="http://www.teamspeak.com/?page=downloads">download those yourself</a> (use either &#8220;Server amd64&#8243; or &#8220;Server x86&#8243; depending on your system).</p><p>After downloading the installation archive (<strong>don&#8217;t extract</strong>), you can execute the following to install your very own Teamspeak 3 server:</p><div
class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div
class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #c20cb9; font-weight: bold;">wget</span> https:<span
style="color: #000000; font-weight: bold;">//</span>raw.github.com<span
style="color: #000000; font-weight: bold;">/</span>gist<span
style="color: #000000; font-weight: bold;">/</span><span
style="color: #000000;">3730343</span><span
style="color: #000000; font-weight: bold;">/</span>39db4465b5f7f97213f015bedb888e74c7db8526<span
style="color: #000000; font-weight: bold;">/</span>install_teamspeak.sh <span
style="color: #000000; font-weight: bold;">&amp;&amp;</span> \<br
/> &nbsp; &nbsp; <span
style="color: #c20cb9; font-weight: bold;">chmod</span> +x install_teamspeak.sh <span
style="color: #000000; font-weight: bold;">&amp;&amp;</span> \<br
/> &nbsp; &nbsp; .<span
style="color: #000000; font-weight: bold;">/</span>install_teamspeak.sh <span
style="color: #000000; font-weight: bold;">&lt;</span>insert path to installation archive here<span
style="color: #000000; font-weight: bold;">&gt;</span></div></div><p>If you&#8217;d like to take a look at the script, don&#8217;t let me keep you. If you run into any problems, please leave me a comment :)</p> <script src="https://gist.github.com/3730343.js"></script> <p><a
href="http://coding-journal.com/?flattrss_redirect&amp;id=553&amp;md5=c39e3f4858a5c0f047d6402a4d550ef0" title="Flattr" target="_blank"><img
src="http://coding-journal.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://coding-journal.com/teamspeak-3-installation-script-for-debianubuntu/feed/</wfw:commentRss> <slash:comments>7</slash:comments> <atom:link rel="payment" title="Flattr this!" href="https://flattr.com/submit/auto?user_id=x3rames&amp;popout=1&amp;url=http%3A%2F%2Fcoding-journal.com%2Fteamspeak-3-installation-script-for-debianubuntu%2F&amp;language=en_GB&amp;category=text&amp;title=Teamspeak+3+installation+script+for+Debian%2FUbuntu&amp;description=I+installed+a+Teamspeak+server+today%2C+and+because+I+had+a+little+time+and+wanted+to+brush+up+my+bash+scripting+skills+anyway%2C+I+coded+a+Teamspeak+3+server+installation...&amp;tags=automated%2Cteamspeak%2Cblog" type="text/html" /> </item> </channel> </rss>