Wednesday, July 20, 2011

Win hangman every time : ) or 99%, at least

This person did a mathematics study of the probabilities of certain words to be guessed in a hangman game.

Go Jazz! :)

Check it out!

Tuesday, July 19, 2011

Old NVIDIA drivers

I was looking for some older NVIDIA drivers tonight, but they weren't on the NVIDIA site.

This site maintains old NVIDIA drivers.

Friday, July 1, 2011

Friday, June 17, 2011

Select on boost asio tcp socket

Boost asio does not provide a method of doing select on tcp::socket directly, but I found this example on the web:

    // socket here is:  boost::shared_ptr a_socket_ptr

        // Set up a timed select call, so we can handle timeout cases.

        fd_set fileDescriptorSet;
        struct timeval timeStruct;

        // set the timeout to 30 seconds
        timeStruct.tv_sec = 30;
        timeStruct.tv_usec = 0;
        FD_ZERO(&fileDescriptorSet);

        // We'll need to get the underlying native socket for this select call, in order
        // to add a simple timeout on the read:

        int nativeSocket = a_socket_ptr->native();

        FD_SET(nativeSocket,&fileDescriptorSet);

        select(nativeSocket+1,&fileDescriptorSet,NULL,NULL,&timeStruct);

        if(!FD_ISSET(nativeSocket,&fileDescriptorSet)){ // timeout

                std::string sMsg("TIMEOUT on read client data. Client IP: ");

                sMsg.append(a_socket_ptr->remote_endpoint().address().to_string());

                throw MyException(sMsg);
        }

        // now we know there's something to read, so read
        boost::system::error_code error;
        size_t iBytesRead = a_socket_ptr->read_some(boost::asio::buffer(myVector), error);

        ...

A little ugly, since it uses the native socket, but should be okay on most systems.

Thursday, June 16, 2011

GNU Screen

I've been using VIM a lot (on the command line too), and am always bummed when I have to switch over to the arrow keys to switch between open terminal windows. GNU Screen is a really nice option (thanks, Peter!!).

GNU Screen Homepage

Handy shortcuts:
Ctrl-a, [0-9] - Switch to a numbered window
Ctrl-a, [n] [p] - next or previous window
Ctrl-a, c - create a new window
Ctrl-a, a - toggle between this and the last window
Ctrl-a, Ctrl-A - give a new name to this window
Ctrl-a, d - detach from this window

screen -ls - list screens
screen -x - reattach to screens

Wednesday, May 4, 2011

Boost ASIO Tutorial

This looks like a promising tutorial to the Boost ASIO stuff. Not quite as nice as Python Twisted, but hey, it's C++.

http://www.gamedev.net/blog/950/entry-2249317-a-guide-to-getting-started-with-boostasio?pg=1

Osama's Compound flooded with reviews from Google Maps users

This is the cute little rustic B& B you only encounter once in a lifetime. The lack of Wi-Fi makes it impractical to hold a MMORPG convention here, but if FPS games are your thing, you do seem to experience a lot of the real thing.

Link to map page

Friday, April 29, 2011

When we seek the inspiration we need, we'll receive it.

It should have been a thrilling moment. In 1996, just two years after he began his full-time broadcasting career, Vai Sikahema was invited to a meeting and offered a promotion to sports director and sports anchor. This meant he would anchor the sports news at 6 and 11 on weekday nights and cover the Philadelphia Eagles on Sunday. It was a dream job, but Sikahema's elation was tempered by one problem: He had just been called to serve as a bishop in his Mormon ward.

How could he reward his bosses' generous offer by telling them he had more compelling duties that would preclude him from meeting all the demands of his new job? How could he explain that he needed to be at church on Sundays, instead of traveling with the Eagles? How could he explain that he needed to be at his church on weeknights, as well, instead of the studio?

Sikahema sought inspiration in the temple of The Church of Jesus Christ of Latter-day Saints and found it.

"I could see in my mind's eye exactly what I was supposed to do and what I was supposed to say to my bosses," he says. He immediately wrote these thoughts on the back of a business card, and two days later, he met again with station manager Pat Wallace and news director Steve Doer.

"There's something you should know," he began. "I don't know if this will make a difference in my promotion, but there might be some conflicts in my personal life."

He told them about his calling as a bishop and that it would require him to perform church duties on weeknights between the 6 o'clock news and 11 o'clock news and all day Sunday. Sikahema was surprised by what happened next.

"What can we do to help you?" Wallace asked.

Overcome with emotion, Sikahema told them how he felt about his church. He concluded by saying, "This is a call of God, and I will move heaven and earth to make certain that my professional duties will not be shortchanged if you allow me to fulfill my obligation."

Wallace generously offered to hire a part-time employee to research and write scripts for Sikahema and another reporter to cover Eagles road games on Sundays.

