Xenical uk saleDoxycycline 100mg tablets malariaBuy ventolin from canadaCan you buy viagra over the counter in cancunWhere to buy orlistat over the counter A Burger Ride

I’ve been wanting to take a relaxing day ride for awhile, but the demands of chores, and the weather in Missouri conspired to keep me close to home, until yesterday. The weather has gotten hot and dry enough that the yard could go a weekend without being mowed, and an article in the West Central Electric Cooperative paper, ElectricNews gave me a destination. Mama’s Burgers & Such is a small burger joint located in Sparta, MO, about 20 miles S of Springfield. I love a good cheeseburger, and the chance to get in a nice ride, and have a good cheese burger with it was all I needed to get motivated.

So, about Mama’s Burgers & Such. The restaurant itself was not what I expected. It’s in a small building on the side of the highway with a glass door that doesn’t seem to fit the rest of the decor. It’s kind of cramped, but quaint, decorated with the owner’s vision of a cross between a dinner, and tea room. But it was not the decor that brought me here. It was the description of their burgers and tenderloins. Mama herself told me that their Smokehouse Burger, and that was just what I was there for. I ordered that, and of course french fries. My meal came in about 10 minutes, and it was delicious. The burger tasted similar to others I’ve had that claim to be Black Angus. It was flavorful and topped with bacon, fried onion rings, what tasted like American cheese, and barbeque sauce. The french fries were almost burn your mouth hot, crispy on the outside, fluffy on the inside, and very good. When I left they asked about where I had come from, and then asked me to sign their guest book. They also gave me a sample of brownie, and a small glass of Coke to wash it down with before I got back on the bike.

Mama's smokehouse burger

Mama’s smokehouse burger

All in all, the burger was very good. A great treat to go along with the ride. If I ever find myself with twenty miles of Mama’s I will stop in again.

Posted in Personal | Comments Off on A Burger Ride

Getting the mail is now just depressing

On Saturday, August 16th, 2014 I had to take my best friend of almost 14 years to be euthanized. She had suffered from arthritis in her hind legs for years, and that had caused me to stop taking her for walks. I’ve spent a little over a year watching her physical and to a lesser extent her mental condition visibly deteriorate. Our play sessions got shorter and shorter until they were little more than her standing over a toy and barking at me until I picked it up and played with it for her. Eventually she didn’t even bark any more, though it took me longer to notice that. She developed a fear of noises that she wouldn’t have even noticed before. An alert on my phone would cause her to struggle to her feet, and she would either leave the room, or more likely sit on my feet and look to me for reassurance. I spent the last year with my phone set to vibrate when home. Through all of her decline though, going outside with me was one thing she enjoyed, and continued to enjoy. She had to stay home alone all day while I was at work so I suspect that my coming home was a daily highlight for her. I know her greeting when I got home was a highlight for me. Our Monday through Friday ritual was, I would get home, go into the house to greet her, then ask if she wanted to go get the mail. The mailbox is located at the street approx. 100 feet from the house. I could get it as I drive in, but seeing her get excited about going out with me prevented me from doing that. Even in the last couple of weeks when she no longer got out of her bed to greet me, asking if she wanted to get the mail would visibly excite her, and she would struggle to her feet to go out. It was extremely gratifying for me to see her still able to enjoy something so much. Especially something as simple as a trip to the mailbox. I’m sure part of her enjoyment was smelling the messages left for her by the other dogs in the area. She would also occasionally get to greet a neighbor and maybe prod them to give her a behind the ear scratch while we caught up on news in the middle of the street. She didn’t always make it all the way to the mailbox, but she wagged her tail, and thoroughly sniffed the ground she did cover. On Saturday, August 9th I noticed a sudden swelling on her left hind leg just above the knee. I took her to the vet the following Monday. The vet took X-rays, and a biopsy of the swollen tissue. He also supplied me with more pain medication and increased the dosage I was to give her. On Wednesday the pathologist’s report came back confirming what I had most feared. The diagnosis was osteosarcoma. An aggressive, and painful cancer of the bone. I still drive past the mailbox, then walk back out to get the mail. Only these days it is the loneliest 100 foot walk imaginable. If I wanted to avoid feeling the depression and loneliness I should probably pick it up as I pull in, but I can’t bring myself to end what was “our” thing.

Posted in Personal | Comments Off on Getting the mail is now just depressing

Printing the contents of a div (or other element)

Today I worked on printing the contents of a <div> tag. The first solution I found was to use java script to open a new window, write the contents of the <div> to it and use the window.print() function. It works well, but what I wanted to print was already being displayed in an iFrame, dialog like over the main window. I did not like opening yet another window in order to print.

The document has a Print button with an onclick event.

<button type="button" onclick="printMessage()">Print</button>

This is the function called by the button onclick event. This function gets the content from the div element and in turn calls the printElemContent function that does the actual printing

