PIXNET Logo登入

!壞人必需做好事!

跳到主文

@!壞人必需做好事!

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 3月 12 週二 201322:26
  • library-prebuilt-for-windows (以後只支援 mingw-w64 & msvc-11-x64) (2013/03/12更新)


現在改到UE4的Git Hub了
https://github.com/damody/UE4-ThirdParty/tree/damody
 




Donate Damody






(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(4) 人氣(1,025)

  • 個人分類:程式問題解決
▲top
  • 5月 29 週五 201517:14
  • OpenMesh與UE4的衝突

DEPRECATED
check
這兩個巨集,直接衝突~
記得要搜尋取代喔
(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(68)

  • 個人分類:程式問題解決
▲top
  • 4月 19 週六 201423:53
  • 打造自己專屬的顏色模型build color model

有人說 文學是苦悶的象徵
我說 幸福是靈感的來源
OK,這是一個場面,我要HOLD住。
 
(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(33)

  • 個人分類:程式問題解決
▲top
  • 1月 12 週日 201419:16
  • flann with radius search

上次是 knnsearch 自定義要找到最近的幾個點,
這次是找半徑內的所有點~
#include <cmath>
#include <cstdio>
#include <flann/flann.hpp>
#include <boost/timer/timer.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/generator_iterator.hpp>
#include <boost/random/mersenne_twister.hpp>
int main(int argc, char** argv)
{
    boost::random::mt19937 rng;
    boost::random::uniform_real_distribution<> uniform_rand(-10000, 10000);
    // 你要找幾個最近點用nn
    int nn = 100;
    // 資料總數
    const int rows = 30000;
    // 資料維度
    const int cols = 3;
    // 查找的位置數
    const int qsize = 2;
    double* rdata = new double[cols * rows];
    double* qdata = new double[cols * qsize];
    // 產生亂數資料
    {
        boost::timer::auto_cpu_timer t;
        for (int i = 0; i < rows; ++i)
        {
            for (int j = 0; j < cols; ++j)
            {
                rdata[i * cols + j] = uniform_rand(rng) * 0.01f;
            }
        }
        for (int i = 0; i < qsize; ++i)
        {
            for (int j = 0; j < cols; ++j)
            {
                qdata[i * cols + j] = uniform_rand(rng) * 0.01f;
                printf("%d %f\n", i * cols + j, qdata[i * cols + j]);
            }
        }
    }
    // 初始化
    flann::Matrix<double> dataset(rdata, rows, cols);
    flann::Matrix<double> query(qdata, qsize, cols);
    flann::Matrix<int> indices(new int[query.rows * nn], query.rows, nn);
    flann::Matrix<double> dists(new double[query.rows * nn], query.rows, nn);
    // construct an randomized kd-tree index using 4 kd-trees
    flann::Index<flann::L2<double> > index(dataset, flann::KDTreeIndexParams(1));
    {
        boost::timer::auto_cpu_timer t;
        index.buildIndex();
    }
    int res = 0;
    printf("index.knnSearch\n");
    {
        boost::timer::auto_cpu_timer t;
        res = index.radiusSearch(query, indices, dists, 100, flann::SearchParams());
    }
    for (int i = 0; i < 2; ++i)
    {
        for (int j = 0; j < nn; ++j)
        {
            int idx = indices[i][j];
            if (idx > 0)
            {
                printf("index:%d distance:%.2f position:(%.2f, %.2f, %.2f)\n",
                       idx, dists[i][j], rdata[idx * cols], rdata[idx * cols + 1],
                       rdata[idx * cols + 2]);
            }
            else // idx == -1
            {
                break;
            }
        }
    }
    delete[] dataset.ptr();
    delete[] query.ptr();
    delete[] indices.ptr();
    delete[] dists.ptr();
    return 0;
}
(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(54)

  • 個人分類:程式問題解決
▲top
  • 1月 09 週四 201421:39
  • 使用 flann & kdtree 簡易範例


#include <cmath>
#include <cstdio>
#include <flann/flann.hpp>
int main(int argc, char** argv)
{
    // 你要找幾個最近點用nn
    int nn = 3;
    // 資料總數
    const int rows = 9000;
    // 資料維度
    const int cols = 3;
    // 查找的位置數
    const int qsize = 2;
    float* rdata = new float[cols * rows];
    float* qdata = new float[cols * qsize];
    // 產生亂數資料
    for (int i = 0; i < rows; ++i)
    {
        for (int j = 0; j < cols; ++j)
        {
            rdata[i * cols + j] = rand() * 0.01f;
        }
    }
    for (int i = 0; i < qsize; ++i)
    {
        for (int j = 0; j < cols; ++j)
        {
            qdata[i * cols + j] = rand() * 0.01f;
            printf("%d %f\n", i * cols + j, qdata[i * cols + j]);
        }
    }
    // 初始化
    flann::Matrix<float> dataset(rdata, rows, cols);
    flann::Matrix<float> query(qdata, qsize, cols);
    flann::Matrix<int> indices(new int[query.rows * nn], query.rows, nn);
    flann::Matrix<float> dists(new float[query.rows * nn], query.rows, nn);
    // construct an randomized kd-tree index using 4 kd-trees
    flann::Index<flann::L2<float> > index(dataset, flann::KDTreeIndexParams(4));
    index.buildIndex();
    printf("index.knnSearch\n");
    // do a knn search, using 128 checks
    index.knnSearch(query, indices, dists, nn, flann::SearchParams(128));
    for (int i = 0; i < query.rows; ++i)
    {
        for (int j = 0; j < nn; ++j)
        {
            int idx = indices[i][j];
            printf("index:%d distance:%f position:(%f, %f, %f)\n",
                   idx, dists[i][j], rdata[idx * cols], rdata[idx * cols + 1],
                   rdata[idx * cols + 2]);
        }
    }
    delete[] dataset.ptr();
    delete[] query.ptr();
    delete[] indices.ptr();
    delete[] dists.ptr();
    return 0;
}
(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(487)

  • 個人分類:程式問題解決
▲top
  • 10月 02 週三 201317:01
  • mingw 的library在msvc有error LNK2001怎麼辨?

error LNK2001: unresolved external symbol __imp__stricmp
去把 _mingw.h 裡面的
#      define _CRTIMP  __attribute__ ((__dllimport__))
改成
#      define _CRTIMP  //__attribute__ ((__dllimport__))
再重編 library 即可。
(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(33)

  • 個人分類:程式問題解決
▲top
  • 9月 29 週日 201309:50
  • Wt web c++ toolkit 用c++寫網頁


基本上這個東西沒有很紅,
我個人覺得有幾個原因:
一.架設與維護人員訓練耗時
要找精通 c++ & javascript & css & (ajax | html5 | flash)的人
你是要殺人喔?
二.網站製作時間相對較長、成本較高
語言本身的難度、編譯的時間、溝通的時間、debug的時間
三.要錢而且很貴
599美金,跟一個microchip編譯器一樣貴。
四.沒有人幫他寫framework跟plugin
不像 wordpress 一樣,掛一掛就解一半的問題~
(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(1,149)

  • 個人分類:程式問題解決
▲top
  • 8月 30 週五 201300:11
  • use visual studio 2008&2012 with clang 3.3


因為新版的 visual studio 不能新增建置規則,
所以從舊版開始,再自動轉換上去。

加入 clang 規則檔
(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(59)

  • 個人分類:程式問題解決
▲top
  • 6月 12 週三 201323:33
  • visual studio 有時方案目錄會錯亂的問題

把 sln 旁邊的 .user 砍掉! 解決!
(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(19)

  • 個人分類:程式問題解決
▲top
  • 5月 08 週三 201313:08
  • 今天看到 nuget 原來已經有 c++ library 了!

參考以下文章:
http://blogs.msdn.com/b/vcblog/archive/2013/04/26/nuget-for-c.aspx
http://blogs.technet.com/b/openness/archive/2013/04/26/nuget-coapp-release.aspx
https://nuget.org/profiles/coapp/
有機會的話真想跟該作者合作,把常用的 library 都推上 nuget 。
(繼續閱讀...)
文章標籤

讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(43)

  • 個人分類:程式問題解決
▲top
12...9»

道大落星級超

讓地獄深紅的天亮
暱稱:
讓地獄深紅的天亮
分類:
數位生活
好友:
累積中
地區:

參觀人氣

  • 本日人氣:
  • 累積人氣:

表整彙章文

表列章文

  • git 在非空資料夾拉東西下來
  • 打信長啦
  • boost 太大了 我只用到一小部份怎麼辨
  • evernote的未來?
  • OpenMesh與UE4的衝突
  • Unreal 加入自定義Asset
  • AutoShortURL 小工具
  • 目前編譯的library改放這
  • ue4 add opencv to thirdparty
  • Emscripten with CMake

類別分明

  • 教學? (6)
  • 生活經驗 (27)
  • 謙卑 (1)
  • 書透book review (2)
  • dotNet (1)
  • powershell (3)
  • 台科專題的VTK之nmea探險 (7)
  • 打工記事 (0)
  • wxdigets (4)
  • 遊戲製作 (24)
  • 屏東生活 (2)
  • 生涯規劃 (2)
  • Java (0)
  • 回憶 (11)
  • 痛 (11)
  • 台科生活 (75)
  • 恥 (6)
  • 程式問題解決 (87)
  • Flash ActionScript3 (2)
  • Flex3 (0)
  • javascript (1)
  • 角色設定 (2)
  • VB2008 (4)
  • 生活記要 (23)
  • 程設心得 (48)
  • 升學相關 (20)
  • VB6 (19)
  • VB2005 (6)
  • 各種C++(CMD.EXE中) (43)
  • 各種視窗介面的C++ (17)
  • 動畫心得 (22)
  • 未分類文章 (1)

我去誰家

誰來我家

動態訂閱