Saturday, February 26, 2011

math problem

A guy I used to work with is married to a math teacher. Once in a while I would send him a math problem I'd thought of that might be interesting to high school math students.

I noticed he isn't on my facebook friends any more. I guess he deleted his account or just deleted me as a fb friend. oh well he'd been among my first 20 or so friends back in like 2007. If he deleted me then no biggie.

I checked I have 141 fb friends at this moment. Of these I could delete about 30 today and it wouldn't make any difference in my facebook experience. People I don't know, people I don't really like, people I don't care about. But if you're on my fb and you're reading this then you're on my "good" list lol.

Anyway back to the math problem I was going to send. Suppose you have a hardware random number generator call it R. It has the property that it will return a uniformly distributed random number in the range [0, 1).

Suppose you are working on an application of some type such as a game and the design requires a random number in the range of 0.10 to 0.85. How do you get this using the generator R?

As a further constraint let's say that you are in a resource constrained environment such as on a battery operated mobile phone. So for performance and battery life you may only invoke R once for this. Thus the scheme of invoking R, and keep repeating until the value returned by R is between 0.10 - 0.85 is not acceptable. It is unacceptable because 25% of the time you would have to invoke R more than once.

It's not a real difficult problem in my opinion. I'll let it sit for a bit and post a solution I came up with in the comments.

Monday, February 21, 2011

new printer Canon Pixma MP280

My trusty old Canon Pixma ip 3000 died on me Sunday. I printed a couple pages early in the evening. Then later I turned it on again to print another page. But nothing happened, no response when turning it on.

It was an old printer, it came with my old computer which I bought over three years ago. At it was around three years old then. So pretty good lifespan for a printer. That was a great printer reliable and never a hint of trouble with it.

So today I went out looking for a new printer. It was pretty easy I had already decided I was getting another Pixma. I found one I liked a Pixma MP280 [2] at Future Shop for $70. That was nice surprise for some reason I had it fixed in my mind printers were $200. We got it home and my older son helped me to set it up. Setup was fast and can't go wrong instructions. Printed some stuff and it all looks good.

The printer looks pretty good it can print photos and has a scanner too. So I can pull up those old sports teams I played baseball and hockey when I was in school like grades 6-10 and post them on facebook lol.

Sunday, February 20, 2011

went to church

I went to church this morning. I'd been thinking about it yesterday. I got to bed at a good time last night and got up and went this morning.

I'm not exactly a churchgoer. I last went there some time last summer. I was going to go one day in January but it was snowing and slippery that morning so I just skipped.

But it's good in a way to be able to still go once in a while. Not much different from last summer. The preacher spoke from Jeremiah. I think he likes the Old Testament, the best testament.

I can say It's a lot better to be going to church on a Sunday morning than getting up and going down to that miserable hospital. So this was a luxury compared to that. So in a way back to the old routines after that period of disruption.

--

On a slightly related note. I was running on a different scene for a while but now that's over and I have returned to my old life. It's not so bad really. I've still got my job and my important-to-me projects to work on. I miss the fast company but who knows what the future holds.

Tuesday, February 15, 2011

bought some baseball cards

After my recent sale on sportlots and this OOT thread on card collecting I checked up on the sets I'd been working on in the past. It turns out there were listings on sportlots on all of my cards outstanding on the 1978 and 1979 o pee chee baseball sets.

They were all from the same seller. It was a guy in Arizona. He was good the cards arrived quickly and the quality was good. Shows what the Internet can do to match up buyers and sellers who would otherwise never meet. The vendor knew about pricing and where he had the only card listed he set his price at $1 or $2. For the other cards he would be right at the going rate. I ended up getting 22 cards it came to around $22. As it happened I had $10 credit at sportlots from some of my own sales. Plus I had $5 in paypal from some survey I'd filled out on linkedin. So with the dollar at par I was only out around $7 out of pocket for the 22 cards which worked out pretty well.


When I put the cards into the albums I noticed I missed two remaining 1978 so I'll have to go back and order them to complete that set. Still the 1979 is now done and I'm glad to have that completed.

The OOT thread mentioned a site called checkoutmycards COMC. That site looks interesting. They have a totally different business model than sportlots. The seller sends his cards in to COMC then pays COMC to warehouse them until they sell. On sale the seller gets all the money with no "tax" back to COMC. I might do a small trial to list some cards there and see how it goes. No complaints but It's not like I've gotten much action selling on sportlots

That's about it for my recent foray back into sports cards. The next project is the big hockey sort from the same era 70s to early 80s. Hopefully I'll get to that later this year some other projects still to work on first.

Tuesday, February 08, 2011

moved in

I reached a milestone over the past weekend. I finally unpacked the last box from my move last August. It was a few pictures which I've now put up on various walls. I had to make a trip to Canadian Tire for the stuff to hang them but it wasn't real hard to do.

So that's finally done. It took a while since I moved in August. Getting the pictures up was about the third post move project. I had got the new bed in first; then replaced the blinds from the previous tenant with my own new ones. It took longer than I thought it would to get through them all. There were a few distractions away from the place that were time consuming.

