<?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/"
	>

<channel>
	<title>Dagblastit</title>
	<atom:link href="http://www.dagblastit.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dagblastit.com/blog</link>
	<description>Dagblastit</description>
	<pubDate>Tue, 22 Nov 2011 17:34:20 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Chunk: yet another Java Template Engine</title>
		<link>http://www.dagblastit.com/blog/2011/01/chunk-yet-another-java-template-engine/</link>
		<comments>http://www.dagblastit.com/blog/2011/01/chunk-yet-another-java-template-engine/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 21:24:17 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=234</guid>
		<description><![CDATA[Q: Does the Java community really need yet another templating engine?
A: Not really, but back when I started Chunk, there wasn&#8217;t  anything else out there like it.  Now that it has matured, I am  releasing it into the wild, and if somebody finds it useful, great!
Click below for an introduction to better [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_239" class="wp-caption alignright" style="width: 160px"><a href="http://code.google.com/p/chunk-templates"><img class="size-thumbnail wp-image-239 " title="Chunk Templates" src="http://www.dagblastit.com/blog/wp-content/uploads/2011/01/chunk_logo_500x500-150x150.png" alt="Simple, powerful templates for Java" width="150" height="150" /></a><p class="wp-caption-text">Simple, powerful templates for Java</p></div></p>
<p>Q: Does the Java community really need yet another templating engine?</p>
<p>A: Not really, but back when I started Chunk, there wasn&#8217;t  anything else out there like it.  Now that it has matured, I am  <a href="http://code.google.com/p/chunk-templates/">releasing it into the wild</a>, and if somebody finds it useful, great!</p>
<p>Click below for an introduction to better code/layout separation:</p>
<p><a href="http://www.x5software.com/chunk/wiki">http://www.x5software.com/chunk/wiki</a></p>
<p>Features:</p>
<ul style="padding-left:20px; padding-bottom:20px;">
<li> Macros, Includes and Conditional Includes.</li>
<li> Flexible null-handling; template designer may specify default tag values.</li>
<li> Library of powerful predefined in-tag filters, including regex (regular expressions), sprintf.</li>
<li> Expose a subset of obj methods to template with a single line of code.</li>
<li> Define multiple snippets per template file.</li>
<li> Support for theme layers.</li>
<li> Highly optimized codebase.</li>
<li> Hooks for extending.</li>
<li> Eclipse Template Editor plugin available with syntax highlighting &amp; more.</li>
</ul>
<p>Visit the <a href="http://code.google.com/p/chunk-templates/">Chunk project home on Google Code</a> to <a href="http://code.google.com/p/chunk-templates/downloads/list">download the Chunk Templates jar</a> and get started.</p>
<p>I don&#8217;t know if Chunk is better than Velocity, I don&#8217;t know if Chunk is better than FreeMarker, but I&#8217;ve been using it for years and it&#8217;s gotten pretty cool.</p>
<p>Hackers are encouraged to contribute enhancements back to the community.  Google is hosting the code on its SVN server so it&#8217;s easy to check out a copy of the source and make whatever improvements you need.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2011/01/chunk-yet-another-java-template-engine/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fix or extend core Magento in an upgrade-safe way</title>
		<link>http://www.dagblastit.com/blog/2010/11/fix-core-magento-in-an-upgrade-safe-way/</link>
		<comments>http://www.dagblastit.com/blog/2010/11/fix-core-magento-in-an-upgrade-safe-way/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 16:22:03 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Magento]]></category>

		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=227</guid>
		<description><![CDATA[Ah, open source.  The Magento core codebase, layouts and templates are right there, warts and all, just daring you to give in to temptation and ignore the &#8220;do not edit this file!&#8221; warning at the top of each distributed file.  We all know the guilty pleasure of instant gratification that comes with tweaking a word, [...]]]></description>
			<content:encoded><![CDATA[<p>Ah, open source.  The Magento core codebase, layouts and templates are right there, warts and all, just daring you to give in to temptation and ignore the &#8220;do not edit this file!&#8221; warning at the top of each distributed file.  We all know the guilty pleasure of instant gratification that comes with tweaking a word, or a layout, or a core class directly in the source and seeing our fix immediately on the site.  It seems especially rewarding after the hour or two it took just to hunt down the right cog in The Machine.  And really, who has time to learn entire frameworks and build a module, just to tweak the way a breadcrumb gets output?</p>
<p>But then it&#8217;s 500 (or 5,000!) lines of &#8220;little tweaks&#8221; later and you need to upgrade.  And you&#8217;re screwed.  And a couple extra xml files and a separate tree of folders and files doesn&#8217;t seem like such a bad idea anymore.</p>
<p>Well, okay, time to roll up your sleeves and learn this durn extension framework that the brainiacs at Varien/Magento have so lovingly constructed.</p>
<h3>Layouts and Templates and Blocks, Oh My</h3>
<p>classyllama.com has a great article on how to modify one or two things in a core layout without (1) modifying it directly in core or (2) having to make a copy of the whole layout file into your theme just to tweak one line:</p>
<p><a href="http://classyllama.com/development/magento-development/the-better-way-to-modify-magento-layout/">http://classyllama.com/development/magento-development/the-better-way-to-modify-magento-layout/</a></p>
<p>Now that I understand this layout stuff, I&#8217;m doing a lot less messing around directly in theme templates.  By the way, if you are editing the factory-supplied Magento templates and layouts directly, for shame!  <a href="http://blancer.com/tutorials/26604/magento-for-designers-part-3/">Set up a theme</a> and make all your changes in the theme.</p>
<p>Update: another great article on navigating the Magento layout framework:<br />
<a href="http://alanstorm.com/layouts_blocks_and_templates">http://alanstorm.com/layouts_blocks_and_templates</a></p>
<h3>OO PHP?  Isn&#8217;t that like oil and water?</h3>
<p>The article linked below offers a lucid explanation of how to roll your own modules that extend the core Model, Controller, Resource, and Block classes (it&#8217;s a little different for each case) to override the core behavior in Magento.  Not for beginners, you really need to have a handle on OO programming.  Again, this is cool because you don&#8217;t have to edit a core file directly (where changes will get blown away in an upgrade) and you don&#8217;t have to copy the whole file just to tweak one function.  The latter strategy prevents you from reaping the benefits of any bugfixes or new features in that file in the next upgrade, and could even cause serious problems/bugs as your copy gets out of sync with the core codebase.</p>
<p><a href="http://prattski.com/2010/06/24/magento-overriding-core-files-blocks-models-resources-controllers/">http://prattski.com/2010/06/24/magento-overriding-core-files-blocks-models-resources-controllers/</a></p>
<p>For some reason that comprehensive article does not include instructions for overriding a function in a helper class (yet another special case).  This article has an example for that:</p>
<p><a href="http://blog.chapagain.com.np/magento-block-controller-model-helper-override/">http://blog.chapagain.com.np/magento-block-controller-model-helper-override/</a></p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2010/11/fix-core-magento-in-an-upgrade-safe-way/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS Sucks (or, center this, microsoft)</title>
		<link>http://www.dagblastit.com/blog/2010/08/css-sucks-or-center-this-microsoft/</link>
		<comments>http://www.dagblastit.com/blog/2010/08/css-sucks-or-center-this-microsoft/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 16:20:01 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=204</guid>
		<description><![CDATA[CSS officially needs to be replaced.  Centering a dropdown menu should NOT be this hard:
http://matthewjamestaylor.com/blog/centered-dropdown-menus
Thank goodness I found that article or I would still be pulling my hair out.
In my day, used to be you could stick this in one or two tables and you were done.  We didn&#8217;t have no stinkin&#8217; separation [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cafepress.com/+css_sucks_colored_dark_tshirt,103766197"><img class="alignright" src="http://images7.cpcache.com/product_zoom/103766197v9_225x225_Front_padToSquare-true.jpg" alt="CSS Sucks" width="158" height="158" /></a>CSS officially needs to be replaced.  Centering a dropdown menu should NOT be this hard:</p>
<p><a href="http://matthewjamestaylor.com/blog/centered-dropdown-menus">http://matthewjamestaylor.com/blog/centered-dropdown-menus</a></p>
<p>Thank goodness I found that article or I would still be pulling my hair out.</p>
<p>In my day, used to be you could stick this in one or two tables and you were done.  We didn&#8217;t have no stinkin&#8217; separation of content and layout and we liked it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2010/08/css-sucks-or-center-this-microsoft/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Calling Magento SOAP API from Perl with SOAP::Lite</title>
		<link>http://www.dagblastit.com/blog/2010/08/use-magento-soap-api-from-perl-with-soaplite/</link>
		<comments>http://www.dagblastit.com/blog/2010/08/use-magento-soap-api-from-perl-with-soaplite/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 20:11:40 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Magento]]></category>

		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=154</guid>
		<description><![CDATA[We had a legacy order fulfillment library written in Perl, so although accessing the API is extremely easy in PHP, when we migrated to Magento I had to figure out how to connect to the SOAP API from Perl.
Turns out the most popular CPAN module for doing SOAP in Perl (SOAP::Lite) is not particularly fun [...]]]></description>
			<content:encoded><![CDATA[<p>We had a legacy order fulfillment library written in Perl, so although accessing the API is extremely easy in PHP, when we migrated to Magento I had to figure out how to connect to the SOAP API from Perl.</p>
<p>Turns out the most popular CPAN module for doing SOAP in Perl (SOAP::Lite) is not particularly fun to use (see &#8220;State of the SOAP&#8221; at <a href="http://www.soaplite.com/">http://www.soaplite.com/</a> for a three-year-old call for volunteers to refactor).</p>
<p>Nevertheless, I did eventually emerge victorious.  There may be a much easier way but after a lot of head-scratching and trial and error, this worked for me, YMMV.</p>
<p>The soapify routine was stolen from this page:<br />
 <a href="http://www.soaplite.com/2004/01/building_an_arr.html">http://www.soaplite.com/2004/01/building_an_arr.html</a><br />
Many thanks to soapify author Sandeep Satavlekar.</p>
<p>For passing the filter args to sales_order.list, I had to make the call in PHP first and then reverse-engineer the encoding of the nested array that actually got passed.  There may be a way to get SOAP::Lite to encode nested arrays like this by default (or encode nested arrays in some other standard SOAPy way that Magento would also accept) but I chose not to waste any more time on this than I already had.</p>
<p>Enjoy!</p>
<blockquote><p>UPDATE: Was getting sporadic &#8220;Access Denied&#8221; errors.  Turns out you can fix this just by  turning on cookies.  Apparently this only affects you if Magento is using DB sessions.  See new get_soap_session below for how to turn on cookies.</p></blockquote>
<blockquote><p>UPDATE TO THE UPDATE: Nah, that didn&#8217;t fix it.  Still searching for a fix&#8230; runs fine in a session, fails about 80% of the time from cron.</p></blockquote>
<p><div id="disappears">
The complete working example script is after the jump...</div></p>
<p><pre><code>
#!/usr/bin/perl

# replace these values with the soap account you set up in the admin
my $user = &#039;username&#039;;
my $pass = &#039;password&#039;;

# replace with your domain and path (we installed magento at /shop/)
my $soap_url = &#039;http://YOURDOMAIN/MAGENTO_PATH/index.php/api/index/index/&#039;;

my ($soap,$session_id) = &amp;get_soap_session($user,$pass,$soap_url);

# simple example (one arg of type string)
my $oid = &#039;1000001&#039;;
my $order = &amp;get_order($soap,$session_id,$oid);

# gnarly example (argument is nested arrays)
my $orders = &amp;get_recent_invoiced_orders($soap,$session_id);

foreach my $ord (@$orders) {
&nbsp;&nbsp;&nbsp;&nbsp;my $due = $ord-&gt;{grand_total};
&nbsp;&nbsp;&nbsp;&nbsp;my $paid_or_authorized = $ord-&gt;{total_invoiced};
&nbsp;&nbsp;&nbsp;&nbsp;my $owed = $due - $paid_or_authorized;
&nbsp;&nbsp;&nbsp;&nbsp;# ignore if not yet paid
&nbsp;&nbsp;&nbsp;&nbsp;next if ($owed &gt; .02);
&nbsp;&nbsp;&nbsp;&nbsp;&amp;fulfill_order($ord);
}

exit 0;
</code></pre><span id="more-154"></span><pre><code>
# 
# subroutines... should do this more OO but this is
# some simple, readable example code to help you avoid
# exploring the dark cave that I went into...
# 
sub get_order {
&nbsp;&nbsp;&nbsp;&nbsp;my $soap = shift;
&nbsp;&nbsp;&nbsp;&nbsp;my $session_id = shift;
&nbsp;&nbsp;&nbsp;&nbsp;my $oid = shift;

&nbsp;&nbsp;&nbsp;&nbsp;# Yes, we&#039;re really calling a method named &quot;call&quot; -- confusing, no?
&nbsp;&nbsp;&nbsp;&nbsp;#
&nbsp;&nbsp;&nbsp;&nbsp;# For simple calls with no args or just one or two string args, this
&nbsp;&nbsp;&nbsp;&nbsp;# straightforward code works fine.
&nbsp;&nbsp;&nbsp;&nbsp;#
&nbsp;&nbsp;&nbsp;&nbsp;# The first argument is always the session ID that was returned from the initial
&nbsp;&nbsp;&nbsp;&nbsp;# login call.&nbsp;&nbsp;The second argument is the requested API resource.
&nbsp;&nbsp;&nbsp;&nbsp;# Third is a list of any arguments to pass to the resource that&#039;s being invoked.
&nbsp;&nbsp;&nbsp;&nbsp;my $resp = $soap-&gt;call(&#039;call&#039; =&gt; ($session_id, &#039;sales_order.info&#039;, ($oid)));
&nbsp;&nbsp;&nbsp;&nbsp;return $resp-&gt;result;
}
</code></pre><pre><code>

sub get_recent_invoiced_orders {
&nbsp;&nbsp;&nbsp;&nbsp;my $soap = shift;
&nbsp;&nbsp;&nbsp;&nbsp;my $session_id = shift;

&nbsp;&nbsp;&nbsp;&nbsp;# limit query to orders with activity in past 60 days
&nbsp;&nbsp;&nbsp;&nbsp;my $sixty_days_back = &amp;sixty_days_back();

&nbsp;&nbsp;&nbsp;&nbsp;# If you can believe it, the crazy array below is really just this:
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;my $filter_a, $filter_b;
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;$filter_a-&gt;{status}-&gt;{eq} = &#039;processing&#039;;
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;$filter_b-&gt;{updated_at}-&gt;{gt} = $sixty_days_back;
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;my $filters = [ $filter_a, $filter_b ];

&nbsp;&nbsp;&nbsp;&nbsp;# look up correct namespace prefixes for soapenc and xsi
&nbsp;&nbsp;&nbsp;&nbsp;my $serializer = $soap-&gt;serializer();
&nbsp;&nbsp;&nbsp;&nbsp;my $soapenc = $serializer-&gt;encprefix || &#039;soapenc&#039;;
&nbsp;&nbsp;&nbsp;&nbsp;my $xsi = $serializer-&gt;find_prefix(&#039;http://www.w3.org/2001/XMLSchema-instance&#039;) || &#039;xsi&#039;;

&nbsp;&nbsp;&nbsp;&nbsp;# There might be some way to automatically generate the mess
&nbsp;&nbsp;&nbsp;&nbsp;# below from the simpler data structure above, but this works for now.
&nbsp;&nbsp;&nbsp;&nbsp;my $ugly_args = [&#039;item&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&#039;item&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [[&#039;key&#039;,&#039;status&#039;],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&#039;value&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&#039;item&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[&#039;key&#039;,&#039;eq&#039;],[&#039;value&#039;,&#039;processing&#039;]]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&quot;$xsi:type&quot;=&gt;&#039;apache:Map&#039;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&#039;item&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [[&#039;key&#039;,&#039;updated_at&#039;],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&#039;value&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&#039;item&#039;,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[&#039;key&#039;,&#039;gt&#039;],[&#039;value&#039;,$sixty_days_back]]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&quot;$xsi:type&quot;=&gt;&#039;apache:Map&#039;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {&quot;$xsi:type&quot;=&gt;&#039;apache:Map&#039;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;];

</code></pre><pre><code>
&nbsp;&nbsp;&nbsp;&nbsp;my $ugly = [&#039;args&#039;,$ugly_args,{&quot;$soapenc:arrayType&quot;=&gt;&#039;apache:Map[1]&#039;,&quot;$xsi:type&quot;,&quot;$soapenc:Array&quot;}];
</code></pre><pre><code>

&nbsp;&nbsp;&nbsp;&nbsp;my @soap_args;
&nbsp;&nbsp;&nbsp;&nbsp;$soap_args[0] = [&#039;sessionId&#039;,$session_id];
&nbsp;&nbsp;&nbsp;&nbsp;$soap_args[1] = [&#039;resourcePath&#039;,&#039;sales_order.list&#039;];
&nbsp;&nbsp;&nbsp;&nbsp;$soap_args[2] = $ugly;

&nbsp;&nbsp;&nbsp;&nbsp;my @data;
&nbsp;&nbsp;&nbsp;&nbsp;foreach my $arg (@soap_args) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push @data, &amp;soapify_args($arg);
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;my $resp = $soap-&gt;call(&#039;call&#039; =&gt; @data);
&nbsp;&nbsp;&nbsp;&nbsp;return $resp-&gt;result;
}

####################################################################
# soapify_args
#
# Description:
# Given an arrayref (infinite depth), constructs a valid SOAP Object
#
# Parameters:
# $args: Arrayref
#
# Format of the arrayref:
# [xml_element_name, value, attributes]
# xml_element_name must be a scalar, value could be a scalar or another arrayref of the same format and
# attributes must be a hashref. xml_element_name and attributes are optional.
#
# Examples:
# 1. [&quot;ElemName1&quot;, &quot;ElemValue1&quot;, { &quot;xmlns&quot; =&gt; &quot;http://blah/blah&quot;}]
# 2. [&quot;ElemName2&quot;, [
# [&quot;NameAtLevel1&quot;, &quot;ValueAtLevel1&quot;, {}],
# ], {&quot;attrname&quot; =&gt; &quot;attrvalue&quot;}]
# 3. [
# [&quot;name&quot;, &quot;value&quot;]
# ]
#
# Return Value:
# SOAP object
############################################################
sub soapify_args {
&nbsp;&nbsp;&nbsp;&nbsp;my ($args) = (@_);

&nbsp;&nbsp;&nbsp;&nbsp;die &quot;The argument must be an arrayref!&quot; if (ref($args) !~ /ARRAY/ );

&nbsp;&nbsp;&nbsp;&nbsp;my @namevaluearray = @$args;
&nbsp;&nbsp;&nbsp;&nbsp;my $soapobject = new SOAP::Data;

&nbsp;&nbsp;&nbsp;&nbsp;if (defined ($namevaluearray[0]) &amp;&amp; ref($namevaluearray[0]) !~ /ARRAY/) {

#------------------name------------------------# 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$soapobject-&gt;name($namevaluearray[0]);

#------------------value-----------------------#
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (defined $namevaluearray[1] &amp;&amp; !ref($namevaluearray[1])) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$soapobject-&gt;value($namevaluearray[1]);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;elsif (ref($namevaluearray[1]) =~ /ARRAY/) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $soapvalue = soapify_args($namevaluearray[1]);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my @pass = (ref($soapvalue) =~ /ARRAY/) ? @$soapvalue : ($soapvalue);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$soapobject-&gt;value(SOAP::Data-&gt;value(@pass));
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

#-------------------attribute------------------#
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $attr = $namevaluearray[2];
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (ref($attr) =~ /HASH/) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$soapobject-&gt;attr($attr);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;elsif (ref($namevaluearray[0]) =~ /ARRAY/) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my @valuesarray;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach my $element (@namevaluearray) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;my $reftoelement = (ref($element) =~ /ARRAY/) ? $element : [$element];
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;push(@valuesarray, soapify_args($reftoelement));
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return [@valuesarray];
&nbsp;&nbsp;&nbsp;&nbsp;}

&nbsp;&nbsp;&nbsp;&nbsp;return $soapobject;
}

sub get_soap_session {
&nbsp;&nbsp;&nbsp;&nbsp;use HTTP::Cookies;
&nbsp;&nbsp;&nbsp;&nbsp;use SOAP::Lite;
&nbsp;&nbsp;&nbsp;&nbsp;on_fault =&gt; sub { my($soap, $res) = @_;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die ref $res ? $res-&gt;faultstring : $soap-&gt;transport-&gt;status, &quot;n&quot;;
&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;#optional, uncomment this to debug xml going back and forth
&nbsp;&nbsp;&nbsp;&nbsp;##&nbsp;&nbsp;&nbsp;&nbsp;SOAP::Lite-&gt;import(trace =&gt;debug);

&nbsp;&nbsp;&nbsp;&nbsp;my $user = shift;
&nbsp;&nbsp;&nbsp;&nbsp;my $pass = shift;
&nbsp;&nbsp;&nbsp;&nbsp;my $soap_url = shift;

&nbsp;&nbsp;&nbsp;&nbsp;# need to turn cookies on, might get &quot;Access Denied&quot; errors otherwise
&nbsp;&nbsp;&nbsp;&nbsp;my $soap = SOAP::Lite-&gt;new();
&nbsp;&nbsp;&nbsp;&nbsp;$soap-&gt;proxy($soap_url, cookie_jar =&gt; HTTP::Cookies-&gt;new(ignore_discard =&gt; 1));

&nbsp;&nbsp;&nbsp;&nbsp;# had to add this namespace to enable passing nested arrays as valid data
&nbsp;&nbsp;&nbsp;&nbsp;my $serializer = $soap-&gt;serializer();
&nbsp;&nbsp;&nbsp;&nbsp;$serializer-&gt;register_ns( &#039;http://xml.apache.org/xml-soap&#039;, &#039;apache&#039; );

&nbsp;&nbsp;&nbsp;&nbsp;my $session_id = $soap-&gt;login($user,$pass)-&gt;result;
&nbsp;&nbsp;&nbsp;&nbsp;return ($soap,$session_id);
}

sub fulfill_order {
&nbsp;&nbsp;&nbsp;&nbsp;my $ord = shift;

&nbsp;&nbsp;&nbsp;&nbsp;# whatever you need to do, do it here... we pass the order to our SAP system
&nbsp;&nbsp;&nbsp;&nbsp;# via a custom web service.&nbsp;&nbsp;Maybe you transmit somewhere via EDI?

&nbsp;&nbsp;&nbsp;&nbsp;# placeholder -- dump raw order data
&nbsp;&nbsp;&nbsp;&nbsp;use Data::Dumper;
&nbsp;&nbsp;&nbsp;&nbsp;print Dumper($ord);

&nbsp;&nbsp;&nbsp;&nbsp;return;
}

sub sixty_days_back {
&nbsp;&nbsp;&nbsp;&nbsp;my $sixty_days_in_secs = 60 * 24 * 60 * 60;
&nbsp;&nbsp;&nbsp;&nbsp;my ($sec,$min,$hr,$mday,$mon0,$yr1900) = localtime(time - $sixty_days_in_secs);
&nbsp;&nbsp;&nbsp;&nbsp;my $year = $yr1900 + 1900;
&nbsp;&nbsp;&nbsp;&nbsp;my $mon = $mon0 + 1;
&nbsp;&nbsp;&nbsp;&nbsp;# eg 2010-08-01 for august 1 2010
&nbsp;&nbsp;&nbsp;&nbsp;return sprintf(&quot;%04d-%02d-%02d&quot;,$year,$mon,$mday);
}

</code></pre></p>
<p>
<style>
#disappears { display:none; } 
</style>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2010/08/use-magento-soap-api-from-perl-with-soaplite/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Customizing Magento</title>
		<link>http://www.dagblastit.com/blog/2010/07/customizing-magento/</link>
		<comments>http://www.dagblastit.com/blog/2010/07/customizing-magento/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 22:07:35 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Magento]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=143</guid>
		<description><![CDATA[Quick start - here are some pages that helped me get going quickly:

Defining your own attributes is easy.  Getting them to display in a template is not.  Cheat sheet:
http://www.sharpdotinc.com/mdost/2009/04/06/magento-getting-product-attributes-values-and-labels/
Don&#8217;t hack the Magento tree directly!  You&#8217;ll be sad when you upgrade and your customizations are gone. Do this instead:
http://www.exploremagento.com/magento/override-a-magento-core-block-class.php
Grab all the simple child products for a [...]]]></description>
			<content:encoded><![CDATA[<p>Quick start - here are some pages that helped me get going quickly:</p>
<hr />
<p>Defining your own attributes is easy.  Getting them to display in a template is not.  Cheat sheet:</p>
<p><a href="http://www.sharpdotinc.com/mdost/2009/04/06/magento-getting-product-attributes-values-and-labels/">http://www.sharpdotinc.com/mdost/2009/04/06/magento-getting-product-attributes-values-and-labels/</a></p>
<hr />Don&#8217;t hack the Magento tree directly!  You&#8217;ll be sad when you upgrade and your customizations are gone. Do this instead:</p>
<p><a href="http://www.exploremagento.com/magento/override-a-magento-core-block-class.php">http://www.exploremagento.com/magento/override-a-magento-core-block-class.php</a></p>
<hr />Grab all the simple child products for a configurable product (and then display one of their other custom attributes):</p>
<p><a href="http://snippi.net/taxonomy/term/10">http://snippi.net/taxonomy/term/10</a></p>
<hr />Updating stock through the SOAP API is unbelievably slow.  The API doesn&#8217;t appear to accept more than one SKU per call!  Use a script like this instead:</p>
<p><a href="http://www.sonassi.com/knowledge-base/magento-knowledge-base/mass-update-stock-levels-in-magento-fast/">http://www.sonassi.com/knowledge-base/magento-knowledge-base/mass-update-stock-levels-in-magento-fast/</a></p>
<hr />Some hints on how to get Magento to generate plain-text email:</p>
<p><a href="http://www.magentocommerce.com/boards/viewthread/43928/">http://www.magentocommerce.com/boards/viewthread/43928/</a></p>
<hr />
Kicking off an index process from the command line (using a custom script):</p>
<p><a href="http://www.sonassi.com/knowledge-base/magento-knowledge-base/catalog-search-index-refresh-running-slow-or-haltingfreezing/">http://www.sonassi.com/knowledge-base/magento-knowledge-base/catalog-search-index-refresh-running-slow-or-haltingfreezing/</a></p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2010/07/customizing-magento/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Finding Y-Wing (aka XY-Wing)</title>
		<link>http://www.dagblastit.com/blog/2010/04/finding-y-wing-aka-xy-wing/</link>
		<comments>http://www.dagblastit.com/blog/2010/04/finding-y-wing-aka-xy-wing/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 00:24:50 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Sudoku]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=122</guid>
		<description><![CDATA[Y-Wing can be a very handy shortcut in a tough sudoku puzzle and it may even be the only way forward in some harder ones. It&#8217;s named after an ugly rebel fighter craft from the Star Wars movies.  True to its namesake, it is not as elegant or as powerful as its X-Wing brother, but [...]]]></description>
			<content:encoded><![CDATA[<p><div class="wp-caption alignright" style="width: 352px"><a href="http://www.fishysudoku.com/?date=20101005"><img class=" " title="Y-Wing Fighter" src="http://www.vegatransports.com.au/starwars/otc_y_wing_fighter.jpg" alt="Y-Wing Fighter: the force is strong with this one." width="342" height="312" /></a><p class="wp-caption-text">Y-Wing Fighter: the force is strong with this one.</p></div></p>
<p>Y-Wing can be a very handy shortcut in a tough sudoku puzzle and it may even be the only way forward in some harder ones. It&#8217;s named after an ugly rebel fighter craft from the Star Wars movies.  True to its namesake, it is not as elegant or as powerful as its X-Wing brother, but it can still do some damage.</p>
<p>Y-Wing can be hard to spot, so today I&#8217;ll describe a method for quickly teasing out the best ones.  It boils down to this &#8212; the best Y-Wing sets are the ones where two of the three squares in the set are <em>in the same 3&#215;3 box!</em></p>
<p>Really, don&#8217;t bother looking for a set that&#8217;s super spread-out.  It&#8217;s very rare that you&#8217;ll find one and even if you do, it&#8217;s the weakest kind: you&#8217;ll only be able to remove one candidate from one square, and that&#8217;s if you&#8217;re lucky.</p>
<p><strong>Y-What?</strong></p>
<p>First, let&#8217;s make sure we all know what we&#8217;re looking for. The basic idea is, you find three squares that each have two remaining candidates. The &#8220;pivot&#8221; square can see both of the end squares.  All three squares share candidates from a pool of just three total numbers, ABC. So one end of the &#8220;V&#8221; is AB, the pivot has BC, and the other end is AC.</p>
<p>Important detail - no two squares in the set have the same pair of candidates.  So, if you whittle down three squares to 78, 48 and 47, you&#8217;re well on your way to a Y-Wing.  If you&#8217;re looking at 47, 48 and 47, no deal.</p>
<p><div id="attachment_225" class="wp-caption aligncenter" style="width: 410px"><a href="http://www.fishysudoku.com/?date=20101005"><img class="size-full wp-image-225" title="y-wing-animation" src="http://www.dagblastit.com/blog/wp-content/uploads/2010/04/y-wing-animation.gif" alt="How to spot Y-Wing / XY-Wing" width="400" height="401" /></a><p class="wp-caption-text">How to spot Y-Wing / XY-Wing</p></div></p>
<p>Any square that can see both ends of the Y-Wing may eliminate candidate A from its own candidate pool. It&#8217;s an easy proof, just look at the pivot &#8212; when the puzzle is done, the pivot will either be B or C.</p>
<p>If the pivot is B, then the first end is not B, and must be A. In the other &#8220;reality,&#8221; if pivot is C, then the other end is not C, and must be A. Since the pivot must be either B or C, at least one of those end squares will have A.  Here&#8217;s the neat part: squares that can &#8220;see&#8221; both end squares can never be A; not in the first case, and not in the second case (and there are only two cases total).</p>
<p><strong>The Claw</strong></p>
<p>Some people like to think of Y-Wing as a claw.  A simple way to visualize it is, the claw&#8217;s pincers (end squares) &#8220;pinch&#8221; candidate A out of any square they can both see.  The pivot is the &#8220;hinge&#8221; of the claw.</p>
<p>There are two kinds of Y-Wing. One can be very helpful, and one is usually not. If the three squares in your Y-Wing are all in different boxes, you&#8217;ve found the less useful Y-Wing variant (your claw is wide open, pincers at 90 degrees).  Only one square can see both pincers - so even if we are lucky, we can only eliminate/pinch one candidate from one square.</p>
<p>The kind I like is when one claw pincer and the pivot share a box. Then you&#8217;ll always have more than one &#8220;pinchable&#8221; square (up to five, in fact). Fortunately, finding this second type is easier anyway.</p>
<p><strong>The Method</strong></p>
<p>Look at each group of 9 squares (the nine large 3&#215;3 boxes).  In each big box, look for two squares in that box with only two candidates left each. They must share exactly one candidate.  It&#8217;s okay if they are in the same row/column but you&#8217;ll cast a wider net for the other claw if they aren&#8217;t. Found a pair like this? Good. Now look at the two candidates they <em>don&#8217;t</em> have in common. Let&#8217;s call them AB.  We are looking for a third square, from a different box, that has only AB left in its candidate pool. It must be able to &#8220;see&#8221; one of our original squares (yep, either one).  The square that it sees from our original box becomes the pivot.</p>
<p>So, we really just scan four potential zones outside our box:</p>
<p style="padding-left: 30px;">• the squares in the same row as square 1</p>
<p>• the squares in the same row as square 2</p>
<p>• the squares in the same column as square 1, and finally,</p>
<p>• the squares in the same column as square 2</p>
<p>Didn&#8217;t pan out?  Move along, find another potential pivot/claw pair, maybe in this box or probably the next.  You&#8217;d be surprised how often you can track down a set of three once you focus your search like this.  See if you can find the Y-Wing below.  hint: start in box 7.</p>
<p><div id="attachment_125" class="wp-caption aligncenter" style="width: 385px"><img class="size-full wp-image-125 " title="XY-Wing Example" src="http://www.dagblastit.com/blog/wp-content/uploads/2010/04/screen-shot-2010-04-08-at-43706-pm.png" alt="Y-Wing Example" width="375" height="373" /><p class="wp-caption-text">Y-Wing Example</p></div></p>
<p><span id="more-122"></span>Solution: Ignore the middle square and the lower right square, too many candidates. 39 and 35 share a candidate (3) but they are in the same row which reduces potential for success - we&#8217;ll come back to this pair only if other options don&#8217;t pan out.  45 and 35 share a candidate and they are located diagonally apart from each other so they are not in the same row or the same column.  Good.  The non-shared candidates are 3 and 4, so check around for a square with 34&#8230; R3C1!  Voila, here is our Y-Wing.  45 is the pivot, the other two are the claws.</p>
<p>Now think it through. When the pivot is 4, the left pincer can&#8217;t be 4 and must be 3.  Otherwise, the pivot is 5, and the right pincer can&#8217;t be 5 and must be 3.  So, either the left pincer is 3 or the right pincer is 3.  Either way, <em>any square that sees them both will never be 3!</em></p>
<p>So, R2C3 and R3C3 get their 3&#8217;s pinched out by the claws, leaving a naked pair that solves R3C1 (3) and sets a whole chain of good things in motion.  Good times.</p>
<p>Followup quiz: What are the five &#8220;pinchable&#8221; squares in this Y-Wing?</p>
<p>Answer: R1C3 R2C3 R3C3 from box 1 and R7C1 R8C1 from box 7 can all &#8220;see&#8221; both claw pincers in this Y-Wing.</p>
<p><div id="attachment_134" class="wp-caption aligncenter" style="width: 425px"><img class="size-full wp-image-134" title="Visualize the Claw" src="http://www.dagblastit.com/blog/wp-content/uploads/2010/04/y-wing-explain.png" alt="Visualize the Claw" width="415" height="373" /><p class="wp-caption-text">Visualize the Claw</p></div></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2010/04/finding-y-wing-aka-xy-wing/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fishy Sudoku</title>
		<link>http://www.dagblastit.com/blog/2010/03/fishy-sudoku/</link>
		<comments>http://www.dagblastit.com/blog/2010/03/fishy-sudoku/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 17:05:23 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Sudoku]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=104</guid>
		<description><![CDATA[Well, it&#8217;s about time I came clean.  I am a Sudoku addict.  I do two fairly difficult puzzles a day, at a site that offers free daily puzzles.  I&#8217;m getting a little tired of the puzzles on that site because they tend to block forward progress until you find one or two X-Wing sets and [...]]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_107" class="wp-caption alignleft" style="width: 160px"><a href="http://www.fishysudoku.com/"><img class="size-thumbnail wp-image-107 " title="fishy_sudoku_logo_big" src="http://www.dagblastit.com/blog/wp-content/uploads/2010/03/fishy_sudoku_logo_big-150x150.png" alt="Fishy Sudoku" width="150" height="150" border="0" /></a><p class="wp-caption-text">Fishy Sudoku: Challenging puzzles. Great Interface.</p></div></p>
<p>Well, it&#8217;s about time I came clean.  I am a Sudoku addict.  I do two fairly difficult puzzles a day, at a site that offers free daily puzzles.  I&#8217;m getting a little tired of the puzzles on that site because they tend to block forward progress until you find one or two <a href="http://www.sudokuwiki.org/X_Wing_Strategy">X-Wing</a> sets and then you&#8217;re done.  A bit predictable after a while, and once you get good at spotting X-Wing it gets kinda boring.</p>
<p>So about a year ago I started making my own puzzles.  I wrote a java program that generates random puzzles, and another java program that solves the puzzles by applying various techniques in a loop, in order of difficulty.  The second program rates the puzzles made by the first program.  I wrote a third program that lets the first two programs fight it out until they come up with a tough puzzle.</p>
<p>Hard puzzles should have one or two X-Wing sets.  Really hard puzzles, in my opinion, need an <a href="http://www.sudokuwiki.org/Y_Wing_Strategy">XY-Wing</a> or a <a href="http://www.sudokuwiki.org/Sword_Fish_Strategy">swordfish</a> or even a <a href="http://www.sudokuwiki.org/Jelly_Fish_Strategy">jellyfish</a>.  Thus the name of my new daily puzzle website, <a href="http://www.fishysudoku.com/">www.fishysudoku.com</a>.</p>
<p>I put together a nice little <a href="http://www.fishysudoku.com/">sudoku puzzle interface in Flash</a>.  It addresses all the things I found really annoying about other online sudoku sites.  First of all, the pencilmarks come up automatically.  My wife insists that Sudoku is a big waste of time, and she&#8217;s right, to an extent.  The interesting parts of solving a sudoku puzzle tend to just punctuate long stretches of tedium.  God forbid you make a mistake during the pencil-mark tedium.  Anyone who has tried Sudoku has made a mistake at some point that went undiscovered for the better part of an hour.  This is not a rewarding feeling.</p>
<p>So in my interface, autohelp is on by default.  Glaring mistakes are immediately circled until they are fixed.  Obvious pencilmarks are done for you.  But most interfaces that do this prevent additional edits to the pre-determined marks.  So in my interface, you can grey out any pencilmarks that you know to be impossible.</p>
<p>I have plenty of features still to add &#8212; puzzle archive, access to the solver for hints &#038; more &#8212; but I figured it was time to do an alpha launch.</p>
<p>To reach a broader audience, I also boxed it up as a <a href="http://apps.facebook.com/fishysudoku">facebook app</a>.  Add it to your facebook apps!  I need at least five people to add it before I can get listed in the app directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2010/03/fishy-sudoku/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Google Sketchup v. Punch Bathroom</title>
		<link>http://www.dagblastit.com/blog/2010/03/google-sketchup-v-punch-bathroom-design/</link>
		<comments>http://www.dagblastit.com/blog/2010/03/google-sketchup-v-punch-bathroom-design/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 22:23:35 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Remodeling]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=99</guid>
		<description><![CDATA[Winner, Google Sketchup.  Punch Bathroom Design really sucks.
Spent $10 on Punch, Sketchup is free.  Sketchup rocks.  With no training and very little ramp-up on the interface, I had a working model of our master bath remodel and was able to mock up the custom shower stall that we want to build, found 3D models of [...]]]></description>
			<content:encoded><![CDATA[<p>Winner, Google Sketchup.  Punch Bathroom Design really sucks.</p>
<p>Spent $10 on Punch, Sketchup is free.  Sketchup rocks.  With no training and very little ramp-up on the interface, I had a working model of our master bath remodel and was able to mock up the custom shower stall that we want to build, found 3D models of toilets, sinks, vanities, clawfoot tubs, fixtures, you name it.</p>
<p>Caveats: Sketchup has no 2D view (although you can swing around to a bird&#8217;s-eye view and look through the ceiling without too much trouble once you get the hang of it).  Sketchup does require some patience when your toilet is 300 feet away from where you want it and you can&#8217;t quite get Sketchup to intuit what you are doing.  That said, nine times out of ten it is unbelievably good at intuiting what you want to do.  A lesser program would misinterpret most mouse movements, but there is some intelligent engine at work in Sketchup that seems to be aware of what you are seeing and almost always does what you mean.</p>
<p>Punch was infuriatingly dumb.  You had to tie everything you put into the space to a wall, and if something overlapped temporarily while you were adding something else or resizing a wall, the items on that wall just get deleted.  You couldn&#8217;t just grab things and move them with the mouse, and the 3D walkthrough was impossible to navigate.  Simple things like looking right or up or backing out, making walls temporarily see-through, etc. are SO easy in Sketchup and simply not possible in Punch.</p>
<p>A few tips to get you started in Sketchup &#8212; you definitely want to use a three button mouse with a mouse wheel.  Rolling the wheel zooms in and out, and holding down the wheel button while you move the mouse rotates/swings your 3D model around (this is a very powerful and satisfying feeling) no matter what tool is currently active.  Press H to get the &#8220;hand&#8221; cursor (grab and slide the model in any direction), Press space to select things, hold down shift to select multiple things.  Press M to grab things and move them.  Selecting and moving a face of a box will adjust the rest of the box as necessary to remain intact.</p>
<p>Hide walls, ceilings, whatever, by right clicking it and selecting &#8216;hide&#8217; on the popup menu.  Sketch away!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2010/03/google-sketchup-v-punch-bathroom-design/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Careful kid, they&#8217;ll break ya heaht&#8230;</title>
		<link>http://www.dagblastit.com/blog/2009/05/careful-kid-theyll-break-ya-heaht/</link>
		<comments>http://www.dagblastit.com/blog/2009/05/careful-kid-theyll-break-ya-heaht/#comments</comments>
		<pubDate>Fri, 15 May 2009 16:02:45 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Boston Sports Teams]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[boston]]></category>

		<category><![CDATA[celtics]]></category>

		<category><![CDATA[p2p]]></category>

		<category><![CDATA[sopcast]]></category>

		<category><![CDATA[sports]]></category>

		<category><![CDATA[tvants]]></category>

		<category><![CDATA[veetle]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=87</guid>
		<description><![CDATA[I have cancelled my cable TV.  Man did it feel good to tell Comcast to go **** it. Net gain $840/yr.   Well, minus whatever it will cost to buy episodes of Top Chef for my wife (ok I admit it, she&#8217;s got me hooked too).
Rabid sports fan that I am, I did [...]]]></description>
			<content:encoded><![CDATA[<p>I have cancelled my cable TV.  Man did it feel good to tell Comcast to go **** it. Net gain $840/yr.   Well, minus whatever it will cost to buy episodes of Top Chef for my wife (ok I admit it, she&#8217;s got me hooked too).</p>
<p><img class="size-thumbnail wp-image-89" style="margin-right: 10px; margin-bottom: 5px;" title="tim_thomas" src="http://www.dagblastit.com/blog/wp-content/uploads/2009/05/tim_thomas-150x150.jpg" alt="tim_thomas" width="150" height="150" align="left" />Rabid sports fan that I am, I did not take the plunge until I discovered www.myp2p.eu and the wonders of p2p live streaming sports.  So far this has turned out to be a mixed bag.  When it&#8217;s good, it&#8217;s mid-to-low-res but you can follow the action.  Veetle is pretty cool. When it&#8217;s bad it really stinks.  The players and plays are fuzzy.  The score is rarely legible.  The keyframes drop out and for several seconds at a time blotchy pieces of the previous shot carry over for that &#8220;they&#8217;re playing in a vat of pea soup&#8221; effect.  The best is when the feed stops for buffering just when Ray Allen has released the shot that will send the game into triple overtime.</p>
<p>But hey, the Bruins are in the playoffs (well, until they choked in OT last night), the Celtics are in the playoffs, and I have found that I will endure quite a lot of low quality picture to be connected to the hunt for a championship.</p>
<p>Some nights the only available feed is from Taiwan, with audio in Taiwanese Chinese (although I have to say, I don&#8217;t speak a word and the Taiwan commercials are still hilarious).</p>
<p>I find it ironic that in this age of higher and higher def, my own TV viewing quality experience is moving in the opposite direction.  It&#8217;s consoling to think that a generation earlier I might be slapping the side of the TV fonzie-style before a big play to try to reduce the static from a bad over-the-air signal.  Now I move around the room and adjust the angle of my laptop in the hopes that our wifi is the bottleneck.</p>
<p>However fuzzy the broadcast, last night proved to me that they can still break your heart, and that stings in hi-def.  Bruins out of the hunt.  Magic force game 7 on the Celts.  Sox fall in the 12th.  To cap it all off, the Yanks win.  I guess we had it coming?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2009/05/careful-kid-theyll-break-ya-heaht/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Baby Happy, Baby Sad</title>
		<link>http://www.dagblastit.com/blog/2009/05/baby-happy-baby-sad/</link>
		<comments>http://www.dagblastit.com/blog/2009/05/baby-happy-baby-sad/#comments</comments>
		<pubDate>Wed, 06 May 2009 05:35:37 +0000</pubDate>
		<dc:creator>Tommy Sasso</dc:creator>
		
		<category><![CDATA[Children's Books]]></category>

		<category><![CDATA[awards]]></category>

		<category><![CDATA[book review]]></category>

		<category><![CDATA[books]]></category>

		<category><![CDATA[byron barton]]></category>

		<category><![CDATA[leslie patricelli]]></category>

		<category><![CDATA[mo willems]]></category>

		<category><![CDATA[toddlers]]></category>

		<guid isPermaLink="false">http://www.dagblastit.com/blog/?p=76</guid>
		<description><![CDATA[You can only stomach so much  - unless you&#8217;re two, then it never gets old -  but I&#8217;m well into my 30s so I&#8217;m always pretty stoked to find a good new children&#8217;s book to bring into the mix.
A new crop of talent is staking its ground in the children&#8217;s book landscape so [...]]]></description>
			<content:encoded><![CDATA[<p>You can only stomach so much <em></em> - unless you&#8217;re two, then it never gets old -  but I&#8217;m well into my 30s so I&#8217;m always pretty stoked to find a good new children&#8217;s book to bring into the mix.</p>
<p>A new crop of talent is staking its ground in the children&#8217;s book landscape so long dominated by the likes of Dr. Seuss and Eric Carle.  It&#8217;s a good time to be a new dad.</p>
<p>Mo Willems is hit or miss, but when he&#8217;s on it&#8217;s pure gold.  <em></em>, for instance, is a clear winner.  Other pigeon books in the series don&#8217;t always measure up.  <em></em> is one of a new Willems series featuring the new Piggie and Elephant duo (occasionally joined by a wise squirrel). This looks to be heavily in the rotation for some months to come.</p>
<p>The award, however, goes to Leslie Patricelli.  Nothing tops <em></em> or <em></em> except maybe her tour de force <em></em>.  These board books are just the right length for the short toddler attention span, and just the right size for little hands and budding imaginations.  It&#8217;s only natural for our kids to imagine themselves as the baby protagonist in these juicy canvases with ultra saturated colors and friendly, thick black lines.</p>
<p>Honorable mention to Byron Barton.  I don&#8217;t know if girls would be quite so excited about the <em></em> / <em></em> / <em></em> trilogy, but our two boys have a whole new appreciation for transportation thanks to Mr. Barton.</p>
<p><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" id="Player_107c622d-ae9f-4034-a9b2-3468f5ebc95c"  WIDTH="400px" HEIGHT="150px"> <PARAM NAME="movie" VALUE="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&#038;MarketPlace=US&#038;ID=V20070822%2FUS%2Fcoolquotes%2F8010%2F107c622d-ae9f-4034-a9b2-3468f5ebc95c&#038;Operation=GetDisplayTemplate"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#FFFFFF"><PARAM NAME="allowscriptaccess" VALUE="always"><embed src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&#038;MarketPlace=US&#038;ID=V20070822%2FUS%2Fcoolquotes%2F8010%2F107c622d-ae9f-4034-a9b2-3468f5ebc95c&#038;Operation=GetDisplayTemplate" id="Player_107c622d-ae9f-4034-a9b2-3468f5ebc95c" quality="high" bgcolor="#ffffff" name="Player_107c622d-ae9f-4034-a9b2-3468f5ebc95c" allowscriptaccess="always"  type="application/x-shockwave-flash" align="middle" height="150px" width="400px"></embed></OBJECT><NOSCRIPT><A HREF="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&#038;MarketPlace=US&#038;ID=V20070822%2FUS%2Fcoolquotes%2F8010%2F107c622d-ae9f-4034-a9b2-3468f5ebc95c&#038;Operation=NoScript">Amazon.com Widgets</A></NOSCRIPT></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dagblastit.com/blog/2009/05/baby-happy-baby-sad/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

