This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>Google+ Hangouts are online rooms where you can have a face-to-face conversation with up to 10 people at once. This is a great way to meet your classmates and to practice thinking and arguing with students all over the world!</p> | |
<p> | |
We've provided some possible discussion topics, but you can talk about whatever you want in each of the rooms, so don't hesitate to jump right in and see what everyone's talking about. And don't worry if you're the first person in a room -- other students | |
will be there soon :-) | |
</p> | |
<p> | |
When you click to join a hangout, you will be asked to create a Google+ Account if you do not already have one. After entering a Hangout room, you will also need to click the JOIN button to participate in the Hangout. Have fun, and please use the | |
<a | |
href="https://class.coursera.org/thinkagain-2012-001/forum/list?forum_id=27">Google+ Hangouts Forum</a>to give us your feedback! | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Google+ Hangouts are online rooms where you can have a real-time audio/video conversation with up to 10 classmates at once. You can schedule hangouts in advance for study groups, review sessions and social meetups with classmates. Use this forum to plan | |
your hangouts with classmates and talk about it afterward: <a href="https://class.coursera.org/behavioralecon-001/forum/list?forum_id=105">Google+ Hangouts Forum</a>. We've scheduled a bunch of these for you (see all the events <a href="https://plus.google.com/u/0/communities/106659009032200000126/events" | |
target="_blank">here</a>), so feel free to join one of those or go ahead and make your own! | |
<br> | |
<br>Scheduled Hangouts will appear on this page. If you use Google Calendar, you can click the Attend button to get a reminder when the hangout is about to begin, but entering a hangout is on a first come first serve basis. You do have to have a Google+ account | |
to do this (but you can easily create one). | |
<br> | |
<br> | |
<h3>New to Hangouts?</h3> | |
Check <a href="https://s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
"backbone", | |
"jquery", | |
"underscore", | |
"js/lib/util", | |
"js/lib/jquery.bbq" | |
], | |
function(Backbone, $, _, util, bbq) { | |
var WIDGET_INFIX = '-state-'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CalendarEvent { | |
/** | |
* | |
* The event ID | |
* @var string | |
*/ | |
private $uid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function truncateText(string, nMaxChars) { | |
if (string.length <= nMaxChars) | |
return string; | |
var xMaxFit = nMaxChars - 3; | |
var xTruncateAt = string.lastIndexOf(' ', xMaxFit); | |
if (xTruncateAt == -1 || xTruncateAt < nMaxChars / 2) | |
xTruncateAt = xMaxFit; | |
return string.substr(0, xTruncateAt) + "..."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# So we can easily bust cache between huge versions | |
def get_cache_key(key): | |
return 'v01022012' + key | |
def put_in_cache(key, val, time=None): | |
from google.appengine.api import memcache | |
try: | |
key = get_cache_key(key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
results = [{'universities': 1L, 'name': u'Course Name', 'categories': 1L, 'id': 2L}, {'universities': 2L, 'name': u'Course Name', 'categories': 1L, 'id': 2L}, {'universities': 1L, 'name': u'Course Name', 'categories': 5L, 'id': 2L}, {'universities': 2L, 'name': u'Course Name', 'categories': 5L, 'id': 2L}, {'universities': 1L, 'name': u'Course Name', 'categories': 6L, 'id': 2L}, {'universities': 2L, 'name': u'Course Name', 'categories': 6L, 'id': 2L}] | |
""" | |
When you call values() on a queryset where the Model has a ManyToManyField | |
and there are multiple related items, it returns a separate dictionary for each | |
related item. This function merges the dictionaries so that there is only | |
one dictionary per id at the end, with lists of related items for each. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run with ./node_modules/mocha/bin/mocha app/www/test/web/wd.js --timeout 5000 | |
var assert = require('assert'); | |
var wd = require('wd-sync').wd | |
var Wd = require('wd-sync').Wd; | |
browser = wd.remote(); | |
/** test data **/ | |
var testData = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// My HTML specifies accept="" on the input | |
// I add this additional function to transloadit2.js | |
Uploader.prototype.checkFileTypes = function() { | |
var self = this; | |
var acceptedTypes = self.$files.attr('accept'); | |
if (!acceptedTypes) { | |
return true; | |
} |