網頁

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([])



2016年1月31日 星期日

Python - PIP

Last Update: 2016/1/31 20:51+08



Intro

PIP 使用記事


2016年1月27日 星期三

IPython

Last Update: 2016/1/27 09:46+08



Intro


安裝
#Python
python-dev
#Python3 - pip3
sudo apt-get install -y python3-pip
sudo pip3 install jupyter
#Python2 - pip
sudo apt-get install python-pip
sudo pip install jupyter 

#執行
jupyter notebook --no-browser --ip=0.0.0.0 --port=8888



2016年1月26日 星期二

Python - 零碎記事

Last Update: 2016/1/27 01:37+08



Intro

零碎的Python記事



2016年1月16日 星期六

Linux RDP

Last Update: 2016/01/16 19:36+08



gnome
在14.04 沒成功
sudo apt-get install xrdp
sudo apt-get update
sudo apt-get install gnome-session-fallback
echo gnome-session --session=gnome-fallback > ~/.xsession
sudo service xrdp restart



xfce4
參考: http://c-nergy.be/blog/?p=5305
sudo apt-get install xrdp
sudo apt-get update
sudo apt-get install xfce4 //或可直接安裝desktop: sudo apt-get install xubuntu-desktop
echo xfce4-session >~/.xsession
sudo service xrdp restart
連不進去時, 可以去刪除 ~/.xsession-error; ~/.Xautorixxx; ~/ICExxx


LXDE
sudo apt-get install xrdp
sudo apt-get update
sudo apt-get install lxde //或可直接安裝desktop: sudo apt-get install lubuntu-desktop
echo lxsession -s Lubuntu -e LXDE > ~/.xsession
sudo service xrdp restart






遠端桌面
應用程式 > Remmina 遠端桌面客戶端
Remmina 無法連線到RDP服務器(Windows遠端桌面)
下面的指令, 每個都可以試一下
apt-get install rdesktop // or
apt-get install --reinstall rdesktop
vim ~/.freerdp/known_hosts //刪除對映IP的認證資料
rm -rf ~/.freerdp
rm -rf ~/.remmina //會刪除儲存的連線資料


Linux 軟體安裝位置

Last Update: 2016/01/16 19:00+08



Intro

看到這篇
在講Linux軟體位置 記錄一下
位置和名字是很重要的, 不信去看一本關於程式重權的畫-Refactoring
慢慢覺得Blogger變成我的記事本了 好啦XD不是重點

2016年1月15日 星期五

Google Compute Engine - SSH

Last Update: 2016/1/16 12:49+08



Intro

SSH 遠端登入 Google Compute Engine 的方法

Prepare:
PuTTYgen: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
SSH 軟體 (PuTTY or MobaXterm)



2016年1月12日 星期二

Ubuntu apt-get

Last Update: 2016/1/13 00:08+08



Intro

常用的指令
sudo apt-get install [package-name]



2016年1月11日 星期一

Linux Git

Last Update: 2016/1/11 23:18+08



Intro

Ubuntu 使用 git
安裝 git
sudo apt-get install git



Ubuntu OpenCV

Last Update: 2016/1/11 21:17+08



Intro

單純用 library 的話
sudo apt-get install libopencv-dev

其它安裝方法
基本上, 完全照著文章做, 這邊留記錄
sudo apt-get update
sudo apt-get upgrade

sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev default-jdk ant libvtk5-qt4-dev



2016年1月5日 星期二

Application Setting & User Setting

Last Update: 2016/01/05 21:46+08



Intro

Application Settings 和 User Settings 差異在
Application Settings 不能在Runtime時修改
User Settings 可以