<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7694153150954292329</id><updated>2026-06-22T22:32:59.718+03:00</updated><category term="programming"/><category term="jquery"/><category term="javascript"/><category term="python"/><category term="asp.net"/><category term="testoob"/><category term=".net"/><category term="git"/><category term="html"/><category term="java"/><category term="jquery validation"/><category term="version control"/><category term="web"/><category term="webforms"/><category term="android"/><category term="boo"/><category term="buttons"/><category term="c#"/><category term="community"/><category term="distributed"/><category term="form"/><category term="idcc"/><category term="idcc09"/><category term="particletree"/><category term="reddit"/><category term="silliness"/><category term="testing"/><category term="trac"/><category term="2.3.5"/><category term="8.10"/><category term="activex"/><category term="ajax"/><category term="ajaxpro"/><category term="alt-net-israel"/><category term="architecture"/><category term="asp.net mvc"/><category term="astronauts"/><category term="autoconf"/><category term="blogger"/><category term="brail"/><category term="bzr"/><category term="c++"/><category term="conference"/><category term="dialog"/><category term="digg"/><category term="dynamic"/><category term="eac"/><category term="encoding"/><category term="experts"/><category term="ff3"/><category term="firebug"/><category term="freezing"/><category term="ftp"/><category term="google toolbar"/><category term="google-code"/><category term="groovy"/><category term="guava"/><category term="hg"/><category term="hotkeys"/><category term="hydrogenaudio"/><category term="ie6"/><category term="ie7"/><category term="ie8"/><category term="iframe"/><category term="intrepid"/><category term="ipy"/><category term="ironpython"/><category term="israel"/><category term="jqmodal"/><category term="jquery ui"/><category term="keyboard"/><category term="lame"/><category term="logging"/><category term="mercurial"/><category term="milestone"/><category term="monorail"/><category term="music"/><category term="namespace"/><category term="nunit"/><category term="nvelocity"/><category term="path"/><category term="performance"/><category term="powerresizer"/><category term="punditry"/><category term="query"/><category term="qunit"/><category term="rdp"/><category term="regex"/><category term="regular expressions"/><category term="resharper"/><category term="ripping"/><category term="roadmap"/><category term="ruby"/><category term="shortcuts"/><category term="software"/><category term="sorting"/><category term="stackoverflow"/><category term="submit"/><category term="svn"/><category term="syntax"/><category term="syntaxhighlighter"/><category term="tablesorter"/><category term="teamcity"/><category term="themes"/><category term="tiddlywiki"/><category term="timespan"/><category term="tools"/><category term="typing"/><category term="ubuntu"/><category term="uri"/><category term="validation"/><category term="windows"/><category term="wufoo"/><category term="zsh"/><title type='text'>Cheap Turpentine: Ori Peleg&#39;s Blog</title><subtitle type='html'>&quot;When art critics get together they talk about Form and Structure and Meaning. When artists get together they talk about where you can buy cheap turpentine.&quot; - Pablo Picasso</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://orip.org/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://orip.org/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>57</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-5659314090389597798</id><published>2014-07-13T16:49:00.000+03:00</published><updated>2014-07-13T19:52:39.260+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="guava"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Guava&#39;s I/O Sources and Sinks on Android</title><content type='html'>&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;I love Guava&#39;s &lt;a href=&quot;https://code.google.com/p/guava-libraries/wiki/IOExplained&quot;&gt;I/O wrappers&lt;/a&gt; - ByteSource, ByteSink, CharSource, and CharSink. They encapsulate I/O stream (or reader/writer) access in a way that makes it easy for me to open &amp;amp; close the stream in the same location; when I pass a stream directly, the points of opening it and reliably closing it may be far apart. They also have helper methods to sweeten some common tasks, like reading an entire char source.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;Android provides an existing mechanism for accessing private files while controlling their access modes: &lt;a href=&quot;http://developer.android.com/reference/android/content/Context.html#openFileOutput(java.lang.String, int)&quot;&gt;Context.openFileOutput&lt;/a&gt; and &lt;a href=&quot;http://developer.android.com/reference/android/content/Context.html#openFileInput(java.lang.String)&quot;&gt;Context.openFileInput&lt;/a&gt;. As a Source/Sink primer, here&#39;s a cool way to adapt between the two:&lt;/span&gt;&lt;/div&gt;
&lt;script src=&quot;https://gist.github.com/orip/d9a61f1622e6808ec2e6.js&quot;&gt;&lt;/script&gt;

&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Helvetica Neue, Arial, Helvetica, sans-serif;&quot;&gt;The usage would look like this:&lt;/span&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: white; color: #445588; font-family: Consolas, &#39;Liberation Mono&#39;, Menlo, Courier, monospace; font-size: 12px; font-weight: bold; line-height: 16.799999237060547px; white-space: pre;&quot;&gt;&lt;code&gt;AndroidPrivateFileGuavaAdapter adapter =
  new AndroidPrivateFileGuavaAdapter(&quot;filename&quot;, Context.MODE_PRIVATE, context);

 // Read all text
String contents = adapter.asCharSource().read();

 // Write some bytes
