Syntax Highlighter for Xquared test page
import sys
import csv
import cStringIO
import codecs
import MySQLdb
class Database:
def __init__(self, hostname, user, password, database_name):
self.hostname = hostname
self.user = user
self.password = password
self.name = database_name
def connect(self):
self.connection = MySQLdb.connect(self.hostname, self.user, self.password, self.name)
self.cursor = self.connection.cursor(MySQLdb.cursors.DictCursor)
def query(self, query):
return self.cursor.execute(query)
class Field:
def __init__(self):
self.value = ""
def __call__(self, name):
print name
def __repr__(self):
return repr(self.value)
#include <unistd.h>
#include <utmp.h>
#include <stdio.h>
#include <sys/types.h>
#include <time.h>
#include <fcntl.h>
#include <string.h>
int main(int argc, char **argv) {
struct utmp *fp;
struct tm *current_time;
printf("-------------------------------------------------\n");
printf("Current Login User Listing (by malltb.com juniac)\n");
printf("-------------------------------------------------\n");
printf("WHEN\t\t WHO\t\tLogin from\n");
while((fp = getutent()) != NULL) {
if(fp->ut_type == USER_PROCESS) {
current_time = localtime(&fp->ut_time);
printf("%d-%02d-%02d %02d:%02d %-10s\t%s\n",
current_time->tm_year + 1900,
current_time->tm_mon + 1,
current_time->tm_mday,
current_time->tm_hour,
current_time->tm_min,
fp->ut_user,
fp->ut_host);
}
}
}
FUNCTION=`echo $1 | sed -e 's/_/-/g'`
w3m -o confirm_qq=false http://kr.php.net/manual/en/function.${FUNCTION}.php
CREATE TABLE `banners` (
`id` int(10) unsigned NOT NULL auto_increment,
`type` enum('TEXT','BOLDTEXT','IMAGE','FLASH','VIDEO') NOT NULL default 'TEXT',
`title` char(100) NOT NULL,
`filename` varchar(50) default NULL,
`filesize` varchar(50) default NULL,
`location` enum('main','mainL','mainR','topCH','topKEY','channel','video','search') NOT NULL,
`url` char(200) NOT NULL,
`description` char(100) NOT NULL,
`state` enum('SHOW','HIDDEN') NOT NULL default 'HIDDEN',
`created` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id`),
KEY `state` (`state`)
) ENGINE=MyISAM AUTO_INCREMENT=54 DEFAULT CHARSET=utf8;
$tmp = "/home/storage/tmp/";
$video_id = 5188801;
$target_dir = $tmp . $video_id . '/';
$source_file = $target_dir . $video_id;
$movie = new ffmpeg_movie($source_file);
$total_frames = $movie->getFrameCount();
$per_frame = round($total_frames / 6);
$start_frame = $per_frame / 2;
for ($i = $start_frame; $i < $total_frames; $i = $i + $per_frame) {
$count++;
if ($count > 6) {
break;
}
$frame = $movie->getFrame($i);
$frame->resize(400, 300);
$GDimage = $frame->toGDImage();
$filename = $target_dir . sprintf("%04d", $count) . '.png';
imagepng($GDimage, $filename);
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>juniac.aqua.kakaka.org</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://www.juniac.net/js/prototype.js"></script>
<script type="text/javascript" src="http://www.juniac.net/js/scriptaculous.js"></script>
<script type="text/javascript" src="http://www.juniac.net/js/html_object.js"></script>
<script type="text/javascript">
</script>
</head>
<body>
if (token.indexOf('#') > -1) {
// Token is an ID selector
var bits = token.split('#');
var tagName = bits[0];
var id = bits[1];
var element = document.getElementById(id);
if (tagName && element.nodeName.toLowerCase() != tagName) {
// tag with that ID not found, return false
return new Array();
}
// Set currentContext to contain just this element
currentContext = new Array(element);
continue; // Skip to next token
}









