網頁

2016年11月23日 星期三

GitHub 操作

Last Update: 2016/11/23 23:54+08



下載GitHub Client
-> Git Shell
-> forward 到有 .git 的資料夾
-> 一般Git操作


2016年10月16日 星期日

C / C++ Memory Op

Last Update: 2016/10/16 20:53+08



void *malloc(size_t size); // stdlib.h
void free(void *pmem); // stdlib.h
void * memcpy ( void * destination, const void * source, size_t num );

2016年10月15日 星期六

Coding Conventions

Last Update: 2016/10/16 02:24+08



C Coding Conventions
struct foo_t{
 int my_var;
 void my_func(){}
}


Java Coding Conventions
class Foo{
 int myVar;
 void myFunc(){}
}


C# Coding Conventions
class Foo{
 int MyVar;
 void MyFunc(){}
}


My Coding Conventions (Java)
class Foo{
 int myVar;
 void myFunc(){}
}
在寫程式時, 我比較在意是否可以一眼區分出class or variable


2016年9月19日 星期一

C 檔案操作

Last Update: 2016/09/19 20:57+08



fopen, fclose
開檔, 關檔


fget, fput
讀取/寫入一字串

fread, fwrite
讀取/寫入一byte

fscanf, fprintf
格式化讀取/寫入一字串





2016年9月7日 星期三

Altera Quartus [Note] [Macro] Altera PLL

Last Update: 2016/09/07 23:27+08



點擊PLL後


照下述可設定2組CLOCK


Reference
Phase-Locked Loop Basics

Java GUI with Eclipse - Windows Builder

Last Update: 2016/09/07 21:43+08



http://download.eclipse.org/windowbuilder/WB/release/R201309271200/4.3/

Interface & Abstract

Last Update: 2016/09/07 21:42+08



Assume
that with interface you mean a C++ class with only pure virtual methods (i.e. without any code),
instead with abstract class you mean a C++ class with virtual methods that can be overridden, and some code, but at least one pure virtual method that makes the class not instantiable.
class MyInterface
{
public:
  // Empty virtual destructor for proper cleanup
  virtual ~MyInterface() {}

  virtual void Method1() = 0;
  virtual void Method2() = 0;
};


class MyAbstractClass
{
public:
  virtual ~MyAbstractClass();

  virtual void Method1();
  virtual void Method2();
  void Method3();

  virtual void Method4() = 0; // make MyAbstractClass not instantiable
};

[Troubleshooting] IIS 與 dotNet MVC

Late Update: 2015/08/19 02:38+08


去C槽 Windows\Microsoft.NET\Framework\ 找出自己4.0版本
cd C:\Windows\Microsoft.NET\Framework\v4.xxx.xxx
aspnet_regiis -i


<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>

2016年9月6日 星期二

Terasic DE1-SoC [Note] Configuration Mode Switch

Last Update: 2016/09/07 21:31+08



預設


設定說明


常用模式




Google Prettify @ Blogger

Last Update: 2016/09/09 00:34+08



Google Prettify


Blogger->版面配置->新增小工具->HTML/Javascript小工具->貼上代碼
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>


追加水平捲軸
pre.prettyprint{
    width: auto;
    overflow: auto;
    max-height: 600px
}



Terasic DE1-SoC [Note] HPS Makefile

Last Update: 2016/09/09 00:24+08



fatal error: socal/socal.h: No such file or directory
修正makefile, 將下面這行
CFLAGS = -static -g -Wall  -I${SOCEDS_DEST_ROOT}/ip/altera/hps/altera_hps/hwlib/include
取代成
ALT_DEVICE_FAMILY ?= soc_cv_av
HWLIBS_ROOT = ${SOCEDS_DEST_ROOT}/ip/altera/hps/altera_hps/hwlib
CFLAGS = -static -g -Wall $(MULTILIBFLAGS) -I${HWLIBS_ROOT}/include -I${HWLIBS_ROOT}/include/soc_cv_av -D$(ALT_DEVICE_FAMILY)



2016年3月22日 星期二

Arduino SPI

Last Update: 2016/3/22 23:02+08



SPCR = SPI Control Register
SPSR = SPI status register
SPDR = SPI data register
參考
Interfacing a Serial EEPROM Using SPI
Arduino對接測試



2016年3月9日 星期三

電子電路名詞

Last Update: 2016/03/09 00:03+08
Type: Note



Vcc: c=circuit
Vdd: d=device
Vss: s=series共通連接
Gnd: 接地
AGnd: 類比接地



TTL & RS232

Last Update: 2016/03/09 23:15+08
Type: Note



TTL 與 RS232 電位邏輯相反
TTL high = RS232 low = 1
TTL low = RS232 high = 0



TTL 是電壓位準的規範 Wiki
輸入電壓準位
Hi > 2.2V
Low < 0.8V
輸出電壓準位
Hi > 2.6V
Low < 0.4V



而RS232比較像是在定義接腳 Wiki
在電位上的定義
邏輯1 = -3 ~ -15 V
邏輯0 = 3 ~ 15 V
電位在邏輯上是相反的
且它是把接近零的電位視為無效
而遠離零的才有效的
所以不用太在意 3.3v, 5v 還是 12v

只是要注意一般電路是用TTL(0v~5v)
若要轉到 RS232, 可以用MAX232, MAX3232, 或自己用電晶體來完成



2016年3月7日 星期一

Arduino - Get Started

Last Update: 2016/03/08 13:44+08



Intro

官網 下載軟體(含驅動)
解壓縮到你喜歡的地方



2016年2月29日 星期一

Quaternion 四元數 - Create by Axis & Angle

Last Update: 2016/4/16 19:00+08
Type: Note



q = a + bi + cj + dk = a + v
讓空間表示、運算和旋轉都變簡單的東西



2016年2月9日 星期二

Python - List

Last Update: 2016/02/09 21:28+08



Intro


List 宣告方法
my_list = [0,1,2,3,4,5,6,7,8,9]

P.S. 陣列物件: numpy.array



Python - Dictionary

Last Update: 2016/02/09 20:44+08



Intro


Dictionary (字典) 宣告 axis=x, 為第 x 維度合併
dict = {"a": 1, "b": 2, "c":3}
dict = {} #可宣告空 Dictionary 



Python - Array

Last Update: 2016/02/09 17:59+08



Intro


Python 陣列的相關用法(廢話XD
a = numpy.array([0,1,2,3,4,5,6,7,8,9])

P.S. list() 物件



2016年2月8日 星期一

Python - Package, Module & Class

Last Update: 2016/02/08 21:22+08



Package, Module & Class
Python是以資料夾結構來定義程式結構
資料夾=Package (or namespace)
檔案.py=Module
在檔案裡宣告Class
from package01.package02.module01 import class01

Package(資料夾) 底下通常會有個 __init__.py 檔案
是載入Package時會執行的敍述, 一般令其為空的就可以了
Class 宣告
Class 的建構子為 __init__
必帶 self 同等 this
欄位宣告如下
class DataSet:
    def __init__(self):
        self.train = numpy.array([[]])
        self.train_taget = numpy.array([[]])
        self.test = numpy.array([])
        self.test_target = numpy.array([])