Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Leah Culver

Name: Anonymous 2017-06-09 17:42

Hi! I'm Cofounder and CTO of Breaker, the best podcast listening and discovery app. I'm a Swift and Python developer and former founder of Grove, Convore, and Pownce. I'm also an author of both the OAuth and oEmbed API specifications.

Name: Anonymous 2017-06-09 17:48

http://web.archive.org/web/20070504110113/www.leahculver.com/2007/04/19/star-ratings/
Ive been awfully busy programming lately. My Django-based side project is coming along well and I hope to have it ready for use in a few weeks. Please dont ask more about it, thats really all I can say for now. Anyways, I came across an interesting little math problem today and was hoping some skilled programmers out there could come up with a more elegant solution than mine.
Problem: Star Ratings

People can rate cheeseburgers on my website with a star rating of 0-5 stars (whole stars only), 5 being mighty tasty and 0 being disgusting. I would like to show the average of everyones ratings of a particular cheeseburger to the nearest half star. I have already calculated the average rating as a float (star_sum) and the total number of people that rated the particular cheeseburger (num_raters). The result should be stored as a float in a variable named stars.

My Solution (in Python):

# round to one decimal place and
# separate into whole and fractional parts
parts = str(round(star_sum/num_raters, 1)).split('.')
whole = int(parts[0])
frac = int(parts[1])
if frac < 3:
___frac = 0
elif frac > 7:
___frac = 0
___whole += 1
else:
___frac = 5
# recombine for a star rating rounded to the half
stars = float(str(whole)+.'+str(frac))

Name: Anonymous 2017-06-09 17:51

Name: Anonymous 2017-06-09 19:44

Who?

Name: Anonymous 2017-06-09 20:30

>>4

Female programmer.

Name: Anonymous 2017-06-09 22:20

OAuth is crap.

Name: Anonymous 2017-06-10 4:58

I'm also an author of both the OAuth and oEmbed API specifications.

OAuth began in November 2006 when Blaine Cook was developing the Twitter OpenID implementation. Meanwhile, Ma.gnolia needed a solution to allow its members with OpenIDs to authorize Dashboard Widgets to access their service. Cook, Chris Messina and Larry Halff from Magnolia met with David Recordon to discuss using OpenID with the Twitter and Ma.gnolia APIs to delegate authentication. They concluded that there were no open standards for API access delegation.[citation needed]

The OAuth discussion group was created in April 2007, for the small group of implementers to write the draft proposal for an open protocol. DeWitt Clinton from Google learned of the OAuth project, and expressed his interest in supporting the effort. In July 2007, the team drafted an initial specification. Eran Hammer joined and coordinated the many OAuth contributions creating a more formal specification. On December 4, 2007, the OAuth Core 1.0 final draft was released.[3]

At the 73rd Internet Engineering Task Force (IETF) meeting in Minneapolis in November 2008, an OAuth BoF was held to discuss bringing the protocol into the IETF for further standardization work. The event was well attended and there was wide support for formally chartering an OAuth working group within the IETF.

The OAuth 1.0 protocol was published as RFC 5849, an informational Request for Comments, in April 2010.

Since August 31, 2010, all third party Twitter applications have been required to use OAuth.[4]

The OAuth 2.0 framework was published as RFC 6749, and the Bearer Token Usage as RFC 6750, both standards track Requests for Comments, in October 2012.

Don't change these.
Name: Email:
Entire Thread Thread List