SELECT TO_CHAR(SYSDATE + INTERVAL '1' hour, 'YYYY:MM:DD HH:MI:SS')
FROM dual
SELECT TO_CHAR(SYSDATE + INTERVAL '1' MONTH, 'YYYY:MM:DD HH:MI:SS')
FROM dual
^^
SELECT TO_CHAR(SYSDATE + INTERVAL '1' hour, 'YYYY:MM:DD HH:MI:SS')
FROM dual
SELECT TO_CHAR(SYSDATE + INTERVAL '1' MONTH, 'YYYY:MM:DD HH:MI:SS')
FROM dual
^^
<html>
<head>
<script type="text/javascript">
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
function checkCookie()
{
username=getCookie('Name1');
alert(username);
if (username!=null && username!="")
{
alert('Welcome again '+username+'!');
}
else
{
username=prompt('Please enter your name:',"");
if (username!=null && username!="")
{
setCookie('username',username,365);
}
}
}
</script>
</head>
<body >
<a href="javascript:checkCookie();">실행</a>
</body>
</html>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
printf("Set-Cookie: Name1=nnn; path=/; expires=Fri, 15 May 2010 21:00:00 GMT\r\n\r\n");
//printf("haha..");
return 0;
}
#include <IOSTREAM>
#include <STRING>
#include <CASSERT>
using namespace std;
string replaceAll(const string &str, const string &pattern, const string &replace)
{
string result = str;
string::size_type pos = 0;
string::size_type offset = 0;
while((pos = result.find(pattern, offset)) != string::npos)
{
result.replace(result.begin() + pos, result.begin() + pos + pattern.size(), replace);
offset = pos + replace.size();
}
return result;
}
int main()
{
assert(replaceAll("abcdefg", "bc", "de") == "adedefg");
assert(replaceAll("abc\nabc\nabc", "\n", "") == "abcabcabc");
assert(replaceAll("aaabbbaaa", "aaa", "1") == "1bbb1");
assert(replaceAll("ababab ababab", "ab", "1") == "111 111");
assert(replaceAll("abcdefg", "gf", "de") == "abcdefg");
assert(replaceAll("aaa", "a", "aa") == "aaaaaa");
assert(replaceAll("11aa11aa", "1", "11") == "1111aa1111aa");
return 0;
}