This file contains 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
class Image | |
attr_accessor :width, :height, :bitmap | |
end | |
img = Image.new | |
hexmap = nil | |
File.open('font1', 'rb') do |f| | |
data = f.read | |
img.width = data[0].ord |
This file contains 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 | |
import Image, ImageDraw, ImageFont | |
import struct | |
font_width = 16 | |
font = ImageFont.truetype("/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc", font_width) | |
def get_font_data(char): |
This file contains 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
{ | |
"debug": { | |
"resourceMap": { | |
"friendlyVersion": "v1.8-HM", | |
"media": [ | |
{ | |
"defName": "PUG", | |
"file": "images/pug.png", | |
"type": "png" | |
}, |
This file contains 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 | |
import Image, ImageDraw, ImageFont | |
import struct | |
font_width = 16 | |
font = ImageFont.truetype("/usr/share/fonts/truetype/wqy/wqy-zenhei.ttc", font_width) | |
def get_font_data(char): |
This file contains 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 | |
# coding=utf-8 | |
import argparse | |
import freetype | |
import os | |
import re | |
import struct | |
import sys | |
import itertools | |
from math import ceil |
This file contains 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
$ ./waf configure | |
Waf: The wscript in 'c:\\Users\\SouthWolf\\pebble\\sdk\\watches\\segment_six' is | |
unreadable | |
Traceback (most recent call last): | |
File "c:\Users\SouthWolf\pebble\sdk\watches\segment_six\waf-1.7.0-9334f7e963be | |
e5410f4fa28728feffdd\waflib\Scripting.py", line 87, in waf_entry_point | |
set_main_module(Context.run_dir+os.sep+Context.WSCRIPT_FILE) | |
File "c:\Users\SouthWolf\pebble\sdk\watches\segment_six\waf-1.7.0-9334f7e963be | |
e5410f4fa28728feffdd\waflib\Scripting.py", line 112, in set_main_module | |
Context.g_module=Context.load_module(file_path) |
This file contains 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 <string.h> | |
#include <ctype.h> | |
#include <SoftwareSerial.h> | |
// the Bluetooth Shield connects to Pin D9 & D10 | |
SoftwareSerial bt(9,10); | |
const uint8_t req[5] = {0x00, 0x01, 0x00, 0x11, 0x00}; | |
const uint8_t cap[17] = {0x00, 0x0d, 0x00, 0x11, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32}; | |
const uint8_t ping[9] = {0x00, 0x05, 0x07, 0xd1, 0x00, 0xde, 0xad, 0xbe, 0xef}; |
This file contains 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 <string.h> | |
#include <ctype.h> | |
const uint8_t req[5] = {0x00, 0x01, 0x00, 0x11, 0x00}; | |
const uint8_t cap[17] = {0x00, 0x0d, 0x00, 0x11, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32}; | |
const uint8_t ping[9] = {0x00, 0x05, 0x07, 0xd1, 0x00, 0xde, 0xad, 0xbe, 0xef}; | |
const uint8_t sms[23] = {0x00, 0x13, 0x0b, 0xb8, 0x01, 0x01, 0x41, 0x01, 0x42, 0x0d, 0x31, 0x33, 0x37, 0x36, 0x34, 0x36, 0x36, 0x36, 0x35, 0x39, 0x30, 0x30, 0x30}; | |
//uint8_t serialMessage[200]; | |
int index = 0; |
This file contains 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
int _tmain(int argc, _TCHAR* argv[]) | |
{ | |
FILE *in_fp; | |
int frameNum = 10000; | |
Uint32 screenWidth = 0, screenHeight = 0; | |
Uint32 frameSize = 0; | |
Uint8 *frame, *displayFrame; | |
SDL_RWops *handle = nullptr; | |
Uint32 readStart, readEnd, readTime, showStart, showEnd, showTime; |
This file contains 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
while (!done) | |
{ | |
if (SDL_WaitEvent(&event)) | |
{ | |
switch (event.type) | |
{ | |
case SDL_QUIT: | |
view.interrupt(); | |
decode.interrupt(); | |
done = 1; |
OlderNewer