News

Coders 4 Charities is live!!!
Add to Technorati Favorites

My Stats

  • Posts - 43
  • Comments - 80
  • Trackbacks - 20

Twitter












Tag Cloud


Recent Comments


Recent Posts


Archives


Post Categories


Image Galleries


Blogs I read


Company Links


Fun Stuff


Kansas City User Groups


My CMS Projects



kcdotnet_green

Very happy to announce that the KC .Net User Group site is live!
The site is intended to announce upcoming meetings and presenters at the User Group, and to promote the adoption and use of the Microsoft .NET framework and related technologies to the Kansas City community.
It will be evolving as future needs arise, but I think it's a great starting point for keeping local developers in touch with all things .NET!

So... what are you waiting for? Check it out now! Register! Post a thread on the forum!

Doug


dougsmall

Last night (July 22, 2008) I presented on Windows Communication Foundation vs. Web Services at the Kansas City .NET User Group.
I talked about Web Services, and how they existed in the .NET 2.0 Framework, and compared them to the new WCF framework in .NET 3.0 and 3.5.
There was a turnout of 57 developers, and Modis brought Gates BBQ!

I've uploaded the presentation to my SkyDrive here.
Many thanks to everyone who showed up to hear me ramble!



youtube  YouTube has recently released a new feature they're calling Annotations - the ability to embed speech bubbles, notes, and spotlights into YouTube videos, with ability to follow a hyperlink when any of those objects are clicked. I remember there were books I read as a kid where you could choose your own adventure. Does anyone remember those? You would get to a part in the book where it would say: "Should Johnny go home and study? Turn to Page 32. Should he hang out and play Rock Band with his friends? Turn to Page 68." Anyway, it was awesome. This is what YouTube just put out there. The ability to create a pop-up video of the used-to-be-mundane.

 

camtasia Couple this with Camtasia Studio, which is a screen recording application that allows you to make video demonstrations, how-to's, or training videos (among many other applications), and you've got one heck of a rich and compelling video.

 

 

For a while now, I've been wanting to create some training videos for a .NET-based web site I built a couple years ago called VFW eMembership. This site allows VFW members and officers to perform tasks that were previously reserved for the post office. Renewing annual dues, changing addresses, applying for new membership, replacing a lost membership card -- these are just some of the things that can be done on the site. However, I'm not a UI guy (and no budget for a UI guy), so some of this stuff is hard to figure out. You've got to jump through a bunch of hoops to even register (especially for an officer account).

I've used Camtasia and YouTube's annotations to create some rough videos that take advantage of the zoom-n-pan functionality in Camtasia, as well as the speech bubbles and spotlights in Annotations. Like I said, it's a rough draft, but hopefully enough to pitch to upper-management.

This is the main video that links to 2 other videos (or you can go see my videos here):

 


c4c-bar

Well, it was a great weekend! 25 developers showed up to help out 5 charities, and each charity ended up with an awesome implementation. I've already written the main C4C Event Wrap-Up on the C4C site, as well as wrap-ups for each of the charities.

The event write-up, as well as the write-ups for each charity can be found on the news page of the C4C site.



The 5 charities who were helped this weekend are:

Many thanks (again!) to all those who showed up to develop, volunteer, and donate their time to this amazing event!

 


These are the final teams who volunteered this weekend at the Coders4Charities event.

Many thanks to all who showed up to help!


Charity Name
: Boy Scout Troop 813
Needs: A basic website to announce activities, give information, and promote Scouting. We would like to be able to update it remotely by authorized users. We must follow BSA guidelines to ensure we protect the identity of our Scouts.

Team Lead: Lee Brandt
Team Members:

  • Becky Isserman
  • Blake Theiss
  • Joe Loux
  • Timothy Wright


Charity Name
: Berean Bible Church
Needs: The Berean Bible Church would like to have a membership tracking web application built to be able to keep an up-to-date list of members and regular attendees of the church and relevant information about each member.

