Posts
74
Comments
75
Trackbacks
0
November 2007 Entries
Timothy Ferriss - Experiments in Lifestyle Design

I need to give a shout out to Timothy Ferris and his blog Experiments in Lifestyle Design.

He recently posted about Tich Nhat Hanh - my favorite Buddhist writer.  And he has posts on how to outsource your work, how to learn foreign languages quickly.... and generally how to incorporate more - travel, adventure, etc in to your life.

He is certainly a terrific inspiration, and my goal is to implement 10% of his hints now...  Hopefully, my life will vastly improve - and yours too - from his wisdom.

Thanks Tim!

Jonathan

posted @ Sunday, November 25, 2007 5:47 PM | Feedback (0)
New Links!

Thought this was fun!

Trunk Monkey
posted @ Sunday, November 25, 2007 5:27 PM | Feedback (7)
Kindle is not the next iPod... yet


With the success Apple has had rolling out the iPod, Amazon is trying to follow suit.  They just released a new eBook device called the Kindle, and most reviewers are not taking kindly to it.  They cite the high cost ($400) for the gadget as well as its limited web access (only to certain blogs, nytimes.com and amazon.com) as significant drawbacks.

The glare reduction engineered in the product, and the fact that it saves trees are pluses.

Generally I do not want to bring a laptop when I go on vacation (Shock & Horror). So, a small device that can serve up multiple books of content and provide some internet access is interesting... 

Bottom line for me:  I think the ability to check and write email, and to play cd's and dvd's are needed for me to buy it.  It is very close, however, and it is exciting to see Amazon making this debut.

Jonathan

Tools   Print    Email   Del.icio.us   Digg   reddit
posted @ Saturday, November 24, 2007 12:59 PM | Feedback (0)
A Modest Mideast Proposal

I know that politics is a taboo subject for a blog devoted to technology.  However, I have come across an interesting and, in my opinion, logical solution to the problems in the Mideast.  My view is an American one, and perhaps I don't take into account all of the needs of other participants.  However you may at least find my view provocative if not entertaining or feasible.

 

There are a few points that I need to make first (like mathematical lemmas), and then I will combine these points to make my proposal.

 

Point 1: Having Many Neighbors is a Bad Thing

 

I once saw a statistical study that isolated the greatest predictors for any country going to war.  To my surprise, the greatest single predictor was the number of borders a country shares with foreign countries.  This, to a large degree, makes sense.  If the average probability a country goes to war with another is p, then the average probability that a country will not got to war might be approximately  

 

Probability(No War) = f(n) = 1 - pn

 

where n is the number of borders the country shares with other.   This function, f(n)  is a monotonically decreasing function.

 


Point 2: What Causes Specific Wars

 

In my opinion, the reason why countries go to war is that countries (or their leadership) believe that they can gain something from waging war that they cannot achieve through peaceful means.  So while some wars are indeed wars of aggression (the war is desired by one party but not another), I think that that is the special case.  More often the road to war is more easily traveled when both countries believe they have something to gain from a war strategy.

 

Putting These Together

 

When I look at the situation in Israel, I cannot help but notice that

 

(1)   Israel has many borders with foreign countries.

(2)   Israel is a very small country, which may give neighboring countries the impression that they can easily seize this land.

(3)   Israel’s military is better trained, and is equipped with far superior technology than its neighbors, which may give Israelis the impression that if the country wages war, they will likely win.

 

The Proposal

 

So the natural proposal is for Israel to swap its land for an island.  Or perhaps to acquire an island and in secret shift its most important assets there.

 

  1. Islands are more easily defended because they don’t share any land borders with other countries.  Anyone who has played Risk, knows about this….  And seriously, island nations on average enjoy much more peace than non-island nations.

 

  1. Island nations can invest in navies to defend themselves, but land based enemies leave their borders less secure when they shift military expenditures to naval development.

 

Final Plug

 

There are many Israelis who will counter that swapping the Holy Land for an island is contrary to the wishes of God.  And they might argue that the entire bible is a Jewish deed proving ownership of this land goes back thousands of years.

 

But the purpose of the State of Israel is to provide a secure homeland for Jews.  And unfortunately, the particular geography of Israel makes this very difficult.

 

Interested in comments,

 

Jonathan

Tools   Print   Email   Del.icio.us   Digg   reddit
posted @ Friday, November 23, 2007 8:30 PM | Feedback (6)
Check this out - Scott Guthrie posted on this blog!
So very cool...  One of my favorite bloggers (and developer/manager extraordinaire), Scott Guthrie, posted a response  on my blog.

