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
| require 'watir' | |
| ie = Watir::IE.new | |
| while 1 do | |
| ie.goto('http://www.douban.com/update/') | |
| sleep 300 | |
| 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
| <html><head><meta http-equiv="Content-Type" content="text/html; charset=GBK"> | |
| <script language="Javascript"> | |
| <!-- | |
| /***************************************************************************** | |
| 个人首选 | |
| *****************************************************************************/ | |
| var conWeekend = 3; // 星期六颜色显示: 1=黑色, 2=绿色, 3=红色, 4=隔周休 |
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 <stdlib.h> | |
| #include <unistd.h> | |
| #include <stdio.h> | |
| #include <fcntl.h> | |
| #include <linux/fb.h> | |
| #include <sys/mman.h> | |
| #include <sys/ioctl.h> | |
| int main() | |
| { |
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 QtQuick 2.0 | |
| import QtWebKit 3.0 | |
| import QtQuick.XmlListModel 2.0 | |
| Rectangle { | |
| id: container | |
| width: 1024 | |
| height: 768 | |
| property string initialUrl: "http://127.0.0.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
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| # | |
| import os | |
| import os.path | |
| import sys | |
| import time | |
| import glob | |
| FILE_EXT_FILTERS = ('.h', '.cpp', '.c') |
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
| all_line_objs = Array.new() | |
| FIELD_SPLITTER = ' ' #change to '\t', ',', ':' as you need; | |
| FIELD_INDEX = 1 #Start from 0; | |
| FIELD_TYPE = "number" #number or string; | |
| File.open(ARGV[0]).each { |line| | |
| fields = line.strip.split(FIELD_SPLITTER) | |
| field = fields[FIELD_INDEX] | |
| line_obj = {field:field, line:line.strip} |
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
| FIELD_SPLITTER = ' ' #change to '\t', ',', ':' as you need; | |
| FIELD_CUT_INDEXS = [0] #Start from 0; | |
| File.open(ARGV[0]).each { |line| | |
| fields = line.strip.split(FIELD_SPLITTER) | |
| cut_fields = [] | |
| FIELD_CUT_INDEXS.each{ |index| | |
| field = fields[index] | |
| cut_fields.push( field ) | |
| } |
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
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| # | |
| import os | |
| import os.path | |
| import sys | |
| import shutil | |
| def copy_directory_tree( base_dir, rel_path_list_file, to_dir ): | |
| rel_path_list = [line.strip() for line in open(rel_path_list_file, 'r')] |
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
| static SDL_Surface * convert_EAISurface_to_SDLSurface(SDL_Surface * screen, EA::Raster::ISurface* easurface, int x, int y, int w, int h){ | |
| int stride = easurface->GetStride(); | |
| typedef uint8_t Uint8; | |
| Uint8 *bits = (Uint8*)easurface->GetData() + y*stride + x*4; | |
| //The following code is mainly from "D:\SDL-1.2.15\test\testbitmap.c"(18,14):SDL_Surface *LoadXBM(SDL_Surface *screen, int w, int h, Uint8 *bits) | |
| SDL_Surface *bitmap; | |
| Uint8 *line; | |
| /* Allocate the bitmap */ |
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
| #ifdef _DEBUG | |
| #ifdef _WIN32 | |
| #define dprintf(format,...) fprintf(stdout, "%s:%d:%s " format , __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__) | |
| #else | |
| //gcc: | |
| #define dprintf(format, args...) fprintf(stdout, "%s:%d:%s " format, __FILE__, __LINE__, __FUNCTION__, ## args) | |
| #endif | |
| #else | |
| #define dprintf(format, args...) | |
| #endif |