Team Lead: Steven Hildreth
Team Members:

  • Jill Kirkpatrick
  • Joseph Cook
  • Jim Heavey
  • Kevin Shaffer

Charity Name: Metropolitan Organization to Counter Sexual Assault (MOCSA)
Needs: MOCSA would like their web site to be enhanced. They will benefit from a CMS such as Graffiti CMS or DotNetNuke.

Team Lead: Patrick Herrington
Team Members:

  • David Rogers
  • Buck Sommerkamp
  • Alex Sommerkamp 
  • Cody Inman
  • Rashid Hoda

Charity Name: Missouri Pit Bull Rescue (MPR)
Needs: Needs: MPR would like a new look for their web, more professional-looking, and easy maintenance. They will benefit from a CMS such as Graffiti CMS or DotNetNuke.
Team Lead: Tim Hibbard
Team Members:

  • Hong Chen 
  • James Clemons
  • Yuriy Lyeshchenko

Charity Name: Task Force Omega of Missouri, Inc.
Needs
: New web site. They currently have a MySpace page. Need to support eCommerce functionality for online donations.

Team Lead: Shawn Mannen
Team Members:

  • Jason Atcheson
  • Jacob Dubin
  • Joe Seaman
  • Mary Stayton

 


c4c-bar It is day one (well, night one) of Coders4Charities, and the teams are off and running. We had a few no-shows, but we managed to do some last-minute re-arranging and load balancing, and it seems that every team is equally loaded. At last check, they were all involved in requirements gathering, and they're trying to determine what solutions will work for them.

 

 

The charities that are here tonight are:

  • Metropolitan Organization to Counter Sexual Assault
  • Boy Scout Troop 813
  • Berean Bible Church
  • Missouri Pit Bull Rescue
  • Task Force Omega

 


I have a stored procedure that I want to call from my VB.net code. The problem is that the stored procedure input parameters may change. Rather than recompiling the stored procedure, and recompiling the assembly that calls the stored procedure, I want my VB.net assembly to query the stored procedure for its parameters, and return them back to me in a list.

I've done some blog searches for this, and I couldn't find anything that did anything like this (or my search terms were not explicit enough).

UPDATE (thanks to Bill Minton): below, I mention using the sp_helptext functionality in SQL, which is a pain. I've left the original code at the end of this post for posterity. Bill left a comment on this post that uses the following SQL functionality: select parameter_name from information_schema.parameters where specific_name = 'YourProcName'

