Detection of peaks in data in python
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
// test |
- What is consensus?
- We all agree on something
- How do we agree when communication lines are unreliable?
- Paxos
- https://en.wikipedia.org/wiki/Paxos_(computer_science)
- Super complex
- Limited implementations
- Raft
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
<html> | |
<title>Hi</title> | |
<body> | |
he he he | |
</body> | |
</html> |
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
<html> | |
<head> | |
<title>Hey {{name|default:"there"}}!</title> | |
</head> | |
<body> | |
It's a lovely day, eh {{name|default:"chap"}}? | |
</body> | |
</html> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title> anyas page </title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script> | |
$(function(){ | |
$("a").click(function(){ | |
alert("clicked"); | |
return false; |
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
class ArticlePreviewTests(TestCaseBase): | |
#..... | |
def test_comments_no_linkify(self): | |
d = _create_document(title='Template:Foo') | |
revision(document=d, | |
is_approved=True, | |
is_ready_for_localization=True, | |
save=True, |
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
#!/usr/bin/env python | |
# By Tim Watts | |
# From http://readevalprint.com/blog/more-better-django-changed-instance-diff.html | |
# Updated on 9/22/2011 - Added Many2Many to supported fields | |
# Updated on 9/23/2011 - Fixed Many2Many fields | |
class Missing: | |
pass |
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 hashlib | |
import datetime | |
import urllib | |
# TODO: Create a thin wrapper to use settings.SECRET_KEY | |
def create(secret, **kwargs): | |
"""Create a signed, timestamped single use nonce from the given kwargs""" | |
m = hashlib.md5() |
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
from django.shortcuts import get_object_or_404 | |
from django.contrib.auth import SESSION_KEY | |
from django import http | |
from django.contrib.auth.models import User | |
from django.contrib.auth.decorators import user_passes_test | |
@user_passes_test(lambda u: u.is_staff) | |
def su(request, username, redirect_url='/'): | |
su_user = get_object_or_404(User, username=username) | |
if su_user.is_active: |
OlderNewer