function printMessages(sender, args) {
    var responseDiv = $('#<%=uxResponseMessageDiv.ClientID %>');
    if (responseDiv != null) {
        printElemContent(responseDiv.html());
}

Printing using a new window:

function printElemContent(data) {
    var myWindow = window.open('', 'my div', 'height=400, width=600');
    myWindow.document.write('<html><head><title></title>');
    myWindow.document.write('<html><body>');
    myWindow.document.write(data);
    myWindow.document.write('</body></html>');
    myWindow.document.close();
    myWindow.focus();
    myWindow.print();
    myWindow.close();
    return true;
}

The above code works, and it solved my need, but like I said, it bothered me that I was opening another window. Also, once the window was opened, but had not yet opened the print dialog, I was left sitting in front of the screen wondering if I was supposed to do something, and I knew what was going on. There is a couple of seconds delay after showing the new window and before the print dialog is opened. What are my users going to be thinking when they try to print? I searched some more and came across a solution using jQuery and an off-screen iframe that did not require opening another window and to me works more smoothly and possibly more quickly. The difference between javascript and jQuery is not important to this. I personally prefer jQuery’s syntax so I tend to gravitate toward it and point it out here only so those less familiar will not miss the difference.

Printing using an iFrame:
Add an iframe tag somewhere in your document.

<iframe id="ifmcontentstoprint" style="position: absolute; top: -1000px; left: -1000px;"></iframe>
function printElemContent(data) {
    var iframe = $('#ifmcontentstoprint')[0];
    var body;
    body = '<html><head><title></title>'
        + '<html><body>'
        + data
        + '</body></html>'                    
    iframe.contentDocument.write(body);
    iframe.contentDocument.close();
    var iframeWindow = iframe.contentWindow ? iframe.contentWindow : iframe.contentDocument.defaultView;
    iframeWindow.focus();
    iframeWindow.print();
    return true;
}

So there you have it. How to print the contents of a <div>, another element or anything else you might want to print, so long as you can write it into an iframe.

Posted in Programming | Comments Off on Printing the contents of a div (or other element)

Limit a TextBox to Numeric Entry Only in VB6

I am surprised at how often I still see this question asked, and the answer almost always involves using the KeyUp, or KeyDown event and programmatically canceling the keystroke if the key pressed was not numeric. I don’t like doing it that way because

  1. It takes several lines of code to accomplish
  2. It has to be done for every textbox you want to limit

So if I don’t like using the Keyup / Keydown events to limit a TextBox to numeric input, how do I choose to do it. I use the Windows API. It’s something I learned early when I started programming in Visual Basic. Many things that are hard to do with VB are much easier to do with the Windows API. In this case I use the SetWindowLong function. I have a .bas module that contains all of my common routines. This particular method is implemented as a function that takes a handle to an edit control as a parameter and returns the result of the SetWindowLong function. I can call this function for any number of TextBoxes I need to.

Option Explicit

Private Const ES_NUMBER = &H2000&
Private Const GWL_STYLE = (-16)
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

'set an editbox to numeric only - return the previous
'style on success or zero on error
Public Function ForceNumeric(ByVal EditControlhWnd As Long) As Long
   Dim lngCurStyle As Long
   Dim lngReturn As Long

   lngCurStyle = GetWindowLong(EditControlhWnd, GWL_STYLE)
   If lngCurStyle &lt;&gt; 0 Then
      lngReturn = SetWindowLong(EditControlhWnd, GWL_STYLE, lngCurStyle Or ES_NUMBER)
   End If

   ForceNumeric = lngReturn

End Function

To use this function:

Private Sub Form_Load()
    Dim lngResult As Long

    lngResult = ForceNumeric(Text1.hwnd)

End Sub

The limit of this approach is that it doesn’t allow for decimals. It also doesn’t allow for characters such as currency, or negative (-) signs.

Posted in Programming | Tagged , , | Comments Off on Limit a TextBox to Numeric Entry Only in VB6

My Political Opinion 2012

We are two days from the 2012 presidential election and I feel the need to post my opinion. I am in what is colloquially termed, mid-life. When I first began my voting career at 18 I was mostly middle of the road, but I had definite Republican leanings. I have always voted a split ticket. I tried to cast my vote to the candidate that seemed to posses the most integrity as well as declaring to support positions that I considered best for the country as a whole. My hope was that I could pick the brightest candidates available, and that together they would debate their ideas coming from differing ideologies and come up with the best possible solution. In the past years my dream of the best and brightest working together for the good of the whole has gone entirely unfulfilled. What we have today is obstructionist politics with the only goal being the support and advancement of the party. It really makes me sick. This year I am voting a straight Democratic ticket. I am doing this because the Republican party has moved too far to the right for me to support their platform. They couldn’t have cared less about the impact to the country during the financial crisis, obstructing every initiative President Obama proposed while offering nothing of their own. Their only concern was being able to say that President Obama didn’t accomplish anything and claiming that having a Republican president would have made all the difference. Both parties are about as bad as each other in that they care only about the party, but at least the Democrats have retained a more middle ground stance on the issues. Because neither party seems to think the voters will hold them accountable (and by all indications they are correct), this year I plan to vote a straight Democratic ticket. The only way the parties will start paying attention to, and working for the people again is if they see, in the form of votes that they are losing. I feel like kicking all the Republican butts out of office at once would be just the wake up call needed. I don’t expect my choice will make a difference to anyone except me, but this is my plan and my reason for it.

Posted in Soapbox | Comments Off on My Political Opinion 2012