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
| //typedef's to adapter to struct BMP_FILEHDR & BMP_INFOHDR; | |
| typedef unsigned char UINT8; | |
| typedef signed char SINT8; | |
| typedef unsigned short UINT16; | |
| typedef signed short SINT16; | |
| typedef unsigned int UINT32; | |
| typedef signed int SINT32; | |
| //struct BMP_FILEHDR & BMP_INFOHDR defines are copied from Win32 .h files; | |
| struct BMP_FILEHDR // BMP file header |
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<cassert> | |
| #include<cstdio> | |
| #include<string> | |
| #include<map> | |
| using namespace std; | |
| std::wstring string2wstring(const std::string& s) | |
| { | |
| int len; | |
| int slength = (int)s.length() + 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
| // This works by converting the SVG arc to "simple" beziers. | |
| // Partly adapted from Niko's code in kdelibs/kdecore/svgicons. | |
| // See also SVG implementation notes: http://www.w3.org/TR/SVG/implnote.html#ArcConversionEndpointToCenter | |
| bool decomposeArcToCubic(float angle, float rx, float ry, FloatPoint& point1, FloatPoint& point2, bool largeArcFlag, bool sweepFlag, | |
| std::vector<FloatPoint>& v1, std::vector<FloatPoint>& v2, std::vector<FloatPoint>& v | |
| ) | |
| { | |
| FloatSize midPointDistance = point1 - point2; | |
| midPointDistance.scale(0.5f); |
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<iostream> | |
| using namespace std; | |
| struct Node { | |
| int key; | |
| Node *next; | |
| }; | |
| Node * reverseList(Node *pHead){ | |
| /* |
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 SimpleHTTPServer | |
| import BaseHTTPServer | |
| import time | |
| import SocketServer | |
| import os | |
| import threading | |
| import socket | |
| PORT = 8888 |
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 SimpleHTTPServer | |
| import BaseHTTPServer | |
| import time | |
| import SocketServer | |
| import os | |
| import threading | |
| import socket | |
| PORT = 8888 |
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 ruby | |
| # encoding: utf-8 | |
| # | |
| #Usage: ruby files_content_replace.rb <filePathLists.txt> | |
| File.open(ARGV[0]).each { |filePath| | |
| correctedFileContentLines = [] | |
| f = File.open(filePath.strip) | |
| f.each { |line| | |
| line2 = line.gsub("old text", "new text") |
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 void saveSkBitmapToBMPFile(const SkBitmap& skBitmap, const char* path) | |
| { | |
| typedef unsigned char UINT8; | |
| typedef signed char SINT8; | |
| typedef unsigned short UINT16; | |
| typedef signed short SINT16; | |
| typedef unsigned int UINT32; | |
| typedef signed int SINT32; | |
| struct BMP_FILEHDR // BMP file header |
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 SimpleHTTPServer | |
| import BaseHTTPServer | |
| import time | |
| import SocketServer | |
| import os | |
| import threading | |
| import socket | |
| PORT = 8888 |
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 os | |
| import sys | |
| import time | |
| PROCESS_NAME = u"Thunder.exe" | |
| PROCESS_STARTUP_CMDLINE = 'E:\ThunderPortable\ThunderPortable.exe' | |
| def win32app_not_running(): | |
| from win32com.client import GetObject | |
| #Need download http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win32-py2.7.exe/download |