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
Ejected | |
STOP -> Stopped | |
Stopped* | |
STOP -> Ejected | |
PLAY -> Playing | |
REWIND -> Rewinding | |
FAST_FORWARD -> FastForwarding | |
Active | |
STOP -> Stopped | |
PLAY -> Stopped |
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 find(key, dictionary): | |
for k, v in dictionary.iteritems(): | |
if k == key: | |
yield v | |
elif isinstance(v, dict): | |
for result in find(key, v): | |
yield result | |
elif isinstance(v, list): | |
for d in v: | |
for result in find(key, d): |
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
from __future__ import absolute_import, print_function, unicode_literals | |
from django.db import models, transaction | |
from django.utils import six | |
from django.apps import apps | |
from django.core.exceptions import FieldDoesNotExist | |
try: | |
# Django 1.7 | |
from django.contrib.admin.utils import NestedObjects | |
except ImportError: | |
# Django < 1.7 |
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
function swap(n) { | |
var arr = n.toString().split(''); // convert number to string then split into array | |
if (arr.length > 2) { | |
var swap_list = []; // arrary to push newly swapped numbers | |
for (var i = 0; i < arr.length; i++) { | |
for (var j = 0; j < arr.length; j++) { | |
if (i != j) { | |
new_arr = arr.slice(0); // copy old array |