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

<channel><title><![CDATA[Paul Canavese - Home]]></title><link><![CDATA[https://www.canavese.org/home]]></link><description><![CDATA[Home]]></description><pubDate>Mon, 25 May 2026 18:32:32 -0700</pubDate><generator>Weebly</generator><item><title><![CDATA[Disabled Autocapitalize in Mobile Safari]]></title><link><![CDATA[https://www.canavese.org/home/disabled-autocapitalize-in-mobile-safari]]></link><comments><![CDATA[https://www.canavese.org/home/disabled-autocapitalize-in-mobile-safari#comments]]></comments><pubDate>Tue, 12 Feb 2013 03:48:27 GMT</pubDate><category><![CDATA[ios]]></category><category><![CDATA[mobile safari]]></category><guid isPermaLink="false">https://www.canavese.org/home/disabled-autocapitalize-in-mobile-safari</guid><description><![CDATA[ I spent quite a bit of time debugging this issue, so I'll toss this into the interwebs in case it can save someone else some hassle...Mobile Safari supports HTML attributes that control which keyboard (and keyboard state) should be launched when a user clicks on a text input field. &nbsp;Otherwise, it uses some smart defaults. &nbsp;I wanted one of my fields to autocapitalize, but setting the attribute at the form level and/or input level had no effect:&lt;form action="/auth/login_cc" autocapit [...] ]]></description><content:encoded><![CDATA[<span class='imgPusher' style='float:left;height:0px'></span><span style='z-index:10;position:relative;float:left;;clear:left;margin-top:0px;*margin-top:0px'><a><img src="https://www.canavese.org/uploads/1/2/7/7/12779077/250284785.png" style="margin-top: 5px; margin-bottom: 10px; margin-left: 0px; margin-right: 10px; border-width:1px;padding:3px;" alt="Picture" class="galleryImageBorder" /></a><div style="display: block; font-size: 90%; margin-top: -10px; margin-bottom: 10px; text-align: center;"></div></span> <div class="paragraph" style="text-align:left;display:block;">I spent quite a bit of time debugging this issue, so I'll toss this into the interwebs in case it can save someone else some hassle...<br /><br />Mobile Safari supports HTML attributes that control which keyboard (and keyboard state) should be launched when a user clicks on a text input field. &nbsp;Otherwise, it uses some smart defaults. &nbsp;I wanted one of my fields to autocapitalize, but setting the attribute at the form level and/or input level had no effect:<br /><br />&lt;form action="/auth/login_cc" autocapitalize="words"&gt;<br />&nbsp; &lt;input autocapitalize="words" name="foobar" /&gt;<br />&lt;/form&gt;<br /><br />It turns out that Safari has a hidden feature in which it changes the default capitalization to lowercase if the string "login" appears anywhere in the form action. &nbsp;Unfortunately, it also ignores any attributes as well, so it is impossible to override this except by changing the action name.<br /><br />As I said, that took a while to track down. &nbsp;I've submitted the bug to Apple...</div> <hr style="width:100%;clear:both;visibility:hidden;"></hr>]]></content:encoded></item><item><title><![CDATA["Zecco Zimulator" Launched]]></title><link><![CDATA[https://www.canavese.org/home/zecco-zimulator-launched]]></link><comments><![CDATA[https://www.canavese.org/home/zecco-zimulator-launched#comments]]></comments><pubDate>Fri, 12 Dec 2008 22:26:22 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">https://www.canavese.org/home/zecco-zimulator-launched</guid><description><![CDATA[ The fantasy financial trading site that I developed for PTrades has finally launched as the&nbsp;Zecco Zimulator!&nbsp;The site allows you to open as many accounts as you want for free, filled with $100,000 of play money.&nbsp; You can then trade stocks, stock options, and futures and gauge your success (before trying with real money).&nbsp; You can form and join teams and compete to rise up the high score boards.&nbsp; All this can be done on the main site or on Facebook, so your friends can r [...] ]]></description><content:encoded><![CDATA[<span class='imgPusher' style='float:left;height:0px'></span><span style='z-index:10;position:relative;float:left;;clear:left;margin-top:0px;*margin-top:0px'><a><img src="https://www.canavese.org/uploads/1/2/7/7/12779077/969635293.gif" style="margin-top: 5px; margin-bottom: 10px; margin-left: 0px; margin-right: 10px; border-width:1px;padding:3px;" alt="Picture" class="galleryImageBorder" /></a><div style="display: block; font-size: 90%; margin-top: -10px; margin-bottom: 10px; text-align: center;"></div></span> <div class="paragraph" style="text-align:left;display:block;">The fantasy financial trading site that I developed for PTrades has finally launched as the&nbsp;<a href="http://game.zecco.com/" style="">Zecco Zimulator</a>!&nbsp;<br /><span style=""></span><br /><span style=""></span>The site allows you to open as many accounts as you want for free, filled with $100,000 of play money.&nbsp; You can then trade stocks, stock options, and futures and gauge your success (before trying with real money).&nbsp; You can form and join teams and compete to rise up the high score boards.&nbsp; All this can be done on the main site or on Facebook, so your friends can read about your trading success in your news feed.<br /><span style=""></span><br /><span style=""></span>Check it out yourself&nbsp;<a href="http://game.zecco.com/" style="">here</a>.<br /><span style=""></span><br /><span style=""></span></div> <hr style="width:100%;clear:both;visibility:hidden;"></hr>]]></content:encoded></item><item><title><![CDATA[Leaderboards and Fragment Caching]]></title><link><![CDATA[https://www.canavese.org/home/leaderboards-and-fragment-caching]]></link><comments><![CDATA[https://www.canavese.org/home/leaderboards-and-fragment-caching#comments]]></comments><pubDate>Thu, 25 Sep 2008 21:29:26 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">https://www.canavese.org/home/leaderboards-and-fragment-caching</guid><description><![CDATA[ When I worked as a server engineer for a game company, I spent some significant time dealing with leaderboards (a.k.a. high score lists).&nbsp; And lo and behold, when I started consulting and was asked to build a fantasy stock/options/futures trading site, there I was coding leaderboards again.With a small number of people, of course, it's not a big deal to generate leaderboards on the fly.&nbsp; But if your site is lucky enough to become successful, you don't want your database queries to bri [...] ]]></description><content:encoded><![CDATA[<span class='imgPusher' style='float:left;height:0px'></span><span style='z-index:10;position:relative;float:left;;clear:left;margin-top:0px;*margin-top:0px'><a><img src="https://www.canavese.org/uploads/1/2/7/7/12779077/676293374.png" style="margin-top: 5px; margin-bottom: 10px; margin-left: 0px; margin-right: 10px; border-width:1px;padding:3px;" alt="Picture" class="galleryImageBorder" /></a><div style="display: block; font-size: 90%; margin-top: -10px; margin-bottom: 10px; text-align: center;"></div></span> <div class="paragraph" style="text-align:left;display:block;">When I worked as a server engineer for a game company, I spent some significant time dealing with leaderboards (a.k.a. high score lists).&nbsp; And lo and behold, when I started consulting and was asked to build a fantasy stock/options/futures trading site, there I was coding leaderboards again.<br><span style=""></span><br><span style=""></span>With a small number of people, of course, it's not a big deal to generate leaderboards on the fly.&nbsp; But if your site is lucky enough to become successful, you don't want your database queries to bring your site to its knees.&nbsp; Things also get more complicated if you want to implement "around me" leaderboards which show the current user's position with a few people above and below.<br><span style=""></span><br><span style=""></span><b>Leaderboard Tables</b><div><br></div><div>The first step is to create separate tables specifically for the leaderboards, rather than expecting to use other tables (e.g. user, team, or network tables).&nbsp; Periodically, do a query from the source table sorting by score.&nbsp; After clearing out the leaderboard table, the results can be inserted with the primary key being position in the table.&nbsp; This makes it easy to look up a particular user to find their position and then do an "around me" query.<br><span style=""></span><br><span style=""></span>Doing a delete all from the table followed by an insert (all within a transaction) will work up to a certain point.&nbsp; But when you're pushing hundreds of thousands of users that will likely be a performance issue.&nbsp; An alternate approach is to create a new temporary table, do the inserts, then&mdash;in a new transaction&mdash;delete the old table and rename the temporary table to replace it.<br><span style=""></span><br><span style=""></span><b>Fragment Caching</b></div><div><br></div><div id="anonymous_element_47">I wanted to share one other trick I was able to use in my latest project.&nbsp; I wanted to cache the HTML fragments showing the leaderboards, but also wanted the current user to see themselves highlighted in the table (meaning the view would look different to different users).&nbsp; That would seem to eliminate the possibility of global caching.<br><span style=""></span><br><span style=""></span>But the only difference across users is a CSS styling, and one that could be controlled in a dynamic way.&nbsp; So what I did was assign a CSS class to each row named to the user id.&nbsp; For example:<br><span style=""></span><br>&lt;tr class="user_2635"&gt;...<br style=""><span style=""></span><span style=""></span><br><span style=""></span>Then, in the dynamic portion of the generated page I added a style definition targeting the current user:<br><span style=""></span><br><span style=""></span>tr.user_2635 { background-color: #f4f1ac; }<br><span style=""></span><br><span style=""></span>Then the same HTML table can be cached and shared across all users.<br><span style=""></span><br><span style=""></span></div></div> <hr style="width:100%;clear:both;visibility:hidden;"></hr>]]></content:encoded></item><item><title><![CDATA["AvaPeeps: FlirtNation" Released]]></title><link><![CDATA[https://www.canavese.org/home/avapeeps-flirtnation-released]]></link><comments><![CDATA[https://www.canavese.org/home/avapeeps-flirtnation-released#comments]]></comments><pubDate>Fri, 12 Sep 2008 22:56:03 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">https://www.canavese.org/home/avapeeps-flirtnation-released</guid><description><![CDATA[ I spent a good portion of my life, while I was employed by&nbsp;Digital Chocolate, working on a game called AvaPeeps:FlirtNation.&nbsp; Initially, it was only targeted at the mobile phone market, but it has just been launched as a beta release as a&nbsp;web game.The game allows you to design an avatar character and send him/her out on dates with other people's avatars.&nbsp; You can send your avatar to different locations to hang out and meet other avatars, coach him/her in what to do on dates, [...] ]]></description><content:encoded><![CDATA[<span class='imgPusher' style='float:left;height:0px'></span><span style='z-index:10;position:relative;float:left;;clear:left;margin-top:0px;*margin-top:0px'><a><img src="https://www.canavese.org/uploads/1/2/7/7/12779077/990862145.png" style="margin-top: 5px; margin-bottom: 10px; margin-left: 0px; margin-right: 10px; border-width:1px;padding:3px;" alt="Picture" class="galleryImageBorder" /></a><div style="display: block; font-size: 90%; margin-top: -10px; margin-bottom: 10px; text-align: center;"></div></span> <div class="paragraph" style="text-align:left;display:block;">I spent a good portion of my life, while I was employed by&nbsp;<a href="http://www.digitalchocolate.com/" style="">Digital Chocolate</a>, working on a game called AvaPeeps:FlirtNation.&nbsp; Initially, it was only targeted at the mobile phone market, but it has just been launched as a beta release as a&nbsp;<a href="http://www.avapeeps.com/" style="">web game</a>.<br /><span style=""></span><br /><span style=""></span>The game allows you to design an avatar character and send him/her out on dates with other people's avatars.&nbsp; You can send your avatar to different locations to hang out and meet other avatars, coach him/her in what to do on dates, and exchange messages with other peeps.<br /><span style=""></span><br /><span style=""></span>It was a fun and challenging application to work on, and it will be interesting to see how it does with a web audience.&nbsp; As a member of the team, I spent a lot of time figuring out how to get it to scale up to support millions of users.&nbsp; Hopefully that work will be put to the test.<br /><span style=""></span><br /><span style=""></span>It's free, so&nbsp;<a href="http://www.avapeeps.com/" style="">check it out!</a><br /><span style=""></span></div> <hr style="width:100%;clear:both;visibility:hidden;"></hr>]]></content:encoded></item><item><title><![CDATA[Spam Woes]]></title><link><![CDATA[https://www.canavese.org/home/spam-woes]]></link><comments><![CDATA[https://www.canavese.org/home/spam-woes#comments]]></comments><pubDate>Tue, 26 Aug 2008 22:52:37 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">https://www.canavese.org/home/spam-woes</guid><description><![CDATA[I host my own email (and that associated with all the domains I manage), and therefore have to deal with the issue of spam. My spam filter currently catches between 500 and 600 messages a day, and misses around 50 spam messages.While it is pretty accurate, I do feel I need to personally review the spam mailbox before deleting messages, as somewhere around 1 in 5000 messages tagged as spam are legitimate.&nbsp; I've taken different approaches to this review, but currently sort all messages by sub [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">I host my own email (and that associated with all the domains I manage), and therefore have to deal with the issue of spam. My spam filter currently catches between 500 and 600 messages a day, and misses around 50 spam messages.<br /><span style=""></span><br /><span style=""></span>While it is pretty accurate, I do feel I need to personally review the spam mailbox before deleting messages, as somewhere around 1 in 5000 messages tagged as spam are legitimate.&nbsp; I've taken different approaches to this review, but currently sort all messages by subject and then can quickly page through messages with identical or similar subject lines.&nbsp; For example, currently in the hopper:<br /><span style=""></span><ul style=""><li style="">Two pages of "Angelina Jolie"</li><li style="">Four pages of "Britney Spears"</li><li style="">Twelve pages of debt ("consolidation, "loans", etc.)</li><li style="">Three pages of replica watches and handbags</li><li style="">Seven pages of "Solution for your sexual life"</li></ul><br /><br />I have been using&nbsp;<a href="http://spamassassin.apache.org/" style="" title="">SpamAssassin</a>&nbsp;for a number of years and have been quite happy with it.&nbsp; It would presumably be even more effective if I had a more current version of the filters.<br /><span style=""></span><br /><span style=""></span>But I am getting very tempted to move to a&nbsp;<a href="http://tmda.net/" style="" title="">challenge response system</a>, as annoying as they are.&nbsp; I'm just spending too much of my precious time combing through the spam box.<br /><span style=""></span></div>]]></content:encoded></item><item><title><![CDATA[Rails Generated Methods]]></title><link><![CDATA[https://www.canavese.org/home/rails-generated-methods]]></link><comments><![CDATA[https://www.canavese.org/home/rails-generated-methods#comments]]></comments><pubDate>Sat, 23 Aug 2008 22:54:25 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">https://www.canavese.org/home/rails-generated-methods</guid><description><![CDATA[One of the downsides to Rails' automatic method generation is that sometimes it bites you in the butt.I've been tearing my hair out trying to figure out why ActionView::Helpers::AssetTagHelper.image_path was behaving strangely all of a sudden.&nbsp; It didn't help that I had a boatload of local changes and there were multiple layers causing problems.&nbsp; I am using the&nbsp;Rails Engines&nbsp;plugin, which was alias_method_chaining that method, and I thought the problem was in the aliasing.&nb [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">One of the downsides to Rails' automatic method generation is that sometimes it bites you in the butt.<br /><span style=""></span><br /><span style=""></span>I've been tearing my hair out trying to figure out why ActionView::Helpers::AssetTagHelper.image_path was behaving strangely all of a sudden.&nbsp; It didn't help that I had a boatload of local changes and there were multiple layers causing problems.&nbsp; I am using the&nbsp;<a href="http://rails-engines.org/" style="">Rails Engines</a>&nbsp;plugin, which was alias_method_chaining that method, and I thought the problem was in the aliasing.&nbsp; But the other AssetTagHelper methods (stylesheet_link_tag, javascript_include_tag, and image_tag) were all correctly aliased and working fine.<br /><span style=""></span><br /><span style=""></span>It turns out that when I created a RESTful route for my new Image ActiveRecord class that it automatically created an image_path method, overriding the normal one.<br /><span style=""></span><br /><span style=""></span>I'm going to go look for some glue to see if I can get this hair to stick back on my head.<br /><span style=""></span></div>]]></content:encoded></item><item><title><![CDATA[Transparent IE PNGs in Rails]]></title><link><![CDATA[https://www.canavese.org/home/transparent-ie-pngs-in-rails]]></link><comments><![CDATA[https://www.canavese.org/home/transparent-ie-pngs-in-rails#comments]]></comments><pubDate>Thu, 14 Aug 2008 22:57:41 GMT</pubDate><category><![CDATA[Uncategorized]]></category><guid isPermaLink="false">https://www.canavese.org/home/transparent-ie-pngs-in-rails</guid><description><![CDATA[I am yet again looking into the best way to get transparent PNGs to display correctly in a Rails app.&nbsp; This is, of course, a well-known problem, but I've run into problems with the common solutions.The complexities is thatRails' approach of appending cache-busting timestamps on the end of image URLs sometimes confuses solutions looking for image references ending in ".png."I want this to work on sites that potentially use a large number of small icons.I want this to work on images that are  [...] ]]></description><content:encoded><![CDATA[<div class="paragraph" style="text-align:left;">I am yet again looking into the best way to get transparent PNGs to display correctly in a Rails app.&nbsp; This is, of course, a well-known problem, but I've run into problems with the common solutions.<br><span style=""></span><br><span style=""></span>The complexities is that<br><span style=""></span><ul style=""><li style="">Rails' approach of appending cache-busting timestamps on the end of image URLs sometimes confuses solutions looking for image references ending in ".png."</li><li style="">I want this to work on sites that potentially use a large number of small icons.</li><li style="">I want this to work on images that are not initially displayed.&nbsp; I have a sitemap that is a dynamic directory tree, with nodes that can be clicked on to display the child nodes.</li><li style="">I'd also like to use it on CSS background images.</li></ul><br><br><strong>Bobosola Solution</strong><br><br><a href="http://homepage.ntlworld.com/bobosola" style="">This solution</a>&nbsp;(with no apparent attribution) uses Javascript and the AlphaImageLoader filter.<br><span style=""></span><br><span style=""></span>It requires a fix, helpfully provided&nbsp;<a href="http://codeprostitute.com/2007/08/31/transparent-png-in-rails-app-not-working-in-ie/" style="">here</a>, to match image URLs with a regular expression, rather than just a straight suffix.<br><span style=""></span><br><span style=""></span>For some reason it only seemed to work with some of the images on my page, and I couldn't figure out what was causing the problems.&nbsp; This approach also doesn't address CSS background images.<br><span style=""></span><br><span style=""></span><strong>TwinHelix Solution</strong><br><br><a href="http://www.twinhelix.com/css/iepngfix/" style="">This solution</a>&nbsp;by Angus Turnbull utilizes custom Microsoft CSS "behaviors."&nbsp; It works out of the box with Rails image URLs, which was nice.<br><span style=""></span><br><span style=""></span>The first problem I ran into is that it is relatively slow, as it iterates through each image in the document.&nbsp; It was taking five seconds to step through each of the GIF images that made up the tree structure.&nbsp; I addressed this by targeting the behavior to only images with a particular CSS class.<br><span style=""></span><br><span style=""></span>While I was having the initial slowness problem, I noticed that images that were initially hidden (CSS "display: none;") were not showing up when their display was enabled.&nbsp; But this problem went away when I targeted by CSS class.&nbsp; Hmm.<br><span style=""></span><br><span style=""></span>This approach supports CSS background images.<br><span style=""></span><br><span style=""></span>So I'm going with this solution for now.<br><span style=""></span></div>]]></content:encoded></item></channel></rss>