Polska Brain Jelly

Brain Drain

Brain DrainMy Kingdom for a Vacation

by on Jun.27, 2012, under Brain Drain

Wow, it’s been over a month since I posted.

And after I had so sincerely promised my self I would write more.

So not much has happened in that last month.  I get busier and the days fail to take my suggestion on getting longer.

I’ve taken up bike riding in all the spare time that I don’t have.  I even have a tracking page here.  I’m doing that along with a little kickboxing to keep me losing weight.  It’s working so far and I’m not getting bored with it yet like I did the torture riddled disk set that I used for a few months.

Not really much happening.  I didn’t realize I was quite this boring.  Remember to bookmark this page for when you have trouble sleeping and late night infomercials aren’t doing the trick.

Leave a Comment more...

Brain DrainRoom to Breathe

by on May.11, 2012, under Brain Drain

Finally, the semester is over and I can take some time to relax.

And post some pictures that I’ve been meaning to put up for almost a month.

I went to watch the Yankees play the Rangers in April (Yankees won, yay!) and took some pictures of a two foot plus hot dog.  Yes, I ate a two foot long hot dog (helped, at least).

Plus the game was really good.  Saw Sabathia pitch, Rivera close.  Arod hit a long ball and Jeter made a bad throw.  But he made up for it later.

Here’s some pics of an epic chili dog and the damage we did to it.  Oh, and a pretzel, too.

If you view the slideshow, just click the picture to move it forward.

Leave a Comment more...

Brain DrainThis Will Be Boring, I Promise

by on Dec.18, 2011, under Brain Drain

I’m writing a Windows Phone 7 app and I wanted to implement a basic number chooser, but in the style of the date picker or time picker.  For those familiar with the Metro UI, it’s basically like a slot machine dial that spins vertically with the available choices.  An example can be found here.

So I found a reference to the toolkit that I needed and installed it.  Still didn’t have an option to use the control that I wanted (the loopingselector control).

Turns out I hadn’t opened up Visual Studio since Mango came out, and it wasn’t updated to use the 7.1 SDK.  Okay, so I get that updated and convert my solution to 7.1.  Now I can actually access the control.

However it requires some work to create the data source to use for the number range.  There are several examples online of how to create the data source.  That’s great, but they are all in  C#.

I’m writing this in VB.net.

My C# skills are rusty at best.  I do manage to translate everything over and now have a working looping selector that I can specify the range using the control’s xmls parameters.  My code example is below:


Public Class NumbersDataSource
        Implements ILoopingSelectorDataSource

        Private minimum As Integer = 1
        Private maximum As Integer = 32
        Private userSelectedItem As Integer = 1

        Public Function GetNext(relativeTo As Object) As Object Implements Microsoft.Phone.Controls.Primitives.ILoopingSelectorDataSource.GetNext

            Dim nextValue = CInt(relativeTo) + 1
            Return If(nextValue <= MaximumNumber, nextValue, MinimumNumber)

        End Function

        Public Function GetPrevious(relativeTo As Object) As Object Implements Microsoft.Phone.Controls.Primitives.ILoopingSelectorDataSource.GetPrevious

            Dim previousValue = CInt(relativeTo) - 1
            Return If(previousValue >= MinimumNumber, previousValue, MaximumNumber)

        End Function

        Public Property SelectedItem As Object Implements Microsoft.Phone.Controls.Primitives.ILoopingSelectorDataSource.SelectedItem
            Get
                Return userSelectedItem
            End Get
            Set(value As Object)
                Dim oldValue = userSelectedItem
                Dim newValue = CInt(value)

                If (oldValue = newValue) Then
                    Return
                End If

                userSelectedItem = newValue

                RaiseEvent SelectionChanged(Me, New SelectionChangedEventArgs({oldValue}, {newValue}))
            End Set
        End Property

        Public Property MinimumNumber As Integer

            Get
                Return minimum
            End Get
            Set(value As Integer)
                minimum = value
                If (userSelectedItem < minimum) Then
                    SelectedItem = value
                End If
            End Set
        End Property

        Public Property MaximumNumber As Integer

            Get
                Return maximum
            End Get
            Set(value As Integer)
                maximum = value
                If (userSelectedItem > maximum) Then
                    SelectedItem = value
                End If
            End Set
        End Property

        Public Event SelectionChanged(sender As Object, e As System.Windows.Controls.SelectionChangedEventArgs) Implements Microsoft.Phone.Controls.Primitives.ILoopingSelectorDataSource.SelectionChanged

    End Class

So, as I promised, pretty boring stuff. But now I have it here in case I need it again, and it might help some other poor soul looking for a vb.net implementation of the looping selector data source.

Leave a Comment more...

Brain DrainUpdate

by on Oct.23, 2011, under Brain Drain

Just wanted to make a quick post to update some things.  I’m back in the panhandle.  Glad to back with my family, not really glad to be back in the flat, windy desolation.  I really will miss the Metro area.

But I got a great opportunity here and I’m excited to be back.  And I’m going to game five of the World Series, so that’s a bonus!  Good seats, too.  I’ll post pictures.  😛

Hoping to get some time to pick up a few projects that I put on the back burner several months ago.  And I need to reconfigure my workout routine since I don’t have on-site facilities anymore.  I am looking forward to the next week off, though.  I can use it.

More news to come.

Leave a Comment more...

Brain DrainWhere Did the Time Go

by on May.25, 2011, under Brain Drain

There’s nothing like a six month hiatus.

I thought that graduating would give me some free time.  Being terrified of free time, I decided (well, actually was required to keep my internship) to enter a grad school program.

Free time problem eliminated!

But what to do for the summer?

Oh, I know!  I’ll get a new job that will require me to move to a major metro area, but not move the family down until the next year.

Done!  I’m getting good at this.

Yep, I will no longer be at the pencil factory as of the beginning of June and I’ll be moving to the Plano area for my new position.  Fortunately, a good friend has agreed to house me for a while as I get the family prepped to move.  He has no idea what he’s agreed to.  Hehehehe…

Oh, Rob, don’t read those last few sentences.

So I’m slowly getting back into the writing and socializing thing.  I’ve even posted a tweet after more than a year.

Baby steps.

2 Comments more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...