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 <QApplication> | |
#include <QImage> | |
#include <QPainter> | |
void extend2iPhone5(const QString &filename){ | |
QImage image(filename); | |
QImage out(640, 1136, QImage::Format_ARGB32); | |
// 640x1136 is iPhone 5 (4 inches)'s screen resolution |
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
#!/bin/sh | |
# This script is used to get the online version's deb in the current folder | |
host="mi.baidu.com" | |
filename=$(curl --silent "$host/Packages" | grep --only-matching 'debs/baidu_input.*deb') | |
echo "I'm going to download $host/$filename" | |
wget "$host/$filename" |
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
static inline const char *GetClassNameCString(id obj){ | |
NSString *className = NSStringFromClass([obj class]); | |
return [className UTF8String]; | |
} | |
static void PrintSubviewToFile(UIView *view, int level, FILE *fp){ | |
for(int i=0; i<level; i++){ | |
fputc('-', fp); | |
} |
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
// assume buffer is the sound file content | |
FMOD_SOUND *sound; | |
FMOD_CREATESOUNDEXINFO info; | |
memset(&info, 0, sizeof(info)); | |
info.cbsize = sizeof(info); | |
info.length = size; | |
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
// assume buffer is the sound file content | |
FMOD_SOUND *sound; | |
FMOD_CREATESOUNDEXINFO info; | |
memset(&info, 0, sizeof(info)); | |
info.cbsize = sizeof(info); | |
info.length = size; | |
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 <QCoreApplication> | |
#include <QStringList> | |
#include <QtDebug> | |
class CompanyComparator{ | |
public: | |
CompanyComparator(bool ascend){ | |
ascend_ = ascend; | |
} |
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
#--- | |
# iPIN - iPhone PNG Images Normalizer v1.0 | |
# Copyright (C) 2007 | |
# | |
# Author: | |
# Axel E. Brzostowski | |
# http://www.axelbrz.com.ar/ | |
# axelbrz@gmail.com | |
# | |
# References: |
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
# plutil.pl 1.6 - implementation of binary/UTF-8 (text) XML conversion of plist files | |
# does not (yet) support OS X plutil command line syntax | |
# 1.0 - first public release | |
# 1.1 - added support for date Type 3; fixed real Type 2 | |
# 1.2 - fixed handling of empty arrays | |
# 1.3 - fixed handling of large strings and empty keys | |
# 1.4 - write utf8 in XML, convert as necessary on read | |
# 1.5 - read/write 8 byte integers and negative integers; handle special XML chars in dictionary keys | |
# - now requires Math::BigInt |
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 "JsonBox.h" | |
#include "lualib/lua.hpp" | |
#include <sstream> | |
static JsonBox::Value LuaValueToJsonValue(lua_State *L); | |
static JsonBox::Value LuaTableToJsonValue(lua_State *L){ | |
luaL_checktype(L, -1, LUA_TTABLE); | |
const static int key_index = -2; |
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
void Converter::convert(const QString &input, const QString &output){ | |
QList<int> list; | |
QString str="8 9 10 9 10 11 " | |
"12 13 14 13 14 15 " | |
"16 17 18 17 18 19 " | |
"12 13 14 13 14 15 " | |
"16 17 18 17 18 19 " | |
"20 21 22 21 22 23 " | |
"0 9 10 1 -1 -1 " |