Looks like he really cares about the Visual Studio 2008 Beta 2 Release (and it does not go unnoticed here.)

Anyway, I will hold off writing about Silverlight until it becomes available.

Thanks again, Scott.

Jonathan
posted @ Monday, November 19, 2007 10:14 PM | Feedback (10)
Visual Studio 2008 Beta 2 - This really is cool!
improve my => 'code'

Wow.... made my first WPF application in seconds flat on Beta 2.

Now when you create a button on the form, you can double click it to make it's event handler, and code right in the contents.  And even more important, the compilations are lightning fast now...

Here's my first application - a Fizz Buzz game (must have beer on the brain).

 

The XAML

<Window x:Class="FizzBuzz.Window1"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Title="FizzBuzz" Height="376" Width="380" Name="FizzBuzz" >

    <Grid Background="BurlyWood" >

        <RichTextBox Margin="64,53,73,123" Name="tOutput" ScrollViewer.VerticalScrollBarVisibility="Auto" />

        <Button Height="23" Margin="145,0,138,66" Name="bPlayFizzBuzz" VerticalAlignment="Bottom" Click="bPlayFizzBuzz_Click">Play Fizz Buzz</Button>

    </Grid>

</Window>

The C#

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Data;

using System.Windows.Documents;

using System.Windows.Input;

using System.Windows.Media;

using System.Windows.Media.Imaging;

using System.Windows.Navigation;

using System.Windows.Shapes;

 

namespace FizzBuzz

{

    /// <summary>

    /// Interaction logic for Window1.xaml

    /// </summary>

    public partial class Window1 : Window

    {

        private int _FuzzBuzzCounter = 1;

        public int FizzBuzzCounter

        {

            get { return _FuzzBuzzCounter; }

            set { _FuzzBuzzCounter = value; }

        }

 

        private StringBuilder _Response;

 

        /// <summary>

        /// Constructor

        /// </summary>

        public Window1()

        {

            InitializeComponent();

        }

 

        /// <summary>

        /// Handles the button click event for button bPlayFizzBuzz

        /// </summary>

        /// <param name="sender"></param>

        /// <param name="e"></param>

        private void bPlayFizzBuzz_Click(object sender, RoutedEventArgs e)

        {

            _Response = new StringBuilder();

            FizzBuzzEval("fizz", 3, ref _Response);

            FizzBuzzEval("buzz", 5, ref _Response);

            if (_Response.ToString() == String.Empty)

            {

                tOutput.AppendText(FizzBuzzCounter.ToString() + ", ");

            }

            else

            {

                tOutput.AppendText(_Response.ToString() + ", ");

            }

 

            FizzBuzzCounter++;

 

        }

        /// <summary>

        /// Evaluate to Fizz Buzz Rules

        /// </summary>

        /// <param name="positiveResponse"></param>

        /// <param name="numberToEvaluate"></param>

        /// <param name="response"></param>

        private void FizzBuzzEval(string positiveResponse, int numberToEvaluate, ref StringBuilder response)

        {

            if (_FuzzBuzzCounter % numberToEvaluate == 0)

            {

                response.Append(positiveResponse);

            }

        }

    }

}

Happy coding,

Jonathan

 

Tools   Print   Email   Del.icio.us   Digg   reddit
posted @ Monday, November 19, 2007 8:56 PM | Feedback (0)
Visual Studio 2008 Beta 2 is here!

Just downloaded and installed on my machine.  It took forever to install... Seriously, I saw this picture without any updates for over twenty minutes on my 2GB RAM machine.

Anyway, I can't wait to get me some Silverlight, and maybe spin the tires on WPF (as this version is supposed to be much more stable)...  Hopefully I will have some time to share my experiences with you here soon.

Happy coding,

Jonathan

posted @ Monday, November 19, 2007 8:16 PM | Feedback (2)
My My MyGeneration Baby...
improve my => 'code'

Okay, I admit it.  I don't like to use generation software tools - mostly because I know I can always do it better by hand.  Also, cut & paste seems to be the most error prone way to write software - you end up writing everything twice that way.

In my latest project, however, the sheer volume I had to write and test in a short period of time had me scrambling to use UltraEdit, Visual Studio Macros, Visual Studio snippets - everything but the proverbial kitchen sink - to get this thing done with lots of time to spare (roughly four weeks ahead of schedule.)  That's okay, as I have so far generated more than 2000 NUnit tests, and plan to get a few more thousand in there to really prove it is rock solid this week....

Anyway, a co-worker just turned me on to MyGeneration - which is really cool to me as it is allowing me to edit their code generation  templates, to get what I really want.... (My project is WCF, and the code gen did not generate the correct attributes without intervention.)  

