<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>Coderspiel</title><generator>Tumblr (3.0; @coderspiel)</generator><link>http://code.technically.us/</link><item><title>Dispatch 0.7.6</title><description>&lt;a href="http://implicit.ly/dispatch-076"&gt;Dispatch 0.7.6&lt;/a&gt;: &lt;p&gt;Broader redirect handling, support for Google ClientLogin, a JSON extractor for optional properties, and OAuth compatibility with Twitter’s streaming API.&lt;/p&gt;</description><link>http://code.technically.us/post/1054548581</link><guid>http://code.technically.us/post/1054548581</guid><pubDate>Thu, 02 Sep 2010 15:41:39 -0400</pubDate><category>Dispatch</category><category>Scala</category><category>Twitter</category><category>OAuth</category><category>ClientLogin</category></item><item><title>"simple-build-tool plugin to publish and distribute your Scala projects using Github as Ivy..."</title><description>“simple-build-tool plugin to publish and distribute your Scala projects using Github as Ivy repository”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://github.com/siasia/plugin"&gt;siasia’s plugin at master - GitHub&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/1053900508</link><guid>http://code.technically.us/post/1053900508</guid><pubDate>Thu, 02 Sep 2010 12:00:27 -0400</pubDate><category>sbt</category><category>plugins</category><category>github</category><category>Software distribution</category><category>Scala</category></item><item><title>Samsung’s idea of bicycling with technology looks more...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_l84dmdALId1qb6dplo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://gizmodo.com/5628214/samsung-galaxy-tab-lifestyle-gallery/gallery/5"&gt;Samsung’s idea of bicycling with technology&lt;/a&gt; looks more fun, less authorized &lt;a href="http://code.technically.us/post/912950746/apple-to-bring-much-needed-authorization-to"&gt;than Apple’s&lt;/a&gt;&lt;/p&gt;</description><link>http://code.technically.us/post/1053078930</link><guid>http://code.technically.us/post/1053078930</guid><pubDate>Thu, 02 Sep 2010 08:35:00 -0400</pubDate><category>Cycling</category><category>Samsung</category><category>Chillness</category><category>Android</category><category>Gizmodo</category></item><item><title>Obama administration: "Piracy is flat, unadulterated theft"</title><description>&lt;a href="http://arstechnica.com/tech-policy/news/2010/08/obama-administration-piracy-is-flat-unadulterated-theft.ars"&gt;Obama administration: "Piracy is flat, unadulterated theft"&lt;/a&gt;: &lt;p&gt;If copyright violations are &lt;em&gt;just like theft&lt;/em&gt; (and they are not, if you think about it for 1.5 seconds), why are the penalties millions of dollars more than for shoplifting?&lt;/p&gt;</description><link>http://code.technically.us/post/1048322551</link><guid>http://code.technically.us/post/1048322551</guid><pubDate>Wed, 01 Sep 2010 11:49:36 -0400</pubDate><category>Bad analogies</category><category>Obama</category><category>Dumb property</category><category>Old media</category><category>Ars</category></item><item><title>"I’ll make you a deal: once Mac Rumors and Macworld update their respective articles that make..."</title><description>“I’ll make you a deal: once Mac Rumors and Macworld update their respective articles that make exactly the same points I did, I’ll update mine. Until then, I won’t defer to the wisdom of the internet’s armchair licensing experts.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://www.tuaw.com/2010/08/26/royalty-free-h-264-is-a-big-win-for-html5-big-loss-for-flash/3#comments"&gt;Adventures in Oblivious Self-Contradiction&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/1020789668</link><guid>http://code.technically.us/post/1020789668</guid><pubDate>Fri, 27 Aug 2010 14:19:00 -0400</pubDate><category>Armchairs</category><category>Experts</category><category>Dumb Property</category><category>New Media</category><category>Video</category><category>Patents</category></item><item><title>"On the other hand, because many of Scala’s concepts are very general and orthogonal, they can be..."</title><description>“On the other hand, because many of Scala’s concepts are very general and orthogonal, they can be combined in a large number of ways. So it is indeed true that almost anything can be achieved in different ways in Scala. It takes practice to discover that often some ways are preferable to others. And it takes a certain amount of tolerance to accept that sometimes there’s more than one route to a good design.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://lamp.epfl.ch/~odersky/blogs/isscalacomplex.html"&gt;Simple or Complex?&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/1014215544</link><guid>http://code.technically.us/post/1014215544</guid><pubDate>Thu, 26 Aug 2010 09:10:37 -0400</pubDate><category>Scala</category><category>Complexity</category><category>Orthogonality</category><category>Software</category><category>Design</category><category>Odersky</category></item><item><title>Holding the Parameter</title><description>&lt;p&gt;HTTP requests: you want to serve them. You want to respond in the 200s. But some requests just don’t make the cut. They lack the attributes you’re looking for, or they have the attributes but in the wrong proportion. In short, some requests are just a bad &lt;em&gt;match&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://github.com/n8han/unfiltered#readme"&gt;Unfiltered&lt;/a&gt; web toolkit gives you two ways to handle request parameters. (Those two are in addition to the infinitely many ways you could handle the parameter map yourself, or even directly access the &lt;code&gt;HttpServletRequest&lt;/code&gt; if you want to &lt;em&gt;go there&lt;/em&gt;.) The first was really easy to build. It’s a natural extension of the pattern matching that Unfiltered uses generally:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;object Number extends Params.Extract(
  "number", 
  Params.first ~&gt; Params.int
)
class MyFilter extends unfiltered.Planify({
  case POST(Path("/hi", Params(Number(num, _), _))) =&gt; 
    ResponseString(num.toString)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And that would give you a filter that only responds when a parameter is supplied that’s called “number” and is an integer. It’s a little odd that the extractor must be defined in an object outside the partial function that defines request handling, but the &lt;em&gt;real&lt;/em&gt; shortcoming of this approach is that you can’t easily define behavior for when the parameter is missing, or bad. You can nest pattern matching statements to catch some of the failure conditions, but it’s not going to be pretty (or complete).&lt;/p&gt;

&lt;p&gt;For an internal service, or a prototype of an external one, descriptively responding to bad inputs may not be a concern. In that case, go to town with the parameter extractor object. It’s an easy and typesafe way to define and handle acceptable inputs. It offloads the effort of dealing with errorneous input to the client making the request.&lt;/p&gt;

&lt;p&gt;But most services can’t just tell bad clients to bug off. For them, there’s &lt;code&gt;QParam&lt;/code&gt;. It can map parameter failures to very specific error responses, no matter how many parameters fail.&lt;/p&gt;

&lt;p&gt;For example!&lt;/p&gt;

&lt;iframe src="http://sourced.implicit.ly/net.databinder/unfiltered.test/0.1.4/ParamsSpec.scala.html?id=19982" width="570" height="200" frameborder="0"&gt;&lt;em&gt;If you’re not seeing sexy code here you need to click through to &lt;a href="http://tumblr.com/xsggibzj8"&gt;the actual post&lt;/a&gt;.&lt;/em&gt;
&lt;/iframe&gt;

&lt;p&gt;This rather dense chunk of code will match on any GET request to “/even”, and respond with either a 200 or 400 depending on the validity of the parameters supplied. Its parameter requirements are defined in a &lt;code&gt;for&lt;/code&gt; expression, whose &lt;code&gt;yield&lt;/code&gt; statement is only evaluated if no errors have accumulated. After defining the requirements, you apply a set of parameters and provide a function to handle the error list if it is non-empty.&lt;/p&gt;

&lt;p&gt;In this case we start with a parameter “number” which must parse into an &lt;code&gt;int&lt;/code&gt; or the error object “nonnumber” will be recorded. (The type of error objects for an expression is inferred from the first error object supplied.) Secondly, it must satisfy the predicate &lt;code&gt;{ (_: Int) % 2 == 0 }&lt;/code&gt; or we’ll note that it was “odd”, and finally it must exist or else it is “missing”. If any requirement on a parameter fails, its remaining requirements are skipped and the next parameter is evaluated.&lt;/p&gt;

&lt;p&gt;How does it work? It’s a variation of the state-transformer monad, apparently. I knew how I wanted parameter evaluation to work, and tried to write it “from scratch” but that didn’t produce anything useful. So I ripped off some code from &lt;a href="http://github.com/szeiger/scala-query"&gt;ScalaQuery&lt;/a&gt; (yes—the SQL API) and that somehow did work. I thought my hack job was pretty slick and showed it to Chris League, who &lt;a href="http://vimeo.com/13304075"&gt;spoke to our Meetup group&lt;/a&gt; about these fancy topics recently. He promptly rewrote it. After some further negotiation, this is what we ended up with:&lt;/p&gt;

&lt;iframe src="http://sourced.implicit.ly/net.databinder/unfiltered/0.1.4/request/params.scala.html?id=6843" width="570" height="460" frameborder="0"&gt;&lt;em&gt;&lt;a href="http://tumblr.com/xsggibzj8"&gt;Ditto&lt;/a&gt;.&lt;/em&gt;&lt;/iframe&gt;

&lt;p&gt;And so on.&lt;/p&gt;

&lt;p&gt;In case you want to try this stuff out, we added some fun parameter gymnastics to Unfiltered’s &lt;a href="http://github.com/softprops/unfiltered.g8"&gt;template project&lt;/a&gt;. It’s a &lt;a href="http://github.com/n8han/giter8#readme"&gt;giter8&lt;/a&gt; template, so if you have &lt;code&gt;g8&lt;/code&gt; on your path you can&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ g8 softprops/unfiltered
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and be on your way. Of course, no one has &lt;code&gt;g8&lt;/code&gt; on their path yet, so &lt;em&gt;you&lt;/em&gt; could be the first person in your timezone to make the &lt;a href="http://github.com/n8han/giter8#readme"&gt;exciting leap to the future of Scala applications installed and launched by sbt&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It’s been a busy summer.&lt;/p&gt;</description><link>http://code.technically.us/post/998251172</link><guid>http://code.technically.us/post/998251172</guid><pubDate>Mon, 23 Aug 2010 10:35:00 -0400</pubDate><category>FP</category><category>Giter8</category><category>Scala</category><category>The Static Typing</category><category>Unfiltered</category><category>Web</category><category>La Monade</category></item><item><title>"This is a simple-build-tool plugin for compiling CoffeeScript files into their javascript..."</title><description>“This is a simple-build-tool plugin for compiling CoffeeScript files into their javascript conterparts.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://groups.google.com/group/simple-build-tool/browse_thread/thread/6651aca5ada33151/d10935a0f53c042f?show_docid=d10935a0f53c042f&amp;pli=1"&gt;coffee-script-sbt-plugin&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/989015835</link><guid>http://code.technically.us/post/989015835</guid><pubDate>Sat, 21 Aug 2010 16:39:14 -0400</pubDate><category>sbt</category><category>Plugins</category><category>CoffeeScript</category><category>Hells Yeah</category></item><item><title>You sound somewhat obsessed with fonts.</title><description>&lt;img src="http://30.media.tumblr.com/tumblr_l7gdykKuDh1qb6dplo1_500.gif"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://wondermark.com/650/"&gt;You sound somewhat obsessed with fonts.&lt;/a&gt;&lt;/p&gt;</description><link>http://code.technically.us/post/982400357</link><guid>http://code.technically.us/post/982400357</guid><pubDate>Fri, 20 Aug 2010 09:39:00 -0400</pubDate><category>Copperplate Gothic</category><category>Monotype Corsiva</category><category>Papyrus</category></item><item><title>"C2DM created a nice opportunity for us to pull together different Google developer tools to create a..."</title><description>“C2DM created a nice opportunity for us to pull together different Google developer tools to create a simple but useful application to enable users to push links and other information from their desktop / laptop to their phone.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://android-developers.blogspot.com/2010/08/powering-chrome-to-phone-with-android.html"&gt;Powering Chrome to Phone with Android to Device Messaging&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/943401924</link><guid>http://code.technically.us/post/943401924</guid><pubDate>Thu, 12 Aug 2010 15:20:54 -0400</pubDate><category>Android</category><category>Chrome</category><category>Google</category><category>Push</category><category>ADB</category></item><item><title>Brendan McAdams gives an introduction to MongoDB and the...</title><description>&lt;object type="application/x-shockwave-flash" data="http://vimeo.com/moogaloop.swf" width="400" height="225"&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf" /&gt;&lt;param name="flashvars" value="clip_id=14090025&amp;color=00adef&amp;fullscreen=1&amp;server=vimeo.com&amp;show_byline=1&amp;show_portrait=1&amp;show_title=1" /&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://vimeo.com/14090025"&gt;Brendan McAdams gives an introduction&lt;/a&gt; to MongoDB and the libraries available for using it with Scala.&lt;/p&gt;</description><link>http://code.technically.us/post/942542158</link><guid>http://code.technically.us/post/942542158</guid><pubDate>Thu, 12 Aug 2010 11:29:47 -0400</pubDate><category>Scala</category><category>MongoDB</category><category>NoSQL</category><category>rit</category><category>Meetups</category><category>Videos</category></item><item><title>Doug Tangren presents the Unfiltered toolkit for serving HTTP...</title><description>&lt;object type="application/x-shockwave-flash" data="http://vimeo.com/moogaloop.swf" width="400" height="225"&gt;&lt;param name="allowscriptaccess" value="always" /&gt;&lt;param name="allowfullscreen" value="true" /&gt;&lt;param name="movie" value="http://vimeo.com/moogaloop.swf" /&gt;&lt;param name="flashvars" value="clip_id=14042004&amp;color=00adef&amp;fullscreen=1&amp;server=vimeo.com&amp;show_byline=1&amp;show_portrait=1&amp;show_title=1" /&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://vimeo.com/14042004"&gt;Doug Tangren presents&lt;/a&gt; the &lt;a href="http://github.com/n8han/unfiltered"&gt;Unfiltered&lt;/a&gt; toolkit for serving HTTP requests in Scala.&lt;/p&gt;</description><link>http://code.technically.us/post/942531598</link><guid>http://code.technically.us/post/942531598</guid><pubDate>Thu, 12 Aug 2010 11:26:00 -0400</pubDate><category>Scala</category><category>Web</category><category>HTTP</category><category>softprops</category><category>Videos</category><category>Meetups</category></item><item><title>jeffplaisance's scala-protobuf</title><description>&lt;a href="http://github.com/jeffplaisance/scala-protobuf"&gt;jeffplaisance's scala-protobuf&lt;/a&gt;: &lt;p&gt;Scala compiler plugin, “generates type safe scala wrappers for java protoc output”&lt;/p&gt;</description><link>http://code.technically.us/post/938071540</link><guid>http://code.technically.us/post/938071540</guid><pubDate>Wed, 11 Aug 2010 14:33:08 -0400</pubDate><category>Scala</category><category>protobuf</category><category>RPC</category><category>Serialization</category></item><item><title>"Maybe it’s the creative pauses forced on them when they wait for the type-checker to finish."</title><description>“Maybe it’s the creative pauses forced on them when they wait for the type-checker to finish.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://blog.fogus.me/2010/08/06/martinodersky-take5-tolist/"&gt;Odersky, on why Haskell and Scala programmers are so hilarious&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/913651228</link><guid>http://code.technically.us/post/913651228</guid><pubDate>Fri, 06 Aug 2010 14:33:50 -0400</pubDate><category>Scala</category><category>Haskell</category><category>The static typing</category><category>FP</category><category>Fogus</category></item><item><title>Apple to bring much needed “authorization” to...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_l6qkd34ccW1qb6dplo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://www.readwriteweb.com/archives/apple_patents_the_ibike.php"&gt;Apple to bring much needed “authorization” to bicycle pedaling process&lt;/a&gt;&lt;/p&gt;</description><link>http://code.technically.us/post/912950746</link><guid>http://code.technically.us/post/912950746</guid><pubDate>Fri, 06 Aug 2010 11:00:39 -0400</pubDate><category>Software Freedom</category><category>Apple</category><category>Cycling</category><category>Lameness</category><category>Lexus drivers who don't understand bicycles</category></item><item><title>"So, while Lamo has repeatedly denied that he ever worked with federal authorities, it turns out that..."</title><description>“So, while Lamo has repeatedly denied that he ever worked with federal authorities, it turns out that he was a ‘volunteer analyst’ for an entity which collects private Internet data in order to process it and turn it over to the Federal Government.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://www.salon.com/news/opinion/glenn_greenwald/2010/08/02/privacy"&gt;Lamo indirectly working for the US government all along&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/898206317</link><guid>http://code.technically.us/post/898206317</guid><pubDate>Tue, 03 Aug 2010 10:35:00 -0400</pubDate><category>Greenwald</category><category>Lamo</category><category>Mean Hacks</category><category>Wikleaks</category><category>Manning</category></item><item><title>"scalaxb-appengine is a RESTful API to run scalaxb over the web. It’s implemented using..."</title><description>“&lt;strong&gt;scalaxb-appengine&lt;/strong&gt; is a RESTful API to run scalaxb over the web. It’s implemented using n8han/Unfiltered and the full source is available on eed3si9n/scalaxb-appengine.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://scalaxb.org/scalaxb-appengine"&gt;eed3si9n&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/870911091</link><guid>http://code.technically.us/post/870911091</guid><pubDate>Wed, 28 Jul 2010 10:35:52 -0400</pubDate><category>Scala</category><category>Web</category><category>Unfiltered</category><category>HTTP</category><category>eed3si9n</category></item><item><title>"On balance, the Register concludes that when one jailbreaks a smartphone in order to make the..."</title><description>“On balance, the Register concludes that when one jailbreaks a smartphone in order to make the operating system on that phone interoperable with an independently created application that has not been approved by the maker of the smartphone or the maker of its operating system, the modifications that are made purely for the purpose of such interoperability are fair uses.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://arstechnica.com/tech-policy/news/2010/07/apple-loses-big-in-drm-ruling-jailbreaks-are-fair-use.ars"&gt;The Register of Copyrights&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/862248355</link><guid>http://code.technically.us/post/862248355</guid><pubDate>Mon, 26 Jul 2010 14:26:56 -0400</pubDate><category>Software freedom</category><category>US</category><category>Copyright</category><category>Clueful</category></item><item><title>a soft sea: a well formed cupcake</title><description>&lt;a href="http://asoftsea.tumblr.com/post/830728351"&gt;a soft sea: a well formed cupcake&lt;/a&gt;: &lt;blockquote&gt;
&lt;p&gt;Here’s a simple little sprinkle for anyone wondering how to serve xml with self-closing tags in Scala.&lt;/p&gt; &lt;p&gt;The basic cooking ingredients in Scala’s xml kitchen will output closing tags, even when the recipe does not call for them.&lt;/p&gt; &lt;pre&gt;&lt;code&gt;val selfClosingCupcake = &lt;cupcake /&gt;
&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;Will always unsuspectingly…&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://code.technically.us/post/832071795</link><guid>http://code.technically.us/post/832071795</guid><pubDate>Mon, 19 Jul 2010 09:58:10 -0400</pubDate><category>Scala</category><category>Web</category><category>Unfiltered</category><category>Friggin' Tips</category></item><item><title>"Casbah provides a series of wrappers and DSL-like (AKA fluid query syntax) functionality for better..."</title><description>“Casbah provides a series of wrappers and DSL-like (AKA fluid query syntax) functionality for better utilizing MongoDB from within Scala.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://implicit.ly/casbah-10"&gt;casbah 1.0 - implicit.ly&lt;/a&gt;&lt;/em&gt;</description><link>http://code.technically.us/post/827942900</link><guid>http://code.technically.us/post/827942900</guid><pubDate>Sun, 18 Jul 2010 10:29:53 -0400</pubDate><category>Scala</category><category>MongoDB</category><category>Casbah</category><category>Key-value stores</category></item></channel></rss>
