Thoughts, Perception, and Point of View

Tuesday, June 1, 2010

PPP: The Sum of Digits

A Programing Practice Problem where the user provides a positive integer to receive back the total of the digits in the given number.

Sum of Digits

Provide me with an application that takes an input int and returns an int that is the total of each digit of that number. In the case of 1024, it should return 7, as 1 + 0 + 2 + 4 = 7. Be sure that anything from a single digit number to a 8 or higher digit number still runs correctly.

Single Digit Sum of Digits

Taken to the next step, repeat the process over and over until the return value is a single digit number.

Extra Credit: Crazy Mode

Allow the user to change the app away from base 10, such as base 2 or base 16. This is called crazy for a reason.

Friday, March 26, 2010

.NET Gridview with jQuery quicksearch

Several key features are needed to get .NET's GridView control to work with jQuery's quicksearch allowing for client side filtering of rows of data. The jQuery will expect to know the id of your target gridview, which .NET will make difficult for you. What was in your code an id of gridview1 becomes something like ctl00_MainContent_Conrol1_gvUserRoles.

If you look at the source of your page after the gridview is added, search for your control name and grab the entire ID. This is the part that goes as a parameter of the quicksearch function, like so:
<script type="text/javascript">
    $(function () {
        $('input#id_search').quicksearch('table#ctl00_MainContent_UserRoles_gvUserRoles tbody .UserRolesRow');
    });
</script>
Note that I change the "table#tableName tbody tr" that most jQuery quicksearch examples use into "table#tableName tbody .tableRow", which is a css class I plan to add to each of my rows. If I didn't do this, I would be loosing my header row when the filter fired. To choose the CSS class of the rows in the gridview, use this line within the gridview:
<RowStyle CssClass="UserRolesRow" />
Check out a full file example here, and good luck in your endeavors.

Friday, February 12, 2010

QA - Daunte's Inferno

Location: Checkpoint just after talking to Virgil for the second time. (Virgil's Dialog: Into the Blind World)
Difficulty: Hellish (likely doesn't matter)
Health on respawn: last 1/6 (like doesn't matter)

The player is to pull a lever to extend a time limited bridge (there is a purple mana restore just left of the lever). After dieing to the wave of skeletons and flying beast, respawn and return to Virgil, and jump up onto the platform below the soul wall. Move screen right until you touch the invisible wall, then return to the switch. The R1 click event is not available.

It appears the only option for the user is to jump off the bridge to cause a respawn.

I have not checked to see if this can happen on the first walk up without being at the checkpoint. There is also the possibility that there is a specific scenario just before the checkpoint required for this bug to occur.

Wednesday, February 10, 2010

Remember, Remember the Event You Need to Remember

Summary

Gmail and Google Calendar together can help you remember important events without resulting in tons of unread emails spamming your inbox. How? That is what this post is for.

You Will Need

I must first assume you:
1) Have a Gmail account: www.gmail.com (bottom right "Create an Account >>")
2) Have Google Calendar: calendar.google.com (you should already have an account from step one)

Step One

Within Google Calendar, create a calendar specifically for reminder events. Once the calendar is created, add relevant email reminder events to that calendar. I use 1 hour, 1 day and 1 week reminders. The email address displayed on the top right of the calendar screen is the address that will be receiving these reminders.

Okay, the more commonly know side of remembering key events is started. You will still need to create events, and set them to repeat as often as they do.

Step Two

The second step is from within Gmail. Setup a filter for the reminder emails to be added to a label when they are received. Use "calendar-notification@google.com" as the "from" of the filter, and apply the label "Reminder" on the second step of creating a filter.

With the filter and label created, change the reminder label's color to something that stands out, like red.

Step Three

Finally the last step that makes this method really shine. If your not a micro manager of your emails like me, you won't want to delete this massive number of reminders one at a time. When you view the messages of a label, you can select all of the messages (just above the messages is the line "Select: All, None, Read, Unread, Starred, Unstarred") and deselect the few still relevant reminders. Hit delete with the unwanted remainders selected, and you have successfully reclaimed your inbox (at least from your own reminders).

Buzz link

Sunday, February 7, 2010

PPP: Alpha Counter

A Programing Practice Problem where the user provides a string and receives a single number back based on what each letter of the string is.

1) Alpha Counter

Provide me with a program that will satisfy the following curiosity. If each letter of the alphabet is represented by it's slot number, where A is 1, B is 2, and so on, what is the sum of the letters for your first name.

The program should take the name "Levi" and output 48. Any unrecognized chars shouldn't add anything to the total (such as the apostrophe in "O’Reilly" or the flem sound in Achmed").

2) Key'ed Alpha Counter

I recall going to lunch in second grade, and as a class being put in alphabetical order. With a last name of Watts, this was only enjoyed when we were in reverse order. To this end, this gives me another idea.

Add a means to our program to change the alphabet order with a key. Any letter not specified is added to the end in alphabetical order. For example, if we say "cat" then the three letters c, a and t are moved to the front, leaving the rest of the alphabet behind it. eg catbdefghijklmnopqrsuvwxyz

There is at least one sticky ambiguous decisions to be made. You are free to deal with it as you see fit, but document those choices. (If you are unsure what I speak of, I will be using my last name as a key to test your app.)

To see my implementation of this PPP, as well as a means to check your code's output, see my alpha counter. Use it as a means of checking your output, and point out any errors you find in my output. I'd hate for my errors to end up on prod.

Saturday, February 6, 2010

Sallie Mae

I pay money to three different companies for my college loans. Of the three websites I access to pay these loans, I dread using SallieMae the most. The payment process for SallieMae is often at least eleven pages. (Salliemae.com, Make payment, Not goverment loan link, Login page, contact info conformation, offer page, offer page 2, summary page, make payment (several pages)).
Of these pages, I find the login, summary and payment pages acceptable. I also find the contact conformation page acceptable once yearly. I find it discerning that SallieMae uses people's impatience to thrust upon them legally binding actions each month. It is both annoying and uncalled for. Unfortunately for myself, I know not how to get my loan moved to another company so that I no longer have to deal with SallieMae. I imagine this is a banked on assumption of SallieMae (no pun intended). Carry on.

Monday, November 23, 2009

Mouse wheel affects: Focus vs Mouseover

I was recently asked to cite sources of applications that have their scroll wheel act upon their moused over target, as opposed to the mouse wheel acting upon the application's focus.

I am pro-Mouseover scroll wheel. Among the mouseover based, there are two camps. Those that ignore the wheel when the mouseover doesn't make sense, and those that use the focus when the mouseover doesn't make sense. I agree with the later.

Mouseover based: Uses mouse location to decide what the scroll wheel means.

Firefox v3.5.5 Tabs vs Window
Picasa 3 v3.5.0 Explorer vs Picture list
Calibre v0.6.7 Content vs Detail
TextPad v5.2.0 Explorer vs Content
Photoshop v8.0 Picture vs Picture
Google Earth v5.0.11733.9347 Left Menu vs The Planet >.<
FreeMind v0.8.1 Content vs Notes

Focused based: Uses the application focus to decide what the scroll wheel means.

Visual Studio '05 v8.0.50727.42
Windows Explorer XP Pro SP3
Excel '03
Dreamweaver MX v6.0
EVEMon v1.2.8.1385
FileZilla v3.3.0

Unique

Cool Edit Pro v2.00, Mousing over the sound wave and using scroll drops focus from anything else. Otherwise focused based.