I encourage you to give MyGeneration a spin.  The software can generate a data tier and the types for your business tier...  Not bad.  It even allows the user to maintain alias maps between database columns/tablenames and business object properties/class names.  Very happy with that particular feature.

Happy coding,

Jonathan

posted @ Monday, November 19, 2007 7:03 PM | Feedback (1)
Ever want to add regions to your .NET code quickly?
improve my => 'code'

I do this quickly now with a free tool from Meridium made available by the good people at CodeProject.com (1000 Thanks)

http://www.codeproject.com/csharp/documentatormacros.asp

Follow the directions to install (I appreciate the fact that the tool works without problems with Resharper), and just click on the method for which you want to add regions, and type <control> + d.  It even tries to add comments, but will not interfere with you previous comments made (nice!)

The two other shortcuts I love are:

Expand All Regions: <control> + <shift> + <+> 

Condense All Regions:<control> + <shift> + <->

These commands are so much better than Outlining -> Toggle All Outlining command in Visual Studio as that command toggles the structures inside regions as well (which I find annoying).

Hope this helps!

Jonathan

Tools   Print   Email   Del.icio.us   Digg   reddit
posted @ Sunday, November 18, 2007 3:52 PM | Feedback (2)
InternalsVisibleTo - Useful .NET Attribute...

improve my => 'code'

.. though it is not very well documented.

I have found it very useful to expose internal interfaces for unit test projects in order to initialize many types of objects at one time (when they all implement the same interface).  Of course, I did not want to switch over the access modifier for the interfaces every time I wanted to run unit tests, so I used the InternalsVisibleAttribute

This attribute can also be very useful for types you want to expose to your own assemblies, but not to outside customers (as it may clutter up their design environment).

First thing you will need to do is fire up the Visual Studio 2005 Command Prompt, and go to the folder for the dll or exe for which you want to grant access.

Next you want to issue: sn.exe -t myDLL.dll myDLL.pub  (substitute myDLL with the name of your dll)

Then you can extract the public key for your dll by issuing the following: sn.exe -tp mykey.pub

Take the output from this command (it will be about 240 characters) and insert the following into the AssemblyInfo.cs file in the dll whose internal types you want to publish:

 [assembly: InternalsVisibleTo("mydll, PublicKey=892s000004800000940000000602000000240000525341312224000001001100e5dd149f
744f5928e87037e26c6f9a9154bcdb5bceee4041c119c0d500d559780596c6305bb1025392b1502558
cb5b468f13c46acf363619115bdd866835f95ddba349343483df54540dd49437a37699c6aafe42fdbc
c391a65907d38768c80c2b9c15cbc55d7ccca9aaa1713476910a1169c93a566541e5ba67b371920053
c8"]  

Voila!  Happy coding,

Jonathan

Tools   Print   Email   Del.icio.us   Digg   reddit
posted @ Sunday, November 18, 2007 3:42 PM | Feedback (1)
Skydived into Skydrive...

I did a quick test of Microsoft's new Skydrive service last night. It appears that Microsoft provides about 1 GB of storage for each Live account, with a cap of 30 MB per file. Microsoft allows you to create your own custom link to your content ala http://xyzzy.spaces.live.com/ where xyzzy is a name you can choose.

Only complaints? I could not upload more than one file at a time for some reason, and the site was slow (perhaps because there were a lot of users at time of launch?) Anyway, you may want to check out the service to back up some of your media.

posted @ Thursday, November 08, 2007 8:58 AM | Feedback (0)
Windows Live Writer - Beta is here...

I finally got around to downloading the Beta version for Windows Live Writer from here

It does have a few features that we don't have on the geekswithblogs.net web site...  Such as inserting map links...

Map image

 

The most interesting feature found so far are plugins that can be added to blogs.  It looks like they have built some integrations with Flickr, and Visual Studio (I will definitely be using this one), Picasa, and Snagit.

 

Here is a sampling.

image

 

It took forever to install Live Writer, but the plugin feature has me hooked...  I will definitely be doing some research to see how to write my own plugin - and possibly share in a post like this one!

 

Hope this piques your interest,

Jonathan

del.icio.us Tags:
posted @ Friday, November 02, 2007 11:38 PM | Feedback (0)
News
Jonathan Starr is a developer in Saint Louis, MO. He holds an MBA in Finance from Columbia Business School and earned his MCSD from Microsoft.


All statements in this blog are personal opinions and do not reflect the opinions of his employer.





Related Sites
Join My Community at MyBloglog!

Tag Cloud