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
def pieceOfWork(i: Int): Int = new Random().nextInt(10) + i | |
def eventualWork(i: Int): Future[Int] = Future { | |
println(s"eventualWork $i") | |
Thread.sleep(500) | |
val r = pieceOfWork(i) | |
println(s"returning $r") | |
r | |
} | |
def findMoreThan(total: Int): Future[Int] = { | |
val promise = Promise[Int]() |
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 SQLPrintingMiddleware(object): | |
""" | |
Middleware which prints out a list of all SQL queries done | |
for each view that is processed. This is only useful for debugging. | |
https://gist.github.com/vstoykov/1390853 | |
Modified locally to depend on settings.DEBUG_SQL, as I don't think this is something we generally want on a dev box. | |
Also added some more coloring, and a line to hide the (usually long) list of fields in the select clause. | |
""" |
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
public class MyAdapter extends SimpleCursorAdapter { | |
// constructor, etc... | |
@Override | |
public void bindView(View view, Context context, Cursor cursor) { | |
super.bindView(view, context, cursor); | |
// Stretch list item height if there are too few to fill the content area. | |
ListView listView = getListView(); |
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 FastFailingTest(TestCase): | |
""" | |
A TestCase that stops execution of the suite if it fails. | |
""" | |
def run(self, result=None): | |
if result is None: | |
result = self.defaultTestResult() | |
failfast = result.failfast | |
result.failfast = 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
D/AwesomePlayer( 112): Failed to open file, all profile flags have to set through setprop method. | |
I/MPEG4Extractor( 112): NON-QT MODE DECIDED | |
D/NvOsDebugPrintf( 112): NvxLiteH264DecoderInit : Opening TVMR H264 block | |
I/OMXCodec( 112): [OMX.Nvidia.h264.decode] AVC profile = 66 (Baseline), level = 30 | |
I/OMXCodec( 112): [OMX.Nvidia.h264.decode] video dimensions are 320 x 240 | |
I/OMXCodec( 112): [OMX.Nvidia.h264.decode] Crop rect is 320 x 240 @ (0, 0) | |
D/NvOsDebugPrintf( 112): NvMMLiteOpen : Block : BlockType = 261 | |
D/NvOsDebugPrintf( 112): ++++++ NvAvpOpen +++++++ | |
D/NvOsDebugPrintf( 112): ++++++++++++ TVMRFrameDelivery +++++++++++++++ | |
D/NvOsDebugPrintf( 112): NvMMLiteBlockCreate : Block : BlockType = 261 |