Google Drove by My House – Street View added for Rochester, NY
Street view has been added to Google Maps in Rochester, NY. This adds a whole new level of helpfulness in finding places online.
[ Leave a Comment ]
Street view has been added to Google Maps in Rochester, NY. This adds a whole new level of helpfulness in finding places online.
[ Leave a Comment ]
If you’re working inside of an institutional structure chances are you occasionally have to deal with code that sucks. I know I do! We have some third party apps at the institution where I work. I believe they were designed in the early 90s before anyone knew the word “standards” or “css” and have not been revisited. While working on one of these code bases I had the idea of using jQuery to remedy my brow furrowing.
No IDs or class names on the the template code. The templates were static and I didn’t want to do a global find and replace to try and fix the problem.
With jQuery’s selector support, I decided that I could use that to add the vital css, classes or ids I need to make the layout work. Example:
1: $(document).ready(function(){
2: // standard document formatting
3: $("BODY DIV:first").css("width", "800px").css("margin", "0 auto 0 auto");
4: });
Instead of injecting css directly, I could have added a class and added my styling in the stylesheet like this:
1: $(document).ready(function(){
2: // standard document formatting
3: $("BODY DIV:first").attr("class", "fixthishoriblecode");
4: });
There you have it. As simple as including the jQuery library and adding some lines of JavaScript. [of course is javascript is turned off, this is not going to work.. but I didn’t say this was a miracle solution for fixing your bad code, just a patch].
If you’ve had to deal with these types of code bases, share your story below of how you fixed the problem.
[ Leave a Comment ]
When Simon was in the bouncy seat last night I thought I was having déjà vu. I looked up and there was a picture of Caleb from about the same time up on the boy’s bookcase. I brought it down and put it next to him.
It might be hard to see in the picture, but he was a spitting image of Caleb.
Amy and I were not eager to spend time in the hospital. After doing this three times already, we have come to realize that there is “no place like home.” We were very pleased to get the cooperation of the midwife, pediatrician and nurses so that we could bring Simon home on the day of his birth (it certainly helped that he was born at 5:30am in the morning). Amy spent most of the day sleeping and feeding and we were able to be home at 5pm and eat around our dinner table. In fact, after dinner we went outside and the boys declared they were having a “birthday party” for Simon. Caleb even asked to have cake (which I might have gotten if I didn’t think I would have fallen asleep at the wheel).
Whenever we interface with the hospital system there are always some interesting things to learn. For one, the nurse said that Amy was the first person to check in and out on the same shift. I’m not for rushing out of the hospital if you really are in need of assistance, but it’s evident that the hospital would love for you to stay a bit longer than you need (in the words of our nurse “if we don’t provide you with services we can’t bill you for anything”).
While Amy was in the room, the nurse came in and asked Amy to “lean forward so she could check her back.” Amy did so, not realizing why she was being asked. The nurse was astonished to find no wound from an epidural needle. The nurse informed Amy that 95% of births at their hospital are performed with epidurals, making it a matter of habit to check women’s backs.
It is interesting to correlate these two pieces of information. Epidural = longer labor and hospital stay = big fat hospital bill to the insurance company. I wonder how many people who choose differently if they were footing the bill personally?
[ Leave a Comment ]
First an introduction. Simon Jacob Pollock was born on June 6, 2008 at 5:30 in the morning. [This is where weight and height would be inserted.. but I’m not really sure why people give those stats, so I’m leaving them out.] He looks just like a Pollock. Below is his very first picture.
Simon’s name was not always to be Simon Jacob. Just a day earlier it was to be Simon Clayton. Clayton was a family name and so initially we thought it made a fine middle name for Simon. The hours surrounding his birth would change all that. On June 5th we traveled to be with friends who were celebrating the death of you their young son Jacob.
I say celebrated, and not mourned, because celebration definitely characterized the event. The Fahmer’s believe, as do I, that a child who has not sinned is not subject to the demands of the Law and therefore the Wrath of God (not the case for the rest of us who have knowingly transgressed the commands of our loving heavenly Father). It was a celebration because he is in heaven where he continually get’s to behold the face of the Lord Jesus and is free from the suffering that characterized his short life (138 days).
Jacob Fahmer was born with Trisomy 18, a life shortening condition (you can read his whole story here). His life was short, by God’s own choosing, but it was not without value or significance. He, like,all creatures made in the image of God, brought a certain reflection that is not limited by length of days. For one, the Fahmer’s life has forever been changed, by the gift of his life. Secondarily, I believe (and you can read testimony for yourself in this post and in others on Jacob’s blog) that people have been caused to consider their lives and their God. What other purpose and hope can one have?! What else is lasting and enduring, than to have the effect of causing people to reflect on their standing with the Eternal God.?!
As we celebrated Jacob’s “home going” my wife began to experience the pangs of labor. We gathered our children, said a few quick goodbyes and headed home (a hour and 15 minutes away). On the way back, we could see that labor was beginning to set in. My wife’s contractions were becoming regular instead of fading away. At one point I looked over to my wife and said “If we have this child tonight I want to call him ‘Simon Jacob’”. My wife gave a quick nod of agreement.
I don’t believe in coincidence. I believe that God orders our days, our death, and our birth. It was not a mistake that my wife went into labor at Jacob’s funeral. It was God’s plan. It’s not just the timing of the event that leads me to see God’s hand, but also my understanding of God. God brings life and death together. He did it when His Son was crucified. Jesus’ death brought forth eternal life. The Creation testifies about this every day. You have to be blind not to see that God has ordered death to life. Plants & Animals that die and fall into the ground and nourish the next generation. A simple walk through the woods could teach this to the attentive eye. All through the Creation death and life are caught up together to point us to the revelation of Jesus’ death on the Cross and Resurrection three days later.
This is the story I want to characterize my life and the life of my family. The story of Jesus’ death and resurrection. He is embedding that story in our lives, even through the simple “happenings” of life. Jacob’s death.. Simon’s life have been tied together in a narrative that God is writing. I am happy simply to see it, acknowledge it, and worship because of it.
Simon Jacob – because God brings life out of death.
[ Leave a Comment ]
For PatternTap.com we wanted to use some edit in place functionality to allow users to change their name, location, etc. I used jQuery to create our own implementation of edit in place.
Here is an example of the markup for the input box (I have left out the server side coding that renders this markup):
<li class="first"> <span class="pro_label">Name:</span> <span id="update_real_name"><span class="editThis">[Users Name]<span class="edit_mark">edit</span></span></span> </li>
The edit mark span is something that provides visual feedback to the user that the area is editable. What is inside the "editThis" span is what will be edited. The span that surrounds the both of those pieces serves as a place holder, so that the input can be swaped in and out of the DOM.
Here is the JavaScript that binds to the item and makes it editable.
$(document).ready(function() { bind_update(); // bind this on page load }); function bind_update() { // find all the editThis elements and find this functionality $('.editThis').bind("click", function(e){
// remove the edit_this mark
$(this).children(".edit_mark").remove();
// capture some information about the selected element
var parentId = this.parentNode.id;
var editType = this.parentNode.className
var revert = this.innerHTML;
// check to see if this is a textarea or inputbox
// note the save and cancel buttons are added along with the input or textarea
if (editType == "textarea")
$('#' + parentId).html("<textarea id=\"input_" + parentId + "\" >" + revert + "</textarea> <button onclick=\"update_value('" + parentId + "', true);\" value=\"Save\" >Save</button> <a id=\"cancel_" + parentId + "\" href=\"javascript:void(0);\">Cancel</a>");
else
$('#' + parentId).html("<input type=\"input\" id=\"input_" + parentId + "\" value=\"" + revert + "\" onblur=\"\" /> <button onclick=\"update_value('" + parentId + "', true);\" value=\"Save\" >Save</button> <a id=\"cancel_" + parentId + "\" href=\"javascript:void(0);\">Cancel</a>");
//set the focus on the newly embedded input box
$("#input_" + parentId)[0].focus();
$("#input_" + parentId)[0].select();
//bind the cancel functionality to the cancel button
$("#cancel_" + parentId).click(function() {
update_value(parentId, revert);
});
});
}
// this function sends the updated value back to the server
function update_value(id, update)
{
if (update == true)
{
result = $('#input_' + id).val();
$.ajax({
type: "POST",
url: "/people/change_user_profile/",
data: "user_id=<?=$user['id']?>&field=" + id + "&value=" + result,
error: function()
{ alert("There was a problem, please let us know.") }
});
}
else
{
// in the case of a cancel, update is the "revet" value
result = update;
}
$('#' + id).html("<span class=\"editThis\">" + result + "<span class=\"edit_mark\">edit</span></span>");
bind_update();
}
I'm sure there are slicker ways to do this, but this certainly did the job for us.
Of course when you send the data to the server you are going to want to authenticate the user to make sure they are who they say they are. This will prevent people from hacking the JavaScript and changing someone elses information.
[ Leave a Comment ]
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.
[ Leave a Comment ]
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".
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.
[ Leave a Comment ]
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.
[ Leave a Comment ]
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="" />
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>
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?')");
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)" />
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.
[ Leave a Comment ]
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.
[ Leave a Comment ]
Check out some of these blogs.
Stay updated on my meandering thoughts & activities via RSS (Syndicate).
Web Developer - proficient in both PHP and ASP.NET.
Rochester, New York
View my web developement site.