tag:blogger.com,1999:blog-86226022047688653392024-02-19T03:55:09.831-08:00rabble.ruleDave Dunkin's blog.Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.comBlogger47125tag:blogger.com,1999:blog-8622602204768865339.post-79470071371718769222011-07-13T17:57:00.000-07:002011-07-13T19:20:12.425-07:00Peace and CourageA little over a year ago, when my wife was pregnant with our youngest daughter, Tamara's doctor noticed a vascular abnormality on an ultrasound. A couple days later we took "Baby Daisy" to see the neonatal specialists for our region of the country. The doctors informed us that the vein in the baby's liver that brings blood from the umbilical cord had not formed properly. A baby with that condition should not have survived to that point in the pregnancy, but Daisy was unexplainably growing. The doctors also advised us that based on her condition and several other factors, Daisy was at increased risk for genetic disease. We were encouraged to have in utero genetic testing; the doctor's opinion, which she expressed to us as truth, was that it would be unethical to bring a baby to term if the baby had some sort of severe genetic disease.<br /><br />Tamara and I left the hospital distraught. We prayed for the health of our baby, for her miraculous healing and for wisdom for ourselves. After a couple days of prayer, the peace came. It came on strong. I knew God was in control and that he would use the circumstances for his glory. With the peace came something I didn't expect: courage. I had courage like I've never had courage before -- courage to make the right choice, regardless of the doctors' or anyone else's opinions about which lives should be given the chance to live.<br /><br />Thanks to the prayers of so many friends, family and strangers who heard our story, Baby Daisy was miraculously healed. When we went back to the specialists, the vein that we were told hadn't formed was found taking an alternate route through the liver. One of the doctors we met with with so unconcerned with Diasy's condition that we spent more time talking about iPhones than Daisy.<br /><br />One year ago today, Alexandra Daisy Sue Dunkin was born a perfectly healthy little girl. We are delighted and blessed to have her as part of our family and to be able to share our story of God's faithfulness.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzdg27fWX6Y29YwBj7FZlhHwAt02qtmgmxvdl3scUyyGyXHC1hHTqaP5mLxGHGJN_0-azZs0_Vff3xfqVShhK8LRhSqG5dC3NHoHCRJAxTOcoJCXs3SHuqNM2qGH0qr0Ynr5IRa4Jj3M-D/s1600/IMG_4513.JPG"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 214px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzdg27fWX6Y29YwBj7FZlhHwAt02qtmgmxvdl3scUyyGyXHC1hHTqaP5mLxGHGJN_0-azZs0_Vff3xfqVShhK8LRhSqG5dC3NHoHCRJAxTOcoJCXs3SHuqNM2qGH0qr0Ynr5IRa4Jj3M-D/s320/IMG_4513.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5629025997102367922" /></a>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com1tag:blogger.com,1999:blog-8622602204768865339.post-56377322482764095932011-04-22T17:17:00.000-07:002011-04-22T17:25:22.524-07:00A Free Gift That Wasn't FreeNot too long ago I read <a href="http://www.amazon.com/Free-Future-Radical-Chris-Anderson/dp/1401322905">Free: The Future of a Radical Price</a> by Chris Anderson. One of the ideas presented was that when things are <a href="http://biblia.com/bible/esv/Ro6.23">offered to you for free</a>, they usually <a href="http://biblia.com/bible/esv/Mt27.50">cost someone else</a>. Something to think about this Good Friday.Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-77412747904178670572010-08-25T17:04:00.000-07:002010-08-25T17:08:14.392-07:00Worthless Comments<pre>/// <summary>Gets the foo</summary><br />/// <param name="bar">the bar</param><br />/// <returns>the foo</returns><br />Foo GetFoo(Bar bar) {<br /> ...<br />}<br /></pre><br /><br />I'm not saying I've never done it, but I usually end up deleting them later.Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-2329801326601789612010-08-19T17:23:00.001-07:002010-08-19T17:50:00.623-07:00Misleading WCF MSMQ Binding ErrorI was getting the following error message when activating a WCF service with a net.msmq binding.<br /><blockquote>Binding validation failed because the endpoint listen URI does not represent an MSMQ direct format name. The service host cannot be opened. Make sure you use a direct format name for the endpoint's listen URI.</blockquote><br />You'd think this had something to the endpoint URI, but you'd be wrong. A little sleuthing revealed WCF trying to validate that it could move the message to the retry subqueue in the event of an error. The queue is hosted on a Windows Server 2003 system, which doesn't support the retry subqueue. I'm testing my WCF service is on Vista. Solution: run the queue and WCF service on the same level OS and curse Microsoft for misleading error messages.Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-75891786941367499902010-08-16T18:02:00.000-07:002010-08-16T18:02:00.183-07:00Smartphone Install BaseThere's been a lot of buzz about Android's amazing growth in the last quarter. Assuming the vast majority of customers don't buy a new phone more often than every two years, the install base would reflect the sum of sales over the last 8 quarters.<br /><br /><h3>Worldwide Smartphone Sales to End Users by OS 3Q08-2Q10 (Thousands of Units)</h3><table><tbody><tr><td>Symbian</td><td>166,463.3</td><td>46%</td></tr><tr><td>RIM</td><td>69,370.6</td><td>19%</td></tr><tr><td>iOS</td><td>50,791.9</td><td>14%</td></tr><tr><td>Windows Mobile</td><td>30,596.9</td><td>8%</td></tr><tr><td>Android</td><td>22,619.2</td><td>6%</td></tr><tr><td>Linux</td><td>17,440.4</td><td>5%</td></tr><tr><td>Other</td><td>5,699.6</td><td>2%</td></tr></tbody></table><br /><br />Note this doesn't include business sales, which would likely boost RIM a lot and iOS a little. Nor does this include devices other than phones, e.g. iPod touch and iPad.Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-53855175769983806972010-07-20T20:21:00.000-07:002010-07-20T23:38:28.562-07:00How a $2 iPhone app restored my love for photographyIn 2004 I bought a digital SLR camera for a trip to Hawaii and my journey into photography began. I took photos of mountains, fields, barns, flowers and occasionally people. I read books on exposure, composition and posing. Eventually I took some family portraits, engagement portraits and even a couple small weddings. My collection of lenses, lights, filters and other accessories evolved until I had just about everything to take whatever kind of photo I could imagine myself taking. I honed my technique and looked with a critical eye at every photo I or anyone else took.<br /><br />In 2006 my wife and I went on safari in Kenya. I took thousands of photos, mostly of animals. I did a pretty good job, too. They're not going to appear in National Geographic, but I was pretty happy with them and I'm pretty picky. When I got home from Africa, I hit a photographic wall. Nothing seemed interesting anymore because I felt I couldn't top what I had done before. I'd peaked two years into my life as an amateur photographer. So I stopped taking photos.<br /><br />Then about two weeks ago, my wife asked me about buying an iPhone app called Hipstamatic, which she had seen a few of her friends use. She got it and took a few photos. Then I installed it on my phone. I got hooked.<br /><br /><a href="http://hipstamaticapp.com/">Hipstamatic</a> is cool for a few reasons. It looks and feels kinda like a camera, which is fun. It makes you choose how your photo will look before you take the photo, like with a film camera. Different lenses, flashes and films produce different effects. The alternative -- endlessly tweaking a photo in Photoshop, applying filter after filter -- sucks the joy out of the photo. I love the simplicity that Hipstamatic provides in this regard.<div><br /></div><div>All the photos it produces have imperfections that are modeled after imperfections from real film photographic equipment. The imperfections keep me from focusing on making a technically perfect photo and instead focus on making an emotive photo. To that extent, Hipstamatic is really good at creating photos that evoke emotion, specifically nostalgia. The photos look like the ones in my parents shoe box or on my grandma's end table. The blurred edges and yellow tint of the photo of my daughter makes me remember her smile a little sweeter. I can hear my son's laugh through the blue cast and faux film frame.<div><br /></div><div>This $2 app is also cool because it makes me want to buy the other lenses and flashes, just like I did on my real photography journey. Except this time, the lenses are $.99 instead of $499. Hipstamatic is the fist app that has compelled me, a total cheapskate, to make an in-app purchase.</div><div><br /></div><div>I do hope I can transfer my renewed enthusiasm for photography from my iPhone to my DSLR. I do have quite a bit of money invested in all that equipment and it's not doing me any good sitting on a shelf when I should be using it to record memories.<br /><br /> </div></div>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com1tag:blogger.com,1999:blog-8622602204768865339.post-40516501856262567772010-07-08T16:25:00.000-07:002010-07-08T17:34:03.810-07:00WCF .NET MSMQ Binding URLs<p>I spent some time struggling with a WCF service with a .NET MSMQ binding. The public queue resided on a test Windows Server 2003 machine. Everything worked fine on my machine, but when I installed the WCF service on the test server, I got the following error message:</p><p><i>An error occurred while opening the queue: The queue does not exist or you do not have sufficient permissions to perform the operation. (-1072824317, 0xc00e0003). The message cannot be sent or received from the queue. Ensure that MSMQ is installed and running. Also ensure that the queue is available to open with the required access mode and authorization.</i></p><p>The error code (0xc00e0003) corresponds to MQ_ERROR_QUEUE_NOT_FOUND.</p><p>Turns out, I needed to reference the queue with net.msmq://server/queue instead of net.msmq://server/public/queue. It's unfortunate the latter URL works in some cases but not others.</p>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-53730675514044867692010-06-01T11:21:00.000-07:002010-06-01T13:01:13.880-07:005 Device Categories<div>Computing devices tend to fit into one of these categories, based on the device's physical characteristics:</div><ol><li>Stuff that fits in your pocket (e.g. phone)</li><li>Stuff that you can carry around comfortably (e.g. tablet)</li><li>Stuff that you can carry around in a bag (e.g. laptop)</li><li>Stuff that you can fit in a back seat (e.g. desktop)</li><li>Stuff that requires a truck to move (e.g. rack of servers)</li></ol><div>Devices should be optimized for their category. If you want something that will fit in your pocket, you want the best thing that will fit in your pocket, but not so small that you'll lose it. If you're going to carry around a laptop bag, you want the best laptop, but you don't want something so big that it's too heavy or so small that you might as well just use your phone.</div><div><br /></div><div>I don't get some of these new devices, like the <a href="http://en.community.dell.com/dell-blogs/b/direct2dell/archive/2010/05/25/dell-streak-the-versatile-5-inch-android-tablet.aspx">Dell Streak</a>, that are just a little too big to fit in your pocket. I think the Nokia MIDs are there too. Once you move into category #2, you might as well make the most of it. I think netbooks are right in between 2 and 3. They could be carried by themselves, but they're awkward to use with one hand and you often have to bring a power brick along. That's why they're really only attractive from a price standpoint.</div><div><br /></div><div>Of course that pricing thing plays a big role in decisions, too, which is a significant factor in there being such a broad spectrum within each category.</div>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-32197749154095317982010-06-01T00:16:00.001-07:002010-06-01T00:18:09.823-07:00How to make a horrible Infographic<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQPWuv56zPM6rBcQCEfTHM8KdYARbXjHOu0zuPjSNXujvErgNmj5NUjf7uW7J8Xclmk2BVDBQ-7cZC-JJvzV7Qf9_86B1mQjjdcGMwjcJ_IdKkb3bwZL-b4odKde9kC5N0WJ9SC0f5yi_6/s1600/Infographic.png"><img style="cursor:pointer; cursor:hand;width: 121px; height: 320px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQPWuv56zPM6rBcQCEfTHM8KdYARbXjHOu0zuPjSNXujvErgNmj5NUjf7uW7J8Xclmk2BVDBQ-7cZC-JJvzV7Qf9_86B1mQjjdcGMwjcJ_IdKkb3bwZL-b4odKde9kC5N0WJ9SC0f5yi_6/s320/Infographic.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5477700933699691762" /></a>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-15567243108405422092010-03-31T17:12:00.000-07:002010-03-31T17:22:03.185-07:00Dewey Griffin Loses a Customer ForeverI just had Dewey Griffin do some recall work on my Subaru to fix a fuel leak. The mechanic broke a gasket while removing a part. They didn't have another one and had to order it, leaving me without a car for the day. I understand that stuff happens, but here's what I don't understand: they charged me for the gasket. I argued with the service manager, Jim Clark, but he wouldn't budge. He acknowledged that the gasket would not have broken if they hadn't done the work but because Subaru wouldn't reimburse him he chose to charge me. Congratulations, Jim, you got your $9.74 and lost a customer forever.Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com2tag:blogger.com,1999:blog-8622602204768865339.post-53473201636995954632010-02-09T12:00:00.000-08:002010-05-31T15:49:49.614-07:00How will the iPad's success be defined?I've had a lot of conversions with people lately about whether or not the iPad would be successful. The problem with these conversations is that we didn't talk about what success looks like.<div><br /></div><div>Is success 1 million units first week sales? Nexus One did 20k units, Droid 250k, iPhone 3GS 1.6M (from <a href="http://blog.flurry.com/bid/29658/Flurry-Special-Report-Google-Nexus-One-Launch-Week-Sales">Flurry</a>). Apple sold 75M iPhone and iPod touch devices in 2009. About 20M netbooks were sold in 2009. Apple sold about 6M Apple TVs in 2009, and that's "just a hobby" for them.</div><div><br /></div><div>Maybe initial sales don't matter and the iPad will be judged by its adoption 3 years from now, by the copycats it inspires or by the way changes the personal computer industry. After all, Apple reinvented the desktop PC industry once, but ultimately lost it to Microsoft. I doubt they will make the same mistake again.</div><br /><div><strong>Update:</strong>Apple just announced 2 million units sold in the first 60 days. It took over two years for Apple to sell its first 2 million iPods. The original iPhone took about four months to reach the 2 million mark. I'd call the iPad's launch a success.</div>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com2tag:blogger.com,1999:blog-8622602204768865339.post-40586681608653420562010-02-09T08:00:00.000-08:002010-02-08T20:42:34.722-08:00iPad Swivel Camera<div>I have a theory as to why the iPad does not have a built in camera. I think Apple will announce a camera accessory that plugs into the dock connector and swivels 180 degrees to point forward or backward. There is no "up" on the iPad -- all orientations are required to be supported by applications -- so it does not matter that the dock connector is on the "bottom" of the device. In the front-facing position, the camera would enable video chat. Turn it around and you can take pictures with the gazillion iPhone apps with that function built in. This solves the <a href="http://www.appleinsider.com/articles/08/03/24/rumor_digg_founder_claims_3g_iphone_to_do_video_chat.html">two camera problem</a>, gives people the camera functions they want, and gives Apple another high-markup item to sell.</div><div><br /></div>P.S. Sorry for the slew of iPad posts, but I think it's a pretty cool device.Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-57236958430241570292010-02-08T21:00:00.000-08:002010-02-08T21:49:17.431-08:00Throwaway VoteRight before a past election, someone asked who I was going to vote for. This person was supporting the Republican candidate. I told the person I was going to vote for the Constitution Party candidate. The person replied something to the effect of, "well it's a throwaway vote, but it's good that you're voting on principle."<div><br /></div><div>I was offended. The only throwaway votes are the ones that aren't cast. In that election, the Republican candidate was as likely to win as my left shoe.</div><div><br /></div><div>I think it's a real shame that people evaluate candidates based solely on party affiliation, not on their records. People vote on a candidate that shares their values and is likely to win. It seems too often the second part outweighs the first part.</div><div><br /></div><div>I wonder if <a href="http://en.wikipedia.org/wiki/Instant-runoff_voting">instant-runoff voting</a> would help with this problem. It would be interesting to see the results of an exit poll that used IRV compared to the actual election results. I wouldn't expect the results to be that much different, though, because I think voters are much less likely to have even considered a third party candidate who does not have a realistic chance of winning. Third party candidates also don't have the financial support to get the same exposure as the two big parties.</div>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com2tag:blogger.com,1999:blog-8622602204768865339.post-27889143112920906612010-01-31T15:21:00.000-08:002010-02-01T10:52:54.061-08:00iPad Fills the Gap<div>Apple's line up is just good business. They need something to sell in the $500-1000 range and are unwilling to produce a cheaper laptop that compromises their standards and would tarnish their reputation. The iPad fits in there just perfectly. It fills the gap and completes the progression from a simple music player to a full blown computer. Whatever you're looking for and whatever your budget, they've got something to sell you. For only a little bit more, they've got something even better to sell you.</div><ul><li>$59 - iPod shuffle 2GB</li><li>$79 - iPod shuffle 4GB</li><li>$149 - iPod nano 8GB</li><li>$179 - iPod nano 16GB</li><li>$199 - iPod touch 8GB</li><li>$299 - iPod touch 16GB</li><li>$399 - iPod touch 64GB</li><li>$499 - iPad 16GB</li><li>$599 - iPad 32GB</li><li>$699 - iPad 64GB</li><li>$729 - iPad 3G 32GB</li><li>$829 - iPad 3G 64GB</li><li>$999 - MacBook</li></ul><div>I don't see Apple selling a laptop for less that $999 anytime in the foreseeable future.</div><div><br /></div><div>Plus, for whatever device they sell you, they've got content to sell you as well.</div>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-14057378211399768982010-01-28T08:54:00.000-08:002010-02-01T10:52:43.701-08:00Apple Reinvents Yet Another CategoryApple is on a roll. While the iPad very much underwhelmed me (what could have lived up to all the hype?), I still think it will redefine the category and make it better for everyone.<div><br /></div><div>Way back when, Apple brought the GUI to the personal computer and to the masses. They didn't invent the personal computer. They didn't invent the GUI. They did make a great product that set the direction of human-computer interaction for the next few decades. Apple wasn't able to capitalize on what they accomplished and are now somewhere around 5% of the PC market share.</div><div><br /></div><div>Apple didn't invent the MP3 player. They reinvented it by making it easy to use and cool. They now own the portable music player market. Apple didn't just reinvent the way we listen to music, they reinvented the music market place with the iTunes store.</div><div><br /></div><div>Apple didn't invent the mobile phone, nor the PDA. They didn't invent the touch screen. They did put them together in a way nobody really expected. (This is starting to sound like a 3M commercial.) The iPhone is extremely elegant and easy to use. It set a new model for human-computer interaction, one dictated largely by the size and power constraints of the device. No pointer, no windows, no drop-down menus, no multitasking, limited typing. The result is a set of task-focused applications that are pretty darn intuitive. It's not how we were used to interactive with a phone, nor a desktop or laptop. In many ways, it's better. Apple took the opportunity to simplify for the better. No file management, minimal configuration, no confusion about how to install or remove applications.</div><div><br /></div><div>The iPad is just a big iPod Touch. That's disappointing in some ways. But it's also what makes the iPad awesome. To appreciate this awesomeness, one first has to understand why tablet PCs have sucked. The big reason: Windows. The problem with Windows (and Windows apps) is that it wasn't designed for use with the constraints a tablet imposes; it is ill-suited for use on a device without a pointing device, keyboard and relatively large screen. The same would be true of Linux/Gnome/KDE or Mac OS.</div><div><br /></div><div>The physical constraints of the iPhone required the iPhone OS designers to rethink how to build applications. It turned out these simplified, task focused applications were really easy to use. I found myself using Safari, Mail and Facebook on my iPhone even though my MacBook was sitting right next to me. There are many tasks which do not require the complexity of desktop applications, but do need more screen real estate than an iPhone. There has also been a shift over the last 15 years or so from using computers for content production to content consumption. This is where the iPad fits perfectly. You're not going to write a textbook on the iPad, but you may read one. You're not going to use Photoshop on the iPad to edit a photo shoot for a magazine, but you may view it with the iPad. The iPad will not replace the desktop computer and everything it does, but it can replace it for what most people casually use a desktop for. Apple successfully reinvented the tablet computer.</div><div><br /></div><div>Whether or not this version of the iPad is wildly successful is irrelevant. Apple will inspire copycats who will take the design and build on it, as Google has done with Android. This will make Apple up its game. Everyone wins.</div><div><br /></div><div><br /></div>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-8284134531848587702010-01-07T21:55:00.000-08:002010-01-10T08:51:43.146-08:00iPhone Bible App Comparison<p>I thought it might be useful to have a feature comparison of all the major Bible apps available for the iPhone. I've attempted to be unbiased, but I do work for Logos on <a href="http://www.logos.com/iphone">Logos Bible Software for iPhone</a> so take that for what it's worth. If I've made a mistake, please let me know and I'll correct it. If I've omitted a feature that is significant and distinctive, please let me know and I'll add it to the matrix.</p><p>(Updated 1/10/2010 8:51 AM PST)</p><p><span style="font-family:Georgia,serif;"> </span></p><div> <table class="" id="xifz" style="text-align: center; color: rgb(0, 0, 0);" border="1" cellpadding="3" cellspacing="0" width="100%"> <tbody> <tr> <td style="text-align: center; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <b><span style="font-size:100%;"><br /></span></b> </td> <td style="text-align: center; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <b><span style="font-size:100%;"><a href="http://www.logos.com/iphone">Logos</a></span></b> </td> <td style="text-align: center; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <b><span style="font-size:100%;"><a href="http://www.olivetree.com/iphone/">BibleReader</a></span></b> </td> <td style="text-align: center; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <b><span style="font-size:100%;"><a href="http://www.laridian.com/iphone/">PocketBible</a></span></b> </td> <td style="text-align: center; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <b><span style="font-size:100%;"><a href="http://www.youversion.com/mobile/iphone">YouVersion</a></span></b> </td> <td style="text-align: center; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <b><span style="font-size:100%;"><a href="http://www.peejstudio.com/iphone/holybible.php">Paul Avery Bible</a></span></b> </td> <td style="text-align: center; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <b><span style="font-size:100%;"><a href="http://mantisbible.com/">Mantis</a></span></b> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;">Free books<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">61</span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">150</span><span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">39</span><span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">41</span><span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">20</span><span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">43<br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Available books </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> ~3000 </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">500+ </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> 256<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> 41<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> 20<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> 190<br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Free modern translations </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;">Commentaries</span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">x</span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">x</span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">x</span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">x<br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;">Dictionaries</span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">x</span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">x<br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" valign="top"> <span style="font-size:100%;"> Maps/Media<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;">x </span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"> x<br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Bookmarks </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x</span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Notes </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> (read-only)<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" valign="top"> <span style="font-size:100%;"> Notes syncing<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"> Evernote<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"> YouVersion.com<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"><br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Highlighting </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Search </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" valign="top"> <span style="font-size:100%;"> Reading plans<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" valign="top"> <span style="font-size:100%;"> x<br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Original language tools*</span></td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Works offline </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> reader only </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> some books </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x </span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Social sharing<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Events<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> </tr> <tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"> <span style="font-size:100%;"> Split screen<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"> x<br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> </tr><tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"><span style="font-size:100%;">Passage Guide*</span></td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">x </span> </td> <td style="text-align: center;" width="14.285714285714286%"><span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"><span style="font-size:100%;"><br /></span> </td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;"><br /></span> </td> </tr><tr> <td style="text-align: left; background-color: rgb(207, 226, 243);" width="14.285714285714286%"><span style="font-size:100%;">Paging/scrolling</span></td> <td style="text-align: center;" width="14.285714285714286%">Paging</td> <td style="text-align: center;" width="14.285714285714286%"><span style="font-size:100%;">Either </span></td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">Paging </span></td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">Scrolling </span></td> <td style="text-align: center;" width="14.285714285714286%"><span style="font-size:100%;">Scrolling </span></td> <td style="text-align: center;" width="14.285714285714286%"> <span style="font-size:100%;">Scrolling </span></td> </tr> </tbody> </table> <div style="text-align: center;"> </div> </div> <div style="text-align: center;"><br /></div>* Original language tools are tools to get more information out of original language books or original language data in English books, not just having original language resources. E.g., Logos' Bible Word Study can bring up a lot of information about the original word used from a modern Bible translation. Logos' Passage Guide and Greek and Hebrew word study tools are very powerful study tools that you need really need to see to appreciate. <p></p>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com7tag:blogger.com,1999:blog-8622602204768865339.post-79927975917165211032009-12-13T10:34:00.000-08:002009-12-13T10:35:13.524-08:00Christmas partyMy company Christmas party was Friday night. I wore a gray shirt and red tie. I'm documenting it here so I don't wear the exact same thing next year. Good day.Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-5881901483530841322009-11-01T22:44:00.000-08:002010-02-01T10:52:32.313-08:00The Next Level of Bible StudyIt occurred to me while working on the <a href="http://www.logos.com/iphone">Logos iPhone app</a> that there have been a number of technologic breakthroughs over the last few thousand years that have been transformative in how they advance the study of scripture.<ul><li>Translation of the Bible into one's own language.</li><li>Printing of the Bible providing a cheap, portable copy.</li><li>Computerization of the Bible, indexing for search and linking to other resources.</li></ul><div>I think now we have reached the next level of Bible study tooling. With the Logos iPhone app you have a mobile library that fits in your pocket. There many different translations of the Bible, original language texts, reverse interlinears and text comparisons. There are help resources such as dictionaries, commentaries, charts and maps. Everything is cross referenced. Everything is indexed for nearly instantaneous search. Because it is an Internet-based application, it is virtually infinitely expandable.</div><div><br /></div><div>Think about that for a minute. In my pocket, right now, is a device that provides me a virtually infinite amount of information useful for Bible study, presented in an easy to use, organized manner. It blew my mind a little bit when I realized that.</div><div><br /></div><div>I think the Logos iPhone app represents the next technological breakthrough that takes Bible study to another level. But at Logos, we're never satisfied. Wait until you see how we can use these tools to help people not only more and better Bible study, but also also help people do more of it <i>together</i>.</div>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-71957943972887733772009-11-01T16:00:00.000-08:002009-11-13T16:17:20.562-08:00We got the Logos iPhone app through on the first tryI didn't expect it to happen, but <a href="http://www.logos.com/iphone">Logos Bible Software for the iPhone</a> was accepted 15 days after the first submission. Woo hoo! <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=336400266&mt=8">Find it in the App Store. It's FREE.</a> We already have an update in the works that will fix a few annoyances and we'll be submitting that soon.<br /><br /><a href="http://itunes.apple.com/us/app/logos-bible/id336400266?mt=8&uo=6"><img height="15" width="61" alt="Logos Bible" src="http://ax.itunes.apple.com/images/badgeitunes61x15dark.gif" /></a>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-87220981378492114522009-08-05T22:16:00.000-07:002009-08-06T22:17:02.976-07:00Detecting a swipe in WebKitI was a bit surprised that there wasn't a built-in swipe event for iPhone web apps or an easy to find library to detect one, so I wrote one based on the <a href="http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html">Mobile Safari documentation</a>.<br /><br />You may need to tweak the vertical threshold (15) or horizontal threshold (50).<br /><br /><pre><br />/**<br /> * You can identify a swipe gesture as follows:<br /> * 1. Begin gesture if you receive a touchstart event containing one target touch.<br /> * 2. Abort gesture if, at any time, you receive an event with >1 touches.<br /> * 3. Continue gesture if you receive a touchmove event mostly in the x-direction.<br /> * 4. Abort gesture if you receive a touchmove event mostly the y-direction.<br /> * 5. End gesture if you receive a touchend event.<br /> * <br /> * @author Dave Dunkin<br /> * @copyright public domain<br /> */<br />function addSwipeListener(el, listener)<br />{<br /> var startX;<br /> var dx;<br /> var direction;<br /> <br /> function cancelTouch()<br /> {<br /> el.removeEventListener('touchmove', onTouchMove);<br /> el.removeEventListener('touchend', onTouchEnd);<br /> startX = null;<br /> startY = null;<br /> direction = null;<br /> }<br /> <br /> function onTouchMove(e)<br /> {<br /> if (e.touches.length > 1)<br /> {<br /> cancelTouch();<br /> }<br /> else<br /> {<br /> dx = e.touches[0].pageX - startX;<br /> var dy = e.touches[0].pageY - startY;<br /> if (direction == null)<br /> {<br /> direction = dx;<br /> e.preventDefault();<br /> }<br /> else if ((direction < 0 && dx > 0) || (direction > 0 && dx < 0) || Math.abs(dy) > 15)<br /> {<br /> cancelTouch();<br /> }<br /> }<br /> }<br /><br /> function onTouchEnd(e)<br /> {<br /> cancelTouch();<br /> if (Math.abs(dx) > 50)<br /> {<br /> listener({ target: el, direction: dx > 0 ? 'right' : 'left' });<br /> }<br /> }<br /> <br /> function onTouchStart(e)<br /> {<br /> if (e.touches.length == 1)<br /> {<br /> startX = e.touches[0].pageX;<br /> startY = e.touches[0].pageY;<br /> el.addEventListener('touchmove', onTouchMove, false);<br /> el.addEventListener('touchend', onTouchEnd, false);<br /> }<br /> }<br /> <br /> el.addEventListener('touchstart', onTouchStart, false);<br />}<br /><br /></pre><br /><br />Use it like this:<br /><pre><br />addSwipeListener(document.body, function(e) { alert(e.direction); });<br /></pre>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com8tag:blogger.com,1999:blog-8622602204768865339.post-36554030511877138572009-07-10T11:46:00.000-07:002009-07-10T11:46:04.654-07:00Alen's Notes: Removing http://tempuri.org Namespace From WSDL<a href="http://alensiljak.blogspot.com/2009/06/removing-httptempuriorg-namespace-from.html">Alen's Notes: Removing http://tempuri.org Namespace From WSDL</a><br /><br />This is the part I always forget:<br />"Add bindingNamespace=ā€¯MyServiceNamespaceā€¯ to each endpoint definition in the Web.config file."Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-35381975876539284932009-07-02T11:45:00.000-07:002009-07-02T11:52:23.589-07:00Logos Bible GiveawayLogos is giving away some nice dead-tree Bibles to promote the <a href="http://www.eia.doe.gov/cneaf/electricity/epa/epates.html">coal-powered</a> <a href="http://bible.logos.com/">Bible website</a> I've been very involved with.<br /><br />Here are the details:<br /><br /><blockquote><a href="http://www.logos.com/">Logos Bible Software</a> is celebrating the launch of their new <a href="http://bible.logos.com/ ">online Bible</a> by giving away <a href="http://bible.logos.com/content/giveaway">72 ultra-premium print Bibles</a> at a rate of 12 per month for six months. The <a href="http://bible.logos.com/content/giveaway">Bible giveaway</a> is being held at <a href="http://bible.logos.com/content/giveaway">Bible.Logos.com</a> and you can get up to five different entries each month! After you enter, be sure to check out <a href="http://www.logos.com/">Logos</a> and see how it can revolutionize your <a href="http://www.logos.com/demo">Bible study</a>.</blockquote>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-87522672875765340432009-04-29T10:57:00.000-07:002009-04-29T11:04:38.687-07:00Global Search and Replace with PerlI've used this article for reference many times before, but it is no longer available. I've reproduced it from an archive.org copy.<br /><br />(source: <a href="http://web.archive.org/web/20030501103834/http://hacks.oreilly.com/pub/h/73">http://hacks.oreilly.com/pub/h/73</a>)<br /><br /><br /><br />There are a couple of switches that make Perl a very useful command-line editing tool. Learn these switches, and you too can learn how to mumble magic Perl one-liners to confound your friends (and frighten your project manager).<br /> <br />The first is <em class="filename">-e</em>. Give Perl a <em class="filename">-e</em> followed by a line of code, and it will run it as if it were an ordinary Perl script:<br /> <br /><blockquote><pre class="code">rob@catlin:~$ <b class="emphasis-bold">perl -e 'print "Hi, Ma!\n"'</b> <br />Hi, Ma!</pre></blockquote> <br /> <br />Note that a trailing <b class="emphasis-bold">;</b> isn't needed on one-liners. It's generally a good idea to wrap your line in single quotes to prevent the shell from attempting to interpret special characters (like the <tt class="literal">!</tt> and <tt class="literal">\</tt> above).<br /> <br />The next switch is a little more complicated, it but becomes second nature once you start using it:<em class="filename"> -p</em>. From perldoc perlrun:<br /> <br /><blockquote><pre class="code"><b class="emphasis-bold">-p</b> causes Perl to assume the following loop around your<br />program, which makes it iterate over filename arguments somewhat like <b class="emphasis-bold">sed</b>:<br /> <br />LINE:<br />while (<>) {<br />... # your program goes here<br />} continue {<br />print or die "-p destination: $!\n";<br />}</pre></blockquote> <br /> <br />The line in question (<tt class="literal">$_</tt>) is automatically printed on every iteration of the loop. If you combine <em class="filename">-p</em> and <em class="filename">-e</em>, you get a one-liner that iterates over every file on the command line or on the text fed to it on STDIN. For example, here's a complicated <em class="filename">cat</em> command:<br /> <br /><blockquote><pre class="code">rob@catlin:~$ <b class="emphasis-bold">perl -pe 1 /etc/hosts</b> <br />#<br /># hosts This file describes a number of hostname-to-address<br /># mappings for the TCP/IP subsystem.<br />#<br /> <br /># For loopbacking.<br />127.0.0.1 localhost</pre></blockquote> <br /> <br />The <em class="filename">1</em> is just a return code (as if you entered <tt class="literal">1;</tt> in a Perl script, which is equivalent to <tt class="literal">return 1;</tt>). Since the lines are printed automatically, we don't really need the program we specify with <em class="filename">-e</em> to do anything.<br /> <br />Where it gets interesting is in providing a bit of code to manipulate the current line before it gets printed. For example, suppose you wanted to append the local machine name to the localhost line:<br /> <br /><blockquote><pre class="code">rob@catlin:~$ <b class="emphasis-bold">perl -pe 's/localhost/localhost $ENV{HOSTNAME}/' /etc/hosts</b> <br />#<br /># hosts This file describes a number of hostname-to-address<br /># mappings for the TCP/IP subsystem.<br />#<br /> <br /># For loopbacking.<br />127.0.0.1 localhost catlin.nocat.net</pre></blockquote> <br /> <br />or maybe you'd like to manipulate your <em class="filename">inetd</em> settings:<br /> <br /><blockquote><pre class="code">rob@caligula:~$ <b class="emphasis-bold">perl -pe 's/^(\s+)?(telnet|shell|login|exec)/# $2/' \ /etc/inetd.conf</b></pre></blockquote> <br /> <br />That will print the contents of <em class="filename">/etc/inetd.conf</em> to STDOUT, commenting out any uncommented <em class="filename">telnet</em>, <em class="filename">shell</em>, <em class="filename">login</em>, or <em class="filename">exec</em> lines along the way. Naturally, we could redirect that back out to a file, but if we just want to edit a file in place, there's a better way: the <em class="filename">-i</em> switch.<br /> <br /><em class="filename">-i</em> lets you edit files in place. So, to comment out all of the above lines in <em class="filename">/etc/inetd.conf</em>, you might try:<br /><br /><blockquote><pre class="code">root@catlin:~# <b class="emphasis-bold">perl -pi -e 's/^(\s+)?(telnet|shell|login|exec)/# $2/' /etc/inetd.conf</b></pre></blockquote> <br /> <br />or better yet:<br /> <br /><blockquote><pre class="code">root@catlin:~# <b class="emphasis-bold">perl -pi.orig -e 's/^(\s+)?(telnet|shell|login|exec)/# $2/' /etc/inetd.conf</b></pre></blockquote> <br /> <br />The second example will backup <em class="filename">/etc/inetd.conf</em> to <em class="filename">/etc/inetd.conf.orig</em> before changing the original. Don't forget to HUP <em class="filename">inetd</em> to make your changes take.<br /> <br />It's just as easy to edit multiple files in place at the same time. You can specify any number of files (or wildcards) on the command line:<br /> <br /><blockquote><pre class="code">rob@catlin:~$ <b class="emphasis-bold">perl -pi.bak -e 's/bgcolor=#ffffff/bgcolor=#000000/i' *.html</b></pre></blockquote> <br /> <br />This will change the background color of all html pages in the current directory from white to black. Don't forget that trailing <tt class="literal">i</tt> to make the match case insensitive (to match bgcolor=#FFFFFF or even BGColor=#FfFffF).<br /> <br />What if you're in the middle of working on a CVS project, and need to change the CVS server that you'd like to commit to? It's easy, if you pipe the output of a <em class="filename">find</em> through an <em class="filename">xargs</em> running a <em class="filename">perl -pi -e</em>:<br /> <br /><blockquote><pre class="code">schuyler@ganesh:~/nocat$ <b class="emphasis-bold">find -name Root | xargs perl -pi -e <br /> 's/cvs.oldserver.com/cvs.newserver.org/g'</b></pre></blockquote> <br /> <br />Then reset your $CVSROOT and do your CVS check in as normal, and your project will automagically end up checked into <em class="emphasis">cvs.newserver.org</em>.<br /> <br />Using Perl from the command line can help you do some powerful transformations on the fly. Study your regular expressions, and use it wisely, and it can save piles of hand edits.Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-30979178484700655252009-04-23T14:04:00.001-07:002009-04-23T14:07:42.165-07:00Do you chew gum you find on the street?I came across this the other day and found it quite amusing and very true:<br /><blockquote><span style="font-weight:bold;">Scott's Rule of Programming - Rule# 0x3eA</span><br />Just because code is on the Internet doesn't mean you should cut and paste it into your production system. Do you chew gum you find on the street? Give code you find on the 'NET the same amount of attention you'd give advice scrawled on a public bathroom wall.<br />-- <a href="http://www.hanselman.com/blog/PermaLink.aspx?guid=e73efd87-2cae-49af-9674-7076a054f2ca">Scott Hanselman</a></blockquote>Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0tag:blogger.com,1999:blog-8622602204768865339.post-40533540124251476452009-04-22T09:28:00.000-07:002009-04-22T09:32:35.123-07:00Adventures in parentingFrustrated because my coffee and oatmeal were now quite cold and my daughter (6 months) would not let me put her down, I turned to my son (21 months) and said, "Ugh! Why does your sister require constant attention?" He replied, "baby sorry, baby sorry."Dave Dunkinhttp://www.blogger.com/profile/13210798101484506505noreply@blogger.com0