mysqlguy.net

Friends

Finally.. Group Chat in Google Talk for the Desktop

sim.plified.com - May 14, 2008 - 3:49pm

I'm a beta nut.. I love the latest and greatest in an app.  Finally I found an edition of Gtalk that allows me to do group chat on the desktop component.  It's available from Google Labs: Click here to download.

Categories: Friends

Communion Hymn - Gather at the Table

sim.plified.com - May 10, 2008 - 2:16pm

My friend William Gucker (Bill) has written anther hymn.  This one if focused on communion and what it means to shre in the body and blood of Jesus together.  It is sung to the tune of "The First Noel".

Gather at The Table

At the table of the Lord, where the brethren meet.

     There's the heart of assembly, and fellowship sweet.

To know, and to be known. To declare where you stand.

     Pilgrims must walk together in this foreign land.

 

Our bodies are clean, yet we still wash our feet.

     We're aware that our sins may cause sickness or sleep.

Confess, repent, keep your conscience clean.

     Bless-ed is the pure heart, for the Lord shall be seen.

 

We remember through the bread, where the Lord of Lords led.

     His body was broken, follow me he said.

Rejoice and do not fear, to carry your cross.

     On the day of redemption you'll suffer no loss.

 

In the wine we see the blood, of a covenant made.

     Forgiveness of sins and a debt that was paid.

One cup is shared by all, and all are made one.

     Keep watch o'er your brother, so says the Son.

 

Heavenly marriage that is forged, groom coming for bride.

     An early taste now of what God will provide.

Dining all together now, a love feast so sweet.

     Eternally joyful at our saviors feet.

 

Technorati Tags: ,
Categories: Friends

Speed Up Web Browsing with OpenDNS Shortcuts

sim.plified.com - May 9, 2008 - 7:10am

A couple of months back I started using OpenDNS, a DNS service that offers a number of nice services. One that I have just started to utilize more is the shortcut feature. OpenDNS allows you to define short cuts that you can type right into the address bar of your browser.  The great part of using OpenDNS for shortcuts is that they are browser and system independent.  So on any browser on any computer connected on my network (OpenDNS is setup in the router), I can access my URL shortcuts.

I've started to add more short cuts to those commonly accessed urls.  Its very easy to setup:

So looking above you can see in order to get to gmail, all I have to do is type "g" in the URL address bar.

Filtering

Another nice thing about OpenDNS is the filtering service.  If you're one of those people who doesn't enjoy naked people showing up on their computer (expectedly or unexpectedly), OpenDNS is a nice way to filter your Internet connection from all sorts of nasty stuff.   If you have kids who can get near a computer and pound away on the keyboard, you will definitely want to consider this service. 

Technorati Tags: ,,,
Categories: Friends

Dirty, Dirty, Dirty… Implementing IsDirty with JavaScript

sim.plified.com - May 7, 2008 - 3:06pm

Sometimes when a user is editing a page, you want to let them know that if they click on a link or a section of the main navigation that they will lose their changes. 

Here's a quick walk through on an IsDirty implementation I did with jQuery and ASP.NET.

Add this hidden field somewhere on your page

<input type="hidden" id="dirty" value="" /> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

Here is the JavaScript that will manipulate the value.

 

