Skip to content

Instantly share code, notes, and snippets.

LONG GetCurrentTopology(DISPLAYCONFIG_TOPOLOGY_ID& currentTopology)
{
LONG lRet = ERROR_SUCCESS;
UINT32 numPathInfoArrayElements = 0;
UINT32 numModeInfoArrayElements = 0;
DISPLAYCONFIG_PATH_INFO emptyPathInfo = { 0 };
DISPLAYCONFIG_MODE_INFO emptyModeInfo = { 0 };
std::vector<DISPLAYCONFIG_PATH_INFO> vecDisplayConfigPathInfo;
std::vector<DISPLAYCONFIG_MODE_INFO> vecDisplayConfigModeInfo;
currentTopology = DISPLAYCONFIG_TOPOLOGY_FORCE_UINT32;
@fknaopen
fknaopen / gist:c6bf598c843450f21fe5457da707d562
Created December 8, 2016 15:21
JR-100 BASIC: TINY SPACE MOUSE
10 REM \8E\8E TINY SPACE MOUSE \8E\8E
20 POKE18,$2F:POKE19,$FF:OPTIONCMODE1:GOTO250
30 REM ----MAIN
40 PICKK:BEEP1:BEEP0:IFK=0GOTO80
50 IFK=$47 GOSUB120:GOTO80
60 X1=(K=$42)-(K=$56):P=PEEK(X+X1):IFP>$83GOSUB220
70 POKEX,$80:X=X+X1:POKEX,$4A
80 Z=RND(20):POKE$3F07,Z:U=USR($306D):IFRND(N)=0POKE$C103+Z,$88
85 U=USR($320A):W=W-(W>0):IF(W>1)*(W<5) POKE1,$70
90 T=T+1:LOCATET/83,0:PRINT" ";:IF(PEEK($3FF0)=1)+(T>1750)GOTO440
// Game start
var __beginTime = new Date().getTime();
var __dump = new Array(15).fill(0);
var __stopper = function (id) {
var elapsed = new Date().getTime() - __beginTime;
__dump[id] ++;
return elapsed < 0;
};
@fknaopen
fknaopen / reverse_read_rbuf.c
Created April 27, 2013 16:15
リングバッファを逆向きに読みたい時のおぼえがき。 主にログファイル用リングバッファを新しい順に読むときに使うかな・・・
/*
* read reverse ring-buffer
*/
#include <stdio.h>
#include <string.h>
#define MAX_BUF (16)
struct ring_t {
int head; // now data
@fknaopen
fknaopen / beagle_rw_usr1.js
Created May 17, 2012 17:59
(node.js on beagle board) enables usr1-LED
// beagle board
// change trigger usr1-LED
var fs = require('fs');
function led_read() {
fs.readFile('/sys/class/leds/beagleboard::usr1/trigger', 'utf-8',
function(err,data) {
if (err) {
return console.log(err);
} else {
@fknaopen
fknaopen / webgit.sh
Created May 15, 2012 11:24
git instaweb launcher
#!/bin/sh
#===============================================================================
# [webgit.sh]
# git-repoを一時的にwebに公開するscript
#
# git-repoの存在するサーバマシン上で実行できます
# ※ git-repoのweb参照が不要になったら必ず終了させてください
#
# 起動: git管理下にあるディレクトリ上で webgit.sh start
# --> 表示されたURLにて参照できます
@fknaopen
fknaopen / gist:1475347
Created December 14, 2011 05:08
od octal dump viewing User-friendly
od -v -t x1z -Ax
$ od -v -t x1z -Ax b.out
000000 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 >.ELF............<
000010 02 00 03 00 01 00 00 00 60 83 04 08 34 00 00 00 >........`...4...<
000020
@fknaopen
fknaopen / func_cut_cgi.c
Created December 14, 2011 04:48
get cgi-name from URL
#include <stdio.h>
#include <string.h>
/*------------------------------------------------------------------------------*/
/*
* @brief get cgi(included "/" ) from URL (URL文字列からcgi名('/'を含む)を取得)
* @param [in] in URL-strings
* @retval *p cgi-strings
* @retval *"\0" error
@fknaopen
fknaopen / func_cut_host.c
Created December 14, 2011 04:24
Using sscanf to get hostname from URL
#include <stdio.h>
#include <string.h>
//-------------------------
// URL INFO
//-------------------------
struct xx_url_t {
char str[1024]; /* URL strings */
};