Below is the code that uses this functionality to get back a List(Of String) with the parameters. I just coded it without testing it, so you may need to work on it a bit (I'm working on something else higher priority at the moment).

   1: Public Shared Function GetStoredProcParams(ByVal spName As String, ByVal dataAction As Aptify.Framework.DataServices.DataAction) As List(Of String)
   2:     Dim reader As SqlDataReader
   3:     Dim params As New List(Of String)
   4:  
   5:     ' build the SQL query
   6:     Dim sql As String = String.Format("select parameter_name from information_schema.parameters where specific_name = '{0}'", spName)
   7:     Try
   8:         reader = dataAction.ExecuteDataReader(sql)
   9:         While reader.Read
  10:             params.Add(reader.GetString(0))
  11:         End While
  12:         reader.Close
  13:     Catch ex As Exception
  14:         Return Nothing
  15:     End Try
  16:  
  17:     Return params
  18: End Function
Thanks again to Bill!

 

Old way:

I've written  VB.net solution to this, which pretty much makes a call to SQL's sp_helptext stored procedure, and parses through the parameter list until it reaches [what it thinks is] the end.

This code works for my needs, but there may be a few bugs for single-parameter stored procs or different stored procedure definitions. My goal is to give a starting point to anyone else out there who is in the same boat as me, but doesn't want to spend the hour or two doing the proof-of-concept.

That being said... here's the code... Let me know if you have any questions. Note that I didn't code out the SQL connection info; you'll need to code that yourself.

 

   1: Public Shared Function GetStoredProcParams(ByVal spName As String) As List(Of String)
   2:     Dim sql As String = String.Format("sp_helptext {0}", spName)
   3:     Dim ds As DataSet = dataAction.GetDataSet(sql)
   4:     ' get the first two rows from the DataSet
   5:     ' (you can keep appending more rows to the spText string if you have a lot of input parms)
   6:     Dim spText As String = ds.Tables(0).Rows(0).Item(0)
   7:     spText += ds.Tables(0).Rows(1).Item(0)
   8:  
   9:     ' we should have the sp definition, with all of the input parameters
  10:     ' pull out the create proc statement
  11:     spText = spText.Replace(String.Format("CREATE PROC {0}", spName), "")
  12:  
  13:     ' now we need to parse out the params themselves
  14:     Dim startIndex As Integer, endIndex As Integer
  15:     Dim params As New List(Of String)
  16:     Dim param As String
  17:  
  18:     While True
  19:         ' find the @
  20:         startIndex = spText.IndexOf("@")
  21:         If startIndex <= 0 Then
  22:             Exit While
  23:         End If
  24:         ' trim away anything to the left of the @
  25:         spText = spText.Substring(startIndex, spText.Length - startIndex)
  26:         ' find the space after the param
  27:         endIndex = spText.IndexOf(" ")
  28:         ' get the param name
  29:         param = spText.Substring(0, endIndex)
  30:         ' add to list
  31:         params.Add(param)
  32:         ' rip out that param we just found
  33:         spText = spText.Substring(endIndex, spText.Length - endIndex)
  34:         ' look for the next @, to see if it's a param, or just sql code down stream
  35:         startIndex = spText.IndexOf("@")
  36:         ' look for a comma, to see if there are more params listed
  37:         endIndex = spText.IndexOf(",")
  38:         ' if the comma comes after the param, this is the last param
  39:         If endIndex > startIndex Then
  40:             ' this is the last parm left
  41:             Exit While
  42:         End If
  43:  
  44:     End While
  45:  
  46:     Return params
  47: End Function

c4c-bar

Software developers! Graphic designers! Database developers! We need you! There is one month left until Coders 4 Charities happens! We've got the charities, we've got the sponsors... we need more developers! We had an excellent turnout at the Microsoft Heroes Happen Here event yesterday, March 25, 2008, and we hope that we reached a lot of developers during the day. If we spoke to you, and you want to accept the challenge, register now for the event!!

What is Coders4Charities? It is a 3-day charity event that pairs charities and local software developers. Charities often do not have the funds to implement a new web site, intranet or database solution. Software developers often do not volunteer for charities because their skills do not apply. This event is the perfect marriage of these two needs; software developers accepting the challenge by volunteering their time to help charities, who in turn can better serve their community though the latest technology!

 


megaphone2

Calling out to all coders in the Greater Kansas City area! We need you! We're looking for software developers, graphics designers and DBAs in the area who are willing to step up to the challenge by taking on a website, intranet or database implementation. We're hosting an event called Coders For Charities, taking place in late April 2008, that will capitalize on the mad skills and passion of geeks in Kansas City, and focus their efforts to benefit a local KC Charity. We've got the venue. We've got the sponsors. We've got the charities. We need geeks. It's your turn. Step up. Even better, challenge your friends and co-workers to GEEK UP to the challenge.

 

Register for the event now!

 


Don't send a lame Starring You! eCard. Try JibJab Sendables!

Don't send a lame Starring You! eCard. Try JibJab Sendables!

c4c-fullsize

We're looking for non-profit organizations in the Kansas City area that we can help during an upcoming event called Coders 4 Charities. This will be a 48-hour  coding event (from Friday, April 25 through Sunday, April 27, 2008) that will benefit non-profit and charity organizations in the greater Kansas City area.

If you are a non-profit organization looking for a better way to:

  • increase your presence on the internet through a rich website
  • help your volunteers and employees stay in touch and organized through an intranet
  • store, manage, retrieve and report against your volunteers, inventory, members or rescued animals, via the latest database technology
  • run your charity without having to fight an antiquated system

We want to help! We are in the process of recruiting volunteer software developers, and we will pair groups of developers with several charities in the area, with the end goal of providing a software solution that will help these charities focus on the real work: running their charity!

If you are interested in becoming part of this event, please register on our site, or contact us at info@coders4charities.org.

We're just a bunch of geeks who want to give back!

 


c4c-bar After a good amount of work (and hurling the laptop across the room several times), the Registration Pages for Developers and Charities are up!

It's late. I'm tired. Go look! And sign up!!

Coders 4 Charities


graffiti-logo-270907_3 We're using Graffiti CMS as our CMS for Coders 4 Charities, a site that we built to spread the word about our charity event coming late April 2008. We needed to implement a registration page, so that developers and charities can register for the event. Graffiti is obviously very powerful and easy to use, but I had a hard time figuring out how to get user entry to work.

Here is my fundamental understanding of how things kinda work:

When you create a post, Graffiti will create a folder for your post, and create a default.aspx page. If you categorize the post, it will put your new page under the category sub-dir. When your default.aspx page renders, Graffiti will look for a .view file that matches the name of your post (for example, if your post name is Registration, the path will be [site root]/registration/default.aspx.) If Graffiti cannot find a registration.view file,it looks for default index.view and layout.view files, which tell it how to render the themes. If it finds your registration.view file, it will render according to the template in that view.

Graffiti has nice Contact and Comment out-of-the-box functionality, and it uses macros to code-gen the javascript in the view files. After some digging, I found out that the javascript function call is performing an Ajax.Request to a HTTP handler, which is compiled into the Graffiti.Core library. The button click event passes the path to the .ashx file, and the HTML <form> is serialized as the parameter collection passed to the handler. Somewhere in that core library the magic happens, the Request is processed, the contact, comment or your operation is processed, and the handler does a Response.Write to send back results.

So, these are the steps I took to implement a registration page on Coders 4 Charities (which, at this time, is not yet fully implemented)

1) Create your post. For this blog, we'll call it Registration. I put it in a category called registration. Put something basic in the body, it will be thrown out by your view file. UPDATED: 2/6/08: I was wrong, it will not be thrown out by the view file. It creates an actual post that is navigable if you put it in a category. I added it to the uncategorized category and checked all of the options that pretty much tell the post to not display.