<script src="js/jquery-1.2.3.min.js" type="text/javascript"></script> <script type="text/javascript"> window.onbeforeunload = checkExit; function confirmExit() { // this value will be return as a part of the confirmation message return "If you have made any changes to the fields without clicking the Save button, your changes will be lost."; } function checkExit() { if ($("#dirty").val() == "true") { return confirmExit(); } } function setDirty(changeVal) { $("#dirty").val(changeVal); } function confirmAndClean(msg) { setDirty(false); return confirm(msg); } </script> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

The only thing that remains it to make sure that you call these JavaScript client functions in the appropriate places.

With ASP.NET I would do something like this:

ddlCategoryPage.Attributes.Add("onclick", "setDirty(true);"); txtTitle.Attributes.Add("onkeyup", "setDirty(true);"); btnSavePage.Attributes.Add("onclick", "setDirty(false);"); btnCancelPage.Attributes.Add("onclick", "return confirmAndClean('Any changes you have made will be lost. Are you sure you want to cancel?')"); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

When I save the page I set the dirty var false so that the user is not prompted.  When the dropdown or title on the page is edited I set the dirty var to true.  The cancel button calls a function that clears the dirty var and displays a custom confirmation box.

With standard HTML I could call the functions like this:

<input type="text" onkeyup="setDirty(true)" /> <input type="submit" value="Save" onclick="setDirty(false)" /> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

Seems to work like a charm so far.  Hope this helps you out.  If you have questions, do not be afraid to shoot me an email or post a comment.

Technorati Tags: ,,
Categories: Friends

19th Ward (Westside) Farmers Market

sim.plified.com - May 7, 2008 - 2:30pm

This notice went out on an email list today.  Here are the details I said I would announce when they became available:

The market in our neighborhood will celebrate opening day on June 17th!!!!!!

It will be called the Westside Farmers Market, serving the westside neighborhoods, as well as anyone else interested in shopping with us. Many westside neighborhood organizations have been involved in the start-up. It will be located in St. Monica's parking lot. The Wilson students are working on a logo now, and you will soon start to see sandwich boards, etc. Applications have been received from fruit and vegetable growers, nurseries. There is the possibility of homemade pasta, meat, jams, ice cream, baked goods. We hope to enjoy entertainment by local musicians, and gather for fun every Tuesday from 4:00 - 8:00 PM.

Technorati Tags:
Categories: Friends

Package Files for Zip Download with ASP.net

sim.plified.com - May 1, 2008 - 2:47pm

In some of my other posts I've talked about an application I have built that accesses the Flickr API and provides campus administrators with a filtered view of the images in our Flickr account. 

One of the features of this site is a photo bucket where users can "mark as favorite" certain images.  I have now included a function that allows them to download all of their favorite photos in a zip file. 

Dependencies:

This app utilizes the SharpZip Library - available here.

Props:

This tutorial was particularly helpful for me - click here.  Although my implementation is quite different.

Basically the user clicks on a button and the zip file presents itself for download

Markup:
<asp:LinkButton ID="lbDownload" runat="server" OnClientClick="$(this).html('Creating Zip File… this may take a moment')">Download All Images (.zip)</asp:LinkButton> .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

Note that I am using jQuery to handle some client feedback.

 

Code Behind:
Public Function CreateZipOfFavorites(ByVal intUserId As Integer) As String Try 'Get list of users favoriates from the database Dim dsFavs As DataSet = UserFavorites(intUserId) If Not IsNothing(dsFavs) Then 'Zip filename will be a simple datetime string Dim strNow As String = String.Format("{0:MMM-dd-yyyy_hh-mm-ss}", System.DateTime.Now) 'Create the Zip library Dim myZipStream As New ZipOutputStream(File.Create(HttpContext.Current.Server.MapPath("./Zips/") + strNow + ".zip")) 'This is the Photo object that comes from the FlickrNet.dll Dim myPhoto As PhotoInfo 'Loop through the favorites and add them to zip For Each drFav As DataRow In dsFavs.Tables(0).Rows 'Grab the files from flickr myPhoto = myFlickr.PhotosGetInfo(ImageGetFlickrId(drFav("pc_id"))) 'Sycronously grab the data (note, large files will take time) Dim fileClient As New Net.WebClient() Dim dataBuffer As Byte() = fileClient.DownloadData(myPhoto.OriginalUrl) 'Put the images into the zip library Dim zipEntry As New ZipEntry(myPhoto.PhotoId & "." & myPhoto.OriginalFormat) myZipStream.PutNextEntry(zipEntry) myZipStream.Write(dataBuffer, 0, dataBuffer.Length) Next 'Clean up and close up myZipStream.Finish() myZipStream.Close() 'Return the file name Return strNow & ".zip" Else 'Return blank if no zip is created Return "" End If Catch ex As Exception myErrorHandler.Exception = ex myErrorHandler.DefaultHandler() Return "" End Try End Function   Protected Sub lbDownload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lbDownload.Click Dim fileZip As String = CreateZipOfFavorites(myPhotoCentral.UserGetId(Session("LogonUser"))) If fileZip <> "" Then Session("FlashMessage") = "Zip file created." Response.ContentType = "application/force-download" Response.AppendHeader("Content-disposition", "attachement; filename=" & fileZip) Response.TransmitFile("Zips/" & fileZip) Else Session("FlashMessage") = "Zip file creation failed." End If End Sub .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

That's about it for the implementation.  It's pretty straight forward.  Let me know if you have comments or questions.

Categories: Friends

"WHERE OR" in LINQ using "Contains"

sim.plified.com - April 18, 2008 - 11:34am

In on of my recent implementations I was looking to loop through a series of categories and then find all the jobs in those categories and add them to a the results list.  The most logical way of doing this would have been to "Where OR" a bunch of items together.  LINQ however does not contain a "WhereOr" operator.  Instead I was able to implement by 1) shoving the selected items into an integer array, and then 2) Using the "Contains" command to filter down the job/category link table.

