Skip to content

Instantly share code, notes, and snippets.

View TSKGunGun's full-sized avatar
💭
I may be slow to respond.

Suguru Ueda TSKGunGun

💭
I may be slow to respond.
View GitHub Profile
@TSKGunGun
TSKGunGun / override
Last active August 29, 2015 14:07
override修飾子をつかってみた
#include<string>
using namespace std;
namespace Hogehoge{
//@super class
class SuperClass
{
public :
string Func( int n ){
return "SuperFunc";
@TSKGunGun
TSKGunGun / Variant in Lopp
Created October 21, 2014 23:23
ループ内変数について
#include<string.h>
using namespace std;
void function(){
//ループ内で変数を宣言する
for( int ii(0); ii < 0; ii++ ){
string str = _T("IN")
}
/*スコープが狭い
@TSKGunGun
TSKGunGun / Effective C++ 27項
Last active August 29, 2015 14:07
型の変換
class Base{};
class Derived:public Base{}; //Baseクラスの継承
void main(void){
int A(0);
double D = double(A); //Cスタイルのキャスト
double D2 = static_cast<double>(A); //C++スタイルのキャスト
Derived d;
Base* pBase = &d; //暗黙の型変換( Derived*をBase*にしている)
@TSKGunGun
TSKGunGun / Effecttive C++ 32項
Created October 23, 2014 12:12
publicのis-a関係
class Person{};
class Student : public Person{};
void eat( cost Person& rPerson ); //人が食べる関数(人はみな食べる)
void study( const Student& rStudent ); //学生が勉強する関数(学生は勉強する)
Person P;
Student S;
eat( P ); //人は食べる
@TSKGunGun
TSKGunGun / VisualC++だけのキーワード Sealedについて
Last active August 29, 2015 14:10
オーバーライドを防ぐ仕組み
//VisualStudio2010で確認
#include "stdafx.h"
class CHoge
{
public:
CHoge(){}
protected:
@TSKGunGun
TSKGunGun / NETTEST.cls
Last active June 15, 2016 21:36
VBAで.NETが使えるか検証するコード
Public Sub NETTest()
Dim A As Object
Set A = CreateObject("System.Collections.ArrayList")
End Sub
@TSKGunGun
TSKGunGun / kindle_unlimited_list.rb
Created November 27, 2016 12:03
RubyでAmazon APIを使ってKindle Unlimited本の一覧を取得
# coding: UTF-8
require 'rubygems'
require 'amazon/ecs'
Amazon::Ecs.options = {
:associate_tag => [Amazonアソシエイトタグ],
:AWS_access_key_id => [AWSアクセスキーID],
:AWS_secret_key => [AWSシークレットキー]
}
@TSKGunGun
TSKGunGun / RedisSample.cs
Created December 14, 2016 11:26
StackExchange.Redis Sample
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StackExchange.Redis;
namespace Redis_CSharp_Sample
{
class Program
@TSKGunGun
TSKGunGun / VBASampleAddin.cs
Created December 15, 2016 23:52
VBAでC#のdllを使うサンプル
using System;
using System.Text;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace VBA_SampleAddin
{
[ComVisible(true)]
public interface IVBA_Addin
{
@TSKGunGun
TSKGunGun / # vim - 2017-01-05_17-32-43.txt
Created January 5, 2017 08:34
vim on macOS 10.11.6 - Homebrew build logs
Homebrew build logs for vim on macOS 10.11.6
Build date: 2017-01-05 17:32:43