2) Create the javascript file that will handle your button onClick event. I called mine c4c.js and I put it in the __utility\js folder (where the graffiti.js and prototype.js files are. NOTE: you need the protoype.js file to handle your Ajax.Request call!!).

function C4CRegisterDeveloper(url)
{
    new Ajax.Request(url,
    {
        method:'post',
        parameters:  Form.serialize('register_form'),
        onSuccess: function(transport)
                    {
                         var response = transport.responseText || "no response text";
                         alert(response);
                    },
        onFailure: function()
        {
            alert("Something went wrong");
        }
  });

}

As you can see, this function (for now) simply throws the response from the Ajax.Request call into an alert() call, so I can make sure we made it round trip.

3) Create a new .view file with the name of your post (registration.view). Mine has a bunch of HTML <table>-based labels and text-boxes, followed by the submit button. I opted to not use the Graffiti macros for my submit button, because I didn't want to extend their macro library. Hard-coding works fine for me in this case. In addition, this view file contains the reference to my c4c.js file. Here is the markup for the registration.view file:

<script type="text/javascript" src="/__utility/js/c4c.js"></script>

<form action="$url" method="post" id="register_form">
<table>
<tr>
<td> <label class="form_field_pair" for="firstlast">Name</label> </td>
<td>
<input class="form_field" type="text" name="_firstname" id="_firstname" value="" tabindex="1" />
<input class="form_field" type="text" name="_lastname" id="_lastname" value="" tabindex="2" />
</td>
</tr>

