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 functools import wraps | |
def patch_objects_get(cls): | |
""" Patch 'cls.objects.get' so its DoesNotExist errors will be more | |
helpful. | |
Usage: | |
>>> @patch_objects_get | |
... class MyModel(m.Model): |
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
<style> | |
.result { | |
width: 35px; | |
height: 35px; | |
} | |
.col-header, .row-header { | |
font-weight: bold; | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> | |
<mx:Script><![CDATA[ | |
import utils.Timeit; | |
// Note: this can be found at https://bitbucket.org/wolever/as3-4house/src/tip/src/utils/ | |
var container:Sprite; | |
function setup():void { | |
container = new Sprite(); |
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 mock | |
import y | |
# | |
# Incorrect | |
# | |
with mock.patch("x.X") as x: | |
print "x from y:", y.get_x() | |
print "mocked x:", x |
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
<?xml version="1.0" encoding="utf-8"?> | |
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> | |
<mx:Script><![CDATA[ | |
import mx.charts.AreaChart; | |
import mx.messaging.Producer; | |
import utils.Timeit; | |
import utils.assert; | |
import utils.cartesian_product; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> | |
<mx:Script><![CDATA[ | |
import mx.charts.AreaChart; | |
import mx.messaging.Producer; | |
import utils.Timeit; | |
import utils.assert; | |
import utils.cartesian_product; | |
import utils.create; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> | |
<mx:Script><![CDATA[ | |
import mx.charts.AreaChart; | |
import mx.messaging.Producer; | |
import utils.Timeit; | |
import utils.assert; | |
import utils.cartesian_product; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> | |
<mx:Script><![CDATA[ | |
import mx.charts.AreaChart; | |
import mx.messaging.Producer; | |
import utils.Timeit; | |
import utils.assert; | |
import utils.cartesian_product; | |
import utils.chain; |
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
[SWF] Users:wolever:Documents:Adobe Flash Builder 4.5:Test:bin-debug:Test.swf - 718,196 bytes after decompression | |
running 5 functions 1000 times... | |
forEachUntyped(int): 3241, 3254, 3225 (min: 3225, drift: 29) | |
forEachUntyped(ac): 3298, 3352, 3350 (min: 3298, drift: 54) | |
forEachTypedInt: 3348, 3361, 3409 (min: 3348, drift: 61) | |
forEachTypedArrayCollection: 3377, 3428, 3415 (min: 3377, drift: 51) | |
usingMapUntypedFullArgs(int): 4050, 4071, 4070 (min: 4050, drift: 21) | |
usingMapUntypedIgnoringArgs(int): 9122, 9095, 9098 (min: 9095, drift: 27) | |
done! |
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
fun! Term() | |
!term "%:p:h" | |
endfun | |
command! Term call Term() |