Rubber Band Gun #6 and Pro/Engineer Wildfire

I recently purchased a copy of Pro/Engineer Wildfire 5.0, and have been comparing it to SolidWorks. They are both nice programs, and within about a day, I have achieved about the same level of usefulness in ProE as SolidWorks. (Note: all that means is that I am a beginner at this).

Anyway, I wished to share one of the models I’m working on. This is a mechanism for a Rubber Band Gun receiver.

U.S. Student Loan Amounts

There is an estimated $730 billion in outstanding federal and private student-loan debt, says Mark Kantrowitz of FinAid, a Web site that tracks financial-aid issues — and only 40% of that debt is actively being repaid. The rest is in default, or in deferment, which means payments and interest are halted, or in forbearance, which means payments are stopped while interest accrues.

(referenced from http://articles.moneycentral.msn.com/CollegeAndFamily/CutCollegeCosts/the-555000-dollar-student-loan-debt.aspx)

Interesting Numeric Pattern

>>> for i in range(1,31):
...     print('  ' + '1'*30)
...     print('x ' + '1'*i)
...     print('= ' + str(int('1'*30) * int('1'*i)))
...     print()
...
  111111111111111111111111111111
x 1
= 111111111111111111111111111111

  111111111111111111111111111111
x 11
= 1222222222222222222222222222221

  111111111111111111111111111111
x 111
= 12333333333333333333333333333321

  111111111111111111111111111111
x 1111
= 123444444444444444444444444444321

  111111111111111111111111111111
x 11111
= 1234555555555555555555555555554321

  111111111111111111111111111111
x 111111
= 12345666666666666666666666666654321

  111111111111111111111111111111
x 1111111
= 123456777777777777777777777777654321

  111111111111111111111111111111
x 11111111
= 1234567888888888888888888888887654321

  111111111111111111111111111111
x 111111111
= 12345678999999999999999999999987654321

  111111111111111111111111111111
x 1111111111
= 123456790111111111111111111110987654321

  111111111111111111111111111111
x 11111111111
= 1234567901222222222222222222220987654321

  111111111111111111111111111111
x 111111111111
= 12345679012333333333333333333320987654321

  111111111111111111111111111111
x 1111111111111
= 123456790123444444444444444444320987654321

  111111111111111111111111111111
x 11111111111111
= 1234567901234555555555555555554320987654321

  111111111111111111111111111111
x 111111111111111
= 12345679012345666666666666666654320987654321

  111111111111111111111111111111
x 1111111111111111
= 123456790123456777777777777777654320987654321

  111111111111111111111111111111
x 11111111111111111
= 1234567901234567888888888888887654320987654321

  111111111111111111111111111111
x 111111111111111111
= 12345679012345678999999999999987654320987654321

  111111111111111111111111111111
x 1111111111111111111
= 123456790123456790111111111110987654320987654321

  111111111111111111111111111111
x 11111111111111111111
= 1234567901234567901222222222220987654320987654321

  111111111111111111111111111111
x 111111111111111111111
= 12345679012345679012333333333320987654320987654321

  111111111111111111111111111111
x 1111111111111111111111
= 123456790123456790123444444444320987654320987654321

  111111111111111111111111111111
x 11111111111111111111111
= 1234567901234567901234555555554320987654320987654321

  111111111111111111111111111111
x 111111111111111111111111
= 12345679012345679012345666666654320987654320987654321

  111111111111111111111111111111
x 1111111111111111111111111
= 123456790123456790123456777777654320987654320987654321

  111111111111111111111111111111
x 11111111111111111111111111
= 1234567901234567901234567888887654320987654320987654321

  111111111111111111111111111111
x 111111111111111111111111111
= 12345679012345679012345678999987654320987654320987654321

  111111111111111111111111111111
x 1111111111111111111111111111
= 123456790123456790123456790110987654320987654320987654321

  111111111111111111111111111111
x 11111111111111111111111111111
= 1234567901234567901234567901220987654320987654320987654321

  111111111111111111111111111111
x 111111111111111111111111111111
= 12345679012345679012345679012320987654320987654320987654321

What is a tuple?

I get asked this from time to time, so for the fun of it, I’ll post this:

Tuples are immutable lists in python (and other languages).  Very lightweight, unchangable arrays.  They are used for storing multiple values in one variable (usually a fixed number of values).

x = (1, 2, 3, 'abc')
x[0]
-> 1
x[1] 
-> 2
x[2] 
-> 3

x[3] 
-> abc
x["bob"]
-> TypeError: tuple indices must be integers, not str

Tuples are immutable lists in python (and other languages).  Very lightweight, unchangable arrays.
x = (1,2,3)
x[0] == 1
x[1] == 2
x[2] == 3
x[“bob”] == “tuple indices must be integers”

A common example is storing x,y coordinances.  You could use a tuple for that:

point = (12,38)

Python can unpack tuples also.

x,y = (12,38)
x
-> 12
y
-> 38

Enjoy.

Freeky Bug

Ever have one of those bugs that customers complain about, but you just cannot reproduce it? Here is a good one…

Customers were complaining about being logged out when clicking a download link.

This particular setup is a Cisco CSS 11501 series load balancer with 2 Dell Poweredge web servers sitting behind it.  Each webserver is running apache, as well as an application server (python) which handles authentication and processing for THAT server.

For weeks, I could not reproduce this bug.  So tonight when I finally got bit by it (at home), I was clueless for a while.  The code is so simple.  A simple key lookup in a simple dictionary, yet it just was not making sense.

Here is the story:

A while ago, we were having problems with Internet Explorer downloading content over SSL.  This turns out to be a common problem with IE, so to fix it, I caused the downloads to not use SSL, which is more efficient anyway.

We use a cisco hardware load balancer which balances incoming requests to different backend servers.  It has a feature called STICKY SOURCE IP, which means that any connections routed from the same IP to the same site will be delivered to the same backend server.  This is nice, because you are always visiting the same server.

So as it turns out, by turning the download SSL off, the load balancer was using another “site” definition to handle the DOWNLOAD request.  STICKY SOURCE IP was out the window, and the request was being passed back to a “random” webserver.

About 50% of the time, users (like me tonight) were tossed to the other server, which knew nothing about the user login. That is why it was complaining about the “WB4_App::$DSEG and/or WB4_App::$AuthToken must be set in order to contact the     applications server.” error message, which is not one that should normally be shown.

To make matters worse, our IP address at work was apparently always using the same server, so I could not reproduce the problem.  I’m lucky that it happened to me at home, or I would still be banging my head against the desk…