This file contains hidden or 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
# Create your views here. | |
from django.shortcuts import render_to_response | |
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm | |
from django import forms | |
from django.contrib.auth import forms | |
from django.core.context_processors import csrf | |
from django.contrib.auth.models import User | |
from django.template import RequestContext | |
from django.contrib.auth import authenticate |
This file contains hidden or 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
# Create your views here. | |
from django.shortcuts import render_to_response | |
from django.contrib.auth.forms import UserCreationForm | |
from django.contrib.auth import forms as auth_forms | |
from django.core.context_processors import csrf | |
from django.contrib.auth.models import User | |
from django.template import RequestContext | |
from django.contrib.auth import authenticate | |
from django.contrib.auth import login as auth_login | |
from django.http import HttpResponse, HttpResponseRedirect |
This file contains hidden or 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
def _split_message(message): | |
wall = models.Wall.objects.all() | |
if len(wall) == 1: | |
keyword = str(wall[0].sms_keyword) | |
message = message.replace(keyword, '').replace(' ', ' ') | |
return keyword, message | |
codes = re.search("(^|\s)(\w{3})(\s|$)", message) | |
if codes == None: | |
return None, None | |
keyword = _get_keyword(codes) |
This file contains hidden or 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
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal" | |
aria-hidden="true">×</button> | |
<h3 id="myModalLabel">Modal header</h3> | |
</div> | |
<div class="modal-body"> | |
<p>One fine body…</p> | |
</div> | |
<div class="modal-footer"> |
This file contains hidden or 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
<!DOCTYPE html > | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<meta charset="utf-8"> | |
<meta name="google-site-verification" |
This file contains hidden or 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
int reverse(char s[]) | |
{ | |
int len, i; | |
char copied[MAXLINE]; | |
copy(copied, s); | |
for (len = 0; ; ++len) | |
if (s[len] == '\n') | |
break; |
This file contains hidden or 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
#include <stdio.h> | |
#define LINECOL 20 /* "fold" after this column */ | |
int main() | |
{ | |
int c, i, j, lastchar; | |
int str[LINECOL]; | |
for (i = 0; i <= LINECOL; i++) | |
str[i] = 0; |
This file contains hidden or 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
{% extends "base.html" %} | |
{% block title %}Messages{% endblock %} | |
{% block css %} | |
.lead { | |
text-align:center; | |
} | |
{% endblock %} | |
{% block content %} |
This file contains hidden or 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 | |
import copy | |
def powerset(iterable): | |
s = list(iterable) | |
return itertools.chain.from_iterable(itertools.combinations(s, r) for r in range(len(s) + 1)) | |
def passgen(password, CHOICES = {'a': ['@', '4'], 's': ['$', '&']} ): |
This file contains hidden or 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
def intersection(sets): | |
counts = {} | |
for s in sets: | |
print "Starting set" | |
if not counts: | |
for item in s: | |
counts[item] = 1 | |
continue | |
changed = False | |
for item in s: |
OlderNewer