tag:blogger.com,1999:blog-81027232024-03-06T02:37:34.107-06:00Pettijohn.comTravishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.comBlogger323125tag:blogger.com,1999:blog-8102723.post-66090106080701210072012-10-21T00:50:00.001-05:002012-10-21T00:50:18.716-05:00The Future of Digital Cameras<p>In the past couple of years, heralded by the iPhone 4, cameras in smart phones have begun producing images that are “good enough.” An old photographer adage says that “the best camera is the one you have with you,” and our mobile phones now produce photos that are as good as entry-level point-and-shoot cameras.</p> <p>Thus smartphones are eroding the point-and-shoot camera market. </p> <p>This is a good thing: it’s forcing camera manufacturers to step up to compete. If a consumer is going to buy a camera, it needs to produce a considerably better image than the camera they already have in their pocket on their phone. Many people choose DSLRs for their “real” camera, and just use their mobile phone for their “everyday” camera.</p> <p>A new race is underway: bigger sensors and better optics in smaller packages. Sony is leading the way with their niche $2800 <a href="http://www.theverge.com/products/cyber-shot-rx1/6122">Sony RX1</a> camera, a 35mm fixed camera with a full-frame sensor. </p> <p>Recently I picked up their more palatable $600 <a href="http://www.theverge.com/products/cyber-shot-rx100/5749">Sony RX100</a>, a pocket-sized point and shoot with a sensor considerably larger than any other similarly-sized camera on the market. Along with full manual controls, it’s capable of producing images that are best in class. Two images from the RX100 are below, the second being a 100% crop.</p> <p>This trend is sure to continue. Bigger sensors and better optics in smaller packages. Leave the bulk of a DSLR behind and embrace the future. </p> <img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgL9T5pRQm9jeRfIcXmjzTvifNticKO1V-MSJsfsaGe5ylok_9umJLsh_lwsNm_cNzoR4xRy5PE4WF2EOYe3Hr-K8tcOdEzUDWxjmCuufSufEvKX5V0RJ-p2rRcqlcuMgEAy-q7/?imgmax=800" width="646" height="433"> <p><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://lh4.ggpht.com/-VESLiIslxKs/UIONFyi9ULI/AAAAAAAAAzg/T-tIzpS3vdA/image%25255B13%25255D.png?imgmax=800" width="646" height="433"></p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-43197513585741734072012-07-30T02:27:00.001-05:002012-07-30T02:50:40.538-05:00Premature Optimisation<p>For over a year in 2008 through 2010, I led a performance optimisation effort of a small team at a very large client on a shockingly complex e-commerce solution. We profiled the codebase, optimised the environment, implemented code optimisations, and worked to get them in our test environments.</p> <p>One lesson that stands out from that is that you should never optimise code without evidence that it is a bottleneck. Run a profile, analyse the hot-path, and then (most likely) cache the result of the operation or find a smarter algorithm to accomplish the same task. </p> <p>I had a colleague on my current project raise a concern about the performance of UTC to Local time conversion. I dismissed it as arithmetic, but he persisted. So we tested it and measured it at our volume as taking 34 milliseconds. For some applications that might be a concern, but not for ours. </p> <p>Bottlenecks usually involve moving data over a network, or naïve algorithms that are <strong>O</strong>(c^n) or <strong>O</strong>(n!) on moderate to large datasets. (Remember that in-memory Linq statements are really just expressive foreach loops, I’ve been burned by that before.)</p> <p>In general, however, it’s best to write <em>readable and maintainable code</em>. Hacking an algorithm because you think it might be slow (like worrying about time zone conversion) is a poor reason to make a decision on how to design your solution. Gather some evidence. Premature optimisation is the root of all evil. </p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com3tag:blogger.com,1999:blog-8102723.post-73365334064787069022012-07-18T07:37:00.000-05:002012-07-18T07:37:08.531-05:00Self-Driving Cars, Taxis, and RentalsA prediction about the future, 2017 or 2020 or so:<br />
<br />
I'll be able to pull out my smartphone and order a self-driving car. It will come to my GPS location and pick me up. In the event that it's a busy street and the car is non-obvious, my phone will alert me that the car has arrived. This is much like ordering a taxi today by phone, with the added advantage that no one can steal it en route. I'll tap my phone on the door to unlock it with NFC. After I ordered it with my smartphone and was waiting for the few minutes for it to come and get me, I entered my destination into the same smartphone app. The car takes off immediately. When I'm done, I tap out with NFC again, and that's it. My account is charged for the trip. It will probably work like most toll and transit passes where they deduct from a small pre-paid balance and it auto-recharges.<br />
<br />
In this world, easily-ordered self-driving cars will replace taxis, shared car services and rental car companies. Why go through the hassle of booking a time slot in the shared car and worry about getting it back on time when it's just as cheap to order a self-driving car? Not to mention driving! Driving is so...pedestrian...so 2012.<br />
<br />
Self-driving taxi/shared cars like this will finally be the killer app for full electric cars. These self-aware cars will drive themselves home when the battery is low.<br />
<br />
They'll also be a death blow to something like 80% of car ownership. It will be pointless for people in big cities to own cars since borrowing one will be effortless and much more economic and efficient. These same fleet companies will offer discount long-term rates for road trips and holidays.<br />
<br />
At first a few players will compete with proprietary systems. Some five years after, the marketplace will standardise, and these cars will become an interchangeable commodity. Governments will step in and run them as "public transit." Luxury brands will come in so that elitists don't have to share cars with the rest of us.<br />
<br />
Or so I hope. This on the news that <a href="http://www.wired.com/autopia/2012/05/sb-1298-autonomous-car/">California has recently legalised self-driving cars</a>.Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com1tag:blogger.com,1999:blog-8102723.post-70538945359922085782012-07-17T20:09:00.003-05:002012-07-17T20:14:12.668-05:00Managing Powershell Profile.ps1 with SkyDriveI use SkyDrive to sync pretty much all of my data (I was an early adopter and so they gave me 25GB free). SkyDrive lives at $home\SkyDrive, and my Powershell Profile.ps1 lives at $home\Documents\WindowsPowerShell\Profile.ps1.<br />
<br />
To manage it, I created a folder named $home\SkyDrive\Documents\WindowsPowerShell and used mklink to create a symbolic link (yes, NTFS supports symlinks). Start cmd.exe as an Administrator:<br />
<br />
<code>cd \users\username\Documents<br />
mklink /D "WindowsPowerShell" "..\SkyDrive\Documents\WindowsPowerShell"</code><br />
<br />
Now I can keep my profile and various modules & utilities (notably PSCX and git-tfs) in my Powershell folder and roam from machine to machine. Bliss!Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-68115829765679736722012-06-08T01:46:00.001-05:002012-06-13T19:27:24.253-05:00Windows 8 Hardware<p>Last week at Computex, we saw a number of new hardware devices taking advantage of the new touch capabilities in Windows 8. From <a href="http://www.theverge.com/2012/6/5/3067005/touchscreen-asus-zenbook-prime">touchscreen ultrabooks</a> to <a href="http://www.theverge.com/2012/6/4/3062279/asus-tablet-810-windows-8-tablet">transformers</a> to <a href="http://www.theverge.com/2012/6/4/3062351/msi-slider-s20-ultrabook">sliders</a> to the craziest PC I’ve ever seen, <a href="http://www.theverge.com/2012/6/4/3062240/asus-taichi-computex-announcement-pictures">the Taichi, which has two full HD screens</a>, one on either side of its lid. All this choice begs the question: what use cases do I hope to achieve with this hybrid desktop/touch OS/hardware future? </p> <ul> <li>Software development, my livelihood. I typically have 30+ windows open at once, heavy multitasking, highly keyboard driven. </li> <li>Heavy email & presentations. Again, tied to my livelihood. A physical keyboard is desirable.</li> <li>Note taking. I use paper notebooks (my favourite is a <a href="http://refer.ly/aaBq">Moleskine Cahier, Large Squared</a>) and <a href="http://refer.ly/aaBK">OneNote</a> extensively, but they’re separate. I remember in 2007 fantasizing about a “OneNote Extender” that had an active digitiser (pen input), a screen based on colour e-ink and a battery that lasted all day. My great dream of OneNote everywhere may be nigh at last. </li> <li>Media consumption. Movies, music. I’d love built-in WIDI or WHDI so that I can have a second display that’s not physically connected. Fire up a movie, flick it to the second screen, and continue computing on the laptop, wirelessly.</li> <li>Business needs. A TPM and fingerprint reader will make my life easier and protect any sensitive client data. </li> <li>Photo and video editing</li> <li>Web browsing / Facebook / Twitter / Online shopping</li> <li>Reading (replace Kindle?)</li></ul> <p>So those are the use cases, but what about hardware? I typically prop my laptop up on a stand and plug in an external keyboard and mouse anyway (my favourites are <a href="http://refer.ly/aaBs">Cherry MX-based keyboards</a> and <a href="http://refer.ly/aaB6">Logitech trackballs</a>), so a slate with an <a href="http://refer.ly/aaBJ">iMac-esque</a> desktop dock could be very nice. Leave the stand/kb/mouse/charger waiting at home, and tote <em>just </em>the slate when you’re out and about. A transformer could fit this bill too.</p> <p>Another related option is something small, like a 7” slate that also plugs into a dock, this time with a touchscreen display. </p> <p>Or split them into two: a workhorse laptop for my livelihood (a la the new <a href="http://refer.ly/aaBt">MacBook Pro</a>…I just wish that Retina display was a touchscreen) and a media-consumption & note-taking Windows RT device. I’d love something about the same size as my Moleskine (would equate to a 7 or 8” screen) with incredible battery life and pen input. My fingers are crossed for Nokia to deliver something great here. </p> <p>Decisions, decisions. It’s hard to predict what use cases and hardware options will win me over in the coming months. </p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com1tag:blogger.com,1999:blog-8102723.post-73924733088004039242012-04-16T07:23:00.001-05:002012-04-16T16:37:30.125-05:00My next mobile is an HTC One X<p>It’s no secret that I’ve historically been a consumer of Microsoft’s <a href="http://www.pettijohn.com/2012/01/personal-cell-phone-timeline.html">mobile devices</a>, their <a href="http://www.pettijohn.com/search/label/silverlight">development platforms</a>, and their <a href="http://www.pettijohn.com/2011/05/performance-testing-azure-dev-fabric.html">cloud services</a>. And so it may come as a bit of a surprise that today I ordered an HTC One X, running Android 4.0, Ice Cream Sandwich. </p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivzy67k6TZI6LnvE8wvA6bJBLIq9DQmUj_wSvSeUB91NzUTxYLMWtCG6kZ6o3Et-mkMSOWDqQCzn_ws4h6IyiC5mX_iOQ2Rh8sqJsXKGFPjduS7bI654h3ajUwZ-2BjJ7-4bu1/s1600-h/htc-one-x-press%25255B3%25255D.jpg"><img title="htc-one-x-press" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="htc-one-x-press" align="left" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyDgjH2cClCRJfxeuc3ubrRquVLF0Q5VN08mCbCMDFBidurx89GI6jiMcCTnv9jbsmsieQtEeKaaT0gVwu6LBuMcUk4El6D3Bb5uuJgmNKKJncjNHFB_jcdweo9q4Ilo0kcoWr/?imgmax=800" width="240" height="181"></a>As my last phone was a Samsung Focus running WP7.5 Mango, it’s a departure from my comfort zone, but an experiment I really want to try. I have a lot of time and technology invested around the Microsoft stack: I use Live Mesh, store a bunch of documents in Sky Drive, have a Zune Pass, use Office, and have a corporate Exchange account for email. Zune on Windows is the most beautiful piece of software possibly ever, and its subscription music service is one of the best. I don’t do heavy Office work on the phone, but I use OneNote all the time for jotting things down (book or movie recommendations from friends, for example) and making shopping lists on my PC and effortlessly syncing it over the cloud. I keep a workout journal in Excel, but have only used Word or Powerpoint for viewing stuff from my colleagues. </p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDxwurOnsaSzZTdz3Judcg-sRQ6HG41NBkSw2_5bodvEh5G_miL85qadfktRVh2XmRfQsvnk1qPkTTX6Zv_nScfQmUIzOiUS1D75I0B8VWpsuVjDAkiHZCEj53Q2z4toj7qXBj/s1600-h/tech_nokia_lumia_900%25255B3%25255D.jpg"><img title="tech_nokia_lumia_900" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: right; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="tech_nokia_lumia_900" align="right" src="http://lh6.ggpht.com/-AA3GSBZX2P4/T4wPUwZGiwI/AAAAAAAAAwU/70aaBTkah4A/tech_nokia_lumia_900_thumb%25255B1%25255D.jpg?imgmax=800" width="240" height="240"></a>I’ve been waiting for the Lumia 900 (in Cyan) since it was announced four months ago at CES. It’s making a splash in The States, but hasn’t been announced in Australia and I’m getting sick of waiting. It’s beautiful, and in my opinion the most striking piece of industrial design in the mobile market right now (the One X is my second favourite, and the iPhone 4 is my third—but really the iPhone only loses marks for sticking to their 4:3 aspect 3.4” screen and leaving all that dead space on the front). </p> <p>And when I say “sick of waiting,” I don’t just mean this device. I want a bigger display, and I want it in high PPI retina territory: WP7 only supports one resolution, 480x800, and that’s that, no matter if it’s a 3.4” screen or a 4.7” screen. “Wait for Apollo,” we hear, “it will support dual core processors, NFC and more screen resolutions.”</p> <p>Not that specs are all that important; WP7 is incredibly well optimized to run on low-end hardware, so for most practical purposes it runs as well on a single core as Android does on a quad core. What I do care about in specs where the One X has an edge is a beautiful screen. HTC One X has <a href="http://www.theverge.com/2012/4/2/2919202/htc-one-x-review">the best display on the market</a>, says The Verge. 720p, 4.7”, IPS LCD, "near-perfect 180 degree viewing angles and perhaps the most accurate color reproduction.” Damn, I want that in my pocket. </p> <p>I’m sick of waiting for Skype. But again, it’s not just that one app (although Microsoft bought Skype 11 months ago and STILL no full-featured WP7 app?), it’s representative of WP7’s rank in the market: tons of apps are only for iPhone and Android. It’s that Adobe Reader has been buggy from day one and seen zero updates. I don’t think this really will affect my life, since about the only apps I use on my phone are a stopwatch, a weather app and LastPass. WP7 has done a phenomenal job of building out the base capability of the OS to include key Twitter and Facebook scenarios making those apps largely unnecessary, plus Sky Drive support eliminating the need for a Dropbox. Their “people first” tag line is true, and I love the way contacts are always up to date with their various statuses and photos. “Wait for it to catch on a little more, it’s a long game to build market- and mindshare.”</p> <p>And so I’ll wait. I’ll wait for Apollo, and hopefully this One X will tide me over. I had my turn with iOS; it has a great ecosystem but I always felt locked in and restrained in how things work (the way Apple broke backwards compatibility with iPod docs and require Apple-approved accessories lest they disable them in software really steam me). But that’s me, I’m a software developer who makes a living on Microsoft, I have different expectations of how a computer should suit me. I don’t know how I’ll like Android, but when I read <a href="http://www.theverge.com/2012/4/3/2921472/lumia-900-review">The Verge’s review of the Lumia 900</a>, it makes me question what I’m missing: death by a thousand cuts, they say. So let’s see what all the fuss is about, shall we?</p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-69321771581204621262012-01-03T23:05:00.002-06:002022-04-25T18:51:15.302-05:00Personal Cell Phone TimelineFor the sake of nostalgia, a trip down cell-phone memory lane.<br />
<br />
c.2000: <a href="http://en.wikipedia.org/wiki/Nokia_8210">Nokia 8260</a>, in blue. My first phone ever. What a great, little, itty-bitty feature phone. Not entirely sure of the carrier or model number, but I’m picking 8260 since Cingular/TDMA seems right.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMABSozaBkLKs2vIvCedfhkY4TV2bFCwm127QcD8iibMBDRs1dQ-jbJizH9kluAmKOG21PrxOfAVIgsfX2IbC7CAhygXn4Nzi3OcwR3dkg9QcsMuXBGa0pg5pVghg1AST70oki/s1600-h/Nokia8260%25255B4%25255D.jpg"><img alt="Nokia8260" src="http://lh6.ggpht.com/-lFyJdmipIdY/TwPr3CZycjI/AAAAAAAAAqg/jW7Nm1Tjibk/Nokia8260_thumb%25255B2%25255D.jpg?imgmax=800" height="240" style="display: inline;" title="Nokia8260" width="124" /></a><br />
<br />
<br />
c.2002: Ericsson T62U. I remember it being comfortable to hold. Cingular, TDMA/GSM both I think. Not entirely sure of the model number but the photo is correct, and the fact that <a href="http://en.wikipedia.org/wiki/GAIT_(wireless)">Cingular offered it as a bridge device</a> is convincing.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBFZcGP1qHWqIQM1gYVY7OhBq2Zd-nDx1SFGBuO0m0kTtefEzY7dw1soezZ068fpM14d4LJPLwKl8fEe5KSfBPEIhZyc0cSRr5qyq003K-4N4ZYHAjDtGeuPTjy1nx_qCdIWWs/s1600-h/Ericsson%252520T62U%25255B5%25255D.jpg"><img alt="Ericsson T62U" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjL_svEgANFwQ-aLs0lEQQYF3RABEFINk2S48OrMs-V6Moyn7huG9pD4jr7SKu5qThqQWE0hRs-XHFShdUvcto-W2mnnKCn-M2GSloDDtwySatvVeqYbgDFR5cjO_shnK-F7OsC/?imgmax=800" height="240" style="display: inline;" title="Ericsson T62U" width="112" /></a><br />
<br />
c.2004: Motorola V400 Camera Phone. Cingular GSM. I actually forgot I owned this phone and never would have remembered the model number had I not found an old email from when I sold it on eBay.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg73dVoUHGmALjXrn-FwkPC3t0BnRcD92IbOdjIG5LBkOhk0C3TQQnElYEpfWbpGrln8FWXM3MG4L6xqxjeFkXIjA53ZdPrJIbnXTwaoKyfIzH9vHm6DI1ljEjDx5APmvl9v6iE/s1600-h/Motorola%252520V400%25255B9%25255D.gif"><img alt="Motorola V400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFv5B6EZ-1xvwn1XN-Mzpy0QsnwRQnVYncq1Z3hc74JMM6vGp7A6GXlckIe9Uy9zPb76dpqOxolkHVtZogJTB8vPT5TAB4gIH9_0T0yyckvUVwsugKPhJ33B0XaHSyeBFeTg6w/?imgmax=800" height="240" style="display: inline;" title="Motorola V400" width="174" /></a><br />
<br />
<a href="http://www.pettijohn.com/2005/06/audiovox-smt-5600.html">2005</a>: Audiovox SMT5600. My first smart phone, running Windows Mobile 2003. T-Mobile GSM. I still have this phone; it’s SIM-unlocked. Not all of the buttons still work reliably, but hey, in a pinch, it can dial a number. Supported voice turn-by-turn nav with a Bluetooth GPS unit (GlobalSat BT-338) and (now defunct) software called Mapopolis. What a great device.<br />
<a href="http://lh5.ggpht.com/-sz8s7oDtDnE/TwPr8aPY9XI/AAAAAAAAArI/Hvso0sPHjB4/s1600-h/audiovox-smt5600%25255B3%25255D.jpg"><img alt="audiovox-smt5600" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-BgU6F2C7VsEdOzj0xhQ5u2aEiu1tjz7Uy2UF0YHPNoxPt9UDPnbG3V961icOIQWO0nEgsIQgGr2ATc7TrAhmapXDh4Lw6jmLitCCEYeA70AeN-TAV8FHYOeLKQp69p59Ourx/?imgmax=800" height="240" style="display: inline;" title="audiovox-smt5600" width="113" /></a><br />
<br />
<a href="http://www.pettijohn.com/2006/11/t-mobile-dash-and-media-center-goodness.html">2006</a>: T-Mobile Dash. Awesome phone. Great keyboard. Proprietary <a href="http://www.pettijohn.com/2006/11/diy-t-mobile-dash-headphone-adapter.html">HTC headphone jack</a> (jerks). <br />
<a href="http://lh6.ggpht.com/-XKSaEeolKI8/TwPr-i1E7LI/AAAAAAAAArU/qffdCwj5eqw/s1600-h/tmobile-dash_xl%25255B3%25255D.gif"><img alt="tmobile-dash_xl" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinJfr5xaQIdIc0KNOxRFo-vHisoKaqchAdk1G5hBOyyTSQlH-dE0W7_5KFGxoyC2SrIRC_9MSAS9RSXP4U_zvAQrzKgPNAEoyisEYqyPHRBPn6y4criaW4Jq70UoqhZ97GSJsO/?imgmax=800" height="240" style="display: inline;" title="tmobile-dash_xl" width="148" /></a><br />
<br />
<a href="http://www.pettijohn.com/2007/10/goodbye-t-mobile-hello-sprint.html">2007</a>: HTC Mogul. Sprint. Giant brick slider, but boy was its data connection <em>FAST </em>for the time! I remember getting like <a href="http://www.pettijohn.com/2007/08/in-car.html">20X data speeds for half the price of T-Mobile</a>. Keyboard flaked out by the end of its life. <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnYazilVBIztvtBSXcomLQgz9OnUgyoqj73zIUgFfXC_Jr_BFV5WK9-kIJodcW6FOTsrz_-fFRCDe-SsjRNLd_2BiWgwPBWCqisbzY746OGXpJb6Vf-RHRqIuSRbhHsy2kd-4L/s1600-h/Sprint-Mogul-CDMA-PDA-phone%25255B3%25255D.jpg"><img alt="Sprint-Mogul-CDMA-PDA-phone" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAMnIp1Swr3MyrUMbymYoiD64b7fWywH7Kujyf95qmE3g4om7ZvWRokN_T6AkE7hcS-iu4y6ra4AqKkeCDJmQvuUqcA8kg1IGtIGkIECKrmqM1dfygBZ_tRr9AjC6_sqR3buXA/?imgmax=800" height="199" style="display: inline;" title="Sprint-Mogul-CDMA-PDA-phone" width="240" /></a><br />
<br />
<a href="http://www.pettijohn.com/2008/10/htc-diamond.html">2008</a>: HTC Touch Diamond. Sprint. Sleek, small, sexy phone with a soft-touch maroon back. Pretty nice skin on WinMo. <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdZifW7DisDJ58SGFmcINtcoQEuOwN6roMTiG4j6oNiZyf1BMrVNTQrhTlUsrp5YDwFiDc2jI9fbfZruFvPJHG8kj3RH-nZ1Hoqo_JWZVXSangeJgp3__Kmap95_2fiCR1FJrW/s1600-h/htc-touch-diamond-sprint2%25255B3%25255D.jpg"><img alt="htc-touch-diamond-sprint2" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEtyNdVTj_J9rFG6Y4m0WkpEiB2YTCw-q8ItX5s5gVIfSPRuDSSy6rnEBfbtYQOZkezDfcLH0T7xEv9_Hz-Zgdm2XtHNHAKcPrqWCQLkl2nXO59XTzFb34rBtqv3CwUsuR-r31/?imgmax=800" height="240" style="display: inline;" title="htc-touch-diamond-sprint2" width="132" /></a><br />
<br />
2009: iPhone 3GS. A very nice phone, especially once jailbroken. <br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe87SwVNtnu5zFOIaYniBilJVliY13MX_e6AWslnjsSwyB32LbPwg_G0Vb16qR_EZOwbOyJCZzRBNi2yp2U4oxvh7MIGBoYmzksm-tg_doVe2smJaj7cwuanOBXYxY3zI_xaE1/s1600-h/iphone-3gs%25255B3%25255D.jpg"><img alt="iphone-3gs" src="http://lh3.ggpht.com/-Eryu2rOjtiw/TwPsEP5zZPI/AAAAAAAAAsM/SoG_HhPcDZo/iphone-3gs_thumb%25255B1%25255D.jpg?imgmax=800" height="240" style="display: inline;" title="iphone-3gs" width="240" /></a><br />
<br />
2010: Samsung Focus (i917) / WP7, WP7.5.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9eIrOjvjymxLF1UJVPZmipjuZOgZ9-VqA_V4bygqSyfF2UteTiHaz8dxPD2Ti8ENimWlr7ZywbdkMKi7RYjg94FIPArLaBUdZD_O2ivpXDRKvBBt-9xCnwAiNHZmN30XWF5dw/s1600-h/samsung-focus-1%25255B3%25255D.jpg"><img alt="samsung-focus-1" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMQOmZBrrYeJMLUyS2CcdVCnF3Dfmim8xczoKe5VI67Q7ZZ7oS_6LcfXVWAumoJNdwo8ipwiEUkeBG5S6C2Rxg9GzrjtL344PXsy-GA1cPdlxmeBtOcwnGweiUsWl1-T68uCMm/?imgmax=800" height="240" style="display: inline;" title="samsung-focus-1" width="134" /></a><br />
<br />
2012/April: HTC One X. <a href="http://www.pettijohn.com/2012/04/my-next-mobile-is-htc-one-x.html">Gave up waiting for Microsoft</a>. Loved the graceful curve of the body, and it had the most perfect display I'd seen probably ever at that point in time. The slipshod UI turned me off. I blamed Android but retrospectively I suspect it was HTC I should have blamed. <br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ-q4TadqgCvfc-n3RNnlFIn9XBHL1TOT24CBe5-lHWuBBH4RBUo31v5PXLhgKSME8s9qbZlu29Ofd_bRfEnSGcIfSIKPWbmz9oihAt9sUXAyQeyLhLRPi2zX7naxA0BaVmeOt/s1600/htc-one-x-white.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ-q4TadqgCvfc-n3RNnlFIn9XBHL1TOT24CBe5-lHWuBBH4RBUo31v5PXLhgKSME8s9qbZlu29Ofd_bRfEnSGcIfSIKPWbmz9oihAt9sUXAyQeyLhLRPi2zX7naxA0BaVmeOt/s1600/htc-one-x-white.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ-q4TadqgCvfc-n3RNnlFIn9XBHL1TOT24CBe5-lHWuBBH4RBUo31v5PXLhgKSME8s9qbZlu29Ofd_bRfEnSGcIfSIKPWbmz9oihAt9sUXAyQeyLhLRPi2zX7naxA0BaVmeOt/s1600/htc-one-x-white.jpg" height="236" width="320" /></a></div>
<br />
<br />
2013/May: Nokia Lumia 920. Lord what a beast. Big, heavy, outstanding camera, could (and did) take a beating. WP8 really started feeling like a "finished" OS.<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZlI5NpXUBC89Gl2GWrLZslzskXR0SK6Qw7EvuwvPNNVjypM8mX4eMI0xZR6RjOHSzfSq9j9fQrAVcqAaMtdqQp6_rReMLvcFu_i_zwQJoDUq152OA89VOwGa2C1qXhid0pcfc/s1600/20130220023338_lumia_920_red.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZlI5NpXUBC89Gl2GWrLZslzskXR0SK6Qw7EvuwvPNNVjypM8mX4eMI0xZR6RjOHSzfSq9j9fQrAVcqAaMtdqQp6_rReMLvcFu_i_zwQJoDUq152OA89VOwGa2C1qXhid0pcfc/s1600/20130220023338_lumia_920_red.jpg" height="320" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
2014/April: Lumia 925 with Windows Phone 8.1. The svelte version of what the 920 should have been been, with Redmond's most competitive mobile operating system to date. "Cortana, remind me to update my blog this evening."</div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCTdY5XTQ7Of9nI2CjD_nnYddiWORIK0c5Bcu3NLRQeA0Cioogsp2Ho0BhfGK3TNMn1zwgE0nb-CcFZutlW2LGBqoULMXNiYfP1UJD9ncSEdrpMjy4O44Ynq2SuAVcHaPvqiaT/s1600/Lumia-925-benefit-6-1500x1500-jpg-700x700.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCTdY5XTQ7Of9nI2CjD_nnYddiWORIK0c5Bcu3NLRQeA0Cioogsp2Ho0BhfGK3TNMn1zwgE0nb-CcFZutlW2LGBqoULMXNiYfP1UJD9ncSEdrpMjy4O44Ynq2SuAVcHaPvqiaT/s1600/Lumia-925-benefit-6-1500x1500-jpg-700x700.jpg" height="320" width="320" /></a></div>
<br />
<br />
<br />
<ul>
<li>2014 / 2015 - Moto X, with a very cool leather back (no case needed). Short lived phone. The Stagefright vulnerability knocked it off the work network, it took months to patch, and only lasted a few days back on the work network after getting patched. What a shame.</li>
<li>2014 / 2015 - iPhone 4c - backup phone while waiting for Moto X to get patched.</li>
<li>2016 / 2017 - iPhone 6 - since Android was useless at work, I gave up and got the latest and greatest iPhone. </li>
<li>2017 - 2018 - Google Pixel.</li>
<li>2018 - 2021 - Google Pixel 3.</li>
<li>2021 - present - Samsung Galaxy S21 Ultra. Pretty good take on Android, though I would prefer stock. Also wish the phone had a place to stick the pen.</li>
</ul>Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com1tag:blogger.com,1999:blog-8102723.post-43351161502626329482011-12-17T17:07:00.000-06:002011-12-17T17:31:03.605-06:00Convert Mac Pages to HTML in Powershell<code><br />
<span class="Apple-style-span" style="background-color: white; color: green; font-size: 12px; line-height: 14px;"># A very crude Mac Pages to HTML converter in Powershell</span><br />
<span class="Apple-style-span" style="background-color: #f8f8f8; color: green; font-size: 12px; line-height: 14px;"># Preserves no formatting save for line breaks.</span><br />
<span class="Apple-style-span" style="background-color: white; color: green; font-size: 12px; line-height: 14px;"># Useful to extract the text so you can paste into Word</span></code><br />
<code><span class="Apple-style-span" style="color: green;"><span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"># A .pages file is a Zip; extract it to get the index.xml file </span></span></code><br />
<code><span class="Apple-style-span" style="color: green;"><span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"># and parse out the paragraphs. </span></span></code><br />
<code><span class="Apple-style-span" style="color: green;"><span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"># Note there's also a preview.pdf in the zip if all you need is to print.</span></span> <br /><span class="Apple-style-span" style="background-color: #f8f8f8; color: green; font-size: 12px; line-height: 14px;"># </span><br />
<span class="Apple-style-span" style="background-color: white; color: green; font-size: 12px; line-height: 14px;"># Pass the .pages file on the command line</span><br />
<span class="Apple-style-span" style="background-color: #f8f8f8; color: green; font-size: 12px; line-height: 14px;"># .\Pages-ToHtml.ps1 '.\Path\To\File.pages' > Converted.html</span><br />
<span class="Apple-style-span" style="background-color: white; color: green; font-size: 12px; line-height: 14px;">#</span><br />
<span class="Apple-style-span" style="background-color: #f8f8f8; color: green; font-size: 12px; line-height: 14px;"># Requires PSCX</span><br />
<span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;">Import</span><span class="sy0" style="background-color: white; color: pink; font-size: 12px; line-height: 14px;">-</span><span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;">Module PSCX</span><br />
<span class="re0" style="background-color: #f8f8f8; color: purple; font-size: 12px; line-height: 14px;">$file</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="sy0" style="background-color: #f8f8f8; color: pink; font-size: 12px; line-height: 14px;">=</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="br0" style="background-color: #f8f8f8; font-size: 12px; line-height: 14px;">(</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">Read</span><span class="sy0" style="background-color: #f8f8f8; color: pink; font-size: 12px; line-height: 14px;">-</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">Archive</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="kw6" style="background-color: #f8f8f8; color: navy; font-size: 12px; line-height: 14px;">$args</span><span class="br0" style="background-color: #f8f8f8; font-size: 12px; line-height: 14px;">[</span><span class="nu0" style="background-color: #f8f8f8; color: #804000; font-size: 12px; line-height: 14px;">0</span><span class="br0" style="background-color: #f8f8f8; font-size: 12px; line-height: 14px;">]</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="kw5" style="background-color: #f8f8f8; color: teal; font-size: 12px; font-style: italic; line-height: 14px;">-format</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">Zip</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="br0" style="background-color: #f8f8f8; font-size: 12px; line-height: 14px;">)</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="sy0" style="background-color: #f8f8f8; color: pink; font-size: 12px; line-height: 14px;">|</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="kw1" style="background-color: #f8f8f8; color: teal; font-size: 12px; font-weight: bold; line-height: 14px;">Where-Object</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="br0" style="background-color: #f8f8f8; font-size: 12px; line-height: 14px;">{</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="kw6" style="background-color: #f8f8f8; color: navy; font-size: 12px; line-height: 14px;">$_</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">.Path</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="kw4" style="background-color: #f8f8f8; color: red; font-size: 12px; line-height: 14px;">-ieq</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="st0" style="background-color: #f8f8f8; color: maroon; font-size: 12px; line-height: 14px;">"index.xml"</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="br0" style="background-color: #f8f8f8; font-size: 12px; line-height: 14px;">}</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="sy0" style="background-color: #f8f8f8; color: pink; font-size: 12px; line-height: 14px;">|</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">Expand</span><span class="sy0" style="background-color: #f8f8f8; color: pink; font-size: 12px; line-height: 14px;">-</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">Archive </span><span class="kw5" style="background-color: #f8f8f8; color: teal; font-size: 12px; font-style: italic; line-height: 14px;">-PassThru</span><br />
<span class="re0" style="background-color: white; color: purple; font-size: 12px; line-height: 14px;">$xml</span><span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="sy0" style="background-color: white; color: pink; font-size: 12px; line-height: 14px;">=</span><span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="br0" style="background-color: white; font-size: 12px; line-height: 14px;">[</span><span class="re3" style="background-color: white; color: teal; font-size: 12px; line-height: 14px;">xml</span><span class="br0" style="background-color: white; font-size: 12px; line-height: 14px;">]</span><span class="br0" style="background-color: white; font-size: 12px; line-height: 14px;">(</span><span class="kw1" style="background-color: white; color: teal; font-size: 12px; font-weight: bold; line-height: 14px;">Get-Content</span><span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="re0" style="background-color: white; color: purple; font-size: 12px; line-height: 14px;">$file</span><span class="br0" style="background-color: white; font-size: 12px; line-height: 14px;">)</span><br />
<span class="re0" style="background-color: #f8f8f8; color: purple; font-size: 12px; line-height: 14px;">$layout</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="sy0" style="background-color: #f8f8f8; color: pink; font-size: 12px; line-height: 14px;">=</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="re0" style="background-color: #f8f8f8; color: purple; font-size: 12px; line-height: 14px;">$xml</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">.document.</span><span class="st0" style="background-color: #f8f8f8; color: maroon; font-size: 12px; line-height: 14px;">"text-storage"</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">.</span><span class="st0" style="background-color: #f8f8f8; color: maroon; font-size: 12px; line-height: 14px;">"text-body"</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">.section.layout</span><br />
<span class="Apple-style-span" style="background-color: white; color: green; font-size: 12px; line-height: 14px;"># Stripped of all formatting</span><br />
<span class="Apple-style-span" style="background-color: #f8f8f8; color: green; font-size: 12px; line-height: 14px;">#$layout.InnerText</span><br />
<span class="Apple-style-span" style="background-color: white; color: green; font-size: 12px; line-height: 14px;"># Write paragraphs only</span><br />
<span class="re0" style="background-color: #f8f8f8; color: purple; font-size: 12px; line-height: 14px;">$layout</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">.p</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="sy0" style="background-color: #f8f8f8; color: pink; font-size: 12px; line-height: 14px;">|</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="kw1" style="background-color: #f8f8f8; color: teal; font-size: 12px; font-weight: bold; line-height: 14px;">ForEach-Object</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="br0" style="background-color: #f8f8f8; font-size: 12px; line-height: 14px;">{</span><br />
<span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="kw2" style="background-color: white; color: teal; font-size: 12px; font-weight: bold; line-height: 14px;">echo</span><span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="st0" style="background-color: white; color: maroon; font-size: 12px; line-height: 14px;">"<p>"</span></code><br />
<code> <span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="kw6" style="background-color: #f8f8f8; color: navy; font-size: 12px; line-height: 14px;">$_</span><span class="Apple-style-span" style="background-color: #f8f8f8; color: #181818; font-size: 12px; line-height: 14px;">.</span><span class="st0" style="background-color: #f8f8f8; color: maroon; font-size: 12px; line-height: 14px;">"#text"</span><br />
<span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;"> </span><span class="kw2" style="background-color: white; color: teal; font-size: 12px; font-weight: bold; line-height: 14px;">echo</span><span class="Apple-style-span" style="background-color: white; color: #181818; font-size: 12px; line-height: 14px;"> </span></code><span class="Apple-style-span" style="background-color: white; color: maroon; font-family: monospace; font-size: 12px; line-height: 14px;">"</p>"</span><br />
<code> <span class="Apple-style-span" style="background-color: #f8f8f8; font-size: 12px; line-height: 14px;">}</span> </code>Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-300416804380650042011-07-02T12:23:00.001-05:002011-07-02T12:23:24.418-05:00How to require SSL in IIS7 and Azure with Rewrite<p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPUBSQXuYRUhHX6oUCuJcMNefN1kpIlbzuLbubF8InhjUjHa6CIEKOGn9K5QimnaZgcKVJFkwsq-4AXdcBmtSaTePwm7gHSn1IuXw7QrLAO7r2ijOfKIRnwuzhfg_fvcCdLtXT/s1600-h/image%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdxsdjAfkFwKx-avpkHGUYtKhbI0qy3XCX5BGhW4N8RMSeTGxSKS5jn5KhId76NfNGZWS7rjU3Mw-bzZGTdDyyhzP96RXRZ5CYv1jAMXSUzTAaZIEm53HtAEN2yUjyPEzhEpwt/?imgmax=800" width="240" height="201" /></a>This is a tidy solution. Instead of requiring SSL (and giving 500s if they come over HTTP), use IIS URL Rewrite to check for HTTPS being off—and if so, redirect them (permanent 301) to the same path over SSL. The converse could also be done. </p> <p>Good news is URL rewrite comes installed out of the box at Azure (<a href="http://msdn.microsoft.com/en-us/library/dd573358.aspx">looks like v1.2 and above</a>). </p> <p>Here's an example web.config showing the configuration to ensure that the <em>secure</em> directory requires SSL.</p> <p><code><?xml version="1.0" encoding="UTF-8"?> <br /><configuration> <br />  <system.webServer> <br />    <rewrite> <br />      <rules> <br />        <rule name="Enforce SSL" enabled="false" stopProcessing="true"> <br />          <match url="/?(secure.*)" ignoreCase="true" /> <br />          <conditions> <br />            <add input="{HTTPS}" pattern="off" /> <br />          </conditions> <br />          <action type="Redirect" url="https://{SERVER_NAME}/{R:1}" /> <br />        </rule> <br />      </rules> <br />    </rewrite> <br />  </system.webServer> <br /></configuration></code></p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-83561857192150597162011-06-09T12:00:00.001-05:002011-06-09T12:00:12.042-05:00Enabling IPv6 on Comcast with Buffalo WZR-HP-G300NH<p>I'm running Buffalo's latest (as of this writing) DD-WRT <a href="http://www.buffalotech.com/support/downloads/">firmware</a>, V24-SP2 build 16783. </p> <p>The DD-WRT IPv6 tutorial is in the ballpark, but didn't work for my setup. See the <a href="http://www.dd-wrt.com/wiki/index.php/IPV6#6rd">section on 6rd</a> for Comcast-specific scripts; for me, the script never succeeded on startup (I presume because the WAN wasn't up before the script was executed). Here's what actually worked:</p> <ul> <li>In the web interface, Administration / Management. </li> <ul> <li>IPv6: Enable </li> <li>Radvd: Disable </li> <li>JFFS2: Enable </li> <li>Clean JFF2: Enable (this will format a writable partition where you can store user scripts) </li> </ul> <li>Apply, and then reboot the router. </li> <li>For some reason, nslookup 6rd.comcast.net throws a segmentation fault on my router… so the script below shows a hard-coded value IP address. The original script linked above intended to parse the result of nslookup. </li> <li>Use SSH/SCP/SFTP to copy this script onto the router to <strong>/jffs/etc/config/ipv6comcast.wanup</strong>: </li> </ul> <blockquote> <p><font face="Courier New">#!/bin/sh</font><font face="Courier New"> <br />insmod /lib/modules/`uname -r`/kernel/net/ipv6/sit.ko <br />HOST6RD=69.252.80.66 <br />#nslookup 6rd.comcast.net segfaults <br />WANIP=$(ip -4 addr show dev eth1 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1) <br />if [ -n "$WANIP" ] <br />then <br />V6PREFIX=$(printf ' 2001:55c:%02x%02x:%02x%02x' $(echo $WANIP | tr . ' ')) <br />ip tunnel add tun6rd mode sit ttl 255 remote any local $WANIP <br />ip link set tun6rd mtu 1280 <br />ip link set tun6rd up <br />ip addr add $V6PREFIX:0::1/32 dev tun6rd <br />ip addr add $V6PREFIX:1::1/64 dev br0 <br />ip -6 route add 2000::/3 via ::$HOST6RD dev tun6rd <br />kill -HUP $(cat /var/run/radvd.pid) <br />fi <br />echo "interface br0 { \ <br />MinRtrAdvInterval 3; MaxRtrAdvInterval 10; AdvLinkMTU 1280; AdvSendAdvert on; \ <br />prefix $V6PREFIX::/64 { AdvOnLink on; AdvAutonomous on; AdvValidLifetime 86400; \ <br />AdvPreferredLifetime 86400; }; };" \ <br />> /tmp/radvd.conf <br />radvd -C /tmp/radvd.conf start</font></p> </blockquote> <ul> <li>Using SSH, <strong>chmod 777 /jffs/etc/config/ipv6comcast.wanup</strong>.</li> <li>The extension .wanup means that the script will run every time the WAN comes up. <a href="http://www.dd-wrt.com/wiki/index.php/Script_Execution">More about scripting on DD-WRT</a>.</li> <li>Reboot the router and your computer.</li> <li>Windows should report IPv6 Internet Connectivity: <br /><a href="http://lh4.ggpht.com/-HuPlPJVwVYs/TfD8GW-CVdI/AAAAAAAAAak/6Sy8thCvN9k/s1600-h/image%25255B3%25255D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdUfi5uxfJJ1c0Io5ZQVc74b46_WITxMK7vnsFa4W106XjSVhrKWeMeihfcWQBPtONTqF5l3-tX_YyqHVhKB0u9FFVJH7XHEbVs8BOKT4HCemapzNlDxUpw-glFOKYFZZa3IeD/?imgmax=800" width="412" height="147" /></a></li> <li><a href="http://test-ipv6.com/">http://test-ipv6.com/</a> should report 10/10 for both IPv4 and IPv6.</li> <li>Note: You should be using Comcast's default DNS. I was using <a href="http://code.google.com/speed/public-dns/faq.html#ipv6">Google's Public DNS, but they don't support IPv6</a>.</li> </ul> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com2tag:blogger.com,1999:blog-8102723.post-1010831672846038202011-05-20T14:20:00.001-05:002011-05-20T14:20:12.349-05:00DIY Hauraches - Luna Sandals<p>Just a few teaser photos.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQ1noIQ1cVa69Q2X-Ih5CJEmZL3CdFrtz3HQVSU_zyBrDKks2TyQRjMPL8RK3u-XmP7hToiTdf63Pw9wtxW50P3hSV7Uc2fmOhoh7zkeXggDzHHOmnoJQxoqDkzHGtygq1ynbb/s1600-h/DSCN0489%5B4%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="DSCN0489" border="0" alt="DSCN0489" src="http://lh4.ggpht.com/_mnoKECFgmiI/Tda-52GGZwI/AAAAAAAAAYo/JPMIoOaOEGs/DSCN0489_thumb%5B1%5D.jpg?imgmax=800" width="484" height="364" /></a></p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwEcjYMxklu4wXxN4B1On1Uhz7E5KE-WNOS0YIi20yY271v19E4ttlhvuMxZh4rtM8iLJGBTI9Rw0sJqPB9GsQyreqorI3X-yWQAAA5mxWY0p0tsRk9RuurEPTUUP5B5JPwVg9/s1600-h/DSCN0493%5B4%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="DSCN0493" border="0" alt="DSCN0493" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJZvfSSu9VRda8DuJ10Lr98wJwGP0b5S1HqEf3yA9X4pn6y5WvLA4KpfNRqdCWUzH728M-C10CWJznbSSVUIFoV4lmIReEuJQTrvSp53FhGv6tq461YyHWSNS2_oVd068_X8Ra/?imgmax=800" width="484" height="364" /></a></p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-82255757616728283582011-05-17T13:59:00.001-05:002011-05-17T14:00:05.524-05:00Triggering Multiple Commands on a Single Button Click in Silverlight XAML<p>If you're using RIA services and have ever drag-and-dropped a datasource onto a user control, you've likely seem the generated Load button that fires a command to load data:</p> <p><font face="Consolas"><Button Content="Load" Margin="3" Name="myDomainDataSourceLoadButton" Command="{Binding Path=LoadCommand, ElementName=myDomainDataSource}" /></font></p> <p>If your control has multiple DomainDataSources and you'd like to trigger them all by a single button click, you can change your markup:</p> <p><font face="Consolas">xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"</font></p> <p><font face="Consolas"><Button Content="Load" Margin="3" Name="myDomainDataSourceLoadButton"> <br />    <i:Interaction.Triggers> <br />        <i:EventTrigger EventName="Click"> <br />            <i:InvokeCommandAction Command="{Binding Path=LoadCommand, ElementName=myDomainDataSource}"/> <br />            <i:InvokeCommandAction Command="{Binding Path=LoadCommand, ElementName=myOtherDomainDataSource}"/> <br />        </i:EventTrigger> <br />    </i:Interaction.Triggers> <br /></Button></font></p> <p>I left out the markup for the DomainDataSource and its query parameters, etc, but this should get the point across.</p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-84925588140799378582011-05-11T15:31:00.000-05:002011-05-13T15:43:46.910-05:00Performance Testing in Azure Dev Fabric<p>I'm running an application at Azure that runs in <a href="http://www.pettijohn.com/2010/12/full-iis-mode-at-windows-azure.html">Full IIS Mode</a> with Dev Fabric version 1.4 on x64 Windows 7. I set out to run some performance tests, since Memory\Page Faults/sec is high during a few scenarios in production.</p> <p>Unfortunately, the Visual Studio tooling has not caught up to Azure, so it takes a bit of hacking and Powershell goodness to get the data you need. On the positive side, the Visual Studio tooling is just a UI for the same command line tools we're about to use. Plus, analysis happens exactly the same way that you're used to in Visual Studio.</p> <p>This tutorial assumes you want Memory and Performance metrics using instrumented assemblies. If you don't want/need Memory, skip the relevant bullet.</p> <p><strong>NB: Be sure you're using the 64-bit versions of these commands </strong>if that is your platform. Also <strong>run Powershell as an Administrator </strong>if you use UAC. Also, oddly, vsperfcmd doesn't seem to return from the <strong>ISE, so you have to use good ol' powershell.exe.</strong></p> <ul> <li>Install <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=C6DB79BF-B076-413B-90C7-EA6457025EBD&displaylang=en">x64 Performance Tools</a> for Visual Studio 2010 SP1 </li> <li>(Optional) Enable <a href="http://msdn.microsoft.com/en-us/library/bb385759.aspx">CLR memory profiling</a> (allocations, or allocations and lifetimes (shown)) <ul> <li>& "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Performance Tools<strong>\x64</strong>\VSPerfCLREnv.cmd" /globaltracegclife </li> <li>(You may have to reboot for the command to take effect) </li> <li><strong>Important:</strong> When you're done, be sure to run the same command with /Off and /GlobalOff switches, otherwise EVERY .NET app on your system will be publishing these metrics and run like dog crap.</li> </ul> </li> <li>Build your application </li> <li>Instrument your assemblies in-place <ul> <li>$vsinstr = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Performance Tools\x64\vsinstr.exe" <br />dir ".\MyCloudApp\bin\Debug\MyCloudApp.csx\roles\MyWebRole\approot\bin\MyNamespace*.dll" | foreach-object { <br />    & $vsinstr $_.FullName; <br />} </li> </ul> </li> <li>Start the performance profiler; it seems this must start before your application (Note I'm naming the .vsp output with a timestamp for easier scripting and history tracking) <ul> <li>$vsperfcmd = "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Performance Tools\x64\vsperfcmd.exe" <br />$date = get-date -F yyyyMMddHHmmss <br />&$vsperfcmd /START:TRACE /OUTPUT:perf_$date.vsp /user:Everyone </li> </ul> </li> <li>Start your application via the Azure cloud tool csrun.exe <ul> <li>$csrun = "C:\Program Files\Windows Azure SDK\v1.4\bin\csrun.exe" <br />&$csrun /devstore:start <br />&$csrun .\MyCloudApp\bin\Debug\<strong>MyCloudApp.csx</strong> .\MyCloudApp\bin\Debug\<strong>ServiceConfiguration.cscfg</strong> </li> </ul> </li> <li>Wait for the <strong>appropriate process </strong>to start and grab its PID. In my case, since I'm using Full IIS Mode and interested in capturing metrics from <a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleentrypoint.aspx">RoleEntryPoint</a> and deeper, that process is WaIISHost.exe. If you are running a worker role, that process is WaWorkerHost.exe; "old" web roles use WaWebHost; web sites running under Full IIS Mode use the regular w3wp.exe (though getting the right app pool may be more difficult). <ul> <li>while(-not $process) { <br />    $process = Get-Process | where { $_.ProcessName -ieq "<strong>waiishost</strong>" }; <br />    start-sleep 0.1; <br />} </li> </ul> </li> <li>When ready, start capturing instrumented data <ul> <li>& $vsperfcmd /processOn:$($process.Id) </li> </ul> </li> <li>When done, disconnect and shut down <ul> <li>& $vsperfcmd /processOff:$($process.Id) </li> <li>& $vsperfcmd /shutdown </li> </ul> </li> </ul> <p>Now open the .vsp and—there you have it—a performance report generated from code running in Azure dev fabric!</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglhJSYgGLOcN7AleeKu7V0Op-02ZPtPOOuaNST5vL1w0LINUmsFkNbYmLMG5fBkgEDBQgKHP7TFMyMxlU9UBa_fK-vXDE0jKDdzxcTPCJmIA9YDPaWYto_8Ufph8CeDY14yTmu/s1600-h/image%5B7%5D.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_mnoKECFgmiI/TcryH4E1uJI/AAAAAAAAAYM/XfiT2LgmJfs/image_thumb%5B3%5D.png?imgmax=800" width="484" height="346" /></a></p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com1tag:blogger.com,1999:blog-8102723.post-68776925218680565242011-04-27T19:54:00.001-05:002011-04-27T19:58:01.132-05:00Converting RunAmocs to Huaraches<p><img style="display: inline" alt="RunAmoc - LITE<br/>Black" src="http://www.softstarshoes.com/images/products/250V/250V_run_blk_std.jpg" /> <br />Last summer I bought a pair of <a href="http://www.softstarshoes.com/index.cfm?fuseaction=product.display&Product_ID=1342">RunAmocs</a>, a barefoot running moccasin. They're neat—but I didn't like the fit. They're too loose for running (contrary to other reviews online), and after the initial excitement wore off, I decided that I didn't like the style. Great vision, but it needed to be secured better on the foot.</p> <p>I finally decided to tear them to bits and turn them into running sandals. I had a few other spare parts lying around, namely, a pair of <a href="http://www.yankz.com/Yankz-Sure-Lace-System-Overview-s/21.htm">elastic shoe laces</a> from my "big fat running shoes" days. So I got to cutting.</p> <p><a href="http://lh3.ggpht.com/_mnoKECFgmiI/Tbi6qcyp57I/AAAAAAAAAWo/ZAsCJM3wVAc/s1600-h/WP_000236%5B4%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="WP_000236" border="0" alt="WP_000236" src="http://lh5.ggpht.com/_mnoKECFgmiI/Tbi6qjaGu1I/AAAAAAAAAWs/S5pXUhEqGOU/WP_000236_thumb%5B1%5D.jpg?imgmax=800" width="184" height="139" /></a> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0AyFRZ9hHYyt86HbWCOCg6A7mzl9Ml6_7pLTWzk1Ke8QFNhVezrVXHXGJWkT5NKNrN2iFf3cugKAWgSmzEpDF44SswOTrRtjrZstCovgqH-izZ5kxKzBec3AbKkAZPMO2mok8/s1600-h/WP_000238%5B5%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="WP_000238" border="0" alt="WP_000238" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM7RsRS38tE5S7mpA2ZBvkAlRSQPlKCLwo9aE_LyGNZ6whdO6xG2QjTS9iqCNswTT3Gcs1q6-auGgTSEiGz8t7XUJMCYlQNzWDmTPC812slSPju_EoYNBEq8tgwBWONX9tJXmT/?imgmax=800" width="184" height="139" /></a></p> <p>And then <a href="http://invisibleshoe.com/tying/">learned about tying</a>. And in the end, ended up with a beautiful little sandal. The elastic closure is incredibly secure while being very easy to get on and off. They way they move with your feet is incredible—I can't believe how many pairs of minimalist shoes I've gone through to find this.</p> <p><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijwjBRYMCqRNvsHsAnz0uh9l-Fj-IAPD-m-NQqoQJxRznSaVeDU9EAZir9ZADcghH4n_57PkA8LLfSkKQQAk9kDB2NWQ7ahqk7v0L-kq7IXcDUaxI7WyAgaJYStHnNgbnzNgQZ/s1600-h/WP_000239%5B5%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="WP_000239" border="0" alt="WP_000239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi84hENpjRx2egfuVXwxVjSgdXxiQcxGBOGwpVQ-22n7NM1_UbL7RfM7wzbSojlYULjz-qczitAAyWvD7l-R58PK70SuqsFNnQ8IcrQINnXjCj3cxCkZp54K7ZBzsQUowEWkIbi/?imgmax=800" width="484" height="364" /></a></p> <p><a href="http://lh3.ggpht.com/_mnoKECFgmiI/Tbi6samBkBI/AAAAAAAAAXA/vRpGWIpiF3g/s1600-h/WP_000240%5B3%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="WP_000240" border="0" alt="WP_000240" align="right" src="http://lh5.ggpht.com/_mnoKECFgmiI/Tbi6sr6SXTI/AAAAAAAAAXE/YW8ijYm0PQI/WP_000240_thumb.jpg?imgmax=800" width="244" height="184" /></a>The way these things move with your feet is very impressive. Not with your feet—as a part of your feet. I've never felt less resistance to move with me in footwear. This is a 2mm road sole with another 2mm or so of lightly-padded faux (?) leather. I trimmed the toes to fit a little better…but got too aggressive on the right foot. Live and learn. I ordered some pieces from Barefoot Ted's <a href="http://lunasandals.com/sandals/5-diy-sandal-making-kit">Luna Sandals</a> and will try another iteration shortly. I also picked up some <a href="http://www.amazon.com/iBungee-Stretch-Laces-38-Inch-Black/dp/B001CH33F4/ref=sr_1_2?ie=UTF8&qid=1303951698&sr=8-2">longer 42" elastic laces</a> in plain black (not the reflective black, above) and a proper leather punch (instead of a drill). I am excited.</p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-53665341937885276842011-04-15T03:09:00.001-05:002011-04-15T03:09:41.743-05:00Using a Vodafone AU Prepaid Data SIM in a Phone<p>The APN for a prepaid data SIM (at least the one I got bundled with a hardware modem):</p> <p>APN: vfprepaymbb <br />Username: web <br />Password: web</p> <p>They don't make that obvious, but it works. Cool. Seems to receive phone calls, too… not sure how that counts against the quota.</p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-7753884947852960252011-03-26T15:34:00.001-05:002011-03-26T15:41:11.433-05:00A Brief History of Modern Running<p>In the beginning, there were bare feet. <a href="http://en.wikipedia.org/wiki/Homo">Homo sapiens sapiens</a> (anatomically modern humans) first appeared as a species about 200,000 years ago. Having come down from trees, we stood upright and grew big brains. Like all animals, we evolved feet well-suited for our tasks: big horn sheep have hooves that enable them to deftly scale cliffs. Monkeys can grip branches and navigate trees with ease. But homo sapiens, no longer hanging onto branches, evolved feet for a rather different purpose: <a href="http://www.youtube.com/watch?v=9wI-9RJi0Qo">running across plains in persistence hunts</a>, chasing down gazelle until they would die of heat exhaustion. <br /><a href="http://lh4.ggpht.com/_mnoKECFgmiI/TY5N22WSWXI/AAAAAAAAAU4/zdFCKbY7E_A/s1600-h/3416139096_985540030a_o%5B4%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Two females, possible a mother daughter team, jog barefoot on the Morro Strand Beach" border="0" alt="Two females, possible a mother daughter team, jog barefoot on the Morro Strand Beach" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqQY4sS18BL87FOU98Q2Vsk2I2xSTm-EWTewhUVyvEjBKRVOyIcOhMYP_qS0a2BxQlWpqdQ9a6jIlLAx6daK6fGbZVXcrAPDsbAeCPWuQvBjIuIjJhkB8UWMHzdJw8i23NsV3F/?imgmax=800" width="484" height="360" /></a> <br /><em><a href="http://www.flickr.com/photos/mikebaird/3416139096/in/photostream/">Photo credit.</a></em></p> <p>In the 1970s, there came a revolution in footwear: Nike. Oh big thick padded footwear! Save us from ourselves! Our feet are defective, we need to enshroud them in padding. The laws were changed to <em>require</em> footwear in school PE classes (the result of footwear company lobbying). <br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho0aLUA0YiOopc4kSq5NAPICyNBf86OSI_KSvZtdxlYHkgELr_c-5b5j9mkRuEi99GuhQn4F6uouxHHLlY_GWzze0v3vzWNgC3ik3nZ23QYNuaJTs6lJe-sMzEMz6u-i9SH28P/s1600-h/378243098_72f998eea6_o%5B4%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="378243098_72f998eea6_o" border="0" alt="378243098_72f998eea6_o" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiI5WPh4wg_Yn_1sJPFffJistUagE6dxdjQdAA2dojQhFle5ROJEjnDosamiPRpMkyViEkgGgtW0y56_hiVgHl7ef74xCAfqns0qrZE_fQcRw-YWP6eqasnXH_ZE4fcdkxWJLd5/?imgmax=800" width="484" height="324" /></a> <br /><em><a href="http://www.flickr.com/photos/20035490@N00/378243098/">Photo credit.</a></em></p> <p>Big, padded heels have an interesting consequence: they change your gait. Most joggers jam their foot way out in front of them and strike heel-first, letting that big pad absorb some of the shock. Some of it. The rest is absorbed by knees and hips, at angles and in ways that we did not evolve to withstand. And, most detrimentally, impact is absorbed in places where there aren't too many nerve endings, meaning pain is noticed well after the damage is done. <br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9zvR_g41RQqIDxJD6rSPJRir0VUOSP3luEi2YnPEyduWGyMZnYXbZbUBbZ93xNl3IfR8aoyu8a1-p0ayFkqYwoVYE64crqBCpyR93W7WB_YJRJME7lbout7PUbUlcXgZTI7d_/s1600-h/Slice%202%5B3%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Slice 2" border="0" alt="Slice 2" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieAAjev9p8qnxfuI5T2R2ZYoSnKbmHB-uCYK3pdtJYbUNzZlYjOPyRAL7rrOSpMs-lALLsHbfo5xvdV1V7ru4zvkfvN5uFCoa0sHvJh5pVZP4FB4LJOs3UkMT0oyiXDASWgE_j/?imgmax=800" width="484" height="324" /></a> <br /><em><a href="http://www.flickr.com/photos/lululemonathletica/4460997554/sizes/o/in/photostream/">Photo credit.</a></em></p> <p>Sports injuries increased: plantar fasciitis, ITBS, etc… What to blame? Not that footwear in and of itself is fundamentally flawed—no. We just had to evolve the footwear. And so arch support was born, so that our feet would no longer (defectively?) flex. Add motion control with varying stiffness of foams to prevent over-pronation. More, more, more. </p> <p>Americans, being the consumers (and consumerists) that we are, needed more products to put on our feet. People began questioning the footwear (perhaps there was always a questioning subculture). Thus, in 2006, a <a href="http://barefootted.com/2009/10/paradigm-shifting-trojan-horses-vffs.html">trojan horse</a> was born: Vibram FiveFingers. Not content to <em>just take off our shoes and run</em>, Americans needed to <em>buy a product </em>in order for the most natural thing possible to become acceptable. For shame, America! For shame!<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf-lx1FICpc7O1ABv636YbNIWzm7EixZVv1Qz0bOloWXccL1anfSsVg4WgoWMmCSPtGwZJUj_ER_8j4YC82qresprQRAm21KJdhKbVuJoOuGl8ZnvkTWnZeRqSmmaNjtqFCYu_/s1600-h/3513130386_ce8c6f3486_o%5B4%5D.jpg"> <br /><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="3513130386_ce8c6f3486_o" border="0" alt="3513130386_ce8c6f3486_o" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKp3fG5jIkRGLjhBcUYk7NuJtebiyXuD8vC-hFbWbYYmIQldmfRjE7MQpxWgJDH9w1rYJvzw99Vd6TREFK5eCfN9xaUpVs7JtQ4eycXs9ugXuejUxSIM2jeyV778T2TDAXRdc_/?imgmax=800" width="484" height="325" /></a> <br /><em><a href="http://www.flickr.com/photos/98912285@N00/3513130386/">Photo credit.</a></em></p> <p>I admit that I bought into it and became an early adopter. These peculiar shoes used to fetch odd looks before coming to be so commonplace these days. </p> <p>A subculture sprung up of people demanding <em>less</em> in their footwear. Less support, less padding, more like a sock than a shoe. These days the tide is swelling, and more and more minimal footwear products are filling the shelves. There are now <a href="http://www.borntorun.com/">entire stores</a> dedicated to selling minimal footwear.</p> <p>Have you ever wondered why your feet are so sensitive? When your shoes come off and you run, your <a href="http://news.harvard.edu/gazette/story/2010/01/different-strokes/">gait becomes softer</a>. Yes, you read that right: the less padding on your feet, the softer you land. When your feet can feel the ground, you <em>instinctively</em> run differently and in a way that minimizes impact and pain. No longer do you land heel first (ouch!)—your strike moves forward to the forefoot or midfoot. If it hurts, those sensitive feet <em>immediately </em>sound alarm bells that you're doing something wrong, so your gait necessarily adapts. The outside edges of your feet land first, you pronate (roll inward) and your arch flexes, all to absorb impact shock before it reverberates up to your knees and hips. When you slow down, no longer can you lean back and slam your padded heels into the ground—you have to take a few strides and slow down, uh, slower. </p> <p>In short: if you run shod, you run incorrectly. If you run barefoot, you run correctly. Yes, you can learn barefoot form <em>and then </em>run correctly whilst shod. But going barefoot is the surest and quickest way to learn.</p> <p>If this piques your interest, go read Born to Run by Christopher McDougall. Or <a href="http://www.youtube.com/watch?v=ie6vFd6P4Og">watch this hour-long video for free</a> of Barefoot Ted. It will inspire you. And if you've been running with padded shoes your whole life, START SLOW. A quarter or a half mile without shoes will be about all you can handle—you are working a lot of atrophied muscles. It will take time before you can run marathons barefoot like this guy. <br /><a href="http://lh3.ggpht.com/_mnoKECFgmiI/TY5PZJ34mkI/AAAAAAAAAVY/-SsMV0SiPJI/s1600-h/4452025215_2b0b8bb317_o%5B4%5D.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="Los Angeles Marathon" border="0" alt="Los Angeles Marathon" src="http://lh3.ggpht.com/_mnoKECFgmiI/TY5PZQfnUfI/AAAAAAAAAVc/nUx3mg9Vbug/4452025215_2b0b8bb317_o_thumb%5B1%5D.jpg?imgmax=800" width="411" height="484" /></a> <br /><em><a href="http://www.flickr.com/photos/jmrosenfeld/4452025215/">Photo credit.</a></em></p> <p>Up next: a brief history of my experiences with minimalist footwear. </p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-24615413486504180752011-03-12T14:28:00.001-06:002011-03-12T14:28:08.374-06:00Notepad++ HTML Tidy doesn't work<p>If Tidy HTML fails silently and you have UAC enabled, try this trick.</p> <p>Tidy needs to write to C:\Program Files (x86)\Notepad++\plugins\Config\tidy\HTMLTIDY.CFG. Create the file, and then grant everyone full control.</p> <p>Now you can do things like <a href="http://www.twu.ca/divisions/technology/sst/orion/blog/tidy-notepad-and-xml.html">auto-indent XML</a> in Notepad++. </p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com6tag:blogger.com,1999:blog-8102723.post-49121454380814351012011-03-06T13:57:00.001-06:002011-03-06T13:57:29.103-06:00Using Screen on Linux - Quick Start<p>I'm performing a long-running import (multiple days) and need to be able to check in on it every so often. Normally, disconnecting your SSH session will kill all of its processes, but screen sits a layer above that, creating a session that you may attach to and detach from at any time, from any SSH/terminal session. <a href="http://www.gnu.org/software/screen/manual/screen.html">Screen</a> is intimidatingly powerful—but here is the <em>minimal info </em>you need to be able to start a screen session and come back to it later.</p> <p>screen -S <name>   <em>Starts a named session. Once inside the session, start the import/whatever you will want to come back to.</em></p> <p>^a d (CTRL+a d)    <em>Detaches the current Screen session.</em></p> <p>screen -list    <em>List all sessions</em></p> <p>screen -r <name>    <em>Resume a detached session</em></p> <p>Hope that helps!</p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-90363030577351218702011-01-19T22:40:00.001-06:002011-02-15T18:42:18.433-06:00Silverlight DataGrid with Dynamic Columns<p>I had to build a grid of images. Business requirements called for an image with a caption, arranged in rows and columns by certain user criteria. (In other words, I couldn't just use a StackPanel and flow them horizontally and wrap row to row). Additionally, the number of rows and columns is impossible to know at compile time.</p> <p>I started with a class </p> <pre>public class Thumb
{
public Thumb(string imageUri, string title)
{
Thumbnail = new BitmapImage(new Uri(imageUri, UriKind.Relative));
Title = title;
}
public ImageSource Thumbnail { get; set; }
public string Title { get; set; }
}</pre>
<p>I wanted to arrange them into a 2D array of Thumb[][], or <strong>IEnumerable<Thumb[]></strong>. I'll stick with the latter because it's clearer to explain: <strong>Enumerate over the rows, and index into the array for columns. </strong>Also, there is other code to guarantee that the data is the same in columns and that the 2D array is always a rectangular, never jagged.</p>
<p>As an aside, if this had been ASP.NET, I could have put these objects into a DataTable/DataSet, and its DataGrid would have dynamically generated the columns. But binding an IEnumerable<Thumb[]> to a Silverlight DataGrid with AutoGenerateColumns=True ends up with a grid where each row is an array…the columns are Length, SyncRoot, IsReadOnly, etc—the properties on the array, not indexing into it.</p>
<p>Now to wire it up in XAML. To start, let's do it by hand, for just the first column. </p>
<pre><sdk:DataGrid ItemsSource="<strong>{Binding MyThumbnailCollection}</strong>">
<sdk:DataGrid.Columns>
<sdk:DataGridTemplateColumn Header="Column Title">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="<strong>{Binding [0].Title}</strong>" />
<Image Source="<strong>{Binding [0].Thumbnail}</strong>" />
</StackPanel>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid></pre>
<p>When the DataGrid renders with TemplateColumns, it enumerates its ItemsSource (which it expects to be IEnumerable), and then sets the DataContext of the child FrameworkElement of the DataTemplate to the given row in the collection—in our case, each row is an array, Thumb[]. You can see that the template above is bound to an indexer and a property of the indexed object. Pretty cool and powerful runtime binding.</p>
<p>But how do we wire that up dynamically? At compile time, we don't know how many columns will be in the grid, so hard-coded XAML columns are out. I need to modify that binding dynamically, after the ItemsSource is set.</p>
<h3>Roadblocks</h3>
<p>This is not, as it turns out, a simple task in Silverlight. </p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.datatemplate.aspx">DataTemplates</a> can't be created in code. </li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridtemplatecolumn(VS.95).aspx">TemplateColumns</a> have no notion of binding or a data context </li>
</ul>
<p>As far as I can see, there's no simple way to create columns dynamically with a data context! If I'm missing something here, please leave a comment!</p>
<h3>XAML in C#</h3>
<p>The first solution I found was to <a href="http://elegantcode.com/2010/03/08/silverlight-datagrid-populate-dynamic-columns-from-a-child-collection/">create the indexed binding XAML</a> in C# and load it into the cell template – a crafty workaround to both problems. It looks something like this:</p>
<pre>private void CreateGridColumns()
{
grid.Columns.Clear();
if (Thumbs.Count == 0) return;
for (int i = 0; i < Thumbs[0].Length; i++)
{
var template = new StringBuilder();
template.Append(@"<sdk:DataGridTemplateColumn
xmlns:sdk=""http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk""
xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:my=""clr-namespace:Client.App.Views;assembly=Client.App"" ");
template.AppendFormat(@"Header=""{0}""> ", Thumbs[0][i].Title);
template.Append(@"<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text=""{");
template.AppendFormat("Binding [{0}].Title", i);
template.Append(@"}"" />
<Image Source=""{");
template.AppendFormat("Binding [{0}].Thumbnail", i);
template.Append(@"}"" />
</StackPanel>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>");
grid.Columns.Add((DataGridTemplateColumn)XamlReader.Load(template.ToString()));
}
}</pre>
<p>This code generates identical XAML as to what we wrote by hand, except one for each column. </p>
<p>As a matter of style though, I don't particularly like the way this code smells. C# isn't for writing XAML, and any UI that has do be done in code should be done using the object model. </p>
<h3><strike>Creating a Bindable Column</strike></h3>
<p><strong>Edit:</strong> This solution fails to work in Silverlight 4 because of the DataGrid's virtualization aka container recycling. See below for a updated version.</p>
<p>The DataGrid recycles rows when they scroll in & out of view. That is to say, rather than create all of the UI elements for potentially millions of rows in a DataGrid, they only create enough to display those that fit on the screen. When a row scrolls out of view, it's put on a "recycled" Stack; when a row scrolls into view, it checks the Stack for a row to reuse before creating a new one. If it finds one, it sets the row's DataContext appropriately and then displays it.</p>
<p>Our solution below fails to work because we set the DataContext of the row UI elements directly—that means when a row gets recycled, it will display whatever data it had been assigned when it was first instantiated. My apologies; I tested it with a small set of data initially. Keep reading for a solution.</p>
<p><strike>This solution is a bit cleaner – it's certainly more object oriented, and feels more at home in C#, despite the increase in lines of code. Create a column that is aware of its binding context so that it can "pass it down" to its cells. </strike></p>
<p><strike>DataGridTemplateColumn has a method </strike><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridtemplatecolumn.generateelement(v=VS.95).aspx"><strike>GenerateElement</strike></a><strike> that is used to build out the FrameworkElement that is the UI of the datagrid cell. We need to override it so that is can be aware of its "column context."</strike></p>
<p><strike>First, create this "bindable" template column, </strike><a href="http://stackoverflow.com/questions/2328497/is-it-possible-to-use-binding-in-a-datagridtemplatecolumn-property"><strike>inspired via</strike></a><strike>:</strike></p>
<pre><strike>public class DataGridBindableTemplateColumn : DataGridTemplateColumn
{
public string BindingPath { get; set; }
protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem)
{
//dataItem is the row.
var elem = base.GenerateElement(cell, dataItem);
elem.SetBinding(FrameworkElement.DataContextProperty, new Binding(BindingPath) { Source = dataItem });
return elem;
}
}</strike></pre>
<p><strike>Two things to note: first, we call base.GenerateElement() to let the DataGrid do its thing and build the UI. Second, when we modify the binding, we only modify the path. This will be a string like "[0].Title" or "[0].Thumbnail" in our case, and it is bound to the dataItem, which is a row in our grid (remember, enumerate over the rows, index into the columns). The framework handles the rest of the binding. </strike></p>
<p><strike>Note this same code "should" work with an IEnumerable<Dictionary<,>> and a BindingPath that keys into the dictionary. I haven't tested that, however.</strike></p>
<p><strike>Then, when your grid's ItemsSource changes, determine the columns and update dynamically:</strike></p>
<pre><strike>private void CreateGridColumns(ObservableCollection<Thumb[]> thumbs)
{
grid.Columns.Clear();
if (thumbs.Count == 0) return;
for (int i = 0; i < thumbs[0].Length; i++)
{
var dt = (DataTemplate)Resources["ThumbViewTemplate"];
var col = new <strong>DataGridBindableTemplateColumn</strong>();
col.CellTemplate = dt;
col.<strong>BindingPath = String.Format("[{0}]", i);</strong>
grid.Columns.Add(col);
}
}</strike></pre>
<p><strike>This code is a little different because, instead of creating the StackPanel, TextBlock and Image in source code, I moved it into a named resource in the XAML (below). You can see that I'm creating the new custom DataGridBindableTemplateColumn and setting its BindingPath to an index into the array, which the above GenerateElement override knows how to use.</strike></p>
<pre><strike><UserControl.Resources>
<DataTemplate x:Key="ThumbViewTemplate">
<StackPanel>
<TextBlock HorizontalAlignment="Center" Text="{Binding Title}" />
<Image HorizontalAlignment="Center" Stretch="Uniform" Width="200" Height="200" Source="{Binding Thumbnail}" />
</StackPanel>
</DataTemplate>
</UserControl.Resources></strike></pre>
<p><strike>As the grid renders, the <StackPanel> of each cell gets its DataContext bound to dataItem[i] – where dataItem is the row. Thus, its children are now bound to a single Thumb instance in our case. </strike></p>
<h3>DataGrid LoadingRow Event</h3>
<p>While the above solution fails abysmally, there is fortunately an even more elegant option. First, you create the columns dynamically just as before. Second, you handle the DataGrid's LoadingRow event, which is fired every time a row is either created or scrolled into view. We can use this event to index into our columns and bind each cell individually. </p>
<p>Note we're using a regular DataGridTemplateColumn.</p>
<p><font face="Courier New">private void CreateGridColumns(ObservableCollection<Thumb[]> thumbs)
<br />{
<br />    grid.Columns.Clear();     <br />    if (thumbs.Count == 0) return;</font></p>
<p><font face="Courier New">    for (int i = 0; i < thumbs[0].Length; i++)
<br />    {
<br />        var dt = (DataTemplate)Resources["ThumbViewTemplate"];
<br />        var col = new DataGridTemplateColumn();
<br />        col.CellTemplate = dt;
<br />        grid.Columns.Add(col);
<br />    }
<br />}</font></p>
<p><font face="Courier New">private void grid_LoadingRow(object sender, DataGridRowEventArgs e)
<br />{
<br />    var dataRow = (Thumb[])e.Row.DataContext;
<br />    for (int i = 0; i < grid.Columns.Count; i++)
<br />    {
<br />        var col = grid.Columns[i];
<br />        var elem = col.GetCellContent(e.Row);//FrameworkElement inside of DataGridCell
<br />        <strong>elem.DataContext = ((Thumb[])e.Row.DataContext)[i];
<br /></strong>    }
<br />}</font>
<br /></p>
<p><font face="Courier New"></font>Another important point to note is that DataGridRow.Cells is an internal property. Use DataGridColumn.GetCellContent(DataGridRow) instead, it will return the FrameworkElement of the cell at the intersection of the row and column.
<br /></p>
<p>There you have it – dynamic columns in a Silverlight datagrid.</p>
<p>Hope this helps! Which solution do you prefer?</p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com5tag:blogger.com,1999:blog-8102723.post-79166975882386880742010-12-25T09:36:00.001-06:002010-12-25T09:36:54.588-06:00How to solve “My PC Randomly Wakes up from Sleep”<p>Whenever your PC wakes up, Windows keeps a log of why. To view, open a command line and run: </p> <code> <pre> C:\> <strong>powercfg -lastwake</strong>
Wake History Count - 1
Wake History [0]
Wake Source Count - 1
Wake Source [0]
Type: Wake Timer
Owner: [PROCESS] \Device\HarddiskVolume3\Windows\System32\services.exe
Owner Supplied Reason: Windows will execute '\Microsoft\Windows\Media Center\mcupdate_scheduled' scheduled task that requested waking the computer.</pre>
</code>
<p>As you can see, my computer woke up because of a scheduled task. Open the Task Scheduler: <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnU2CngQme0RFxZTbAZf2hfVu5nK3x8qAcKGUAZXoQKQLliM5g0YUkcFZfCMnOBj3OXRvuLcJpYeatVZPscPi2xqIqVJa2PLaLZHvUaX8sN0ztO0Et51QirQYuyLlAlyzDAwQv/s1600-h/image%5B2%5D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgg2PGGwtbhdjODPFXsHVqKTEvgzLTWZORd3gvM3P0jTYntiKo8GaHXhUzqoF29EQNqPK2dX2t6AVdGKXrVFT8khLKBu9fktrQgA4XYe4Qg6QPCCu1w4A6nmbg-1xerbTUBhgl/?imgmax=800" width="209" height="80" /></a> And navigate to the task in question (\Microsoft\Windows\Media Center\mcupdate_scheduled, in my case). On the Conditions tab, uncheck wake: <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMMOCqCHeQt_K_AOizvFKlv4EeLl5MILLlNcuyvUo_4XnwEfk3M3YTEBc6d67gfJHcomHF_6OgksuOuuiaVGHMknp9BOFrBNXqvJoCCgcA2NcYN1buPxRO6menLQIQCsLlWwjN/s1600-h/image%5B5%5D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhssHp8fnu6xj-lCQzN330Sc4xiaKpnRsHK0RqkQ6_5Ayqdx9M_GupLeAfdcX27adPG803aoH71Tm9pVq7PLvNm7xmF_nJv-LWOi4TRa_kgBJVlGq_IcFj9wi05rZ8YEuXFC60r/?imgmax=800" width="244" height="90" /></a></p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com2tag:blogger.com,1999:blog-8102723.post-90434809331920577242010-12-24T18:09:00.001-06:002010-12-24T18:09:18.956-06:00Why Developers Always Need to use UTC<p>Assert.AreEqual(new DateTime(2010, 11, 07, 06, 0, 0, DateTimeKind.Utc).ToLocalTime(), <br />new DateTime(2010, 11, 07, 07, 0, 0, DateTimeKind.Utc).ToLocalTime());</p> <p>Because when we fall back from Daylight Saving Time, the hour of 1am is repeated, making it ambiguous. Which is why the above test code passes in Central time, since 6am and 7am UTC are both 1am, one 1am CDT, the other 1am CST.</p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-36567383632365020572010-12-13T13:18:00.001-06:002010-12-13T13:18:38.219-06:00Using XML Namespaces in PowerShell<code> <pre>$xpath = @{
Start="//e:data[@name = 'BootStartTime']/text()"
End="//e:data[@name = 'BootEndTime']/text()"
}
$ns = New-Object Xml.XmlNamespaceManager $xml.NameTable
$ns.AddNamespace( "e", "http://schemas.microsoft.com/win/2004/08/events/event" )
[DateTime]$Start = $xml.SelectSingleNode( $xpath.Start, $ns ).Value
[DateTime]$End = $xml.SelectSingleNode( $xpath.End, $ns ).Value
($End - $Start).ToString() # Displays: 00:03:11.7917783</pre>
</code>
<p><a href="http://huddledmasses.org/xpath-and-namespaces-in-powershell/">Via</a>.</p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-41892623884096875472010-12-08T17:15:00.003-06:002010-12-08T17:17:29.595-06:00Full IIS Mode at Windows AzureOne of the nice new features in the December 2010 release 1.3 of the Azure tools is Full IIS Mode, the ability to run multiple web sites in a single Azure web role. The documentation is a bit sparse still, but the short answer is to add multiple <site/> tags in the ServiceDefinition.csdef.<br />
<br />
<a href="https://blogs.msdn.com/b/windowsazure/archive/2010/12/02/new-full-iis-capabilities-differences-from-hosted-web-core.aspx">Here's a good post on the Azure blog</a>, and here's <a href="http://msdn.microsoft.com/en-us/library/gg433110.aspx">some documentation at MSDN</a>.<br />
<br />
<br />
<code><pre><Site name="<web-site-name>" physicalDirectory="<directory-path>">
<Bindings>
<Binding name="<name-of-the-binding>" endpointName="<endpoint-identifier>" hostHeader="<url-of-the-website>" />
</Bindings>
</Site></pre>
</code>Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-21836781852616470612010-11-30T09:26:00.001-06:002010-11-30T09:44:01.199-06:00Task Scheduler Engine<p>This past weekend I published a small open source project at CodePlex, <a href="http://taskschedulerengine.codeplex.com/">Task Scheduler Engine</a>. It is a simple cron-like scheduling API with a clean fluent interface (also supports XML config, if you prefer typing out assembly qualified names). Use it when you need a simple, in-memory scheduler and when you need tasks to execute at a specific second (in other words, if you start doing math to compute the duration of your timer so that it fires at a specific time, use this instead). If you have multiple services load balanced to execute tasks, this isn’t for you. </p> <p>Here’s all that’s required to schedule a task (write console output) to execute every ten seconds:</p> <blockquote> <pre>var s = new Schedule()
.AtSeconds(0, 10, 20, 30, 40, 50)
.WithLocalTime()
.Execute<ConsoleWriteTask>();<br /></pre>
<p><font face="Courier New">SchedulerRuntime.Start(s); </font></p>
</blockquote>
<p>Creating your own tasks is just as easy—implement ITask, which has an Initialize method and a Handle method that is called at the scheduled time.</p>
<p>It compiles to an 18KB assembly, has no external (non-framework) dependencies, and is just over 250 lines of code. Add clean, simple scheduling to your .NET application.</p> Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0tag:blogger.com,1999:blog-8102723.post-63556956806220762272010-11-14T19:19:00.001-06:002010-11-14T19:21:38.439-06:00Travis Cooks<p>I started a new blog over at <a href="http://www.traviscooks.com/">www.traviscooks.com</a>. Imagine me with a cameraphone uploading quick summaries of what I'm cooking.</p>
<p>On the subject of food, I run <a href="http://www.kefirpedia.org/">Kefirpedia.org</a>, a site where I drop all of my knowledge and research about kefir. If you don't know what kefir is, it's a wonderful probiotic fermented milk beverage—imagine a super yogurt.</p>Travishttp://www.blogger.com/profile/04336404952882579145noreply@blogger.com0