Here's a code snippet:

'If the category selection method is selected then filter the jobs. If rblCategories.SelectedValue = "Some" Then 'Get all the categories and throw them into an array. Dim CategoryIdList As New ArrayList() For Each li As ListItem In cblCategories.Items If li.Selected Then Dim intCategoryId As Integer = li.Value CategoryIdList.Add(intCategoryId) End If Next 'Cast the array list into the an array of integers Dim intCategoryIdList As Integer() = CType(CategoryIdList.ToArray(GetType(Integer)), Integer()) 'Filter the category List Dim categories = From c In dbCareerServices.LQ_TBL_JOBS_TO_CATEGORies Select c categories = categories.Where(Function(ct) intCategoryIdList.Contains(ct.int_category_id)) 'Now filter the job list result = result.Where(Function(j) categories.Any(Function(c) c.int_job_id = j.int_job_id)) End If .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

If anyone knows of a better way to get similar results with LINQ, please let me know.

Technorati Tags: ,,
Categories: Friends

CheckBoxList as and Unordered List (CSS Stylable)

sim.plified.com - April 18, 2008 - 11:02am

The CheckBoxList control in ASP.NET is great because the control handles all the data for you.  However, if you want to enhance the UI a little bit the control is left wanting for sure.  This led me to do some searching for CheckBoxList alternatives.  I came up with two blogs posts (one here, the other here) that recommended creating a Custom Server Control that encapsulated the CheckBoxList inside of an unordered list. I went this route and the results were fantastic:

I used the Server Control to change the CSS Class of the enclosing list item when the item is selected.  That allowed me to apply some nice CSS styling to to any item that was selected.  (As a side note the entire block is enclosed in an UpdatePanel, so clicking the options changes the data below dynamically).

