tag:blogger.com,1999:blog-109460872024-03-12T20:30:56.136-07:00MetaDeveloperDavid Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.comBlogger354125tag:blogger.com,1999:blog-10946087.post-43534839739797891442011-06-20T05:25:00.001-07:002011-06-20T05:36:10.362-07:00NDC 2011<h2><font color="#0000ff">{</font></h2> <p>It may be easy to miss amidst all the hoopla around Windows 8 but the Norwegian Developers Conference just released all their session vidoes on the site. </p> <p>It’s been a while since I’ve gotten to go to a conference but the last few I have attended were put on by Microsoft. Although this has advantages in the sense that it coalesces the “experts” of specific Microsoft technologies, many of the presenters work at Microsoft and therefore don’t have a similar problem set that you or I might slogging our way through building products, often with older (read: more “boring”) software. There are also some talks on development techniques like <a href="http://behaviour-driven.org/">BDD</a> and <a href="http://en.wikipedia.org/wiki/Domain-driven_design">DDD</a> that are not product specific.</p> <p>The good thing about NDC is that it seems a lot of the presenters come from an outside perspective so it’s a good balance for a lot of the MIX / PDC type stuff I’ve been watching of late. Without further ado:</p> <p>Direct Download from NDC website: <a href="http://ndc2011.no/agenda.aspx?cat=1071&id=-1&day=3726">Day 1</a> | <a href="http://ndc2011.no/agenda.aspx?cat=1071&id=-1&day=3727">Day 2</a> | <a href="http://ndc2011.no/agenda.aspx?cat=1071&id=-1&day=3728">Day 3</a></p> <p><a href="http://goo.gl/IKrBh">Roy Osherove’s “unofficial” torrent</a></p> <h2><font color="#0000ff">}</font></h2> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com51tag:blogger.com,1999:blog-10946087.post-25364615747996427962011-06-15T21:56:00.001-07:002011-06-15T22:05:15.610-07:00Search, Match, Replace, Generate<h2><font color="#0000ff">{</font></h2> <p>Many moons ago I got about <a href="http://www.hanselman.com/blog/ScottHanselmans2007UltimateDeveloperAndPowerUsersToolListForWindows.aspx">0.25 seconds of fame</a> when <a href="http://www.nregex.com">nRegex</a>, a tool I wrote for evaluating regular expressions of the .NET flavor,  got a bit of acclaim. It was one of the better days of my life, an encouragement that sometimes struggling alone in a South Dakota basement can lead to a little bit of notice. </p> <p>One of the tricks that keeps me going back to nRegex is being able to generate code by using a regular expressions. Regular Expressions, though often reviled, turn out to be quite handy in a lot of situations. </p> <p>Let’s say you have a table that looks like this:</p> <pre class="brush:sql"> CREATE TABLE PackingList(<br /> PackingListId INT IDENTITY PRIMARY KEY, <br /> PackingItem VARCHAR(50), <br /> Destination VARCHAR(50)<br /> )<br /> GO</pre><br /><br /><p> </p><br /><br /><p>Let’s say you have a list of values:</p><br /><br /><pre class="brush:sql">Shoes<br />Camera<br />Laptop<br />Wallet</pre><br /><br /><p>The list is short for brevity but let's say you want to insert them all into your table for a destination called //Build/. You know the syntax for an INSERT but it's a bit of a nuisance to type over and over again. One thing you can do is to use a regular expression to match and then reference the results of your match in a replace. Over on nRegex, we'd paste in our list of items into the main text area and then use the regular expression (.+) to match each item, line by line. Because the items are matched into a group with your parenthesis, you can now write something like the following for your replace: </p><br /><br /><pre class="brush:sql">INSERT INTO PackingList VALUES('$1', '//Build/')</pre><br /><br /><p>And voila! You now just have to copy the results: </p><br /><br /><pre class="brush:sql">INSERT INTO PackingList VALUES('Shoes', '//Build/')<br />INSERT INTO PackingList VALUES('Camera', '//Build/')<br />INSERT INTO PackingList VALUES('Laptop', '//Build/')<br />INSERT INTO PackingList VALUES('Wallet', '//Build/')</pre><br /><img style="border-bottom: gray 1px solid; border-left: gray 1px solid; border-top: gray 1px solid; border-right: gray 1px solid" src="http://www.t3rse.com/meta_images/GeneratingCode1.jpg" /> <br /><br /><p>But that's just a tip of the iceberg. There's a lot more nifty regular expressions tricks for working with code. Here's another one I run into quite often. Let's say I have some code that looks like this:</p><br /><br /><pre class="brush:csharp"> rs["foo"] = myFoo;<br /> rs["bar"] = myBar;</pre><br /><br /><p>I want to swap what's on either side of the equals sign to do the opposite type of assignment. Here's my regular expression: </p><br /><br /><pre class="brush:pl">(.+)\s=\s(.+);</pre><br /><br /><p>And my replacement expression</p><br /><br /><pre class="brush:pl">$2 = $1;</pre><br /><br /><p>Et voila aussi! You can now copy the swapped values to wherever they need to go. </p><br /><img style="border-bottom: gray 1px solid; border-left: gray 1px solid; border-top: gray 1px solid; border-right: gray 1px solid" src="http://www.t3rse.com/meta_images/GeneratingCode2.jpg" /> <br /><br /><p>One final thing: any place that offers you regular expressions you can use these techniques. There are some subtle differences but as long as you have a conceptual understanding of what your goal is it's quite easy to bend to the flavor of regular expressions presented. For example, if you are using Notepad++ and want to accomplish the same thing, you reference your groups with a leading backslash rather than the "$" character - in our first example you would use the following:</p><br /><br /><pre class="brush:sql">INSERT INTO PackingList VALUES('\1', '//Build/')</pre><br /><br /><p>This is, of course, just scratching the surface. It’s not that hard though! Once you learn the meaning of things like ^ or $ then you can manipulate strings in all sorts of ways that may have once not seemed possible. The best way to learn regular expressions hasn’t changed for many years. The two canonical books I always refer to are <a href="http://oreilly.com/catalog/9780596528126/index.html">Mastering Regular Expressions</a> by <a href="http://regex.info/blog/">Jeffrey Friedl</a> and the <a href="http://oreilly.com/catalog/9780596520694">Regular Expressions Cookbook</a> by Goyvaerts and Levithan. </p><br /><br /><table><tbody><br /> <tr><br /> <td><a href="http://oreilly.com/catalog/9780596528126/index.html"><img src="http://www.t3rse.com/meta_images/Mastering Regular Expressions.gif" /></a></td><br /><br /> <td><a href="http://oreilly.com/catalog/9780596520694"><img src="http://www.t3rse.com/meta_images/Regular Expressions Cookbook.gif" /></a></td><br /> </tr><br /> </tbody></table><br /><br /><p> </p><br /><br /><p>Although nRegex will allow you to hobble by I also recommend <a href="http://www.regexbuddy.com/">RegexBuddy</a>. <a href="http://www.rexv.org">Rexv</a> (which inspired nRegex) is a good tool though the Regular Expression engine is not .NET.</p><br /><br /><p>Last thing: do you have any nifty regex to code generation tricks you use on a regular basis? The audience of one you have in this space would love to learn them. </p><br /><br /><h2><font color="#0000ff">}</font></h2> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com1tag:blogger.com,1999:blog-10946087.post-54898763171182768662011-06-14T22:05:00.001-07:002011-06-14T22:05:43.764-07:00On Features<h2><font color="#0000ff">{</font></h2> <blockquote> <p style="line-height: 160%; font-size: 3em">“More features isn’t [sic] better. More features is unfocused. More features means you’ll do them worse. More features means you probably don’t have any differentiation. If you’re doing a startup, you should have <em>less </em>[sic] features than your competitors. If you have more features, you’re probably doing it wrong.”</p> </blockquote> <p>Nugget from <a href="http://poorbuthappy.com/ease/archives/2011/06/12/4875/more-features-competitive-advantage-for-a-startup">Peter Van Dijck</a>. So the question is: when do you add a new feature? Joel Spolsky (who has written about most interesting things already, way back in the day (although it would be interesting to hear if things are still done the same in the present day FogCreek) ) <a href="http://www.joelonsoftware.com/articles/SetYourPriorities.html">wrote</a> about how they decided on new features by prioritizing and voting as a group. </p> <p>As <a href="http://www.t3rse.com">a developer of one</a> I’m interested in techniques on deciding what to put on a roadmap and how to prioritize features. Any insight? </p> <h2><font color="#0000ff">}</font></h2> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-87964525716973750592011-06-13T06:12:00.001-07:002011-06-13T06:12:57.800-07:00Closures, Anonymous: JavaScript influenced C#<h2><font color="#0000ff">{</font></h2> <p>I’ve taken knocks in the past because of my penchant for closures and lambdas. Syntactically they never looked that strange to me and most of the time when I used them it was because it made more sense to get a sense of the flow of how things were assigned. I thought: this feels so natural, what makes it so different from some of the people I’m around using C#? Here’s an example of how I’d approach something: in the constructor, assign a loading handler, in that handler, assign a click handler, and rather than putting it in some separate method where I’d have to scroll or look elsewhere, just place it here: </p> <pre class="brush:csharp"> public MainPage()<br /> {<br /> InitializeComponent();<br /><br /> this.Loaded += (o, e) => <br /> {<br /> myButton.Click += (_, e2) =><br /> {<br /> myText.Text = "Hello World";<br /> };<br /> };<br /> }</pre><br /><br /><p>But then the other day I was tinkering with KnockoutJS, writing some Javascript with jquery and it dawned on my why I approach things the way I do. </p><br /><br /><pre class="brush:js"> $(document).ready(function () {<br /> $('#myButton').click(function () {<br /> $('#myLabel').text('Hello World');<br /> });<br /> });</pre><br /><br /><p>It's always interesting to make that connection more formally than trying to explain why my approach would be “better.” The advantage of being able to use a closure with the above approach has always been the main rational I’ve given when forced to come up with an answer. </p><br /><br /><h2><font color="#0000ff">}</font></h2> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-26800482875391712702011-06-10T06:05:00.001-07:002011-06-10T06:05:43.468-07:00Getting Random Rows, Random Numbers with Sql Server<h2><font color="#0000ff">{</font></h2> <p>The 5 second version of this, should you arrive via search, is that to get random rows, simply use an TOP query with  <strong><em>ORDER BY NewId()</em></strong> expression. It’s really that simple! Take a look: </p> <pre class="brush:sql">-- SAMPLE TABLE<br />CREATE TABLE Keywords(<br /> KeywordId INT IDENTITY(1,1) PRIMARY KEY, <br /> KeywordValue VARCHAR(50)<br />)<br />GO<br /><br />-- SAMPLE DATA<br />DECLARE @N INT<br />SET @N = 1<br />WHILE @N < 101 BEGIN<br /> INSERT INTO Keywords(KeywordValue)<br /> VALUES('key word ' + CONVERT(VARCHAR(5), @N))<br /> SET @N = @N + 1<br />END<br /><br />-- A TOP QUERY WITH ORDER BY NEWID()<br />SELECT TOP 5 * FROM Keywords ORDER BY NEWID()</pre><br /><br /><p>The longer version of this is that I recently was asked to generate random keywords for a website I was working on with a lookup table. Getting random numbers in TSQL is easy, the RAND() function does all the magic but getting rows is a lot more tricky, especially if you want to make sure you exclude anything you’ve previously retrieved. The above technique worked quite well and made it easy to allow for them to add and remove keywords on demand. </p><br /><br /><p>One interesting application of this is that you can combine it with RAND() to get random numbers via multiplier and random rows (RAND gets a random between 0 and 1 leaving you the responsibility to multiply it to control the range you want). </p><br /><br /><p>Here is where I thought this could be taken as a flexible way to get random numbers within a bounded range: </p><br /><br /><pre class="brush:sql">-- get a series of random numbers<br />SELECT TOP 5 Rand() * KeywordId FROM Keywords ORDER BY NEWID()</pre><br /><br /><p>There’s a lot of flexibility but SQL Server makes it trivial.  </p><br /><br /><h2><font color="#0000ff">}</font></h2> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-43914051557613850762011-06-08T21:59:00.001-07:002011-06-14T15:00:51.595-07:00Silverlight Is Dead…<h2><font color="#0000ff">{</font></h2> <p>… a title which I hope brings massive attention to this blog and to this rant against those that are rabid in their attacks on Microsoft and the Silverlight platform. </p> <p>First and foremost: Silverlight 5 has yet to be released. How can the platform be “dead” if we’re on the verge of a new version? </p> <p>Secondly: Spend some time listening to <a href="http://wildermuth.com/2010/12/12/The_Next_Application_Platform_All_of_them">MVPs</a> and <a href="http://www.hanselman.com/blog/ShouldIUseHTML5OrSilverlightOneMansOpinion.aspx">Microsoft</a> <a href="http://jesseliberty.com/2011/05/16/yet-another-podcast-35silverlight-html5-and-developers/">people</a>. Even though there is this awkward gag order until <a href="http://www.buildwindows.com/">//Build/</a> it seems quite obvious that the platform will continue to be a viable option for developers.</p> <p>Third: HTML5 is no panacea. Spend a few days looking into the different specifications and the <a href="http://findmebyip.com/#target-selector">varied support</a> by browsers and platforms. It will become obvious that the W3C is being true to their word when they say <a href="http://www.w3.org/2011/02/htmlwg-pr.html">it won’t be “finished” for a while</a>.</p> <p>Fourth: Grow Up. Yes you’ve made this enormous investment in Silverlight or WPF. I have too; the last 3 years of my life have been in the trenches and my employer took a calculated risk to do a significant amount of work in Silverlight. Does that mean that every rumor should shake you to the very foundation and cause emotional outbursts at being abandoned? Stay the course. When you have real information from Microsoft directly <strong>then</strong> you can have your break down if it’s not what you expected. I don’t consider my time wasted no matter what the case. I can take my knowledge of MVVM <a href="http://knockoutjs.com/">elsewhere</a>. I know a lot more than I used to about asynchronous programming. </p> <p>Fifth: Let’s just say it’s true. Does it still warrant all that drama? You’ll be fine. People are dying in wars, unrest, and natural disasters all over the place but guess what? If you’re a Silverlight Dev and They all of a sudden remove the Silverlight Project Template from your Visual Studio and run a secret binary on your local machine to destroy the plugin removing all evidence of its existence globally you’ll still be alive. You’ll still dust off your trousers and either port your work or begin new and fanciful things in a platform that you find available. </p> <p>Sixth: Try to make a distinction between people who are vocal versus people who are actually building software. I’m aware of a project right now where I work that makes heavy use of COM. Yeah that “not dead but done” COM. People who build things usually have their heads down creating value. I know there are a lot of talking heads online, especially talkers unsympathetic to the “evil” b0rg in Redmond, but there’s a lot of noise for very little signal. It’s cool that people get passionate (I’m being passionate myself now too) but sometimes it’s a good thing to take a step back and survey the landscape of what is real and what is bluster.</p> <p>I’ve already admitted I could be wrong. But as significant a decision Microsoft has potential to make, my approach is to take it in stride, try to learn as much as I can and be flexible since in the tech world, no matter who you are, change is inevitable. For some of us change, with all the concomitant turbulence, is fun.</p> <h2><font color="#0000ff">}</font></h2> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-14176053480966418782011-03-14T21:29:00.001-07:002011-03-14T21:29:26.743-07:00Happy pi day!<h2><font color="#0000ff">{</font></h2> <pre style="padding-bottom: 10px; line-height: 120%; margin: 1em 0px; padding-left: 10px; padding-right: 10px; font-family: courier; background: #000; color: #eee; font-size: 10pt; overflow: auto; padding-top: 10px">class Program<br />{<br /><br /> static double PI(int i, int limit)<br /> {<br /> return (i > limit)? 1 : (1 + i / (2.0 * i + 1) * PI(i + 1, limit));<br /> }<br /><br /> static void Main(string[] args)<br /> {<br /> double pi = 2 * PI(1, 2011);<br /> Console.WriteLine(pi);<br /> Console.WriteLine("Happy pi day!");<br /> Console.ReadLine();<br /> }<br />}</pre><br /><br /><h2><font color="#0000ff">}</font></h2> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com1tag:blogger.com,1999:blog-10946087.post-52314507592065666802011-01-29T19:07:00.001-08:002011-01-29T19:12:19.879-08:00Primes, Sums of Primes, 2011 in C#<h3><font color="#0000ff">{</font></h3> <p>I had no idea: </p> <p><font size="5">2011 = 157 + 163 + 167 + 173 + 179 + 181 + 191 + 193 + 197 + 199 + 211</font></p> <p>After learning that not only was 2011 was prime, but that it was the sum of consecutive primes, I sought to write some C# code that would demonstrate this. I wrote it in a functional style, meaning at some point to port it to F# – you'll recognize my in a forthcoming post on computing primes with F# which is actually an implementation of the algorithm I first worked through in the below C#. </p> <pre style="padding-bottom: 10px; line-height: 120%; margin: 1em 0px; padding-left: 10px; padding-right: 10px; font-family: courier; background: #000; color: #eee; font-size: 8pt; overflow: auto; padding-top: 10px">Func<long[], IEnumerable<KeyValuePair<long, string>>> GenerateConsecutivePrimeSums = (primes) =><br />{<br /> List<KeyValuePair<long, string>> primeSums = new List<KeyValuePair<long, string>>();<br /> for (int i = 0; i < primes.Count(); i++) <br /> {<br /> List<string> operands = new List<string>();<br /> long primeSum = primes[i];<br /> operands.Add(primeSum.ToString());<br /> for (int j = i + 1; j < primes.Count(); j++) <br /> {<br /> primeSum += primes[j];<br /> operands.Add(primes[j].ToString());<br /> if (!primeSums.Any(ps => ps.Key == primeSum) && primes.Contains(primeSum))<br /> {<br /> primeSums.Add(new KeyValuePair<long, string>(primeSum, String.Join(" + ", operands.ToArray())));<br /> }<br /> } <br /> }<br /><br /> return primeSums;<br />};<br /><br />Action primesAndSums = () => { <br /> // generate primes up to 2020<br /> var primes = GeneratePrimes(2020);<br /> // generate arrays of consecutive primes that add up to prime<br /> var primesSummed = GenerateConsecutivePrimeSums(primes.OrderBy(a => a).ToArray());<br /> // go through the summed primes (dictionary of prime as key, added numbers as value)<br /> // Console.WriteLine formatted results<br /> primesSummed<br /> .OrderBy(ps => ps.Key)<br /> .ToList()<br /> .ForEach(ps => Console.WriteLine(ps.Key + " = " + ps.Value));<br />};<br /><br />primesAndSums();</pre><br /><br /><p> </p><br /><br /><p>The code actually calculates sums of the primes it generates, <a href="http://www.t3rse.com/metadeveloper/primesAndSums.txt">click here</a> for all the other primes which are sums of consecutive primes up to 2020: </p><br /><br /><h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-68867798351146232352011-01-24T21:57:00.001-08:002011-01-24T21:57:21.395-08:00Interesting Data Points From How Facebook Ships Code<h3><font color="#0000ff">{</font></h3> <p>I ran across <a href="http://framethink.wordpress.com/2011/01/17/how-facebook-ships-code/">this blog entry</a> which is an unofficial attempt by somoene to glean the internal workings of Facebook’s product and software development processes. There are some very interesting things to be noted, most of which I’ll just quote from the article directly: </p> <blockquote> <p>“resourcing for projects is purely voluntary”</p> </blockquote> <p>It’s interesting from this unofficial post that project dynamics are organic and based on what engineers want to work on. It begs the question of how the more difficult and less pleasing problems are solved but I would hedge that by having people who are talented and motivated, difficult and more grimy problems might be what attract people that are always seeking challenges. Indeed, from later in the article: “<em>engineers generally want to work on infrastructure, scalability and “hard problems” — that’s where all the prestige is.</em>”.</p> <blockquote> <p>“Engineers handle entire feature themselves — front end javascript, backend database code, and everything in between.  If they want help from a Designer (there are a limited staff of dedicated designers available), they need to get a Designer interested enough in their project to take it on.  Same for Architect help.  But in general, expectation is that engineers will handle everything they need themselves.”</p> </blockquote> <p>This is one of the more fascinating points because it reflects one side of an approach to programming that I’ve encountered: that delivering some functionality is a process of ownership where a person generalizes across disciplines and technologies. The opposing viewpoint sees programming more in terms of division of labor with staff assigned to “tiers” of the technological back end: database developers, “business layer” or component programmers, user interface and so on. I always think of sports with this dichotomy where the former thinks of software development like basketball – a game that involves some specialization but really rewards the generalist who can play any role on a team, and football – a game of specialists where it’s a liability to do too many things since even the physique is developed on a per position basis. </p> <p>Many people acknowledge generalists for small organization but it appears that Facebook, a company as large as they come, prefers them. </p> <blockquote> <p>“engineers responsible for testing, bug fixes, and post-launch maintenance of their own work.  there are some unit-testing and integration-testing frameworks available, but only sporadically used.”</p> </blockquote> <p>There are a few edits and comments to this point but the reason I find it interesting is that they are a corollary to the views that Joel Spolsky expressed on the StackOverflow podcast. Many developers, myself included, berate ourselves on a lack of unit testing with the assumption that “everyone is doing it, why can’t I?” As time passes, however, I realize that TDD and Unit Testing are very important but not essential. It’s a very unpopular opinion and while I admit that I strive to make my code testable and, especially on personal projects where I have enough control, architect my software so that it’s testable from the get-go. </p> <h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-55881915497366618462011-01-22T21:40:00.001-08:002011-01-22T21:40:19.302-08:00Learning F# with FizzBuzz: Match<h3><font color="#0000ff">{</font></h3> <p>I had previously done <a href="http://metadeveloper.blogspot.com/2011/01/learning-f-with-fizzbuzz.html">a solution</a> for FizzBuzz in F# (from a long time ago) but now that I’m more familiar with the idioms of F# I tend more towards pattern matching instead of if/else logic for quite a few scenarios. Here is an example of my rewriting what could otherwise been a conditional if/else checking for factors of 3 and 5, but using a pattern match instead. </p> <pre style="padding-bottom: 10px; line-height: 120%; margin: 1em 0px; padding-left: 10px; padding-right: 10px; font-family: courier; background: #000; color: #eee; font-size: 10pt; overflow: auto; padding-top: 10px">#light <br />let fizz num = <br /> match (num % 3 = 0) with <br /> | true -> "fizz"<br /> | false -> ""<br /><br />let buzz num = <br /> match (num % 5 = 0) with <br /> | true -> "buzz"<br /> | false -> ""<br /><br />let outform num fizCalc = <br /> match fizCalc.ToString().Length = 0 with<br /> | true -> num.ToString()<br /> | false -> fizCalc<br /><br />let rec printer nums =<br /> match nums with<br /> | [] -> printfn "-"<br /> | h::t -> <br /> printfn "%s" (outform h ((fizz h) + (buzz h)))<br /> printer t<br /><br />let numbers = [1..100]<br />printer numbers</pre><br /><br /><br /><br /><p>Although I read claims that if/else conditional operations are more readable, I think the pattern match used consistently across scenarios above makes for something I find quite readable.</p><br /><br /><h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-14591057618757317882011-01-20T22:08:00.001-08:002011-01-20T22:08:56.093-08:00On Leadership<h3><font color="#0000ff">{</font></h3> <blockquote> <p style="line-height: 140%; font-size: 2em">“If you want to build a ship, don’t drum up people to gather wood, divide the work, and give them orders. Instead, teach them to yearn for the vast and endless sea”</p> <p>- Antoine De Saint-Exupery, author of "The Little Prince"</p> </blockquote> <p>Originally <a href="http://www.sellsbrothers.com/Posts/Details/12688">posted</a> on Chris Sells’s blog but worth some thought. </p> <h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com2tag:blogger.com,1999:blog-10946087.post-80440916178458362902011-01-19T20:53:00.001-08:002011-01-19T20:53:01.436-08:00Download .NET Source Code<h3><font color="#0000ff">{</font></h3> <p>I’ve been having <a href="http://stackoverflow.com/questions/4742143/calculating-text-wrapping-in-the-net-drawingcontext-drawtext-method">a problem</a> that warrants looking at the source which can be downloaded right <a href="http://referencesource.microsoft.com/netframework.aspx">here</a>. </p> <h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-44550118062567701222011-01-19T05:53:00.001-08:002011-01-19T05:53:36.604-08:00Learning F# with FizzBuzz<h3><font color="#0000ff">{</font></h3> <p>Eons ago <a href="http://metadeveloper.blogspot.com/2009/09/fizzbuzz-functional.html">I'd posted</a> on how I’d rewritten how I would solve FizzBuzz to have a more functional style (<a href="http://metadeveloper.blogspot.com/2007/03/fizbuzz-conundrum-ramanujan.html">here</a> is an imperative version), inspired by Tomas Petricek and John Skeet’s <a href="http://www.manning.com/petricek/">Functional Programming for the Real World</a>. Shortly thereafter I had written a version in F#, I’m not sure what prevented me from posting it but here it is: </p> <pre style="padding-bottom: 10px; line-height: 120%; margin: 1em 0px; padding-left: 10px; padding-right: 10px; font-family: courier; background: #000; color: #eee; font-size: 12pt; overflow: auto; padding-top: 10px">let numbers = [1..100]<br />let fizz num = <br /> let res = if (num % 3 = 0) then "fizz" else ""<br /> res<br /><br />let buzz num = <br /> let res = if (num % 5 = 0) then "buzz" else ""<br /> res<br /><br />let outform num fizCalc = <br /> let res = if(fizCalc.ToString().Length > 0) then fizCalc.ToString() else num.ToString()<br /> res<br /><br />let rec printer nums =<br /> match nums with<br /> | [] -> printfn "-"<br /> | h::t -> <br /> printfn "%s" (outform h ((fizz h) + (buzz h)))<br /> printer t<br /><br />printer numbers</pre><br /><br /><p>I can already see now areas that are still influenced by the C# - most notably the use of <strong>if</strong> rather than using match for everything. I will clean it up, hopefully demonstrating an increased facility with F#. If you are looking at the above and know F#, what are some idioms or language constructs that I am neglecting in the above code? Type annotations for one... what else? </p><br /><br /><h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-61877975456049420882011-01-02T11:55:00.001-08:002011-01-02T11:55:19.189-08:00Information Diet Planning – Newsletters<h3><font color="#0000ff">{</font></h3> <p>Given the amount of information that is out there it’s difficult to throttle back and actually digest it. A quick look at any web page will set that context; hit StackOverflow and you’ve got several dozens of links to follow, each a rabbit hole on its own. The same can be said for Hacker News, Channel 9, and just about every other popular developer site that is out there. </p> <p>What tools exist to process this more efficiently? Perhaps, I hope, one of the oldest tools out there: <strong>email</strong>.</p> <p>I came across this solution reading the Washington Post’s email newsletter I subscribe to one morning. I realized I’d get more out of the news by scheduling a more deliberate reading of the newsletter than by going to the site and being bombarded by stories and links that, while no doubt interesting, would result in an overflow of words that would invariably lose their depth. </p> <p>I decided for the next week not to visit any news site directly but rather to subscribe to several newsletters and schedule the reading from directly from my email inbox. I also turned off the radio so that rather than hearing multiple versions of syndicated stories from the Associated Press, I would be able to dive more deeply and think more at length about what I read. The goal was to buck <a href="http://www.guardian.co.uk/media/2008/jan/27/internet.pressandpublishing">the trends</a> of the modern day information seeker: </p> <blockquote> <p><font size="4">“characterised as being 'horizontal, bouncing, checking and viewing in nature. Users are promiscuous, diverse and volatile.' 'Horizontal' information-seeking means 'a form of skimming activity, where people view just one or two pages from an academic site then "bounce" out, perhaps never to return.' The average times users spend on e-book and e-journal sites are very short: typically four and eight minutes respectively.”</font></p> </blockquote> <p>I wanted to get more vertical with my reading rather than surfing through multiple versions of the same piece of news.</p> <p>I was so pleased with the results that I decided to use the same strategy with technical news and articles. I have long been a member of <a href="http://www.codeproject.com/">The Code Project</a> and of the software development newsletters I receive (surprisingly few) theirs is probably the best. Each day, and then in a weekly digest, there is an email in my inbox with a decent roundup of technical articles. Although not all of them pertain to my skills set or interests, there are usually one or two good links to follow up with; in <a href="http://www.codeproject.com/script/Mailouts/View.aspx?mlid=8588">this newsletter</a> received on the last day of the year I could easily spend an hour on <a href="http://www.switched.com/2010/12/30/best-technology-writing-of-2010/">The Best Technology Writing of 2010</a> or catch up with Rob Connery giving <a href="http://blog.wekeroad.com/microsoft/hey-kid-come-over-here">his sentiments</a> on <a href="http://www.microsoft.com/bizspark/">BizSpark</a>. </p> <p>The experiment will continue and although I do admit to “skimming” from time to time, even the tepid commitment that I’ve made seems to make my time online much more efficient. The next steps regarding newsletters is to find some more development related ones that come in a digest form, preferably weekly so that I can spend a full week on the contents. </p> <h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-64770479657719637182010-12-23T05:23:00.001-08:002010-12-23T05:28:11.527-08:00Information Diet Planning - Part 1<h3><font color="#0000ff">{</font></h3> <p><strong>Goal Setting</strong></p> <p>I’ve let it slip that one personal goal for 2011 is a more regimented information diet. I’m becoming increasingly convinced that the concepts we apply to diets on the body can be applied with some parallel applications in the world of information. </p> <p><strong>Calorie Counting</strong></p> <p>The first thing that applies to physical diets is the concept of tracking intake. Our bodies can utilize up to a certain amount of food after which, no matter how good it is, the food is going to be stored up as fat. Is tracking intake something that can be applied to information? The number of sites visited in a day, the number of browser tabs open, the amount of time getting pumped with information via some form of media: podcast, radio, screencast, television or otherwise? Is there a point where that additional reading does no good and takes away from what might have been retained?</p> <p><strong>Exercise</strong></p> <p>The second basic thing in the world of physical diets is some concomitant form of exercise. Some of this might be for burning away calories (cardio) but sometimes it’s about gaining mass or turning “fat” into “muscle.” I wonder what exercise looks like in the world of information. Steve Yegge had <a href="http://sites.google.com/site/steveyegge2/practicing-programming">an old article</a> about practice for programmers and I suspect that exercise involves designating time specifically for the mental effort related to processing information efficiently. </p> <blockquote> <p style="font-size: 1.5em">“The great engineers I know are as good as they are <em>because</em> they practice all the time. People in great physical shape only get that way by working out regularly, and they need to keep it up, or they get out of shape. The same goes for programming and engineering.”</p> </blockquote> <p><strong>Media and Delivery</strong></p> <p>There are different “food groups” associated with a healthy diet. Some types of food, like “fatty carbs” are very difficult to incorporate into any meaningful diet but others, like fruit, are a staple of most sensible dieting efforts drawn up for a healthier lifestyle. I wrote down my main sources of intake and looking at the list I would consider some blog entries analogous to fatty carbs or sugar whereas other forms of intake such as technical books to be a more substantive form of media for input and processing. </p> <p>Confession: I’m an architecture geek<sup>1</sup>. It started in earnest when I moved to South Dakota – it was the first time I’d lived in a rural area. I missed the built environment I was used to in cities. Along the way I’ve managed to have 14 different architecture blogs in my RSS Reader. Especially since I’m not an architect, this is excessive. I usually enjoy a story here and there but I leave a lot unread. This is a case where it’s not my curiosity that needs to go away, it’s the delivery format. I’d be better served rereading Steen Eiler Rasmussen’s <a href="http://www.amazon.com/Experiencing-Architecture-Steen-Eiler-Rasmussen/dp/0262680025">Experiencing Architecture</a> or Bjarke Ingalls’s <a href="http://www.amazon.com/Yes-More-Archicomic-Architectural-Evolution/dp/3836520109/ref=sr_1_1?s=books&ie=UTF8&qid=1293108284&sr=1-1">Yes Is More</a> than getting distracted by blog entries from the web. </p> <p><strong>Processing</strong></p> <p>I’m not sure there is any equivalent in the world of dieting but the last thing I’ve been thinking about related to my information diet is designating time for processing. Earlier this year I finally made some headway in understanding <a href="http://en.wikipedia.org/wiki/Getting_Things_Done">Getting Things Done</a> and though I can’t say I’ve implemented everything David Allen recommends two things have stuck: his recommendation of using a calendar and the idea that you process information rather than letting it idle in an indeterminate state. </p> <p>It’s occurred to me that in recent years information access for personal and professional development is trivial. Wikipedia is a great resource for documenting general knowledge. For professional work there are websites, link aggregators, and vendors eagerly providing a glut of information to learn from. </p> <p>In this environment, what does it mean to “process” an information resource? For example, at work this week we watched <a href="http://community.bartdesmet.net/blogs/bart/Default.aspx">Bart De Smet</a> give <a href="http://bit.ly/bfzKCk">a talk</a> on a language feature of C# called LINQ. I’ve used LINQ quite a bit but his talk covered some direction in the technology that is new (<a href="http://msdn.microsoft.com/en-us/devlabs/ee794896.aspx">Rx</a>). In a more general sense, he referenced the Wikipedia entry on <a href="http://en.wikipedia.org/wiki/Monad_(functional_programming)">Monads</a> – another resource which I would like to process. </p> <p>I’m not sure what processing should look like but it seems like what it means to process an information resource is less of an issue than the discipline it takes to designate time for it. Perhaps that ties this notion back to exercise. </p> <p><strong>Conclusion</strong></p> <p>I’ll be using the next couple of weeks to think more about what an Information Diet should look like and a practical structure to use. I’m posting in part because I would love any input on tactics and also because committing this to the permanence of my blog means the commitment is formalized. Four areas of focus will be: </p> <ul> <li>Calorie Counting – tracking input</li> <li>Exercise – deliberate practice </li> <li>Media and Delivery – determining which formats and timing work best for information</li> <li>Processing – what steps are involved in making meaning out of information</li> </ul> <h3><font color="#0000ff">}</font></h3> <p><sup>1</sup>A running joke with my wife is that I will quit my job, enroll in an architecture program just so I can be a <a href="http://en.wikipedia.org/wiki/Paul_Goldberger">critic</a>. She takes great joy in laughing about this.</p> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-47686291905053834632010-12-20T05:42:00.001-08:002010-12-20T05:42:46.821-08:00Language, Programming, Quirks, Conviction; Derek Sivers at RailsConf<h3><font color="#0000ff">{</font></h3> <blockquote> <p><font size="6">“</font></p> <p>Imagine that you are standing on a street, and you are in America, and a Japanese guy comes up to you and says “Excuse me… what is the name of this block?” </p> <p>And you say “well, I don’t understand… there’s Oak street and there’s Elm street, this is 27<sup>th</sup> street and that’s 26<sup>th</sup>…”</p> <p>And he says: “Yes but what is the name of this block?”</p> <p>You say: “I don’t understand what you mean; blocks don’t have names, streets have names. Blocks are just the unnamed spaces in between the streets.”</p> <p>He looks a little disappointed and leaves.</p> <p>… </p> <p>So now imagine that you are standing in Tokyo one day and you’re a little lost and you turn to somebody next to you and you say “Excuse me, what is the name of this street?”</p> <p>And they say, “That is block 17 and that is block 16.”</p> <p>And you say “Yeah, but what is the name of this street?”</p> <p>And they say, “Streets don’t have names; that’s just the space between blocks 16 and 17.”</p> <p><font size="6">”</font></p> </blockquote> <p>A great talk from <a href="http://sivers.org/blog">Derek Sivers</a> given at RailsConf earlier this year <a href="http://itc.conversationsnetwork.org/shows/detail4565.html">available on IT Conversations</a>.</p> <h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-13608159995838303712010-12-19T10:51:00.001-08:002010-12-19T10:51:49.887-08:00The Future Is Balkanized<h3><font color="#0000ff">{</font></h3> <blockquote> <p><font size="5">“I like HTML5, but I think you're duct taping a horn on a horse and hoping it will become a unicorn.”</font></p> </blockquote> <p>Shawn Wildermuth hit the nail on the head with a recent analysis entitled “<a href="http://wildermuth.com/2010/12/12/The_Next_Application_Platform_All_of_them">The Next Application Platform? All of them...</a> ” It would be interesting to see how many more hits the article would have gotten with a title like “XYZ is dead” or “The Death of XYZ,” perhaps something along the lines of “The Death of the One Stop platform.” </p> <p>A basic summary is that he points to a future in which developers tangle themselves with the following development targets:</p> <ul> <li>An HTML5 solution for the web</li> <li>Plugins to extend HTML5 as necessary</li> <li>Desktop/Browser apps for in house/well known customers</li> <li>Apps for mobile/tablets in Objective-C, Java, and Silverlight</li> </ul> <p>The sentiments are corroborated by my own experience, most recently even with a potential customer who wanted to have an iPad friendly application (native) but also wanted to support web based users who had no such device. If I could translate the request, it could simply be that they want things in the best possible experience for each of the disparate platforms for which they had users. Of course the smart phone was no exception. </p> <p>In a world like this, what could the future portend but that we will have multiple platforms, no singular delivery, and a constantly increasing need to build things quickly, portably? </p> <p>I’ve cited the article quite a bit but over the years I’ve always gone back to Jonathan Edwards <a href="http://alarmingdevelopment.org/?p=79">article</a> on Beautiful Code: </p> <blockquote> <p>“I wish someone had instead warned me that programming is a desperate losing battle against the unconquerable complexity of code, and the treachery of requirements.”</p> </blockquote> <p>Although Edwards was talking more specifically about code, all of my experience points towards this truth in the realms of the disparate platforms, specifically that getting something to work in a “real world” where people use different operating systems, browsers, displays, and connectivity paradigms. Over the years there have been different tactics in trying to solve the problem: <a href="http://www.webstandards.org/">web standards</a>, ActiveX controls, Java, plugins, and of course the latest new craze, HTML5. It’s not that these tactics (and the technologies related to them) are bad: I still advocate web standards to a point, I still have my day job programming Silverlight. It’s just that the pragmatist in me thinks this is the Arab-Israeli conflict in software: no perfect solution no matter how badly its desired by those in each of the platform camps. </p> <p>The big insight for me as a developer is this line:</p> <blockquote> <p>“<strong>This means as a developer you'll need to expand what you know and learn more platforms. Is that bad or good?  Both. It means more work for all of us, but it does mean you'll need to less focus on silo's of platforms and use your knowledge across these platforms.</strong>”</p> </blockquote> <h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-84953602399235864382010-12-13T20:56:00.001-08:002010-12-13T20:56:31.185-08:00Advent Calendars for Developers<h2>{</h2> <p>Since my days <strong><em><a href="http://metadeveloper.blogspot.com/2007/02/language-and-thinking.html">trying to hack up some Perl</a></em></strong><sup>1</sup> I was charmed by the idea of a developer’s advent calendar: a day by day lead up to Christmas with articles pertaining to a specific topic. I’m otherwise a scrooge during the holiday time; not given to commercialism, Christmas music, and other seasonal rituals. </p> <p>But I am up for the both the <a href="http://perladvent.pm.org/2010/">Perl Advent Calendar</a> and the <a href="http://advent.rjbs.manxome.org/2010/">RJBS (Perl) Advent Calendar</a>. On a similar vein, <a href="http://sysadvent.blogspot.com/">Sys Advent</a>, a sys admin advent calendar should be interesting tracking too.</p> <p>Others have riffed on the idea, most notably web developers. <a href="http://24ways.org/2010">24ways</a> is a seasonal advent project that I’ve tuned into each year – I usually have at least one or two of the posts stick. </p> <p>Finally, there is an entrepreneurial advent calendar, <a href="http://24waystostart.com/2010/">24waystostart</a>. A lot of good things in there, I feel the onset of holiday good cheer. </p> <p>I’m disappointed not to find a .NET Advent calendar (or even a Python one!). If you know of a good advent calendar, developer or otherwise, feel free to share. A few good articles can make the season pleasurable, even for a grinch like me. </p> <h2>}</h2> <p><sup>1</sup>Could it have been that long ago? Funny to see those old posts, but that's part of why I blog</p> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-30861807339997945342010-12-02T05:36:00.001-08:002010-12-02T05:36:25.042-08:00Serialization’s “Pit of Success” with C# and JSON<h3><font color="#0000ff">{</font></h3> <p>Although it’s been mentioned before here, it bears repeating that before you find yourself making a reference to the <a href="http://msdn.microsoft.com/en-us/library/bb410770.aspx">DataContractJsonSerializer</a>, you ought to consider and indeed are more likely better off with the NewtonSoft library <a href="http://json.codeplex.com/">Json.NET</a>. Whereas the DataContractJsonSerializer relies on giving you the flexibility of creating types and using the DataContract and DataMember attributes on them for a lot of granular control, this is burdensome with types that should naturally find themselves serializable and JSON friendly. For example, let’s say I have a Dictionary<int, string>; the intent of the user shouldn’t be too complicated in the serialization process. Or, if I have a class Foo with a couple of properties, and I want to serialize an IEnumerable of said class, again, the intent doesn’t require the extra use of attributes and a complexity overhead. </p> <p>This is not to say that the DataContractJsonSerializer does not have its place; if you are leveraging WCF and choosing JSON as your serialization format, it is probably the best route to go. That said, however, I have fallen more than once into a “pit of success” with Json.NET after getting burdened with trying to use the DataContractJsonSerializer.</p> <p>Json.NET is still quite active, the last release during the latter half of this year. <a href="http://json.codeplex.com/releases/view/50552#ReviewsAnchor">Check it out</a>.</p> <h3><font color="#0000ff">}</font></h3> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-16150595360154410422010-08-27T05:53:00.001-07:002010-08-27T05:53:59.253-07:00Design Related: Branding with Debbie Millman<p><font color="#0000ff" size="4">{</font></p> <p>I always struggled with a singular identity. Maybe that had something to do with going back and forth from East Africa and the United States, maybe it is because my father had a lot of books and it gave me a curious nature. Whatever it is, I am the kind of person who, when I find myself in a bookstore, picks up a magazine on a topic I know nothing about and enjoys trying to discover the nuances of a not yet explored world of information. I’ve done it with things like pens, model trains, and antiques. </p> <p>When it comes to design, as much as it may seem by some to be orthogonal to software development, I’ve had the growing understanding that the two go hand in hand. Design, to me, is not picking nice colors for gradients or making icons. Design is planning, it’s understanding a problem and solving it. Although as a software developer my <em>visual design</em> has often been an afterthought (something I’ve fought with increasing intensity over time) and yet when I write a piece of software, put together a user interface, or model data structures, I am planning and problem solving. I am designing, even if I’m making a poor effort of things.</p> <p>The more aware I’ve become of this, the more I’ve sought to have a baseline understanding of design which is why I found myself at the <a href="http://www.southdakota.aiga.org/">South Dakota AIGA</a> hearing <a href="http://debbiemillman.blogspot.com/">Debbie Millman</a> give a talk on the history of branding, which was originally prompted by her thinking about the phenomenon of MySpace. I’d long been aware of Debbie; I listened to her <em>Design Matters</em> show when it originally became available online and look forward to a <a href="http://observermedia.designobserver.com/show_designmattersarchive.html">new podcast via Design Observer</a>. </p> <p>In speeding us to the present, the question of why there may be 300 national brands of cereal or 100 different types of bottled water in a store, Millman began 50,000 years ago with the “big brain bang” where scientists believe we developed our <a href="http://en.wikipedia.org/wiki/Triune_brain">Triune brain</a>. The 3 parts of the brain Millman talked about, Reptilllian, Limbic, and Neocortex are a basis for how she believes that branding works today – if I could shortcut to the conclusion, the reason why we put ourselves in groups and find affiliation important is because this need is hardwired. In one humorous aside, Millman said of the part of the brain that fears the unknown: </p> <p>“You can’t meditate it away. It’s just there.”</p> <p>The talk bolstered this point along many fronts, some anthropology, some historical/statistics and other scientific studies and anecdotes. She then divided the history of branding, starting from the US Trademark Registration (landmark legislation that is the legal foundation for branding) in 1876, into 5 different “waves:”</p> <p><strong>Wave 1: 1875 – 1920</strong> </p> <blockquote> <p>Brands as a guarantor of consistency (Think Campbells soup, Quaker Oats).</p> </blockquote> <p><strong>Wave 2: 1920 – 1965</strong></p> <blockquote> <p>Brands as a guarantor of quality. (Think Mortin’s Salt, Pepsi).</p> </blockquote> <p><strong>Wave 3: 1965 – 1985</strong></p> <blockquote> <p>Brands as self expressive statements, telegraphing what others should think of us. (Think Nike, Levis, Volskwagen).</p> </blockquote> <p><strong>Wave 4: 1985 – 2000</strong></p> <blockquote> <p>Brands as an experience. (Think Starbucks.)</p> </blockquote> <p><strong>Wave 5: 2000 – present</strong></p> <blockquote> <p>Limbic brands. (Think Social Networking). In reference to the earlier portion of the talk on brain development, this is the part of our brains which serves us emotion and sense of group. In our present, fractured world, where traditional models of group like family are being uprooted by modernity, we turn to brands to fill that portion of our lives, which is hardwired.</p> </blockquote> <p>I found the talk riveting, in large part because it aimed at a higher level thinking of how branding works. Afterward I had a chance to talk to Debbie and it sounds like there are new <em>Design Matters</em> shows in the making. I’ll look forward to hearing them and learning more.</p> <p><font color="#0000ff" size="4">}</font></p> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-86848742043136799132010-08-11T21:45:00.001-07:002010-08-12T05:07:05.737-07:00Failure in two parts, IronRuby<p><font color="#0080ff" size="4">{</font></p> <p>I recently ran across a <a href="http://scripting.com/stories/2010/08/05/whyDidntGoogleWaveBootUp.html">two</a> <a href="http://scripting.com/stories/2010/08/06/embracingFailureIsAGoodWay.html">part</a> series from Dave Winer related to failure. Essentially Winer asserts the following: </p> <blockquote> <p><em>“The only way to succeed in my opinion is if you cannot visualize failure.”</em></p> </blockquote> <p>In the first post he describes a personal experience where failure was imminent and he pushed on despite it because he realized his back was to the wall.  In the second he keeps the theme by emphasizing the special level of determination necessary for success. Many of the blog posts I find my way to via Hacker News and other outlets have similar exhortations but Winer holds more gravitas for me because of his success as a founder and longevity as one of the alpha dog programmer/internet personalities. </p> <p>Both pieces were inspired by the recent news that Google was <a href="http://googleblog.blogspot.com/2010/08/update-on-google-wave.html">no longer pursuing Wave</a> – the kind of capitulation that may have inspired Winer’s title: <em>“Embracing failure is a good way to fail.”</em> As an aside, Dare Obasanjo has <a href="http://www.25hoursaday.com/weblog/2010/08/05/GoogleWaveAndNetworkEffects.aspx">some thoughtful points</a> on why Wave couldn’t grow. </p> <p>Not long after I <a href="http://blog.jimmy.schementi.com/2010/08/start-spreading-news-future-of-jimmy.html">discovered</a> that IronRuby’s future as a Microsoft project was in flux. It seemed to me similar to Wave in the sense that I remember the fanfare when all the Iron* (IronRuby, IronPython, etc… ) projects were beginning and the excitement of people in the programming community only to perk my head up now and find that the project seems no longer to have the good graces of its company. What a contrast. </p> <p>I speak as an outsider but I suspected that as time passed the level of interest in these projects began to erode: everything from key people leaving teams to diminishing excitement from people on the outside. Most of my interest was directed toward IronPython since it was the most mature dynamic language implementation in the beginning (the whole concept of the Dynamic Language Runtime (DLR) came from Jim Hugunin’s <a href="http://blogs.msdn.com/b/hugunin/archive/2006/09/05/741605.aspx">early port of Python</a>). This was both fortunate and unfortunate; I was eager to learn Ruby but since I can’t learn languages very fast I decided to maintain my focus on Python in exclusion of other DLR language implementations. All I can do is suspect but perhaps there were others like me who decided rather than trying to learn different languages simultaneously it would be better to focus on one. </p> <p>Now as I think upon my encounters with the DLR, I realize that I’m a part of the “failure,” if one can call it that, of Microsoft in valuing this and other dynamic language implementations. Although I was excited early on, even spending some time <a href="http://www.t3rse.com/twining/">creating projects</a> and <a href="http://metadeveloper.blogspot.com/2009/04/using-ironpython-for-coverters-in.html">coming up with ideas</a> that leveraged the dynamic languages on the DLR, I got bogged down by how hard it was without a lot of documentation and the difficulty of trying to convince people around me that what I was doing was worth it. (Insert the glazed eyes and “why not just use C#? It has intellisense…” conversation). In the interests of a more full disclosure, a personal tragedy from last year took a lot of wind out of my sails and I didn’t do any programming my spare time for a long stretch of time. </p> <p>But of course I neither think that IronRuby is a “failure” nor do I think my lack of initiative over the last few years is the way things need to remain. Now seems an even better time to become more active in what community IronRuby has since the absence of Microsoft will create space for people like me, on the outside. I will probably return to the drawing board with a few projects and ideas in IronPython but Bruce Tate’s <a href="http://pragprog.com/titles/btlang/seven-languages-in-seven-weeks">latest book</a> has inspired me to think that perhaps trying to tackle multiple languages at the same time isn’t so outlandish a goal after all. The important thing I’m going to try to bring with me is the frame of mind I quoted above from Winer: being unable to imagine that IronRuby can go away or lose value as an idea or a platform.  </p> <p><font color="#0080ff" size="4">}</font></p> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-29028491595452459232010-07-29T05:40:00.001-07:002010-07-29T05:40:55.618-07:00Management Perspectives from a Groundling and Dan Pink<p><font color="#0080ff" size="4">{</font></p> <p>Over the weekend I took the time to watch <a href="http://www.imdb.com/title/tt0314724/">Stan Lee’s Mutants, Monsters and Marvels</a>, a film that consists entirely of an interview between film maker Kevin Smith and Stan Lee. As a kid who grew up loving comics, I loved the unveiling of the world behind the worlds I spent as much time as I could with my imagination: Spiderman, Fantastic Four, Hulk, Iron Man, and the list goes on though I’ll stop before daunting anyone without appreciation for such comic book geekdome. </p> <p>One of the interesting segments dealt with Stan Lee’s approach as the top editor at Marvel. Although the characters we are familiar with are his creations and he would collaborate with artists on the first few releases of books, subsequently other teams of artists and writers would work on their own releases of the characters he created. When Kevin asked how he managed this he waved his hand and said that he found the best way to manage creatives was to leave them alone: that’s how you would get their <u>best work</u>.</p> <p>Stan Lee seems to be a man of intuition (in the interview he’s matter of fact and terse, less a man of “Big Ideas” and more of “Common Sense” when it comes to managing) but I think he was getting at the management theory that is being articulating these days by Dan Pink. Pink’s ideas have to do with the connection of motivation and better outcomes that are concomitant with employee autonomy. A summary of his ideas as well as their rational basis is in this entertaining animated video from RSA: </p> <object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/u6XAPnuFjJc&hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/u6XAPnuFjJc&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object> <p>Although I do not have any formal disagreements with Pink’s ideas (they are spot on in my book) I think what is telling is his background and where he worked. Some top notch schools and the upper echelons of government imbue a sense of personal worth and require the freedom and tactics he recommends. The same is true with Stan Lee: his management style worked precisely because of the environment he was in and the nature of his work; in comics being creative and motivated as well as finding ways to help your employees in that regard are the name of the game.</p> <p>What I would add, from the groundling floor, is that in many places it’s not that these theories don’t make sense or aren’t highly empirical (Pink glosses over some behavioral economics although if you really want to dive into the field <a href="http://web.mit.edu/ariely/www/MIT/papers.shtml">Dan Ariely is a better start</a>); it’s that different organizations have different goals. As much of a thought bludgeon as it is, the haunting truth is that some places are perfectly happy trading out creativity, autonomy, and the requisite unpredictability associated with them. </p> <p><font color="#0080ff" size="4">}</font></p> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-52576273779030884362010-07-27T16:51:00.001-07:002010-07-27T16:51:26.036-07:00XAML Iconography<p><font color="#0080ff" size="4">{</font></p> <p>I have been having a lot of fun lately using Adobe Illustrator and symbol icons to build icons in XAML. Although the typical icon libraries provide very compact image files, the advantage of XAML comes not just in space, but in the ability to manipulate the graphic that you are leveraging. </p> <p>Here is a brief example of what I mean: </p> <p>1. There is no shortage of good symbol fonts (or fonts in general, for that matter). I have bought fonts at both MyFonts.com and Fonts.com and had great experiences. The symbol font I will use in this case is Energetics. </p> <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Energetics_Font" border="0" alt="Energetics_Font" src="http://www.t3rse.com/metadeveloper/blend_iconography/Energetics_Font.gif" width="615" height="261" /></p> <p>2. In Illustrator, I create a document and insert the character of choice making it large enough that it will be easily visible when I import it to Blend.</p> <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Illustrator1" border="0" alt="Illustrator1" src="http://www.t3rse.com/metadeveloper/blend_iconography/Illustrator1.png" width="329" height="256" /> </p> <p>3. Using the File –> Import option from Blend, I have two Adobe related options; in this case we obviously leverage the Import Adobe Illustrator option</p> <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Blend1" border="0" alt="Blend1" src="http://www.t3rse.com/metadeveloper/blend_iconography/Blend1.png" width="333" height="340" /> </p> <p>4. Voila! We now have our same symbol in Blend but digging in it’s a XAML Path rather than an image. Although it has been imported, however, you will notice a few extra pieces of XAML that you don’t need holding the Path as its container. I usually copy the Path, delete the extras and then paste it back in.</p> <p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Blend3" border="0" alt="Blend3" src="http://www.t3rse.com/metadeveloper/blend_iconography/Blend3.png" width="337" height="230" /></p> <p>Now that the symbol is in XAML, not only is it not taking up the kind of space that the original image would have, it is also easier to work with if you need to manipulate it programmatically.  Here’s my weight lifter in XAML: </p> <pre style="padding-bottom: 10px; line-height: 120%; margin: 1em 0px; padding-left: 10px; padding-right: 10px; font-family: courier; background: #000; color: #eee; font-size: 12pt; overflow: auto; padding-top: 10px" class="brush: csharp;"><Path Data="F1M562.59375,264.9375C562.59375,283.96875,560.390625,301.390625,556.015625,317.234375C551.625,<br />333.078125,546.125,345.03125,539.53125,353.125L510.140625,353.125C503.296875,344.578125,497.703125,332.296875,<br />493.375,316.296875C489.046875,300.296875,486.890625,281.96875,486.890625,261.34375L480.5625,261.34375C475.65625,<br />264.09375,468.9375,269.5,460.40625,277.578125C460.515625,285.671875,459.921875,299.328125,458.609375,<br />318.515625C457.296875,337.71875,456.359375,350.90625,455.796875,358.078125C455.671875,359.796875,454.359375,<br />360.640625,451.859375,360.640625C449.34375,360.640625,448.09375,359.796875,448.09375,358.078125C443.765625,<br />358.984375,439.578125,359.703125,435.53125,360.21875C431.484375,360.734375,425.78125,360.9375,418.4375,360.8125C411.09375,<br />360.703125,404.0625,359.9375,397.34375,358.5C390.625,357.078125,383.71875,354.59375,376.65625,351.0625C374.609375,357.5625,<br />372.46875,362.953125,370.25,367.21875C368.03125,371.5,364.578125,377.734375,359.921875,385.9375C367.328125,390.953125,<br />372.671875,395.703125,375.984375,400.203125C379.28125,404.703125,380.9375,410.03125,380.9375,416.1875C380.9375,424.15625,<br />378.453125,431.109375,373.5,437.03125C368.53125,442.96875,362.46875,447.296875,355.296875,450.015625C357.109375,456.84375,<br />358.96875,465.703125,360.84375,476.59375C362.71875,487.46875,364.171875,497.328125,365.203125,506.15625C366.234375,514.984375,<br />366.796875,521.109375,366.921875,524.53125L335.140625,524.53125C330.234375,524.53125,329.140625,522.078125,331.890625,<br />517.1875C332.796875,515.6875,332.21875,513.015625,330.171875,509.15625C323.453125,496.390625,312.109375,481.46875,296.171875,<br />464.375C295.25,463.34375,293.90625,461.84375,292.140625,459.84375C290.375,457.84375,289.09375,456.375,288.296875,455.40625C287.5,<br />454.4375,286.875,453.734375,286.421875,453.265625L274.8125,455.3125L289.84375,511.375C290.640625,514.09375,289.15625,517.578125,<br />285.40625,521.796875L250.375,521.796875L250.71875,517.53125L264.390625,504.015625L211.578125,456.34375C210.09375,454.984375,<br />207.390625,452.5625,203.453125,449.078125C199.515625,445.609375,196.671875,442.8125,194.90625,440.703125C193.140625,438.609375,<br />191.859375,436.5,191.0625,434.390625C190.265625,432.28125,189.875,429.796875,189.875,426.953125C189.875,421.375,192.28125,<br />415.828125,197.125,410.296875C201.96875,404.765625,209.828125,400.015625,220.71875,396.015625C231.59375,392.03125,245.578125,<br />389.984375,262.671875,389.859375L239.78125,350.390625C231.90625,355.984375,222.671875,359.875,212.078125,362.09375C201.484375,<br />364.3125,191,364.234375,180.640625,361.828125C178.015625,351.578125,176.109375,342.59375,174.921875,334.84375C173.71875,327.09375,<br />172.859375,319.609375,172.34375,312.359375C171.828125,305.125,171.34375,295.578125,170.90625,283.734375L151.25,272.28125L140.140625,<br />272.625C140.140625,313.75,132.78125,343.71875,118.09375,362.515625L90.0625,362.515625C85.84375,357.28125,82.09375,350.5625,78.78125,<br />342.359375C75.46875,334.15625,72.859375,324.578125,70.921875,313.640625C68.984375,302.703125,68.015625,291.03125,68.015625,<br />278.609375C68.015625,259.921875,70.125,242.890625,74.34375,227.515625C78.5625,212.140625,83.796875,201.140625,90.0625,<br />194.53125L118.09375,194.53125C121.84375,198.75,125.234375,204.359375,128.265625,211.359375C131.28125,218.375,133.78125,226.5,<br />135.78125,235.71875C137.765625,244.9375,139.109375,255.25,139.796875,266.640625L148.171875,266.640625C148.625,264.703125,149.5,<br />263.234375,150.8125,262.203125C152.125,261.171875,153.6875,260.859375,155.515625,261.265625C157.328125,261.671875,158.984375,<br />262.890625,160.484375,264.9375C163.890625,259.59375,167.828125,259.359375,172.265625,264.25C172.953125,262.3125,174.375,261.0625,<br />176.53125,260.5C178.6875,259.9375,180.578125,260.4375,182.1875,262.03125C183.65625,260.4375,185.34375,259.84375,187.21875,<br />260.234375C189.09375,260.640625,189.984375,262.3125,189.875,265.28125L271.390625,262.375C271.046875,252.921875,271.6875,244.75,<br />273.34375,237.859375C275,230.96875,277.9375,224.734375,282.15625,219.140625L314.796875,217.9375L322.484375,260.65625L448.4375,<br />256.5625C449.6875,253.9375,451.625,252.34375,454.25,251.78125C456.875,251.21875,458.921875,252.40625,460.40625,255.359375C462,<br />253.3125,463.875,251.96875,466.046875,251.34375C468.203125,250.71875,470.375,251.5,472.53125,253.65625C475.265625,249.5625,<br />478.578125,248.875,482.453125,251.609375C484.5,250.359375,486.09375,249.890625,487.234375,250.234375C488.03125,235.09375,<br />490.5625,220.578125,494.84375,206.671875C499.109375,192.765625,504.203125,182.796875,510.140625,176.75L539.53125,<br />176.75C542.828125,180.28125,545.90625,185.046875,548.75,191.03125C551.59375,197.015625,554.078125,203.90625,556.1875,<br />211.703125C558.296875,219.515625,559.890625,227.90625,560.96875,236.90625C562.046875,245.90625,562.59375,255.25,562.59375,<br />264.9375L562.59375,264.9375 M535.9375,182.734375L512.875,182.734375C508.765625,187.75,505.140625,194.59375,502.015625,<br />203.25C498.875,211.90625,496.515625,221.9375,494.921875,233.3125L518.171875,233.3125C519.640625,222.15625,521.953125,<br />212.203125,525.078125,203.421875C528.203125,194.640625,531.828125,187.75,535.9375,182.734375L535.9375,182.734375 M447.75,<br />262.375L364.015625,265.28125C371.875,268.25,378.484375,271.78125,383.84375,275.875C389.1875,279.984375,393.8125,286.25,<br />397.6875,294.671875C404.859375,292.859375,411.515625,292.375,417.671875,293.21875C423.828125,294.078125,429.40625,297.234375,<br />434.421875,302.703125L447.75,262.375 M312.234375,237.59375L309.84375,223.921875L285.40625,224.9375C280.84375,231.671875,<br />278.28125,239.765625,277.71875,249.21875C279.65625,253.09375,284.03125,255.015625,290.875,255.015625C295.421875,255.015625,<br />300,253.578125,304.625,250.671875C309.234375,247.765625,311.765625,243.40625,312.234375,237.59375L312.234375,237.59375 M375.296875,<br />299.625C375.296875,292.109375,371.421875,286.296875,363.671875,282.203125C355.921875,278.109375,344.75,276.046875,330.171875,<br />276.046875C317.1875,276.046875,307.5,277.359375,301.125,279.96875C292.8125,277.8125,286.03125,276.734375,280.796875,<br />276.734375C271.453125,276.734375,262.59375,278.390625,254.21875,281.6875C245.84375,285,239.203125,289.1875,234.296875,<br />294.25C229.390625,299.3125,226.953125,304.125,226.953125,308.6875C226.953125,313.46875,229.453125,317.296875,234.46875,<br />320.140625C239.484375,322.984375,244.671875,324.40625,250.03125,324.40625C257.203125,324.40625,264.953125,322.984375,<br />273.265625,320.140625C281.578125,317.296875,288.1875,313.921875,293.09375,310.046875C298.671875,313.359375,305.671875,<br />316.125,314.109375,318.34375C322.546875,320.5625,330.921875,321.671875,339.234375,321.671875C348.921875,321.671875,357.34375,<br />319.578125,364.53125,315.359375C371.703125,311.140625,375.296875,305.90625,375.296875,299.625L375.296875,299.625 M328.125,<br />340.125C328.125,337.40625,325.125,334.921875,319.15625,332.703125C313.171875,330.484375,305.625,329.359375,296.515625,<br />329.359375C287.859375,329.359375,280.328125,330.625,273.953125,333.125C267.578125,335.640625,264.390625,338.203125,264.390625,<br />340.8125C264.390625,344.921875,271.390625,347.140625,285.40625,347.484375C273.21875,351.921875,267.125,356.59375,267.125,<br />361.5C267.125,363.09375,268.25,364.328125,270.53125,365.171875C272.8125,366.03125,276.03125,366.65625,280.1875,367.046875C284.34375,<br />367.453125,287.78125,367.703125,290.53125,367.8125C284.03125,371.234375,280.796875,374.375,280.796875,377.21875C280.796875,379.15625,<br />282.8125,380.875,286.859375,382.34375C290.890625,383.828125,294.96875,384.5625,299.078125,384.5625C303.390625,384.5625,<br />307.71875,383.765625,312.0625,382.171875C316.390625,380.578125,318.5625,378.59375,318.5625,376.1875C318.5625,373.90625,317.671875,<br />372.265625,315.90625,371.234375C314.140625,370.21875,311.09375,369.1875,306.765625,368.15625C320.203125,364.96875,326.9375,361.5,<br />326.9375,357.734375C326.9375,355.578125,325.671875,353.71875,323.171875,352.1875C320.65625,350.65625,317.40625,349.3125,313.4375,<br />348.15625C323.21875,346.453125,328.125,343.78125,328.125,340.125L328.125,340.125 M259.078125,268.6875L189.015625,271.265625L187.65625,<br />275.359375L192.609375,312.109375C198.296875,306.640625,205.3125,303.625,213.625,303.046875C216.921875,297.8125,220.703125,<br />293.140625,224.984375,289.03125C229.265625,284.9375,234.359375,281.09375,240.28125,277.5C246.203125,273.90625,252.46875,270.96875,<br />259.078125,268.6875L259.078125,268.6875 M112.453125,200.5L92.796875,200.5C84.703125,210.53125,79.125,226.03125,76.046875,<br />246.984375L95.703125,246.984375C98.78125,226.03125,104.359375,210.53125,112.453125,200.5L112.453125,200.5 M360.59375,518.71875C360.25,<br />512.109375,358.546875,499.4375,355.46875,480.6875C352.390625,461.9375,348.296875,444.921875,343.171875,429.59375C338.046875,<br />414.28125,332.28125,406.609375,325.90625,406.609375C315.765625,406.609375,306.53125,410.09375,298.21875,417.03125C289.90625,<br />423.984375,285.75,430.9375,285.75,437.890625C285.75,440.734375,286.765625,443.5,288.8125,446.171875C290.859375,448.859375,295.53125,<br />454.203125,302.828125,462.234375C310.109375,470.265625,316.328125,477.546875,321.453125,484.109375C326.578125,490.65625,331.265625,<br />498.09375,335.484375,506.421875C337.1875,509.484375,338.1875,511.796875,338.46875,513.328125C338.75,514.859375,338.4375,516.65625,<br />337.53125,518.71875L360.59375,518.71875" Stretch="Fill" Margin="57,81,0,0" UseLayoutRounding="False" HorizontalAlignment="Left" <br />Height="131.781" VerticalAlignment="Top" Width="187.405"><br /> <Path.Fill><br /> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"><br /> <GradientStop Color="#FF2D2D2D" Offset="0"/><br /> <GradientStop Color="#FF3D3C3C" Offset="1"/><br /> </LinearGradientBrush><br /> </Path.Fill><br /></Path></pre><br /><br /><p> </p><br /><br /><p><font color="#0080ff" size="4">}</font></p> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0tag:blogger.com,1999:blog-10946087.post-55043338463406101542010-07-24T21:16:00.001-07:002010-07-24T21:16:15.033-07:00Excel Interop in C# .NET without COM<p><font color="#0080ff" size="4">{</font></p> <p>Tonight I ran across the excellent albeit unimaginatively called <a href="http://code.google.com/p/excellibrary/">excellibrary project</a> on Google Code and leveraged it in one of my personal projects. It’s nice to be able to get the Excel file format without having to do it in either CSV or with COM Interop. </p> <p>Reference: <a href="http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c">Stackoverflow Question / Answer</a></p> <p><font color="#0080ff" size="4">}</font></p> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com1tag:blogger.com,1999:blog-10946087.post-13268370016567670112010-07-22T21:32:00.001-07:002010-07-22T21:32:17.020-07:00TortoiseSVN Extensions Missing on Windows 7<p><font color="#0080ff" size="4">{</font></p> <p>Ran into this issue recently after upgrading my TortoiseSVN shell extensions. To fix, simply run the installer again using the <em>Repair</em> option.</p> <p>Reference: <a href="http://stackoverflow.com/questions/1057734/tortoisesvn-icons-not-showing-up-under-windows-7">StackOverflow Question / Answer</a>.</p> <p><font color="#0080ff" size="4">}</font></p> David Seruyangehttp://www.blogger.com/profile/02586023781945095350noreply@blogger.com0