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
class Hoge | |
{ Q_OBJECT; | |
public: | |
Hoge(); | |
private slot: | |
void OnButtonClicked(bool); | |
private: | |
QPushButton *button_ |
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
import System.Threading | |
rnd = System.Random() | |
data = (rnd.Next(100) for i in range(100)) | |
for t in (Thread({Thread.Sleep(i*100); print i}) for i in data): | |
t.Start() |
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
import System | |
import System.Windows.Forms; | |
class Parent(Form): | |
public def constructor(): | |
self.IsMdiContainer = true | |
_btn = Button(Text: "Create Child") | |
_btn.Click += self.CreateChild | |
self.Controls.Add(_btn) |
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
use strict; | |
use warnings; | |
use utf8; | |
#=============================== | |
my $consumer_key = ''; | |
my $consumer_secret = ''; | |
my $access_token = ''; | |
my $access_token_secret = ''; |
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
#!perl | |
use strict; | |
use warnings; | |
use utf8; | |
use XML::RSS; | |
use Growl::Any; | |
use LWP::UserAgent; | |
use File::Temp qw/:POSIX/; | |
use HTTP::Status qw/:constants/; | |
use Scope::Guard; |
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
#include <iostream> | |
#include <limits> | |
#include <boost/timer.hpp> | |
struct BitTest { | |
int i; | |
bool a : 1; | |
}; |
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
diff --git a/lib/AnyEvent/Twitter/Stream.pm b/lib/AnyEvent/Twitter/Stream.pm | |
index 34f4539..4ba412c 100644 | |
--- a/lib/AnyEvent/Twitter/Stream.pm | |
+++ b/lib/AnyEvent/Twitter/Stream.pm | |
@@ -154,7 +154,7 @@ sub new { | |
my($handle, $json) = @_; | |
# Twitter stream returns "\x0a\x0d\x0a" if there's no matched tweets in ~30s. | |
$set_timeout->(); | |
- if ($json) { | |
+ if ($json && $json =~ /^{/) { |
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
use strict; | |
use warnings; | |
use BDB::Wrapper; | |
my $dbfile = '/path/to/file.bdb'; | |
my $wrap = BDB::Wrapper->new; | |
if ( my $h = $wrap->create_write_dbh($dbfile) ) { | |
local @SIG{qw/INT TERM QUIT/}; |
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
use strict; | |
use warnings; | |
use utf8; | |
use Win32::GuiTest qw/:ALL/; | |
use Time::HiRes qw/sleep/; | |
UnicodeSemantics(1); | |
my $setupexe = "d:/tmp/cygwin/setup.exe"; |
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
(ns htmlscrapetest | |
(:require [clojure.xml :as xml] | |
[clojure.zip :as zip] | |
[clojure.contrib.zip-filter :as z] | |
[clojure.contrib.zip-filter.xml :as zf]) | |
(:use [clojure.java.io :only [as-file]]) | |
; http://htmlcleaner.sourceforge.net/ | |
(:import [org.htmlcleaner CleanerProperties CompactXmlSerializer HtmlCleaner]) | |
) |