Skip to content

Instantly share code, notes, and snippets.

View harujoh's full-sized avatar
💭
I'm fine.

harujoh

💭
I'm fine.
View GitHub Profile
AVFormatContext *formatC = avformat_alloc_context();
AVDictionary* options = NULL;
av_dict_set(&options,"list_devices","true",0);
AVInputFormat *iformat = av_find_input_format("dshow");
avformat_open_input(&formatC,"video=dummy",iformat,&options);
@ochilab
ochilab / showMultiTiff.cs
Last active June 19, 2019 23:59
C#でマルチページ形式のTiff画像を表示する方法(Form編)
private void showMultiTiff(string tiffFileName){
FileStream tifFS = new FileStream( tiffFileName , FileMode.Open , FileAccess.Read ) ;
Image gim = Image.FromStream( tifFS ) ;
FrameDimension gfd = new FrameDimension(gim.FrameDimensionsList[0]);
int pageCount = gim.GetFrameCount( gfd ) ;//全体のページ数を得る
System.Diagnostics.Debug.WriteLine(pageCount);
Graphics g = pictureBox1.CreateGraphics();
for(int i=0;i<pageCount;i++){
gim.SelectActiveFrame(gfd, i);
g.DrawImage(gim, 0,0, pictureBox1.Width, pictureBox1.Height);//PictureBoxに表示してます
cmake_minimum_required(VERSION 2.8.4)
project(so29595222)
find_package(PythonLibs REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
ADD_DEFINITIONS( -std=c++11 )
set(SOURCE_FILES python_threading_example_so29595222.cpp)
@DanielSWolf
DanielSWolf / Program.cs
Last active July 16, 2024 20:29
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@shigehiro-yanbe
shigehiro-yanbe / Program.cs
Last active October 4, 2018 09:40
IronPythonを利用してC#からpythonを呼んでみるテスト
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Scripting.Hosting;
using SheetType = System.Collections.Generic.List<
System.Collections.Generic.Dictionary< string, object > >;
using RecordType = System.Collections.Generic.Dictionary< string, object >;
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active July 21, 2024 08:16
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@mignonstyle
mignonstyle / markdown-cheatsheet.md
Last active July 16, 2024 03:26
Markdown記法 チートシート

Block Elements ## Headers 見出し 先頭に#をレベルの数だけ記述します。 ```

見出し1

見出し2

見出し3

見出し4

見出し5
見出し6
## 見出し2
### 見出し3
#### 見出し4
##### 見出し5
###### 見出し6 ## Block 段落 空白行を挟むことで段落となります。 ```
段落1
(空行)
段落2
``` 段落1 段落2 ## Br 改行 改行の前に半角スペース` `を2つ記述します。 ```
hoge
fuga(スペース2つ)
piyo
``` hoge
fuga piyo ## Blockquotes 引用 先頭に`&gt;`を記述します。ネストは`&gt;`を多重に記述します。 ```
&gt; 引用 &gt; 引用
&gt;&gt; 多重引用
``` &gt; 引用 &gt; 引用
&gt;&gt; 多重引用 ## Code コード `` `バッククオート` `` 3つ、あるいはダッシュ`~`3つで囲みます。 ```
print 'hoge'
``` ```
print 'hoge'
``` ### インラインコード `` `バッククオート` `` で単語を囲むとインラインコードになります。 ```
これは `インラインコード`です。
``` これは `インラインコード`です。 ## pre 整形済みテキスト 半角スペース4個もしくはタブで、コードブロックをpre表示できます ``` class Hoge def hoge print 'hoge' end end
``` class Hoge def hoge print 'hoge' end end ## Hr 水平線 アンダースコア`_` 、アスタリスク`*`、ハイフン`-`などを3つ以上連続して記述します。 ```
hoge
***
hoge
___
hoge
---
``` hoge
***
hoge
___
hoge
--- # Lists ## Ul 箇条書きリスト ハイフン`-`、プラス`+`、アスタリスク`*`のいずれかを先頭に記
@ufcpp
ufcpp / parallel.cs
Last active December 26, 2016 23:21
積和演算の並列化
using System;
using System.Diagnostics;
using System.Linq;
using System.Numerics;
using System.Threading.Tasks;
class Program
{
private const int Loops = 500;
private const int N = 4 * 1024 * 1024;
@PonDad
PonDad / imagenet_class_index.json
Created December 31, 2016 12:19
imagenetのラベルを日本語化するjsonです。
[
{
"num": "n01440764",
"en": "tench",
"ja": "テンチ"
},
{
"num": "n01443537",
"en": "goldfish",
"ja": "金魚"
@ufcpp
ufcpp / SafeCrash.cs
Last active December 21, 2017 13:14
セキュリティホール作るのに unsafe なんて要らなかった
using System;
using System.Runtime.InteropServices;
class Base { }
class Derived : Base
{
// 1個や2個だと「たまたま0詰め」な領域を指すかもしれないので無駄にたくさんフィールド並べる
public long A { get; }
public long B { get; }
public long C { get; }