How to preconfigure your Ruby on Rails application for MySQL

No response, Aug 19, 2008

Rails 2.0.2 now defaults your app’s database to SQLite3 (I believe because OSX comes pre-shipped with it).  In order to generate a rails application and having it setup to MySQL is pretty easy.

In your when you create your app add (-d mysql) in the rails command:  rails -d mysql myapp

Bill Gates’ last day at Microsoft

No response, Mar 04, 2008

A series of Short reviews…

No response, Mar 04, 2008

There were a series of announcements and reviews that came out lately, here’s a sample:

Google MobileGoogle Gears has gone mobile - what a great idea.  When your mobile device can’t get a signal (such as on an airplane) but you need to do some work, you can now access your mobile apps though google gears.  Zoho runs on Google Gears, hopefully Zoho Planner is supported.  Unfortunately, Google Gears only runs on IE Mobile.
Yahoo onePlace OverviewYahoo has announced onePlace which is a mobile service designed to take your Yahoo settings and make them available on your mobile device.  Your stock portfolio is available, your favorites, your Flickr account, your My Yahoo feeds - everything is available.  Look for this to come out shortly.
Google Docs Vs Microsoft Workspaces Read Write Web has a good feature comparison between Google Docs and Microsoft Office Workspaces.  Google has everything between email, documents, calendars, etc.  For the life of me I can’t figure out why they don’t have a task tracking system.  Is it too easy?  Too basic for them?  It would be a hot commodity.

Windows Presentation Foundation Flotzam has a new UI

No response, Mar 02, 2008

Flotzam, a life streaming screensaver based all on Microsoft’s new Windows Presentation Foundation (WPF) put out a contest for redesigned UI.  Here’s a screencast of the winner.


Flotzam Design Contest Winner

Sharepoint Conference 2008 - Buzzstream

No response, Mar 02, 2008

Here are feeds to track the action going on at Sharepoint Conference 2008:

You can also monitor:  http://mysharepointcommunity.com/SPC2008

Is SocialThing.com the big hit out of SXSW?

No response, Mar 02, 2008

ReadWriteWeb is trying to predict what app will be the big hit at SXSW, and they seem to have concluded that whatever it is, it will involve social networking.  RWW seem impressed with SocialThing, and predict that if they get their iPhone interface working by SXSW then thy’ve got a real chance at being a huge hit this year.  The idea behind the app is to allow you and your friends to keep tabs on what one-another is doing via different services available for life streaming.  From their website:

Get your digital life in order

socialthing! is a digital life manager that puts what you do online into one place. See everything that’s going on with your friends in all the sites you use, post stuff to multiple places at once and more!

Here are some photos from their flickr account:

Socialthing! Adds Pownce

 

And their iPhone interface:

Socialthing! Mobile - Home

Socialthing! iPhone Edition

Socialthing! Mobile - Post Status

Check out my Pownce Feed

No response, Feb 28, 2008

I’ve place a badge on my home page that displays my two latest Pownce posts, and dedicated an entire page Pownce Feeds that lists my 30 most recent Pownce posts.  Things that ramble off my brain that don’t deserve a full blog post will get Pownced.

Format DateTime to Short Date when Binding in ASP.Net

1 response, Feb 28, 2008

Here’s how to format a DateTime value to a Short Date when Binding in ASP.Net:

<%# Eval(”StartDate”, “{0:d}”) %>

How to style a table for Sharepoint

No response, Feb 28, 2008

The Sharepoint GridView is not as fancy as the ASP.Net Listview, therefore it’s better to use an ASP.Net Listview to display a data table and style the table with the Sharepoint style classes.  Here are my notes on how to style a data table for Sharepoint:

 

Table

Table Style: border-style:None;width:100%;border-collapse:collapse;

Table Class: ms-listviewtable

Header Row Class: ms-viewheadertr

Header TH: ms-vh2-nofilter ms-vh2-gridview

Item TD: ms-vb2

 

Data Paging

The TD surrounding the DataPager: ms-listheaderlabel

Data Pager:

<asp:DataPager ID="DataPager1" runat="server" PageSize="10">

<Fields>

<asp:NextPreviousPagerField ButtonType="Image" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" FirstPageImageUrl="/_layouts/1033/images/prev.gif" LastPageImageUrl="/_layouts/1033/images/prev.gif" NextPageImageUrl="/_layouts/1033/images/prev.gif" PreviousPageImageUrl="/_layouts/1033/images/prev.gif" />

<asp:NumericPagerField />

<asp:NextPreviousPagerField ButtonType="Image" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" FirstPageImageUrl="/_layouts/1033/images/next.gif" LastPageImageUrl="/_layouts/1033/images/next.gif" NextPageImageUrl="/_layouts/1033/images/next.gif" PreviousPageImageUrl="/_layouts/1033/images/next.gif" />

</Fields>

</asp:DataPager>

How To Dynamically Set a LinqDataSource to filter the results based on user input

No response, Feb 28, 2008

Here’s an example of how to dynamically set the where property on a LinqDataSource to filter data based on user input from a textbox.  In this case we have a Linq entity called ContractsEntity that has a table called ContractHeaders.  Not shown in this example is the listview (in the Ajax UpdatePanel) that is bound to the LinqDataSource.  The listview will show all contracts by default, but I want the user to be able to enter text to filter the results.  The user enters data in the textbox and clicks on the Search button.  This causes the UpdatePanel to send an Ajax request which fires off the SearchContractNumButton_Click event.  In the event I set the LinqDataSource Where property to do the filtering.

The ASP.Net source looks like this:

<form id=”form1″ runat=”server”>

<div>

<asp:LinqDataSource ID=”ContractHeadersLinqDataSource” runat=”server”

ContextTypeName=”ContractsEntity” TableName=”ContractHeaders”>

</asp:LinqDataSource>

<asp:ScriptManager ID=”ScriptManager1″ runat=”server”>

</asp:ScriptManager>

<asp:UpdatePanel ID=”UpdatePanel1″ runat=”server”>

<ContentTemplate>

<div>

<p>Enter a contract to search for:</p>

<p>Contract # <asp:TextBox ID=”SearchContractNumTextBox” runat=”server”></asp:TextBox>

<asp:Button ID=”SearchContractNumButton” runat=”server”

onclick=”SearchContractNumButton_Click” Text=”Search” />

</p>

</div>

</ContentTemplate>

</asp:UpdatePanel>

</div>

</form>

In the code behind the Button’s OnClick event looks like this:

protected void SearchContractNumButton_Click(object sender, EventArgs e)

{

ContractHeadersLinqDataSource.Where = “ContractNum.Contains(\”" + SearchContractNumTextBox.Text + “\”)”;

}

After further testing I have determined that this is not the best way of doing things, it stops working with paging.  Once I have figured out a better way of doing this I’ll post it.

A better way of doing this requires absolutely no code!  Configure your LinqDataSource in design view and click Next in the Choose a Context Object window.  Click on the Where button to configure the Where.  Make sure Automatically generate the Where Expression… checkbox is not checked.  In the Where Expression text area enter

ContractNum.Contains(@ContractNum)

Click on the Add Parameter button to add the Parameter.  In Parameter Source choose Control.  In ControlID choose SearchContractNumTextBox.  Click on the Show advanced properties link to show advanced properties.  Change ConvertEmptyStringToNull to False (Missing this step will cause an error on the page).  Change Name to ContractNum.  See the screenshot below.  Click OK and Finish.  Your filtering should be all set to go!

LinqDataSource Filter On User Input
Page 1 of 41234»