Skip to content

Instantly share code, notes, and snippets.

View chchwy's full-sized avatar

Matt Chia-wen Chang chchwy

View GitHub Profile
@chchwy
chchwy / 216-ac.cpp
Last active June 2, 2022 06:33
Leetcode-216-combination-3
// 216. Combination Sum III
// https://leetcode.com/problems/combination-sum-iii/
class Solution {
public:
void backtrack(vector<int>& path, int next, int k, int n, vector<vector<int>>& combinations) {
if (path.size() == k) {
int sum = 0;
@chchwy
chchwy / bgfx_asmjs.txt
Created October 29, 2018 22:30
Linking errors from compiling bgfx to asm.js
D:\emsdk>emsdk activate latest
Writing .emscripten configuration file to user home directory C:\Users\Matt/
The Emscripten configuration file C:\Users\Matt\.emscripten has been rewritten with the following contents:
import os
LLVM_ROOT='D:/emsdk/clang/e1.38.15_64bit'
EMSCRIPTEN_NATIVE_OPTIMIZER='D:/emsdk/clang/e1.38.15_64bit/optimizer.exe'
BINARYEN_ROOT='D:/emsdk/clang/e1.38.15_64bit/binaryen'
NODE_JS='D:/emsdk/node/8.9.1_64bit/bin/node.exe'
PYTHON='D:/emsdk/python/2.7.13.1_64bit/python-2.7.13.amd64/python.exe'
"D:/Github/pencil/app/../bin/plugins/ffmpeg.exe"
OutFile: "C:/Users/Matt/Desktop/hey4.mp4"
Audio Length = 110.083 seconds
TempAudio= "C:/Users/Matt/AppData/Local/Temp/Pencil2D-p0gajk/tmpaudio0.wav"
"\"D:/Github/pencil/app/../bin/plugins/ffmpeg.exe\" -f image2pipe -vcodec bmp -framerate 12 -start_number 1 -i - -threads 16 -s 640x480 -pix_fmt yuv420p -y \"C:/Users/Matt/Desktop/hey4.mp4\""
[ffmpeg] "ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers"
[ffmpeg] " built with gcc 7.2.0 (GCC)"
[ffmpeg] " configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enab
"D:/Github/pencil2d/app/../bin/plugins/ffmpeg.exe"
OutFile: "C:/Users/Matt/Desktop/hey2.gif"
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00001.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00002.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00003.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00004.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00005.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00006.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00007.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00008.png" , Success= true
"D:/Github/pencil2d/app/../bin/plugins/ffmpeg.exe"
OutFile: "C:/Users/Matt/Desktop/hey2.mp4"
Audio Length = 110.083 seconds
TempAudio= "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/tmpaudio0.wav"
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00001.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00002.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00003.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00004.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00005.png" , Success= true
Save img to: "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/test_img_00006.png" , Success= true
"D:/Github/pencil/app/../bin/plugins/ffmpeg.exe"
OutFile: "C:/Users/Matt/Desktop/hey.gif"
"\"D:/Github/pencil/app/../bin/plugins/ffmpeg.exe\" -f image2pipe -vcodec bmp -framerate 12 -start_number 1 -i - -y -s 640x480 -filter_complex \"[0:v]palettegen [p]; [0:v][p] paletteuse\" \"C:/Users/Matt/Desktop/hey.gif\""
[ffmpeg] "ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers"
[ffmpeg] " built with gcc 7.2.0 (GCC)"
[ffmpeg] " configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va
"D:/Github/pencil/app/../bin/plugins/ffmpeg.exe"
OutFile: "C:/Users/Matt/Desktop/hey.mp4"
Audio Length = 110.083 seconds
TempAudio= "C:/Users/Matt/AppData/Local/Temp/Pencil2D-l9Mfi9/tmpaudio0.wav"
ASSEMBLE AUDIO = 0.0
"\"D:/Github/pencil/app/../bin/plugins/ffmpeg.exe\" -f image2pipe -vcodec bmp -framerate 12 -start_number 1 -i - -threads 16 -s 640x480 -pix_fmt yuv420p -y \"C:/Users/Matt/Desktop/hey.mp4\""
[ffmpeg] "ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers"
[ffmpeg] " built with gcc 7.2.0 (GCC)"
[ffmpeg] " configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib
@chchwy
chchwy / .gitignore
Last active September 3, 2020 05:33
UVa Online Judge
*.exe
*.orig
list.txt
@chchwy
chchwy / upload.cpp
Created September 20, 2017 02:10 — forked from creativepsyco/upload.cpp
Upload File + Callback
#include <stdio.h>
#include <iostream>
#include <string>
#include <curl/curl.h>
using namespace std;
static string data;
size_t writeCallback(char *buf, size_t size, size_t nmemb, void *up)
{
sceneManager->setAmbientLight( Ogre::ColourValue( 0.3f, 0.5f, 0.7f ) * 0.1f * 0.75f,
Ogre::ColourValue( 0.6f, 0.45f, 0.3f ) * 0.065f * 0.75f,
-light->getDirection() + Ogre::Vector3::UNIT_Y * 0.2f );