<?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:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-12688691</id><updated>2010-02-02T09:42:31.555-08:00</updated><title type='text'>Jiro Feingold</title><subtitle type='html'>              .NET, iPhone, programming, fonts and image manipulation.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.3203.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default'/><link rel='alternate' type='text/html' href='http://blog.3203.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default?start-index=26&amp;max-results=25'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12688691.post-8494657246546219039</id><published>2009-11-29T13:37:00.000-08:00</published><updated>2009-12-05T10:01:28.867-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='laser'/><category scheme='http://www.blogger.com/atom/ns#' term='scanner'/><category scheme='http://www.blogger.com/atom/ns#' term='scanning'/><category scheme='http://www.blogger.com/atom/ns#' term='barcodes'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><category scheme='http://www.blogger.com/atom/ns#' term='128'/><category scheme='http://www.blogger.com/atom/ns#' term='coupons'/><title type='text'>Creating barcodes readable off of the iPhone</title><content type='html'>The iPhone app I've created creates barcodes on the fly, that are scannable directly off of the iPhone.  Creating the barcodes is relatively easy, figure out the encoding system you'll be using (these were Code 128 barcodes), the string of numbers you are encoding gets run through a function that creates start and end codes (that the scanner uses to verify it has correctly scanned the number).  There are several true type fonts of barcode schemes available, and so you can just use the font to image tricks I've gone over before.&lt;br&gt;
&lt;br&gt;
Because a piece of paper is reflective and the iPhone screen isn't, older barcode scanners will not work.  They depend on the laser reflecting off of the paper and this won't work off of the iPhone (its screen transmits light, but doesn't really reflect it).  I tried tweaking the colors of the coupon, but nothing helped.  Fortunately most scanners are moving towards a system that is more like taking a digital image of the barcode (you can tell these because the laser doesn't just create a straight line on the coupon, it'll create a box, or something two dimensional).  Since these scans are just looking at the image transmitted back, they'll work fine off of the iPhone (even when screen protectors are used).&lt;br&gt;&lt;br&gt;
Click &lt;a href="http://www.jirofeingold.com/bar.aspx?text=12345"&gt;here&lt;/a&gt; to see a sample&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-8494657246546219039?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/8494657246546219039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=8494657246546219039' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8494657246546219039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8494657246546219039'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/11/creating-barcodes-readable-off-of.html' title='Creating barcodes readable off of the iPhone'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-443349555391603886</id><published>2009-11-15T20:33:00.000-08:00</published><updated>2009-12-05T20:40:02.692-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='visual studio'/><category scheme='http://www.blogger.com/atom/ns#' term='tag'/><category scheme='http://www.blogger.com/atom/ns#' term='option'/><category scheme='http://www.blogger.com/atom/ns#' term='compiler'/><category scheme='http://www.blogger.com/atom/ns#' term='unsafe'/><category scheme='http://www.blogger.com/atom/ns#' term='2008'/><title type='text'>Unsafe code and visual studio 2008</title><content type='html'>I had some code I was using to apply a smoothing filter to an image that used the unsafe tag in visual studio.  Unfortunately all the references I found about allowing this in the compilation weren't referring to how to set this up for a web project.  It actually needs to be set in the web.config file:
&lt;br&gt;
....&lt;br&gt;
 &amp;lt;system.codedom&amp;gt;&lt;br&gt;
  &amp;lt;compilers&amp;gt;&lt;br&gt;
   &amp;lt;compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/unsafe"&amp;gt;&lt;br&gt;
&lt;br&gt;
The important part being the compilerOptions at the end.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-443349555391603886?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/443349555391603886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=443349555391603886' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/443349555391603886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/443349555391603886'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/12/unsafe-code-and-visual-studio-2008.html' title='Unsafe code and visual studio 2008'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-3025251471983402155</id><published>2009-09-18T16:47:00.000-07:00</published><updated>2009-09-23T15:28:15.476-07:00</updated><title type='text'>App available in App Store</title><content type='html'>The app I've been working on is now available through the App Store

&lt;br /&gt;&lt;br /&gt;
&lt;a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=331229741&amp;amp;mt=8"&gt;&lt;/a&gt;&lt;a href="http://bit.ly/edw8O"&gt;Click here&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;

The app pulls down coupons for adidas outlet stores, which can be sent to specific users based on location they are in (so if a store in my area has too much of something I might get a coupon for it).
&lt;br /&gt;&lt;br /&gt;


I create the barcodes on the fly, which are actually scannable directly from the screen (on most of the scanners in the stores).  It has a custom interface, links to maps for the locations of the stores, and I think is a pretty decent app for my first "official" one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-3025251471983402155?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/3025251471983402155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=3025251471983402155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/3025251471983402155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/3025251471983402155'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/09/app-available-in-app-store.html' title='App available in App Store'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-399967511176104747</id><published>2009-08-07T08:41:00.000-07:00</published><updated>2009-08-07T08:49:28.871-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='loadRequest'/><category scheme='http://www.blogger.com/atom/ns#' term='anchor'/><category scheme='http://www.blogger.com/atom/ns#' term='link'/><category scheme='http://www.blogger.com/atom/ns#' term='uiwebview'/><category scheme='http://www.blogger.com/atom/ns#' term='baseURL'/><category scheme='http://www.blogger.com/atom/ns#' term='local'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><category scheme='http://www.blogger.com/atom/ns#' term='loadHTMLString'/><title type='text'>Navigating to local anchor link, even though your setting relative paths in a UIWebView</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;I've got a UIWebView that I wanted to set a baseURL for (it is a local to the iPhone html file, and has local image references). Unfortunately loadRequest doesn't allow you to set the baseURL (only loadHTMLString).  I really don't know why.
&lt;br /&gt;&lt;br /&gt;


So if you use loadHTMLString and pass it a blank string (and set the baseURL) and then call loadRequest, you can make it work.
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;

NSString *path = [[NSBundle mainBundle] bundlePath];
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;NSURL *baseURL = [NSURL fileURLWithPath: path];
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;NSString *filePath = [[NSBundle mainBundle] pathForResource:@"stores" ofType:@"html"];
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;NSURL *fullURL = [NSURL URLWithString:@"#OR" relativeToURL:fileURL];
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;NSURL *fileURL = [NSURL fileURLWithPath:filePath];
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;[webView loadHTMLString:@"" baseURL:baseURL];
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:lucida grande;"&gt;[webView loadRequest:[NSURLRequest requestWithURL: fullURL]];

&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-399967511176104747?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/399967511176104747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=399967511176104747' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/399967511176104747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/399967511176104747'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/08/navigating-to-local-anchor-link-even.html' title='Navigating to local anchor link, even though your setting relative paths in a UIWebView'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-5852514295527289370</id><published>2009-08-04T16:46:00.000-07:00</published><updated>2009-08-04T16:50:35.878-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='cheating'/><category scheme='http://www.blogger.com/atom/ns#' term='safari'/><category scheme='http://www.blogger.com/atom/ns#' term='render'/><category scheme='http://www.blogger.com/atom/ns#' term='apple is dirty'/><category scheme='http://www.blogger.com/atom/ns#' term='printing'/><category scheme='http://www.blogger.com/atom/ns#' term='print'/><title type='text'>Javascript printing in Safari</title><content type='html'>Because safari seems to cheat with browser speed tests and calls javascript before the page has finished rendering, I ran into a problem with having a javascript windows.print(); function on the page, the print box would come up before the page had finished loading.&lt;br /&gt;
&lt;br /&gt;
Took me a while to figure out a solution, but by making the body tag a server control, I could call:&lt;br /&gt;
body.Attributes.Add("onload", "javascript: window.print();");&lt;br /&gt;
&lt;br /&gt;
To programmatically add the javascript, which would only load _after_ the page had rendered.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-5852514295527289370?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/5852514295527289370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=5852514295527289370' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/5852514295527289370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/5852514295527289370'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/08/javascript-printing-in-safari.html' title='Javascript printing in Safari'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-8195280444788981062</id><published>2009-08-01T16:01:00.000-07:00</published><updated>2009-08-01T16:06:04.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='server'/><category scheme='http://www.blogger.com/atom/ns#' term='holy crap'/><category scheme='http://www.blogger.com/atom/ns#' term='password'/><category scheme='http://www.blogger.com/atom/ns#' term='sa'/><category scheme='http://www.blogger.com/atom/ns#' term='db'/><title type='text'>Recovering access to a SQL db</title><content type='html'>&lt;span style="font-family: lucida grande;"&gt;Our database on the server hosting our clients suddenly stopped allowing access (for some reason it got put into windows authentication mode, we don't know how).  With the sa password not around I used this great solution to set up a login via windows authentication so I could login and change the authentication mode.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;

&lt;a href="http://blogs.msdn.com/raulga/archive/2007/07/12/disaster-recovery-what-to-do-when-the-sa-account-password-is-lost-in-sql-server-2005.aspx"&gt;&lt;span style="font-family: lucida grande;"&gt;http://blogs.msdn.com/raulga/archive/2007/07/12/disaster-recovery-what-to-do-when-the-sa-account-password-is-lost-in-sql-server-2005.aspx&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-8195280444788981062?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/8195280444788981062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=8195280444788981062' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8195280444788981062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8195280444788981062'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/08/recovering-access-to-sql-db.html' title='Recovering access to a SQL db'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-5212158002592823739</id><published>2009-06-10T16:18:00.000-07:00</published><updated>2009-06-10T16:37:28.700-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='profile'/><category scheme='http://www.blogger.com/atom/ns#' term='xcode'/><category scheme='http://www.blogger.com/atom/ns#' term='cert'/><category scheme='http://www.blogger.com/atom/ns#' term='provisioning'/><category scheme='http://www.blogger.com/atom/ns#' term='CSSMERR_TP_CERT_NOT_VALID_YET'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><category scheme='http://www.blogger.com/atom/ns#' term='app id'/><category scheme='http://www.blogger.com/atom/ns#' term='ad hoc'/><title type='text'>iPhone ad hoc provisioning profiles</title><content type='html'>&lt;span style="font-family: lucida grande;"&gt;&lt;span style="font-family: lucida grande;"&gt;In trying to develop for the iPhone you've got to create provisioning profiles, and this was proving to be more complicated than I thought.  Going through the directions (creating cert, creating app id, creating provisioning profile) wasn't working&lt;/span&gt;.  I'd either get an error when trying to sync, or even have trouble creating the app in the first place.  Here's what I did to solve it:&lt;br /&gt;
&lt;br /&gt;
Make sure your default keychain is login&lt;br /&gt;
Clear off all the certs and start fresh.&lt;br /&gt;
Make sure your you are added to the team, and your device is added&lt;br /&gt;
Create the initial cert according to Apple's directions, submit it and approve the cert. (do this for both the development and distribution tabs under certificates&lt;br /&gt;
Download the two certs and install them.&lt;br /&gt;
Download the WWDR intermediate cert and install it.&lt;br /&gt;
Create the app id, I used com.overlandagency.appname for the bundle identifier&lt;br /&gt;
Create a distribution provisioning profile picking the app id, make sure you select your device&lt;br /&gt;
Download the provisioning profile&lt;br /&gt;
In Xcode right click on the top item in Groups &amp;amp; Files and select Get info&lt;br /&gt;
Under the build tab, under code signing  make sure the code signing identity and any iphone OS device have "iPhone Distribution: your name" set&lt;br /&gt;
Right click the app under targets (in groups &amp;amp; files) make sure the Code signing entitlements (under code signing) is set to the plist file (you've created according to apple's instructions)&lt;br /&gt;
Click the properties tab and make sure the identifier is correct (in this case com.overlandagency.appname)&lt;br /&gt;
Click clean all targets in Xcode (this fixed many problems)&lt;br /&gt;
Click build, right click on the .app file in products and pick reveal in finder&lt;br /&gt;
&lt;br /&gt;
I ran into problems at one point because my mac had weirdly set itself to the wrong time so I was getting a CSSMERR_TP_CERT_NOT_VALID_YET error, that refused to clear up.  Even though I fixed this problem, I couldn't even build at this point, but then making sure I clicked "Clean all targets" fixed this problem, and could have been half of what was going on with issues I was having before.


&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-5212158002592823739?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/5212158002592823739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=5212158002592823739' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/5212158002592823739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/5212158002592823739'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/06/iphone-ad-hoc-provisioning-profiles.html' title='iPhone ad hoc provisioning profiles'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-3319265188452526184</id><published>2009-05-28T10:24:00.001-07:00</published><updated>2009-05-28T10:31:21.096-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='query'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='sheet'/><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='reading'/><title type='text'>Reading excel files from .NET</title><content type='html'>&lt;span style="font-family: lucida grande;"&gt;It is pretty easy to create excel files on the fly from .NET
&lt;br /&gt;&lt;br /&gt;
Using the office automation stuff to read from excel files was always a pain.  Here is a way to avoid that.
&lt;br /&gt;
&lt;br /&gt;
The connection string is just something like this:
&lt;/span&gt;&lt;span style="font-family: lucida grande;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family: lucida grande;"&gt;String connString = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("Coupon Report Example.xls") + ";Extended Properties=Excel 8.0";
&lt;/span&gt;&lt;span style="font-family: lucida grande;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family: lucida grande;"&gt;&lt;br /&gt;
And you'd read from it with just a "SELECT * FROM [Sheet1$]"
&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
If the sheet is named something else, you can just use the following to get the correct sheet name. &lt;a href="http://www.codeproject.com/KB/aspnet/getsheetnames.aspx"&gt;http://www.codeproject.com/KB/aspnet/getsheetnames.aspx
&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-3319265188452526184?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/3319265188452526184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=3319265188452526184' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/3319265188452526184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/3319265188452526184'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/05/reading-excel-files-from-net.html' title='Reading excel files from .NET'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-8473638005457017978</id><published>2009-02-26T09:39:00.001-08:00</published><updated>2009-02-26T09:46:27.816-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='submit'/><category scheme='http://www.blogger.com/atom/ns#' term='tags'/><category scheme='http://www.blogger.com/atom/ns#' term='control'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='input'/><category scheme='http://www.blogger.com/atom/ns#' term='safari'/><category scheme='http://www.blogger.com/atom/ns#' term='form'/><category scheme='http://www.blogger.com/atom/ns#' term='button'/><title type='text'>Styling buttons in safari with ease</title><content type='html'>&lt;span style="font-family: lucida grande;"&gt;I've always hated how Safari would style buttons (dorky rounded) instead of how everyone else would render them.  I found a site saying that having &amp;lt;button&amp;gt; tags would avoid this (over &amp;lt;input&amp;gt; tags), but .NET renders &amp;lt;asp.Button as a input.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: lucida grande;"&gt;There is a way to get .NET to render how you'd like, and it seems to work, &lt;/span&gt;&lt;a style="font-family: lucida grande;" href="http://www.delphicsage.com/home/blog.aspx/d=239/title=Convert_Your_ASPButton_Controls_to_Sliding_Doors_Styled_Button_Elements_"&gt;click here &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-8473638005457017978?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/8473638005457017978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=8473638005457017978' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8473638005457017978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8473638005457017978'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/02/styling-buttons-in-safari-with-ease.html' title='Styling buttons in safari with ease'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-8147109923734371307</id><published>2009-02-11T10:02:00.000-08:00</published><updated>2009-08-12T15:58:26.806-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='back'/><category scheme='http://www.blogger.com/atom/ns#' term='telerik'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='update'/><category scheme='http://www.blogger.com/atom/ns#' term='history'/><category scheme='http://www.blogger.com/atom/ns#' term='skipping'/><category scheme='http://www.blogger.com/atom/ns#' term='scriptmanager'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Ajax steps in browser history in .NET 3.5</title><content type='html'>&lt;span style="font-family: lucida grande;font-family:lucida grande;" &gt;.NET 3.5 has new functionality in the scriptmanager object to handle putting ajax "steps" in the browser history.&lt;/span&gt; &lt;span style="font-family: lucida grande;font-family:lucida grande;" &gt;
&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style="font-family: lucida grande;font-family:lucida grande;" &gt;By setting EnableHistory="True" you can add items to the &lt;/span&gt;&lt;span style="font-family: lucida grande;"&gt;history in your codebehind, and respond to them with OnNavigate (in scriptmanager)&lt;/span&gt;
&lt;span style="font-family: lucida grande;font-family:lucida grande;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: lucida grande;"&gt;The great thing about it is you can put in history items whenever you choose and respond to them how you would like, so the process of stepping back can make sense.&lt;/span&gt;
&lt;span style="font-family: lucida grande;font-family:lucida grande;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family: lucida grande;"&gt;Look at the code in this zip (with both version for plain .NET and using Telerik controls)&lt;/span&gt;
&lt;span style="font-family: lucida grande;font-family:lucida grande;" &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;a style="font-family: lucida grande;" href="http://drop.3203.com/ajaxhistory.zip"&gt;ajaxhistory.zip&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-8147109923734371307?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/8147109923734371307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=8147109923734371307' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8147109923734371307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8147109923734371307'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/02/ajax-steps-in-browser-history-in-net-35.html' title='Ajax steps in browser history in .NET 3.5'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-6441576310927517576</id><published>2009-02-06T14:29:00.000-08:00</published><updated>2009-11-29T09:16:16.539-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='ie'/><category scheme='http://www.blogger.com/atom/ns#' term='fonts'/><category scheme='http://www.blogger.com/atom/ns#' term='embedding'/><category scheme='http://www.blogger.com/atom/ns#' term='safari'/><category scheme='http://www.blogger.com/atom/ns#' term='eot'/><title type='text'>Font embedding</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;Ben R who is doing a site for us showed me how to embed fonts.  This can work directly for Firefox (3.1+) and Safari and with a little work for all versions of IE.


&lt;br&gt;&lt;br&gt;


Click &lt;a href="http://3203.jirofeingold.com/font.htm"&gt;here &lt;/a&gt;to see a page with embedded fonts (note, if you're using FF 3.0 and below you won't see anything).  View source to see how I did it.
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;


&lt;br&gt;&lt;br&gt;

&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;a href="http://www.spoono.com/html/tutorials/tutorial.php?id=19"&gt;Here &lt;/a&gt;is the tool you have to use for IE to create the embedded font (which is tied to the domain), it was pretty crashy on Vista, but since it was written many years ago that isn't a big surprise.  Supposedly this will work for versions of IE way back, I did have an issue with warning messages (just warning about temp use of a font) on a locked down version of IE6 on a server.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-6441576310927517576?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/6441576310927517576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=6441576310927517576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6441576310927517576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6441576310927517576'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/02/font-embedding.html' title='Font embedding'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-2064620730801913233</id><published>2009-02-05T10:46:00.000-08:00</published><updated>2009-11-29T09:27:48.207-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cells'/><category scheme='http://www.blogger.com/atom/ns#' term='pretty'/><category scheme='http://www.blogger.com/atom/ns#' term='regular expression'/><category scheme='http://www.blogger.com/atom/ns#' term='rows'/><category scheme='http://www.blogger.com/atom/ns#' term='lines'/><category scheme='http://www.blogger.com/atom/ns#' term='color'/><category scheme='http://www.blogger.com/atom/ns#' term='alternate'/><category scheme='http://www.blogger.com/atom/ns#' term='automatic'/><category scheme='http://www.blogger.com/atom/ns#' term='table'/><category scheme='http://www.blogger.com/atom/ns#' term='content'/><title type='text'>Pretty tables</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;I was wondering if I could make tables that were entered via a CMS have special formatting (alternating line color, custom header) without making the user entering the table via the CMS have to tag the rows or cells with classes.  And yes, Nate, these really are tables...
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;
So I thought I could use regular expressions to parse the content block and pull out tables, parse through the lines of the table and automatically set the class of the tr.  I was able to come up with some code to do this, and it seems to work pretty well.  Remember to put "using System.Text.RegularExpressions;" at the top of your file.
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;br /&gt;&lt;/span&gt;
&lt;a href="http://3203.jirofeingold.com/prettytable.txt"&gt;prettytable.txt&lt;/a&gt;
&lt;span style="font-family:lucida grande;"&gt;
&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;br /&gt;&lt;/span&gt;

&lt;span style="font-family:lucida grande;"&gt;An example?  This was a table with no formatting:
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;br /&gt;&lt;/span&gt;

&lt;span style="font-family:lucida grande;"&gt; &lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3203.jirofeingold.com/table-783673.png"&gt;&lt;img style="cursor: pointer; width: 165px; height: 204px;" src="http://3203.jirofeingold.com/table-783670.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-2064620730801913233?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/2064620730801913233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=2064620730801913233' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/2064620730801913233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/2064620730801913233'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/02/pretty-tables.html' title='Pretty tables'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-7995000412921299921</id><published>2009-01-23T14:08:00.001-08:00</published><updated>2009-01-23T14:12:27.322-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='viewport'/><category scheme='http://www.blogger.com/atom/ns#' term='zoom'/><category scheme='http://www.blogger.com/atom/ns#' term='display'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>iPhone/mobile view of website</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;I built in an iPhone/mobile view to our CMS, but wanted to have the content fill the screen on the phone when you went to it.&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;&amp;lt;meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/&amp;gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;This will present the content (if the content is formatted to be 320px wide) to fill the screen of the phone's browser.  Check out &lt;a href="http://www.overlandagency.com"&gt;http://www.overlandagency.com&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-7995000412921299921?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/7995000412921299921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=7995000412921299921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/7995000412921299921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/7995000412921299921'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/01/iphonemobile-view-of-website.html' title='iPhone/mobile view of website'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-8365128491184501611</id><published>2009-01-23T13:54:00.000-08:00</published><updated>2009-01-23T14:04:35.269-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='detect'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><category scheme='http://www.blogger.com/atom/ns#' term='browser'/><title type='text'>Testing for mobile browser</title><content type='html'>I've been looking for a .net version of some code to test to see if the user is viewing the site with a mobile browser. Here's what I came up with cobbled together from several references:
&lt;br /&gt;
&lt;br /&gt;public bool isMobileBrowser()
&lt;br /&gt;{
&lt;br /&gt;string strMKey = null;
&lt;br /&gt;
&lt;br /&gt;string strHttpAccept = null;
&lt;br /&gt;string strHttpUserAgent = null;
&lt;br /&gt;
&lt;br /&gt;strHttpAccept = Request.ServerVariables["HTTP_ACCEPT"].ToLower();
&lt;br /&gt;
&lt;br /&gt;strHttpUserAgent = Request.ServerVariables["HTTP_USER_AGENT"].ToLower();
&lt;br /&gt;
&lt;br /&gt;// User Agent is windows but not windows mobile?
&lt;br /&gt;if ((strHttpUserAgent.IndexOf("windows") &gt;= 0) &amp;amp;&amp;amp; !(strHttpUserAgent.IndexOf("windows ce") &gt;= 0))
&lt;br /&gt;{
&lt;br /&gt;return false;
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;// User agent matches one of these keywords?
&lt;br /&gt;string[] Key = new string[] { "up.browser", "up.link", "windows ce", "iemobile", "mini", "mmp", "symbian", "midp", "wap", "phone", "pocket", "mobile", "pda", "psp", "iphone" };
&lt;br /&gt;
&lt;br /&gt;for (int i = 0; i &amp;lt; Key.Length; i++)
&lt;br /&gt;{
&lt;br /&gt;if (strHttpUserAgent.IndexOf(Key[i]) &gt;= 0)
&lt;br /&gt;{
&lt;br /&gt;return true;
&lt;br /&gt;}
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;if ((strHttpAccept.IndexOf("text/vnd.wap.wml") &gt;= 0) || (strHttpAccept.IndexOf("application/vnd.wap.xhtml+xml") &gt;= 0))
&lt;br /&gt;{
&lt;br /&gt;return true;
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;if ((Request.ServerVariables["HTTP_X_WAP_PROFILE"] != null) &amp;amp;&amp;amp; (Request.ServerVariables["HTTP_X_WAP_PROFILE"].ToString() != ""))
&lt;br /&gt;{
&lt;br /&gt;return true;
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;if ((Request.ServerVariables["HTTP_PROFILE"] != null) &amp;amp;&amp;amp; (Request.ServerVariables["HTTP_PROFILE"].ToString() != ""))
&lt;br /&gt;{
&lt;br /&gt;return true;
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;if ((Request.ServerVariables["X-OperaMini-Features"] != null) &amp;amp;&amp;amp; (Request.ServerVariables["X-OperaMini-Features"].ToString() != ""))
&lt;br /&gt;{
&lt;br /&gt;return true;
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;if ((Request.ServerVariables["UA-pixels"] != null) &amp;amp;&amp;amp; (Request.ServerVariables["UA-pixels"].ToString() != ""))
&lt;br /&gt;{
&lt;br /&gt;return true;
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;// Check first four char from strHttpUserAgent
&lt;br /&gt;string[] M = new string[] { "acs-", "alav", "alca", "amoi", "audi", "aste", "avan", "benq", "bird", "blac", "blaz", "brew", "cell", "cldc", "cmd-", "dang", "doco", "eric", "hipt", "inno", "ipaq", "java", "jigs", "kddi", "keji", "leno", "lg-c", "lg-d", "lg-g", "lge-", "maui", "maxo", "midp", "mits", "mmef", "mobi", "mot-", "moto", "mwbp", "nec-", "newt", "noki", "opwv", "palm", "pana", "pant", "pdxg", "phil", "play", "pluc", "port", "prox", "qtek", "qwap", "sage", "sams", "sany", "sch-", "sec-", "send", "seri", "sgh-", "shar", "sie-", "siem", "smal", "smar", "sony", "sph-", "symb", "t-mo", "teli", "tim-", "tosh", "treo", "tsm-", "upg1", "upsi", "vk-v", "voda", "wap-", "wapa", "wapi", "wapp", "wapr", "webc", "winw", "xda-", "modu" };
&lt;br /&gt;
&lt;br /&gt;strMKey = strHttpUserAgent.Substring(0, 4).Replace(" ", "-");
&lt;br /&gt;
&lt;br /&gt;for (int i = 0; i &amp;lt;M.Length; i++)
&lt;br /&gt;{
&lt;br /&gt;if (M[i] == strMKey)
&lt;br /&gt;{
&lt;br /&gt;return true;
&lt;br /&gt;}
&lt;br /&gt;}
&lt;br /&gt;
&lt;br /&gt;return false;
&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-8365128491184501611?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/8365128491184501611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=8365128491184501611' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8365128491184501611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8365128491184501611'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2009/01/testing-for-mobile-browser.html' title='Testing for mobile browser'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-6937408677420085427</id><published>2008-10-24T14:02:00.000-07:00</published><updated>2008-10-24T14:03:54.107-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><title type='text'>SQL Server</title><content type='html'>Is the most overly complicated, hard to use, hard to setup program ever.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-6937408677420085427?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/6937408677420085427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=6937408677420085427' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6937408677420085427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6937408677420085427'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2008/10/sql-server.html' title='SQL Server'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-6099294631290267362</id><published>2008-08-07T09:36:00.000-07:00</published><updated>2009-11-29T09:22:36.625-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='w3c'/><category scheme='http://www.blogger.com/atom/ns#' term='images'/><category scheme='http://www.blogger.com/atom/ns#' term='alt tag'/><category scheme='http://www.blogger.com/atom/ns#' term='regular expression'/><category scheme='http://www.blogger.com/atom/ns#' term='alt'/><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='automatic'/><category scheme='http://www.blogger.com/atom/ns#' term='img'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='compliant'/><title type='text'>Automatically adding alt tags for images</title><content type='html'>So since being W3C compliant is supposed to help with search optimization I've always wanted to be able to automatically add alt tags to images that don't have them.  Since alot of the content on our websites is entered via a cms, we don't always have complete control over this.

&lt;br /&gt;&lt;br /&gt;


I've seen regular expressions that are supposed to detect img tags without alt tags in them, but couldn't get this to work the way I wanted it to.
&lt;br /&gt;&lt;br /&gt;



I think I've found a good solution to this.  I'm just using regular expressions to find all image tags, then going through a list of them, finding ones without alt tags, and then trying to process the src tag to come up with a guess as to what a good choice for the alt tag would be.


&lt;br /&gt;&lt;br /&gt;







Here it is, remember you've got to have (using System.Text.RegularExpressions;) at the top of the cs file

&lt;br /&gt;&lt;br /&gt;



&lt;a href="http://3203.jirofeingold.com/fixalt.txt"&gt;fixalt.txt&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-6099294631290267362?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/6099294631290267362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=6099294631290267362' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6099294631290267362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6099294631290267362'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2008/08/automatically-adding-alt-tags-for.html' title='Automatically adding alt tags for images'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-5144274446099164555</id><published>2008-06-18T08:49:00.000-07:00</published><updated>2008-06-18T13:41:32.303-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ff3'/><category scheme='http://www.blogger.com/atom/ns#' term='incorrect format'/><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='imagebutton'/><category scheme='http://www.blogger.com/atom/ns#' term='panel'/><category scheme='http://www.blogger.com/atom/ns#' term='telerik'/><category scheme='http://www.blogger.com/atom/ns#' term='radajax'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='defaultbutton'/><category scheme='http://www.blogger.com/atom/ns#' term='input string'/><category scheme='http://www.blogger.com/atom/ns#' term='firefox 3'/><title type='text'>ImageButtons that are DefaultButtons cause an error on Firefox 3</title><content type='html'>Ok, so suddenly with Firefox 3 I've been getting errors on some pages.  They have an ajax panel (from Telerik, but I've found out this happens with other ajax libraries) that wraps a asp:Panel (with default button set to) an asp:ImageButton.

&lt;br /&gt;&lt;br /&gt;
This works fine on all browsers.  Except Firefox 3.  It'll return an "Input String was not in a correct format."  It seems on loaded of some posted data it is expecting an Int and it is a String.
&lt;br /&gt;&lt;br /&gt;

I was stumped on this.  Taking out the ImageButton (and just having it be a regular button) fixed the problem.  Not making the ImageButton the default button for the panel fixed the problem.  Taking out the ajax wrapper panel fixed the problem.

&lt;br /&gt;&lt;br /&gt;
After banging my head on this for quite a while my coworker Del found the solution.  It turns out that there is a weird double post-back happening, leading to much confusion.  By adding:
&lt;p&gt;&lt;span style="color: rgb(255, 0, 0);font-size:85%;" &gt;OnClientClick&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);font-size:85%;" &gt;="this.disabled=true;__doPostBack(this.name,'');"&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);font-size:85%;" &gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;To the imagebutton and everything works.  The page that he found that talks about this is http://forums.asp.net/p/1121832/1757434.aspx which also gives some other solutions to the problem.   Here is another link http://www.andornot.com/about/developerblog/2007/09/fix-firefox-defaultbutton-issue-with.aspx
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);font-size:85%;" &gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Unfortunately, we'll probably have to go back to all of our old websites to find and fix this behavior (I've been able to reproduce it in many sites we've done that have been up (and bug free) for a while.  I don't think it is necessarily a firefox 3 issue, but has more to do with timing.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-5144274446099164555?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/5144274446099164555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=5144274446099164555' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/5144274446099164555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/5144274446099164555'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2008/06/imagebuttons-that-are-defaultbuttons.html' title='ImageButtons that are DefaultButtons cause an error on Firefox 3'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-8173274893502677632</id><published>2008-06-06T16:18:00.000-07:00</published><updated>2009-11-29T09:28:35.936-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='crop'/><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='automatic'/><title type='text'>Dynamic recrop of images</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;So this e-commerce site I'm doing has thousands of images. Some unfortunately were non-square and then placed centered on a white background, even if the predominant colors were darker. Going through all of these would be a nightmare production task.
&lt;br /&gt;&lt;br /&gt;
I wondered if I could programmatically detect these rectangular white regions, and replace them with a better chosen color. The problem is that some of the images are really on a white background, centered and shouldn't be touched.&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;I've written some code that comes in diagonally until it detects a pixel that isn't white is the next pixel. I then check a vertical and horizontal line from that point. If one direction is all white, I assume that it is a rectangular region. Same from the bottom right corner coming up. &lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;If one of these checks fail in both directions I bail. If I detect different orientations on the top and the bottom I bail. But if I detect horizontal or vertical stripes of white I then step in one pixel from all four "corners" and then average the color values. I then use this color to fill the white regions.&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;I know that certain shapes (peanut like) can screw up this calculation. Still the color chosen for the fill in that circumstance will be decent (and only fill white regions). Also some of the images have dithered edges, possibly throwing off the calculation. Still this seems to work pretty well.&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;Click &lt;a href="http://3203.jirofeingold.com/test.htm"&gt;here &lt;/a&gt;to see what I'm talking about. The first three images are a diagram of how the code looks at various images. The next items are the full size image, image resized (with border) without this dynamic cropping applied, and image resized with dynamic cropping applied.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-8173274893502677632?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/8173274893502677632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=8173274893502677632' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8173274893502677632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/8173274893502677632'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2008/06/dynamic-recrop-of-images.html' title='Dynamic recrop of images'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-2538301275249851652</id><published>2008-04-23T16:32:00.000-07:00</published><updated>2009-11-29T09:29:44.058-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='quality'/><category scheme='http://www.blogger.com/atom/ns#' term='dynamic'/><category scheme='http://www.blogger.com/atom/ns#' term='border'/><category scheme='http://www.blogger.com/atom/ns#' term='rescale'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='jpeg'/><category scheme='http://www.blogger.com/atom/ns#' term='resize'/><title type='text'>Adjusting images for image size/file size</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;I'm working on an ecommerce site and want to work from a single source image for the items.
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;Using some of the ideas I've talked about before I can resize the images on the fly, but I wanted to also set a maximum file size for the images (after all, if I'm making a 25x25 thumbnail, it shouldn't be over 5k)
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;I'm saving a memory stream as a jpg, and torquing down the Encoder.Quality setting until the stream is less than the number of bytes I'm trying to fit in.
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;This is working really well, check out &lt;a href="http://3203.jirofeingold.com/images.htm"&gt;this &lt;/a&gt;to see (I'm also adding rounded corners to the images)
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-2538301275249851652?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/2538301275249851652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=2538301275249851652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/2538301275249851652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/2538301275249851652'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2008/04/adjusting-images-for-image-sizefile.html' title='Adjusting images for image size/file size'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-5649027159381689853</id><published>2008-01-14T10:29:00.000-08:00</published><updated>2008-01-14T10:43:42.822-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='registration'/><category scheme='http://www.blogger.com/atom/ns#' term='download'/><category scheme='http://www.blogger.com/atom/ns#' term='cms'/><category scheme='http://www.blogger.com/atom/ns#' term='tracking'/><category scheme='http://www.blogger.com/atom/ns#' term='document'/><title type='text'>Tracking on click/mousover</title><content type='html'>&lt;span style="font-family: lucida grande;"&gt;I was asked to add tracking of downloads to the CMS I've written.  The problem is that people can insert links to documents anywhere in the content.  Also a landing page wasn't going to be acceptable, so the tracking would have to not interfere with the link still downloading the file.  This tracking would also have to put in the user if signed in.&lt;br /&gt;&lt;br /&gt;

By doing a text replace on the content for an "A" link that referenced the document directory I could programmatically insert an onclick event for the A that I had replace the background image of the link with the output of a page that I created that could do the tracking.  I later realized that I could just have javascript load the page and so didn't have to mess with the background image or have the page output anything.  Since this could also be done on mouseover/mouseout I could track even how long they hovered over a link even if they didn't click it.&lt;br /&gt;&lt;br /&gt;

This actually works amazingly well.  By passing "this.href" through I could also easily know which document they had clicked on.  I was a little worried about the href and onclick interfering with each other, but it seems to work fine on all browsers.&lt;br /&gt;&lt;br /&gt;

The on the fly replace trick is one I use for a very simple (and not very secure) files that require registration option.  I have the CMS allow for uploading files to a registration required directory and then search and replace on a links referencing files in those.  Again not secure at all, but most of the time the only reason these files are set up this way is to harvest leads.  This allows for files to be uploaded anywhere, and is easy to implement.&lt;br /&gt;&lt;br /&gt;

I used XMLHttpRequest to make the request for the page in javascript.

&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-5649027159381689853?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/5649027159381689853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=5649027159381689853' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/5649027159381689853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/5649027159381689853'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2008/01/tracking-on-clickmousover.html' title='Tracking on click/mousover'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-3401576323406300751</id><published>2008-01-04T10:21:00.000-08:00</published><updated>2009-02-19T15:55:07.588-08:00</updated><title type='text'>PNGs have driven me crazy</title><content type='html'>In the past.  Sometimes it seems like matching colors never quite works out right.  I'll always have to tweak colors to get things to look right, or jpgs and gifs placed right next to pngs don't match.  The same png would look different in two different browsers.

&lt;br /&gt;&lt;br /&gt;
I found the answer to this problem.  Photoshop saves extra meta information with 24-bit pngs (like gamma correction) which is applied differently by browsers.
&lt;br /&gt;&lt;br /&gt;

Here is an article all about it   &lt;br /&gt;&lt;p class="MsoNormal"&gt;http://freaksgfx.blogspot.com/2007/10/png-color-mismatch-on-web-easy-fix.html&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;and some useful info about the problem http://morris-photographics.com/photoshop/articles/png-gamma.html#remove
&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a href="http://www.polarbearlamps.net/2007/04/png_color_mismatch_on_the_web.html"&gt;
&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-3401576323406300751?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/3401576323406300751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=3401576323406300751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/3401576323406300751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/3401576323406300751'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2008/01/pngs-have-driven-me-crazy.html' title='PNGs have driven me crazy'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-6059301989961553534</id><published>2007-11-15T16:48:00.000-08:00</published><updated>2007-11-15T16:58:46.022-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='dymamic'/><category scheme='http://www.blogger.com/atom/ns#' term='viewstate'/><category scheme='http://www.blogger.com/atom/ns#' term='invalid'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='exception'/><category scheme='http://www.blogger.com/atom/ns#' term='controls'/><title type='text'>Why viewstate nearly killed me</title><content type='html'>&lt;span style="font-family: lucida grande;"&gt;I've been working for the last two months on a huge e-commerce site with a configurator of high-end gaming PCs.  (http://www.hp.com/blackbird) &lt;br /&gt;&lt;br /&gt;

Because of complex rules of component interactions I was loading the entire component set (even though it is displayed on seperate pages) and relying on viewstate to keep track of what was selected.  Because each selection could enable/disable any other as well as change messaging and force selection the logic to drive this was very complex.  The initial decision of a base model also determined the base feature set to work with.&lt;/span&gt;&lt;span style="font-family: lucida grande;"&gt;  All of the controls on the page would be dynamically created in the init function.&lt;br /&gt;&lt;br /&gt;

We started having sporadic invalid viewstate exceptions, with no consitent reproduction steps.  I tried compressing the viewstate (which was large, at 16k), making sure I wasn't loosing the session (and therefore the model selection) and then moving the entire viewstate into session.  Nothing seemed to work.&lt;br /&gt;&lt;br /&gt;

The problem seemingly came and went, several times we thought we had eliminated it but it would reappear.&lt;br /&gt;&lt;br /&gt;

The problem came down to how I was trying to optimize the data queries, and storing information in appdomain.  I had inadvertently stored some information that was model dependant in the application domain and if multiple people were choosing different models at the same time the viewstate would be different than the created list of controls.  Sometimes.  &lt;br /&gt;&lt;br /&gt;

Anyway after a week and a half of monkeying with the viewstate it turned out that the exception message was right and the list of controls was mismatched.&lt;br /&gt;&lt;br /&gt;

I'll put up another post with some of the other solutions I tried as well.
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-6059301989961553534?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/6059301989961553534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=6059301989961553534' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6059301989961553534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6059301989961553534'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2007/11/why-viewstate-nearly-killed-me.html' title='Why viewstate nearly killed me'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-693671311989956949</id><published>2007-11-15T16:40:00.001-08:00</published><updated>2007-11-15T16:47:56.660-08:00</updated><title type='text'>IE7 .NET and disabled radio buttons</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;Trying to have disabled radio buttons on a black background was hairy in .NET&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;

Because .NET puts them in spans and sets disabled="disabled" they were getting a white drop shadow.  Of course when you have radio buttons on a white background you don't notice this, but on a black background it was ugly.&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;

&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
Here is the javascript we used to strip the spans of the flag (and since the radio input itself was disabled, it still worked fine).  Thanks to Josh for coming up with the javascript.&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;

&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;var els = document.getElementsByTagName("span");&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;for(var i = 0; i&amp;lt;els.length;i++)&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;{&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;    els[i].removeAttribute('disabled');&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;}&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;
&lt;span style="font-family:lucida grande;"&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-693671311989956949?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/693671311989956949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=693671311989956949' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/693671311989956949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/693671311989956949'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2007/11/ie7-net-and-disabled-radio-buttons.html' title='IE7 .NET and disabled radio buttons'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-6781258405125140978</id><published>2007-10-04T16:54:00.001-07:00</published><updated>2007-10-04T17:00:56.842-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='usercontrol'/><category scheme='http://www.blogger.com/atom/ns#' term='telerik'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='mootools'/><title type='text'>Ajax, Telerik and mootools ouch</title><content type='html'>&lt;span style="font-family: lucida grande;"&gt;I &lt;span style="font-family: lucida grande;"&gt;was having massive problems with getting javascript (to control mootools) to correctly work with calls set up through a Telerik Ajax Panel.

I was doing the trick of populating &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: lucida grande;"&gt;&lt;span style="font-family: lucida grande;"&gt;(serverside) &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: lucida grande;"&gt;&lt;span style="font-family: lucida grande;"&gt;a literal  on the page with the javascript I wanted to execute, but I wasn't getting the javascript to be evaluated.  I was sure I have gotten this to work in situations in the past and realized that the reason the javascript I was injecting wasn't being evaluated was because the literal was on the page itself and not in a user control.  Pulling everything into a user control allowed the injection trick to work (and the javascript to be evaluated.)

Makes sense when I thought about it, but I thought I'd write it down in case anyone else has the same problem.
&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-6781258405125140978?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/6781258405125140978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=6781258405125140978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6781258405125140978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/6781258405125140978'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2007/10/ajax-telerik-and-mootools-ouch.html' title='Ajax, Telerik and mootools ouch'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12688691.post-4619409046989943847</id><published>2007-09-07T09:13:00.000-07:00</published><updated>2009-11-29T09:32:09.001-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='custom'/><category scheme='http://www.blogger.com/atom/ns#' term='image'/><category scheme='http://www.blogger.com/atom/ns#' term='fonts'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='render'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Simple font renderer</title><content type='html'>&lt;span style="font-family:lucida grande;"&gt;Alright, I've gotten some requests for the actual code to render fonts and so I've made a zip with a simple project in it.

This will work fine for simple things, but I recommend using the javascript trick I reference in another post to not hurt search rankings.

&lt;/span&gt;&lt;a href="http://3203.jirofeingold.com/text.zip"&gt;text.zip&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12688691-4619409046989943847?l=blog.3203.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.3203.com/feeds/4619409046989943847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12688691&amp;postID=4619409046989943847' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/4619409046989943847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12688691/posts/default/4619409046989943847'/><link rel='alternate' type='text/html' href='http://blog.3203.com/2007/09/simple-font-renderer.html' title='Simple font renderer'/><author><name>Jiro Feingold</name><uri>http://www.blogger.com/profile/14681855913248753444</uri><email>jiro.feingold@gmail.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='08092338274577586105'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>