byte[] bytes = ...; // obtains bytes from somewhere
adapter.asByteSink().write(bytes);&lt;/code&gt;&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/5659314090389597798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2014/07/guavas-io-sources-and-sinks-on-android.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/5659314090389597798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/5659314090389597798'/><link rel='alternate' type='text/html' href='http://orip.org/2014/07/guavas-io-sources-and-sinks-on-android.html' title='Guava&#39;s I/O Sources and Sinks on Android'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-2634370177821614703</id><published>2013-11-11T22:18:00.000+02:00</published><updated>2013-11-11T22:18:01.714+02:00</updated><title type='text'>Instantly migrate to a secure password hashing scheme</title><content type='html'>&lt;p&gt;So your site uses terrible password hashing scheme H1 (perhaps MD5), and you want to migrate to secure password hashing scheme H2 (preferably &lt;a href=&quot;http://en.wikipedia.org/wiki/Scrypt&quot;&gt;scrypt&lt;/a&gt;, but possibly bcrypt or PBKDF2).&lt;/p&gt;
&lt;p&gt;The standard migration approach is to upgrade users as they log in and enter their password. There are insecurities[1] and workarounds[2] doing this, but there&#39;s an alternative that instantly secures everybody using your service with no distruption:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Change your password hash to H2(H1(password)).&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Can be done immediately for everyone, because you know H1(password).&lt;/li&gt;
&lt;li&gt;Critical parameters such as salt, CPU-hardness (stretching), and possibly memory-hardness (scrypt FTW) are provided by H2.&lt;/li&gt;
&lt;li&gt;Weaknesses in H1, such as collisions, don&#39;t affect the limited use case of password hashing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I first heard of this idea from &lt;a class=&quot;g-profile&quot; href=&quot;http://plus.google.com/109520319613762443011&quot; target=&quot;_blank&quot;&gt;Avner Rosenan&lt;/a&gt;, and there&#39;s an &lt;a href=&quot;http://crypto.stackexchange.com/questions/2945/is-this-password-migration-strategy-secure&quot;&gt;interesting discussion about it on crypto.stackexchange.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
Footnotes:
&lt;div&gt;[1] e.g. old password hashes kept around&lt;/div&gt;
&lt;div&gt;[2] e.g. delete old hashes and require a password reset&lt;/div&gt;
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/2634370177821614703/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2013/11/instantly-migrate-to-secure-password.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/2634370177821614703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/2634370177821614703'/><link rel='alternate' type='text/html' href='http://orip.org/2013/11/instantly-migrate-to-secure-password.html' title='Instantly migrate to a secure password hashing scheme'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-7964367339521851724</id><published>2013-10-21T20:59:00.000+03:00</published><updated>2013-10-21T20:59:54.079+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="android"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Android: backup and restore an app&#39;s data during development</title><content type='html'>During development, having an app with a realistic configuration and data set is really useful. Here&#39;s a trick that can help.&lt;br /&gt;
&lt;br /&gt;
Connect a device with the app configured with lots of good data, turn USB debugging on, and then:&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;adb backup com.example.mypackage&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Later, on another device (or the same device after a clean install):&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;adb restore backup.ab&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
W00t.</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/7964367339521851724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2013/10/android-backup-and-restore-apps-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/7964367339521851724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/7964367339521851724'/><link rel='alternate' type='text/html' href='http://orip.org/2013/10/android-backup-and-restore-apps-data.html' title='Android: backup and restore an app&#39;s data during development'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-3564102860753659656</id><published>2013-10-07T21:09:00.001+03:00</published><updated>2013-10-07T22:21:41.690+03:00</updated><title type='text'>Versioning Android apps with git tags, using the new Gradle-based build system</title><content type='html'>&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;At &lt;a href=&quot;http://www.onavo.com/&quot;&gt;Onavo&lt;/a&gt;&amp;nbsp;we version our Android and iOS apps with git tags (&lt;a href=&quot;http://www.cimgf.com/2011/02/20/revisiting-git-tags-and-building/&quot;&gt;inspired by&amp;nbsp;Fraser Hess&lt;/a&gt;). No more mucking about with manifests and plists in short-lived branches.&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-size: 13px;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;Our release git tags look like &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;abc1.2.3-foo_15_bar&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;, which translates to a version name of &lt;b&gt;1.2.3-foo&lt;/b&gt; and a version code of &lt;b&gt;15&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;The &#39;abc&#39; prefix differentiates between different apps on the same repo, and is ignored.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;The &#39;bar&#39; suffix differentiates between identical version names and version codes, and is also ignored. We sometimes need this when a a bad tag was made and pushed and we have to retag with the proper revision, since replacing a pushed tag in git isn&#39;t wise.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;Our apk filenames look like &lt;b&gt;appname-flavor-release-1.2.3-rc2-68fb97b.apk&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;Android&#39;s Gradle-based build system makes this super sweet. Here&#39;s how we do it:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/orip/6872109.js&quot;&gt;&lt;/script&gt;
&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;To see something different,&amp;nbsp;&lt;a class=&quot;g-profile&quot; href=&quot;http://plus.google.com/108284392618554783657&quot; target=&quot;_blank&quot;&gt;+Jake Wharton&lt;/a&gt;&amp;nbsp;describes an &lt;a href=&quot;https://plus.google.com/108284392618554783657/posts/6f5TcVPRZij&quot;&gt;awesome approach to versioning &amp;amp; git hacks with Gradle&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;Soon I&#39;ll hopefully write about how we use Gradle with different flavors, and some some apk signing hacks.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;EDIT: I forgot to explain the mysterious &lt;b&gt;tagToBuildFrom&lt;/b&gt; - it&#39;s for the cases when we release a version of 2 different apps from the same git revision. There are 2 git tags, and &quot;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;git describe --exact HEAD&quot; will arbitrarily choose one. We can force gradle to use a specific tag by running:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial; font-size: 13px;&quot;&gt;&lt;pre&gt;./gradlew --daemon assembleRelease -PtagToBuildFrom=myapp4.5.6_31&lt;/pre&gt;&lt;/span&gt;
</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/3564102860753659656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2013/10/versioning-android-apps-with-git-tags.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3564102860753659656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3564102860753659656'/><link rel='alternate' type='text/html' href='http://orip.org/2013/10/versioning-android-apps-with-git-tags.html' title='Versioning Android apps with git tags, using the new Gradle-based build system'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-4760382937617932826</id><published>2012-07-22T22:43:00.000+03:00</published><updated>2012-07-22T22:43:39.451+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python: change and restore the working directory</title><content type='html'>&lt;p&gt;
Occasionally a command should be run from a specific directory. Here&#39;s a Python helper for this:
&lt;ul&gt;
  &lt;li&gt;&lt;code&gt;try/finally&lt;/code&gt; ensures the original working directory is restored.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://docs.python.org/library/contextlib.html#contextlib.contextmanager&quot;&gt;contextlib.contextmanager&lt;/a&gt; is a neat way to write things supporting the &quot;with&quot; statement (&quot;Context Managers&quot;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;script src=&quot;https://gist.github.com/3160773.js?file=temp_chdir.py&quot;&gt;&lt;/script&gt;
&lt;noscript&gt;
&lt;code&gt;import os, contextlib