<tr>
<td> <label class="form_field_pair" for="address">Address</label> </td>
<td> <input class="form_field" type="text" name="_addresslineone" id="_addresslineone" value="" tabindex="3" /> </td>
</tr>

<tr>
<td> &nbsp;</td>
<td>
<input class="form_field" type="text" name="_addresslinetwo" id="_addresslinetwo" value="" tabindex="4" />
</td>
</tr>

<tr>
<td> <label class="form_field_pair" for="citystatezip">City, State, Zip</label> </td>
<td> <input class="form_field" type="text" name="_city" id="_city" value="" tabindex="5" />
<select class="form_field" name="_state" id="_state" tabindex="6">
    <option selected value="--">--</option>
...
</select>
<input class="form_field" type="text" name="_zipcode" id="_zipcode" value="" tabindex="7" />
</td>
</tr>

<tr>
<td> <label class="form_field_pair" for="email">Email</label> </td>
<td> <input class="form_field" type="text" name="_email" id="_email" value="" tabindex="8" /> </td>
</tr>

<tr>
<td> <label class="form_field_pair" for="phone">Phone</label> </td>
<td> <input class="form_field" type="text" name="_phonenumber" id="_phonenumber" value="" tabindex="9" /> </td>
</tr>

<tr>
<td> <label class="form_field_pair" for="phone">Cell</label> </td>
<td> <input class="form_field" type="text" name="_phonenumbertwo" id="_phonenumbertwo" value="" tabindex="10" /> </td>
</tr>

<tr>
<td> <label class="form_field_pair" for="talents">Talents</label> </td>
<td> <textarea class="form_field" id="_talents" name="_talents" cols="20" rows="5" tabindex="11"></textarea> </td>
</tr>

<tr>
<td> &nbsp; </td>
<td> <input type="button" name="Register" value="Register" id="Register" onClick="C4CRegisterDeveloper('/c4c.ashx');" /> </td>
</tr>

</table>
<div style="display:none;" id="contact_status"></div>
</form>

This can obviously be cleaned up, but hey, I'm still prototyping.

 

4) Create your Generic HTTP Handler. I created a C# Web Project, added a Generic Handler template, and named it c4c.ashx. VS will create the code-behind for you, and the end result looks like this (with my code added):

using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace C4CWeb
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class c4c : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            System.Text.StringBuilder myResponse = new System.Text.StringBuilder();
            myResponse.Append(context.Request["_firstname"]);
            myResponse.Append(" ");
            myResponse.Append(context.Request["_lastname"]);
            myResponse.Append("\r\n");
            myResponse.Append(context.Request["_addresslineone"]);
            myResponse.Append("\r\n");
            myResponse.Append(context.Request["_addresslinetwo"]);
            myResponse.Append("\r\n");
            myResponse.Append(context.Request["_city"]);
            myResponse.Append(", ");
            myResponse.Append(context.Request["_state"]);
            myResponse.Append(" ");
            myResponse.Append(context.Request["_zipcode"]);
            myResponse.Append("\r\n");
            myResponse.Append(context.Request["_email"]);
            myResponse.Append("\r\n");
            myResponse.Append(context.Request["_phonenumber"]);
            myResponse.Append("\r\n");
            myResponse.Append(context.Request["_phonenumbertwo"]);
            myResponse.Append("\r\n");
            myResponse.Append(context.Request["_talents"]);
            context.Response.Write(myResponse);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

For now, all I am doing is making sure that I can parse off the elements in the serialized <form>. This is just proof-of-concept, and not clean by any means. I just want to pull the parameters off the context.Request object, assemble a string, and send it back to the caller to confirm the round trip. This is where you add your business logic. I still need to take these parameters and store them in my data source.

 

5) Push it up. I put the c4c.ashx file off the site root, and my C4CWeb.dll in the bin folder in Graffiti.

 

I think that should be everything! If I have forgotten anything, or if you have any questions, post a comment to this blog and I'll try to help.

Doug