So that should be it for now with the apartment. Maybe in August it will be the anniversary of the move there's some stuff that should be done. For sure get a proper entertainment stand to replace the broken old coffee table I use now. Replace the old ugly easy chair with a newer, more comfortable model. New kitchen table chairs; but keeping the vintage kitchen table though. The manager's chair here at the computer could stand to be upgraded.

Monday, February 07, 2011

Vancouver luge track safety revisionism

So now there's a possibly lawsuit driven attempt to bring up the tired old - discussed to death issue of the Vancouver Olympics luge track. At the time the top lugers had it right. That track was indeed dangerous for amateurs and non-elite lugers.

That was the real problem. This IOC politically correct "no country left behind" mentality that has led to the rise of underqualified exotic athletes in order to be inclusive so that as many athletes and countries as possible can be there. So this is what you get. Increased risk results and the expected value of increased accidents and tragedies. Strangely the earliest Yahoo article comments are pretty good and mention how dangerous and irresponsible it was letting Eddie the Eagle out there back in 1988 which is a root of this exotic athlete trend.

The solution was and still is to assure safety by filtering unqualified performers out of the competition. If that means a given country can't be in the Olympics well then deal with it. At the time in Vancouver after the accident they shortened the luge track which damaged the competition. The correct move would have been to let the qualified elite compete on the original design which they liked; and send the pretenders home for their own safety. It was wrong to water down the competition and bring down the level of the very best in order to accommodate those that didn't even belong there.

Saturday, February 05, 2011

super bowl

I'm looking forward to the super bowl as usual. It could be a good game. The Steelers are the wild card who knows which team will show up. They were terrible at times against both Baltimore and the Jets but also so strong at times they still managed to win.

They will need to be more consistent through four quarters to beat Green Bay. The Packers offense looked unstoppable at times but the Steelers have a good D. They have some film too it seemed the Bears had a good handle on the GB offence for chunks of that game.

I have a kind of "bet" on the game. It's a freeroll. At work there was some intranet site. There was a poll there with a prize a $50 amazon gift card. The poll was to pick the super bowl winner. I went over to bodog and the vegas sites and I saw that Green Bay is the favorite. So with nothing else to go on I picked Green Bay in the poll. After I picked it showed there was 25 votes; 17 for Pittsburgh and 8 for Green Bay. So I had around $3 of EV at that point. I'm not sure how many voted since. hmmm oops I forgot to mention to my coworkers about the freeroll poll. oh well you know what they say about overlay ...

I don't have a plan for where to watch it. I wasn't invited to any parties and haven't spoken to anyone about it. Maybe go to my parent's place and watch it there.

What's the deal on Arizona and the bowl. First it was the Kurt Havelock thing. Now out of Arizona we have a guy inserting porn into a super bowl broadcast.

Thursday, February 03, 2011

The Rehberg cross burning case

Wow I was shocked at what I saw in the Chronicle Herald today. Real journalism. That paper may find relevance and survive after all.

I'm talking about the Nathan and Justin Rehberg series. Up until now the political correct orthodoxy is that the Rehnberg's are to be treated basically as skinheads who targeted the Lyon-Howe household because Howe is black. The true backstory has been either ignored or intentionally drowned out by the cross burning hysteria.

They definitely targeted that house, especially Lyon per the Herald article. But it was actually a personal vendetta and Lyon herself very badly wronged the Rehnberg brothers. Read the article and Lyon-Howe aren't exactly forthcoming about their history with the Rehnbergs. They are definitely on the defensive now that the political correct process has run through and the Rehnbergs got jail and big media went away - good riddance. Now the full story can come out if an outlet has the courage to. The Herald surprised me they apparently do.

I think everyone agrees that it was incredibly poor judgment by Nathan and Justin to burn a cross on a black man's lawn. I believe they were making a statement and lashing out. Still I don't think their true underlying intent was racist.

Edit: I should clarify. The Rehnbergs had to get jail for what happened. You just can't do that. Plus they embarrassed Hants County and Nova Scotia and we've had to do a lot of damage control on this. I'm sure many were expecting a sentence in years instead of months. The learned judge considered all of the facts and came up with an appropriate sentence.

Wednesday, February 02, 2011

work from home

Today I did something I hadn't done before. I worked from home on a regular work day.

It snowed overnight with more forecast for today. So no point really going in for a couple of hours just to have to rush out when the snow started again around noon. So the three of us in my group all just worked from home.

I've used remote desktop before and it's a great invention. In the past it was usually in the evening or a weekend I would RDP in for a bit and do some stuff while still being able to be at home. It went pretty well today it was definitely quiet with minimal distractions. No free coffee though had to make my own. With no commute I slept in a bit, didn't shave, and wore sweat pants to work.

Since it was an unusual day instead of the usual blah sandwich I scooted over to Wendy's around 11:20 just before the snow started. I got take out to stay ahead of the weather. With coupons I ended up getting a junior bacon cheeseburger, fries, and a 16 oz frostie all for just $2 total. Pretty good deal Wendy's is a favorite.