@contextlib.contextmanager
def temp_chdir(path):
    &quot;&quot;&quot;
    Usage:
    &gt;&gt;&gt; with temp_chdir(gitrepo_path):
    ...   subprocess.call(&#39;git status&#39;)
    &quot;&quot;&quot;
    starting_directory = os.getcwd()
    try:
        os.chdir(path)
        yield
    finally:
        os.chdir(starting_directory)&lt;/code&gt;
&lt;/noscript&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/4760382937617932826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2012/07/python-change-and-restore-working.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/4760382937617932826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/4760382937617932826'/><link rel='alternate' type='text/html' href='http://orip.org/2012/07/python-change-and-restore-working.html' title='Python: change and restore the working directory'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-6546244547301621196</id><published>2010-09-01T01:51:00.000+03:00</published><updated>2010-09-01T01:54:48.888+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="hg"/><category scheme="http://www.blogger.com/atom/ns#" term="mercurial"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="version control"/><title type='text'>Hg vs. Git in the workplace</title><content type='html'>&lt;p&gt;This post is based on the &lt;a href=&quot;http://groups.google.com/group/altnetisrael/browse_thread/thread/231c10c8321ff02&quot;&gt;following mail&lt;/a&gt; I sent to the ALT.NET Israel list. I&#39;m discussing a Windows development environment.&lt;/p&gt;

&lt;p&gt;
I&#39;m much better at git than hg, and I use git a lot for real work, and it&#39;s great (no ifs or buts).&lt;br/&gt;
I also helped originate the move to git at work, because the transition plan was much better. I evaluated hg first and loved it, but the transition plan wouldn&#39;t have been half has smooth (a better hg-svn bridge may have been written since then).
&lt;/p&gt;

&lt;p&gt;
Still, here are - in order - the reasons I thing hg would fit better at my workplace (and had we found a good transition plan we&#39;d probably be using hg instead of git):
&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
  Friendlier commands and interface. With git I feel like I need to research how to do straightforward things. Git is extremely powerful and I can do anything with it, and I&#39;m strange so I like the arcane, but git requires more of an investment from people to use it effectively when they have other things to do. Some things are arguably easier to understand in git (rebasing, for example, vs. hg&#39;s patch queues - although that&#39;s debatable) but the whole package leans heavily to hg IMO. This is the least-loved aspect of git among the teams.
  &lt;/li&gt;

  &lt;li&gt;
  In hg, commits remember the named branch they were committed to (see here). I would LOVE to have this in git, but no cigar - we&#39;re still playing with different schemes of approximating this.&lt;br/&gt;
With many people working at times on several branches, and with merging done between branches, then given commit XYZ it&#39;s nontrivial in git to figure out which branch it belongs to.&lt;br/&gt;
This is especially true in some scenarios we encountered - e.g. human error caused an older release branch to be fast-forwarded to the head of the latest devel branch - few traces are left in the repository itself of the previous state, and we had fun a few times fixing this (can take hours). Now we have a hook to prevent this.&lt;br/&gt;
If we&#39;d have cherry-picked between different branches instead of merged then this would be easy (and this is equivalent to svn&#39;s merging, only better), but we like git&#39;s merge and we want to use that.
  &lt;/li&gt;

  &lt;li&gt;
  hg has less quirky Windows support. Points to consider:
    &lt;ul&gt;
      &lt;li&gt;
      msysgit gets sporadic releases and is usually months behind the stable git version, the latest hg versions just work.
        &lt;ul&gt;
          &lt;li&gt;This hit us a few times (bug has been fixed but not available in msysgit).&lt;/li&gt;
          &lt;li&gt;Current example: Git 1.7.2 has improved crlf handling but msysgit isn&#39;t there.&lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;
      Being able to &quot;hg serve&quot; your repository is incredibly cool, but &quot;git daemon&quot; doesn&#39;t work with msysgit
        &lt;ul&gt;
          &lt;li&gt;
          Think continuous integration that watches your local repository and runs builds with your current code, giving up-to-date feedback
          &lt;/li&gt;
          &lt;li&gt;
          collaborating with someone without pushing a publicly-visible branch (I&#39;ve actually wanted to do that a few times)
          &lt;/li&gt;
          &lt;li&gt;
          developing and testing on more than 1 machine simultaneously. There are workarounds, but &quot;git daemon&quot; would have been perfect.
          &lt;/li&gt;
        &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;
        automating hg, including hooks, run in a Windows environment (vs. git where it runs in mingw&#39;s MSYS environment)
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

What doesn&#39;t bother me much for the long run is tooling. Right now hg seems to have better tools for our scenarios (even including much better Trac support), but I think git&#39;s extreme popularity will cause better and better tools to be written. Some people were very sad to let go of their VisualSvn / Ankh plugins, but they manage with Git Extensions (mostly) and occasionally TortoiseGit. I was surprised at how few people use git from the command-line, I can&#39;t live without it.</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/6546244547301621196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2010/08/hg-vs-git-in-workplace.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/6546244547301621196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/6546244547301621196'/><link rel='alternate' type='text/html' href='http://orip.org/2010/08/hg-vs-git-in-workplace.html' title='Hg vs. Git in the workplace'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-3403240442531450772</id><published>2010-06-28T19:34:00.000+03:00</published><updated>2010-07-26T14:00:21.290+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery validation"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>jQuery Validate: Required If Visible</title><content type='html'>&lt;p&gt;I needed a generic &quot;required if visible&quot; rule for use with the &lt;a href=&quot;http://bassistance.de/jquery-plugins/jquery-plugin-validation/&quot;&gt;jQuery Validation&lt;/a&gt; plugin. This is the result:&lt;/p&gt;&lt;script src=&quot;http://gist.github.com/456034.js?file=jQuery.validate.requiredIfVisible.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;code style=&quot;display:none&quot;&gt;// jQuery.validate.requiredIfVisible.js&lt;br /&gt;
// Copyright (c) 2010 Ori Peleg, http://orip.org, distributed under the MIT license&lt;br /&gt;
(function($) {&lt;br /&gt;
$.validator.addMethod(&lt;br /&gt;
  &amp;quot;requiredIfVisible&amp;quot;,&lt;br /&gt;
  function(value, element, params) {&lt;br /&gt;
    function isVisible(e) {&lt;br /&gt;
    // the element and all of its parents must be :visible&lt;br /&gt;
    // inspiration: http://remysharp.com/2008/10/17/jquery-really-visible/&lt;br /&gt;
    return e.is(&amp;quot;:visible&amp;quot;) &amp;amp;&amp;amp; e.parents(&amp;quot;:not(:visible)&amp;quot;).length == 0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (isVisible($(element))) {&lt;br /&gt;
    // call the &amp;quot;required&amp;quot; method&lt;br /&gt;
    return $.validator.methods.required.call(this, $.trim(element.value), element);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return true;&lt;br /&gt;
  },&lt;br /&gt;
  $.validator.messages.required&lt;br /&gt;
  );&lt;br /&gt;
})(jQuery);&lt;/code&gt;&lt;br /&gt;
&lt;p&gt;Notes:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Using &lt;code&gt;required:&quot;#myinput:visible&quot;&lt;/code&gt; could have worked, but &quot;:visible&quot; doesn&#39;t check for hidden parents, and I didn&#39;t want to repeat the element selector.&lt;/li&gt;
&lt;li&gt;&quot;:hidden&quot; is false for elements with the &quot;visibility:hidden&quot; CSS rule, so I couldn&#39;t use &quot;:not(:hidden)&quot; either.&lt;/li&gt;
&lt;li&gt;Technique for checking element visibility from &lt;a href=&quot;http://remysharp.com/2008/10/17/jquery-really-visible/&quot;&gt;Remy Sharp&#39;s blog&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/3403240442531450772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2010/06/jquery-validate-required-if-visible.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3403240442531450772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3403240442531450772'/><link rel='alternate' type='text/html' href='http://orip.org/2010/06/jquery-validate-required-if-visible.html' title='jQuery Validate: Required If Visible'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-5113325432297135300</id><published>2010-04-25T14:58:00.000+03:00</published><updated>2010-04-25T14:58:07.875+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="asp.net mvc"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="webforms"/><title type='text'>MVC&#39;s RenderPartial in a WebForms page</title><content type='html'>&lt;p&gt;We have a mixed ASP.NET MVC/WebForms application, slowly transitioning to all-MVC. Obviously, sharing components between MVC and WebForms is important to us.&lt;/p&gt;&lt;p&gt;Using WebForms controls in MVC views is easy enough (minus the postbacks), but when we &lt;a href=&quot;http://stackoverflow.com/questions/702746/how-to-include-a-partial-view-inside-a-webform&quot;&gt;rendered partial views in a WebForms page&lt;/a&gt; using &lt;a href=&quot;http://bizvprog.blogspot.com/&quot;&gt;Keith Henry&lt;/a&gt;&#39;s code we occasionally got evil &quot;Validation of viewstate MAC failed&quot; errors. Microsoft &lt;a href=&quot;https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=393619&amp;wa=wsignin1.0&quot;&gt;doesn&#39;t think hybrid WebForms / MVC apps are relevant&lt;/a&gt;, but then &lt;a href=&quot;http://bugsquash.blogspot.com/2009/02/aspnet-mvc-postback-support.html&quot;&gt;Mauricio Scheffer came to the rescue&lt;/a&gt;. Instead of having the partial views subclass &lt;code&gt;ViewUserControl&lt;/code&gt;, we now subclass Mauricio&#39;s &lt;code&gt;ViewUserControlWithoutViewState&lt;/code&gt; - problem solved.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/5113325432297135300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2010/04/mvcs-renderpartial-in-webforms-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/5113325432297135300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/5113325432297135300'/><link rel='alternate' type='text/html' href='http://orip.org/2010/04/mvcs-renderpartial-in-webforms-page.html' title='MVC&#39;s RenderPartial in a WebForms page'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-3863495328979871799</id><published>2010-04-12T15:08:00.000+03:00</published><updated>2010-04-12T15:08:04.436+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="teamcity"/><title type='text'>TeamCity 5.0 upgrade - &quot;out of memory&quot; error</title><content type='html'>&lt;p&gt;I upgraded &lt;a href=&quot;http://www.jetbrains.com/teamcity/&quot;&gt;JetBrains TeamCity&lt;/a&gt; to version 5.0 on Windows (for &lt;a href=&quot;http://www.ronnie-midnight-oil.net/2010/04/i-just-uploaded-patch-to-git-plugin-for.html&quot;&gt;Git&lt;/a&gt; support, yay!). The previous version upgrades went smoothly, but this time I got an exception when loading the server:&lt;/p&gt;&lt;pre&gt;java.sql.SQLException: out of memory&lt;/pre&gt;&lt;p&gt;After some googling, I thought I had to:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Run &lt;code&gt;...\TeamCity\bin\tomcat6w.exe //ES//TeamCity&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;In the &quot;Java&quot; tab change the value for &quot;Maximum memory pool&quot;&lt;/li&gt;
&lt;li&gt;Not set it too high&lt;/li&gt;
&lt;/ul&gt;But no cigar. I realized that I probably had a corrupt HSQLDB database, and I ended up reinstalling and copying the config &lt;em&gt;by hand&lt;/em&gt; (which was a little frustrating). I don&#39;t think there&#39;s a real reason why an embedded SQL database should be less dependable than one with a server (I know that from SQLite), so I&#39;m guessing it&#39;s either TeamCity&#39;s or HSQLDB&#39;s fault. Even so, an &quot;export configuration&quot; button would be nice, and take the pain out of reinstalling TeamCity.&lt;br /&gt;
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/3863495328979871799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2010/04/teamcity-50-upgrade-out-of-memory-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3863495328979871799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3863495328979871799'/><link rel='alternate' type='text/html' href='http://orip.org/2010/04/teamcity-50-upgrade-out-of-memory-error.html' title='TeamCity 5.0 upgrade - &quot;out of memory&quot; error'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-8948065847507286227</id><published>2010-02-14T19:22:00.000+02:00</published><updated>2010-02-14T19:32:18.783+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="ftp"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="uri"/><title type='text'>Encoding usernames and passwords in FTP URIs</title><content type='html'>&lt;p&gt;I want to encode the following into a single URI:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Username: &#39;jane+foo@example.com&#39;&lt;/li&gt;
&lt;li&gt;password: &#39;my password&#39; (with a space)&lt;/li&gt;
&lt;li&gt;ftp server: &#39;ftp.example.org&#39;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The FTP URI that I expect:&lt;/p&gt;
&lt;pre&gt;ftp://jane%2bfoo%40example.com:my%20password@ftp.example.org&lt;/pre&gt;
&lt;p&gt;In .NET, &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.httputility.urlencode.aspx&quot;&gt;HttpUtility.UrlEncode&lt;/a&gt; almost does what I need - it hex-encodes the special chars, but it also converts spaces to &quot;+&quot; which the FTP server interprets as a literal &quot;+&quot;.&lt;/p&gt;
&lt;p&gt;Final code that works with my tests using the FileZilla FTP Server:&lt;/p&gt;
&lt;pre&gt;string EncodeFtpUserInfoComponent(string s)
{
  // assume or assert s != null
  return HttpUtility.UrlEncode(s).Replace(&quot;+&quot;, &quot;%20&quot;);
}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/8948065847507286227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2010/02/encoding-usernames-and-passwords-in-ftp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/8948065847507286227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/8948065847507286227'/><link rel='alternate' type='text/html' href='http://orip.org/2010/02/encoding-usernames-and-passwords-in-ftp.html' title='Encoding usernames and passwords in FTP URIs'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-1749797069485104161</id><published>2010-02-02T20:04:00.001+02:00</published><updated>2010-02-02T20:12:44.052+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hotkeys"/><category scheme="http://www.blogger.com/atom/ns#" term="keyboard"/><category scheme="http://www.blogger.com/atom/ns#" term="powerresizer"/><category scheme="http://www.blogger.com/atom/ns#" term="shortcuts"/><title type='text'>PowerResizer Keyboard Shortcuts</title><content type='html'>&lt;p&gt;For some reason the keyboard shortcuts / hotkeys for Federico Bastianello&#39;s &lt;a href=&quot;https://sourceforge.net/projects/powerresizer/&quot;&gt;PowerResizer&lt;/a&gt; aren&#39;t on the web, only in the &quot;Readme.txt&quot; installed with it. So, as a public service, here they are (for version 0.95):&lt;/p&gt;
&lt;pre&gt;2.1 - Window Docking Features and Keyboard Shortcuts

 - Move Window + A: dock a window to the left-half of the screen.
 - Move Window + S: dock a window to the right-half of the screen.
 - Move Window + W: dock a window to the top-half of the screen.
 - Move Window + Z: dock a window to the bottom-half of the screen.
 - Move Window + 1: dock a window to the top-left corner of the screen.
 - Move Window + 2: dock a window to the top-right corner of the screen.
 - Move Window + 3: dock a window to the bottom-left corner of the screen.
 - Move Window + 4: dock a window to the bottom-right corner of the screen.
 
When you resize the inner border of those windows you docked to one of the four
corners of the screen or to one of the four screen halves, PowerResizer 
changes the windows&#39; behavior during resize in a way that all docked windows
will follow the new size of their neighboors.
It is possible to mix docked windows in halves of the screen and in corners.

2.2 - Window Moving/Resizing Features and Keyboard Shortcuts

 - Resize Window + CTRL: resize a window mantaining fixed its center point.
 - Resize Window + SHIFT: move a window using its border.
 - Move Window + 5: center a window into the screen (1/16 screen size margin).
 - Move Window + 6: center a window into the screen (1/10 screen size margin).
 - Move Window + 7: center a window into the screen (1/6 screen size margin).
 - Move Window + 8: center a window into the screen (1/4 screen size margin).
 - Move Window + 9: center a window into the screen (1/3 screen size margin).
 - Move Window + 0: maximize a window.
 
2.3 - Screen window reposition Features and Keyboard Shortcuts

 - CTRL + ALT + PAGE UP: Rotate docked windows counter-clockwise.
 - CTRL + ALT + PAGE DOWN: Rotate docked windows clockwise.
 - CTRL + ALT + HOME: Reposition windows.
 
Note: the keyboard shortcuts in that section, are system-wide shortcuts and 
they will work on windows docked on the monitor containing active window.&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/1749797069485104161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2010/02/powerresizer-keyboard-shortcuts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/1749797069485104161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/1749797069485104161'/><link rel='alternate' type='text/html' href='http://orip.org/2010/02/powerresizer-keyboard-shortcuts.html' title='PowerResizer Keyboard Shortcuts'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-1824600785165431830</id><published>2009-10-29T17:31:00.000+02:00</published><updated>2009-10-29T17:38:59.720+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="ipy"/><category scheme="http://www.blogger.com/atom/ns#" term="ironpython"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="testoob"/><title type='text'>Console colors on Windows in .NET</title><content type='html'>&lt;p&gt;Changing the console output color is easy on *nix terminals with escape sequences, but has a funky API on Windows (see the &lt;a href=&quot;http://bazaar.launchpad.net/~testoob-team/testoob/trunk/annotate/head:/src/testoob/reporting/colored.py#L50&quot;&gt;color support code from Testoob&lt;/a&gt; for a Python example with pywin32/ctypes).&lt;/p&gt;
&lt;p&gt;It turns out that there&#39;s a very nice .NET API for it, though (there&#39;s a nice &lt;a href=&quot;http://dotnetperls.com/console-color&quot;&gt;article by Sam Allen&lt;/a&gt; on the Dot Net Perls site). This would be awesome for &lt;a href=&quot;http://code.google.com/p/testoob/&quot;&gt;Testoob&lt;/a&gt;&#39;s IronPython support.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/1824600785165431830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/10/console-colors-on-windows-in-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/1824600785165431830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/1824600785165431830'/><link rel='alternate' type='text/html' href='http://orip.org/2009/10/console-colors-on-windows-in-net.html' title='Console colors on Windows in .NET'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-4325288404457261639</id><published>2009-10-26T10:47:00.000+02:00</published><updated>2009-10-26T12:35:41.768+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="web"/><title type='text'>Include literal file contents in ASP.NET</title><content type='html'>&lt;p&gt;I was looking for something similar to &lt;a href=&quot;http://velocity.apache.org/&quot;&gt;Velocity&lt;/a&gt;&#39;s &lt;code&gt;#include&lt;/code&gt; for ASP.NET. &lt;code&gt;&amp;lt;% Response.WriteFile([filename]); %&amp;gt;&lt;/code&gt; works well, but a .NET control for this could be nice. Here is my attempt (MIT license):&lt;/p&gt;
&lt;pre&gt;using System.IO;
using System.Web;
using System.Web.UI;

namespace FooControls
{
  public class LiteralContentFromFile : Control
  {
    public string Path { get; set; }

    protected override void Render(HtmlTextWriter writer)
    {
      var server = HttpContext.Current.Server;
      var physicalPath = server.MapPath(Path);
      var fileContents = File.ReadAllText(physicalPath);
      writer.Write(fileContents);
    }
  }
}&lt;/pre&gt;
&lt;p&gt;Usage in an .aspx file (WebForms or ASP.NET MVC):&lt;/p&gt;
&lt;pre&gt;&amp;lt;%@ Register TagPrefix=&quot;foo&quot;
  Namespace=&quot;FooControls&quot; Assembly=&quot;FooControls&quot; %&amp;gt;
...
&amp;lt;foo:LiteralContentFromFile runat=&quot;server&quot;
  Path=&quot;~/path/to/file&quot; /&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;Edit:&lt;/b&gt; subclassing &lt;code&gt;System.Web.UI.Control&lt;/code&gt; instead of &lt;code&gt;System.Web.UI.WebControls.WebControl&lt;/code&gt; which added unnecessary and unwanted behavior (for example, wrapped the output with &lt;code&gt;&amp;lt;span&amp;gt;&lt;/code&gt;).&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/4325288404457261639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/10/include-literal-file-contents-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/4325288404457261639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/4325288404457261639'/><link rel='alternate' type='text/html' href='http://orip.org/2009/10/include-literal-file-contents-in-aspnet.html' title='Include literal file contents in ASP.NET'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-6949073634015748495</id><published>2009-10-22T01:43:00.000+02:00</published><updated>2009-10-22T01:46:11.941+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="google-code"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="testoob"/><category scheme="http://www.blogger.com/atom/ns#" term="trac"/><title type='text'>Issues API for Google Code Hosting</title><content type='html'>&lt;p&gt;Google have recently released an &lt;a href=&quot;http://googlecode.blogspot.com/2009/10/issue-tracker-data-api-for-project.html&quot;&gt;issue-management API&lt;/a&gt; for projects hosted on Google Code.&lt;/p&gt;
&lt;p&gt;That&#39;s good news for &lt;a href=&quot;http://code.google.com/p/testoob/&quot;&gt;Testoob&lt;/a&gt; - I&#39;ve been wanting to import its old Trac tickets for ages!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/6949073634015748495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/10/issues-api-for-google-code-hosting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/6949073634015748495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/6949073634015748495'/><link rel='alternate' type='text/html' href='http://orip.org/2009/10/issues-api-for-google-code-hosting.html' title='Issues API for Google Code Hosting'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-9058113581135112902</id><published>2009-10-08T02:30:00.001+02:00</published><updated>2009-10-08T02:36:49.373+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="testing"/><category scheme="http://www.blogger.com/atom/ns#" term="testoob"/><title type='text'>Testoob 1.15 released</title><content type='html'>&lt;p&gt;I&#39;m very happy to announce that after nearly 3 years &lt;a href=&quot;http://code.google.com/p/testoob&quot;&gt;Testoob&lt;/a&gt; sees another release.&lt;/p&gt;

&lt;p&gt;Testoob is the advanced Python test runner and testing framework that spices up any existing unittest test suite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Changes:&lt;/strong&gt; Version 1.15 (Oct. 2009) adds better Python 2.6, IronPython, and Jython support, as well as test coverage improvements, better color 
support, and some new options and bugfixes. A full list of changes is available in the &lt;a href=&quot;http://groups.google.com/group/testoob/browse_thread/thread/ff2a026433539fb0&quot;&gt;release announcement&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;A big shout out to Ronnie van &#39;t Westeinde - without him this version wouldn&#39;t have been possible.&lt;/p&gt;

&lt;p&gt;Options to install:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;With easy_install: &quot;&lt;code&gt;easy_install -U testoob&lt;/code&gt;&quot;&lt;/li&gt;
&lt;li&gt;One of the &lt;a href=&quot;http://code.google.com/p/testoob/downloads/list&quot;&gt;available packages&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/9058113581135112902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/10/testoob-115-released.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/9058113581135112902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/9058113581135112902'/><link rel='alternate' type='text/html' href='http://orip.org/2009/10/testoob-115-released.html' title='Testoob 1.15 released'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-579694601001836031</id><published>2009-09-09T15:54:00.000+03:00</published><updated>2009-09-09T16:00:56.404+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="community"/><category scheme="http://www.blogger.com/atom/ns#" term="conference"/><category scheme="http://www.blogger.com/atom/ns#" term="idcc"/><category scheme="http://www.blogger.com/atom/ns#" term="idcc09"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>IDCC 2009 Registration Is Open</title><content type='html'>&lt;p&gt;The response for the &lt;a href=&quot;http://orip.org/2009/07/idcc-2009-call-for-content.html&quot;&gt;call for content&lt;/a&gt; for &lt;a href=&quot;http://idcc.co.il/&quot;&gt;IDCC 2009&lt;/a&gt; has been impressive, and now &lt;a href=&quot;http://weblogs.asp.net/israelio/archive/2009/09/09/idcc-new-agenda-we-added-another-track.aspx&quot;&gt;two tracks are open&lt;/a&gt; with great talks.&lt;/p&gt;
&lt;p&gt;Hurry up and &lt;a href=&quot;http://idcc.co.il/register&quot;&gt;register&lt;/a&gt;!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/579694601001836031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/09/idcc-2009-registration-is-open.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/579694601001836031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/579694601001836031'/><link rel='alternate' type='text/html' href='http://orip.org/2009/09/idcc-2009-registration-is-open.html' title='IDCC 2009 Registration Is Open'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-2580614422333419399</id><published>2009-09-07T16:43:00.000+03:00</published><updated>2009-09-07T17:00:24.234+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="form"/><category scheme="http://www.blogger.com/atom/ns#" term="html"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>&quot;Enter&quot; submits my ASP.NET form!</title><content type='html'>&lt;p&gt;ASP.NET encourages web pages to be written as one big &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt;, and every interaction with it to be a POST to the server (&quot;Postback&quot; in ASP.NET). This means pages often have multiple auto-generated &lt;code&gt;&amp;lt;input type=&quot;submit&quot;&amp;gt;&lt;/code&gt; elements.&lt;/p&gt;
&lt;p&gt;On some browsers, pressing &lt;kbd&gt;Enter&lt;/kbd&gt; causes the first submit button to be &quot;clicked&quot;. In pages with many such buttons, that&#39;s usually not what you want. As a hack to make &quot;Enter&quot; do nothing on an already-built page, I added the following before any other submit button:&lt;/p&gt;
&lt;pre&gt;
&amp;lt;div style=&quot;visibility:hidden;height:0;&quot;&amp;gt;
  &amp;lt;input type=&quot;submit&quot; value=&quot;Dummy&quot; onclick=&quot;return false;&quot; /&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Now this do-nothing, invisible submit button &quot;catches&quot; the Enter and prevents the next button from being &quot;clicked&quot;. This requires JavaScript turned on, but ASP.NET&#39;s &quot;Postbacks&quot; require them anyway, so no big loss.&lt;/p&gt;
&lt;p&gt;Implementation note: using &#39;&lt;code&gt;display:none;&lt;/code&gt;&#39; caused the browser to ignore it, so I had to resort to &#39;&lt;code&gt;visibility:hidden;&lt;/code&gt;&#39; and then &#39;&lt;code&gt;height:0;&lt;/code&gt;&#39; to impact the layout as little as I could. There could be cross-browser styling issues here, my specific case didn&#39;t need anything special.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/2580614422333419399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/09/enter-submits-my-aspnet-form.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/2580614422333419399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/2580614422333419399'/><link rel='alternate' type='text/html' href='http://orip.org/2009/09/enter-submits-my-aspnet-form.html' title='&quot;Enter&quot; submits my ASP.NET form!'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-3633422731443414049</id><published>2009-08-24T15:54:00.001+03:00</published><updated>2009-08-24T15:57:41.909+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="path"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Python: checking if an executable exists in the path</title><content type='html'>I wanted to do this on Windows. Based on &lt;a href=&quot;http://stackoverflow.com/questions/775351/os-path-exists-for-files-in-your-path/1322060&quot;&gt;this StackOverflow question&lt;/a&gt; and on Trey Stout&#39;s and Carl Meyer&#39;s responses I made the following snippet:
&lt;pre&gt;
def exists_in_path(cmd):
  # can&#39;t search the path if a directory is specified
  assert not os.path.dirname(cmd)

  extensions = os.environ.get(&quot;PATHEXT&quot;, &quot;&quot;).split(os.pathsep)
  for directory in os.environ.get(&quot;PATH&quot;, &quot;&quot;).split(os.pathsep):
    base = os.path.join(directory, cmd)
    options = [base] + [(base + ext) for ext in extensions]
    for filename in options:
      if os.path.exists(filename):
        return True
  return False
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/3633422731443414049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/08/python-checking-if-executable-exists-in.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3633422731443414049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3633422731443414049'/><link rel='alternate' type='text/html' href='http://orip.org/2009/08/python-checking-if-executable-exists-in.html' title='Python: checking if an executable exists in the path'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-3238309650456563507</id><published>2009-07-22T21:43:00.000+03:00</published><updated>2009-07-23T09:36:57.738+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="namespace"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>JavaScript Namespaces</title><content type='html'>&lt;p&gt;It&#39;s important to &lt;a href=&quot;http://yuiblog.com./blog/2006/06/01/global-domination/&quot;&gt;namespace your JavaScript code&lt;/a&gt;. I want one &quot;master&quot; namespace, and everything else under it (like &lt;a href=&quot;http://developer.yahoo.com/yui/&quot;&gt;YUI&lt;/a&gt;&#39;s namespacing approach). I fell into some potholes of browser compatibility on the way (with &lt;code&gt;var foo; if (!foo) foo = {};&lt;/code&gt;), but here&#39;s what I ended up with:&lt;/p&gt;
&lt;pre&gt;
// define master namespace
if (typeof foo === &quot;undefined&quot;) var foo = {};

(function(){ // lexical scoping, allows &quot;private&quot; variables and functions

// define sub-namespace
if (!foo.bar) foo.bar = {};

// these don&#39;t leak outside
function helper() { /* ... */ } // &quot;private&quot; function
var counter = 0;                // &quot;private&quot; variable

// this function shows up globally under namespace foo.bar
foo.bar.func1 = function(x) { /* ... */ };

// not just functions
foo.bar.constant1 = 12;
foo.bar.shared_data = [];

})(); // end of lexical scoping
&lt;/pre&gt;
&lt;p&gt;This way all the JS files can use the same namespace hierarchy, and can still be defined separately. No JS library necessary.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/3238309650456563507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/07/javascript-namespaces.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3238309650456563507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/3238309650456563507'/><link rel='alternate' type='text/html' href='http://orip.org/2009/07/javascript-namespaces.html' title='JavaScript Namespaces'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-7915311900970252994</id><published>2009-07-15T11:31:00.000+03:00</published><updated>2009-07-15T14:08:44.759+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net"/><category scheme="http://www.blogger.com/atom/ns#" term="community"/><category scheme="http://www.blogger.com/atom/ns#" term="idcc"/><category scheme="http://www.blogger.com/atom/ns#" term="idcc09"/><category scheme="http://www.blogger.com/atom/ns#" term="israel"/><title type='text'>IDCC 2009, call for content</title><content type='html'>&lt;p&gt;&lt;a href=&quot;http://www.idcc.co.il/&quot;&gt;The Israeli Developers Community Conference 2009&lt;/a&gt; has started its call for content. It&#39;s a community conference centered on the .NET world.&lt;/p&gt;

&lt;p&gt;If you have a &lt;a href=&quot;http://www.idcc.co.il/sessions/submit&quot;&gt;session to propose&lt;/a&gt;, please do! The community will vote on the proposals, and the conference will conform to the participants - not the other way around.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/7915311900970252994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/07/idcc-2009-call-for-content.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/7915311900970252994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/7915311900970252994'/><link rel='alternate' type='text/html' href='http://orip.org/2009/07/idcc-2009-call-for-content.html' title='IDCC 2009, call for content'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-7774384928332126408</id><published>2009-06-05T17:17:00.001+03:00</published><updated>2009-06-05T17:17:52.901+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="testoob"/><title type='text'>Fresh instances in Python with lazy evaluation</title><content type='html'>&lt;p&gt;Testoob&#39;s &lt;code&gt;--capture&lt;/code&gt; feature (written by &lt;a href=&quot;http://code.google.com/u/misha.seltzer/&quot;&gt;Misha&lt;/a&gt;) replaces &lt;code&gt;sys.stdout&lt;/code&gt; and &lt;code&gt;sys.stderr&lt;/code&gt; for each test being run, and displays the output only if the test fails.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://code.google.com/u/leeor.aharon/&quot;&gt;Leeor Aharon&lt;/a&gt;, of &lt;a href=&quot;http://code.google.com/p/ff-activex-host/&quot;&gt;ff-activex-host&lt;/a&gt; fame, wanted to use it with Python&#39;s &lt;a href=&quot;http://docs.python.org/library/logging.html&quot;&gt;logging module&lt;/a&gt;, but the &lt;code&gt;StreamHandler&lt;/code&gt; class stores a reference to the output stream on initialization - it already has a reference to sys.stdout, so replacing it won&#39;t affect it.&lt;/p&gt;
&lt;p&gt;We originally thought of sublcassing &lt;code&gt;StreamHandler&lt;/code&gt; and making retrieve the logger from a property, but we came up with this elegant code instead:&lt;/p&gt;
&lt;pre class=&quot;code-py&quot;&gt; 
class LazyEvaluator(object):
    def __init__(self, factory):
        self.__factory = factory
    def __getattr__(self, name):
        return getattr(self.__factory(), name)

lazy_stdout = LazyEvaluator(lambda:sys.stdout)
handler = StreamHandler(strm=lazy_stdout)
&lt;/pre&gt;
&lt;p&gt;The &quot;lazy evaluator&quot; is initialized with a factory callable, and every time it tries to access an attribute or method the object will be re-created by the factory. No changes necessary for &lt;code&gt;StreamHandler&lt;/code&gt;, and &lt;code&gt;./alltests.py --capture&lt;/code&gt; works like a charm.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/7774384928332126408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/06/fresh-instances-in-python-with-lazy.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/7774384928332126408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/7774384928332126408'/><link rel='alternate' type='text/html' href='http://orip.org/2009/06/fresh-instances-in-python-with-lazy.html' title='Fresh instances in Python with lazy evaluation'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-4840477894520565671</id><published>2009-05-27T10:47:00.001+03:00</published><updated>2009-05-27T11:13:14.614+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dialog"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery ui"/><category scheme="http://www.blogger.com/atom/ns#" term="themes"/><title type='text'>jQuery UI scoped themes and the Dialog widget</title><content type='html'>&lt;p&gt;There&#39;s a problem using scoped themes with jQuery UI&#39;s Dialog widget in the 1.6 and 1.7 releases (and possibly 1.7.1 as well).&lt;/p&gt;
&lt;p&gt;Christoph Herold &lt;a href=&quot;http://groups.google.com/group/jquery-ui-dev/browse_thread/thread/264dce061c54e0ae
&quot;&gt;mentioned his workaround&lt;/a&gt; - wrapping the dialog&#39;s DOM with a scoping div (with the scoped theme&#39;s class name). I wrote a small jQuery plugin that does this and works fine so far:&lt;/p&gt;
&lt;pre class=&quot;code-js&quot;&gt;
// Wraps the dialog in a div with the scoping class on
// dialog open, removes the scoping class on dialog close
$.fn.dialogScopingWorkaround = function(scopingClass) {
  this.bind(&#39;dialogopen&#39;, function(event, ui) {
    $(this).parents(&quot;.ui-dialog&quot;).wrap(
      &#39;&amp;lt;div class=&quot;dialogScopingWrapper &#39;
      + scopingClass
      + &#39;&quot;&gt;&amp;lt;/div&gt;&#39;
    );
  });
  this.bind(&#39;dialogclose&#39;, function(event, ui) {
    var wrapper = $(this).parents(&quot;.dialogScopingWrapper&quot;);
    wrapper.replaceWith(wrapper.children());
  });
  return this;
};&lt;/pre&gt;
&lt;p&gt;Example with the &quot;smoothness&quot; theme scoped with class &quot;theme-smoothness&quot;:&lt;/p&gt;
&lt;pre class=&quot;code-js&quot;&gt;$(&#39;#dialog&#39;).dialogScopingWorkaround(&quot;theme-smoothness&quot;).dialog();

// Must call the workaround before opening the dialog
// so the &#39;dialogopen&#39; event is bound.&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/4840477894520565671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/05/jquery-ui-scoped-themes-and-dialog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/4840477894520565671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/4840477894520565671'/><link rel='alternate' type='text/html' href='http://orip.org/2009/05/jquery-ui-scoped-themes-and-dialog.html' title='jQuery UI scoped themes and the Dialog widget'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-7093108671803916287</id><published>2009-05-17T17:05:00.000+03:00</published><updated>2009-05-17T17:10:28.133+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ie7"/><category scheme="http://www.blogger.com/atom/ns#" term="ie8"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>IE7 compatibility image wants to install IE8</title><content type='html'>I use Microsoft&#39;s &lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&amp;displaylang=en&quot;&gt;IE Application Compatibility&lt;/a&gt; virtual machine images to test web sites with IE6 and IE7.

Well, today my IE7 virtual machine wanted to &lt;a href=&quot;http://blogs.msdn.com/ie/archive/2009/04/10/prepare-for-automatic-update-distribution-of-ie8.aspx&quot;&gt;automatically update to IE8&lt;/a&gt;. Great for the web, funny for an IE7 compatibility test image :)</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/7093108671803916287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/05/ie7-compatibility-image-wants-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/7093108671803916287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/7093108671803916287'/><link rel='alternate' type='text/html' href='http://orip.org/2009/05/ie7-compatibility-image-wants-to.html' title='IE7 compatibility image wants to install IE8'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-2280687188851089366</id><published>2009-05-14T22:38:00.001+03:00</published><updated>2009-05-14T23:06:40.404+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ajax"/><category scheme="http://www.blogger.com/atom/ns#" term="ajaxpro"/><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery"/><title type='text'>Ajax.NET Professional &quot;onTimeout&quot; exception</title><content type='html'>&lt;p&gt;We just upgraded to &lt;a href=&quot;http://codeplex.com/AjaxPro&quot;&gt;Ajax.NET Professional&lt;/a&gt; 9.2.17.1 and started seeing these JavaScript exceptions in file &quot;core.ashx&quot;:&lt;/p&gt;
&lt;blockquote&gt;
this.onTimeout is not a function
&lt;/blockquote&gt;
&lt;p&gt;It turns out this is a &lt;a href=&quot;http://ajaxpro.codeplex.com/WorkItem/View.aspx?WorkItemId=21433&amp;ProjectName=AjaxPro&quot;&gt;known issue&lt;/a&gt; with synchronous calls done with AjaxPro&#39;s client-side JS. We should probably have ditched it and used regular jQuery AJAX calls on the client side (like &lt;a href=&quot;http://weblogs.asp.net/mschwarz/archive/2007/04/10/jquery-and-ajax-net-professional-ajaxpro.aspx&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://weblogs.asp.net/mschwarz/archive/2007/04/15/download-ajaxpro-beta-with-jquery-support.aspx&quot;&gt;here&lt;/a&gt;) but we haven&#39;t gotten around to that yet.&lt;/p&gt;

&lt;p&gt;Our workaround was easy - we were making a &quot;fire and forget&quot; call, so it didn&#39;t need to be synchronous (we added an empty callback handler to the arg list). We could have also patched the JS ourselves and:
&lt;ul&gt;
&lt;li&gt;rebuilt AjaxPro with the patched version&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://weblogs.asp.net/mschwarz/archive/2005/11/24/431450.aspx&quot;&gt;made AjaxPro load the patched version&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;not used RegisterTypeForAjax and &lt;a href=&quot;http://my6solutions.com/post/2009/03/09/Running-AjaxNET-Professional-under-ASP-NET-MVC.aspx&quot;&gt;added the script references ourselves&lt;/a&gt; - pointing to the patched version, and possibly taking the opportunity to combine and minify AjaxPro&#39;s JS files.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/2280687188851089366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/05/ajaxnet-professional-ontimeout.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/2280687188851089366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/2280687188851089366'/><link rel='alternate' type='text/html' href='http://orip.org/2009/05/ajaxnet-professional-ontimeout.html' title='Ajax.NET Professional &quot;onTimeout&quot; exception'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7694153150954292329.post-4024052193538554791</id><published>2009-03-17T02:31:00.000+02:00</published><updated>2009-03-17T03:01:49.792+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="blogger"/><category scheme="http://www.blogger.com/atom/ns#" term="digg"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="reddit"/><title type='text'>Reddit and Digg icons on Blogger without external scripts</title><content type='html'>&lt;p&gt;It took me a while to be able to add reddit and Digg icons that didn&#39;t load external scripts - Blogger&#39;s templating language had me stumped. I used &lt;a href=&quot;http://www.reddit.com/buttons/&quot;&gt;reddit&lt;/a&gt;&#39;s, &lt;a href=&quot;http://digg.com/tools/integrate&quot;&gt;Digg&lt;/a&gt;&#39;s, and &lt;a href=&quot;http://help.blogger.com/bin/answer.py?answer=47270&quot;&gt;Blogger&lt;/a&gt;&#39;s documentation, but I would never have gotten the &quot;onclick&quot; escaping right without &lt;a href=&quot;http://www.consumingexperience.com/2007/01/new-blogger-expr-how-to-convert.html&quot;&gt;this post&lt;/a&gt;.&lt;/p&gt;
&lt;pre&gt;&amp;lt;!-- reddit button --&gt;
&amp;lt;a expr:href=&#39;&quot;http://www.reddit.com/submit?url=&quot; + data:post.url&#39; expr:onclick=&#39;&quot;window.location = \&quot;http://www.reddit.com/submit?url=\&quot; + encodeURIComponent(\&quot;&quot; + data:post.url + &quot;\&quot;); return false&quot;&#39;&gt; &amp;lt;img src=&quot;http://www.reddit.com/static/spreddit1.gif&quot; title=&quot;submit to reddit&quot; alt=&quot;submit to reddit&quot; border=&quot;0&quot; /&gt; &amp;lt;/a&gt;
&amp;lt;!-- digg button --&gt;
&amp;lt;a expr:href=&#39;&quot;http://digg.com/submit?url=&quot; + data:post.url&#39; expr:onclick=&#39;&quot;window.location = \&quot;http://digg.com/submit?url=\&quot; + encodeURIComponent(\&quot;&quot; + data:post.url + &quot;\&quot;); return false&quot;&#39;&gt; &amp;lt;img style=&quot;background:white;&quot; width=&quot;16&quot; height=&quot;16&quot; alt=&quot;Submit Story to Digg&quot; title=&quot;Submit Story to Digg&quot; src=&quot;http://digg.com/img/digg-guy-icon.gif&quot;/&gt;&amp;lt;/a&gt;&lt;/pre&gt;
&lt;p&gt;P.S. - if you can&#39;t find the &quot;data:post.body&quot; element to add the buttons after, like I couldn&#39;t, see if you forgot to check the &quot;Expand Widget Templates&quot; checkbox under &quot;Layout -&gt; Edit HTML&quot;.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://orip.org/feeds/4024052193538554791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://orip.org/2009/03/reddit-and-digg-icons-on-blogger.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/4024052193538554791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7694153150954292329/posts/default/4024052193538554791'/><link rel='alternate' type='text/html' href='http://orip.org/2009/03/reddit-and-digg-icons-on-blogger.html' title='Reddit and Digg icons on Blogger without external scripts'/><author><name>orip</name><uri>http://www.blogger.com/profile/00060140324205560525</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>