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
// gcc -o try-catch-ex try-catch.c try-catch-ex.c | |
#include <stdio.h> | |
#include "try-catch.h" | |
// Example of use for try-catch.h | |
int main(int argc, char *argv[]) | |
{ | |
int i = 101; | |
printf("before try block...\n"); |
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
<?xml version="1.0"?> | |
<opencv_storage> | |
<qrcode type_id="opencv-haar-classifier"> | |
<size> | |
48 48</size> | |
<stages> | |
<_> | |
<!-- stage 0 --> | |
<trees> | |
<_> |
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
/*The win32 service runs with its current working directory set to C:\Windows\System32 | |
*You might need to place anyrun-time configuration scripts there. | |
*If you run into any confusion with the above detail, it is worthwhile to | |
*set the current working directory to your application installation directory like I did | |
*/ | |
MyApp::OnInit() | |
{ | |
// | |
// |
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 | |
# -*- coding: utf-8 -*- | |
# | |
# Make an iOS project transportable so that it can be zipped and | |
# sent to another machine | |
# | |
import os, sys, shutil, codecs, glob | |
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) |
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
public Bitmap GetBitmap(BitmapSource source) | |
{ | |
Bitmap bmp = new Bitmap | |
( | |
source.PixelWidth, | |
source.PixelHeight, | |
System.Drawing.Imaging.PixelFormat.Format32bppPArgb | |
); | |
BitmapData data = bmp.LockBits |
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
/* | |
* 無圧縮AVIファイル"input.avi"を | |
* GUIで選択した圧縮形式で圧縮して、"output.avi" に出力するだけのプログラム | |
*/ | |
#include <Windows.h> | |
#include <tchar.h> | |
#include <Vfw.h> | |
#pragma comment(lib, "vfw32.lib") | |
#include <GdiPlus.h> |
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 "dwmswitch.h" | |
void ShowLastError(void){ | |
LPVOID lpMessageBuffer; | |
FormatMessage( | |
FORMAT_MESSAGE_ALLOCATE_BUFFER | | |
FORMAT_MESSAGE_FROM_SYSTEM, | |
NULL, | |
GetLastError(), |
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
/* $ gcc -Wall -g [-DDEBUG] curl_writefunction.c -lcurl */ | |
/* $ ./a.out [URL] */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <curl/curl.h> | |
#define BUFFER_MAX 0x10000 | |
size_t write_length = 0; |
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 time | |
def bench(fn): | |
begin = time.time() | |
fn() | |
return time.time() - begin | |
n = 100000 | |
def setwork(cl): | |
for i in range(0, n): |
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 "mkmf" | |
$libs += " -lstdc++ " | |
create_makefile("human") |
OlderNewer