"You go fulfill your obligations to your church and to your faith," he said, with this caveat: that he arrive at the studio a half-hour before his two nightly newscasts.

More

Wednesday, April 13, 2011

Now that is real grit.....

After an attempted assassination attempt, in which he was actually shot, Teddy Roosevelt actually got up and gave a 90 minute campaign speech. He started out with the following:

"Friends, I shall ask you to be as quiet as possible. I don't know whether you fully understand that I have just been shot; but it takes more than that to kill a Bull Moose. But fortunately I had my manuscript, so you see I was going to make a long speech, and there is a bullet - there is where the bullet went through - and it probably saved me from it going into my heart. The bullet is in me now, so that I cannot make a very long speech, but I will try my best."

– Theodore Roosevelt, Address at Milwaukee, Wis., October 14, 1912

The bullet was never removed. When asked later about the bullet still inside him, he said, "I do not mind it anymore than if it were in my waistcoat pocket."

Monday, April 11, 2011

Modest dresses

What a great idea!  Kudos to Charity and Maren and their family for standing up for what is right!

195-dresses

Thursday, March 31, 2011

Hallelujah, Qt Creator Vim mode is fixed!

I just couldn't take it any more!  There were three things that I found absolutely unacceptable with the Qt Creator FakeVim mode--you couldn't paste over text, you couldn't exit visual mode by hitting 'v', and the search result color was a horrible yellow background with yellow foreground, rendering the search results unreadable.

I downloaded the source and fixed the bloody thing myself.  W00T!!!

Monday, March 28, 2011

My Baptism primary song (with music)

I was able to get the "Baptism" primary song written down with Harmony Assistant.  Here is a PDF, if you want to try it out!

http://www.quiltengineering.com/blog/Baptism.pdf

Getting ready for the Dam Jam

Wow, have I got a lot to learn before this year's Rockport Dam Jam, in mid-August!  I've got to learn a bunch of bluegrass tunes so that I don't look like an idiot : )  Well, I'm not sure I can pull that off.....


Here are some of the supposedly most common bluegrass tunes:


Lonesome Road Blues
Sittin' On Top of The World
Rollin' in my Sweet Baby's Arms
Mountain Dew
Long Journey Home ie.. 2 dollar bill

John Hardy
Nine Pound Hammer
I Am A Pilgrim
Blue Moon Of Kentucky
Doin' My Time

Old Home Place
Fox on the Run
Dark Hollow
Love Please Come Home
Ain't Nobody Gonna Miss Me When I'm Gone

Old Home Place
Fox on the Run
Rolling in my Sweet Baby's Arms
Friend of the Devil
Blackberry Blossom
Cherokee Shuffle
Soldier's Joy 
Surfgrass Medley

Rocky Top
Two dollar bill
The old home place
Love of the Mountains
Shuckin the Corn

Salt Creek
Red Haired Boy
Whiskey Before Breakfast
Forked Deer
Saint Anne's Reel
Old Joe Clark

John Henry
Angeline the Baker
Ashokan Farewell
Paradise (John Prine)
Dark as a Dungeon
Uncle Pen
Molly and Tenbrooks

Worried Man Blues
How Mountain Gals Can Love
Leavin
Back Up and Push
Flop Eared Mule
Goldrush
Lost Indian
Never Hit Your Grandma With a Great Big Stick


Saturday, March 26, 2011

Baptism

Today I went to the baptism of Beatrice, who lives in our ward, a wonderful lady originally from the Sudan. I had to play the piano for the opening and closing songs, but I probably would have gone anyway. We had a good strong show of support from the ward, for which I was grateful. On the way home, it made me start thinking about Emma's upcoming baptism, and the idea for a song just came so quickly.

Here are the lyrics - unfortunately this isn't the best place for the music yet. I'll have to post that later.


I know when I am baptized
My sins are washed away
I promise to remember
My Savior every day

I get to choose to follow
I get to choose to live
And He will send His Spirit
To guide me on my way

I'm going to make a cov'nant
To promise to obey
To live my life as he did
At home, at work, at play.

I get to choose to follow
I get to choose to live
And He will send His Spirit
To guide me on my way

The Holy Ghost will help me
If I listen to His voice
But if I want his guidance
Then I must make that choice.

I get to choose to follow
I get to choose to live
And He will send His Spirit
To guide me on my way

And I will care for others
And do all that I can
To live and love, and watch and pray
And follow Father's plan.

I get to choose to follow
I get to choose to live
And He will send His Spirit
To guide me on my way.

I like it enough that I'm going to submit it to the church.

Friday, March 25, 2011

Yes, I started a blog

Yep, I'm starting yet another blog.  This is mostly just to keep track of interesting things as they come up, and write down stuff I'm working on.  I'll also post some things that I learn while doing scripture study.