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 std; | |
fn vec_push(&v: [int], elt: int){ | |
v += [elt]; | |
} | |
fn main() { | |
let v: [int] = []; | |
let vec_size: uint = 0u; | |
vec_push(v,5); |
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
--- /media/Data/mikutter/core/config.rb.orig 2012-02-10 00:56:37.435758528 +0900 | |
+++ /media/Data/mikutter/core/config.rb 2012-02-10 00:56:04.940757018 +0900 | |
@@ -42,7 +42,7 @@ | |
REVISION = 658 | |
# このソフトのバージョン。 | |
- VERSION = [0,1,0, ((/Last Changed Rev\s*:\s*(\d+)/.match(`sh -c 'LANG=C svn info ../'`)[1] || REVISION).to_i rescue REVISION)] | |
+ VERSION = [0,1,0, ((/Last Changed Rev\s*:\s*(\d+)/.match(`sh -c 'LC_ALL=C svn info ../'`)[1] || REVISION).to_i rescue REVISION)] | |
end |
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
# -*- coding: utf-8 -*- | |
require 'socket' | |
Plugin.create :socket_tweet do | |
#複数回ツイートを送信するために複数ソケット通信対応サーバーとする | |
@thread = SerialThreadGroup.new | |
@thread.new{ | |
server = TCPServer.open(3900) | |
loop { | |
begin | |
client = server.accept |
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 <boost/asio.hpp> | |
int main(int argc, char** argv) | |
{ | |
using namespace boost::asio; | |
using ip::tcp; | |
std::string buf; | |
try | |
{ |
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 Network | |
import System.IO | |
import System.Exit | |
import Control.Exception | |
import Prelude hiding (catch) | |
sendMessage :: String -> IO () | |
sendMessage msg = withSocketsDo $ do | |
hSetBuffering stdout NoBuffering | |
h <- connectTo "127.0.0.1" (PortNumber 3939) |
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 Text.Regex.Posix | |
main = do name <- getLine | |
print (checkURL name) | |
-- URLの正規表現を定める | |
urlRegex :: [Char] | |
urlRegex = ".*(https?|ftp)(://[-_.!~*\'()a-zA-Z0-9;/?:@&=+$,%#]+).*$" | |
-- t.coのURL長 | |
tcoLength :: Int |
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 Text.Regex.Posix | |
main = do name <- getLine | |
print (checkURL name) | |
print (countURLLength name) | |
print (twitLength name) | |
checkLengthAndTwit name | |
-- URLの正規表現を定める | |
urlRegex :: [Char] |
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
#bashシェルを埋め込んでみた。 | |
#必要なヘッダーが有る時はなにもしないよ | |
fixshContent= | |
"#!/usr/bin/env bash\n | |
cd arch/x86/include/asm/\n | |
if [ -f unistd_32.h ] ; then | |
echo 'no need fix.' | |
else | |
ln -s ../generated/asm/unistd*.h .\n | |
fi" |
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
alias alert='growlnotify -t "$([ $? = 0 ] && echo terminal || echo error)" -m "$(history|tail -n1|sed -e '\''s/^..[0-9]*//;s/[;&|]\s*alert$//'\'')"' |
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="unicode nls X gtk berkdb cups apng python ghcbootstrap ghcquickbuild x264 faac thread threads mp3 alsa" | |
LANGS=ja | |
LINGUAS=ja | |
CFLAGS="-O2 -pipe -march=native" | |
CXXFLAGS="${CFLAGS}" | |
RUBY_TARGETS=ruby19 | |
ACCEPT_LICENSE="@GPL-COMPATIBLE @OSI-APPROVED @EULA atheros-hal BitstreamVera" | |
source /home/cosmo/gentoo/var/lib/layman/make.conf | |
PORTDIR_OVERLAY="/home/cosmo/portage-overlay ${PORTDIR_OVERLAY}" | |
CHOST=i686-pc-linux-gnu |