I have enclosed my code for my custom server control below.  I borrowed from the the two blog posts above, but added some additional data to account for "AutoPostBack" and the applying CSS Styling to the selected item.  I'm am also making the compiled DLL available for download here.

Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Text Imports System.Web Imports System.Web.UI Imports System.Web.UI.WebControls Namespace edu.roberts.its.CustomWebControls <DefaultProperty("Text"), ToolboxData("<{0}:ULCheckBoxList runat=server></{0}:ULCheckBoxList>")> _ Public Class ULCheckBoxList Inherits CheckBoxList Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter) Controls.Clear() Dim inputFormatString As String = "<input id={0}{1}{0} name={0}{2}{0} type={0}checkbox{0} value={0}{3}{0} {4} {5} />" Dim labelFormatString As String = "<label for={0}{1}{0}>{2}</label>" If (Not MyBase.CssClass Is Nothing AndAlso MyBase.CssClass <> "") Then writer.WriteLine("<ul class=""" & MyBase.CssClass & """>") Else writer.WriteLine("<ul>") End If For index As Integer = 0 To Items.Count - 1 Dim inputBuilder As New StringBuilder Dim labelBuilder As New StringBuilder Dim checked As String = "" If (Items(index).Selected) Then checked = "checked=""checked""" End If 'Add selected class to the list item if the checkbox is checked. writer.Indent += 1 writer.WriteLine("<li class=""" & IIf(Items(index).Selected, "selected", "") & """>") writer.Indent += 1 Dim postbackScript As String = "" If MyBase.AutoPostBack = True Then postbackScript = String.Format("onclick=""javascript:setTimeout('__doPostBack(\'{0}\',\'\')', 0)""", MyBase.UniqueID & "$" & index.ToString()) End If inputBuilder.AppendFormat(inputFormatString, """", MyBase.ClientID & "_" & index.ToString(), MyBase.UniqueID & "$" & index.ToString(), Items(index).Value, checked, postbackScript) labelBuilder.AppendFormat(labelFormatString, """", MyBase.ClientID & "_" & index.ToString(), Items(index).Text) writer.WriteLine(inputBuilder.ToString()) writer.WriteLine(labelBuilder.ToString()) writer.Indent -= 1 writer.WriteLine("</li>") writer.WriteLine() writer.Indent -= 1 Next writer.WriteLine("</ul>") End Sub End Class End Namespace .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Technorati Tags: ,,,
Categories: Friends

CushyCMS and UserVoice - found two great web applications in the same day

sim.plified.com - April 11, 2008 - 7:40am

Paying attention to my daily feeds I found a new web application called CushyCMS.  CushyCMS allow users to edit web content WITHOUT the necessity of installing any third party CMS software on the server. For existing sites and small projects this seems life a fabulous tool.  It seems to be be dead simple to use and setup.  I watched the 5 minute intro and found out most of what I needed to know!  On the technical side, the designer/developer simply includes a class on any of the DOM objects that he or she wants the editor to be able to edit.  CushyCMS parses the contents (accessing your site through FTP) and only allows the editor to edit the content areas you have designated.  Seems sharp, and easy to use.

When providing some feedback about CushyCMS I found that they were utilizing another new web application called UserVoice.

UserVoice looks like a simple bug tracking and user feedback program that allows the user to tell you what problems are most important to them.  I had a few problems logging in the first time, but other than that, the program seems to work well, allowing even anonymous users to vote on which issues they are seeing as problems or features that need to be added.  When developing my next web application, I may look to this app to get at my user base.

Technorati Tags: ,,,
Categories: Friends

Worm Hotel… Composting with Worms

sim.plified.com - April 10, 2008 - 9:14pm

Well since we have 3 boys (soon to be 4) we thought it only appropriate that we get well aquatinted with things slippery and slimy.  Actually, it was my wife who wanted to make the dive (or should I say squirm) into Vermicompost.  Now we have a hotel for worms in our backyard and lots of happy residents chowing down on our daily food scraps.   We have several small garden plots on our postage stamp size lot in the city, so I'm sure the ROI for compost is about 20 years at price it took us to build our hotel and populate it.  Cynicism aside, I have no doubt that the worm bin will not only provide us with some good compost, but hours on fun for our masculine element.  Check out the pictures below.  If you want to build your own hotel, here is one basic set of instructions.

Our New Hotel

 

New Residents.. wait.. maybe not.

 

The Real New Residents

Technorati Tags: ,,
Categories: Friends

Parsing URLs from Flickr Descriptions

sim.plified.com - April 10, 2008 - 8:52pm

PatternTap had its beginnings in flickr.  Instead of transferring all that data by hand, flickr's API allows us to access the data very nicely.  Unfortunately, the source URL for each images was not in a separate field, but in the general description field.  I wrote the following PHP function to parse the last URL out of the description and return it as a string.

// Returns the last URL in an HTML description // Input: HTML description // Output: URL string function return_url_from_description($desc) { $url = ""; $doc = new DOMDocument(); // shove the description in the dom $doc->loadHTML($desc); // search for anchor tags $a_tags = $doc->getElementsByTagName("a"); for ($i = 0; $i < $a_tags->length; $i++) { // get the href attribute of the anchor tag $url = $a_tags->item($i)->getAttribute("href"); } return $url; } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }
Categories: Friends

Creating Calendar Event Callouts for the ASP.NET Calendar Control

sim.plified.com - March 31, 2008 - 11:56am

Story

I needed to revamp our campus calendar and found a great css/javascript calendar callout implementation while browsing Squared Eye's UI gallery (soon to become Pattern Tap).  I wanted to do a similar implementation, highlighting the individual event, instead of the whole day.

My Version

Here is the visual end result of my calendar callout:

The date (or date span) appears in the header with a close button.  The event name, time, details, link and location are included in the box. At the bottom there is a permalink to the event in case people want to link directly to the Event information.  Click here to see the live implementation(Note: the calendar was still not live at time of blog article publication)

ASP.NET Implementation

I implemented this through a combination of the ASP.NET calendar control, some Ajax call backs, and the jQuery Javascript library.  I'll try to cover the basics of the implementations and point out the pitfalls I had to overcome below.

The events are show in the calendar day through implementing the DayRender event of the ASP.NET Calendar Control.  I loop through the events, add them to a string builder and then output that string into the control. 

... For Each dayEvent In events … myString.AppendFormat("<div id=""" & myEvent_ID & "_" & e.Day.DayNumberText & _ """ class=""event""><a href=""javascript: showEvent(" & myEvent_ID & _ ",'top','" & rightOrLeft & "', " & _ e.Day.DayNumberText & ")"" class=""e"">" & DisplayedLink & _ strDisplayedCalName & DisplayedTimeRange & "</a>{0}</div>", strEditLInk) Next 'Write the Event Info to the cell e.Cell.Controls.Add(New LiteralControl(myString.ToString())) .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

You can see that I have not included all my code, but you can see that each event is surrounded by an anchor tag that called the showEvent() javascript function.  This function passes a unique identifier of the event, how to display the box (e.g. top, bottom, left, right) and then the day number (needed to included day number because some events span multiple days with the same event number.  The day tells the javascript function which event in the UI to show the call out next to.

Javascript Functions

Here is the showEvent() function

function showEvent(id, posV, posH, day) { $('.event').attr("class","event"); $('.eventDetail').hide(); $('#' + id + '_' + day).attr("class","event eventSelected"); var myClass = 'eventDetail'; if (posV == "bottom") { myClass = myClass + " bottom"; } else { myClass = myClass + " top"; } if (posH == "left") { myClass = myClass + " left"; } else { myClass = myClass + " right"; } $.ajax({ type: "GET", url: "callbacks/ajaxcalendar.aspx?cmd=showEvent&id=" + id, success: function(htmlContent) { $('#' + id + '_' + day).append("<div id='hover_" + id + "_" + day + "' class='" + myClass + "'>" + htmlContent + "</div>"); } }); } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

First thing it is resets the classes.  This has the effect of closing another callout box if one is currently open.  Then the currently selected callout is selected (given the class "eventSelected").  Additional classes are added to the event to tell the box where to render in relationship to the event.

The event id is then used to make an ajax callback to get the details of the event (this prevents a large amount of data having to be loaded into the DOM on page_load()). 

To close the call out there is a very simple call that resets all the classes on the event objects.

function closeEvent() { $('.event').attr("class","event"); $('.eventDetail').hide(); } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

 

CSS

The CSS if very important in this implementation because it controls how the callouts are displayed.  An interesting bug I ran into while working on this is the IE 6/7 z-index bug that has been exceptionally well documented by Aleksandar Vacić.

Here is the important CSS

.event { position: relative; z-index: 1; font-family: Arial, Verdana; font-size: 9pt; line-height: normal; font-weight: normal; margin: 0; padding:0; } .eventSelected { color: #fff; background-color: #b22222; z-index: 2; } .eventSelected a { color: #fff; } .eventDetail { position: absolute; width: 290px; border: 5px solid #b22222; color: #333; background: #fff; z-index: 999; } .eventDetail .eventContent { padding: 10px; } .eventSelected .eventDetail .eventContent a { color: #b22222; } .eventDetail .eventHeader { background-color: #b22222; padding:0 0 6px 0; color: #fff;} .eventDetail .eventHeader a { display: block; float: right; } .eventDetail .eventFooter { text-align: right; margin: 5px 0 0 0; padding: 0; } .eventDetail h1 { margin: 0; padding: 5px 0 5px 0; font-size: 1.4em; line-height: normal;} .eventDetail h2 { margin: 0; padding: 0; font-size: 1.2em;} .eventDetail h1 IMG { border: 0; padding: 0 5px 0 0; } .top { top: 0; } .right { right: -300px; } .bottom { bottom: 0px; } .left { left: -300px; } .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; }

You can see that the z-index of event and eventSelected needs to be set differently.  This compensates for the IE6/IE7 z-index bug, ensuring that the event detail does show on the top of future events.

That's about the scope of it.  Please post any questions or comments you have.

Special thanks to Matthew Smith of Squared Eye who advised me on the layout.

 

Technorati Tags: ,,
Categories: Friends

A Hymn of our Age - Governance

sim.plified.com - March 30, 2008 - 7:30pm

Today I had the privilege of hearing and playing a new hymn that I believe captures a keen prophetic word to the church of our age.

This song is sung to the tune of Come Thou Fount of Every Blessing

Governance
Written by William J. Gucker

Holy Spirit come and bind us, baptize us in your body
Though the Church has many members, we can live in unity
Make us people with one judgment, with one spirit, and one mind
Guard our souls from worldly wisdom, it is your way we would find

There’s no elder who serves as Moses, Jesus came to set us free
We are governed by the Spirit, walking in him we agree
There is one Lord, undivided, there is one truth, one way
We must learn to abide in him, so we are not led astray

Survey the world around you, it may tempt you to despair
Satan seeks to find a foothold, Jesus’ body he will tear
Keep your eyes upon the scriptures, walk by faith, and not by sight
Do not fear, your strength will fail you, live in resurrections’ light

Fleshly men suppressing knowledge, build their strongholds all around
Marching faithful, sound a clear note, and their walls will tumble down
Waiting for the second coming we shall know as we are known
What was dim will come to light and we shall reap what we have sown

In a day where the attractive leadership of individuals is often substituted for the oneness, unity and brotherhood of believers this is a much needed song!

For those of you familiar with hymnody, the tune name is Nettleton and the meter is 8.7.8.7.D. If you have an interested in contacting the author, let me know an I can put you in touch with him.

Categories: Friends

Some insight..

sim.plified.com - March 29, 2008 - 11:42am

Here is some insight into what us web developer type people do all day.

Categories: Friends

T-SQL Loop through SELECT Statement

sim.plified.com - March 28, 2008 - 10:22am

I recently changed the a data structure in calendar program and needed to move some data around.  Normally to do this I would write an external app to query the database and rewrite the data.  This time I decided to try using T-SQL.  It worked great.  Below is my code:

DECLARE @Event_ID int DECLARE my_cursor CURSOR FOR SELECT Event_ID FROM ITS_CALENDAR_EVENTS_LIST WHERE EVENT_SA_Flag = 1 OPEN my_cursor FETCH NEXT FROM my_cursor INTO @Event_ID WHILE @@FETCH_STATUS = 0 BEGIN INSERT INTO ITS_CALENDAR_EVENTS_TO_FLAGS (Event_ID, Event_Flag_ID) VALUES (@Event_ID, 1) FETCH NEXT FROM my_cursor INTO @Event_ID END CLOSE my_cursor DEALLOCATE my_cursor .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Technorati Tags: ,,
Categories: Friends

960 CSS Grid System - Sketch, Design, Code

sim.plified.com - March 24, 2008 - 7:32am

I met Nathan Smith at BibleTech08.  A very enjoyable man who also has quite an enthusiasm for web standards based development.  At the conference he gave me a sneak peak on a new css grid system that he was developing.

I have used blueprint in the past and enjoyed the ease of building up the layout, but did not enjoy the the less design worthy features like the smallness of margin between columns.  Nathan had a similar prospective, which led him to develop a slightly different system.

One of the things I enjoy about Nathan's system is that he has tried to bring the prospective of the grid into the entire process.  He includes PDF sketch pages and PSD templates as a part of the download.  This gets you thinking about designing on the grid before you even start to touch a bit of code. 

Take his system for a test drive: http://960.gs/

I have yet to develop a full fledged site in his framework, but as soon as I do, I will try to post it here with a more through review.

Categories: Friends

Psalm Visualizer Gets Its Start

sim.plified.com - March 23, 2008 - 2:45pm

Well over this Resurrection weekend I had the chance to start building the Psalm visualizer that I talked about several posts ago.  The idea behind the visiualier is that it shows you by varying opacity the psalms that have NT references or allusions. 

Right now the interface is very simple, but then again, it's just for me at the moment.  The idea is that I insert a psalm reference and then a cross reference.  In the dropdown I select "Direct", "Allusion" or "Pondering".  Each of these has a different weight.  The weights are then added up to calculate the opacity representation of each psalm.  Feel free to take a look around

My hope is that as I trek through the psalms I continue to add references to this site.  When you click on the Psalm, it shows you the text of the psalm (thanks the the ESV web service) and the references I have marked in the margin.  There are a lot of ideas for enhancing the UI that I would like to develop.. but all in due time. 

Technorati Tags: ,,
Categories: Friends

Three Step Kitchen Stool (Popular Mechanics)

sim.plified.com - March 23, 2008 - 2:30pm

In thinking my three (soon to be four) boys I want to be able to teach to use their hands to make and fix things.  Being a computer programmer I know that in order to pass on these skills to my sons that I need to develop them myself. 

The kids are frequently in the kitchen trying to help mommy or washing their hands so a stool seemed like a useful project to start honing my skills.  I did some Googling and I found a plan to build a three step kitchen stool on the Popular Mechanics web site.  

Overall I was very satisfied with this stool.  It's rock solid and is definitely something that will be around for years and years (unlike something you would buy at Walmart or even IKEA). 

Here are a few things I learned while making this stool.

Don't be intimidated by new tools or processes - I never used a chisel, glued boards together, planed boards or recessed screws with wood plugs, but I found each of things steps to be fairly straight forward.  I dove right in an was able to learn a few things.

Lining up boards joined with dowels is tricky.  I think if I were going to join boards together on a regular basis I'd look into a joining tool. Lining up the holes where the dowels sit was not very straightforward (even though I marked the middle of the board, the drill seemed to shift). 

Be careful of different colored wood filler - I had some white color wood filer hanging around and decided to use it to fill in the gaps that were left by my cutting.  Bad idea, I should have gotten some wood filer that was the same color as my boards.  The result is that the filler did not blend in when the stool was stained.

Watch carefully if cutting a curve with a jig saw - I don't know happened, but I must have stopped paying attention for a second while cutting the bottom curve with my jig saw.  What I got a flat spot in the curve that I tried to smooth out with my Dremel tool. 

Overall the project was a success.  The boys watched the construction of the whole project (preoccupying them for many evenings) and now they have a piece of furniture that they helped to construct.  It was a learning process for Daddy as much as for them, but after all, that was the point of this particular project. 

Categories: Friends

CSA Pickup Point in the 19th Ward

sim.plified.com - March 20, 2008 - 12:25pm

There will be a pick-up location for the Windy Meadow Farms CSA in the 19th Ward this year.  On Thursday evenings during the growing season, from 4-6 PM,  our house will be a pick-up site for this organic vegetable producer.  If you have interest in Community Supported Agriculture (CSA), or if you'd just be interested in a steady stream of local, in-season, organic produce, take a look at their website. http://www.windymeadowfarms.com/  Their site gives all of the pricing and contact information along with an online registration form for anyone who wants to sign up.

If you are interested in picking up at our house, please contact me and I will give you our address.

Michael Warren Thomas will be interviewing Brenda from Windy Meadows Farms on March 29th on his show Savor Life on WYSL 1040 AM

Michael also informed me that he is helping to organize a Farmer's market  in the 19th Ward on Tuesday afternoons/evenings. It will probably be located in the St. Monica's parking lot on Genesee St.  When the details are firm I will post them.

Technorati Tags: ,
Categories: Friends

Visualize New Testament Usage of the Psalms

sim.plified.com - March 19, 2008 - 11:24pm

Ever since hearing Bob MacDonald at BibleTech 2008 I have been increasingly captivated by seeing Jesus Christ in the Psalms.  This prospective has thoroughly dislodged the Psalms from whatever purely academic rubrics I was placing on top of them in the past and set me about looking for a Person.   What is shocking is that the looking is not very difficult.  He's everywhere!  How did I miss him when He was so close, even in my mouth? 

This new found excitement has got me thinking about how to actually try and visualize the new testament writers usage of the Psalms.  This book more than any other seems to hold a certain amount of weight when it comes to the number of Old Testament quotations in the New Testament. 

If you have ideas or input on how to visualize, please comment.

Technorati Tags: ,,
Categories: Friends

MySQL

Yahoo

Recent comments

About Me

Jay Janssen
Yahoo!, Inc.
jayj at yahoo dash inc dot com

MySQL
High Availability
Global Load Balancing
Failover

View Jay Janssen's LinkedIn profileView Jay Janssen's Facebook profile

User login

Friends

Links