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
<? | |
require 'parallelcurl.php'; | |
$pc = new ParallelCurl(5); | |
// Bind $callback and $pc using "use()" construct, because we'll use them inside the closure | |
$callback = function($content, $url, $ch, $userParams) use (&$callback, $pc) { | |
// Print status of finished request | |
$i = $userParams['i']; |
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 ruby | |
if ARGV.empty? | |
puts 'Usage: timer TIME' | |
exit | |
end | |
TOKENS = { 's' => 1, 'm' => 60, 'h' => 60 * 60 } | |
def parse_duration(str) |
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
#include <iostream> | |
#include <cstdio> | |
#include <vector> | |
#include <queue> | |
#include <algorithm> | |
#include <map> | |
using namespace std; | |
const int MAX_SQUARES = 6; |
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
<?php | |
/** | |
* Renders rain. The code was like 10 times shorter before moving it into the class | |
*/ | |
class Renderer | |
{ | |
protected $width, $height, $text; | |
private $_middle, $_textBeginPos, $_textLength, $_line; |
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
==2885== Memcheck, a memory error detector | |
==2885== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. | |
==2885== Using Valgrind-3.6.1-Debian and LibVEX; rerun with -h for copyright info | |
==2885== Command: giomm-test | |
==2885== | |
==2885== | |
==2885== HEAP SUMMARY: | |
==2885== in use at exit: 93,481 bytes in 1,693 blocks | |
==2885== total heap usage: 2,493 allocs, 800 frees, 214,414 bytes allocated | |
==2885== |
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
==3152== Memcheck, a memory error detector | |
==3152== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. | |
==3152== Using Valgrind-3.6.1-Debian and LibVEX; rerun with -h for copyright info | |
==3152== Command: giomm-test | |
==3152== | |
(process:3152): glibmm-CRITICAL **: Glib::ObjectBase* Glib::wrap_create_new_wrapper_for_interface(GObject*, GType): assertion `wrap_func_table != 0' failed | |
(process:3152): GLib-GObject-CRITICAL **: g_object_set_qdata_full: assertion `quark > 0' failed | |
==3152== |